Skip to content
Snippets Groups Projects
Commit 28eb4386 authored by Naumann, Andreas's avatar Naumann, Andreas
Browse files

looking for umfpack (+amd,ufconfig), dont compile it any more

parent 6c170ae4
No related branches found
No related tags found
No related merge requests found
......@@ -47,7 +47,7 @@ else()
endif()
unset(_AMDIS_LIB CACHE)
find_package(Boost 1.42 REQUIRED system iostreams)
find_package(Boost 1.42 REQUIRED system iostreams filesystem)
if(Boost_FOUND)
list(APPEND AMDIS_LIBRARIES ${Boost_LIBRARIES})
list(APPEND AMDIS_LIBRARY_DIRS ${Boost_LIBRARY_DIRS})
......@@ -63,20 +63,63 @@ set(AMDIS_USE_FILE ${AMDIS_DIR}/AMDiSUse.cmake)
set(AMDiS_COMPILEFLAGS "@COMPILEFLAGS@")
if(AMDiS_NEED_UMFPACK)
find_library(BLAS_LIBRARY NAMES "blas" "goto")
#look for umfpack, we need the headers only
find_file(UMFPACK_H umfpack.h
HINTS /usr/include /usr/include/suitesparse
DOC "headerfile umfpack.h for UMFPACK")
if( UMFPACK_H )
#construct the include path
get_filename_component(UMFPACK_PATH ${UMFPACK_H} PATH)
#look for ufconfig
find_file(UFCONFIG_H UFconfig.h
HINTS /usr/include ${UMFPACK_PATH}
DOC "headerfile UFConfig.h")
if( UFCONFIG_H )
get_filename_component(UFCONFIG_PATH ${UFCONFIG_H} PATH)
else()
message(FATAL_ERROR "could not find UFConfig.h, needed for umfpack")
endif()
#look for amd
find_file(AMD_H amd.h
HINTS /usr/include/ ${UMFPACK_PATH}
DOC "headerfile amd.h")
if( AMD_H )
get_filename_component(AMD_PATH ${AMD_H} PATH)
else()
message( FATAL_ERROR "could not find amd.h, needed for umfpack")
endif()
#add the compileflags and directories
list(APPEND AMDIS_INCLUDE_DIRS ${UMFPACK_PATH} ${UFCONFIG_PATH} ${AMD_PATH})
else()
message(FATAL_ERROR "Could not find the umfpack-headers. Please install umfpack")
endif()
find_library(BLAS_LIBRARY NAMES "blas" "goto"
DOC "the blas library")
# message("blaslibrary: ${BLAS_LIBRARY}")
if(NOT BLAS_LIBRARY)
if( BLAS_LIBRARY )
list(APPEND AMDIS_LIBRARIES ${BLAS_LIBRARY})
else()
message(ERROR " could not find the blas library. please set the variable BLAS_LIBRARY to the blas library with full path")
endif()
list(APPEND AMDIS_LIBRARIES ${AMDIS_LIBRARY_DIR}/umfpack/libumfpack.a ${AMDIS_LIBRARY_DIR}/amd/libamd.a ${BLAS_LIBRARY})
#message("amdis-libs: ${AMDIS_LIBRARIES}")
list(APPEND AMDIS_LIBRARY_DIRS ${AMDIS_LIBRARY_DIR}/umfpack ${AMDIS_LIBRARY_DIR}/amd ${BLAS_LIBRARY_DIR})
list(APPEND AMDIS_INCLUDE_DIRS
${AMDIS_INCLUDE_DIR}/umfpack
${AMDIS_INCLUDE_DIR}/amd
${AMDIS_INCLUDE_DIR}/ufconfig
${AMDIS_INCLUDE_DIR}/ufconfig/xerbla
)
find_library(UMFPACK_LIB umfpack
DOC "the UMFPACK library")
if( UMFPACK_LIB )
list(APPEND AMDIS_LIBRARIES ${UMFPACK_LIB})
else()
message(FATAL_ERROR "Did not find the umfpack library")
endif()
find_library(AMD_LIB amd
DOC "the AMD library")
if( AMD_LIB )
list(APPEND AMDIS_LIBRARIES ${AMD_LIB})
else()
message(FATAL_ERROR "Did not find the amd library")
endif()
#message("amdis-libs: ${AMDIS_LIBRARIES}")
list(APPEND AMDIS_LIBRARY_DIRS ${BLAS_LIBRARY_DIR})
endif(AMDiS_NEED_UMFPACK)
if(${AMDIS_FIND_COMPONENTS} MATCHES umfpack )
......
......@@ -213,49 +213,79 @@ if(ENABLE_PARALLEL_DOMAIN)
endif(ENABLE_PARALLEL_DOMAIN)
if(ENABLE_UMFPACK)
include_directories(${LIB_DIR}/UFconfig ${LIB_DIR}/AMD/Include ${LIB_DIR}/UMFPACK/Include)
SET(COMPILEFLAGS "${COMPILEFLAGS} -DHAVE_UMFPACK=1 -DMTL_HAS_UMFPACK")
FILE(GLOB UMFPACK_HEADERS "${LIB_DIR}/UMFPACK/Include/*.h")
INSTALL(FILES ${UMFPACK_HEADERS}
DESTINATION include/amdis/umfpack/)
list(APPEND deb_add_dirs "include/amdis/umfpack")
FILE(GLOB UMFPACK_HEADERS "${LIB_DIR}/AMD/Include/*.h")
INSTALL(FILES ${UMFPACK_HEADERS}
DESTINATION include/amdis/amd/)
list(APPEND deb_add_dirs "include/amdis/amd")
FILE(GLOB HEADERS "${LIB_DIR}/UFconfig/*.h")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/ufconfig/)
list(APPEND deb_add_dirs "include/amdis/ufconfig")
FILE(GLOB HEADERS "${LIB_DIR}/UFconfig/xerbla/*.h")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/ufconfig/xerbla)
list(APPEND deb_add_dirs "include/amdis/ufconfig/xerbla")
# include_directories(${LIB_DIR}/UFconfig ${LIB_DIR}/AMD/Include ${LIB_DIR}/UMFPACK/Include)
# FILE(GLOB UMFPACK_HEADERS "${LIB_DIR}/UMFPACK/Include/*.h")
# INSTALL(FILES ${UMFPACK_HEADERS}
# DESTINATION include/amdis/umfpack/)
# list(APPEND deb_add_dirs "include/amdis/umfpack")
# FILE(GLOB UMFPACK_HEADERS "${LIB_DIR}/AMD/Include/*.h")
# INSTALL(FILES ${UMFPACK_HEADERS}
# DESTINATION include/amdis/amd/)
# list(APPEND deb_add_dirs "include/amdis/amd")
# FILE(GLOB HEADERS "${LIB_DIR}/UFconfig/*.h")
# INSTALL(FILES ${HEADERS}
# DESTINATION include/amdis/ufconfig/)
# list(APPEND deb_add_dirs "include/amdis/ufconfig")
# FILE(GLOB HEADERS "${LIB_DIR}/UFconfig/xerbla/*.h")
# INSTALL(FILES ${HEADERS}
# DESTINATION include/amdis/ufconfig/xerbla)
# list(APPEND deb_add_dirs "include/amdis/ufconfig/xerbla")
#add some rules to build the umfpack and amd libs
# message("adding command for libumfpack:${CMAKE_CURRENT_SOURCE_DIR}/${LIB_DIR}/UMFPACK/Lib/libumfpack.a ")
add_custom_target(umfpack-lib ALL
make
WORKING_DIRECTORY ${LIB_DIR}/UMFPACK
)
add_custom_target(amd-lib ALL
make
WORKING_DIRECTORY ${LIB_DIR}/AMD
)
INSTALL(FILES ${LIB_DIR}/UMFPACK/Lib/libumfpack.a
DESTINATION lib/amdis/umfpack/)
list(APPEND deb_add_dirs "lib/amdis/umfpack")
INSTALL(FILES ${LIB_DIR}/AMD/Lib/libamd.a
DESTINATION lib/amdis/amd/)
list(APPEND deb_add_dirs "lib/amdis/amd")
# add_custom_target(umfpack-lib ALL
# make
# WORKING_DIRECTORY ${LIB_DIR}/UMFPACK
# )
# add_custom_target(amd-lib ALL
# make
# WORKING_DIRECTORY ${LIB_DIR}/AMD
# )
# INSTALL(FILES ${LIB_DIR}/UMFPACK/Lib/libumfpack.a
# DESTINATION lib/amdis/umfpack/)
# list(APPEND deb_add_dirs "lib/amdis/umfpack")
# INSTALL(FILES ${LIB_DIR}/AMD/Lib/libamd.a
# DESTINATION lib/amdis/amd/)
# list(APPEND deb_add_dirs "lib/amdis/amd")
#look for umfpack, we need the headers only
find_file(UMFPACK_H umfpack.h
HINTS /usr/include /usr/include/suitesparse
DOC "headerfile umfpack.h for UMFPACK")
if( UMFPACK_H )
#construct the include path
get_filename_component(UMFPACK_PATH ${UMFPACK_H} PATH)
#look for ufconfig
find_file(UFCONFIG_H UFconfig.h
HINTS /usr/include ${UMFPACK_PATH}
DOC "headerfile UFConfig.h")
if( UFCONFIG_H )
get_filename_component(UFCONFIG_PATH ${UFCONFIG_H} PATH)
else()
message(FATAL_ERROR "could not find UFConfig.h, needed for umfpack")
endif()
#look for amd
find_file(AMD_H amd.h
HINTS /usr/include/ ${UMFPACK_PATH}
DOC "headerfile amd.h")
if( AMD_H )
get_filename_component(AMD_PATH ${AMD_H} PATH)
else()
message( FATAL_ERROR "could not find amd.h, needed for umfpack")
endif()
#add the compileflags and directories
include_directories(${UMFPACK_PATH} ${UFCONFIG_PATH} ${AMD_PATH})
SET(COMPILEFLAGS "${COMPILEFLAGS} -DHAVE_UMFPACK=1 -DMTL_HAS_UMFPACK")
else()
message(FATAL_ERROR "Could not find the umfpack-headers. Please install umfpack")
endif()
SET(RPM_DEPEND_STR "blas")
LIST(APPEND AMDiS_LIBS amdis blas amd umfpack)
endif(ENABLE_UMFPACK)
SET(COMPOSITE_SOURCE_DIR ${SOURCE_DIR}/compositeFEM)
......@@ -281,7 +311,6 @@ add_library(amdis SHARED ${AMDIS_SRC} ${PARALLEL_DOMAIN_AMDIS_SRC})
add_library(compositeFEM SHARED ${COMPOSITE_FEM_SRC})
add_library(reinit STATIC ${REINIT_SRC})
target_link_libraries(compositeFEM amdis)
LIST(APPEND AMDiS_LIBS amdis boost_system boost_iostreams)
if(WIN32)
SET(COMPILEFLAGS "${COMPILEFLAGS} -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS")
......@@ -385,7 +414,7 @@ configure_file(${AMDiS_SOURCE_DIR}/postrm.in
${AMDiS_BINARY_DIR}/postrm
@ONLY)
set(CPACK_RPM_PACKAGE_REQUIRES "boost-devel >= 1.42, ${RPM_DEPEND_STR}")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-dev (>= 1.42), libboost-iostreams-dev (>= 1.42), libboost-system-dev (>= 1.42)")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-dev (>= 1.42), libboost-iostreams-dev (>= 1.42), libboost-system-dev (>= 1.42), libboost-filesystem-dev (>= 1.42)")
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${AMDiS_BINARY_DIR}/preinst" "${AMDiS_BINARY_DIR}/postrm")
include(CPack)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment