Commit 9b8b6cf1 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

restructured extensions and split into library components and examples

parent 6cf89423
Pipeline #1705 failed with stages
in 10 minutes and 59 seconds
...@@ -22,7 +22,7 @@ endif () ...@@ -22,7 +22,7 @@ endif ()
include(FeatureSummary) include(FeatureSummary)
# Required to enable testing for link-time optimization. # Required to enable testing for link-time optimization.
#include(CheckIPOSupported) include(CheckIPOSupported OPTIONAL)
# Define GNU standard installation directories CMAKE_INSTALL_xxx # Define GNU standard installation directories CMAKE_INSTALL_xxx
include(GNUInstallDirs) include(GNUInstallDirs)
...@@ -102,9 +102,6 @@ endif () ...@@ -102,9 +102,6 @@ endif ()
add_subdirectory(cmake) add_subdirectory(cmake)
add_subdirectory(lib) add_subdirectory(lib)
add_subdirectory(src) add_subdirectory(src)
# if (ENABLE_EXTENSIONS)
# add_subdirectory(../extensions extensions)
# endif (ENABLE_EXTENSIONS)
if(TARGET AMDiS::AMDiS) if(TARGET AMDiS::AMDiS)
feature_summary(WHAT ALL) feature_summary(WHAT ALL)
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
get_filename_component(AMDiS_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) get_filename_component(AMDiS_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(CMAKE_MODULE_PATH "${AMDiS_CMAKE_DIR}" ${CMAKE_MODULE_PATH}) set(CMAKE_MODULE_PATH "${AMDiS_CMAKE_DIR}" ${CMAKE_MODULE_PATH})
include(CMakeFindDependencyMacro) include(CMakeFindDependencyMacro)
include(FeatureSummary)
if (NOT CMAKE_BUILD_TYPE) if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
...@@ -11,15 +10,8 @@ if (NOT CMAKE_BUILD_TYPE) ...@@ -11,15 +10,8 @@ if (NOT CMAKE_BUILD_TYPE)
FORCE) FORCE)
endif () endif ()
# adopt pahts from AMDiS installation
include(find_dependencies)
# global dependencies # global dependencies
find_dependency(Boost ${Boost_VERSION_EXACT} REQUIRED COMPONENTS ${Boost_COMPONENTS}) include(find_dependencies)
find_dependency(MTL REQUIRED)
find_dependency(MuParser REQUIRED)
find_dependency(nanoflann)
find_dependency(PugiXML)
# if not component is specified, assume sequential # if not component is specified, assume sequential
if (NOT AMDiS_FIND_REQUIRED_SEQUENTIAL AND NOT AMDiS_FIND_REQUIRED_PARALLEL) if (NOT AMDiS_FIND_REQUIRED_SEQUENTIAL AND NOT AMDiS_FIND_REQUIRED_PARALLEL)
...@@ -28,10 +20,7 @@ endif () ...@@ -28,10 +20,7 @@ endif ()
# add sequential/parallel dependencies and add the amdis import target # add sequential/parallel dependencies and add the amdis import target
if(AMDiS_FIND_REQUIRED_SEQUENTIAL AND NOT TARGET AMDiS::AMDiS-s) if(AMDiS_FIND_REQUIRED_SEQUENTIAL AND NOT TARGET AMDiS::AMDiS-s)
find_dependency(UMFPACK ${UMFPACK_VERSION_EXACT}) include(find_dependencies-s OPTIONAL)
find_dependency(HYPRE ${HYPRE_VERSION_EXACT})
find_dependency(PETSc ${PETSc_VERSION_EXACT})
find_dependency(MPI)
include(AMDiSTargets-s OPTIONAL RESULT_VARIABLE AMDiS_SEQUENTIAL_FOUND) include(AMDiSTargets-s OPTIONAL RESULT_VARIABLE AMDiS_SEQUENTIAL_FOUND)
if (NOT AMDiS_SEQUENTIAL_FOUND) if (NOT AMDiS_SEQUENTIAL_FOUND)
# fallback to parallel version if sequential does not exist # fallback to parallel version if sequential does not exist
...@@ -39,10 +28,7 @@ if(AMDiS_FIND_REQUIRED_SEQUENTIAL AND NOT TARGET AMDiS::AMDiS-s) ...@@ -39,10 +28,7 @@ if(AMDiS_FIND_REQUIRED_SEQUENTIAL AND NOT TARGET AMDiS::AMDiS-s)
endif (NOT AMDiS_SEQUENTIAL_FOUND) endif (NOT AMDiS_SEQUENTIAL_FOUND)
endif() endif()
if(AMDiS_FIND_REQUIRED_PARALLEL AND NOT TARGET AMDiS::AMDiS-p) if(AMDiS_FIND_REQUIRED_PARALLEL AND NOT TARGET AMDiS::AMDiS-p)
find_dependency(MPI REQUIRED) include(find_dependencies-p OPTIONAL)
find_dependency(PETSc ${PETSc_VERSION_EXACT} REQUIRED)
find_dependency(Zoltan ${Zoltan_VERSION_EXACT})
find_dependency(BDDCML ${BDDCML_VERSION_EXACT})
include(AMDiSTargets-p OPTIONAL RESULT_VARIABLE AMDiS_PARALLEL_FOUND) include(AMDiSTargets-p OPTIONAL RESULT_VARIABLE AMDiS_PARALLEL_FOUND)
endif() endif()
......
...@@ -6,17 +6,14 @@ set(INSTALL_CONFIG_DIR ${CMAKE_INSTALL_LIBDIR}/amdis/cmake) ...@@ -6,17 +6,14 @@ set(INSTALL_CONFIG_DIR ${CMAKE_INSTALL_LIBDIR}/amdis/cmake)
set(PROJECT_CONFIG_FILE ${PROJECT_BINARY_DIR}/AMDiSConfig.cmake) set(PROJECT_CONFIG_FILE ${PROJECT_BINARY_DIR}/AMDiSConfig.cmake)
configure_package_config_file(AMDiSConfig.cmake.in configure_package_config_file(AMDiSConfig.cmake.in
${PROJECT_CONFIG_FILE} ${PROJECT_CONFIG_FILE}
INSTALL_DESTINATION INSTALL_DESTINATION ${INSTALL_CONFIG_DIR}
${INSTALL_CONFIG_DIR}
) )
set(PROJECT_CONFIG_VERSION_FILE ${PROJECT_BINARY_DIR}/AMDiSConfigVersion.cmake) set(PROJECT_CONFIG_VERSION_FILE ${PROJECT_BINARY_DIR}/AMDiSConfigVersion.cmake)
write_basic_package_version_file( write_basic_package_version_file(
${PROJECT_CONFIG_VERSION_FILE} ${PROJECT_CONFIG_VERSION_FILE}
VERSION VERSION ${PACKAGE_VERSION}
${PACKAGE_VERSION} COMPATIBILITY SameMajorVersion
COMPATIBILITY
SameMajorVersion
) )
install(FILES install(FILES
...@@ -25,9 +22,11 @@ install(FILES ...@@ -25,9 +22,11 @@ install(FILES
FindBDDCML.cmake FindBDDCML.cmake
FindHYPRE.cmake FindHYPRE.cmake
FindMTL.cmake FindMTL.cmake
FindParMETIS.cmake
FindPETSc.cmake FindPETSc.cmake
FindPNG.cmake
FindUMFPACK.cmake FindUMFPACK.cmake
FindZoltan.cmake FindZOLTAN.cmake
parse_zoltan_makefile.cmake parse_zoltan_makefile.cmake
target_enable_cxx11.cmake target_enable_cxx11.cmake
DESTINATION ${INSTALL_CONFIG_DIR}) DESTINATION ${INSTALL_CONFIG_DIR})
# FindMTL.cmake # FindPETSc.cmake
# #
# Finds the PETSc library # Finds the PETSc library
# #
......
# FindParMETIS.cmake
#
# Finds the ParMETIS library
#
# This will define the following variables
#
# ParMETIS_FOUND
# PARMETIS_INCLUDE_DIR
# PARMETIS_COMPILE_DEFINITIONS
#
# and the following imported targets
#
# ParMETIS::ParMETIS
#
# Author: Simon Praetorius <simon.praetorius@tu-dresden.de>
mark_as_advanced(ParMETIS_FOUND ParMETIS_VERSION PARMETIS_LIBRARY PARMETIS_HEADER PARMETIS_INCLUDE_DIR)
find_library(PARMETIS_LIBRARY parmetis
HINTS
${PARMETIS_ROOT}
${PETSC_LIBRARY_DIRS}
ENV PARMETIS_ROOT
ENV EBROOTPARMETIS
PATH_SUFFIXES lib/ lib64/
DOC "Library file for ParMETIS"
)
find_file(PARMETIS_HEADER parmetis.h
HINTS
${PARMETIS_ROOT}
${PETSC_INCLUDE_DIRS}
ENV PARMETIS_ROOT
ENV EBROOTPARMETIS
PATH_SUFFIXES include/ include/suitesparse/ include/ufsparse/
DOC "Headerfile umfpack.h for ParMETIS"
)
if (PARMETIS_HEADER)
# extract version of umfpack from umfpack.h
file(STRINGS ${PARMETIS_HEADER} PARMETIS_VERSION_LINES REGEX "#define PARMETIS_(MAJOR|MINOR|SUBMINOR)_VERSION")
set(PARMETIS_MAJOR_VERSION 0)
set(PARMETIS_MINOR_VERSION 0)
set(PARMETIS_SUBMINOR_VERSION 0)
foreach(LINE IN LISTS PARMETIS_VERSION_LINES)
string(REGEX MATCH "PARMETIS_(MAJOR|MINOR|SUBMINOR)_VERSION[ \t]+([0-9]+)" PARMETIS_VERSION_REGEX ${LINE})
set(PARMETIS_${CMAKE_MATCH_1}_VERSION "${CMAKE_MATCH_2}")
endforeach()
set(ParMETIS_VERSION "${PARMETIS_MAJOR_VERSION}.${PARMETIS_MINOR_VERSION}.${PARMETIS_SUBMINOR_VERSION}")
endif (PARMETIS_HEADER)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ParMETIS
REQUIRED_VARS PARMETIS_LIBRARY PARMETIS_HEADER
VERSION_VAR ParMETIS_VERSION
)
if(ParMETIS_FOUND AND NOT TARGET ParMETIS::ParMETIS)
add_library(ParMETIS::ParMETIS INTERFACE IMPORTED)
get_filename_component(PARMETIS_INCLUDE_DIR ${PARMETIS_HEADER} PATH)
set_target_properties(ParMETIS::ParMETIS PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${PARMETIS_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${PARMETIS_LIBRARY}"
)
endif()
# FindMTL.cmake # FindUMFPACK.cmake
# #
# Finds the UMFPACK library # Finds the UMFPACK library
# #
...@@ -20,6 +20,7 @@ mark_as_advanced(UMFPACK_FOUND UMFPACK_VERSION UMFPACK_LIBRARY UMFPACK_HEADER UM ...@@ -20,6 +20,7 @@ mark_as_advanced(UMFPACK_FOUND UMFPACK_VERSION UMFPACK_LIBRARY UMFPACK_HEADER UM
find_library(UMFPACK_LIBRARY umfpack find_library(UMFPACK_LIBRARY umfpack
HINTS HINTS
${SUITESPARSE_ROOT} ${SUITESPARSE_ROOT}
${PETSC_LIBRARY_DIRS}
ENV SUITESPARSE_ROOT ENV SUITESPARSE_ROOT
ENV EBROOTSUITESPARSE ENV EBROOTSUITESPARSE
PATH_SUFFIXES lib/ lib64/ PATH_SUFFIXES lib/ lib64/
...@@ -29,6 +30,7 @@ find_library(UMFPACK_LIBRARY umfpack ...@@ -29,6 +30,7 @@ find_library(UMFPACK_LIBRARY umfpack
find_file(UMFPACK_HEADER umfpack.h find_file(UMFPACK_HEADER umfpack.h
HINTS HINTS
${SUITESPARSE_ROOT} ${SUITESPARSE_ROOT}
${PETSC_INCLUDE_DIRS}
ENV SUITESPARSE_ROOT ENV SUITESPARSE_ROOT
ENV EBROOTSUITESPARSE ENV EBROOTSUITESPARSE
PATH_SUFFIXES include/ include/suitesparse/ include/ufsparse/ PATH_SUFFIXES include/ include/suitesparse/ include/ufsparse/
......
# FindZoltan.cmake # FindZOLTAN.cmake
# #
# Finds the Zoltan library # Finds the Zoltan library
# #
# This will define the following variables # This will define the following variables
# #
# Zoltan_FOUND # ZOLTAN_FOUND
# ZOLTAN_INCLUDE_DIR # ZOLTAN_INCLUDE_DIR
# ZOLTAN_LIBS # ZOLTAN_LIBS
# #
# and the following imported targets # and the following imported targets
# #
# Zoltan::Zoltan # ZOLTAN::ZOLTAN
# #
# Author: Simon Praetorius <simon.praetorius@tu-dresden.de> # Author: Simon Praetorius <simon.praetorius@tu-dresden.de>
mark_as_advanced(Zoltan_FOUND Zoltan_VERSION ZOLTAN_INCLUDE_DIR ZOLTAN_LIBS) mark_as_advanced(ZOLTAN_FOUND ZOLTAN_VERSION ZOLTAN_INCLUDE_DIR ZOLTAN_LIBS)
find_package(Zoltan QUIET) find_package(Zoltan QUIET CONFIG)
if (Zoltan_FOUND) if (ZOLTAN_FOUND)
find_file(ZOLTAN_HEADER zoltan.h HINTS ${Zoltan_INCLUDE_DIRS}) find_file(ZOLTAN_HEADER zoltan.h HINTS ${ZOLTAN_INCLUDE_DIRS})
if (ZOLTAN_HEADER) if (ZOLTAN_HEADER)
set(ZOLTAN_INCLUDE_DIR ${Zoltan_INCLUDE_DIRS} PARENT_SCOPE) set(ZOLTAN_INCLUDE_DIR ${ZOLTAN_INCLUDE_DIRS} PARENT_SCOPE)
endif (ZOLTAN_HEADER) endif (ZOLTAN_HEADER)
set(ZOLTAN_LIBS "") set(ZOLTAN_LIBS "")
foreach (LIB_NAME ${Zoltan_LIBRARIES}) foreach (LIB_NAME ${ZOLTAN_LIBRARIES})
find_library(_ZOLTAN_LIB ${LIB_NAME} HINTS ${Zoltan_LIBRARY_DIRS}) find_library(_ZOLTAN_LIB ${LIB_NAME} HINTS ${ZOLTAN_LIBRARY_DIRS})
if (_ZOLTAN_LIB) if (_ZOLTAN_LIB)
list(APPEND ZOLTAN_LIBS ${_ZOLTAN_LIB}) list(APPEND ZOLTAN_LIBS ${_ZOLTAN_LIB})
else ()
message(FATAL_ERROR "Could not find library \"${LIB_NAME}\" in directories ${Zoltan_LIBRARY_DIRS}!")
endif () endif ()
unset(_ZOLTAN_LIB CACHE) unset(_ZOLTAN_LIB CACHE)
endforeach(LIB_NAME) endforeach(LIB_NAME)
else (Zoltan_FOUND) else (ZOLTAN_FOUND)
find_file(ZOLTAN_HEADER zoltan.h find_file(ZOLTAN_HEADER zoltan.h
HINTS HINTS
${ZOLTAN_ROOT} ${ZOLTAN_ROOT}
...@@ -49,12 +47,12 @@ else (Zoltan_FOUND) ...@@ -49,12 +47,12 @@ else (Zoltan_FOUND)
# extract Zoltan version number # extract Zoltan version number
file(STRINGS ${ZOLTAN_HEADER} ZOLTAN_VERSION_LINE REGEX "#define ZOLTAN_VERSION_NUMBER") file(STRINGS ${ZOLTAN_HEADER} ZOLTAN_VERSION_LINE REGEX "#define ZOLTAN_VERSION_NUMBER")
string(REGEX MATCH "([0-9]+[.][0-9]+)" ZOLTAN_VERSION_REGEX ${ZOLTAN_VERSION_LINE}) string(REGEX MATCH "([0-9]+[.][0-9]+)" ZOLTAN_VERSION_REGEX ${ZOLTAN_VERSION_LINE})
set(Zoltan_VERSION ${CMAKE_MATCH_1}) set(ZOLTAN_VERSION ${CMAKE_MATCH_1})
endif (ZOLTAN_HEADER) endif (ZOLTAN_HEADER)
find_library(ZOLTAN_LIB zoltan find_library(ZOLTAN_LIB zoltan
HINTS HINTS
${Zoltan_INCLUDE_DIR}/.. ${ZOLTAN_INCLUDE_DIR}/..
${ZOLTAN_ROOT} ${ZOLTAN_ROOT}
${PETSC_LIB_DIRS} ${PETSC_LIB_DIRS}
ENV ZOLTAN_ROOT ENV ZOLTAN_ROOT
...@@ -63,26 +61,23 @@ else (Zoltan_FOUND) ...@@ -63,26 +61,23 @@ else (Zoltan_FOUND)
) )
include(parse_zoltan_makefile) include(parse_zoltan_makefile)
find_file(ZOLTAN_CONFIG_FILE Makefile.export.zoltan HINTS ${Zoltan_INCLUDE_DIR}) find_file(ZOLTAN_CONFIG_FILE Makefile.export.zoltan HINTS ${ZOLTAN_INCLUDE_DIR})
if (ZOLTAN_CONFIG_FILE) if (ZOLTAN_CONFIG_FILE)
set(ZOLTAN_LIBS ${ZOLTAN_LIB}) set(ZOLTAN_LIBS ${ZOLTAN_LIB})
parse_zoltan_makefile(${ZOLTAN_CONFIG_FILE} ZOLTAN_LIBS) parse_zoltan_makefile(${ZOLTAN_CONFIG_FILE} ZOLTAN_LIBS)
else ()
message(WARNING "Zoltan configuration file Makefile.export.zoltan not found!")
endif () endif ()
endif (Zoltan_FOUND) endif (ZOLTAN_FOUND)
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Zoltan find_package_handle_standard_args(Zoltan
REQUIRED_VARS ZOLTAN_INCLUDE_DIR ZOLTAN_LIBS REQUIRED_VARS ZOLTAN_INCLUDE_DIR ZOLTAN_LIBS
VERSION_VAR Zoltan_VERSION VERSION_VAR ZOLTAN_VERSION
CONFIG_MODE
) )
if(Zoltan_FOUND AND NOT TARGET Zoltan::Zoltan) if(ZOLTAN_FOUND AND NOT TARGET ZOLTAN::ZOLTAN)
add_library(Zoltan::Zoltan INTERFACE IMPORTED) add_library(ZOLTAN::ZOLTAN INTERFACE IMPORTED)
set_target_properties(Zoltan::Zoltan PROPERTIES set_target_properties(ZOLTAN::ZOLTAN PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${ZOLTAN_INCLUDE_DIR}" INTERFACE_INCLUDE_DIRECTORIES "${ZOLTAN_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${ZOLTAN_LIBS}" INTERFACE_LINK_LIBRARIES "${ZOLTAN_LIBS}"
) )
......
set(ENABLE_PARALLEL_DOMAIN @ENABLE_PARALLEL_DOMAIN@)
set(ENABLE_MPI @ENABLE_MPI@)
set(ENABLE_UMFPACK @ENABLE_UMFPACK@)
set(ENABLE_EXTENSIONS @ENABLE_EXTENSIONS@)
set(ENABLE_HYPRE @ENABLE_HYPRE@)
set(ENABLE_PNG @ENABLE_PNG@)
set(ENABLE_ZOLTAN @ENABLE_ZOLTAN@)
set(ENABLE_PARALLEL_SOLVERS @ENABLE_PARALLEL_SOLVERS@)
set(ENABLE_BDDCML @ENABLE_BDDCML@)
set(ENABLE_BASE_PROBLEMS @ENABLE_BASE_PROBLEMS@)
set(ENABLE_COMPRESSION @ENABLE_COMPRESSION@)
set(ENABLE_REINIT @ENABLE_REINIT@)
set(ENABLE_COMPOSITE_FEM @ENABLE_COMPOSITE_FEM@)
set(ENABLE_OPENMP @ENABLE_OPENMP@)
set(ENABLE_SEQ_PETSC @ENABLE_SEQ_PETSC@)
if (ENABLE_PARALLEL_DOMAIN OR ENABLE_SEQ_PETSC)
if (NOT PETSC_ROOT)
file(TO_CMAKE_PATH "@PETSC_PKG_CONFIG@/../.." PETSC_ROOT)
endif (NOT PETSC_ROOT)
set(PETSc_VERSION "@PETSc_VERSION@")
if (PETSc_VERSION)
set(PETSc_VERSION_EXACT "${PETSc_VERSION}" EXACT)
endif (PETSc_VERSION)
find_dependency(PETSc ${PETSc_VERSION_EXACT})
if (NOT PARMETIS_ROOT)
file(TO_CMAKE_PATH "@PARMETIS_INCLUDE_DIR@/.." PARMETIS_ROOT)
endif (NOT PARMETIS_ROOT)
set(ParMETIS_VERSION "@ParMETIS_VERSION@")
if (ParMETIS_VERSION)
set(ParMETIS_VERSION_EXACT "${ParMETIS_VERSION}" EXACT)
endif (ParMETIS_VERSION)
find_dependency(ParMETIS ${ParMETIS_VERSION_EXACT})
endif (ENABLE_PARALLEL_DOMAIN OR ENABLE_SEQ_PETSC)
if (ENABLE_PARALLEL_DOMAIN OR ENABLE_MPI)
find_dependency(MPI)
endif (ENABLE_PARALLEL_DOMAIN OR ENABLE_MPI)
if (ENABLE_UMFPACK)
if (NOT SUITESPARSE_ROOT)
file(TO_CMAKE_PATH "@UMFPACK_INCLUDE_DIR@/.." SUITESPARSE_ROOT)
endif (NOT SUITESPARSE_ROOT)
set(UMFPACK_VERSION "@UMFPACK_VERSION@")
if (UMFPACK_VERSION)
set(UMFPACK_VERSION_EXACT "${UMFPACK_VERSION}" EXACT)
endif (UMFPACK_VERSION)
find_dependency(UMFPACK ${UMFPACK_VERSION_EXACT})
endif (ENABLE_UMFPACK)
if (ENABLE_HYPRE)
if (NOT HYPRE_ROOT)
file(TO_CMAKE_PATH "@HYPRE_INCLUDE_DIR@/.." HYPRE_ROOT)
endif (NOT HYPRE_ROOT)
set(HYPRE_VERSION "@HYPRE_VERSION@")
if (HYPRE_VERSION)
set(HYPRE_VERSION_EXACT "${HYPRE_VERSION}" EXACT)
endif (HYPRE_VERSION)
find_dependency(HYPRE ${HYPRE_VERSION_EXACT})
endif (ENABLE_HYPRE)
if (ENABLE_PNG)
if (NOT ZLIB_ROOT)
file(TO_CMAKE_PATH "@ZLIB_INCLUDE_DIR@/.." ZLIB_ROOT)
endif (NOT ZLIB_ROOT)
set(ZLIB_VERSION "@ZLIB_VERSION@")
if (ZLIB_VERSION)
set(ZLIB_VERSION_EXACT "${ZLIB_VERSION}" EXACT)
endif (ZLIB_VERSION)
find_dependency(PNG)
endif (ENABLE_PNG)
if (ENABLE_ZOLTAN)
if (NOT ZOLTAN_ROOT)
file(TO_CMAKE_PATH "@ZOLTAN_INCLUDE_DIR@/.." ZOLTAN_ROOT)
endif (NOT ZOLTAN_ROOT)
set(ZOLTAN_VERSION "@ZOLTAN_VERSION@")
if (ZOLTAN_VERSION)
set(ZOLTAN_VERSION_EXACT "${ZOLTAN_VERSION}" EXACT)
endif (ZOLTAN_VERSION)
find_dependency(ZOLTAN ${ZOLTAN_VERSION_EXACT})
endif (ENABLE_ZOLTAN)
if (ENABLE_BDDCML)
if (NOT BDDCML_ROOT)
file(TO_CMAKE_PATH "@BDDCML_INCLUDE_DIR@/.." BDDCML_ROOT)
endif (NOT BDDCML_ROOT)
set(BDDCML_VERSION "@BDDCML_VERSION@")
if (BDDCML_VERSION)
set(BDDCML_VERSION_EXACT "${BDDCML_VERSION}" EXACT)
endif (BDDCML_VERSION)
find_dependency(BDDCML ${BDDCML_VERSION_EXACT})
endif (ENABLE_BDDCML)
...@@ -11,51 +11,9 @@ set(Boost_USE_STATIC_LIBS @Boost_USE_STATIC_LIBS@) ...@@ -11,51 +11,9 @@ set(Boost_USE_STATIC_LIBS @Boost_USE_STATIC_LIBS@)
if (Boost_VERSION) if (Boost_VERSION)
set(Boost_VERSION_EXACT "${Boost_VERSION}" EXACT) set(Boost_VERSION_EXACT "${Boost_VERSION}" EXACT)
endif (Boost_VERSION) endif (Boost_VERSION)
find_dependency(Boost ${Boost_VERSION_EXACT} REQUIRED COMPONENTS ${Boost_COMPONENTS})
if (NOT PETSC_ROOT) find_dependency(MTL)
file(TO_CMAKE_PATH "@PETSC_PKG_CONFIG@/../.." PETSC_ROOT) find_dependency(MuParser)
endif (NOT PETSC_ROOT) find_dependency(nanoflann)
set(PETSc_VERSION "@PETSc_VERSION@") find_dependency(PugiXML)
if (PETSc_VERSION) \ No newline at end of file
set(PETSc_VERSION_EXACT "${PETSc_VERSION}" EXACT)
endif (PETSc_VERSION)
if (NOT SUITESPARSE_ROOT)
file(TO_CMAKE_PATH "@UMFPACK_INCLUDE_DIR@/.." SUITESPARSE_ROOT)
endif (NOT SUITESPARSE_ROOT)
set(UMFPACK_VERSION "@UMFPACK_VERSION@")
if (UMFPACK_VERSION)
set(UMFPACK_VERSION_EXACT "${UMFPACK_VERSION}" EXACT)
endif (UMFPACK_VERSION)
if (NOT HYPRE_ROOT)
file(TO_CMAKE_PATH "@HYPRE_INCLUDE_DIR@/.." HYPRE_ROOT)
endif (NOT HYPRE_ROOT)
set(HYPRE_VERSION "@HYPRE_VERSION@")
if (HYPRE_VERSION)
set(HYPRE_VERSION_EXACT "${HYPRE_VERSION}" EXACT)
endif (HYPRE_VERSION)
if (NOT ZLIB_ROOT)
file(TO_CMAKE_PATH "@ZLIB_INCLUDE_DIR@/.." ZLIB_ROOT)
endif (NOT ZLIB_ROOT)
set(ZLIB_VERSION "@ZLIB_VERSION@")
if (ZLIB_VERSION)
set(ZLIB_VERSION_EXACT "${ZLIB_VERSION}" EXACT)
endif (ZLIB_VERSION)
if (NOT ZOLTAN_ROOT)
file(TO_CMAKE_PATH "@ZOLTAN_INCLUDE_DIR@/.." ZOLTAN_ROOT)
endif (NOT ZOLTAN_ROOT)
set(Zoltan_VERSION "@Zoltan_VERSION@")
if (Zoltan_VERSION)
set(Zoltan_VERSION_EXACT "${Zoltan_VERSION}" EXACT)
endif (Zoltan_VERSION)
if (NOT BDDCML_ROOT)
file(TO_CMAKE_PATH "@BDDCML_INCLUDE_DIR@/.." BDDCML_ROOT)
endif (NOT BDDCML_ROOT)
set(BDDCML_VERSION "@BDDCML_VERSION@")
if (BDDCML_VERSION)
set(BDDCML_VERSION_EXACT "${BDDCML_VERSION}" EXACT)
endif (BDDCML_VERSION)
macro(target_enable_bddcml _TARGET_ _SCOPE_)
if (${ARGC} GREATER 2)
set(LINK_EXECUTABLE ON)
else ()
set(LINK_EXECUTABLE OFF)
endif ()
SET(BDDCML_LINK_LIST "" CACHE STRING "Further libraries to be linked with BDDCML")
find_file(BDDCML_H bddcml_interface_c.h
HINTS ENV CPATH
DOC "Header bddcml_interface_c.h for the BDDCML library.")
if (BDDCML_H)
get_filename_component(BDDCML_PATH ${BDDCML_H} PATH)
target_include_directories(${_TARGET_} ${_SCOPE_} ${BDDCML_PATH})
target_compile_definitions(${_TARGET_} ${_SCOPE_} HAVE_BDDC_ML=1 Add_)
else()
message(FATAL_ERROR "Could not find BDDCML headers.")
endif()
if (LINK_EXECUTABLE OR APPLE)
find_library(BDDCML_LIB bddcml
HINTS ENV LIBRARY_PATH
DOC "BDDCML library")
if(BDDCML_LIB)
target_link_libraries(${_TARGET_} ${BDDCML_LIB})
else()
message(FATAL_ERROR "Could not find the BDDCML library")
endif()
endif (LINK_EXECUTABLE OR APPLE)
target_compile_definitions(${_TARGET_} ${_SCOPE_} HAVE_BDDCML=1)
endmacro(target_enable_bddcml)
macro(target_enable_hypre _TARGET_ _SCOPE_)
if (${ARGC} GREATER 2)
set(LINK_EXECUTABLE ON)
else ()
set(LINK_EXECUTABLE OFF)
endif ()
# MPI is required
if (LINK_EXECUTABLE)
target_enable_mpi(${_TARGET_} ${_SCOPE_} ON)
else ()
target_enable_mpi(${_TARGET_} ${_SCOPE_})
endif (LINK_EXECUTABLE)
find_file(_HYPRE_H HYPRE.h
HINTS ${PETSC_INCLUDE_DIRS})
if (_HYPRE_H)
get_filename_component(HYPRE_INCLUDE_DIRECTORIES ${_HYPRE_H} PATH)
target_include_directories(${_TARGET_} ${_SCOPE_} ${HYPRE_INCLUDE_DIRECTORIES})
endif (_HYPRE_H)
if (LINK_EXECUTABLE OR APPLE)
find_library(_HYPRE_LIB HYPRE
HINTS ${PETSC_LIBRARY_DIRS})
if(_HYPRE_LIB)
get_filename_component(HLIB_PATH ${_HYPRE_LIB} PATH)
file(GLOB HYPRE_OTHER ${HLIB_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}HYPRE*${CMAKE_SHARED_LIBRARY_SUFFIX})
target_link_libraries(${_TARGET_} ${_HYPRE_LIB} ${HYPRE_OTHER})
endif (_HYPRE_LIB)
# lapack library is required
find_library(LAPACK_LIB
NAMES lapack flapack
HINTS ${LAPACK_DIR}/lib ${PETSC_LIBRARY_DIRS} ${PETSC_DIR}/lib)
if (LAPACK_LIB)
set(LAPACK_LIBRARIES ${LAPACK_LIB})
else (LAPACK_LIB)
find_package(LAPACK REQUIRED)
endif (LAPACK_LIB)
target_link_libraries(${_TARGET_} ${_SCOPE_} ${LAPACK_LIBRARIES})
endif (LINK_EXECUTABLE OR APPLE)
if (_HYPRE_H AND (NOT LINK_EXECUTABLE OR _HYPRE_LIB OR APPLE))
set(HAVE_HYPRE ON)