Commit 75441912 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

AMDiSConfig file optimized, pugixml restructured, and extensions compile errors removed

parent c5e96515
...@@ -38,7 +38,7 @@ option(ENABLE_MPI "Compile with MPI compiler and library" false) ...@@ -38,7 +38,7 @@ option(ENABLE_MPI "Compile with MPI compiler and library" false)
option(ENABLE_UMFPACK "Enable support for the UMFPACK solver" true) option(ENABLE_UMFPACK "Enable support for the UMFPACK solver" true)
option(ENABLE_EXTENSIONS "Use extensions for AMDiS" false) option(ENABLE_EXTENSIONS "Use extensions for AMDiS" false)
option(ENABLE_HYPRE "Use HYPRE AMG solver" false) option(ENABLE_HYPRE "Use HYPRE AMG solver" false)
option(ENABLE_PNG "Use png reader/writer" false) #option(ENABLE_PNG "Use png reader/writer" false) # NOTE: currently not working
# additional options for parallel_domain # additional options for parallel_domain
# { # {
......
...@@ -3,37 +3,55 @@ ...@@ -3,37 +3,55 @@
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(target_enable_boost) include(FeatureSummary)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
"Choose the type of build, options are: Debug Release [RelWithDebInfo] MinSizeRel."
FORCE)
endif ()
# adopt pahts from AMDiS installation
include(find_dependencies)
# global dependencies # global dependencies
find_dependency(Boost ${Boost_VERSION_EXACT} REQUIRED COMPONENTS ${Boost_COMPONENTS})
find_dependency(MTL REQUIRED) find_dependency(MTL REQUIRED)
target_enable_boost()
find_dependency(MuParser REQUIRED) find_dependency(MuParser REQUIRED)
find_dependency(nanoflann)
find_dependency(PugiXML)
if (NOT AMDiS_FIND_REQUIRED_SEQUENTIAL AND NOT AMDiS_FIND_REQUIRED_PARALLEL)
set (AMDiS_FIND_REQUIRED_SEQUENTIAL 1)
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) find_dependency(UMFPACK ${UMFPACK_VERSION_EXACT})
find_dependency(HYPRE) find_dependency(HYPRE ${HYPRE_VERSION_EXACT})
find_dependency(PNG) #find_dependency(PNG ${PNG_VERSION_EXACT} QUIET)
find_dependency(PETSc) find_dependency(PETSc ${PETSc_VERSION_EXACT})
find_dependency(MPI) find_dependency(MPI)
include("${AMDiS_CMAKE_DIR}/AMDiSTargets-s.cmake") include(AMDiSTargets-s OPTIONAL RESULT_VARIABLE AMDiS_SEQUENTIAL_FOUND)
set(AMDiS_SEQUENTIAL_FOUND TRUE) if (NOT AMDiS_SEQUENTIAL_FOUND)
elseif(AMDiS_FIND_REQUIRED_PARALLEL AND NOT TARGET AMDiS::AMDiS-p) # fallback to parallel version of sequential does not exist
set(AMDiS_FIND_REQUIRED_PARALLEL 1)
endif (NOT AMDiS_SEQUENTIAL_FOUND)
endif()
if(AMDiS_FIND_REQUIRED_PARALLEL AND NOT TARGET AMDiS::AMDiS-p)
find_dependency(MPI REQUIRED) find_dependency(MPI REQUIRED)
find_dependency(PETSc REQUIRED) find_dependency(PETSc ${PETSc_VERSION_EXACT} REQUIRED)
find_dependency(Zoltan) find_dependency(Zoltan ${Zoltan_VERSION_EXACT})
find_dependency(BDDCML) find_dependency(BDDCML ${BDDCML_VERSION_EXACT})
include("${AMDiS_CMAKE_DIR}/AMDiSTargets-p.cmake") include(AMDiSTargets-p OPTIONAL RESULT_VARIABLE AMDiS_PARALLEL_FOUND)
set(AMDiS_PARALLEL_FOUND TRUE)
endif() endif()
# add alias AMDiS that links to the sequential version by default # add alias AMDiS that links to the sequential version by default
# only if component=PARALLEL it links to the parallel version # only if component=PARALLEL it links to the parallel version
if (AMDiS_FIND_REQUIRED_SEQUENTIAL OR NOT AMDiS_FIND_REQUIRED_PARALLEL) if (AMDiS_SEQUENTIAL_FOUND)
add_library(AMDiS INTERFACE) add_library(AMDiS INTERFACE)
target_link_libraries(AMDiS INTERFACE AMDiS::AMDiS-s) target_link_libraries(AMDiS INTERFACE AMDiS::AMDiS-s)
elseif (AMDiS_FIND_REQUIRED_PARALLEL) elseif (AMDiS_PARALLEL_FOUND)
add_library(AMDiS INTERFACE) add_library(AMDiS INTERFACE)
target_link_libraries(AMDiS INTERFACE AMDiS::AMDiS-p) target_link_libraries(AMDiS INTERFACE AMDiS::AMDiS-p)
endif () endif ()
......
...@@ -29,6 +29,5 @@ install(FILES ...@@ -29,6 +29,5 @@ install(FILES
FindUMFPACK.cmake FindUMFPACK.cmake
FindZoltan.cmake FindZoltan.cmake
parse_zoltan_makefile.cmake parse_zoltan_makefile.cmake
target_enable_boost.cmake
target_enable_cxx11.cmake target_enable_cxx11.cmake
DESTINATION ${INSTALL_CONFIG_DIR}) DESTINATION ${INSTALL_CONFIG_DIR})
...@@ -17,7 +17,6 @@ mark_as_advanced(BDDCML_FOUND BDDCML_INCLUDE_DIR BDDCML_LIBRARY) ...@@ -17,7 +17,6 @@ mark_as_advanced(BDDCML_FOUND BDDCML_INCLUDE_DIR BDDCML_LIBRARY)
find_library(BDDCML_LIBRARY bddcml find_library(BDDCML_LIBRARY bddcml
HINTS HINTS
${AMDIS_BDDCML_ROOT_DIR}
${BDDCML_ROOT} ${BDDCML_ROOT}
${PETSC_LIBRARY_DIRS} ${PETSC_LIBRARY_DIRS}
ENV BDDCML_ROOT ENV BDDCML_ROOT
...@@ -28,7 +27,6 @@ find_library(BDDCML_LIBRARY bddcml ...@@ -28,7 +27,6 @@ find_library(BDDCML_LIBRARY bddcml
find_file(BDDCML_HEADER bddcml_interface_c.h find_file(BDDCML_HEADER bddcml_interface_c.h
HINTS HINTS
${AMDIS_BDDCML_ROOT_DIR}
${BDDCML_ROOT} ${BDDCML_ROOT}
${PETSC_INCLUDE_DIRS} ${PETSC_INCLUDE_DIRS}
ENV BDDCML_ROOT ENV BDDCML_ROOT
......
...@@ -13,11 +13,10 @@ ...@@ -13,11 +13,10 @@
# Author: Simon Praetorius <simon.praetorius@tu-dresden.de> # Author: Simon Praetorius <simon.praetorius@tu-dresden.de>
mark_as_advanced(HYPRE_FOUND HYPRE_LIBRARY HYPRE_HEADER) mark_as_advanced(HYPRE_FOUND HYPRE_VERSION HYPRE_LIBRARY HYPRE_HEADER HYPRE_INCLUDE_DIR HYPRE_LIB_DIR)
find_library(HYPRE_LIBRARY HYPRE find_library(HYPRE_LIBRARY HYPRE
HINTS HINTS
${AMDIS_HYPRE_ROOT_DIR}
${HYPRE_ROOT} ${HYPRE_ROOT}
${PETSC_LIBRARY_DIRS} ${PETSC_LIBRARY_DIRS}
ENV HYPRE_ROOT ENV HYPRE_ROOT
...@@ -28,7 +27,6 @@ find_library(HYPRE_LIBRARY HYPRE ...@@ -28,7 +27,6 @@ find_library(HYPRE_LIBRARY HYPRE
find_file(HYPRE_HEADER HYPRE.h find_file(HYPRE_HEADER HYPRE.h
HINTS HINTS
${AMDIS_HYPRE_ROOT_DIR}
${HYPRE_ROOT} ${HYPRE_ROOT}
${PETSC_INCLUDE_DIRS} ${PETSC_INCLUDE_DIRS}
ENV HYPRE_ROOT ENV HYPRE_ROOT
...@@ -36,18 +34,26 @@ find_file(HYPRE_HEADER HYPRE.h ...@@ -36,18 +34,26 @@ find_file(HYPRE_HEADER HYPRE.h
PATH_SUFFIXES include/ PATH_SUFFIXES include/
DOC "Headerfile hypre.h for HYPRE" DOC "Headerfile hypre.h for HYPRE"
) )
if (HYPRE_HEADER)
get_filename_component(HYPRE_INCLUDE_DIR ${HYPRE_HEADER} PATH)
# extract HYPRE version number
file(STRINGS ${HYPRE_INCLUDE_DIR}/HYPRE_config.h HYPRE_VERSION_LINE REGEX "#define HYPRE_RELEASE_VERSION")
string(REGEX MATCH "([0-9]+[.][0-9]+[.][0-9]+)" HYPRE_VERSION_REGEX ${HYPRE_VERSION_LINE})
set(HYPRE_VERSION ${CMAKE_MATCH_1})
endif (HYPRE_HEADER)
find_package(MPI QUIET COMPONENTS CXX) find_package(MPI QUIET COMPONENTS CXX)
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(HYPRE find_package_handle_standard_args(HYPRE
REQUIRED_VARS HYPRE_LIBRARY HYPRE_HEADER MPI_FOUND REQUIRED_VARS HYPRE_LIBRARY HYPRE_HEADER MPI_FOUND
VERSION_VAR HYPRE_VERSION
) )
if(HYPRE_FOUND AND MPI_FOUND AND NOT TARGET HYPRE::HYPRE) if(HYPRE_FOUND AND MPI_FOUND AND NOT TARGET HYPRE::HYPRE)
add_library(HYPRE::HYPRE INTERFACE IMPORTED) add_library(HYPRE::HYPRE INTERFACE IMPORTED)
get_filename_component(HYPRE_INCLUDE_DIR ${HYPRE_HEADER} PATH)
get_filename_component(HYPRE_LIB_DIR ${HYPRE_LIBRARY} PATH) get_filename_component(HYPRE_LIB_DIR ${HYPRE_LIBRARY} PATH)
file(GLOB HYPRE_LIBS ${HYPRE_LIB_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}HYPRE*${CMAKE_SHARED_LIBRARY_SUFFIX}) file(GLOB HYPRE_LIBS ${HYPRE_LIB_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}HYPRE*${CMAKE_SHARED_LIBRARY_SUFFIX})
list(APPEND HYPRE_LIBS ${HYPRE_LIBRARY}) list(APPEND HYPRE_LIBS ${HYPRE_LIBRARY})
......
...@@ -52,9 +52,9 @@ find_package(ZLIB ${_FIND_ZLIB_ARG}) ...@@ -52,9 +52,9 @@ find_package(ZLIB ${_FIND_ZLIB_ARG})
if(ZLIB_FOUND) if(ZLIB_FOUND)
find_path(PNG_PNG_INCLUDE_DIR png.h HINTS ${PNG_ROOT} ENV PNG_ROOT PATH_SUFFIXES include include/libpng include/libpng16) find_path(PNG_PNG_INCLUDE_DIR png.h HINTS ${PNG_ROOT} ENV PNG_ROOT PATH_SUFFIXES include include/libpng include/libpng16)
if (NOT PNG_PNG_INCLUDE_DIR) #if (NOT PNG_PNG_INCLUDE_DIR)
message(FATAL_ERROR "PNG header png.h not found. Specify PNG_ROOT as root directory of your PNG installation") # message(FATAL_ERROR "PNG header png.h not found. Specify PNG_ROOT as root directory of your PNG installation")
endif () #endif ()
list(APPEND PNG_NAMES png libpng) list(APPEND PNG_NAMES png libpng)
unset(PNG_NAMES_DEBUG) unset(PNG_NAMES_DEBUG)
...@@ -80,9 +80,9 @@ if(ZLIB_FOUND) ...@@ -80,9 +80,9 @@ if(ZLIB_FOUND)
if(NOT PNG_LIBRARY) if(NOT PNG_LIBRARY)
find_library(PNG_LIBRARY_RELEASE NAMES ${PNG_NAMES} HINTS ${PNG_ROOT} ENV PNG_ROOT PATH_SUFFIXES lib lib64) find_library(PNG_LIBRARY_RELEASE NAMES ${PNG_NAMES} HINTS ${PNG_ROOT} ENV PNG_ROOT PATH_SUFFIXES lib lib64)
find_library(PNG_LIBRARY_DEBUG NAMES ${PNG_NAMES_DEBUG} HINTS ${PNG_ROOT} ENV PNG_ROOT PATH_SUFFIXES lib lib64) find_library(PNG_LIBRARY_DEBUG NAMES ${PNG_NAMES_DEBUG} HINTS ${PNG_ROOT} ENV PNG_ROOT PATH_SUFFIXES lib lib64)
if (NOT PNG_LIBRARY_RELEASE AND NOT PNG_LIBRARY_DEBUG) #if (NOT PNG_LIBRARY_RELEASE AND NOT PNG_LIBRARY_DEBUG)
message(FATAL_ERROR "PNG library {${PNG_NAMES}} not found. Specify PNG_ROOT as root directory of your PNG installation") # message(FATAL_ERROR "PNG library {${PNG_NAMES}} not found. Specify PNG_ROOT as root directory of your PNG installation")
endif () #endif ()
include(SelectLibraryConfigurations) include(SelectLibraryConfigurations)
select_library_configurations(PNG) select_library_configurations(PNG)
...@@ -98,7 +98,7 @@ if(ZLIB_FOUND) ...@@ -98,7 +98,7 @@ if(ZLIB_FOUND)
if (PNG_LIBRARY AND PNG_PNG_INCLUDE_DIR) if (PNG_LIBRARY AND PNG_PNG_INCLUDE_DIR)
# png.h includes zlib.h. Sigh. # png.h includes zlib.h. Sigh.
set(PNG_INCLUDE_DIRS ${PNG_PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ) set(PNG_INCLUDE_DIRS ${PNG_PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
set(PNG_INCLUDE_DIR ${PNG_INCLUDE_DIRS} ) # for backward compatibility set(PNG_INCLUDE_DIR ${PNG_INCLUDE_DIRS}) # for backward compatibility
set(PNG_LIBRARIES ${PNG_LIBRARY} ${ZLIB_LIBRARY}) set(PNG_LIBRARIES ${PNG_LIBRARY} ${ZLIB_LIBRARY})
if (CYGWIN) if (CYGWIN)
...@@ -143,8 +143,8 @@ if(ZLIB_FOUND) ...@@ -143,8 +143,8 @@ if(ZLIB_FOUND)
string(REGEX REPLACE "^#define[ \t]+PNG_LIBPNG_VER_STRING[ \t]+\"([^\"]+)\".*" "\\1" PNG_VERSION_STRING "${png_version_str}") string(REGEX REPLACE "^#define[ \t]+PNG_LIBPNG_VER_STRING[ \t]+\"([^\"]+)\".*" "\\1" PNG_VERSION_STRING "${png_version_str}")
unset(png_version_str) unset(png_version_str)
endif () endif ()
else() #else()
message(FATAL_ERROR "zlib required for PNG. Specify ZLIB_ROOT as root directory of your zlib installation.") # message(FATAL_ERROR "zlib required for PNG. Specify ZLIB_ROOT as root directory of your zlib installation.")
endif() endif()
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
......
...@@ -15,11 +15,10 @@ ...@@ -15,11 +15,10 @@
# Author: Simon Praetorius <simon.praetorius@tu-dresden.de> # Author: Simon Praetorius <simon.praetorius@tu-dresden.de>
mark_as_advanced(UMFPACK_FOUND UMFPACK_LIBRARY UMFPACK_HEADER) mark_as_advanced(UMFPACK_FOUND UMFPACK_VERSION UMFPACK_LIBRARY UMFPACK_HEADER UMFPACK_INCLUDE_DIR)
find_library(UMFPACK_LIBRARY umfpack find_library(UMFPACK_LIBRARY umfpack
HINTS HINTS
${AMDIS_UMFPACK_ROOT_DIR}
${SUITESPARSE_ROOT} ${SUITESPARSE_ROOT}
ENV SUITESPARSE_ROOT ENV SUITESPARSE_ROOT
ENV EBROOTSUITESPARSE ENV EBROOTSUITESPARSE
...@@ -29,23 +28,30 @@ find_library(UMFPACK_LIBRARY umfpack ...@@ -29,23 +28,30 @@ find_library(UMFPACK_LIBRARY umfpack
find_file(UMFPACK_HEADER umfpack.h find_file(UMFPACK_HEADER umfpack.h
HINTS HINTS
${AMDIS_UMFPACK_ROOT_DIR}
${SUITESPARSE_ROOT} ${SUITESPARSE_ROOT}
ENV SUITESPARSE_ROOT ENV SUITESPARSE_ROOT
ENV EBROOTSUITESPARSE ENV EBROOTSUITESPARSE
PATH_SUFFIXES include/ include/suitesparse/ include/ufsparse/ PATH_SUFFIXES include/ include/suitesparse/ include/ufsparse/
DOC "Headerfile umfpack.h for UMFPACK" DOC "Headerfile umfpack.h for UMFPACK"
) )
if (UMFPACK_HEADER)
# extract version of umfpack from umfpack.h
file(STRINGS ${UMFPACK_HEADER} UMFPACK_VERSION_LINE REGEX "#define UMFPACK_VERSION")
string(REGEX MATCH "\"UMFPACK V([0-9]+)\.([0-9]+)\.([0-9]+).*\"" UMFPACK_VERSION_REGEX ${UMFPACK_VERSION_LINE})
set(UMFPACK_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}")
endif (UMFPACK_HEADER)
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(UMFPACK find_package_handle_standard_args(UMFPACK
REQUIRED_VARS UMFPACK_LIBRARY UMFPACK_HEADER REQUIRED_VARS UMFPACK_LIBRARY UMFPACK_HEADER
VERSION_VAR UMFPACK_VERSION
) )
if(UMFPACK_FOUND AND NOT TARGET UMFPACK::UMFPACK) if(UMFPACK_FOUND AND NOT TARGET UMFPACK::UMFPACK)
add_library(UMFPACK::UMFPACK INTERFACE IMPORTED) add_library(UMFPACK::UMFPACK INTERFACE IMPORTED)
get_filename_component(UMFPACK_INCLUDE_DIR ${UMFPACK_HEADER} PATH) get_filename_component(UMFPACK_INCLUDE_DIR ${UMFPACK_HEADER} PATH)
#set(UMFPACK_INCLUDE_DIR ${UMFPACK_INCLUDE_DIR} PARENT_SCOPE)
set_target_properties(UMFPACK::UMFPACK PROPERTIES set_target_properties(UMFPACK::UMFPACK PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${UMFPACK_INCLUDE_DIR}" INTERFACE_INCLUDE_DIRECTORIES "${UMFPACK_INCLUDE_DIR}"
) )
......
...@@ -15,13 +15,13 @@ ...@@ -15,13 +15,13 @@
# Author: Simon Praetorius <simon.praetorius@tu-dresden.de> # Author: Simon Praetorius <simon.praetorius@tu-dresden.de>
mark_as_advanced(Zoltan_FOUND 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)
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}) set(ZOLTAN_INCLUDE_DIR ${Zoltan_INCLUDE_DIRS} PARENT_SCOPE)
endif (ZOLTAN_HEADER) endif (ZOLTAN_HEADER)
set(ZOLTAN_LIBS "") set(ZOLTAN_LIBS "")
...@@ -44,7 +44,12 @@ else (Zoltan_FOUND) ...@@ -44,7 +44,12 @@ else (Zoltan_FOUND)
PATH_SUFFIXES include/ PATH_SUFFIXES include/
) )
if (ZOLTAN_HEADER) if (ZOLTAN_HEADER)
get_filename_component(ZOLTAN_INCLUDE_DIR "${ZOLTAN_HEADER}" PATH CACHE) get_filename_component(ZOLTAN_INCLUDE_DIR "${ZOLTAN_HEADER}" PATH)
# extract 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})
set(Zoltan_VERSION ${CMAKE_MATCH_1})
endif (ZOLTAN_HEADER) endif (ZOLTAN_HEADER)
find_library(ZOLTAN_LIB zoltan find_library(ZOLTAN_LIB zoltan
...@@ -70,6 +75,7 @@ endif (Zoltan_FOUND) ...@@ -70,6 +75,7 @@ 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
CONFIG_MODE CONFIG_MODE
) )
...@@ -80,11 +86,4 @@ if(Zoltan_FOUND AND NOT TARGET Zoltan::Zoltan) ...@@ -80,11 +86,4 @@ if(Zoltan_FOUND AND NOT TARGET Zoltan::Zoltan)
INTERFACE_INCLUDE_DIRECTORIES "${ZOLTAN_INCLUDE_DIR}" INTERFACE_INCLUDE_DIRECTORIES "${ZOLTAN_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${ZOLTAN_LIBS}" INTERFACE_LINK_LIBRARIES "${ZOLTAN_LIBS}"
) )
# extract Zoltan version number
if (ZOLTAN_HEADER)
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})
set(Zoltan_VERSION ${CMAKE_MATCH_1})
endif (ZOLTAN_HEADER)
endif() endif()
if (NOT BOOST_ROOT)
set(_DIRS @Boost_INCLUDE_DIRS@)
list(GET _DIRS 0 _DIR)
file(TO_CMAKE_PATH "${_DIR}/.." BOOST_ROOT)
unset(_DIR)
unset(_DIRS)
endif (NOT BOOST_ROOT)
#set(Boost_VERSION "@Boost_VERSION@")
set(Boost_COMPONENTS "@BOOST_LIBS_REQUIRED@")
set(Boost_USE_STATIC_LIBS @Boost_USE_STATIC_LIBS@)
if (Boost_VERSION)
set(Boost_VERSION_EXACT "${Boost_VERSION}" EXACT)
endif (Boost_VERSION)
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)
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 PNG_ROOT)
file(TO_CMAKE_PATH "@PNG_INCLUDE_DIR@/.." PNG_ROOT)
endif (NOT PNG_ROOT)
set(PNG_VERSION "@PNG_VERSION@")
if (PNG_VERSION)
set(PNG_VERSION_EXACT "${PNG_VERSION}" EXACT)
endif (PNG_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_boost)
if (BOOST_ROOT)
file(TO_CMAKE_PATH ${BOOST_ROOT} BOOST_ROOT)
endif (BOOST_ROOT)
if (BOOST_LIBRARYDIR)
file(TO_CMAKE_PATH ${BOOST_LIBRARYDIR} BOOST_LIBRARYDIR)
endif (BOOST_LIBRARYDIR)
set(BOOST_VERSION "1.48")
set(BOOST_LIBS_REQUIRED system iostreams filesystem program_options date_time)
if (WIN32)
list(APPEND BOOST_LIBS_REQUIRED zlib)
if (ENABLE_COMPRESSION OR AMDIS_NEED_COMPRESSION)
list(APPEND BOOST_LIBS_REQUIRED bzip2)
endif (ENABLE_COMPRESSION OR AMDIS_NEED_COMPRESSION)
endif (WIN32)
if (NOT BUILD_SHARED_LIBS)
set(Boost_USE_STATIC_LIBS ON)
endif (NOT BUILD_SHARED_LIBS)
find_package(Boost ${BOOST_VERSION} REQUIRED COMPONENTS ${BOOST_LIBS_REQUIRED})
if (${ARGC} GREATER 0)
foreach (_C ${BOOST_LIBS_REQUIRED})
target_link_libraries(${ARGV0} Boost::${_C})
endforeach ()
endif ()
endmacro(target_enable_boost)
...@@ -4,16 +4,16 @@ project(muparser VERSION 1.34 LANGUAGES CXX) ...@@ -4,16 +4,16 @@ project(muparser VERSION 1.34 LANGUAGES CXX)
include(GNUInstallDirs) include(GNUInstallDirs)
set(PUGIXML_HEADERS set(PUGIXML_HEADERS
src/pugiconfig.hpp include/pugixml/pugiconfig.hpp
src/pugixml.hpp) include/pugixml/pugixml.hpp)
set(PUGIXML_SOURCES src/pugixml.cpp) set(PUGIXML_SOURCES src/pugixml.cpp)
add_library(PugiXML ${PUGIXML_HEADERS} ${PUGIXML_SOURCES}) add_library(PugiXML ${PUGIXML_HEADERS} ${PUGIXML_SOURCES})
add_library(PugiXML::PugiXML ALIAS PugiXML) add_library(PugiXML::PugiXML ALIAS PugiXML)
target_include_directories(PugiXML target_include_directories(PugiXML
PUBLIC PUBLIC
$<INSTALL_INTERFACE:include/pugixml> $<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
) )
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/PugiXMLConfig.cmake.in configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/PugiXMLConfig.cmake.in
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* Copyright (C) 2003, by Kristen Wegner (kristen@tima.net) * Copyright (C) 2003, by Kristen Wegner (kristen@tima.net)
*/ */
#include "pugixml.hpp" #include "pugixml/pugixml.hpp"
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
......
# Include macros # Include macros
include(target_enable_cxx11) include(target_enable_cxx11)
include(target_enable_boost)
set(AMDIS_HEADERS set(AMDIS_HEADERS
AMDiS.h AMDiS.h
...@@ -255,7 +254,7 @@ set_target_properties(AMDiS${POSTFIX} ...@@ -255,7 +254,7 @@ set_target_properties(AMDiS${POSTFIX}
target_enable_cxx14(SUPPORTS_CXX14 AMDiS${POSTFIX} PUBLIC) target_enable_cxx14(SUPPORTS_CXX14 AMDiS${POSTFIX} PUBLIC)
if (SUPPORTS_CXX14) if (SUPPORTS_CXX14)
target_compile_definitions(AMDiS${POSTFIX} PRIVATE "AMDIS_HAS_CXX14=1") target_compile_definitions(AMDiS${POSTFIX} PUBLIC "AMDIS_HAS_CXX14=1")
else () else ()
target_enable_cxx11(SUPPORTS_CXX11 AMDiS${POSTFIX} PUBLIC) target_enable_cxx11(SUPPORTS_CXX11 AMDiS${POSTFIX} PUBLIC)
endif () endif ()
...@@ -263,16 +262,32 @@ endif () ...@@ -263,16 +262,32 @@ endif ()
if (NOT SUPPORTS_CXX11 AND NOT SUPPORTS_CXX14) if (NOT SUPPORTS_CXX11 AND NOT SUPPORTS_CXX14)
message(FATAL_ERROR "AMDiS needs at least c++11, but the current compiler does not support this standard!") message(FATAL_ERROR "AMDiS needs at least c++11, but the current compiler does not support this standard!")
endif () endif ()
target_compile_definitions(AMDiS${POSTFIX} PRIVATE "AMDIS_HAS_CXX11=1") target_compile_definitions(AMDiS${POSTFIX} PUBLIC "AMDIS_HAS_CXX11=1")
# configure external packages # configure external packages
# --------------------------- # ---------------------------
set(BOOST_LIBS_REQUIRED system iostreams filesystem program_options date_time)
if (WIN32)
list(APPEND BOOST_LIBS_REQUIRED zlib)
if (ENABLE_COMPRESSION)
list(APPEND BOOST_LIBS_REQUIRED bzip2)
endif (ENABLE_COMPRESSION)
endif (WIN32)
if (NOT BUILD_SHARED_LIBS)
set(Boost_USE_STATIC_LIBS ON)
endif (NOT BUILD_SHARED_LIBS)
find_package(Boost 1.48 REQUIRED COMPONENTS ${BOOST_LIBS_REQUIRED})
foreach (_C ${BOOST_LIBS_REQUIRED})
target_link_libraries(AMDiS${POSTFIX} Boost::${_C})
endforeach (_C)
unset(_C CACHE)
find_package(MTL REQUIRED) find_package(MTL REQUIRED)
target_link_libraries(AMDiS${POSTFIX} MTL::MTL) target_link_libraries(AMDiS${POSTFIX} MTL::MTL)
target_enable_boost(AMDiS${POSTFIX})
find_package(MuParser 1.34 CONFIG REQUIRED)