Commit 360312dc authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

final CMakeLists reimplementation finished

parent 32fd7bcc
set(CMAKE_LEGACY_CYGWIN_WIN32 0)
cmake_minimum_required(VERSION 2.8 FATAL_ERROR) cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(AMDiS) project(AMDiS)
...@@ -5,8 +6,8 @@ if (USE_NEW_CMAKE AND ${CMAKE_VERSION} VERSION_GREATER "3.0") ...@@ -5,8 +6,8 @@ if (USE_NEW_CMAKE AND ${CMAKE_VERSION} VERSION_GREATER "3.0")
# Experimental implementation of new CMakeLists.txt # Experimental implementation of new CMakeLists.txt
# Can be selected by calling cmake -DUSE_NEW_CMAKE=ON . # Can be selected by calling cmake -DUSE_NEW_CMAKE=ON .
# Use only if you know what you are doing :-) # Use only if you know what you are doing :-)
include(${AMDiS_SOURCE_DIR}/cmake3/CMakeLists_3.0.txt) include(${AMDiS_SOURCE_DIR}/cmake3/CMakeLists.txt)
else () else ()
# By defualt the classical CMakeLists file ist used # By defualt the classical CMakeLists file ist used
include(${AMDiS_SOURCE_DIR}/cmake/CMakeLists_2.8.txt) include(${AMDiS_SOURCE_DIR}/cmake/CMakeLists.txt)
endif () endif ()
...@@ -20,19 +20,22 @@ endif () ...@@ -20,19 +20,22 @@ endif ()
list(APPEND CMAKE_MODULE_PATH ${AMDIS_DIR}) list(APPEND CMAKE_MODULE_PATH ${AMDIS_DIR})
set(IS_AMDISCONFIG true)
set(AMDIS_NEED_ZOLTAN @ENABLE_ZOLTAN@) set(AMDIS_NEED_ZOLTAN @ENABLE_ZOLTAN@)
set(AMDIS_NEED_CXX11 @ENABLE_CXX11@) set(AMDIS_NEED_CXX11 @ENABLE_CXX11@)
set(AMDIS_NEED_UMFPACK @ENABLE_UMFPACK@) set(AMDIS_NEED_UMFPACK @ENABLE_UMFPACK@)
set(AMDIS_HAS_PARALLEL_DOMAIN @ENABLE_PARALLEL_DOMAIN@) set(AMDIS_HAS_PARALLEL_DOMAIN @ENABLE_PARALLEL_DOMAIN@)
set(AMDIS_NEED_COMPRESSION @ENABLE_COMPRESSION@) set(AMDIS_NEED_COMPRESSION @ENABLE_COMPRESSION@)
set(BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
add_library(amdis_base INTERFACE) add_library(amdis_base INTERFACE)
add_library(AMDiS ALIAS amdis_base) add_library(AMDiS ALIAS amdis_base)
target_compile_definitions(amdis_base INTERFACE target_compile_definitions(amdis_base INTERFACE
$<$<CONFIG:Debug>:DEBUG=1> $<$<CONFIG:Release>:DEBUG=0>
$<$<CONFIG:Release>:DEBUG=0>) $<$<NOT:$<CONFIG:Release>>:DEBUG=1>)
if (AMDIS_NEED_CXX11) if (AMDIS_NEED_CXX11)
target_compile_features(amdis_base INTERFACE target_compile_features(amdis_base INTERFACE
...@@ -55,7 +58,7 @@ find_file(_AMDIS_H AMDiS.h PATHS ${AMDIS_DIR}/../../include/amdis/) ...@@ -55,7 +58,7 @@ find_file(_AMDIS_H AMDiS.h PATHS ${AMDIS_DIR}/../../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)
target_include_directories(amdis_base INTERFACE ${AMDIS_INCLUDE_DIR}) target_include_directories(amdis_base INTERFACE ${AMDIS_INCLUDE_DIR})
target_include_directories(amdis_base INTERFACE ${AMDIS_INCLUDE_DIR}/mtl4) include(find_mtl4)
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 ()
...@@ -75,54 +78,30 @@ unset(_AMDIS_LIB CACHE) ...@@ -75,54 +78,30 @@ unset(_AMDIS_LIB CACHE)
# Boost libraries # Boost libraries
# --------------- # ---------------
set(BOOST_LIBS_REQUIRED system iostreams filesystem program_options date_time) if (NOT BOOST_ROOT)
if (WIN32) set(BOOST_ROOT @BOOST_ROOT@)
list(APPEND BOOST_LIBS_REQUIRED zlib) endif (NOT BOOST_ROOT)
if (AMDIS_NEED_COMPRESSION) if (NOT BOOST_LIBRARYDIR)
list(APPEND BOOST_LIBS_REQUIRED bzip2) set(BOOST_LIBRARYDIR @BOOST_LIBRARYDIR@)
endif () endif (NOT BOOST_LIBRARYDIR)
endif () include(find_boost)
set(BOOST_VERSION "1.48")
find_package(Boost ${BOOST_VERSION} REQUIRED ${BOOST_LIBS_REQUIRED})
if (Boost_FOUND)
target_include_directories(amdis_base INTERFACE ${Boost_INCLUDE_DIR})
target_link_libraries(amdis_base INTERFACE ${Boost_LIBRARIES})
else ()
message(ERROR "Boost libraries not found")
endif(Boost_FOUND)
# umfpack library # umfpack library
# -------------------- # --------------------
if (AMDIS_NEED_UMFPACK) if (AMDIS_NEED_UMFPACK)
set(AMDIS_SuiteSparse_DIR @SuiteSparse_DIR@)
set(AMDIS_UMFPACK_INCLUDE_DIR @UMFPACK_INCLUDE_DIRS@) set(AMDIS_UMFPACK_INCLUDE_DIR @UMFPACK_INCLUDE_DIRS@)
set(AMDIS_UMFPACK_LIB_DIR ${AMDIS_UMFPACK_INCLUDE_DIR}/../lib) set(AMDIS_UMFPACK_LIB_DIR ${AMDIS_UMFPACK_INCLUDE_DIR}/../include)
find_file(UMFPACK_H umfpack.h HINTS ${AMDIS_UMFPACK_INCLUDE_DIR}) include(find_umfpack)
find_library(UMFPACK_LIBRARY umfpack HINTS ${AMDIS_UMFPACK_LIB_DIR})
if (UMFPACK_H AND UMFPACK_LIBRARY)
get_filename_component(UMFPACK_INCLUDE_DIRS ${UMFPACK_H} PATH)
target_include_directories(amdis_base INTERFACE ${UMFPACK_INCLUDE_DIRS})
find_library(AMD_LIBRARY amd HINTS ${AMDIS_UMFPACK_LIB_DIR})
find_library(BLAS_LIBRARY blas HINTS ${AMDIS_UMFPACK_LIB_DIR})
if (AMD_LIBRARY AND BLAS_LIBRARY)
target_link_libraries(amdis_base INTERFACE
${UMFPACK_LIBRARY}
${AMD_LIBRARY}
${BLAS_LIBRARY})
# TODO: add test whether umfpack is configured successfully
endif()
else()
message(FATAL_ERROR "Could not find the UMFPACK library")
endif()
endif (AMDIS_NEED_UMFPACK) endif (AMDIS_NEED_UMFPACK)
# Parallel amdis # Parallel amdis
# -------------- # --------------
if (AMDIS_HAS_PARALLEL_DOMAIN) if (AMDIS_HAS_PARALLEL_DOMAIN)
target_compile_definitions(amdis_base INTERFACE
HAVE_PARALLEL_DOMAIN_AMDIS=1)
find_package(MPI REQUIRED) find_package(MPI REQUIRED)
if (MPI_FOUND) if (MPI_FOUND)
target_include_directories(amdis_base INTERFACE ${MPI_INCLUDE_PATH}) target_include_directories(amdis_base INTERFACE ${MPI_INCLUDE_PATH})
...@@ -137,18 +116,13 @@ if (AMDIS_HAS_PARALLEL_DOMAIN) ...@@ -137,18 +116,13 @@ if (AMDIS_HAS_PARALLEL_DOMAIN)
target_include_directories(amdis_base INTERFACE ${PETSC_INCLUDES}) target_include_directories(amdis_base INTERFACE ${PETSC_INCLUDES})
target_link_libraries(amdis_base INTERFACE target_link_libraries(amdis_base INTERFACE
${PETSC_LIBRARY_SYS} ${PETSC_LIBRARY_SYS}
${PETSC_LIBRARIES}) ${PETSC_LIBRARIES}
blas lapack)
target_compile_definitions(amdis_base INTERFACE
HAVE_PARALLEL_PETSC=1)
else() else()
message(FATAL_ERROR "Could not find PETSc!") message(FATAL_ERROR "Could not find PETSc!")
endif (PETSc_FOUND) endif (PETSc_FOUND)
find_library(_AMDIS_PARALLEL_LIB amdis_parallel PATHS ${AMDIS_DIR}/../../lib/amdis/)
if (_AMDIS_PARALLEL_LIB)
target_link_libraries(amdis_base INTERFACE ${_AMDIS_PARALLEL_LIB})
else ()
message(ERROR "Could not detect the AMDiS::parallel library. Please set the variable _AMDIS_PARALLEL_LIB to this library.")
endif ()
unset(_AMDIS_PARALLEL_LIB CACHE)
endif (AMDIS_HAS_PARALLEL_DOMAIN) endif (AMDIS_HAS_PARALLEL_DOMAIN)
...@@ -187,6 +161,7 @@ else () ...@@ -187,6 +161,7 @@ else ()
endif () endif ()
unset(_MUPARSER_LIB CACHE) unset(_MUPARSER_LIB CACHE)
# Zoltan library # Zoltan library
# -------------- # --------------
if (AMDIS_NEED_ZOLTAN) if (AMDIS_NEED_ZOLTAN)
......
cmake_minimum_required(VERSION 3.2 FATAL_ERROR) cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
project(AMDiS VERSION 0.9 LANGUAGES CXX) project(AMDiS VERSION 0.9 LANGUAGES CXX)
message(WARNING "This is an experimental CMakeLists.txt file.")
set(BASE_DIR ${AMDiS_SOURCE_DIR}) set(BASE_DIR ${AMDiS_SOURCE_DIR})
set(SOURCE_DIR ${BASE_DIR}/src) set(SOURCE_DIR ${BASE_DIR}/src)
list(APPEND CMAKE_MODULE_PATH ${BASE_DIR}/cmake3) list(APPEND CMAKE_MODULE_PATH ${BASE_DIR}/cmake3)
option(BUILD_SHARED_LIBS "Build all libraries as shared or static, default: shared" true)
option(ENABLE_CXX11 "Enable C++11 compiler features" false) option(ENABLE_CXX11 "Enable C++11 compiler features" false)
option(ENABLE_PARALLEL_DOMAIN "Use parallel domain decomposition" false) option(ENABLE_PARALLEL_DOMAIN "Use parallel domain decomposition" false)
option(ENABLE_UMFPACK "Use of UMFPACK solver" false) option(ENABLE_UMFPACK "Enable support for the UMFPACK solver" false)
option(ENABLE_COMPRESSION "Use output compression" false) option(ENABLE_COMPRESSION "Use output compression for vtu and arh files" false)
option(ENABLE_EXTENSIONS "Use extensions for AMDiS" false)
option(BUILD_SHARED_LIBS "Build all libraries as shared or static, default: shared" ON)
if (MSVC)
# if (${CMAKE_VERSION} VERSION_LESS "3.4")
set(BUILD_SHARED_LIBS OFF)
mark_as_advanced(BUILD_SHARED_LIBS)
message(WARNING "Currently we can only build static libraries wiht Visual Studio")
# elseif (BUILD_SHARED_LIBS)
# set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS true)
# set(MSVC_SHARED_LIBS true)
# endif ()
endif (MSVC)
add_library(amdis_base INTERFACE) add_library(amdis_base INTERFACE)
add_library(AMDiS::base ALIAS amdis_base) add_library(AMDiS::base ALIAS amdis_base)
target_include_directories(amdis_base INTERFACE ${SOURCE_DIR}) target_include_directories(amdis_base INTERFACE ${SOURCE_DIR})
target_compile_definitions(amdis_base INTERFACE target_compile_definitions(amdis_base INTERFACE
$<$<CONFIG:Debug>:DEBUG=1> $<$<CONFIG:Release>:DEBUG=0>
$<$<CONFIG:Release>:DEBUG=0>) $<$<NOT:$<CONFIG:Release>>:DEBUG=1>)
if (ENABLE_CXX11) if (ENABLE_CXX11)
target_compile_features(amdis_base INTERFACE target_compile_features(amdis_base INTERFACE
...@@ -37,7 +50,10 @@ endif (ENABLE_CXX11) ...@@ -37,7 +50,10 @@ endif (ENABLE_CXX11)
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
include(find_mtl4) # -> target mtl4 include(find_mtl4) # -> target mtl4
install(FILES ${BASE_DIR}/cmake3/find_mtl4.cmake DESTINATION share/amdis/)
include(find_boost) # -> target boost include(find_boost) # -> target boost
install(FILES ${BASE_DIR}/cmake3/find_boost.cmake DESTINATION share/amdis/)
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
...@@ -65,7 +81,6 @@ add_library(amdis ...@@ -65,7 +81,6 @@ add_library(amdis
${SOURCE_DIR}/DOFIndexed.cc ${SOURCE_DIR}/DOFIndexed.cc
${SOURCE_DIR}/DOFMatrix.cc ${SOURCE_DIR}/DOFMatrix.cc
${SOURCE_DIR}/DOFVector.cc ${SOURCE_DIR}/DOFVector.cc
${SOURCE_DIR}/Debug.cc
${SOURCE_DIR}/DirichletBC.cc ${SOURCE_DIR}/DirichletBC.cc
${SOURCE_DIR}/DualTraverse.cc ${SOURCE_DIR}/DualTraverse.cc
${SOURCE_DIR}/ElInfo.cc ${SOURCE_DIR}/ElInfo.cc
...@@ -82,8 +97,6 @@ add_library(amdis ...@@ -82,8 +97,6 @@ add_library(amdis
${SOURCE_DIR}/FirstOrderTerm.cc ${SOURCE_DIR}/FirstOrderTerm.cc
${SOURCE_DIR}/FixVec.cc ${SOURCE_DIR}/FixVec.cc
${SOURCE_DIR}/Global.cc ${SOURCE_DIR}/Global.cc
${SOURCE_DIR}/GlobalDOFNumbering.cc
${SOURCE_DIR}/GlobalElementNumbering.cc
${SOURCE_DIR}/Initfile.cc ${SOURCE_DIR}/Initfile.cc
${SOURCE_DIR}/Lagrange.cc ${SOURCE_DIR}/Lagrange.cc
${SOURCE_DIR}/LeafData.cc ${SOURCE_DIR}/LeafData.cc
...@@ -100,7 +113,6 @@ add_library(amdis ...@@ -100,7 +113,6 @@ add_library(amdis
${SOURCE_DIR}/ProblemInstat.cc ${SOURCE_DIR}/ProblemInstat.cc
${SOURCE_DIR}/ProblemInterpol.cc ${SOURCE_DIR}/ProblemInterpol.cc
${SOURCE_DIR}/ProblemStat.cc ${SOURCE_DIR}/ProblemStat.cc
${SOURCE_DIR}/ProblemStatDbg.cc
${SOURCE_DIR}/Projection.cc ${SOURCE_DIR}/Projection.cc
${SOURCE_DIR}/QPInfo.cc ${SOURCE_DIR}/QPInfo.cc
${SOURCE_DIR}/QPsiPhi.cc ${SOURCE_DIR}/QPsiPhi.cc
...@@ -167,15 +179,28 @@ add_library(amdis ...@@ -167,15 +179,28 @@ add_library(amdis
${SOURCE_DIR}/time/RosenbrockAdaptInstationary.cc ${SOURCE_DIR}/time/RosenbrockAdaptInstationary.cc
${SOURCE_DIR}/time/RosenbrockMethod.cc ${SOURCE_DIR}/time/RosenbrockMethod.cc
${SOURCE_DIR}/time/RosenbrockStationary.cc ${SOURCE_DIR}/time/RosenbrockStationary.cc
) )
add_library(amdis_debug INTERFACE)
target_sources(amdis_debug INTERFACE
${SOURCE_DIR}/Debug.cc
${SOURCE_DIR}/GlobalDOFNumbering.cc # not used by any other class
${SOURCE_DIR}/GlobalElementNumbering.cc # not used by any other class
${SOURCE_DIR}/ProblemStatDbg.cc
)
if (ENABLE_COMPRESSION) if (ENABLE_COMPRESSION)
target_compile_definitions(amdis PRIVATE HAVE_COMPRESSION=1) target_compile_definitions(amdis PRIVATE HAVE_COMPRESSION=1)
endif (ENABLE_COMPRESSION) endif (ENABLE_COMPRESSION)
include(amdis_parallel) # -> target AMDiS::parallel if (ENABLE_UMFPACK)
target_compile_definitions(amdis PRIVATE HAVE_UMFPACK=1)
endif (ENABLE_UMFPACK)
include(amdis_parallel) # adds sources to amdis
include(amdis_reinit) # -> target AMDiS::reinit include(amdis_reinit) # -> target AMDiS::reinit
include(amdis_compositeFEM) # -> target AMDiS::compositeFEM include(amdis_compositeFEM) # -> target AMDiS::compositeFEM
include(amdis_extensions) # -> target AMDiS::extensions
include(muparser) # -> target muparser include(muparser) # -> target muparser
...@@ -185,11 +210,8 @@ if (MSVC) ...@@ -185,11 +210,8 @@ if (MSVC)
_CRT_SECURE_NO_WARNINGS) _CRT_SECURE_NO_WARNINGS)
endif (MSVC) endif (MSVC)
target_link_libraries(amdis AMDiS::base AMDiS::reinit AMDiS::compositeFEM muparser) target_link_libraries(amdis AMDiS::base muparser
if (ENABLE_PARALLEL_DOMAIN) $<$<CONFIG:Debug>:amdis_debug>)
target_link_libraries(amdis AMDiS::parallel)
endif (ENABLE_PARALLEL_DOMAIN)
# specify how to install this target: # specify how to install this target:
# ----------------------------------- # -----------------------------------
...@@ -213,7 +235,3 @@ configure_file(${BASE_DIR}/cmake3/AMDISConfig.cmake.in ...@@ -213,7 +235,3 @@ configure_file(${BASE_DIR}/cmake3/AMDISConfig.cmake.in
) )
install(FILES ${AMDiS_BINARY_DIR}/AMDISConfig.cmake DESTINATION share/amdis/) install(FILES ${AMDiS_BINARY_DIR}/AMDISConfig.cmake DESTINATION share/amdis/)
# file(GLOB CMAKE_FILES "${BASE_DIR}/cmake3/*.cmake")
# install(FILES ${CMAKE_FILES} DESTINATION share/amdis/)
...@@ -16,7 +16,7 @@ add_library(AMDiS::compositeFEM ALIAS amdis_compositeFEM) ...@@ -16,7 +16,7 @@ add_library(AMDiS::compositeFEM ALIAS amdis_compositeFEM)
target_compile_definitions(amdis_compositeFEM PUBLIC target_compile_definitions(amdis_compositeFEM PUBLIC
HAVE_COMPOSITE_FEM=1) HAVE_COMPOSITE_FEM=1)
target_include_directories(amdis_compositeFEM PRIVATE ${COMPOSITE_SOURCE_DIR}) target_include_directories(amdis_compositeFEM PRIVATE ${COMPOSITE_SOURCE_DIR})
target_link_libraries(amdis_compositeFEM amdis_base) target_link_libraries(amdis_compositeFEM amdis)
# specify how to install this target: # specify how to install this target:
# ----------------------------------- # -----------------------------------
......
if (ENABLE_EXTENSIONS)
option(ENABLE_BASE_PROBLEMS "Use base_problems" true)
find_path(EXTENSIONS_DIR NAMES Helpers.h
HINTS ${BASE_DIR}/../extensions
DOC "Path to AMDiS extensions.")
if (EXTENSIONS_DIR)
if (NOT EXISTS ${EXTENSIONS_DIR}/Helpers.h OR NOT EXISTS ${EXTENSIONS_DIR}/ExtendedProblemStat.h)
message(FATAL_ERROR "Wrong extensions directory! Directory must contain the files 'Helpers.h' and 'ExtendedProblemStath'")
endif ()
add_library(amdis_extensions
${EXTENSIONS_DIR}/Helpers.cc
${EXTENSIONS_DIR}/BackgroundMesh.cc
${EXTENSIONS_DIR}/GeometryTools.cc
${EXTENSIONS_DIR}/POperators.cc
${EXTENSIONS_DIR}/SingularDirichletBC2.cc
${EXTENSIONS_DIR}/time/ExtendedRosenbrockStationary.cc
${EXTENSIONS_DIR}/pugixml/src/pugixml.cpp
)
add_library(AMDiS::extensions ALIAS amdis_extensions)
target_compile_definitions(amdis_extensions PRIVATE HAVE_EXTENSIONS=1)
target_include_directories(amdis_extensions PRIVATE
${EXTENSIONS_DIR}
${EXTENSIONS_DIR}/time
${EXTENSIONS_DIR}/nanoflann
${EXTENSIONS_DIR}/pugixml/src
)
set(INSTALL_SUBDIRS . time preconditioner nanflann)
if (ENABLE_SEQ_PETSC)
target_sources(amdis_extensions PRIVATE
${EXTENSIONS_DIR}/preconditioner/PetscPreconPfc.cc
${EXTENSIONS_DIR}/preconditioner/PetscPreconPfcDiag.cc
${EXTENSIONS_DIR}/preconditioner/PetscPreconCahnHilliard.cc)
endif (ENABLE_SEQ_PETSC)
if (ENABLE_PARALLEL_DOMAIN)
target_sources(amdis_extensions PRIVATE
${EXTENSIONS_DIR}/preconditioner/PetscSolverPfc.cc
${EXTENSIONS_DIR}/preconditioner/PetscSolverPfc_diag.cc)
target_link_libraries(amdis_extensions amdis_parallel)
endif (ENABLE_PARALLEL_DOMAIN)
if (ENABLE_BASE_PROBLEMS)
target_sources(amdis_extensions PRIVATE
${EXTENSIONS_DIR}/base_problems/CahnHilliard.cc
${EXTENSIONS_DIR}/base_problems/CahnHilliard_RB.cc
${EXTENSIONS_DIR}/base_problems/CahnHilliardNavierStokes.cc
${EXTENSIONS_DIR}/base_problems/CahnHilliardNavierStokes_RB.cc
${EXTENSIONS_DIR}/base_problems/CahnHilliardNavierStokes_TwoPhase.cc
${EXTENSIONS_DIR}/base_problems/CahnHilliardNavierStokes_TwoPhase_RB.cc
${EXTENSIONS_DIR}/base_problems/DiffuseDomainFsi.cc
${EXTENSIONS_DIR}/base_problems/LinearElasticity.cc
${EXTENSIONS_DIR}/base_problems/LinearElasticityPhase.cc
${EXTENSIONS_DIR}/base_problems/NavierStokesCahnHilliard.cc
${EXTENSIONS_DIR}/base_problems/NavierStokesPhase_TaylorHood.cc
${EXTENSIONS_DIR}/base_problems/NavierStokes_TaylorHood.cc
${EXTENSIONS_DIR}/base_problems/NavierStokes_TaylorHood_RB.cc
${EXTENSIONS_DIR}/base_problems/NavierStokes_TH_MultiPhase.cc
${EXTENSIONS_DIR}/base_problems/NavierStokes_TH_MultiPhase_RB.cc
${EXTENSIONS_DIR}/base_problems/PhaseFieldCrystal.cc
${EXTENSIONS_DIR}/base_problems/PhaseFieldCrystal_Phase.cc
${EXTENSIONS_DIR}/base_problems/PhaseFieldCrystal_RB.cc
${EXTENSIONS_DIR}/base_problems/PolarizationField.cc
${EXTENSIONS_DIR}/base_problems/QuasiCrystal.cc
${EXTENSIONS_DIR}/base_problems/QuasiCrystal_RB.cc)
# ${EXTENSIONS_DIR}/base_problems/NavierStokes_Chorin.cc
# ${EXTENSIONS_DIR}/base_problems/NavierStokesPhase_Chorin.cc
# ${EXTENSIONS_DIR}/base_problems/VacancyPhaseFieldCrystal.cc
target_compile_definitions(amdis_extensions PRIVATE HAVE_BASE_PROBLEMS=1)
target_include_directories(amdis_extensions PRIVATE ${EXTENSIONS_DIR}/base_problems)
list(APPEND INSTALL_SUBDIRS base_problems)
endif (ENABLE_BASE_PROBLEMS)
target_link_libraries(amdis_extensions amdis amdis_reinit)
# specify how to install this target:
# -----------------------------------
foreach (SUBDIR ${INSTALL_SUBDIRS})
file(GLOB HEADERS "${EXTENSIONS_DIR}/${SUBDIR}/*.h*")
install(FILES ${HEADERS} DESTINATION include/amdis/extensions/${SUBDIR}/)
endforeach ()
file(GLOB HEADERS "${EXTENSIONS_DIR}/pugixml/src/*.hpp")
install(FILES ${HEADERS} DESTINATION include/amdis/extensions/pugixml/)
install(TARGETS amdis_extensions DESTINATION lib/amdis/)
endif (EXTENSIONS_DIR)
endif (ENABLE_EXTENSIONS)
...@@ -2,8 +2,8 @@ if (ENABLE_PARALLEL_DOMAIN) ...@@ -2,8 +2,8 @@ if (ENABLE_PARALLEL_DOMAIN)
option(ENABLE_ZOLTAN "Add support for the Parallel Partitioning suite Zoltan" false) option(ENABLE_ZOLTAN "Add support for the Parallel Partitioning suite Zoltan" false)
option(ENABLE_PARALLEL_SOLVERS "Add some problem dependent solver, e.g. Feti, Navier-Stokes and Cahn-Hilliard" false) option(ENABLE_PARALLEL_SOLVERS "Add some problem dependent solver, e.g. Feti, Navier-Stokes and Cahn-Hilliard" false)
add_library(amdis_parallel add_library(amdis_parallel INTERFACE)
${SOURCE_DIR}/parallel/BddcMlSolver.cc target_sources(amdis PRIVATE
${SOURCE_DIR}/parallel/DofComm.cc ${SOURCE_DIR}/parallel/DofComm.cc
${SOURCE_DIR}/parallel/CheckerPartitioner.cc ${SOURCE_DIR}/parallel/CheckerPartitioner.cc
${SOURCE_DIR}/parallel/ElementObjectDatabase.cc ${SOURCE_DIR}/parallel/ElementObjectDatabase.cc
...@@ -13,27 +13,27 @@ if (ENABLE_PARALLEL_DOMAIN) ...@@ -13,27 +13,27 @@ if (ENABLE_PARALLEL_DOMAIN)
${SOURCE_DIR}/parallel/MeshManipulation.cc ${SOURCE_DIR}/parallel/MeshManipulation.cc
${SOURCE_DIR}/parallel/MeshPartitioner.cc ${SOURCE_DIR}/parallel/MeshPartitioner.cc
${SOURCE_DIR}/parallel/MpiHelper.cc ${SOURCE_DIR}/parallel/MpiHelper.cc
${SOURCE_DIR}/parallel/ParallelDebug.cc
${SOURCE_DIR}/parallel/ParallelDofMapping.cc ${SOURCE_DIR}/parallel/ParallelDofMapping.cc
${SOURCE_DIR}/parallel/ParallelProblemStat.cc ${SOURCE_DIR}/parallel/ParallelProblemStat.cc
${SOURCE_DIR}/parallel/ParallelSolver.cc ${SOURCE_DIR}/parallel/ParallelSolver.cc
${SOURCE_DIR}/parallel/PeriodicMap.cc ${SOURCE_DIR}/parallel/PeriodicMap.cc
${SOURCE_DIR}/parallel/ParMetisPartitioner.cc ${SOURCE_DIR}/parallel/ParMetisPartitioner.cc
${SOURCE_DIR}/parallel/StdMpi.cc ${SOURCE_DIR}/parallel/StdMpi.cc
${SOURCE_DIR}/parallel/ZoltanPartitioner.cc
) )
add_library(AMDiS::parallel ALIAS amdis_parallel)
target_compile_definitions(amdis_parallel PUBLIC target_sources(amdis_debug INTERFACE
${SOURCE_DIR}/parallel/ParallelDebug.cc
)
target_compile_definitions(amdis_parallel INTERFACE
HAVE_PARALLEL_DOMAIN_AMDIS=1) HAVE_PARALLEL_DOMAIN_AMDIS=1)
target_link_libraries(amdis_parallel amdis_base)
# MPI is required # MPI is required
find_package(MPI REQUIRED) find_package(MPI REQUIRED)
if (MPI_FOUND) if (MPI_FOUND)
target_include_directories(amdis_parallel PUBLIC target_include_directories(amdis_parallel INTERFACE
${MPI_INCLUDE_PATH}) ${MPI_INCLUDE_PATH})
target_compile_options(amdis_parallel PUBLIC target_compile_options(amdis_parallel INTERFACE
${MPI_COMPILE_FLAGS}) ${MPI_COMPILE_FLAGS})
endif (MPI_FOUND) endif (MPI_FOUND)
...@@ -41,7 +41,7 @@ if (ENABLE_PARALLEL_DOMAIN) ...@@ -41,7 +41,7 @@ if (ENABLE_PARALLEL_DOMAIN)
set(PETSC_EXECUTABLE_RUNS ON) set(PETSC_EXECUTABLE_RUNS ON)
include(find_petsc) include(find_petsc)
if (PETSc_FOUND) if (PETSc_FOUND)
target_include_directories(amdis_parallel PUBLIC target_include_directories(amdis_parallel INTERFACE
${PETSC_DIR}/include ${PETSC_DIR}/include
${PETSC_DIR}/${PETSC_ARCH}/include) ${PETSC_DIR}/${PETSC_ARCH}/include)
...@@ -49,7 +49,7 @@ if (ENABLE_PARALLEL_DOMAIN) ...@@ -49,7 +49,7 @@ if (ENABLE_PARALLEL_DOMAIN)
find_file(PARMETIS_HEADER_FILE "parmetis.h" HINTS ${PETSC_DIR}/include ) find_file(PARMETIS_HEADER_FILE "parmetis.h" HINTS ${PETSC_DIR}/include )
if (PARMETIS_HEADER_FILE) if (PARMETIS_HEADER_FILE)
get_filename_component(PARMETIS_INCLUDE_PATH "${PARMETIS_HEADER_FILE}" PATH CACHE) get_filename_component(PARMETIS_INCLUDE_PATH "${PARMETIS_HEADER_FILE}" PATH CACHE)
target_include_directories(amdis_parallel PUBLIC ${PARMETIS_INCLUDE_PATH}) target_include_directories(amdis_parallel INTERFACE ${PARMETIS_INCLUDE_PATH})
else() else()
message(FATAL_ERROR "Could not find ParMetis header file 'parmetis.h'!") message(FATAL_ERROR "Could not find ParMetis header file 'parmetis.h'!")
endif (PARMETIS_HEADER_FILE) endif (PARMETIS_HEADER_FILE)
...@@ -59,15 +59,24 @@ if (ENABLE_PARALLEL_DOMAIN) ...@@ -59,15 +59,24 @@ if (ENABLE_PARALLEL_DOMAIN)
find_file(ZOLTAN_HEADER_FILE "zoltan_cpp.h" HINTS ${PETSC_DIR}/include) find_file(ZOLTAN_HEADER_FILE "zoltan_cpp.h" HINTS ${PETSC_DIR}/include)
if (ZOLTAN_HEADER_FILE) if (ZOLTAN_HEADER_FILE)
get_filename_component(ZOLTAN_HEADER_DIR "${ZOLTAN_HEADER_FILE}" PATH CACHE) get_filename_component(ZOLTAN_HEADER_DIR "${ZOLTAN_HEADER_FILE}" PATH CACHE)
target_include_directories(amdis_parallel PRIVATE ${ZOLTAN_HEADER_DIR}) target_include_directories(amdis_parallel PRIINTERFACEVATE ${ZOLTAN_HEADER_DIR})
target_compile_definitions(amdis_parallel PRIVATE HAVE_ZOLTAN=1)
else() else()
message(FATAL_ERROR "Could not find Zoltan include file 'zoltan_cpp.h'!") message(FATAL_ERROR "Could not find Zoltan include file 'zoltan_cpp.h'!")
endif(ZOLTAN_HEADER_FILE) endif(ZOLTAN_HEADER_FILE)
target_compile_definitions(amdis_parallel INTERFACE HAVE_ZOLTAN=1)
target_sources(amdis PRIVATE
${SOURCE_DIR}/parallel/ZoltanPartitioner.cc)
endif (ENABLE_ZOLTAN) endif (ENABLE_ZOLTAN)
if (ENABLE_BDDCML)
target_compile_definitions(amdis_parallel INTERFACE HAVE_BDDCML=1)
target_sources(amdis PRIVATE
${SOURCE_DIR}/parallel/BddcMlSolver.cc)
endif (ENABLE_BDDCML)
# add some more source-files that need petsc # add some more source-files that need petsc
target_sources(amdis_parallel PRIVATE target_sources(amdis PRIVATE
${SOURCE_DIR}/parallel/MatrixNnzStructure.cc ${SOURCE_DIR}/parallel/MatrixNnzStructure.cc
${SOURCE_DIR}/parallel/ParallelCoarseSpaceSolver.cc ${SOURCE_DIR}/parallel/ParallelCoarseSpaceSolver.cc
${SOURCE_DIR}/parallel/PetscHelper.cc ${SOURCE_DIR}/parallel/PetscHelper.cc
...@@ -78,7 +87,7 @@ if (ENABLE_PARALLEL_DOMAIN) ...@@ -78,7 +87,7 @@ if (ENABLE_PARALLEL_DOMAIN)
) )
if (ENABLE_PARALLEL_SOLVERS) if (ENABLE_PARALLEL_SOLVERS)
target_sources(amdis_parallel PRIVATE</