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

petsc configuration with more than one petsc-library

parent 869dbce6
No related branches found
No related tags found
No related merge requests found
...@@ -41,7 +41,7 @@ find_library(_AMDiS_LIB amdis PATHS ${AMDiS_LIBRARY_DIR} ${AMDiS_DIR}/../../lib/ ...@@ -41,7 +41,7 @@ find_library(_AMDiS_LIB amdis PATHS ${AMDiS_LIBRARY_DIR} ${AMDiS_DIR}/../../lib/
if(_AMDiS_LIB) if(_AMDiS_LIB)
get_filename_component(AMDiS_LIBRARY_DIR ${_AMDiS_LIB} PATH CACHE) get_filename_component(AMDiS_LIBRARY_DIR ${_AMDiS_LIB} PATH CACHE)
set(AMDiS_LIBRARY_DIRS ${AMDiS_LIBRARY_DIR}) set(AMDiS_LIBRARY_DIRS ${AMDiS_LIBRARY_DIR})
set(AMDiS_LIBRARIES amdis compositeFEM) set(AMDiS_LIBRARIES "${_AMDiS_LIB};${AMDiS_LIBRARY_DIR}/libcompositeFEM.so" CACHE STRING "amdis libraries")
else() else()
message(ERROR "could not detect the AMDiS library directory. Please set the variable AMDiS_LIBRARY_DIR to the directory containg the AMDiS library") message(ERROR "could not detect the AMDiS library directory. Please set the variable AMDiS_LIBRARY_DIR to the directory containg the AMDiS library")
endif() endif()
...@@ -60,16 +60,22 @@ set(AMDiS_NEED_UMFPACK @ENABLE_UMFPACK@) ...@@ -60,16 +60,22 @@ set(AMDiS_NEED_UMFPACK @ENABLE_UMFPACK@)
set(AMDiS_NEED_MKL @ENABLE_MKL@) set(AMDiS_NEED_MKL @ENABLE_MKL@)
set(AMDiS_USE_FILE ${AMDiS_DIR}/AMDiSUse.cmake) set(AMDiS_USE_FILE ${AMDiS_DIR}/AMDiSUse.cmake)
set(AMDiS_COMPILEFLAGS "@COMPILEFLAGS@") set(AMDiS_COMPILEFLAGS "@COMPILEFLAGS@")
message("find-components: ${AMDiS_FIND_COMPONENTS}")
if(AMDiS_NEED_UMFPACK) if(AMDiS_NEED_UMFPACK)
set(BLAS_LIBRARY_DIR "" CACHE PATH "the blas library directory") set(BLAS_LIBRARY_DIR "" CACHE PATH "the blas library directory")
set(BLAS_LIBRARY "blas" CACHE STRING "the blas library") if(NOT BLAS_LIBRARY)
set(BLAS_LIBRARY "blas" CACHE STRING "the blas library")
endif(NOT BLAS_LIBRARY)
find_library(_BLAS_LIB ${BLAS_LIBRARY} PATHS ${BLAS_LIBRARY_DIR}) find_library(_BLAS_LIB ${BLAS_LIBRARY} PATHS ${BLAS_LIBRARY_DIR})
if(NOT _BLAS_LIB)
if(EXISTS ${BLAS_LIBRARY})
set(_BLAS_LIB ${BLAS_LIBRARY})
endif()
endif(NOT _BLAS_LIB)
if(NOT _BLAS_LIB) if(NOT _BLAS_LIB)
message(ERROR "could not find the blas library. please set the variables BLAS_LIBRARY_DIR and BLAS_LIBRARY") message(ERROR "could not find the blas library. please set the variables BLAS_LIBRARY_DIR and BLAS_LIBRARY")
endif() endif()
list(APPEND AMDiS_LIBRARIES umfpack amd ${BLAS_LIBRARY}) list(APPEND AMDiS_LIBRARIES ${AMDiS_LIBRARY_DIR}/umfpack/libumfpack.a ${AMDiS_LIBRARY_DIR}/amd/libamd.a ${BLAS_LIBRARY})
list(APPEND AMDiS_LIBRARY_DIRS ${AMDiS_LIBRARY_DIR}/umfpack ${AMDiS_LIBRARY_DIR}/amd ${BLAS_LIBRARY_DIR}) list(APPEND AMDiS_LIBRARY_DIRS ${AMDiS_LIBRARY_DIR}/umfpack ${AMDiS_LIBRARY_DIR}/amd ${BLAS_LIBRARY_DIR})
list(APPEND AMDiS_INCLUDE_DIRS list(APPEND AMDiS_INCLUDE_DIRS
${AMDiS_INCLUDE_DIR}/umfpack ${AMDiS_INCLUDE_DIR}/umfpack
...@@ -80,9 +86,7 @@ if(AMDiS_NEED_UMFPACK) ...@@ -80,9 +86,7 @@ if(AMDiS_NEED_UMFPACK)
endif(AMDiS_NEED_UMFPACK) endif(AMDiS_NEED_UMFPACK)
if(${AMDiS_FIND_COMPONENTS} MATCHES umfpack ) if(${AMDiS_FIND_COMPONENTS} MATCHES umfpack )
if( AMDiS_NEED_UMFPACK ) if( NOT AMDiS_NEED_UMFPACK )
list(APPEND AMDiS_LIBRARIES umfpack blas)
else()
set( AMDiS_umfpack_FOUND FALSE) set( AMDiS_umfpack_FOUND FALSE)
message(SEND_ERROR "the selected amdis was not compiled with umfpack") message(SEND_ERROR "the selected amdis was not compiled with umfpack")
endif() endif()
...@@ -90,7 +94,7 @@ endif() ...@@ -90,7 +94,7 @@ endif()
if( AMDiS_NEED_PARMETIS ) if( AMDiS_NEED_PARMETIS )
list(APPEND AMDiS_LIBRARY_DIRS ${AMDiS_LIBRARY_DIR}/parmetis) list(APPEND AMDiS_LIBRARY_DIRS ${AMDiS_LIBRARY_DIR}/parmetis)
list(APPEND AMDiS_LIBRARIES parmetis metis) list(APPEND AMDiS_LIBRARIES ${AMDiS_LIBRARY_DIR}/parmetis/libparmetis.a ${AMDiS_LIBRARY_DIR}/parmetis/libmetis.a)
endif() endif()
if(${AMDiS_FIND_COMPONENTS} MATCHES parmetis AND NOT AMDiS_NEED_PARMETIS) if(${AMDiS_FIND_COMPONENTS} MATCHES parmetis AND NOT AMDiS_NEED_PARMETIS)
......
...@@ -10,15 +10,15 @@ if(AMDiS_HAS_PARALLEL_DOMAIN) ...@@ -10,15 +10,15 @@ if(AMDiS_HAS_PARALLEL_DOMAIN)
CMAKE_FORCE_C_COMPILER(mpicc "The MPI C Compiler") CMAKE_FORCE_C_COMPILER(mpicc "The MPI C Compiler")
endif(MPI_FOUND) endif(MPI_FOUND)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${AMDiS_DIR}) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${AMDiS_DIR})
set(PETSC_EXECUTABLE_RUNS ON)
find_package(PETSc REQUIRED) find_package(PETSc REQUIRED)
if(PETSC_FOUND) if(PETSC_FOUND)
list(APPEND AMDiS_LIBRARIES ${PETSC_LIBRARIES}) list(APPEND AMDiS_LIBRARIES ${PETSC_LIBRARY_SYS} ${PETSC_LIBRARIES})
list(APPEND AMDiS_INCLUDE_DIRS ${PETSC_INCLUDES}) list(APPEND AMDiS_INCLUDE_DIRS ${PETSC_INCLUDES})
endif(PETSC_FOUND) endif(PETSC_FOUND)
endif(NOT AMDiS_NEED_PARMETIS) endif(NOT AMDiS_NEED_PARMETIS)
endif(AMDiS_HAS_PARALLEL_DOMAIN) endif(AMDiS_HAS_PARALLEL_DOMAIN)
#thats bad because it affects each target #thats bad because it affects each target
add_definitions(${AMDiS_COMPILEFLAGS}) add_definitions(${AMDiS_COMPILEFLAGS})
link_directories(${AMDiS_LIBRARY_DIRS})
include_directories(${AMDiS_INCLUDE_DIRS}) include_directories(${AMDiS_INCLUDE_DIRS})
...@@ -171,6 +171,7 @@ if(ENABLE_PARALLEL_DOMAIN) ...@@ -171,6 +171,7 @@ if(ENABLE_PARALLEL_DOMAIN)
) )
set(ENABLE_PARMETIS ON) set(ENABLE_PARMETIS ON)
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};/usr/share/cmake-2.8/Modules/;${CMAKE_SOURCE_DIR}/") set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};/usr/share/cmake-2.8/Modules/;${CMAKE_SOURCE_DIR}/")
set(PETSC_EXECUTABLE_RUNS ON)
find_package(PETSc REQUIRED) find_package(PETSc REQUIRED)
include_directories(${PETSC_DIR}/include ${PETSC_DIR}/${PETSC_ARCH}/include) include_directories(${PETSC_DIR}/include ${PETSC_DIR}/${PETSC_ARCH}/include)
SET(PARALLEL_DOMAIN_AMDIS_SRC SET(PARALLEL_DOMAIN_AMDIS_SRC
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment