From 440f285502a3ddc71f9386cfe4405280fe0a9e9e Mon Sep 17 00:00:00 2001 From: Andreas Naumann <andreas.naumann@tu-dresden.de> Date: Fri, 21 Jan 2011 13:41:13 +0000 Subject: [PATCH] petsc configuration with more than one petsc-library --- AMDiS/AMDiSConfig.cmake.in | 20 ++++++++++++-------- AMDiS/AMDiSUse.cmake | 4 ++-- AMDiS/CMakeLists.txt | 1 + 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/AMDiS/AMDiSConfig.cmake.in b/AMDiS/AMDiSConfig.cmake.in index 0d6f04ac..83c5bdd8 100644 --- a/AMDiS/AMDiSConfig.cmake.in +++ b/AMDiS/AMDiSConfig.cmake.in @@ -41,7 +41,7 @@ find_library(_AMDiS_LIB amdis PATHS ${AMDiS_LIBRARY_DIR} ${AMDiS_DIR}/../../lib/ if(_AMDiS_LIB) get_filename_component(AMDiS_LIBRARY_DIR ${_AMDiS_LIB} PATH CACHE) 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() message(ERROR "could not detect the AMDiS library directory. Please set the variable AMDiS_LIBRARY_DIR to the directory containg the AMDiS library") endif() @@ -60,16 +60,22 @@ set(AMDiS_NEED_UMFPACK @ENABLE_UMFPACK@) set(AMDiS_NEED_MKL @ENABLE_MKL@) set(AMDiS_USE_FILE ${AMDiS_DIR}/AMDiSUse.cmake) set(AMDiS_COMPILEFLAGS "@COMPILEFLAGS@") -message("find-components: ${AMDiS_FIND_COMPONENTS}") if(AMDiS_NEED_UMFPACK) 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}) + if(NOT _BLAS_LIB) + if(EXISTS ${BLAS_LIBRARY}) + set(_BLAS_LIB ${BLAS_LIBRARY}) + endif() + endif(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") 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_INCLUDE_DIRS ${AMDiS_INCLUDE_DIR}/umfpack @@ -80,9 +86,7 @@ if(AMDiS_NEED_UMFPACK) endif(AMDiS_NEED_UMFPACK) if(${AMDiS_FIND_COMPONENTS} MATCHES umfpack ) - if( AMDiS_NEED_UMFPACK ) - list(APPEND AMDiS_LIBRARIES umfpack blas) - else() + if( NOT AMDiS_NEED_UMFPACK ) set( AMDiS_umfpack_FOUND FALSE) message(SEND_ERROR "the selected amdis was not compiled with umfpack") endif() @@ -90,7 +94,7 @@ endif() if( AMDiS_NEED_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() if(${AMDiS_FIND_COMPONENTS} MATCHES parmetis AND NOT AMDiS_NEED_PARMETIS) diff --git a/AMDiS/AMDiSUse.cmake b/AMDiS/AMDiSUse.cmake index 02e454d9..60716e5b 100644 --- a/AMDiS/AMDiSUse.cmake +++ b/AMDiS/AMDiSUse.cmake @@ -10,15 +10,15 @@ if(AMDiS_HAS_PARALLEL_DOMAIN) CMAKE_FORCE_C_COMPILER(mpicc "The MPI C Compiler") endif(MPI_FOUND) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${AMDiS_DIR}) + set(PETSC_EXECUTABLE_RUNS ON) find_package(PETSc REQUIRED) 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}) endif(PETSC_FOUND) endif(NOT AMDiS_NEED_PARMETIS) endif(AMDiS_HAS_PARALLEL_DOMAIN) #thats bad because it affects each target add_definitions(${AMDiS_COMPILEFLAGS}) -link_directories(${AMDiS_LIBRARY_DIRS}) include_directories(${AMDiS_INCLUDE_DIRS}) diff --git a/AMDiS/CMakeLists.txt b/AMDiS/CMakeLists.txt index b82e022e..f56f4fee 100644 --- a/AMDiS/CMakeLists.txt +++ b/AMDiS/CMakeLists.txt @@ -171,6 +171,7 @@ if(ENABLE_PARALLEL_DOMAIN) ) set(ENABLE_PARMETIS ON) 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) include_directories(${PETSC_DIR}/include ${PETSC_DIR}/${PETSC_ARCH}/include) SET(PARALLEL_DOMAIN_AMDIS_SRC -- GitLab