Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • iwr/amdis
  • backofen/amdis
  • aland/amdis
3 results
Show changes
Commits on Source (1213)
Showing
with 1171 additions and 744 deletions
# ignore generated .vtu and .pvd files,
*.vtu
*.pvd
*.pvtu
*.vtk
# ignore ARH files
*.arh
*.parh
*.tarh
*.kate-swp
*.tmp
# ignore build directories
build*/
install*/
output*/
# ignore CMake files
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
---
image: mathiwr/amdis-base:debian9
stages:
- build
- demo
- test
# compile amdis
build:9-debug-gcc:
stage: build
script:
- tools/build_amdis.sh --stage build --config Debug
artifacts:
paths:
- install/
name: "$CI_BUILD_NAME"
expire_in: 6 hrs
build:9-release-gcc:
stage: build
script:
- tools/build_amdis.sh --stage build --config Release
artifacts:
paths:
- install/
name: "$CI_BUILD_NAME"
expire_in: 6 hrs
build:9-parallel-debug-gcc:
stage: build
script:
- tools/build_amdis.sh --stage build --config Debug --parallel
artifacts:
paths:
- install/
name: "$CI_BUILD_NAME"
expire_in: 6 hrs
build:9-parallel-release-gcc:
stage: build
script:
- tools/build_amdis.sh --stage build --config Release --parallel
artifacts:
paths:
- install/
name: "$CI_BUILD_NAME"
expire_in: 6 hrs
# compile the demos
demo:9-debug-gcc:
stage: demo
script:
- tools/build_amdis.sh --stage demo --config Debug
dependencies:
- build:9-debug-gcc
demo:9-release-gcc:
stage: demo
script:
- tools/build_amdis.sh --stage demo --config Release
dependencies:
- build:9-release-gcc
demo:9-parallel-debug-gcc:
stage: demo
script:
- tools/build_amdis.sh --stage demo --config Debug --parallel
dependencies:
- build:9-parallel-debug-gcc
demo:9-parallel-release-gcc:
stage: demo
script:
- tools/build_amdis.sh --stage demo --config Release --parallel
dependencies:
- build:9-parallel-release-gcc
# compiel and run the tests
test:9-debug-gcc:
stage: test
script:
- tools/build_amdis.sh --stage test --config Debug
dependencies:
- build:9-debug-gcc
test:9-release-gcc:
stage: test
script:
- tools/build_amdis.sh --stage test --config Release
dependencies:
- build:9-release-gcc
test:9-parallel-debug-gcc:
stage: test
script:
- tools/build_amdis.sh --stage test --config Debug --parallel
dependencies:
- build:9-parallel-debug-gcc
test:9-parallel-release-gcc:
stage: test
script:
- tools/build_amdis.sh --stage test --config Release --parallel
dependencies:
- build:9-parallel-release-gcc
#This configuration file is shipped with the great FEM-Toolbox AMDiS.
#It simplifies the configure of different amdis-version and sets some variables.
#We set the following variables:
# AMDIS_INCLUDE_DIR the amdis-directory only
# AMDIS_INCLUDE_DIRS all include directories (mtl, umfpack, parmetis, metis, ...)
# AMDIS_LIBRARIES the needed libraries
# AMDIS_LIBRARY_DIRS the link directories
# AMDiS_COMPILEFLAGS some compile flags for amdis
#
#
# For a fast start, you use this package in the following way
# simply look for it, possibly set the AMDiS directory
# find_package(AMDiS )
# include(${AMDIS_USE_FILE})
# add_executable(yourTarget <yourSources>)
# target_link_libraries(yourTarget ${AMDIS_LIBRARIES})
#
#
#The AMDIS_USE_FILE adds the include and link-directories for amdis to cmake.
#
#If you use the parallel amdis-version, the AMDIS_USE_FILE also trys to detect
#the mpi and petsc configuration. If those versions don't fit your needs,
#you can change the corresponding directories, or simply do this work at your own
#and omit the AMDIS_USE_FILE. Then you also have to set the flags, include
#and library directories.
################## ONLY WORKAROUND AND WARNING ###################
if(NOT "$ENV{LIBRARY_PATH}" STREQUAL "")
message(WARNING "the environment variable LIBRARY_PATH is set. this can lead to problems during linking. \n You can unset it in your CMakeLists.txt with the command unset(ENV{LIBRARY_PATH}).\n")
endif()
##################################################################
#try to detect the AMDiS include directory
find_file(_AMDIS_H AMDiS.h PATHS ${AMDIS_INCLUDE_DIR} ${AMDIS_DIR}/../../include/amdis/ /usr/include/amdis/)
if(_AMDIS_H)
get_filename_component(AMDIS_INCLUDE_DIR ${_AMDIS_H} PATH CACHE)
set(AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR})
else()
message(ERROR "could not detect the AMDiS include directory. Please set the variable AMDIS_INCLUDE_DIR to the directory containing the AMDiS headers.")
endif()
unset(_AMDIS_H CACHE)
set(MTL_DIR ${AMDIS_INCLUDE_DIR}/mtl4 CACHE PATH "the mtl directory")
list(APPEND AMDIS_INCLUDE_DIRS ${MTL_DIR})
find_library(_AMDIS_LIB amdis PATHS ${AMDIS_LIBRARY_DIR} ${AMDIS_DIR}/../../lib/amdis/ /usr/include/amdis)
if(_AMDIS_LIB)
get_filename_component(AMDIS_LIBRARY_DIR ${_AMDIS_LIB} PATH CACHE)
set(AMDIS_LIBRARY_DIRS ${AMDIS_LIBRARY_DIR})
set(AMDIS_LIBRARIES "${_AMDIS_LIB};${AMDIS_LIBRARY_DIR}/libcompositeFEM.so;${AMDIS_LIBRARY_DIR}/libreinit.so;${AMDIS_LIBRARY_DIR}/libmuparser.so" CACHE STRING "amdis libraries")
else()
message(ERROR "could not detect the AMDiS library directory. Please set the variable AMDIS_LIBRARY_DIR to the directory containg the AMDiS library")
endif()
unset(_AMDIS_LIB CACHE)
find_package(Boost 1.42 REQUIRED system iostreams filesystem)
if(Boost_FOUND)
list(APPEND AMDIS_LIBRARIES ${Boost_LIBRARIES})
list(APPEND AMDIS_LIBRARY_DIRS ${Boost_LIBRARY_DIRS})
list(APPEND AMDIS_INCLUDE_DIRS ${Boost_INCLUDE_DIR})
endif(Boost_FOUND)
set(AMDIS_NEED_ZOLTAN @ENABLE_ZOLTAN@)
set(AMDIS_HAS_PARALLEL_DOMAIN @ENABLE_PARALLEL_DOMAIN@)
set(AMDIS_NEED_UMFPACK @ENABLE_UMFPACK@)
set(AMDIS_NEED_MKL @ENABLE_MKL@)
set(AMDIS_USE_FILE ${AMDIS_DIR}/AMDISUse.cmake)
set(AMDIS_COMPILEFLAGS "@COMPILEFLAGS@")
set(AMDIS_VERSION @CurrentRevision@)
set(AMDIS_MAJOR_VERSION @AMDIS_MAJOR@)
set(AMDIS_MINOR_VERSION @AMDIS_MINOR@)
if(AMDIS_NEED_UMFPACK)
set(AMDIS_UMFPACK_PATH @UMFPACK_PATH@)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_UMFPACK_PATH})
find_library(UMFPACK_LIB umfpack
HINTS ENV LIBRARY_PATH
DOC "The UMFPACK library")
if(UMFPACK_LIB)
list(APPEND AMDIS_LIBRARIES ${UMFPACK_LIB})
else()
message(FATAL_ERROR "Could not find the UMFPACK library")
endif()
find_library(BLAS_LIBRARY NAMES "blas" "goto" "mkl"
HINTS ENV MKL_LIB
DOC "The BLAS library")
if(BLAS_LIBRARY)
list(APPEND AMDIS_LIBRARIES ${BLAS_LIBRARY})
list(APPEND AMDIS_LIBRARY_DIRS ${BLAS_LIBRARY_DIR})
else()
message(ERROR "Could not find the BLAS library. Please set the variable BLAS_LIBRARY to the blas library with full path")
endif()
find_library(AMD_LIB amd
HINTS ENV LIBRARY_PATH
DOC "The AMD library")
if(AMD_LIB)
list(APPEND AMDIS_LIBRARIES ${AMD_LIB})
else()
message(FATAL_ERROR "Could not find the AMD library.")
endif()
endif(AMDIS_NEED_UMFPACK)
#add directories for reinit
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/reinit)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/compositeFEM)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/muparser)
if(${AMDIS_FIND_COMPONENTS} MATCHES umfpack )
if(NOT AMDIS_NEED_UMFPACK)
set(AMDIS_umfpack_FOUND FALSE)
message(SEND_ERROR "The selected amdis was not compiled with umfpack")
endif()
endif()
if(AMDIS_NEED_ZOLTAN)
find_library(ZOLTAN_LIB zoltan
HINTS ENV LIBRARY_PATH
DOC "full path to the zoltan library")
if(ZOLTAN_LIB)
list(APPEND AMDIS_LIBRARIES ${ZOLTAN_LIB})
else()
message(FATAL_ERROR "Could not find zoltan library!")
endif()
endif()
#load mpi-compiler for use with parmetis and parallel_domain
if(AMDIS_HAS_PARALLEL_DOMAIN)
find_package(MPI REQUIRED)
if(MPI_FOUND)
list(APPEND AMDIS_LIBRARIES ${MPI_LIBRARIES})
list(APPEND AMDIS_COMPILEFLAGS ${MPI_COMPILE_FLAGS})
list(APPEND AMDIS_INCLUDE_DIRS ${MPI_INCLUDE_PATH})
endif(MPI_FOUND)
if(AMDIS_HAS_PARALLEL_DOMAIN STREQUAL "PETSC")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${AMDIS_DIR})
set(PETSC_EXECUTABLE_RUNS ON)
find_package(PETSc REQUIRED)
if(PETSC_FOUND)
list(APPEND AMDIS_LIBRARIES ${PETSC_LIBRARY_SYS} ${PETSC_LIBRARIES})
list(APPEND AMDIS_INCLUDE_DIRS ${PETSC_INCLUDES})
else()
message(FATAL_ERROR "Could not find PETSc!")
endif(PETSC_FOUND)
elseif(AMDIS_HAS_PARALLEL_DOMAIN STREQUAL "PMTL")
find_package(MTL REQUIRED)
list(APPEND AMDIS_LIBRARIES ${MTL_LIBRARIES})
find_library(PARMETIS_LIB parmetis)
if(PARMETIS_LIB)
list(APPEND AMDIS_LIBRARIES ${PARMETIS_LIB})
else(PARMETIS_LIB)
message(ERROR "could not find the parmetis libraries needed by amdis")
endif(PARMETIS_LIB)
endif()
endif(AMDIS_HAS_PARALLEL_DOMAIN)
#thats bad because it affects each target
add_definitions(${AMDIS_COMPILEFLAGS})
include_directories(${AMDIS_INCLUDE_DIRS})
project(AMDIS)
cmake_minimum_required(VERSION 2.6)
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(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -g -Wall -DDEBUG=0")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -DDEBUG=1 -O0")
if(NOT CurrentRevision)
find_package(Subversion)
if(Subversion_FOUND)
Subversion_WC_INFO(${CMAKE_CURRENT_SOURCE_DIR} svn_info)
#message("svn-rev: ${svn_info_WC_REVISION}")
set(CurrentRevision "0.9.${svn_info_WC_REVISION}")
endif()
endif()
if(NOT AMDIS_MAJOR)
set(AMDIS_MAJOR "0")
endif()
if(NOT AMDIS_MINOR)
set(AMDIS_MINOR "9")
endif()
set(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()
#option(ENABLE_INTEL "use intel compiler" false)
SET(ENABLE_PARALLEL_DOMAIN "OFF" CACHE STRING "use parallel domain decomposition. please set to one of: PMTL, PETSC, OFF" )
option(USE_PETSC_DEV false)
option(ENABLE_ZOLTAN false)
option(ENABLE_UMFPACK "use umfpack solver" false)
if(ENABLE_INTEL)
Message("please set the icc manually")
INCLUDE (CMakeForceCompiler)
CMAKE_FORCE_C_COMPILER(icc "intel C compiler")
CMAKE_FORCE_CXX_COMPILER(icpc "intel C++ compiler")
#SET(CMAKE_C_COMPILER "icc")
endif(ENABLE_INTEL)
find_package(Boost 1.42 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}/Assembler.cc
${SOURCE_DIR}/BasisFunction.cc
${SOURCE_DIR}/Boundary.cc
${SOURCE_DIR}/BoundaryManager.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}/Estimator.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}/Mesh.cc
${SOURCE_DIR}/MeshStructure.cc
${SOURCE_DIR}/Operator.cc
${SOURCE_DIR}/OperatorTerm.cc
${SOURCE_DIR}/Parametric.cc
${SOURCE_DIR}/PeriodicBC.cc
${SOURCE_DIR}/ProblemImplicit.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}/RecoveryEstimator.cc
${SOURCE_DIR}/RefinementManager.cc
${SOURCE_DIR}/RefinementManager1d.cc
${SOURCE_DIR}/RefinementManager2d.cc
${SOURCE_DIR}/RefinementManager3d.cc
${SOURCE_DIR}/ResidualEstimator.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}/SolverMatrix.cc
${SOURCE_DIR}/SubAssembler.cc
${SOURCE_DIR}/SubElInfo.cc
${SOURCE_DIR}/SubQuadrature.cc
${SOURCE_DIR}/SurfaceQuadrature.cc
${SOURCE_DIR}/Tetrahedron.cc
${SOURCE_DIR}/Traverse.cc
${SOURCE_DIR}/Triangle.cc
${SOURCE_DIR}/VertexVector.cc
${SOURCE_DIR}/ZeroOrderAssembler.cc
${SOURCE_DIR}/ZeroOrderTerm.cc
${SOURCE_DIR}/io/ArhReader.cc
${SOURCE_DIR}/io/ArhWriter.cc
${SOURCE_DIR}/io/DataCollector.cc
${SOURCE_DIR}/io/DofWriter.cc
${SOURCE_DIR}/io/ElementFileWriter.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/PngWriter.cc
${SOURCE_DIR}/io/PovrayWriter.cc
${SOURCE_DIR}/io/ValueReader.cc
${SOURCE_DIR}/io/ValueWriter.cc
${SOURCE_DIR}/io/VtkWriter.cc
${SOURCE_DIR}/nonlin/ProblemNonLin.cc
${SOURCE_DIR}/parallel/InteriorBoundary.cc
${SOURCE_DIR}/time/RosenbrockAdaptInstationary.cc
${SOURCE_DIR}/time/RosenbrockMethod.cc
${SOURCE_DIR}/time/RosenbrockStationary.cc
)
if(ENABLE_PARALLEL_DOMAIN)
### Search for MPI compiler and get compile flags and include paths. ###
find_package(MPI REQUIRED)
if(MPI_FOUND)
list(APPEND COMPILEFLAGS "${MPI_COMPILE_FLAGS}")
include_directories(${MPI_INCLUDE_PATH})
endif(MPI_FOUND)
### Search for ParMetis ###
find_file(PARMETIS_HEADER_FILE "parmetis.h" PATH ENV CPATH)
if(PARMETIS_HEADER_FILE)
get_filename_component(PARMETIS_INCLUDE_PATH "${PARMETIS_HEADER_FILE}" PATH CACHE)
include_directories(${PARMETIS_INCLUDE_PATH})
else()
message(FATAL_ERROR "Could not find ParMetis header file!")
endif(PARMETIS_HEADER_FILE)
find_file(PARMETIS_LIB_FILE "libparmetis.a" PATH ENV LIBRARY_PATH)
if(PARMETIS_LIB_FILE)
get_filename_component(PARMETIS_LINK_PATH "${PARMETIS_LIB_FILE}" PATH CACHE)
link_directories(${PARMETIS_LINK_PATH})
else()
message(FATAL_ERROR "Could not find ParMetis library file!")
endif(PARMETIS_LIB_FILE)
### Search for Zoltan ###
if(ENABLE_ZOLTAN)
find_file(ZOLTAN_HEADER_FILE "zoltan_cpp.h" PATH ENV CPATH)
if(ZOLTAN_HEADER_FILE)
get_filename_component(ZOLTAN_HEADER_DIR "${ZOLTAN_HEADER_FILE}" PATH CACHE)
include_directories(${ZOLTAN_HEADER_DIR})
else()
message(FATAL_ERROR "Could not find Zoltan include file!")
endif(ZOLTAN_HEADER_FILE)
list(APPEND COMPILEFLAGS "-DHAVE_ZOLTAN")
endif(ENABLE_ZOLTAN)
list(APPEND COMPILEFLAGS "-DHAVE_PARALLEL_DOMAIN_AMDIS=1")
SET(PARALLEL_DOMAIN_AMDIS_SRC
${SOURCE_DIR}/parallel/ParMetisPartitioner.cc
${SOURCE_DIR}/parallel/CheckerPartitioner.cc
${SOURCE_DIR}/parallel/ElementObjectData.cc
${SOURCE_DIR}/parallel/MeshDistributor.cc
${SOURCE_DIR}/parallel/MeshManipulation.cc
${SOURCE_DIR}/parallel/MeshPartitioner.cc
${SOURCE_DIR}/parallel/MpiHelper.cc
${SOURCE_DIR}/parallel/ParallelDebug.cc
${SOURCE_DIR}/parallel/ParallelProblemStatBase.cc
${SOURCE_DIR}/parallel/ParMetisPartitioner.cc
${SOURCE_DIR}/parallel/StdMpi.cc
${SOURCE_DIR}/parallel/ZoltanPartitioner.cc)
if(ENABLE_PARALLEL_DOMAIN STREQUAL "PETSC")
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};/usr/share/cmake-2.8/Modules/;${CMAKE_SOURCE_DIR}/")
set(PETSC_EXECUTABLE_RUNS ON)
find_package(PETSc REQUIRED)
include_directories(${PETSC_DIR}/include ${PETSC_DIR}/${PETSC_ARCH}/include)
list(APPEND AMDIS_INCLUDE_DIRS ${PETSC_DIR}/include ${PETSC_DIR}/${PETSC_ARCH}/include)
list(APPEND PARALLEL_DOMAIN_AMDIS_SRC ${SOURCE_DIR}/parallel/PetscSolver.cc
${SOURCE_DIR}/parallel/PetscProblemStat.cc
${SOURCE_DIR}/parallel/PetscSolverFeti.cc
${SOURCE_DIR}/parallel/PetscSolverGlobalMatrix.cc
${SOURCE_DIR}/parallel/PetscSolverSchur.cc)
elseif(ENABLE_PARALLEL_DOMAIN STREQUAL "PMTL")
set(MTL_INCLUDE_DIR "")
find_package(MTL REQUIRED)
list(APPEND COMPILEFLAGS "-DMTL_HAS_MPI" "-DHAVE_PARALLEL_MTL4")
list(APPEND PARALLEL_DOMAIN_AMDIS_SRC ${SOURCE_DIR}/parallel/Mtl4Solver.cc)
list(APPEND AMDIS_LIBS ${MTL_LIBRARIES})
else()
message(SEND_ERROR "Set the domain-decomposition version correctly.")
endif()
INSTALL(FILES ResolveCompilerPaths.cmake FindPackageMultipass.cmake FindPETSc.cmake
DESTINATION share/amdis/)
if(USE_PETSC_DEV)
list(APPEND COMPILEFLAGS "-DHAVE_PETSC_DEV")
endif( USE_PETSC_DEV)
endif(ENABLE_PARALLEL_DOMAIN)
if(ENABLE_UMFPACK)
find_file(UMFPACK_H umfpack.h
HINTS ENV CPATH /usr/include /usr/include/suitesparse /usr/include/ufsparse
DOC "headerfile umfpack.h for UMFPACK")
if(UMFPACK_H)
get_filename_component(UMFPACK_PATH ${UMFPACK_H} PATH)
include_directories(${UMFPACK_PATH} ${UFCONFIG_PATH} ${AMD_PATH})
list(APPEND COMPILEFLAGS "-DHAVE_UMFPACK=1" "-DMTL_HAS_UMFPACK")
else()
message(FATAL_ERROR "Could not find the UMFPACK headers.")
endif()
SET(RPM_DEPEND_STR "blas")
endif(ENABLE_UMFPACK)
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 )
set(REINIT_SOURCE_DIR ${SOURCE_DIR}/reinit)
file(GLOB REINIT_SRC ${REINIT_SOURCE_DIR}/*.cc)
include_directories(${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})
#include_directories(${MTL_INCLUDE_DIR})
list(APPEND AMDIS_INCLUDE_DIRS ${SOURCE_DIR})
#include_directories(${SOURCE_DIR})
include_directories(${AMDIS_INCLUDE_DIRS})
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})
#target_link_libraries(compositeFEM amdis)
#target_link_libraries(reinit amdis)
list(APPEND AMDIS_LIBS amdis ${Boost_LIBRARIES})
if(WIN32)
list(APPEND COMPILEFLAGS "-D_SCL_SECURE_NO_WARNINGS" "-D_CRT_SECURE_NO_WARNINGS")
endif(WIN32)
message("compileflags: ${COMPILEFLAGS}")
#SET_TARGET_PROPERTIES(amdis PROPERTIES COMPILE_FLAGS "${COMPILEFLAGS}")
add_definitions(${COMPILEFLAGS})
if(ENABLE_MARMOT)
Message("please set marmotcc manually")
endif(ENABLE_MARMOT)
#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}/*.hh")
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}/time/*.h")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/time/)
list(APPEND deb_add_dirs "include/amdis/time")
FILE(GLOB HEADERS "${SOURCE_DIR}/itl/*.hpp")
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/itl)
list(APPEND deb_add_dirs "include/amdis/itl")
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 "${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
LIBRARY DESTINATION lib/amdis/ )
configure_file(${AMDIS_SOURCE_DIR}/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/")
INSTALL(FILES ${AMDIS_SOURCE_DIR}/AMDISUse.cmake
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)
list(REMOVE_DUPLICATES deb_add_dirs)
#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/")
configure_file(${AMDIS_SOURCE_DIR}/preinst.in
${AMDIS_BINARY_DIR}/preinst
@ONLY)
configure_file(${AMDIS_SOURCE_DIR}/postrm.in
${AMDIS_BINARY_DIR}/postrm
@ONLY)
set(CPACK_RPM_PACKAGE_REQUIRES "boost-devel >= 1.42, ${RPM_DEPEND_STR}")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-dev (>= 1.42), libboost-iostreams-dev (>= 1.42), libboost-system-dev (>= 1.42), libboost-filesystem-dev (>= 1.42)")
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${AMDIS_BINARY_DIR}/preinst" "${AMDIS_BINARY_DIR}/postrm")
include(CPack)
set(CMAKE_LEGACY_CYGWIN_WIN32 0)
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
project(AMDiS)
set(AMDiS_VERSION "1.2.0")
set(BASE_DIR ${AMDiS_SOURCE_DIR})
set(SOURCE_DIR ${BASE_DIR}/src)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
"Choose the type of build, options are: None Debug Release [RelWithDebInfo] MinSizeRel."
FORCE)
endif ()
# ------------------------------------------------------------------------------
# some options to control the build process
option(ENABLE_PARALLEL_DOMAIN "Use parallel domain decomposition" false)
option(ENABLE_MPI "Compile with MPI compiler and library" 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)
include(CMakeDependentOption)
# additional options for parallel_domain
# {
cmake_dependent_option(ENABLE_ZOLTAN
"Add support for the Parallel Partitioning suite Zoltan" false
"ENABLE_PARALLEL_DOMAIN" false)
cmake_dependent_option(ENABLE_PARALLEL_SOLVERS
"Add some problem dependent solver, e.g. Feti, Navier-Stokes and Cahn-Hilliard" true
"ENABLE_PARALLEL_DOMAIN" false)
cmake_dependent_option(ENABLE_BDDCML
"Add support for the BDDCML library" false
"ENABLE_PARALLEL_DOMAIN" false)
# }
# enable/disable some more features
option(ENABLE_COMPRESSION "Use output compression for vtu and arh files" true)
mark_as_advanced(ENABLE_COMPRESSION)
option(ENABLE_REINIT "Compile reinit library" true)
mark_as_advanced(ENABLE_REINIT)
option(ENABLE_COMPOSITE_FEM "Compile compositeFEM library" true)
mark_as_advanced(ENABLE_COMPOSITE_FEM)
option(ENABLE_OPENMP "Compile with OpenMP flags. (Experimental)" false)
mark_as_advanced(ENABLE_OPENMP)
option(ENABLE_SEQ_PETSC "Use sequential PETSc solvers" false)
mark_as_advanced(ENABLE_SEQ_PETSC)
option(BUILD_SHARED_LIBS "Build all libraries as shared or static, default: shared" true)
mark_as_advanced(BUILD_SHARED_LIBS)
if (MSVC)
set(BUILD_SHARED_LIBS false)
mark_as_advanced(BUILD_SHARED_LIBS)
message(WARNING "Currently we can only build static libraries with Visual Studio")
add_definitions(-DNOMINMAX -D_CONSOLE -DSTRICT -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS)
endif (MSVC)
# parallel of sequential version
if (ENABLE_PARALLEL_DOMAIN)
set(ENABLE_MPI 1 CACHE BOOL "Compile with MPI compiler and library" FORCE)
set(POSTFIX "-p")
else ()
set(POSTFIX "-s")
endif ()
# ------------------------------------------------------------------------------
if (${CMAKE_VERSION} VERSION_LESS "3.2")
# Fallback to classical CMakeLists file
include(${AMDiS_SOURCE_DIR}/cmake/CMakeLists.txt)
else ()
include(${AMDiS_SOURCE_DIR}/cmake3/CMakeLists.txt)
endif ()
# ------------------------------------------------------------------------------
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
${AMDiS_BINARY_DIR}/AMDISConfigVersion.cmake
VERSION ${AMDiS_VERSION}
COMPATIBILITY SameMajorVersion
)
install(FILES ${AMDiS_BINARY_DIR}/AMDISConfigVersion.cmake DESTINATION share/amdis/)
<html>
<head>
<title> Using AMDiS with cmake </title>
<style type="text/css" >
.desc { background-color:#E0E0E0; margin-left:100px }
</style >
</head>
<body>
<h1> Using AMDiS with cmake </h1>
With this short page, I will show you, how to use the cmake buildsystem with AMDiS. The introduction consists of two main parts:
<ol>
<li> <a href="#compiling" > compiling and installing AMDiS with CMake </a ></li>
<li> <a href="#using" > using the cmake installed AMDiS in your project </a ></li>
<li> <a href="#faq" > some frequently asked questions </a ></li>
</ol>
<h2> <a name="compiling" > Compiling and installing AMDiS with CMake </a > </h2>
<h3> configure </h3>
There are 3 different configure tools for CMake:
<ul> <li> cmake (non interactive) </li>
<li> ccmake (interactive on command line) </li>
<li> cmake-gui (qt-based gui) </li></ul>
<p>I will use the cmake and ccmake. The autoconf/automake implementation was used directly inside the AMDiS source directory (i.e. the directory you get through svn). To use the CMake buildsystem, I recommend a different directory structure for building and compiling AMDiS. The script <a href="https://gforge.zih.tu-dresden.de/frs/download.php/34/getamdis_cmake.sh" >getamdis_cmake.sh</a>, which can be found on <ah ref="https://gforge.zih.tu-dresden.de" >gforge.zih.tu-dresden.de</a>, creates such a directory structure.</p>
Assume, you have AMDiS downloaded in the directory
<p class="desc" >
/home/joe/work/
</p>
, the AMDiS source directory is
<p class="desc">
/home/joe/work/amdis/AMDiS
</p>
. To configure and compile AMDiS I recommend to create a directory
<p class="desc">
/home/joe/work/amdis_build
</p>
and run
<p class="desc">
cd /home/joe/work/amdis_build<br>
cmake -DCMAKE_INSTALL_PREFIX=${HOME}/programs/ ../amdis/AMDiS
</p>
Compilation and installation is the same as with automake/autoconf:
<p class="desc">
make ; make install
</p>
The last command will install AMDiS to /home/joe/programs
<a href="#config_fast_and_simple" >fast and simple configuration </a>
<a href="#config_with_options" >configuration with options </a>
If you only want to build with standard options, you can simply run
<verbatim> cmake . </verbatim>
<h2> <a name="using" > Using the cmake installed AMDiS in your project </a > </h2>
A cmake-project consists of the source files and a file CMakeLists.txt, which contains a description of needed libraries, headers and programs. If you have a simple project with one program "fooProg", which have to compile only one source file "src/foo.cc", your CMakeLists.txt consist of the following lines:
<p class="desc" >
project(projectName) <br>
cmake_minimum_required(VERSION 2.8)<br><br>
find_package(AMDiS REQUIRED)<br>
if(AMDiS_FOUND)<br>
include(${AMDiS_USE_FILE})<br>
add_executable(fooProg src/foo.cc)<br>
target_link_libraries(fooProg ${AMDIS_LIBRARIES})<br>
endif(AMDiS_FOUND)<br>
</p >
The first two lines
<p class="desc" >
project(projectName) <br>
cmake_minimum_required(VERSION 2.8)
</p >
tell cmake the name of your project and that you whish to use only cmake versions newer than 2.8.<br>
The line
<p class="desc" >
find_package(AMDiS REQUIRED)
</p >
tells cmake, that you want to use AMDiS and it should complain if AMDiS was not found. CMake will print an error message, bu will not stop the execution! With the command
<p class="desc" >
include(${AMDiS_USE_FILE})
</p >
we read an AMDiS specific configuration file, which sets some compilerflags and adds the include directorys. The program is added with
<p class="desc" >
add_executable(fooProg src/foo.cc)
</p >
and we have to tell cmake, that we need the library amdis and each library amdis depends on. This is done with the command
<p class="desc" >
target_link_libraries(fooProg ${AMDIS_LIBRARIES})
</p >
If cmake does not find AMDiS, you have to set the variable AMDIS_DIR to the directory containing the file AMDiSConfig.cmake. This file resides in
<p class="desc" >
$CMAKE_INSTALL_PREFIX/share/amdis/
</p >
<h2 > <a name="faq" > Frequently asked questions </a ></h2 >
<h3 > Boost </h3>
If you have different boost versions on your system and you do not want to use the standard version in /usr/lib and /usr/include, you should set the environment variable BOOST_ROOT to your boost-installation.
<h3 > I will not set the AMDIS_DIR in every project. </h3 >
If you always use the same AMDiS directory, you can add the directory to your PATH variable.
</body>
</html>
Testing AMDiS
--------------
testing the compilation of amdis is done after configuring the binary using cmake. The compile test is run using
ctest -V -S CTestScript.cmake
(omit the argument -V to remove the output)
Hint: This test only compiles the given configuration from a previous cmake run. If you want to test the demos, initfiles and so on, you have to check out https://fusionforge.zih.tu-dresden.de/svn/amdis/trunk/tools/test and have a look at the README there.
set(AMDIS_NEED_CXX11 @ENABLE_CXX11@)
set(AMDIS_NEED_UMFPACK @ENABLE_UMFPACK@)
set(AMDIS_NEED_COMPRESSION @ENABLE_COMPRESSION@)
set(AMDIS_NEED_EXTENSIONS @ENABLE_EXTENSIONS@)
set(AMDIS_NEED_BASE_PROBLEMS @ENABLE_BASE_PROBLEMS@)
set(AMDIS_NEED_REINIT @ENABLE_REINIT@)
set(AMDIS_NEED_COMPOSITE_FEM @ENABLE_COMPOSITE_FEM@)
set(AMDIS_NEED_ZOLTAN @ENABLE_ZOLTAN@)
set(AMDIS_NEED_BDDCML @ENABLE_BDDCML@)
set(AMDIS_NEED_HYPRE @ENABLE_HYPRE@)
set(AMDIS_NEED_PNG @ENABLE_PNG@)
set(AMDIS_NEED_SEQ_PETSC @ENABLE_SEQ_PETSC@)
set(BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
set(CMAKE_BUILD_TYPE @CMAKE_BUILD_TYPE@)
set(AMDIS_COMPILEFLAGS "")
set(AMDIS_INCLUDE_DIRS "")
set(AMDIS_LIBRARIES "")
if (AMDIS_NEED_CXX11)
enable_cxx11(AMDIS_NEED_CXX11 AMDIS_COMPILEFLAGS)
if (NOT AMDIS_NEED_CXX11)
message(FATAL_ERROR "AMDiS was compiled with c++11 support, but the current compiler does not support this feature!")
endif (NOT AMDIS_NEED_CXX11)
list(APPEND AMDIS_COMPILEFLAGS "-DAMDIS_HAS_CXX11=1")
else ()
list(APPEND AMDIS_COMPILEFLAGS "-DAMDIS_HAS_CXX11=0")
endif (AMDIS_NEED_CXX11)
# try to detect the AMDiS include directory
# -------------------------------------------
find_file(_AMDIS_H AMDiS.h PATHS ${AMDIS_DIR}/../../include/amdis/)
if (_AMDIS_H)
get_filename_component(AMDIS_INCLUDE_DIR ${_AMDIS_H} PATH CACHE)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR})
else ()
message(ERROR "Could not detect the AMDiS include directory. Please set the variable AMDIS_INCLUDE_DIR to the directory containing the AMDiS headers.")
endif ()
unset(_AMDIS_H CACHE)
# MTL4 libraries
# --------------------
enable_mtl4(AMDIS_COMPILEFLAGS AMDIS_INCLUDE_DIRS AMDIS_LIBRARIES ON)
# AMDiS base libraries
# --------------------
find_library(_AMDIS_LIB amdis${POSTFIX} PATHS ${AMDIS_DIR}/../../lib/amdis/)
if (_AMDIS_LIB)
list(APPEND AMDIS_LIBRARIES optimized ${_AMDIS_LIB} debug ${_AMDIS_LIB}d)
else ()
message(ERROR "Could not detect the AMDiS${POSTFIX} library. Please set the variable _AMDIS_LIB to the AMDiS${POSTFIX} library.")
endif ()
unset(_AMDIS_LIB CACHE)
# Boost libraries
# ---------------
if (NOT BOOST_ROOT)
set(BOOST_ROOT @BOOST_ROOT@)
endif (NOT BOOST_ROOT)
if (NOT BOOST_LIBRARYDIR)
set(BOOST_LIBRARYDIR @BOOST_LIBRARYDIR@)
endif (NOT BOOST_LIBRARYDIR)
enable_boost(AMDIS_COMPILEFLAGS AMDIS_INCLUDE_DIRS AMDIS_LIBRARIES ON)
# umfpack library
# --------------------
if (AMDIS_NEED_UMFPACK)
set(AMDIS_SuiteSparse_DIR @SuiteSparse_DIR@)
set(AMDIS_UMFPACK_INCLUDE_DIR @UMFPACK_INCLUDE_DIRS@)
set(AMDIS_UMFPACK_LIB_DIR ${AMDIS_UMFPACK_INCLUDE_DIR}/../include)
enable_umfpack(AMDIS_COMPILEFLAGS AMDIS_INCLUDE_DIRS AMDIS_LIBRARIES ON)
endif (AMDIS_NEED_UMFPACK)
# amdis extensions
# ----------------
if (AMDIS_NEED_EXTENSIONS)
find_library(_EXTENSIONS_LIB amdisextensions${POSTFIX} PATHS ${AMDIS_DIR}/../../lib/amdis/)
if (_EXTENSIONS_LIB)
list(APPEND AMDIS_INCLUDE_DIRS
${AMDIS_INCLUDE_DIR}/extensions
${AMDIS_INCLUDE_DIR}/extensions/nanoflann
${AMDIS_INCLUDE_DIR}/extensions/pugixml
${AMDIS_INCLUDE_DIR}/extensions/time)
list(APPEND AMDIS_COMPILEFLAGS "-DHAVE_EXTENSIONS=1")
list(APPEND AMDIS_LIBRARIES optimized ${_EXTENSIONS_LIB} debug ${_EXTENSIONS_LIB}d)
if (AMDIS_NEED_BASE_PROBLEMS)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/extensions/base_problems)
endif (AMDIS_NEED_BASE_PROBLEMS)
else ()
message(FATAL_ERROR "Extensions library not found")
endif ()
unset(_EXTENSIONS_LIB CACHE)
endif (AMDIS_NEED_EXTENSIONS)
# reinit library
# --------------
if (AMDIS_NEED_REINIT)
find_library(_REINIT_LIB amdisreinit${POSTFIX} PATHS ${AMDIS_DIR}/../../lib/amdis/)
if (_REINIT_LIB)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/reinit)
list(APPEND AMDIS_LIBRARIES optimized ${_REINIT_LIB} debug ${_REINIT_LIB}d)
else ()
message(FATAL_ERROR "Reinit library not found")
endif ()
unset(_REINIT_LIB CACHE)
endif (AMDIS_NEED_REINIT)
# compositeFEM library
# --------------------
if (AMDIS_NEED_COMPOSITE_FEM)
find_library(_COMPOSITE_FEM_LIB amdiscompositefem${POSTFIX} PATHS ${AMDIS_DIR}/../../lib/amdis/)
if (_COMPOSITE_FEM_LIB)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/compositeFEM)
list(APPEND AMDIS_LIBRARIES optimized ${_COMPOSITE_FEM_LIB} debug ${_COMPOSITE_FEM_LIB}d)
else ()
message(FATAL_ERROR "CompositeFEM library not found")
endif ()
unset(_COMPOSITE_FEM_LIB CACHE)
endif (AMDIS_NEED_COMPOSITE_FEM)
# muparser library
# --------------------
find_library(_MUPARSER_LIB muparser PATHS ${AMDIS_DIR}/../../lib/amdis/)
if (_MUPARSER_LIB)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/muparser)
list(APPEND AMDIS_LIBRARIES ${_MUPARSER_LIB})
else ()
message(ERROR "MuParser library not found")
endif ()
unset(_MUPARSER_LIB CACHE)
# Additional libraries
# ==================================================================================================
if (AMDIS_HAS_PARALLEL_DOMAIN)
enable_mpi(AMDIS_COMPILEFLAGS AMDIS_INCLUDE_DIRS AMDIS_LIBRARIES ON)
enable_petsc(AMDIS_COMPILEFLAGS AMDIS_INCLUDE_DIRS AMDIS_LIBRARIES ON)
list(APPEND AMDIS_COMPILEFLAGS "-DHAVE_PARALLEL_DOMAIN_AMDIS=1")
endif (AMDIS_HAS_PARALLEL_DOMAIN)
# Zoltan library
# --------------
if (AMDIS_NEED_ZOLTAN)
enable_zoltan(AMDIS_COMPILEFLAGS AMDIS_INCLUDE_DIRS AMDIS_LIBRARIES ON)
endif ()
# BDDCML library
# --------------
if (AMDIS_NEED_BDDCML)
enable_bddcml(AMDIS_COMPILEFLAGS AMDIS_INCLUDE_DIRS AMDIS_LIBRARIES ON)
endif ()
# Hypre library
# --------------
if (AMDIS_NEED_HYPRE)
enable_hypre(AMDIS_COMPILEFLAGS AMDIS_INCLUDE_DIRS AMDIS_LIBRARIES ON)
endif ()
# PNG library
# --------------
if (AMDIS_NEED_PNG)
enable_png(AMDIS_COMPILEFLAGS AMDIS_INCLUDE_DIRS AMDIS_LIBRARIES ON)
endif ()
# Sequential PETSc library
# --------------
if (AMDIS_NEED_SEQ_PETSC AND NOT AMDIS_HAS_PARALLEL_DOMAIN)
enable_mpi(AMDIS_COMPILEFLAGS AMDIS_INCLUDE_DIRS AMDIS_LIBRARIES ON)
enable_petsc(AMDIS_COMPILEFLAGS AMDIS_INCLUDE_DIRS AMDIS_LIBRARIES ON)
list(APPEND COMPILEFLAGS "-DHAVE_SEQ_PETSC=1")
endif ()
# This configuration file is shipped with the FEM-Toolbox AMDiS.
# It simplifies the configure of different amdis-versions.
#
# We set the following variables:
# AMDIS_INCLUDE_DIRS all include directories (mtl, umfpack, parmetis, metis, ...)
# AMDIS_LIBRARIES the needed libraries
# AMDiS_COMPILEFLAGS some compile flags for amdis
#
# Use this package in the following way:
#
# find_package(AMDiS REQUIRED [PARALLEL|SEQUENTIAL])
# add_executable(yourTarget <yourSources>)
# include_directories(${AMDIS_INCLUDE_DIRS})
# compile_definitions(${AMDIS_COMPILEFLAGS})
# target_link_libraries(yourTarget ${AMDIS_LIBRARIES})
#
# The default component for this package is SEQUENTIAL.
#
if (${CMAKE_VERSION} VERSION_LESS "2.8.10")
message(FATAL_ERROR "The Configuration file was created for CMake version >= 2.8.10")
endif ()
list(APPEND CMAKE_MODULE_PATH ${AMDIS_DIR})
set(IS_AMDISCONFIG true)
set(AMDIS_USE_FILE ${AMDIS_DIR}/AMDISUse.cmake)
# 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)
# enable components
# -----------------
if (AMDIS_FIND_REQUIRED_PARALLEL AND AMDIS_FIND_REQUIRED_SEQUENTIAL)
message(WARNING "Choose either SEQUENTIAL or PARALLEL as component, not both! Falling back to the default SEQUENTIAL.")
set(AMDIS_FIND_REQUIRED_PARALLEL OFF)
endif ()
set(AMDIS_CONFIGURATION "")
# parallel of sequential version
if (AMDIS_FIND_REQUIRED_PARALLEL)
set(AMDIS_HAS_PARALLEL_DOMAIN ON)
set(POSTFIX "-p")
list(APPEND AMDIS_CONFIGURATION "PARALLEL")
else ()
set(AMDIS_HAS_PARALLEL_DOMAIN OFF)
set(POSTFIX "-s")
list(APPEND AMDIS_CONFIGURATION "SEQUENTIAL")
endif ()
if (MSVC)
add_definitions(-DNOMINMAX -D_CONSOLE -DSTRICT -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS)
endif (MSVC)
if (NOT EXISTS ${AMDIS_DIR}/AMDIS${POSTFIX}.cmake)
message(FATAL_ERROR "Configuration ${AMDIS_CONFIGURATION} can not be found in ${AMDIS_DIR}.")
endif ()
# include component configuration
include(AMDIS${POSTFIX})
# globally add compile options and include directories
add_definitions(${AMDIS_COMPILEFLAGS})
include_directories(${AMDIS_INCLUDE_DIRS})
cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR)
if(POLICY CMP0048)
cmake_policy(SET CMP0048 OLD)
endif()
project(AMDiS)
# set some policies
cmake_policy(SET CMP0017 OLD)
if(POLICY CMP0042)
cmake_policy(SET CMP0042 NEW)
endif()
if(POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()
list(APPEND CMAKE_MODULE_PATH ${BASE_DIR}/cmake)
# 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)
# ------------------------------------------------------------------------------
include_directories(${SOURCE_DIR})
set(AMDIS_INCLUDE_DIRS "")
set(COMPILEFLAGS "")
enable_cxx11(ENABLE_CXX11 COMPILEFLAGS)
if (ENABLE_CXX11)
list(APPEND COMPILEFLAGS "-DAMDIS_HAS_CXX11=1")
else ()
list(APPEND COMPILEFLAGS "-DAMDIS_HAS_CXX11=0")
endif (ENABLE_CXX11)
enable_mtl4(COMPILEFLAGS AMDIS_INCLUDE_DIRS _)
enable_boost(COMPILEFLAGS AMDIS_INCLUDE_DIRS _)
if (ENABLE_UMFPACK)
enable_umfpack(COMPILEFLAGS AMDIS_INCLUDE_DIRS _)
endif (ENABLE_UMFPACK)
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
${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}/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}/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}/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
# debugging files
${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_MPI)
enable_mpi(COMPILEFLAGS AMDIS_INCLUDE_DIRS _)
list(APPEND COMPILEFLAGS "-DHAVE_MPI=1")
endif (ENABLE_MPI)
include(amdis_parallel)
include(muparser)
# ------------------------------------------------------------------------------
if (ENABLE_COMPRESSION)
list(APPEND COMPILEFLAGS "-DAMDIS_HAS_COMPRESSION")
endif (ENABLE_COMPRESSION)
if (ENABLE_EXTENSIONS)
include(amdis_extensions)
add_library(amdis_extensions ${EXTENSIONS_SRC})
set_target_properties(amdis_extensions PROPERTIES OUTPUT_NAME amdisextensions${POSTFIX}
DEBUG_OUTPUT_NAME amdisextensions${POSTFIX}d)
install(TARGETS amdis_extensions DESTINATION lib/amdis/ )
endif (ENABLE_EXTENSIONS)
if (ENABLE_REINIT)
include(amdis_reinit)
add_library(amdis_reinit ${REINIT_SRC})
set_target_properties(amdis_reinit PROPERTIES OUTPUT_NAME amdisreinit${POSTFIX}
DEBUG_OUTPUT_NAME amdisreinit${POSTFIX}d)
install(TARGETS amdis_reinit DESTINATION lib/amdis/ )
endif (ENABLE_REINIT)
if (ENABLE_COMPOSITE_FEM)
include(amdis_compositeFEM)
add_library(amdis_compositeFEM ${COMPOSITE_FEM_SRC})
set_target_properties(amdis_compositeFEM PROPERTIES OUTPUT_NAME amdiscompositefem${POSTFIX}
DEBUG_OUTPUT_NAME amdiscompositefem${POSTFIX}d)
install(TARGETS amdis_compositeFEM DESTINATION lib/amdis/ )
endif (ENABLE_COMPOSITE_FEM)
if (ENABLE_SEQ_PETSC)
include(amdis_seq_petsc)
endif (ENABLE_SEQ_PETSC)
# ------------------------------------------------------------------------------
include_directories(${AMDIS_INCLUDE_DIRS})
add_definitions(${COMPILEFLAGS})
add_library(amdis ${AMDIS_SRC} ${PARALLEL_DOMAIN_AMDIS_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)
foreach (SUBDIR ${INSTALL_SUBDIRS})
file(GLOB HEADERS "${SOURCE_DIR}/${SUBDIR}/*.h*")
install(FILES ${HEADERS} DESTINATION include/amdis/${SUBDIR}/)
endforeach ()
file(GLOB CMAKE_MACROS "${BASE_DIR}/cmake/enable_*.cmake")
install(FILES ${CMAKE_MACROS} DESTINATION share/amdis/)
install(FILES ${BASE_DIR}/cmake3/parse_zoltan_makefile.cmake 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)
set_target_properties(amdis PROPERTIES OUTPUT_NAME amdis${POSTFIX}
DEBUG_OUTPUT_NAME amdis${POSTFIX}d)
install(TARGETS amdis DESTINATION lib/amdis/ )
# generate configuration file:
# ----------------------------
# global configuration
configure_file(${BASE_DIR}/cmake/AMDISConfig.cmake.in
${AMDiS_BINARY_DIR}/AMDISConfig.cmake
@ONLY
)
# component configuration
configure_file(${BASE_DIR}/cmake/AMDIS.cmake.in
${AMDiS_BINARY_DIR}/AMDIS${POSTFIX}.cmake
@ONLY
)
install(FILES ${AMDiS_BINARY_DIR}/AMDISConfig.cmake DESTINATION share/amdis/)
install(FILES ${AMDiS_BINARY_DIR}/AMDIS${POSTFIX}.cmake DESTINATION share/amdis/)
install(FILES ${BASE_DIR}/cmake3/AMDISUse.cmake DESTINATION share/amdis/)
# CorrectWindowsPaths - this module defines one macro
#
# CONVERT_CYGWIN_PATH( PATH )
# This uses the command cygpath (provided by cygwin) to convert
# unix-style paths into paths useable by cmake on windows
macro (CONVERT_CYGWIN_PATH _path)
if (WIN32)
EXECUTE_PROCESS(COMMAND cygpath.exe -m ${${_path}}
OUTPUT_VARIABLE ${_path})
string (STRIP ${${_path}} ${_path})
endif (WIN32)
endmacro (CONVERT_CYGWIN_PATH)
......@@ -9,8 +9,10 @@
# PETSC_MPIEXEC - Executable for running MPI programs
# PETSC_VERSION - Version string (MAJOR.MINOR.SUBMINOR)
#
# Hack: PETSC_VERSION currently decides on the version based on the
# layout. Otherwise we need to run C code to determine the version.
# Usage:
# find_package(PETSc COMPONENTS CXX) - required if build --with-clanguage=C++ --with-c-support=0
# find_package(PETSc COMPONENTS C) - standard behavior of checking build using a C compiler
# find_package(PETSc) - same as above
#
# Setting these changes the behavior of the search
# PETSC_DIR - directory in which PETSc resides
......@@ -20,6 +22,31 @@
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
set(PETSC_VALID_COMPONENTS
C
CXX)
if(NOT PETSc_FIND_COMPONENTS)
set(PETSC_LANGUAGE_BINDINGS "C")
else()
# Right now, this is designed for compatability with the --with-clanguage option, so
# only allow one item in the components list.
list(LENGTH ${PETSc_FIND_COMPONENTS} components_length)
if(${components_length} GREATER 1)
message(FATAL_ERROR "Only one component for PETSc is allowed to be specified")
endif()
# This is a stub for allowing multiple components should that time ever come. Perhaps
# to also test Fortran bindings?
foreach(component ${PETSc_FIND_COMPONENTS})
list(FIND PETSC_VALID_COMPONENTS ${component} component_location)
if(${component_location} EQUAL -1)
message(FATAL_ERROR "\"${component}\" is not a valid PETSc component.")
else()
list(APPEND PETSC_LANGUAGE_BINDINGS ${component})
endif()
endforeach()
endif()
function (petsc_get_version)
if (EXISTS "${PETSC_DIR}/include/petscversion.h")
file (STRINGS "${PETSC_DIR}/include/petscversion.h" vstrings REGEX "#define PETSC_VERSION_(RELEASE|MAJOR|MINOR|SUBMINOR|PATCH) ")
......@@ -42,12 +69,20 @@ function (petsc_get_version)
endfunction ()
find_path (PETSC_DIR include/petsc.h
HINTS ENV PETSC_DIR
HINTS /usr/lib/petsc ENV PETSC_DIR
PATHS
/usr/lib/petscdir/3.1 /usr/lib/petscdir/3.0.0 /usr/lib/petscdir/2.3.3 /usr/lib/petscdir/2.3.2 # Debian
# Debian paths
/usr/lib/petscdir/3.5.1 /usr/lib/petscdir/3.5
/usr/lib/petscdir/3.4.2 /usr/lib/petscdir/3.4
/usr/lib/petscdir/3.3 /usr/lib/petscdir/3.2 /usr/lib/petscdir/3.1
/usr/lib/petscdir/3.0.0 /usr/lib/petscdir/2.3.3 /usr/lib/petscdir/2.3.2
# MacPorts path
/opt/local/lib/petsc
$ENV{HOME}/petsc
DOC "PETSc Directory")
find_program (MAKE_EXECUTABLE NAMES make gmake)
if (PETSC_DIR AND NOT PETSC_ARCH)
set (_petsc_arches
$ENV{PETSC_ARCH} # If set, use environment variable first
......@@ -57,11 +92,11 @@ if (PETSC_DIR AND NOT PETSC_ARCH)
foreach (arch ${_petsc_arches})
if (NOT PETSC_ARCH)
find_path (petscconf petscconf.h
HINTS ${PETSC_DIR}
PATH_SUFFIXES ${arch}/include bmake/${arch}
NO_DEFAULT_PATH)
HINTS ${PETSC_DIR}
PATH_SUFFIXES ${arch}/include bmake/${arch}
NO_DEFAULT_PATH)
if (petscconf)
set (PETSC_ARCH "${arch}" CACHE STRING "PETSc build architecture")
set (PETSC_ARCH "${arch}" CACHE STRING "PETSc build architecture")
endif (petscconf)
endif (NOT PETSC_ARCH)
endforeach (arch)
......@@ -77,7 +112,10 @@ find_package_multipass (PETSc petsc_config_current
# Determine whether the PETSc layout is old-style (through 2.3.3) or
# new-style (>= 3.0.0)
if (EXISTS "${PETSC_DIR}/${PETSC_ARCH}/include/petscconf.h") # > 2.3.3
if (EXISTS "${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/petscvariables") # > 3.5
set (petsc_conf_rules "${PETSC_DIR}/lib/petsc/conf/rules")
set (petsc_conf_variables "${PETSC_DIR}/lib/petsc/conf/variables")
elseif (EXISTS "${PETSC_DIR}/${PETSC_ARCH}/include/petscconf.h") # > 2.3.3
set (petsc_conf_rules "${PETSC_DIR}/conf/rules")
set (petsc_conf_variables "${PETSC_DIR}/conf/variables")
elseif (EXISTS "${PETSC_DIR}/bmake/${PETSC_ARCH}/petscconf.h") # <= 2.3.3
......@@ -86,9 +124,10 @@ elseif (EXISTS "${PETSC_DIR}/bmake/${PETSC_ARCH}/petscconf.h") # <= 2.3.3
elseif (PETSC_DIR)
message (SEND_ERROR "The pair PETSC_DIR=${PETSC_DIR} PETSC_ARCH=${PETSC_ARCH} do not specify a valid PETSc installation")
endif ()
petsc_get_version()
if (petsc_conf_rules AND petsc_conf_variables AND NOT petsc_config_current)
petsc_get_version()
# Put variables into environment since they are needed to get
# configuration (petscvariables) in the PETSc makefile
set (ENV{PETSC_DIR} "${PETSC_DIR}")
......@@ -103,12 +142,12 @@ if (petsc_conf_rules AND petsc_conf_variables AND NOT petsc_config_current)
include ${petsc_conf_rules}
include ${petsc_conf_variables}
show :
-@echo -n \${\${VARIABLE}}
\t-@echo -n \${\${VARIABLE}}
")
macro (PETSC_GET_VARIABLE name var)
set (${var} "NOTFOUND" CACHE INTERNAL "Cleared" FORCE)
execute_process (COMMAND ${CMAKE_MAKE_PROGRAM} --no-print-directory -f ${petsc_config_makefile} show VARIABLE=${name}
execute_process (COMMAND ${MAKE_EXECUTABLE} --no-print-directory -f ${petsc_config_makefile} show VARIABLE=${name}
OUTPUT_VARIABLE ${var}
RESULT_VARIABLE petsc_return)
endmacro (PETSC_GET_VARIABLE)
......@@ -117,6 +156,7 @@ show :
petsc_get_variable (PETSC_CCPPFLAGS petsc_cpp_line)
petsc_get_variable (PETSC_INCLUDE petsc_include)
petsc_get_variable (PCC petsc_cc)
petsc_get_variable (PCC_FLAGS petsc_cc_flags)
petsc_get_variable (MPIEXEC petsc_mpiexec)
# We are done with the temporary Makefile, calling PETSC_GET_VARIABLE after this point is invalid!
file (REMOVE ${petsc_config_makefile})
......@@ -125,11 +165,39 @@ show :
# Extract include paths and libraries from compile command line
resolve_includes (petsc_includes_all "${petsc_cpp_line}")
#on windows we need to make sure we're linking against the right
#runtime library
if (WIN32)
if (petsc_cc_flags MATCHES "-MT")
set(using_md False)
foreach(flag_var
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
if(${flag_var} MATCHES "/MD")
set(using_md True)
endif(${flag_var} MATCHES "/MD")
endforeach(flag_var)
if(${using_md} MATCHES "True")
message(WARNING "PETSc was built with /MT, but /MD is currently set.
See http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_build_my_MSVC_application_with_a_static_runtime.3F")
endif(${using_md} MATCHES "True")
endif (petsc_cc_flags MATCHES "-MT")
endif (WIN32)
include (CorrectWindowsPaths)
convert_cygwin_path(petsc_lib_dir)
message (STATUS "petsc_lib_dir ${petsc_lib_dir}")
macro (PETSC_FIND_LIBRARY suffix name)
set (PETSC_LIBRARY_${suffix} "NOTFOUND" CACHE INTERNAL "Cleared" FORCE) # Clear any stale value, if we got here, we need to find it again
find_library (PETSC_LIBRARY_${suffix} NAMES ${name} HINTS ${petsc_lib_dir} NO_DEFAULT_PATH)
if (WIN32)
set (libname lib${name}) #windows expects "libfoo", linux expects "foo"
else (WIN32)
set (libname ${name})
endif (WIN32)
find_library (PETSC_LIBRARY_${suffix} NAMES ${libname} HINTS ${petsc_lib_dir} NO_DEFAULT_PATH)
set (PETSC_LIBRARIES_${suffix} "${PETSC_LIBRARY_${suffix}}")
mark_as_advanced (PETSC_LIBRARY_${suffix})
endmacro (PETSC_FIND_LIBRARY suffix name)
......@@ -166,29 +234,42 @@ show :
message (STATUS "Recognized PETSc install with single library for all packages")
endif ()
include (CheckCSourceRuns)
include(Check${PETSC_LANGUAGE_BINDINGS}SourceRuns)
macro (PETSC_TEST_RUNS includes libraries runs)
multipass_c_source_runs ("${includes}" "${libraries}" "
if(${PETSC_LANGUAGE_BINDINGS} STREQUAL "C")
set(_PETSC_ERR_FUNC "CHKERRQ(ierr)")
elseif(${PETSC_LANGUAGE_BINDINGS} STREQUAL "CXX")
set(_PETSC_ERR_FUNC "CHKERRXX(ierr)")
endif()
if (PETSC_VERSION VERSION_GREATER 3.1)
set (_PETSC_TSDestroy "TSDestroy(&ts)")
else ()
set (_PETSC_TSDestroy "TSDestroy(ts)")
endif ()
set(_PETSC_TEST_SOURCE "
static const char help[] = \"PETSc test program.\";
#include \"petscts.h\"
#include <petscts.h>
int main(int argc,char *argv[]) {
PetscErrorCode ierr;
TS ts;
ierr = PetscInitialize(&argc,&argv,0,help);CHKERRQ(ierr);
ierr = TSCreate(PETSC_COMM_WORLD,&ts);CHKERRQ(ierr);
ierr = TSSetFromOptions(ts);CHKERRQ(ierr);
ierr = TSDestroy(ts);CHKERRQ(ierr);
ierr = PetscFinalize();CHKERRQ(ierr);
ierr = PetscInitialize(&argc,&argv,0,help);${_PETSC_ERR_FUNC};
ierr = TSCreate(PETSC_COMM_WORLD,&ts);${_PETSC_ERR_FUNC};
ierr = TSSetFromOptions(ts);${_PETSC_ERR_FUNC};
ierr = ${_PETSC_TSDestroy};${_PETSC_ERR_FUNC};
ierr = PetscFinalize();${_PETSC_ERR_FUNC};
return 0;
}
" ${runs})
")
multipass_source_runs ("${includes}" "${libraries}" "${_PETSC_TEST_SOURCE}" ${runs} "${PETSC_LANGUAGE_BINDINGS}")
if (${${runs}})
set (PETSC_EXECUTABLE_RUNS "YES" CACHE BOOL
"Can the system successfully run a PETSc executable? This variable can be manually set to \"YES\" to force CMake to accept a given PETSc configuration, but this will almost always result in a broken build. If you change PETSC_DIR, PETSC_ARCH, or PETSC_CURRENT you would have to reset this variable." FORCE)
"Can the system successfully run a PETSc executable? This variable can be manually set to \"YES\" to force CMake to accept a given PETSc configuration, but this will almost always result in a broken build. If you change PETSC_DIR, PETSC_ARCH, or PETSC_CURRENT you would have to reset this variable." FORCE)
endif (${${runs}})
endmacro (PETSC_TEST_RUNS)
find_path (PETSC_INCLUDE_DIR petscts.h HINTS "${PETSC_DIR}" PATH_SUFFIXES include NO_DEFAULT_PATH)
find_path (PETSC_INCLUDE_CONF petscconf.h HINTS "${PETSC_DIR}" PATH_SUFFIXES "${PETSC_ARCH}/include" "bmake/${PETSC_ARCH}" NO_DEFAULT_PATH)
mark_as_advanced (PETSC_INCLUDE_DIR PETSC_INCLUDE_CONF)
......@@ -198,7 +279,7 @@ int main(int argc,char *argv[]) {
if (petsc_works_minimal)
message (STATUS "Minimal PETSc includes and libraries work. This probably means we are building with shared libs.")
set (petsc_includes_needed "${petsc_includes_minimal}")
else (petsc_works_minimal) # Minimal includes fail, see if just adding full includes fixes it
else (petsc_works_minimal) # Minimal includes fail, see if just adding full includes fixes it
petsc_test_runs ("${petsc_includes_all}" "${PETSC_LIBRARIES_TS}" petsc_works_allincludes)
if (petsc_works_allincludes) # It does, we just need all the includes (
message (STATUS "PETSc requires extra include paths, but links correctly with only interface libraries. This is an unexpected configuration (but it seems to work fine).")
......@@ -206,21 +287,21 @@ int main(int argc,char *argv[]) {
else (petsc_works_allincludes) # We are going to need to link the external libs explicitly
resolve_libraries (petsc_libraries_external "${petsc_libs_external}")
foreach (pkg SYS VEC MAT DM KSP SNES TS ALL)
list (APPEND PETSC_LIBRARIES_${pkg} ${petsc_libraries_external})
list (APPEND PETSC_LIBRARIES_${pkg} ${petsc_libraries_external})
endforeach (pkg)
petsc_test_runs ("${petsc_includes_minimal}" "${PETSC_LIBRARIES_TS}" petsc_works_alllibraries)
if (petsc_works_alllibraries)
message (STATUS "PETSc only need minimal includes, but requires explicit linking to all dependencies. This is expected when PETSc is built with static libraries.")
set (petsc_includes_needed ${petsc_includes_minimal})
message (STATUS "PETSc only need minimal includes, but requires explicit linking to all dependencies. This is expected when PETSc is built with static libraries.")
set (petsc_includes_needed ${petsc_includes_minimal})
else (petsc_works_alllibraries)
# It looks like we really need everything, should have listened to Matt
set (petsc_includes_needed ${petsc_includes_all})
petsc_test_runs ("${petsc_includes_all}" "${PETSC_LIBRARIES_TS}" petsc_works_all)
if (petsc_works_all) # We fail anyways
message (STATUS "PETSc requires extra include paths and explicit linking to all dependencies. This probably means you have static libraries and something unexpected in PETSc headers.")
else (petsc_works_all) # We fail anyways
message (STATUS "PETSc could not be used, maybe the install is broken.")
endif (petsc_works_all)
# It looks like we really need everything, should have listened to Matt
set (petsc_includes_needed ${petsc_includes_all})
petsc_test_runs ("${petsc_includes_all}" "${PETSC_LIBRARIES_TS}" petsc_works_all)
if (petsc_works_all) # We fail anyways
message (STATUS "PETSc requires extra include paths and explicit linking to all dependencies. This probably means you have static libraries and something unexpected in PETSc headers.")
else (petsc_works_all) # We fail anyways
message (STATUS "PETSc could not be used, maybe the install is broken.")
endif (petsc_works_all)
endif (petsc_works_alllibraries)
endif (petsc_works_allincludes)
endif (petsc_works_minimal)
......
......@@ -21,7 +21,14 @@
# # Make temporary files, run programs, etc, to determine FOO_INCLUDES and FOO_LIBRARIES
# endif (NOT foo_current)
#
# MULTIPASS_SOURCE_RUNS (Name INCLUDES LIBRARIES SOURCE RUNS LANGUAGE)
# Always runs the given test, use this when you need to re-run tests
# because parent variables have made old cache entries stale. The LANGUAGE
# variable is either C or CXX indicating which compiler the test should
# use.
# MULTIPASS_C_SOURCE_RUNS (Name INCLUDES LIBRARIES SOURCE RUNS)
# DEPRECATED! This is only included for backwards compatability. Use
# the more general MULTIPASS_SOURCE_RUNS instead.
# Always runs the given test, use this when you need to re-run tests
# because parent variables have made old cache entries stale.
......@@ -39,7 +46,7 @@ macro (FIND_PACKAGE_MULTIPASS _name _current)
# The name of the stored value for the given state
set (_stored_var PACKAGE_MULTIPASS_${_NAME}_${_state})
if (NOT "${${_stored_var}}" STREQUAL "${${_NAME}_${_state}}")
set (_states_current "NO")
set (_states_current "NO")
endif (NOT "${${_stored_var}}" STREQUAL "${${_NAME}_${_state}}")
set (${_stored_var} "${${_NAME}_${_state}}" CACHE INTERNAL "Stored state for ${_name}." FORCE)
list (REMOVE_AT _args 0)
......@@ -61,7 +68,7 @@ macro (FIND_PACKAGE_MULTIPASS _name _current)
if (_cmd STREQUAL "DEPENDENTS")
list (REMOVE_AT _args 0)
foreach (dep ${_args})
set (${_NAME}_${dep} "NOTFOUND" CACHE INTERNAL "Cleared" FORCE)
set (${_NAME}_${dep} "NOTFOUND" CACHE INTERNAL "Cleared" FORCE)
endforeach (dep)
endif (_cmd STREQUAL "DEPENDENTS")
set (${_NAME}_FOUND "NOTFOUND" CACHE INTERNAL "Cleared" FORCE)
......@@ -70,9 +77,9 @@ macro (FIND_PACKAGE_MULTIPASS _name _current)
endmacro (FIND_PACKAGE_MULTIPASS)
macro (MULTIPASS_C_SOURCE_RUNS includes libraries source runs)
include (CheckCSourceRuns)
# This is a ridiculous hack. CHECK_C_SOURCE_* thinks that if the
macro (MULTIPASS_SOURCE_RUNS includes libraries source runs language)
include (Check${language}SourceRuns)
# This is a ridiculous hack. CHECK_${language}_SOURCE_* thinks that if the
# *name* of the return variable doesn't change, then the test does
# not need to be re-run. We keep an internal count which we
# increment to guarantee that every test name is unique. If we've
......@@ -86,6 +93,14 @@ macro (MULTIPASS_C_SOURCE_RUNS includes libraries source runs)
set (testname MULTIPASS_TEST_${MULTIPASS_TEST_COUNT}_${runs})
set (CMAKE_REQUIRED_INCLUDES ${includes})
set (CMAKE_REQUIRED_LIBRARIES ${libraries})
check_c_source_runs ("${source}" ${testname})
if(${language} STREQUAL "C")
check_c_source_runs ("${source}" ${testname})
elseif(${language} STREQUAL "CXX")
check_cxx_source_runs ("${source}" ${testname})
endif()
set (${runs} "${${testname}}")
endmacro (MULTIPASS_SOURCE_RUNS)
macro (MULTIPASS_C_SOURCE_RUNS includes libraries source runs)
multipass_source_runs("${includes}" "${libraries}" "${source}" ${runs} "C")
endmacro (MULTIPASS_C_SOURCE_RUNS)
......@@ -38,23 +38,34 @@
#
# assuming both directories exist.
# Note: as currently implemented, the -I/string will be picked up mistakenly (cry, cry)
include (CorrectWindowsPaths)
macro (RESOLVE_LIBRARIES LIBS LINK_LINE)
string (REGEX MATCHALL "((-L|-l|-Wl)([^\" ]+|\"[^\"]+\")|/[^\" ]+(a|so|dll))" _all_tokens "${LINK_LINE}")
set (_libs_found)
set (_directory_list)
string (REGEX MATCHALL "((-L|-l|-Wl)([^\" ]+|\"[^\"]+\")|[^\" ]+\\.(a|so|dll|lib))" _all_tokens "${LINK_LINE}")
set (_libs_found "")
set (_directory_list "")
foreach (token ${_all_tokens})
if (token MATCHES "-L([^\" ]+|\"[^\"]+\")")
# If it's a library path, add it to the list
string (REGEX REPLACE "^-L" "" token ${token})
string (REGEX REPLACE "//" "/" token ${token})
convert_cygwin_path(token)
list (APPEND _directory_list ${token})
elseif (token MATCHES "^(-l([^\" ]+|\"[^\"]+\")|/[^\" ]+(a|so|dll))")
elseif (token MATCHES "^(-l([^\" ]+|\"[^\"]+\")|[^\" ]+\\.(a|so|dll|lib))")
# It's a library, resolve the path by looking in the list and then (by default) in system directories
string (REGEX REPLACE "^-l" "" token ${token})
set (_root)
if (token MATCHES "^/") # We have an absolute path, add root to the search path
set (_root "/")
if (WIN32) #windows expects "libfoo", linux expects "foo"
string (REGEX REPLACE "^-l" "lib" token ${token})
else (WIN32)
string (REGEX REPLACE "^-l" "" token ${token})
endif (WIN32)
set (_root "")
if (token MATCHES "^/") # We have an absolute path
#separate into a path and a library name:
string (REGEX MATCH "[^/]*\\.(a|so|dll|lib)$" libname ${token})
string (REGEX MATCH ".*[^${libname}$]" libpath ${token})
convert_cygwin_path(libpath)
set (_directory_list ${_directory_list} ${libpath})
set (token ${libname})
endif (token MATCHES "^/")
set (_lib "NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
find_library (_lib ${token} HINTS ${_directory_list} ${_root})
......@@ -78,10 +89,11 @@ endmacro (RESOLVE_LIBRARIES)
macro (RESOLVE_INCLUDES INCS COMPILE_LINE)
string (REGEX MATCHALL "-I([^\" ]+|\"[^\"]+\")" _all_tokens "${COMPILE_LINE}")
set (_incs_found)
set (_incs_found "")
foreach (token ${_all_tokens})
string (REGEX REPLACE "^-I" "" token ${token})
string (REGEX REPLACE "//" "/" token ${token})
convert_cygwin_path(token)
if (EXISTS ${token})
list (APPEND _incs_found ${token})
else (EXISTS ${token})
......
# specify the target and requirements for the composite fem library
set(COMPOSITE_SOURCE_DIR ${SOURCE_DIR}/compositeFEM)
list(APPEND 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)
list(APPEND COMPILEFLAGS "-DHAVE_COMPOSITE_FEM=1")
list(APPEND AMDIS_INCLUDE_DIRS ${COMPOSITE_SOURCE_DIR})
# specify how to install this target:
# -----------------------------------
file(GLOB COMPOSITE_HEADERS "${COMPOSITE_SOURCE_DIR}/*.h*")
install(FILES ${COMPOSITE_HEADERS} DESTINATION include/amdis/compositeFEM)
option(ENABLE_BASE_PROBLEMS "Use base_problems" true)
mark_as_advanced(ENABLE_BASE_PROBLEMS)
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 'ExtendedProblemStat.h'")
endif ()
list(APPEND 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
)
list(APPEND COMPILEFLAGS "-DHAVE_EXTENSIONS=1")
list(APPEND AMDIS_INCLUDE_DIRS
${EXTENSIONS_DIR}
${EXTENSIONS_DIR}/time
${EXTENSIONS_DIR}/nanoflann
${EXTENSIONS_DIR}/pugixml/src
)
set(INSTALL_SUBDIRS . time preconditioner nanoflann)
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/PetscSolverPfc.cc
${EXTENSIONS_DIR}/preconditioner/PetscSolverPfc_diag.cc)
endif (ENABLE_PARALLEL_DOMAIN)
if (ENABLE_BASE_PROBLEMS)
if (ENABLE_REINIT)
list(APPEND EXTENSIONS_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)
endif (ENABLE_REINIT)
list(APPEND EXTENSIONS_SRC
${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
list(APPEND COMPILEFLAGS "-DHAVE_BASE_PROBLEMS=1")
list(APPEND AMDIS_INCLUDE_DIRS ${EXTENSIONS_DIR}/base_problems)
list(APPEND INSTALL_SUBDIRS base_problems)
endif (ENABLE_BASE_PROBLEMS)
# 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/)
endif (EXTENSIONS_DIR)
if (ENABLE_PARALLEL_DOMAIN)
set(PARALLEL_DOMAIN_AMDIS_SRC
${SOURCE_DIR}/parallel/DofComm.cc
${SOURCE_DIR}/parallel/CheckerPartitioner.cc
${SOURCE_DIR}/parallel/ElementObjectDatabase.cc
${SOURCE_DIR}/parallel/InteriorBoundary.cc
${SOURCE_DIR}/parallel/MeshDistributor.cc
${SOURCE_DIR}/parallel/MeshLevelData.cc
${SOURCE_DIR}/parallel/MeshManipulation.cc
${SOURCE_DIR}/parallel/MeshPartitioner.cc
${SOURCE_DIR}/parallel/MpiHelper.cc
${SOURCE_DIR}/parallel/ParallelDebug.cc
${SOURCE_DIR}/parallel/ParallelDofMapping.cc
${SOURCE_DIR}/parallel/ParallelProblemStat.cc
${SOURCE_DIR}/parallel/ParallelSolver.cc
${SOURCE_DIR}/parallel/PeriodicMap.cc
${SOURCE_DIR}/parallel/ParMetisPartitioner.cc
${SOURCE_DIR}/parallel/StdMpi.cc
)
list(APPEND COMPILEFLAGS "-DHAVE_PARALLEL_DOMAIN_AMDIS=1")
enable_petsc(COMPILEFLAGS AMDIS_INCLUDE_DIRS _)
# add support for the zoltan library
if (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)
enable_bddcml(COMPILEFLAGS AMDIS_INCLUDE_DIRS _)
list(APPEND PARALLEL_DOMAIN_AMDIS_SRC
${SOURCE_DIR}/parallel/BddcMlSolver.cc)
endif (ENABLE_BDDCML)
# add some more source-files that need petsc
list(APPEND PARALLEL_DOMAIN_AMDIS_SRC
${SOURCE_DIR}/parallel/MatrixNnzStructure.cc
${SOURCE_DIR}/parallel/ParallelCoarseSpaceSolver.cc
${SOURCE_DIR}/parallel/PetscHelper.cc
${SOURCE_DIR}/parallel/PetscSolver.cc
${SOURCE_DIR}/parallel/PetscSolverGlobalMatrix.cc
${SOURCE_DIR}/parallel/PetscSolverGlobalBlockMatrix.cc
${SOURCE_DIR}/solver/PetscTypes.cc
)
if (ENABLE_PARALLEL_SOLVERS)
list(APPEND PARALLEL_DOMAIN_AMDIS_SRC
${SOURCE_DIR}/parallel/PetscSolverFeti.cc
${SOURCE_DIR}/parallel/PetscSolverFetiDebug.cc
${SOURCE_DIR}/parallel/PetscSolverFetiMonitor.cc
${SOURCE_DIR}/parallel/PetscSolverFetiOperators.cc
${SOURCE_DIR}/parallel/PetscSolverFetiTimings.cc
${SOURCE_DIR}/parallel/PetscSolverNavierStokes.cc
${SOURCE_DIR}/parallel/PetscSolverNSCH.cc
${SOURCE_DIR}/parallel/PetscSolverCahnHilliard2.cc
${SOURCE_DIR}/parallel/PetscSolverCahnHilliard.cc
${SOURCE_DIR}/parallel/PetscSolverSchur.cc
)
list(APPEND COMPILEFLAGS "-DHAVE_PARALLEL_SOLVERS=1")
endif (ENABLE_PARALLEL_SOLVERS)
# specify how to install this target:
# -----------------------------------
file(GLOB AMDIS_PARALLEL_HEADERS "${SOURCE_DIR}/parallel/*.h")
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
DESTINATION share/amdis/)
endif (ENABLE_PARALLEL_DOMAIN)
# specify the target and requirements for the reinit library
set(REINIT_SOURCE_DIR ${SOURCE_DIR}/reinit)
file(GLOB REINIT_SRC ${REINIT_SOURCE_DIR}/*.cc)
list(APPEND COMPILEFLAGS "-DHAVE_REINIT=1")
list(APPEND AMDIS_INCLUDE_DIRS ${REINIT_SOURCE_DIR})
# specify how to install this target:
# -----------------------------------
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)