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

capital i, part II

parent 7cde5539
No related branches found
No related tags found
No related merge requests found
#This configuration file is shipped with the great FEM-Toolbox AMDiS. #This configuration file is shipped with the great FEM-Toolbox AMDiS.
#It simplifies the configure of different amdis-version and sets some variables. #It simplifies the configure of different amdis-version and sets some variables.
#We set the following variables: #We set the following variables:
# AMDiS_INCLUDE_DIR the amdis-directory only # AMDIS_INCLUDE_DIR the amdis-directory only
# AMDiS_INCLUDE_DIRS all include directories (mtl, umfpack, parmetis, metis, ...) # AMDIS_INCLUDE_DIRS all include directories (mtl, umfpack, parmetis, metis, ...)
# AMDiS_LIBRARIES the needed libraries # AMDIS_LIBRARIES the needed libraries
# AMDIS_LIBRARY_DIRS the link directories # AMDIS_LIBRARY_DIRS the link directories
# AMDiS_COMPILEFLAGS some compile flags for amdis # AMDiS_COMPILEFLAGS some compile flags for amdis
# #
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# find_package(AMDiS ) # find_package(AMDiS )
# include(${AMDIS_USE_FILE}) # include(${AMDIS_USE_FILE})
# add_executable(yourTarget <yourSources>) # add_executable(yourTarget <yourSources>)
# target_link_libraries(yourTarget ${AMDiS_LIBRARIES}) # target_link_libraries(yourTarget ${AMDIS_LIBRARIES})
# #
# #
#The AMDIS_USE_FILE adds the include and link-directories for amdis to cmake. #The AMDIS_USE_FILE adds the include and link-directories for amdis to cmake.
...@@ -26,22 +26,22 @@ ...@@ -26,22 +26,22 @@
#try to detect the AMDiS include directory #try to detect the AMDiS include directory
find_file(_AMDiS_H AMDiS.h PATHS ${AMDiS_INCLUDE_DIR} ${AMDiS_DIR}/../../include/amdis/ /usr/include/amdis/) find_file(_AMDiS_H AMDiS.h PATHS ${AMDIS_INCLUDE_DIR} ${AMDiS_DIR}/../../include/amdis/ /usr/include/amdis/)
if(_AMDiS_H) if(_AMDiS_H)
get_filename_component(AMDiS_INCLUDE_DIR ${_AMDiS_H} PATH CACHE) get_filename_component(AMDIS_INCLUDE_DIR ${_AMDiS_H} PATH CACHE)
set(AMDiS_INCLUDE_DIRS ${AMDiS_INCLUDE_DIR}) set(AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR})
else() else()
message(ERROR "could not detect the AMDiS include directory. Please set the variable AMDiS_INCLUDE_DIR to the directory containing the AMDiS headers.") message(ERROR "could not detect the AMDiS include directory. Please set the variable AMDIS_INCLUDE_DIR to the directory containing the AMDiS headers.")
endif() endif()
unset(_AMDiS_H CACHE) unset(_AMDiS_H CACHE)
set(MTL_DIR ${AMDiS_INCLUDE_DIR}/mtl4 CACHE PATH "the mtl directory") set(MTL_DIR ${AMDIS_INCLUDE_DIR}/mtl4 CACHE PATH "the mtl directory")
list(APPEND AMDiS_INCLUDE_DIRS ${MTL_DIR}) list(APPEND AMDIS_INCLUDE_DIRS ${MTL_DIR})
find_library(_AMDiS_LIB amdis PATHS ${AMDIS_LIBRARY_DIR} ${AMDiS_DIR}/../../lib/amdis/ /usr/include/amdis) find_library(_AMDiS_LIB amdis PATHS ${AMDIS_LIBRARY_DIR} ${AMDiS_DIR}/../../lib/amdis/ /usr/include/amdis)
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_LIB};${AMDIS_LIBRARY_DIR}/libcompositeFEM.so" CACHE STRING "amdis libraries") 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()
...@@ -49,9 +49,9 @@ unset(_AMDiS_LIB CACHE) ...@@ -49,9 +49,9 @@ unset(_AMDiS_LIB CACHE)
find_package(Boost 1.42 REQUIRED system iostreams) find_package(Boost 1.42 REQUIRED system iostreams)
if(Boost_FOUND) if(Boost_FOUND)
list(APPEND AMDiS_LIBRARIES ${Boost_LIBRARIES}) list(APPEND AMDIS_LIBRARIES ${Boost_LIBRARIES})
list(APPEND AMDIS_LIBRARY_DIRS ${Boost_LIBRARY_DIRS}) list(APPEND AMDIS_LIBRARY_DIRS ${Boost_LIBRARY_DIRS})
list(APPEND AMDiS_INCLUDE_DIRS ${Boost_INCLUDE_DIR}) list(APPEND AMDIS_INCLUDE_DIRS ${Boost_INCLUDE_DIR})
endif(Boost_FOUND) endif(Boost_FOUND)
set(AMDiS_NEED_PARMETIS @ENABLE_PARMETIS@) set(AMDiS_NEED_PARMETIS @ENABLE_PARMETIS@)
...@@ -68,14 +68,14 @@ if(AMDiS_NEED_UMFPACK) ...@@ -68,14 +68,14 @@ if(AMDiS_NEED_UMFPACK)
if(NOT BLAS_LIBRARY) if(NOT BLAS_LIBRARY)
message(ERROR " could not find the blas library. please set the variable BLAS_LIBRARY to the blas library with full path") message(ERROR " could not find the blas library. please set the variable BLAS_LIBRARY to the blas library with full path")
endif() endif()
list(APPEND AMDiS_LIBRARIES ${AMDIS_LIBRARY_DIR}/umfpack/libumfpack.a ${AMDIS_LIBRARY_DIR}/amd/libamd.a ${BLAS_LIBRARY}) list(APPEND AMDIS_LIBRARIES ${AMDIS_LIBRARY_DIR}/umfpack/libumfpack.a ${AMDIS_LIBRARY_DIR}/amd/libamd.a ${BLAS_LIBRARY})
#message("amdis-libs: ${AMDiS_LIBRARIES}") #message("amdis-libs: ${AMDIS_LIBRARIES}")
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
${AMDiS_INCLUDE_DIR}/amd ${AMDIS_INCLUDE_DIR}/amd
${AMDiS_INCLUDE_DIR}/ufconfig ${AMDIS_INCLUDE_DIR}/ufconfig
${AMDiS_INCLUDE_DIR}/ufconfig/xerbla ${AMDIS_INCLUDE_DIR}/ufconfig/xerbla
) )
endif(AMDiS_NEED_UMFPACK) endif(AMDiS_NEED_UMFPACK)
...@@ -88,12 +88,12 @@ endif() ...@@ -88,12 +88,12 @@ 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 ${AMDIS_LIBRARY_DIR}/parmetis/libparmetis.a ${AMDIS_LIBRARY_DIR}/parmetis/libmetis.a) list(APPEND AMDIS_LIBRARIES ${AMDIS_LIBRARY_DIR}/parmetis/libparmetis.a ${AMDIS_LIBRARY_DIR}/parmetis/libmetis.a)
endif() endif()
if( AMDiS_NEED_ZOLTAN ) if( AMDiS_NEED_ZOLTAN )
find_library(ZOLTAN_LIB zoltan DOC "full path to the zoltan library") find_library(ZOLTAN_LIB zoltan DOC "full path to the zoltan library")
list(APPEND AMDiS_LIBRARIES ${ZOLTAN_LIB}) list(APPEND AMDIS_LIBRARIES ${ZOLTAN_LIB})
endif() endif()
if(${AMDiS_FIND_COMPONENTS} MATCHES parmetis AND NOT AMDiS_NEED_PARMETIS) if(${AMDiS_FIND_COMPONENTS} MATCHES parmetis AND NOT AMDiS_NEED_PARMETIS)
message(SEND_ERROR "amdis was not compiled with parmetis") message(SEND_ERROR "amdis was not compiled with parmetis")
......
...@@ -8,20 +8,20 @@ if(AMDiS_HAS_PARALLEL_DOMAIN) ...@@ -8,20 +8,20 @@ if(AMDiS_HAS_PARALLEL_DOMAIN)
# INCLUDE(CMakeForceCompiler) # INCLUDE(CMakeForceCompiler)
# CMAKE_FORCE_CXX_COMPILER(mpicxx "The MPI C++ compiler") # CMAKE_FORCE_CXX_COMPILER(mpicxx "The MPI C++ compiler")
# CMAKE_FORCE_C_COMPILER(mpicc "The MPI C Compiler") # CMAKE_FORCE_C_COMPILER(mpicc "The MPI C Compiler")
list(APPEND AMDiS_LIBRARIES ${MPI_LIBRARIES}) list(APPEND AMDIS_LIBRARIES ${MPI_LIBRARIES})
list(APPEND AMDiS_COMPILEFLAGS ${MPI_COMPILE_FLAGS}) list(APPEND AMDiS_COMPILEFLAGS ${MPI_COMPILE_FLAGS})
list(APPEND AMDiS_INCLUDE_DIRS ${MPI_INCLUDE_PATH}) list(APPEND AMDIS_INCLUDE_DIRS ${MPI_INCLUDE_PATH})
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) set(PETSC_EXECUTABLE_RUNS ON)
find_package(PETSc REQUIRED) find_package(PETSc REQUIRED)
if(PETSC_FOUND) if(PETSC_FOUND)
list(APPEND AMDiS_LIBRARIES ${PETSC_LIBRARY_SYS} ${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})
include_directories(${AMDiS_INCLUDE_DIRS}) include_directories(${AMDIS_INCLUDE_DIRS})
...@@ -60,7 +60,7 @@ find_package(AMDiS REQUIRED)<br> ...@@ -60,7 +60,7 @@ find_package(AMDiS REQUIRED)<br>
if(AMDiS_FOUND)<br> if(AMDiS_FOUND)<br>
include(${AMDiS_USE_FILE})<br> include(${AMDiS_USE_FILE})<br>
add_executable(fooProg src/foo.cc)<br> add_executable(fooProg src/foo.cc)<br>
target_link_libraries(fooProg ${AMDiS_LIBRARIES})<br> target_link_libraries(fooProg ${AMDIS_LIBRARIES})<br>
endif(AMDiS_FOUND)<br> endif(AMDiS_FOUND)<br>
</p > </p >
...@@ -84,7 +84,7 @@ we read an AMDiS specific configuration file, which sets some compilerflags and ...@@ -84,7 +84,7 @@ we read an AMDiS specific configuration file, which sets some compilerflags and
</p > </p >
and we have to tell cmake, that we need the library amdis and each library amdis depends on. This is done with the command and we have to tell cmake, that we need the library amdis and each library amdis depends on. This is done with the command
<p class="desc" > <p class="desc" >
target_link_libraries(fooProg ${AMDiS_LIBRARIES}) target_link_libraries(fooProg ${AMDIS_LIBRARIES})
</p > </p >
If cmake does not find AMDiS, you have to set the variable AMDIS_DIR to the directory containing the file AMDiSConfig.cmake. This file resides in If cmake does not find AMDiS, you have to set the variable AMDIS_DIR to the directory containing the file AMDiSConfig.cmake. This file resides in
......
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