Skip to content

Commit

Permalink
umfpack related changes to Makefiles and CMake scripts
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@22095 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Michael Kloeppel committed Sep 2, 2014
1 parent 5867ce3 commit c28f099
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 64 deletions.
35 changes: 18 additions & 17 deletions Makefile.common
Expand Up @@ -113,23 +113,24 @@ build/lib/omc/libipopt.la: 3rdParty/Ipopt-3.11.6/Makefile
test ! `uname` = Darwin || install_name_tool -id @rpath/libcoinmumps.1.4.11.dylib 3rdParty/Ipopt-3.11.6/lib/libcoinmumps.1.4.11.dylib
cp -a 3rdParty/Ipopt-3.11.6/lib*/*.* build/lib/omc

ipopt: build/lib/omc/libipopt.la

build/lib/omc/libumfpack.a: 3rdParty/SuiteSparse/UMFPACK/Makefile
$(MAKE) -C 3rdParty/SuiteSparse/UMFPACK
cp -a 3rdParty/SuiteSparse/UMFPACK/Lib/*.a build/lib/omc
cp -a 3rdParty/SuiteSparse/AMD/Lib/*.a build/lib/omc
mkdir --parent build/include/omc/c/suitesparse
cp -a 3rdParty/SuiteSparse/UMFPACK/Include/*.h build/include/omc/c/suitesparse
cp -a 3rdParty/SuiteSparse/AMD/Include/*.h build/include/omc/c/suitesparse
cp -a 3rdParty/SuiteSparse/UFconfig/*.h build/include/omc/c/suitesparse
umfpack: build/lib/omc/libumfpack.a

umfpack-clean:
cd 3rdParty/SuiteSparse/UMFPACK && make clean && make purge
rm -rf build/include/omc/c/suitesparse
rm -f build/lib/omc/libumfpack.a
rm -f build/lib/omc/libamd.a
ipopt: build/lib/omc/libipopt.la

build/lib/omc/libumfpack.a: 3rdParty/SuiteSparse/UMFPACK/Makefile
mkdir -p 3rdParty/SuiteSparse/build
cd 3rdParty/SuiteSparse/build && $(CMAKE) .. -G $(CMAKE_TARGET) -DCMAKE_INSTALL_PREFIX:PATH="../../../build"
$(MAKE) -C 3rdParty/SuiteSparse/build install
#cp -au 3rdParty/SuiteSparse/build/*.$(STATIC_EXT) build/lib/omc
#mkdir --parent build/include/omc/c/suitesparse
#cp -a 3rdParty/SuiteSparse/UMFPACK/Include/*.h build/include/omc/c/suitesparse
#cp -a 3rdParty/SuiteSparse/AMD/Include/*.h build/include/omc/c/suitesparse
#cp -a 3rdParty/SuiteSparse/UFconfig/*.h build/include/omc/c/suitesparse
umfpack: build/lib/omc/libumfpack.a

umfpack-clean:
cd 3rdParty/SuiteSparse/build && make clean
rm -rf build/include/omc/c/suitesparse
rm -f build/lib/omc/libumfpack.a
rm -f build/lib/omc/libamd.a

build/lib/omc/libopenblas_openmodelica.a:
$(MAKE) -C 3rdParty/OpenBLAS-0.2.8 CC="$(CC)" CXX="$(CXX)" FC="$(FC)" USE_THREAD=0 NO_LAPACKE=1 LIBNAMESUFFIX=openmodelica $(OPENBLAS_EXTRA_ARGS)
Expand Down
94 changes: 47 additions & 47 deletions SimulationRuntime/cpp/Solver/UmfPack/SuiteSparseConfig.cmake
@@ -1,47 +1,47 @@
set(SuiteSparse_found true)
message(STATUS "Searching for UmfPack")
find_file(UMFPACK_H umfpack.h HINTS "${CMAKE_SOURCE_DIR}/../../build/include/omc/c/suitesparse")
if(UMFPACK_H)
get_filename_component(UMFPACK_INCLUDE_DIRS "${UMFPACK_H}" PATH)
message(STATUS "${UMFPACK_H}")
else()
message(STATUS "umfpack.h not found")
set(SuiteSparse_found false)
endif()
find_library(UMFPACK_LIB umfpack
HINTS "${CMAKE_SOURCE_DIR}/../../build/lib/omc"
NO_DEFAULT_PATH
DOC "The UMFPACK library")
if(UMFPACK_LIB)
list(APPEND SUITESPARSE_LIBRARIES ${UMFPACK_LIB})
else()
message(STATUS "Could not find the UMFPACK library")
set(SuiteSparse_found false)
endif()

find_package(BLAS)
if(BLAS_FOUND)
list(APPEND SUITESPARSE_LIBRARIES ${BLAS_LIBRARIES})
else()
message(STATUS "Could not find the BLAS library. Please set the variable BLAS_LIBRARY to the blas library with full path")
endif()


find_library(AMD_LIB amd
HINTS "${CMAKE_SOURCE_DIR}/../../build/lib/omc"
NO_DEFAULT_PATH
DOC "The AMD library")
if(AMD_LIB)
list(APPEND SUITESPARSE_LIBRARIES ${AMD_LIB})
else()
message("Could not find the AMD library.")
set(SuiteSparse_found false)
endif()

find_file(UFCONFIG_H UFconfig.h HINTS "${CMAKE_SOURCE_DIR}/../../build/include/omc/c/suitesparse")
if(UFCONFIG_H)
get_filename_component(SUITESPARSE_INCLUDE_DIRS "${UFCONFIG_H}" PATH)
else()
message(STATUS "UFconfig.h not found")
set(SuiteSparse_found false)
endif()
set(SuiteSparse_found true)
message(STATUS "Searching for UmfPack")
find_file(UMFPACK_H umfpack.h HINTS "${CMAKE_SOURCE_DIR}/../../build/include/omc/c/suitesparse/Include")
if(UMFPACK_H)
get_filename_component(UMFPACK_INCLUDE_DIRS "${UMFPACK_H}" PATH)
message(STATUS "${UMFPACK_H}")
else()
message(STATUS "umfpack.h not found")
set(SuiteSparse_found false)
endif()
find_library(UMFPACK_LIB umfpack
HINTS "${CMAKE_SOURCE_DIR}/../../build/lib/omc"
NO_DEFAULT_PATH
DOC "The UMFPACK library")
if(UMFPACK_LIB)
list(APPEND SUITESPARSE_LIBRARIES ${UMFPACK_LIB})
else()
message(STATUS "Could not find the UMFPACK library")
set(SuiteSparse_found false)
endif()

find_package(BLAS)
if(BLAS_FOUND)
list(APPEND SUITESPARSE_LIBRARIES ${BLAS_LIBRARIES})
else()
message(STATUS "Could not find the BLAS library. Please set the variable BLAS_LIBRARY to the blas library with full path")
endif()


find_library(AMD_LIB amd
HINTS "${CMAKE_SOURCE_DIR}/../../build/lib/omc"
NO_DEFAULT_PATH
DOC "The AMD library")
if(AMD_LIB)
list(APPEND SUITESPARSE_LIBRARIES ${AMD_LIB})
else()
message("Could not find the AMD library.")
set(SuiteSparse_found false)
endif()

find_file(UFCONFIG_H UFconfig.h HINTS "${CMAKE_SOURCE_DIR}/../../build/include/omc/c/suitesparse/Include")
if(UFCONFIG_H)
get_filename_component(SUITESPARSE_INCLUDE_DIRS "${UFCONFIG_H}" PATH)
else()
message(STATUS "UFconfig.h not found")
set(SuiteSparse_found false)
endif()

0 comments on commit c28f099

Please sign in to comment.