Commit 32fd7bcc authored by Praetorius, Simon's avatar Praetorius, Simon

CMakeLists changed - must be tested further

parent 98614912
project(AMDIS)
cmake_minimum_required(VERSION 2.6)
cmake_policy(SET CMP0017 OLD)
if(POLICY CMP0042)
cmake_policy(SET CMP0042 NEW)
endif()
if(POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()
SET(LIB_DIR ${AMDIS_SOURCE_DIR}/lib)
SET(SOURCE_DIR ${AMDIS_SOURCE_DIR}/src)
#TODO: use the cmake build type
SET(MTL_INCLUDE_DIR ${LIB_DIR}/mtl4/ CACHE PATH "mtl4 directory")
# set global compile_definitions for all target, depending on build-type
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS
$<$<CONFIG:Debug>:DEBUG=1>
$<$<CONFIG:Release>:DEBUG=0>)
# find_package(Subversion QUIET)
# if(Subversion_FOUND)
# 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()
set(CurrentRevision "0.9")
if(NOT AMDIS_MAJOR)
set(AMDIS_MAJOR "0")
endif()
if(NOT AMDIS_MINOR)
set(AMDIS_MINOR "9")
endif()
list(APPEND COMPILEFLAGS "-DAMDIS_VERSION=${CurrentRevision}")
#define the build type, empty can be everything and nothing
if(CMAKE_BUILD_TYPE STREQUAL "")
set(CMAKE_BUILD_TYPE "Release")
endif()
if(CMAKE_CXX_COMPILER MATCHES ".*icpc")
Message("Compiler: Intel")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -diag-disable 654 -diag-disable 858")
endif()
SET(ENABLE_PARALLEL_DOMAIN "OFF" CACHE STRING "use parallel domain decomposition. please set to one of: PMTL, PETSC, OFF" )
option(ENABLE_CXX11 "Enable C++11 compiler features" false)
option(ENABLE_SEQ_PETSC "Use sequential PETSc solvers" false)
option(ENABLE_UMFPACK "Use of UMFPACK solver" false)
option(ENABLE_HYPRE "Use HYPRE AMG solver" false)
option(ENABLE_PNG "use png reader/writer" false)
option(ENABLE_BDDCML "Use of BDDCML library" false)
mark_as_advanced(ENABLE_BDDCML)
option(ENABLE_EXTENSIONS "Use extensions" false)
option(ENABLE_OPENMP "Use OpenMP" false)
option(ENABLE_COMPRESSION "Use output compression" false)
option(ENABLE_OUTPUT "AMDiS output printing, disable only for debugging!" true)
mark_as_advanced(ENABLE_OUTPUT)
find_package(Boost 1.44 REQUIRED)
if (Boost_FOUND)
list(APPEND AMDIS_INCLUDE_DIRS ${Boost_INCLUDE_DIR})
message("boost lib-dirs: ${Boost_LIBRARY_DIRS}")
message("use the boost dir: ${Boost_INCLUDE_DIR}")
#if (WIN32)
#message("the windows find_boost does not set the boost library paths, please set it")
#SET(Boost_LIBRARY_DIRS CACHE PATH "The directory containing the boost libraries")
#endif (WIN32)
list(APPEND AMDIS_LINK_DIRS ${Boost_LIBRARY_DIRS})
endif (Boost_FOUND)
SET(AMDIS_SRC ${SOURCE_DIR}/AdaptBase.cc
${SOURCE_DIR}/AdaptInfo.cc
${SOURCE_DIR}/AdaptInstationary.cc
${SOURCE_DIR}/AdaptStationary.cc
${SOURCE_DIR}/AMDiS.cc
${SOURCE_DIR}/Assembler.cc
${SOURCE_DIR}/BasisFunction.cc
${SOURCE_DIR}/Boundary.cc
${SOURCE_DIR}/BoundaryManager.cc
${SOURCE_DIR}/BoundaryObject.cc
${SOURCE_DIR}/Bubble.cc
${SOURCE_DIR}/Cholesky.cc
${SOURCE_DIR}/CoarseningManager.cc
${SOURCE_DIR}/CoarseningManager1d.cc
${SOURCE_DIR}/CoarseningManager2d.cc
${SOURCE_DIR}/CoarseningManager3d.cc
${SOURCE_DIR}/ComponentTraverseInfo.cc
${SOURCE_DIR}/CouplingIterationInterface.cc
${SOURCE_DIR}/CreatorMap.cc
${SOURCE_DIR}/DOFAdmin.cc
${SOURCE_DIR}/DOFIndexed.cc
${SOURCE_DIR}/DOFMatrix.cc
${SOURCE_DIR}/DOFVector.cc
${SOURCE_DIR}/Debug.cc
${SOURCE_DIR}/DirichletBC.cc
${SOURCE_DIR}/DualTraverse.cc
${SOURCE_DIR}/ElInfo.cc
${SOURCE_DIR}/ElInfo1d.cc
${SOURCE_DIR}/ElInfo2d.cc
${SOURCE_DIR}/ElInfo3d.cc
${SOURCE_DIR}/ElInfoStack.cc
${SOURCE_DIR}/Element.cc
${SOURCE_DIR}/ElementData.cc
${SOURCE_DIR}/ElementDofIterator.cc
${SOURCE_DIR}/ElementRegion_ED.cc
${SOURCE_DIR}/FiniteElemSpace.cc
${SOURCE_DIR}/FirstOrderAssembler.cc
${SOURCE_DIR}/FirstOrderTerm.cc
${SOURCE_DIR}/FixVec.cc
${SOURCE_DIR}/Global.cc
${SOURCE_DIR}/GlobalDOFNumbering.cc
${SOURCE_DIR}/GlobalElementNumbering.cc
${SOURCE_DIR}/Initfile.cc
${SOURCE_DIR}/Lagrange.cc
${SOURCE_DIR}/LeafData.cc
${SOURCE_DIR}/Line.cc
${SOURCE_DIR}/MacroElement.cc
${SOURCE_DIR}/Marker.cc
${SOURCE_DIR}/MatrixVector.cc
${SOURCE_DIR}/Mesh.cc
${SOURCE_DIR}/MeshStructure.cc
${SOURCE_DIR}/Operator.cc
${SOURCE_DIR}/OperatorTerm.cc
${SOURCE_DIR}/Parametric.cc
${SOURCE_DIR}/PeriodicBC.cc
${SOURCE_DIR}/ProblemInstat.cc
${SOURCE_DIR}/ProblemInterpol.cc
${SOURCE_DIR}/ProblemStat.cc
${SOURCE_DIR}/ProblemStatDbg.cc
${SOURCE_DIR}/Projection.cc
${SOURCE_DIR}/QPInfo.cc
${SOURCE_DIR}/QPsiPhi.cc
${SOURCE_DIR}/Quadrature.cc
${SOURCE_DIR}/RCNeighbourList.cc
${SOURCE_DIR}/Recovery.cc
${SOURCE_DIR}/RefinementManager.cc
${SOURCE_DIR}/RefinementManager1d.cc
${SOURCE_DIR}/RefinementManager2d.cc
${SOURCE_DIR}/RefinementManager3d.cc
${SOURCE_DIR}/RobinBC.cc
${SOURCE_DIR}/ScalableQuadrature.cc
${SOURCE_DIR}/SecondOrderAssembler.cc
${SOURCE_DIR}/SecondOrderTerm.cc
${SOURCE_DIR}/Serializer.cc
${SOURCE_DIR}/StandardProblemIteration.cc
${SOURCE_DIR}/SubAssembler.cc
${SOURCE_DIR}/SubElInfo.cc
${SOURCE_DIR}/SubQuadrature.cc
${SOURCE_DIR}/SurfaceQuadrature.cc
${SOURCE_DIR}/SurfaceRegion_ED.cc
${SOURCE_DIR}/SystemVector.cc
${SOURCE_DIR}/Tetrahedron.cc
${SOURCE_DIR}/Timer.cc
${SOURCE_DIR}/Traverse.cc
${SOURCE_DIR}/Triangle.cc
${SOURCE_DIR}/VertexVector.cc
${SOURCE_DIR}/ZeroOrderAssembler.cc
${SOURCE_DIR}/ZeroOrderTerm.cc
${SOURCE_DIR}/est/Estimator.cc
${SOURCE_DIR}/est/RecoveryEstimator.cc
${SOURCE_DIR}/est/ResidualEstimator.cc
${SOURCE_DIR}/est/SimpleResidualEstimator.cc
${SOURCE_DIR}/io/ArhReader.cc
${SOURCE_DIR}/io/detail/ArhReader.cc
${SOURCE_DIR}/io/Arh2Reader.cc
${SOURCE_DIR}/io/Arh2Writer.cc
${SOURCE_DIR}/io/Arh3Reader.cc
${SOURCE_DIR}/io/Arh3Writer.cc
${SOURCE_DIR}/io/detail/Arh2Reader.cc
${SOURCE_DIR}/io/detail/ArhWriter.cc
${SOURCE_DIR}/io/detail/Arh2Writer.cc
${SOURCE_DIR}/io/detail/Arh3Reader.cc
${SOURCE_DIR}/io/detail/Arh3Writer.cc
${SOURCE_DIR}/io/DofWriter.cc
${SOURCE_DIR}/io/ElementFileWriter.cc
${SOURCE_DIR}/io/FileWriterInterface.cc
${SOURCE_DIR}/io/FileWriter.cc
${SOURCE_DIR}/io/GNUPlotWriter.cc
${SOURCE_DIR}/io/MacroInfo.cc
${SOURCE_DIR}/io/MacroReader.cc
${SOURCE_DIR}/io/MacroWriter.cc
${SOURCE_DIR}/io/PngReader.cc
${SOURCE_DIR}/io/PngWriter.cc
${SOURCE_DIR}/io/PovrayWriter.cc
${SOURCE_DIR}/io/Spreadsheet.cc
${SOURCE_DIR}/io/ValueReader.cc
${SOURCE_DIR}/io/ValueWriter.cc
${SOURCE_DIR}/io/VtkWriter.cc
${SOURCE_DIR}/io/VtkVectorWriter.cc
${SOURCE_DIR}/io/detail/VtkWriter.cc
${SOURCE_DIR}/nonlin/ProblemNonLin.cc
${SOURCE_DIR}/solver/SolverMatrix.cc
${SOURCE_DIR}/time/RosenbrockAdaptInstationary.cc
${SOURCE_DIR}/time/RosenbrockMethod.cc
${SOURCE_DIR}/time/RosenbrockStationary.cc
)
include(cmake/enable_cxx11.cmake)
include(cmake/enable_parallel_domain.cmake)
include(cmake/enable_seq_petsc.cmake)
include(cmake/enable_umfpack.cmake)
include(cmake/enable_hypre.cmake)
include(cmake/enable_png.cmake)
include(cmake/enable_bddcml.cmake)
include(cmake/enable_extensions.cmake)
include(cmake/enable_openmp.cmake)
if(ENABLE_COMPRESSION)
list(APPEND COMPILEFLAGS "-DHAVE_COMPRESSION=1")
endif(ENABLE_COMPRESSION)
if(NOT ENABLE_OUTPUT)
message(WARNING "AMDiS cout output disabled!")
list(APPEND COMPILEFLAGS "-DSUPPRESS_OUTPUT")
endif(NOT ENABLE_OUTPUT)
if(ENABLE_MARMOT)
Message("please set marmotcc manually")
endif(ENABLE_MARMOT)
# composite fem includes
SET(COMPOSITE_SOURCE_DIR ${SOURCE_DIR}/compositeFEM)
SET(COMPOSITE_FEM_SRC ${COMPOSITE_SOURCE_DIR}/CFE_Integration.cc
${COMPOSITE_SOURCE_DIR}/CFE_NormAndErrorFcts.cc
${COMPOSITE_SOURCE_DIR}/CompositeFEMMethods.cc
${COMPOSITE_SOURCE_DIR}/CompositeFEMOperator.cc
${COMPOSITE_SOURCE_DIR}/LevelSetAdaptMesh.cc
${COMPOSITE_SOURCE_DIR}/PenaltyOperator.cc
${COMPOSITE_SOURCE_DIR}/ElementLevelSet.cc
${COMPOSITE_SOURCE_DIR}/SubPolytope.cc
${COMPOSITE_SOURCE_DIR}/SubElementAssembler.cc )
# reinit includes
set(REINIT_SOURCE_DIR ${SOURCE_DIR}/reinit)
file(GLOB REINIT_SRC ${REINIT_SOURCE_DIR}/*.cc)
list(APPEND AMDIS_INCLUDE_DIRS ${REINIT_SOURCE_DIR})
# muparser includes
set(MUPARSER_SOURCE_DIR ${AMDIS_SOURCE_DIR}/lib/muparser_v134)
file(GLOB MUPARSER_SRC ${MUPARSER_SOURCE_DIR}/src/*.cpp)
list(APPEND AMDIS_INCLUDE_DIRS ${MUPARSER_SOURCE_DIR}/include)
# mtl4 includes
list(APPEND AMDIS_INCLUDE_DIRS ${MTL_INCLUDE_DIR})
list(APPEND AMDIS_INCLUDE_DIRS ${SOURCE_DIR})
include_directories(${AMDIS_INCLUDE_DIRS})
if(WIN32)
add_library(amdis STATIC ${AMDIS_SRC} ${PARALLEL_DOMAIN_AMDIS_SRC})
add_library(compositeFEM STATIC ${COMPOSITE_FEM_SRC})
add_library(reinit STATIC ${REINIT_SRC})
add_library(muparser STATIC ${MUPARSER_SRC})
else()
add_library(amdis SHARED ${AMDIS_SRC} ${PARALLEL_DOMAIN_AMDIS_SRC})
add_library(compositeFEM SHARED ${COMPOSITE_FEM_SRC})
add_library(reinit SHARED ${REINIT_SRC})
add_library(muparser SHARED ${MUPARSER_SRC})
endif()
list(APPEND AMDIS_LIBS amdis ${Boost_LIBRARIES})
# some special treatements for Windows systems
# --------------------------------------------
if(WIN32)
list(APPEND COMPILEFLAGS "-D_SCL_SECURE_NO_WARNINGS" "-D_CRT_SECURE_NO_WARNINGS")
endif(WIN32)
# some special treatements for MacOS Systems
# ------------------------------------------
if(CMAKE_SYSTEM_NAME MATCHES Darwin)
if(CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS} -flat_namespace -single_module -undefined dynamic_lookup")
SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS} -flat_namespace -single_module -undefined dynamic_lookup")
set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -bind_at_load -m64")
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -bind_at_load -m64")
endif()
endif()
message("compileflags: ${COMPILEFLAGS}")
add_definitions(${COMPILEFLAGS})
#dont change this destination. the GUI depends on it to guess the buildsystem
FILE(GLOB HEADERS "${SOURCE_DIR}/*.h")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/)
list(APPEND deb_add_dirs "include/amdis")
FILE(GLOB HEADERS "${SOURCE_DIR}/config/*.h*")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/config/)
list(APPEND deb_add_dirs "include/amdis/config")
FILE(GLOB HEADERS "${SOURCE_DIR}/*.hh")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/)
FILE(GLOB HEADERS "${SOURCE_DIR}/*.hpp")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/)
FILE(GLOB HEADERS "${SOURCE_DIR}/parallel/*.h")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/parallel/)
list(APPEND deb_add_dirs "include/amdis/parallel")
FILE(GLOB HEADERS "${SOURCE_DIR}/nonlin/*.h")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/nonlin/)
list(APPEND deb_add_dirs "include/amdis/nonlin")
FILE(GLOB HEADERS "${SOURCE_DIR}/est/*.h")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/est/)
list(APPEND deb_add_dirs "include/amdis/est")
FILE(GLOB HEADERS "${SOURCE_DIR}/expressions/*.h*")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/expressions/)
list(APPEND deb_add_dirs "include/amdis/expressions")
FILE(GLOB HEADERS "${SOURCE_DIR}/operations/*.h*")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/operations/)
list(APPEND deb_add_dirs "include/amdis/operations")
FILE(GLOB HEADERS "${SOURCE_DIR}/traits/*.h*")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/traits/)
list(APPEND deb_add_dirs "include/amdis/traits")
FILE(GLOB HEADERS "${SOURCE_DIR}/utility/*.h*")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/utility/)
list(APPEND deb_add_dirs "include/amdis/utility")
FILE(GLOB HEADERS "${SOURCE_DIR}/time/*.h")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/time/)
list(APPEND deb_add_dirs "include/amdis/time")
FILE(GLOB HEADERS "${SOURCE_DIR}/traits/*.h*")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/traits/)
list(APPEND deb_add_dirs "include/amdis/traits")
FILE(GLOB HEADERS "${SOURCE_DIR}/solver/*.h")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/solver)
list(APPEND deb_add_dirs "include/amdis/solver")
FILE(GLOB HEADERS "${SOURCE_DIR}/solver/*.hh")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/solver)
list(APPEND deb_add_dirs "include/amdis/solver")
FILE(GLOB HEADERS "${SOURCE_DIR}/solver/details/*.h")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/solver/details)
list(APPEND deb_add_dirs "include/amdis/solver/details")
FILE(GLOB HEADERS "${SOURCE_DIR}/solver/itl/*.hpp")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/solver/itl)
list(APPEND deb_add_dirs "include/amdis/solver/itl")
FILE(GLOB HEADERS "${SOURCE_DIR}/solver/details/*.h")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/solver/details)
list(APPEND deb_add_dirs "include/amdis/solver/details")
FILE(GLOB HEADERS "${SOURCE_DIR}/io/*.h")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/io)
list(APPEND deb_add_dirs "include/amdis/io")
FILE(GLOB HEADERS "${SOURCE_DIR}/io/*.hh")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/io)
FILE(GLOB HEADERS "${SOURCE_DIR}/io/detail/*h")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/io/detail)
list(APPEND deb_add_dirs "include/amdis/io/detail")
FILE(GLOB HEADERS "${REINIT_SOURCE_DIR}/*.h")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/reinit)
list(APPEND deb_add_dirs "include/amdis/reinit")
FILE(GLOB HEADERS "${COMPOSITE_SOURCE_DIR}/*.h")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/compositeFEM)
list(APPEND deb_add_dirs "include/amdis/compositeFEM")
FILE(GLOB HEADERS "${MUPARSER_SOURCE_DIR}/include/*.h")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/muparser)
list(APPEND deb_add_dirs "include/amdis/muparser")
list(APPEND deb_add_dirs "lib/amdis")
install(TARGETS amdis compositeFEM reinit muparser
DESTINATION lib/amdis/ )
configure_file(${AMDIS_SOURCE_DIR}/cmake/AMDISConfig.cmake.in
${AMDIS_BINARY_DIR}/AMDISConfig.cmake
@ONLY
)
INSTALL(FILES ${AMDIS_BINARY_DIR}/AMDISConfig.cmake
DESTINATION share/amdis/)
list(APPEND deb_add_dirs "share/amdis/")
FILE(GLOB CMAKE_FILES "${AMDIS_SOURCE_DIR}/cmake/*.cmake")
INSTALL(FILES ${CMAKE_FILES}
DESTINATION share/amdis/)
#install mtl
INSTALL(DIRECTORY ${AMDIS_SOURCE_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
)
FILE(GLOB_RECURSE mtl4_files
RELATIVE ${AMDIS_SOURCE_DIR}/lib/mtl4/boost/
${AMDIS_SOURCE_DIR}/lib/mtl4/boost/*.hpp)
foreach(mtl4_file in ${mtl4_files})
get_filename_component(mtl4File_path ${mtl4_file} PATH)
list(APPEND deb_add_dirs "include/amdis/mtl4/boost/${mtl4File_path}")
endforeach(mtl4_file)
#install documentation
FILE(GLOB DOCS "${AMDIS_SOURCE_DIR}/doc/*.pdf")
INSTALL(FILES ${DOCS} DESTINATION share/amdis/doc)
list(APPEND deb_add_dirs "share/amdis/doc")
list(REMOVE_DUPLICATES deb_add_dirs)
ENABLE_TESTING()
INCLUDE(CTest)
INCLUDE(Dart)
if(NOT CTEST_MODEL)
set(CTEST_MODEL "Experimental")
endif()
if( NOT N_TEST_PROC)
set(N_TEST_PROC "8")
endif()
configure_file(cmake/myMake.sh.in myMake.sh @ONLY)
configure_file(cmake/CTestScript.cmake.in CTestScript.cmake @ONLY)
# PACKAGES
# ========================================================
set(CPACK_PACKAGE_NAME "AMDIS")
set(CPACK_PACKAGE_CONTACT "Andreas.Naumann@tu-dresden.de")
set(CPACK_PACKAGE_VERSION "${CurrentRevision}")
set(CPACK_GENERATOR "RPM" "DEB" "TGZ")
set(CPACK_INSTALL_PREFIX "/usr/")
set(CPACK_RESOURCE_FILE_LICENSE "${AMDIS_SOURCE_DIR}/license.opensource.txt")
# library depends on boost, but boost libraries have version-number in name on some systems.
# so we have to find a workaround to enforce allowed boost versions
set(boost_ver ${Boost_MINOR_VERSION})
math(EXPR boost_ver_start "${Boost_MINOR_VERSION}+1")
math(EXPR boost_ver_stop "${Boost_MINOR_VERSION}+10")
set(boost_depends "libboost${Boost_MAJOR_VERSION}.${boost_ver}-dev (>= ${Boost_MAJOR_VERSION}.${boost_ver})")
set(boost_iostreams_depends "libboost-iostreams${Boost_MAJOR_VERSION}.${boost_ver}-dev (>= ${Boost_MAJOR_VERSION}.${boost_ver})")
set(boost_system_depends "libboost-system${Boost_MAJOR_VERSION}.${boost_ver}-dev (>= ${Boost_MAJOR_VERSION}.${boost_ver})")
set(boost_filesystem_depends "libboost-filesystem${Boost_MAJOR_VERSION}.${boost_ver}-dev (>= ${Boost_MAJOR_VERSION}.${boost_ver})")
foreach(boost_ver RANGE ${boost_ver_start} ${boost_ver_stop})
set(boost_depends "${boost_depends} | libboost${Boost_MAJOR_VERSION}.${boost_ver}-dev (>= ${Boost_MAJOR_VERSION}.${boost_ver})")
set(boost_iostreams_depends "${boost_iostreams_depends} | libboost-iostreams${Boost_MAJOR_VERSION}.${boost_ver}-dev (>= ${Boost_MAJOR_VERSION}.${boost_ver})")
set(boost_system_depends "${boost_system_depends} | libboost-system${Boost_MAJOR_VERSION}.${boost_ver}-dev (>= ${Boost_MAJOR_VERSION}.${boost_ver})")
set(boost_filesystem_depends "${boost_filesystem_depends} | libboost-filesystem${Boost_MAJOR_VERSION}.${boost_ver}-dev (>= ${Boost_MAJOR_VERSION}.${boost_ver})")
endforeach(boost_ver)
configure_file(${AMDIS_SOURCE_DIR}/cmake/preinst.in
${AMDIS_BINARY_DIR}/preinst
@ONLY)
configure_file(${AMDIS_SOURCE_DIR}/cmake/postrm.in
${AMDIS_BINARY_DIR}/postrm
@ONLY)
#----Test if clang setup works----------------------------------------------------------------------
set(COMPILER_VERSION "")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
exec_program(${CMAKE_C_COMPILER} ARGS "-v" OUTPUT_VARIABLE _clang_version_info)
string(REGEX REPLACE "^.*[ ]([0-9]+)\\.[0-9].*$" "\\1" CLANG_MAJOR "${_clang_version_info}")
string(REGEX REPLACE "^.*[ ][0-9]+\\.([0-9]).*$" "\\1" CLANG_MINOR "${_clang_version_info}")
set(COMPILER_VERSION "clang ${CLANG_MAJOR}.${CLANG_MINOR}")
endif()
#---Obtain the major and minor version of the GNU compiler-------------------------------------------
if (CMAKE_COMPILER_IS_GNUCXX)
exec_program(${CMAKE_C_COMPILER} ARGS "-dumpversion" OUTPUT_VARIABLE _gcc_version_info)
string(REGEX REPLACE "^([0-9]+).*$" "\\1" GCC_MAJOR ${_gcc_version_info})
string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*$" "\\1" GCC_MINOR ${_gcc_version_info})
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" GCC_PATCH ${_gcc_version_info})
if(GCC_PATCH MATCHES "\\.+")
set(GCC_PATCH "")
endif()
if(GCC_MINOR MATCHES "\\.+")
set(GCC_MINOR "")
endif()
if(GCC_MAJOR MATCHES "\\.+")
set(GCC_MAJOR "")
endif()
set(COMPILER_VERSION "gcc ${_gcc_version_info}")
endif()
set(CPACK_RPM_PACKAGE_REQUIRES "boost-devel >= ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}, ${RPM_DEPEND_STR}")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${boost_depends},\\n ${boost_iostreams_depends},\\n ${boost_system_depends},\\n ${boost_filesystem_depends}")
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "AMDiS (Adaptive Multi-Dimensional Simulations) - a C++ library to solve partial differential equations using adaptive finite elements. The main features of AMDiS are:
.
- full adaptive meshes in 1D, 2D and 3D
- adaptive time stepping strategies for time dependent equations
- uses high performance Krylov subspace solvers from MTL4 and the direct solvers UMFPACK and Intel's Pardiso
- parallelization of the overall finite element method with excelent scaling up to several thounds of processors
- uses PETSc for solving parallel distributed linear systems
- easy to use interface, no additional effort to run code in parallel!
.
The library is compiled with ${COMPILER_VERSION} and compiled/linked with boost ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}.")
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${AMDIS_BINARY_DIR}/preinst" "${AMDIS_BINARY_DIR}/postrm")
include(CPack)
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(AMDiS)
if (USE_NEW_CMAKE AND ${CMAKE_VERSION} VERSION_GREATER "3.0")
# Experimental implementation of new CMakeLists.txt
# Can be selected by calling cmake -DUSE_NEW_CMAKE=ON .
# Use only if you know what you are doing :-)
include(${AMDiS_SOURCE_DIR}/cmake3/CMakeLists_3.0.txt)
else ()
# By defualt the classical CMakeLists file ist used
include(${AMDiS_SOURCE_DIR}/cmake/CMakeLists_2.8.txt)
endif ()
cmake_minimum_required(VERSION 2.8.10)
project(AMDIS)
cmake_policy(SET CMP0017 OLD)
if(POLICY CMP0042)
cmake_policy(SET CMP0042 NEW)
endif()
if(POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()
SET(LIB_DIR ${AMDIS_SOURCE_DIR}/lib)
SET(SOURCE_DIR ${AMDIS_SOURCE_DIR}/src)
#TODO: use the cmake build type
SET(MTL_INCLUDE_DIR ${LIB_DIR}/mtl4/ CACHE PATH "mtl4 directory")
# set global compile_definitions for all target, depending on build-type
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS
$<$<CONFIG:Debug>:DEBUG=1>
$<$<CONFIG:Release>:DEBUG=0>)
# find_package(Subversion QUIET)
# if(Subversion_FOUND)
# 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()
set(CurrentRevision "0.9")
if(NOT AMDIS_MAJOR)
set(AMDIS_MAJOR "0")
endif()
if(NOT AMDIS_MINOR)
set(AMDIS_MINOR "9")
endif()
list(APPEND COMPILEFLAGS "-DAMDIS_VERSION=${CurrentRevision}")
#define the build type, empty can be everything and nothing
if(CMAKE_BUILD_TYPE STREQUAL "")
set(CMAKE_BUILD_TYPE "Release")
endif()
if(CMAKE_CXX_COMPILER MATCHES ".*icpc")
Message("Compiler: Intel")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -diag-disable 654 -diag-disable 858")
endif()
SET(ENABLE_PARALLEL_DOMAIN "OFF" CACHE STRING "use parallel domain decomposition. please set to one of: PMTL, PETSC, OFF" )
option(ENABLE_CXX11 "Enable C++11 compiler features" false)
option(ENABLE_SEQ_PETSC "Use sequential PETSc solvers" false)
option(ENABLE_UMFPACK "Use of UMFPACK solver" false)
option(ENABLE_HYPRE "Use HYPRE AMG solver" false)
option(ENABLE_PNG "use png reader/writer" false)
option(ENABLE_BDDCML "Use of BDDCML library" false)
mark_as_advanced(ENABLE_BDDCML)
option(ENABLE_EXTENSIONS "Use extensions" false)
option(ENABLE_OPENMP "Use OpenMP" false)
option(ENABLE_COMPRESSION "Use output compression" false)
option(ENABLE_OUTPUT "AMDiS output printing, disable only for debugging!" true)
mark_as_advanced(ENABLE_OUTPUT)
find_package(Boost 1.44 REQUIRED)
if (Boost_FOUND)
list(APPEND AMDIS_INCLUDE_DIRS ${Boost_INCLUDE_DIR})
message("boost lib-dirs: ${Boost_LIBRARY_DIRS}")
message("use the boost dir: ${Boost_INCLUDE_DIR}")
#if (WIN32)
#message("the windows find_boost does not set the boost library paths, please set it")
#SET(Boost_LIBRARY_DIRS CACHE PATH "The directory containing the boost libraries")
#endif (WIN32)
list(APPEND AMDIS_LINK_DIRS ${Boost_LIBRARY_DIRS})
endif (Boost_FOUND)
SET(AMDIS_SRC ${SOURCE_DIR}/AdaptBase.cc
${SOURCE_DIR}/AdaptInfo.cc
${SOURCE_DIR}/AdaptInstationary.cc
${SOURCE_DIR}/AdaptStationary.cc
${SOURCE_DIR}/AMDiS.cc
${SOURCE_DIR}/Assembler.cc
${SOURCE_DIR}/BasisFunction.cc
${SOURCE_DIR}/Boundary.cc