Commit 227aa1e9 authored by Naumann, Andreas's avatar Naumann, Andreas

adapted amdis configuration to cholmod,colamd and acml

parent 5f0d2ca0
......@@ -25,9 +25,9 @@
#and library directories.
################## ONLY WORKAROUND AND WARNING ###################
if(NOT "$ENV{LIBRARY_PATH}" STREQUAL "")
message(WARNING "the environment variable LIBRARY_PATH is set. this can lead to problems during linking. \n You can unset it in your CMakeLists.txt with the command unset(ENV{LIBRARY_PATH}).\n")
endif()
#if(NOT "$ENV{LIBRARY_PATH}" STREQUAL "")
# message(WARNING "the environment variable LIBRARY_PATH is set. this can lead to problems during linking. \n You can unset it in your CMakeLists.txt with the command unset(ENV{LIBRARY_PATH}).\n")
#endif()
##################################################################
#try to detect the AMDiS include directory
find_file(_AMDIS_H AMDiS.h PATHS ${AMDIS_INCLUDE_DIR} ${AMDIS_DIR}/../../include/amdis/ /usr/include/amdis/)
......@@ -73,7 +73,6 @@ set(AMDIS_MINOR_VERSION @AMDIS_MINOR@)
if(AMDIS_NEED_UMFPACK)
set(AMDIS_UMFPACK_PATH @UMFPACK_PATH@)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_UMFPACK_PATH})
find_library(UMFPACK_LIB umfpack
HINTS ENV LIBRARY_PATH
DOC "The UMFPACK library")
......@@ -82,16 +81,24 @@ if(AMDIS_NEED_UMFPACK)
else()
message(FATAL_ERROR "Could not find the UMFPACK library")
endif()
find_library(BLAS_LIBRARY NAMES "blas" "goto" "mkl"
if("$ENV{BLA_VENDOR}" STREQUAL "ACML")
find_library(ACML_LIBRARY acml HINTS ENV ACML_LIB)
if(ACML_LIBRARY)
list(APPEND AMDIS_LIBRARIES ${ACML_LIBRARY} fortran ffio m rt) #needed on atlas..
else()
message(FATAL_ERROR "could not find the acml libraries, required by acml blas")
endif(ACML_LIBRARY)
else()
find_library(BLAS_LIBRARY NAMES "blas" "goto" "mkl"
HINTS ENV MKL_LIB
DOC "The BLAS library")
if(BLAS_LIBRARY)
if(BLAS_LIBRARY)
list(APPEND AMDIS_LIBRARIES ${BLAS_LIBRARY})
list(APPEND AMDIS_LIBRARY_DIRS ${BLAS_LIBRARY_DIR})
else()
else()
message(ERROR "Could not find the BLAS library. Please set the variable BLAS_LIBRARY to the blas library with full path")
endif()
endif()
endif("$ENV{BLA_VENDOR}" STREQUAL "ACML")
find_library(AMD_LIB amd
HINTS ENV LIBRARY_PATH
......@@ -101,6 +108,32 @@ if(AMDIS_NEED_UMFPACK)
else()
message(FATAL_ERROR "Could not find the AMD library.")
endif()
#check for if we need cholmod
set(_CHOLMOD_TEST_DIR ${CMAKE_BINARY_DIR}/CMakeFiles/cholmodTest/)
file(WRITE ${_CHOLMOD_TEST_DIR}/CMakeLists.txt "project(cholmodTest)
cmake_minimum_required(VERSION 2.8)
include_directories(${AMDIS_INCLUDE_DIRS})
add_executable(cholmodTest cholmodTest.cpp)
target_link_libraries(cholmodTest ${AMDIS_LIBRARIES})")
file(WRITE ${_CHOLMOD_TEST_DIR}/cholmodTest.cpp "#include <umfpack.h>
int main(int , char* argv[]) { double c[UMFPACK_CONTROL]; umfpack_dl_defaults(c); return 0;}")
try_compile(CHOLMOD_TEST ${_CHOLMOD_TEST_DIR}/build ${_CHOLMOD_TEST_DIR} cholmodTest
OUTPUT_VARIABLE CHOLMOD_OUT)
if(NOT CHOLMOD_TEST)
find_library(CHOLMOD_LIB cholmod)
if(CHOLMOD_LIB)
list(APPEND AMDIS_LIBRARIES ${CHOLMOD_LIB})
else()
message(FATAL_ERROR "your umfpack seems to need cholmod, but cmake could not find it")
endif()
find_library(COLAMD_LIB colamd)
if(COLAMD_LIB)
list(APPEND AMDIS_LIBRARIES ${COLAMD_LIB})
else()
message(FATAL_ERROR "your umfpack seems to need colamd, but cmake could not find it")
endif()
endif()
endif(AMDIS_NEED_UMFPACK)
if(AMDIS_NEED_PNG)
......
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