Commit 8376cb3d authored by Praetorius, Simon's avatar Praetorius, Simon

cleaned up cmake configuration for cmake 2.8. TODO: adopt configuration for...

cleaned up cmake configuration for cmake 2.8. TODO: adopt configuration for cmake 3. Parallel AMDiS is now provided as package component
parent 49fb3404
......@@ -2,9 +2,9 @@ set(CMAKE_LEGACY_CYGWIN_WIN32 0)
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(AMDiS)
if (${CMAKE_VERSION} VERSION_GREATER "3.2")
include(${AMDiS_SOURCE_DIR}/cmake3/CMakeLists.txt)
else ()
# if (${CMAKE_VERSION} VERSION_GREATER "3.2")
# include(${AMDiS_SOURCE_DIR}/cmake3/CMakeLists.txt)
# else ()
# Fallback to classical CMakeLists file
include(${AMDiS_SOURCE_DIR}/cmake/CMakeLists.txt)
endif ()
# endif ()
This diff is collapsed.
This diff is collapsed.
......@@ -9,13 +9,26 @@ if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif ()
include(FindPkgConfig)
# Include macros
include(enable_cxx11)
include(enable_mtl4)
include(enable_boost)
include(enable_umfpack)
include(enable_petsc)
include(enable_zoltan)
include(enable_bddcml)
include(enable_hypre)
include(enable_png)
# ------------------------------------------------------------------------------
#some options to control the build process
option(ENABLE_PARALLEL_DOMAIN "Use parallel domain decomposition" false)
option(ENABLE_UMFPACK "Enable support for the UMFPACK solver" true)
option(ENABLE_EXTENSIONS "Use extensions for AMDiS" false)
option(ENABLE_HYPRE "Use HYPRE AMG solver" false)
option(ENABLE_PNG "Use png reader/writer" false)
option(ENABLE_SEQ_PETSC "Use sequential PETSc solvers" false)
# enable/disable some more features
option(ENABLE_COMPRESSION "Use output compression for vtu and arh files" true)
......@@ -41,34 +54,28 @@ endif (MSVC)
include_directories(${SOURCE_DIR})
set(AMDIS_INCLUDE_DIRS "")
set(COMPILEFLAGS "")
set(AMDIS_SRC "")
include(enable_cxx11)
enable_cxx11(ENABLE_CXX11 COMPILEFLAGS)
if (ENABLE_CXX11)
list(APPEND COMPILEFLAGS "-DHAS_CXX11=1")
else ()
list(APPEND COMPILEFLAGS "-DHAS_CXX11=0")
endif (ENABLE_CXX11)
# ------------------------------------------------------------------------------
include(find_mtl4) # -> target mtl4
install(FILES ${BASE_DIR}/cmake/find_mtl4.cmake DESTINATION share/amdis/)
enable_mtl4(COMPILEFLAGS AMDIS_INCLUDE_DIRS _)
enable_boost(COMPILEFLAGS AMDIS_INCLUDE_DIRS _)
if (ENABLE_UMFPACK)
include(enable_umfpack)
enable_umfpack(COMPILEFLAGS AMDIS_INCLUDE_DIRS _)
install(FILES ${BASE_DIR}/cmake/enable_umfpack.cmake DESTINATION share/amdis/)
endif (ENABLE_UMFPACK)
include(enable_boost)
enable_boost(COMPILEFLAGS AMDIS_INCLUDE_DIRS _)
install(FILES ${BASE_DIR}/cmake/enable_boost.cmake DESTINATION share/amdis/)
if (ENABLE_PNG)
enable_png(COMPILEFLAGS AMDIS_INCLUDE_DIRS _)
endif (ENABLE_PNG)
# ------------------------------------------------------------------------------
set(AMDIS_SRC "")
list(APPEND AMDIS_SRC
${SOURCE_DIR}/AdaptBase.cc
${SOURCE_DIR}/AdaptInfo.cc
......@@ -198,20 +205,21 @@ list(APPEND AMDIS_SRC
${SOURCE_DIR}/ProblemStatDbg.cc
)
include(amdis_parallel) # adds sources to amdis
include(amdis_parallel)
include(amdis_extensions)
include(muparser)
# ------------------------------------------------------------------------------
if (ENABLE_PARALLEL_DOMAIN)
set(POSTFIX "-parallel")
else ()
set(POSTFIX "")
endif (ENABLE_PARALLEL_DOMAIN)
if (ENABLE_COMPRESSION)
list(APPEND COMPILEFLAGS "-DHAVE_COMPRESSION=1")
endif (ENABLE_COMPRESSION)
if (ENABLE_UMFPACK)
list(APPEND COMPILEFLAGS "-DHAVE_UMFPACK=1")
endif (ENABLE_UMFPACK)
if (ENABLE_REINIT)
include(amdis_reinit)
endif (ENABLE_REINIT)
......@@ -220,41 +228,57 @@ if (ENABLE_COMPOSITE_FEM)
include(amdis_compositeFEM)
endif (ENABLE_COMPOSITE_FEM)
# ------------------------------------------------------------------------------
if (ENABLE_SEQ_PETSC)
include(amdis_seq_petsc)
endif (ENABLE_SEQ_PETSC)
if (MSVC)
list(APPEND COMPILEFLAGS "-D_SCL_SECURE_NO_WARNINGS" "-D_CRT_SECURE_NO_WARNINGS")
endif (MSVC)
# ------------------------------------------------------------------------------
include_directories(${AMDIS_INCLUDE_DIRS})
add_definitions(${COMPILEFLAGS})
add_library(amdis${POSTFIX} ${AMDIS_SRC} ${PARALLEL_DOMAIN_AMDIS_SRC} ${EXTENSIONS_SRC})
add_library(amdis${POSTFIX}_compositeFEM ${COMPOSITE_FEM_SRC})
add_library(amdis${POSTFIX}_reinit ${REINIT_SRC})
# specify how to install this target:
# -----------------------------------
set(INSTALL_SUBDIRS . config nonlin est expressions operations traits
utility time solver solver/details solver/itl io io/detail)
utility time solver solver/details solver/itl io io/detail)
foreach (SUBDIR ${INSTALL_SUBDIRS})
file(GLOB HEADERS "${SOURCE_DIR}/${SUBDIR}/*.h*")
install(FILES ${HEADERS} DESTINATION include/amdis/${SUBDIR}/)
file(GLOB HEADERS "${SOURCE_DIR}/${SUBDIR}/*.h*")
install(FILES ${HEADERS} DESTINATION include/amdis/${SUBDIR}/)
endforeach ()
message("INCLUDE_DIRS: ${AMDIS_INCLUDE_DIRS}")
include_directories(${AMDIS_INCLUDE_DIRS})
add_definitions(${COMPILEFLAGS})
file(GLOB CMAKE_MACROS "${BASE_DIR}/cmake/enable_*.cmake")
install(FILES ${CMAKE_MACROS} DESTINATION share/amdis/)
install(DIRECTORY ${BASE_DIR}/lib/mtl4/ DESTINATION include/amdis/mtl4/
FILES_MATCHING PATTERN "*.hpp"
PATTERN ".svn" EXCLUDE
PATTERN ".svn/*" EXCLUDE
PATTERN "mtl4/libs" EXCLUDE
PATTERN "mtl4/extern" EXCLUDE)
add_library(amdis ${AMDIS_SRC} ${PARALLEL_DOMAIN_AMDIS_SRC} ${EXTENSIONS_SRC})
add_library(amdis_compositeFEM ${COMPOSITE_FEM_SRC})
add_library(amdis_reinit ${REINIT_SRC})
install(TARGETS
amdis${POSTFIX}
amdis${POSTFIX}_compositeFEM
amdis${POSTFIX}_reinit
DESTINATION lib/amdis/ )
install(TARGETS amdis DESTINATION lib/amdis/ )
# generate configuration file:
# ----------------------------
configure_file(${BASE_DIR}/cmake/AMDISConfig.cmake.in
${AMDiS_BINARY_DIR}/AMDISConfig.cmake
@ONLY
${AMDiS_BINARY_DIR}/AMDISConfig.cmake
@ONLY
)
install(FILES ${AMDiS_BINARY_DIR}/AMDISConfig.cmake DESTINATION share/amdis/)
install(FILES ${BASE_DIR}/cmake/AMDISUse.cmake DESTINATION share/amdis/)
install(FILES ${BASE_DIR}/cmake/enable_cxx11.cmake DESTINATION share/amdis/)
This diff is collapsed.
SET (CTEST_SOURCE_DIRECTORY @CMAKE_CURRENT_SOURCE_DIR@)
SET (CTEST_BINARY_DIRECTORY @CMAKE_CURRENT_BINARY_DIR@)
SET (CTEST_COMMAND "${CMAKE_CTEST_COMMAND}")
SET (CTEST_BUILD_COMMAND ${CTEST_BINARY_DIRECTORY}/myMake.sh)
set(CTEST_UPDATE_COMMAND ${CTEST_SOURCE_DIRECTORY}/MySvn.sh)
#set(CTEST_UPDATE_OPTIONS "--username studentiwr --password iwr_ws09")
set(CTEST_SITE @SITE@)
set(CTEST_BUILD_NAME @BUILDNAME@)
ctest_start(@CTEST_MODEL@)
ctest_build()
ctest_submit()
set(COMPILER_TEST_DIR ${CMAKE_BINARY_DIR}/CMakeFiles/compilerTest)
file(WRITE ${COMPILER_TEST_DIR}/CMakeLists.txt
"project(compilerTest)
cmake_minimum_required(VERSION 2.8)
add_definitions(-std=c++11)
# VARIADIC CLASS_TEMPLATES
add_executable(test_variadic_templ_class test_variadic_templ_class.cpp)
target_link_libraries(test_variadic_templ_class)
# VARIADIC FUNCTION TEMPLATES
add_executable(test_variadic_templ_fct test_variadic_templ_fct.cpp)
target_link_libraries(test_variadic_templ_fct)
# ALIAS TEMPLATES
add_executable(test_alias_templates test_alias_templates.cpp)
target_link_libraries(test_alias_templates)
# DECLTYPE
add_executable(test_decltype test_decltype.cpp)
target_link_libraries(test_decltype)
# AUTO SPECIFIER
add_executable(test_auto test_auto.cpp)
target_link_libraries(test_auto)
# CONSTEXPR
add_executable(test_constexpr test_constexpr.cpp)
target_link_libraries(test_constexpr)
# DELEGATING CONSTRUCTORS
add_executable(test_delegating_constructors test_delegating_constructors.cpp)
target_link_libraries(test_delegating_constructors)
# RANGE-BASED FOR LOOPS
add_executable(test_range_based_for test_range_based_for.cpp)
target_link_libraries(test_range_based_for)")
file(WRITE ${COMPILER_TEST_DIR}/test_variadic_templ_class.cpp
"template<class... Ts> struct A{}; int main(){A<int, double> a;}")
file(WRITE ${COMPILER_TEST_DIR}/test_variadic_templ_fct.cpp
"template<class... Ts> void foo(Ts... ts){}; int main(){foo(1, 2.0, 3.0f);}")
file(WRITE ${COMPILER_TEST_DIR}/test_alias_templates.cpp
"template<class T> struct A{}; template<class T> using B=A<T>; int main(){B<int> b;}")
file(WRITE ${COMPILER_TEST_DIR}/test_decltype.cpp
"int main(){decltype(1) a = 1;}")
file(WRITE ${COMPILER_TEST_DIR}/test_auto.cpp
"int main(){auto a = 1;}")
file(WRITE ${COMPILER_TEST_DIR}/test_constexpr.cpp
"constexpr int foo(){return 1;}; int main(){static constexpr int f = foo();}")
file(WRITE ${COMPILER_TEST_DIR}/test_delegating_constructors.cpp
"struct A{ A(){} A(int) : A(){} }; int main(){ A a(1);}")
file(WRITE ${COMPILER_TEST_DIR}/test_range_based_for.cpp
"int main(){ int vec[10]; for (int& elem : vec) { elem = 1; } }")
set(COMPILER_CXX11_FEATURES "")
try_compile(TEST_VARIADIC_TEMPL_CLASS ${COMPILER_TEST_DIR} ${COMPILER_TEST_DIR} compilerTest test_variadic_templ_class)
try_compile(TEST_VARIADIC_TEMPL_FCT ${COMPILER_TEST_DIR} ${COMPILER_TEST_DIR} compilerTest test_variadic_templ_fct)
if (TEST_VARIADIC_TEMPL_CLASS AND TEST_VARIADIC_TEMPL_FCT)
message("Compiler supports variadic class/ function templates")
list(APPEND COMPILER_CXX11_FEATURES "-DHAS_VARIADIC_TEMPLATES=1")
endif()
try_compile(TEST_ALIAS_TEMPLATES ${COMPILER_TEST_DIR} ${COMPILER_TEST_DIR} compilerTest test_alias_templates)
if (TEST_ALIAS_TEMPLATES)
message("Compiler supports alias-templates")
list(APPEND COMPILER_CXX11_FEATURES "-DHAS_ALIAS_TEMPLATES=1")
endif()
try_compile(TEST_DECLTYPE ${COMPILER_TEST_DIR} ${COMPILER_TEST_DIR} compilerTest test_decltype)
if (TEST_DECLTYPE)
message("Compiler supports decltype")
list(APPEND COMPILER_CXX11_FEATURES "-DHAS_DECLTYPE=1")
endif()
try_compile(TEST_AUTO_SPECIFIER ${COMPILER_TEST_DIR} ${COMPILER_TEST_DIR} compilerTest test_auto)
if (TEST_AUTO_SPECIFIER)
message("Compiler supports auto")
list(APPEND COMPILER_CXX11_FEATURES "-DHAS_AUTO=1")
endif()
try_compile(TEST_CONSTEXPR ${COMPILER_TEST_DIR} ${COMPILER_TEST_DIR} compilerTest test_constexpr)
if (TEST_CONSTEXPR)
message("Compiler supports constexpr")
list(APPEND COMPILER_CXX11_FEATURES "-DHAS_CONSTEXPR=1")
endif()
try_compile(TEST_DELEGATING_CONSTRUCTORS ${COMPILER_TEST_DIR} ${COMPILER_TEST_DIR} compilerTest test_delegating_constructors)
if (TEST_DELEGATING_CONSTRUCTORS)
message("Compiler supports delegating constructors")
list(APPEND COMPILER_CXX11_FEATURES "-DHAS_DELEGATING_CONSTRUCTORS=1")
endif()
try_compile(TEST_RANGED_BASED_FOR ${COMPILER_TEST_DIR} ${COMPILER_TEST_DIR} compilerTest test_range_based_for)
if (TEST_RANGED_BASED_FOR)
message("Compiler supports range-based for loops")
list(APPEND COMPILER_CXX11_FEATURES "-DHAS_RANGE_BASED_FOR=1")
endif()
\ No newline at end of file
find_file(HYPRE_H HYPRE.h)
find_library(HYPRE_LIB HYPRE)
if(HYPRE_H AND HYPRE_LIB)
set(HAVE_HYPRE ON)
find_package(MPI REQUIRED)
#append each library in the hypre_lib directory beginning with HYPRE to the list of hypre libraries
get_filename_component(HLIB_PATH ${HYPRE_LIB} PATH)
file(GLOB HYPRE_OTHER ${HLIB_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}HYPRE*${CMAKE_SHARED_LIBRARY_SUFFIX})
find_library(LAPACK_LIB lapack)
set(HYPRE_LIBRARIES ${MPI_LIBRARIES} ${HYPRE_LIB} ${HYPRE_OTHER} ${LAPACK_LIB})
message("hypre libraries: ${HYPRE_LIBRARIES}")
get_filename_component(HYPRE_INCLUDE_DIRECTORIES ${HYPRE_H} PATH)
list(APPEND HYPRE_INCLUDE_DIRECTORIES ${MPI_CXX_INCLUDE_PATH})
else()
if(HAVE_HYPRE)
message("could not find hypre:")
message("library: ${HYPRE_LIB}")
message("header: ${HYPRE_H}")
endif()
set(HAVE_HYPRE FALSE)
endif()
This diff is collapsed.
#this files sets the cmake variable AMDIS_SUB_MINOR to the subversion global revision
#if the global revision could not be determined, the variable remains empty
#TODO: git compatibility
macro(Subversion_CHECK_WC dir prefix)
set(_Subversion_SAVED_LC_ALL "$ENV{LC_ALL}")
set(ENV{LC_ALL} C)
execute_process(COMMAND ${Subversion_SVN_EXECUTABLE} info ${dir}
OUTPUT_VARIABLE ${prefix}_WC_INFO
ERROR_VARIABLE Subversion_svn_info_error
RESULT_VARIABLE Subversion_svn_info_result
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(${Subversion_svn_info_result} EQUAL 0)
set(${prefix} TRUE)
#message(SEND_ERROR "Command \"${Subversion_SVN_EXECUTABLE} info ${dir}\" failed with output:\n${Subversion_svn_info_error}")
else()
set(${prefix} FALSE)
endif()
# restore the previous LC_ALL
set(ENV{LC_ALL} ${_Subversion_SAVED_LC_ALL})
endmacro()
find_package(Subversion)
if(Subversion_FOUND)
#CMake Version 3.5.2: fatal error in Subversion_WC_INFO if CMAKE_CURRENT_SOURCE_DIR is not a working directory
Subversion_CHECK_WC(${CMAKE_CURRENT_SOURCE_DIR} svn_check)
if(svn_check)
Subversion_WC_INFO(${CMAKE_CURRENT_SOURCE_DIR} svn_info)
#message("svn-rev: ${svn_info_WC_REVISION}")
set(AMDIS_SUB_MINOR "${svn_info_WC_REVISION}")
endif()
endif()
if (ENABLE_EXTENSIONS)
option(ENABLE_BASE_PROBLEMS "Use base_problems" true)
mark_as_advanced(ENABLE_BASE_PROBLEMS)
......
if (ENABLE_PARALLEL_DOMAIN)
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" true)
option(ENABLE_BDDCML "Add support for the BDDCML library" false)
mark_as_advanced(ENABLE_PARALLEL_SOLVERS)
mark_as_advanced(ENABLE_BDDCML)
set(PARALLEL_DOMAIN_AMDIS_SRC
${SOURCE_DIR}/parallel/DofComm.cc
......@@ -24,20 +26,18 @@ if (ENABLE_PARALLEL_DOMAIN)
list(APPEND COMPILEFLAGS "-DHAVE_PARALLEL_DOMAIN_AMDIS=1")
include(enable_petsc)
enable_mpi(COMPILEFLAGS AMDIS_INCLUDE_DIRS _)
enable_petsc(COMPILEFLAGS AMDIS_INCLUDE_DIRS _)
# add support for the zoltan library
if (ENABLE_ZOLTAN)
include(enable_zoltan)
enable_zoltan(COMPILEFLAGS AMDIS_INCLUDE_DIRS _)
list(APPEND PARALLEL_DOMAIN_AMDIS_SRC
${SOURCE_DIR}/parallel/ZoltanPartitioner.cc)
endif (ENABLE_ZOLTAN)
if (ENABLE_BDDCML)
list(APPEND COMPILEFLAGS "-DHAVE_BDDCML=1")
enable_bddcml(COMPILEFLAGS AMDIS_INCLUDE_DIRS _)
list(APPEND PARALLEL_DOMAIN_AMDIS_SRC
${SOURCE_DIR}/parallel/BddcMlSolver.cc)
endif (ENABLE_BDDCML)
......@@ -76,11 +76,9 @@ if (ENABLE_PARALLEL_DOMAIN)
install(FILES ${AMDIS_PARALLEL_HEADERS} DESTINATION include/amdis/parallel/)
install(FILES
${BASE_DIR}/cmake/ResolveCompilerPaths.cmake
${BASE_DIR}/cmake/FindPackageMultipass.cmake
${BASE_DIR}/cmake/CorrectWindowsPaths.cmake
${BASE_DIR}/cmake/FindPETSc.cmake
${BASE_DIR}/cmake/enable_petsc.cmake
${BASE_DIR}/cmake/enable_zoltan.cmake
DESTINATION share/amdis/)
${BASE_DIR}/cmake/ResolveCompilerPaths.cmake
${BASE_DIR}/cmake/FindPackageMultipass.cmake
${BASE_DIR}/cmake/CorrectWindowsPaths.cmake
${BASE_DIR}/cmake/FindPETSc.cmake
DESTINATION share/amdis/)
endif (ENABLE_PARALLEL_DOMAIN)
......@@ -11,4 +11,3 @@ list(APPEND AMDIS_INCLUDE_DIRS ${REINIT_SOURCE_DIR})
file(GLOB RINIT_HEADERS "${REINIT_SOURCE_DIR}/*.h*")
install(FILES ${RINIT_HEADERS} DESTINATION include/amdis/reinit)
if (ENABLE_SEQ_PETSC)
enable_mpi(COMPILEFLAGS AMDIS_INCLUDE_DIRS _)
enable_petsc(COMPILEFLAGS AMDIS_INCLUDE_DIRS _)
list(APPEND COMPILEFLAGS "-DHAVE_SEQ_PETSC=1")
list(APPEND AMDIS_SRC
${SOURCE_DIR}/solver/PetscSolver.cc
${SOURCE_DIR}/solver/PetscTypes.cc)
endif (ENABLE_SEQ_PETSC)
macro(enable_bddcml _FLAGS_ _INC_DIRS_ _LIBS_)
if (${ARGC} GREATER 3)
set(LINK_EXECUTABLE ON)
else ()
set(LINK_EXECUTABLE OFF)
endif ()
if (ENABLE_BDDCML)
SET(BDDCML_LINK_LIST "" CACHE STRING "Further libraries to be linked with BDDCML")
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.")
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)
include_directories(${BDDCML_PATH})
list(APPEND COMPILEFLAGS "-DHAVE_BDDC_ML=1")
list(APPEND COMPILEFLAGS "-DAdd_")
else()
message(FATAL_ERROR "Could not find BDDCML headers.")
endif()
if (BDDCML_H)
get_filename_component(BDDCML_PATH ${BDDCML_H} PATH)
list(APPEND ${_INC_DIRS_} ${BDDCML_PATH})
list(APPEND ${_FLAGS_} "-DHAVE_BDDC_ML=1" "-DAdd_")
else()
message(FATAL_ERROR "Could not find BDDCML headers.")
endif()
find_library(BDDCML_LIB bddcml
HINTS ENV LIBRARY_PATH
DOC "BDDCML library")
if (LINK_EXECUTABLE)
find_library(BDDCML_LIB bddcml
HINTS ENV LIBRARY_PATH
DOC "BDDCML library")
if(BDDCML_LIB)
list(APPEND AMDIS_LIBS ${BDDCML_LIB})
else()
message(FATAL_ERROR "Could not find the BDDCML library")
endif()
if(BDDCML_LIB)
list(APPEND ${_LIBS_} ${BDDCML_LIB})
else()
message(FATAL_ERROR "Could not find the BDDCML library")
endif()
endif (LINK_EXECUTABLE)
find_file(BLOPEX_PATH blopex
HINTS ENV CPATH
DOC "Path to BLOPEX library.")
endif (ENABLE_BDDCML)
list(APPEND ${_FLAGS_} "-DHAVE_BDDCML=1")
endmacro(enable_bddcml)
# TODO: make extensions a subproject
# add_subdirectory(${SOURCE_DIR}/compositeFEM [binarydir])
if (ENABLE_EXTENSIONS)
option(ENABLE_BASE_PROBLEMS "Use base_problems" true)
find_path(EXTENSIONS_DIR NAMES Helpers.h
HINTS ${CMAKE_CURRENT_SOURCE_DIR}/../extensions
DOC "Path to AMDiS extensions.")
if (EXTENSIONS_DIR)
if (NOT EXISTS ${EXTENSIONS_DIR}/Helpers.h OR NOT EXISTS ${EXTENSIONS_DIR}/base_problems/BaseProblem.h)
message(FATAL_ERROR "Wrong extensions directory! Directory must contain the 'Helpers.h' and the subdirectory 'base_problems'")
else()
SET(EXTENSIONS_SRC
${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)
if(ENABLE_SEQ_PETSC)
list(APPEND EXTENSIONS_SRC
${EXTENSIONS_DIR}/preconditioner/PetscPreconPfc.cc
${EXTENSIONS_DIR}/preconditioner/PetscPreconPfcDiag.cc
${EXTENSIONS_DIR}/preconditioner/PetscPreconCahnHilliard.cc)
endif(ENABLE_SEQ_PETSC)
if(ENABLE_PARALLEL_DOMAIN)
list(APPEND EXTENSIONS_SRC
# ${EXTENSIONS_DIR}/preconditioner/PetscSolverNavierStokes2.cc
${EXTENSIONS_DIR}/preconditioner/PetscSolverPfc.cc
${EXTENSIONS_DIR}/preconditioner/PetscSolverPfc_diag.cc)
endif(ENABLE_PARALLEL_DOMAIN)
list(APPEND COMPILEFLAGS "-DHAVE_EXTENSIONS=1")
list(APPEND AMDIS_INCLUDE_DIRS ${EXTENSIONS_DIR})
list(APPEND AMDIS_INCLUDE_DIRS ${EXTENSIONS_DIR}/time)
list(APPEND AMDIS_INCLUDE_DIRS ${EXTENSIONS_DIR}/nanoflann)
list(APPEND AMDIS_INCLUDE_DIRS ${EXTENSIONS_DIR}/pugixml/src)
if(WIN32)
add_library(extensions STATIC ${EXTENSIONS_SRC})
else()
add_library(extensions SHARED ${EXTENSIONS_SRC})
endif()
list(APPEND AMDIS_LIBS extensions)
FILE(GLOB HEADERS "${EXTENSIONS_DIR}/*.h")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/extensions/)
FILE(GLOB HEADERS "${EXTENSIONS_DIR}/*.hh")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/extensions/)
list(APPEND deb_add_dirs "include/amdis/extensions")
FILE(GLOB HEADERS "${EXTENSIONS_DIR}/time/*.h")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/extensions/time/)
FILE(GLOB HEADERS "${EXTENSIONS_DIR}/time/*.hh")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/extensions/time/)
FILE(GLOB HEADERS "${EXTENSIONS_DIR}/preconditioner/*.h")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/extensions/preconditioner/)
FILE(GLOB HEADERS "${EXTENSIONS_DIR}/preconditioner/*.hh")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/extensions/preconditioner/)
list(APPEND deb_add_dirs "include/amdis/extensions/time")
FILE(GLOB HEADERS "${EXTENSIONS_DIR}/nanoflann/*.hpp")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/extensions/nanoflann/)
list(APPEND deb_add_dirs "include/amdis/extensions/nanoflann")
FILE(GLOB HEADERS "${EXTENSIONS_DIR}/pugixml/src/*.hpp")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/extensions/pugixml/)
list(APPEND deb_add_dirs "include/amdis/extensions/pugixml")
install(TARGETS extensions
DESTINATION lib/amdis/ )
# === baseProblems ====================================================================
if(ENABLE_BASE_PROBLEMS)
SET(BASE_PROBLEMS_SRC
${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/NavierStokes_Chorin.cc
${EXTENSIONS_DIR}/base_problems/NavierStokesCahnHilliard.cc
# ${EXTENSIONS_DIR}/base_problems/NavierStokesPhase_Chorin.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/VacancyPhaseFieldCrystal.cc
)
list(APPEND COMPILEFLAGS "-DHAVE_BASE_PROBLEMS=1")
list(APPEND AMDIS_INCLUDE_DIRS ${EXTENSIONS_DIR}/base_problems)
if(WIN32)
add_library(base_problems STATIC ${BASE_PROBLEMS_SRC})
else()
add_library(base_problems SHARED ${BASE_PROBLEMS_SRC})
endif()
list(APPEND AMDIS_LIBS base_problems)
FILE(GLOB HEADERS "${EXTENSIONS_DIR}/base_problems/*.h")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/base_problems/)
FILE(GLOB HEADERS "${EXTENSIONS_DIR}/base_problems/*.hh")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/base_problems/)
list(APPEND deb_add_dirs "include/amdis/base_problems")
install(TARGETS base_problems
DESTINATION lib/amdis/ )
endif(ENABLE_BASE_PROBLEMS)
endif()
endif()
endif (ENABLE_EXTENSIONS)
macro(enable_hypre _FLAGS_ _INC_DIRS_ _LIBS_)
if (${ARGC} GREATER 3)
set(LINK_EXECUTABLE ON)
else ()