Commit b4bb0b6f authored by Praetorius, Simon's avatar Praetorius, Simon

corrected search for umfpack library files

parent 8aa43b17
......@@ -78,7 +78,7 @@ target_enable_boost(amdis_base INTERFACE ON)
# --------------------
if (AMDIS_NEED_UMFPACK)
set(AMDIS_SuiteSparse_DIR @SuiteSparse_DIR@)
set(AMDIS_UMFPACK_ROOT_DIR @UMFPACK_INCLUDE_DIRS@/..)
set(AMDIS_UMFPACK_ROOT_DIR @UMFPACK_ROOT_DIR@)
target_enable_umfpack(amdis_base INTERFACE ON)
endif (AMDIS_NEED_UMFPACK)
......
......@@ -26,12 +26,13 @@ macro(target_enable_umfpack _TARGET_ _SCOPE_)
else (SuiteSparse_FOUND)
# find umfpack manually by searching for umfpack.h header file
find_library(UMFPACK_LIBRARY umfpack
HINTS ${AMDIS_UMFPACK_ROOT_DIR}
PATH_PREFIXES lib lib64
HINTS ${AMDIS_UMFPACK_ROOT_DIR}
PATHS $ENV{EBROOTSUITESPARSE}
PATH_SUFFIXES lib/ lib64/
DOC "Library file for UMFPACK")
find_file(UMFPACK_H umfpack.h
HINTS ${AMDIS_UMFPACK_ROOT_DIR}/include
PATHS /usr/include/suitesparse /usr/include/ufsparse
HINTS ${AMDIS_UMFPACK_ROOT_DIR}/include
PATHS /usr/include/suitesparse /usr/include/ufsparse $ENV{EBROOTSUITESPARSE}/include
DOC "Headerfile umfpack.h for UMFPACK")
if (UMFPACK_H AND UMFPACK_LIBRARY)
......@@ -41,6 +42,12 @@ macro(target_enable_umfpack _TARGET_ _SCOPE_)
get_filename_component(UMFPACK_LIB_PATH ${UMFPACK_LIBRARY} PATH)
set(FOUND_SUITESPARSE_LIBS ${UMFPACK_LIBRARY})
# extract root directory from umfpack lib dir
set (UMFPACK_ROOT_DIR ${UMFPACK_LIB_PATH}/..)
if (NOT EXISTS ${UMFPACK_ROOT_DIR}/include)
message(WARNING "directory ${UMFPACK_ROOT_DIR} is not a valid root dir of an umfpack installation.")
endif ()
if (LINK_EXECUTABLE OR APPLE)
# find all connected libraries
......@@ -74,7 +81,12 @@ macro(target_enable_umfpack _TARGET_ _SCOPE_)
target_link_libraries(${_TARGET_} ${_SCOPE_} ${FOUND_SUITESPARSE_LIBS})
endif (LINK_EXECUTABLE OR APPLE)
else()
message(FATAL_ERROR "Could not find the UMFPACK header umfpack.h.")
if (NOT UMFPACK_H)
message(FATAL_ERROR "Could not find the UMFPACK header umfpack.h.")
endif ()
if (NOT UMFPACK_LIBRARY)
message(FATAL_ERROR "Could not find the UMFPACK library libumfpack.so")
endif ()
endif (UMFPACK_H AND UMFPACK_LIBRARY)
endif (SuiteSparse_FOUND)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment