CMakeLists.txt 7.56 KB
Newer Older
Naumann, Andreas's avatar
Naumann, Andreas committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
project("AMDiS")

cmake_minimum_required(VERSION 2.6)

#needs: --enable-debug, enable-intel --enable-openmp --enable-parmetis --enable-parallel-domain --enable-umfpack --enable-mkl --enable-boost --enable-marmot

option(ENABLE_DEBUG "debug" false)
#option(ENABLE_INTEL "use intel compiler" false)
option(ENABLE_OPENMP "use openmp" false)
option(ENABLE_PARMETIS "use partion of unity and enable parmetis" false)
option(ENABLE_PARALLEL_DOMAIN "use parallel domain decomposition" false)
SET(PETSC_DIR "" CACHE STRING "Petsc directory for parallel domain decomposition" )
SET(PETSC_ARCH "" CACHE STRING "Petsc architecture")
option(ENABLE_UMFPACK "use umfpack solver" false)
option(ENABLE_MKL "use the mkl" false)
SET(MKL_DIR "" CACHE STRING "MKL directory")
option(ENABLE_DUNE "use dune" false)
SET(DUNE_DIR "" CACHE STRING "Dune directory")
option(ENABLE_BOOST "use the boost library" false)
option(ENABLE_MARMOT "use marmot" false)
option(ENABLE_GUI "compile the gui" false)
#option(ENABLE_TESTS "compile the tests" false)
SET(ENABLE_TESTS 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)

SET(LIB_DIR ./lib)
SET(SOURCE_DIR ./src)
SET(AMDIS_SRC ${SOURCE_DIR}/DOFIndexed.cc ${SOURCE_DIR}/GNUPlotWriter.cc ${SOURCE_DIR}/VertexVector.cc 
	      ${SOURCE_DIR}/PeriodicBC.cc ${SOURCE_DIR}/Recovery.cc ${SOURCE_DIR}/RecoveryEstimator.cc 
	      ${SOURCE_DIR}/ResidualEstimator.cc ${SOURCE_DIR}/Cholesky.cc ${SOURCE_DIR}/AdaptBase.cc
	      ${SOURCE_DIR}/StandardProblemIteration.cc ${SOURCE_DIR}/ProblemScal.cc ${SOURCE_DIR}/ProblemVec.cc 
	      ${SOURCE_DIR}/ProblemVecDbg.cc ${SOURCE_DIR}/DualTraverse.cc ${SOURCE_DIR}/ElementData.cc 
	      ${SOURCE_DIR}/ComponentTraverseInfo.cc ${SOURCE_DIR}/CreatorMap.cc ${SOURCE_DIR}/ProblemInterpolScal.cc 
	      ${SOURCE_DIR}/ProblemInterpolVec.cc ${SOURCE_DIR}/MacroReader.cc ${SOURCE_DIR}/ValueReader.cc 
	      ${SOURCE_DIR}/Projection.cc ${SOURCE_DIR}/SubAssembler.cc ${SOURCE_DIR}/ZeroOrderAssembler.cc 
	      ${SOURCE_DIR}/FirstOrderAssembler.cc ${SOURCE_DIR}/SecondOrderAssembler.cc ${SOURCE_DIR}/Assembler.cc 
	      ${SOURCE_DIR}/AdaptInfo.cc ${SOURCE_DIR}/Marker.cc ${SOURCE_DIR}/SurfaceQuadrature.cc 
	      ${SOURCE_DIR}/LeafData.cc ${SOURCE_DIR}/BoundaryManager.cc ${SOURCE_DIR}/DirichletBC.cc 
	      ${SOURCE_DIR}/RobinBC.cc  ${SOURCE_DIR}/FileWriter.cc ${SOURCE_DIR}/ElementFileWriter.cc 
	      ${SOURCE_DIR}/ElInfo.cc ${SOURCE_DIR}/ElInfoStack.cc ${SOURCE_DIR}/OperatorTerm.cc 
              ${SOURCE_DIR}/ZeroOrderTerm.cc ${SOURCE_DIR}/FirstOrderTerm.cc ${SOURCE_DIR}/SecondOrderTerm.cc 
              ${SOURCE_DIR}/Operator.cc ${SOURCE_DIR}/Mesh.cc ${SOURCE_DIR}/MeshStructure.cc 
	      ${SOURCE_DIR}/AdaptStationary.cc  ${SOURCE_DIR}/AdaptInstationary.cc
	      ${SOURCE_DIR}/DOFVector.cc ${SOURCE_DIR}/Estimator.cc ${SOURCE_DIR}/ProblemInstat.cc ${SOURCE_DIR}/ProblemNonLin.cc 
	      ${SOURCE_DIR}/NonLinUpdater.cc ${SOURCE_DIR}/QPsiPhi.cc ${SOURCE_DIR}/BasisFunction.cc ${SOURCE_DIR}/Boundary.cc 
	      ${SOURCE_DIR}/CoarseningManager.cc ${SOURCE_DIR}/CoarseningManager1d.cc ${SOURCE_DIR}/CoarseningManager2d.cc 
	      ${SOURCE_DIR}/CoarseningManager3d.cc ${SOURCE_DIR}/DOFAdmin.cc ${SOURCE_DIR}/DOFMatrix.cc ${SOURCE_DIR}/Element.cc 
	      ${SOURCE_DIR}/ElInfo1d.cc ${SOURCE_DIR}/ElInfo2d.cc ${SOURCE_DIR}/ElInfo3d.cc ${SOURCE_DIR}/FiniteElemSpace.cc 
	      ${SOURCE_DIR}/FixVec.cc ${SOURCE_DIR}/Global.cc ${SOURCE_DIR}/Lagrange.cc ${SOURCE_DIR}/Line.cc 
	      ${SOURCE_DIR}/MacroElement.cc ${SOURCE_DIR}/MacroWriter.cc ${SOURCE_DIR}/Parameters.cc ${SOURCE_DIR}/Parametric.cc 
	      ${SOURCE_DIR}/Quadrature.cc ${SOURCE_DIR}/RCNeighbourList.cc ${SOURCE_DIR}/RefinementManager.cc 
	      ${SOURCE_DIR}/RefinementManager1d.cc ${SOURCE_DIR}/RefinementManager2d.cc ${SOURCE_DIR}/RefinementManager3d.cc 
	      ${SOURCE_DIR}/Tetrahedron.cc ${SOURCE_DIR}/Traverse.cc ${SOURCE_DIR}/TraverseParallel.cc ${SOURCE_DIR}/Triangle.cc 
	      ${SOURCE_DIR}/TecPlotWriter.cc ${SOURCE_DIR}/ValueWriter.cc ${SOURCE_DIR}/VtkWriter.cc ${SOURCE_DIR}/PngWriter.cc 
	      ${SOURCE_DIR}/PovrayWriter.cc ${SOURCE_DIR}/DataCollector.cc ${SOURCE_DIR}/ScalableQuadrature.cc 
	      ${SOURCE_DIR}/SubElInfo.cc ${SOURCE_DIR}/parallel/InteriorBoundary.cc ${SOURCE_DIR}/ElementDofIterator.cc 
	      ${SOURCE_DIR}/Debug.cc
65
              ${SOURCE_DIR}/time/RosenbrockAdaptInstationary.cc ${SOURCE_DIR}/time/RosenbrockStationary.cc
Naumann, Andreas's avatar
Naumann, Andreas committed
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
	      )

if(ENABLE_PARMETIS)
	find_package(MPI REQUIRED)
	INCLUDE (CMakeForceCompiler)	
	CMAKE_FORCE_C_COMPILER(mpicc "MPI C compiler")
	CMAKE_FORCE_CXX_COMPILER(mpiCC "MPI C++ compiler")

	include_directories( ${LIB_DIR}/ParMetis-3.1)
	SET(PARALLEL_AMDIS_SRC  ${SOURCE_DIR}/ConditionalEstimator.cc ${SOURCE_DIR}/ConditionalMarker.cc 
				${SOURCE_DIR}/ParallelProblem.cc ${SOURCE_DIR}/ParMetisPartitioner.cc 
				${SOURCE_DIR}/PollutionError.cc)
	SET(COMPILEFLAGS "${COMPILEFLAGS} -DHAVE_PARALLEL_AMDIS=1")
endif(ENABLE_PARMETIS)

if(ENABLE_PARALLEL_DOMAIN)
	include_directories(${PETSC_DIR}/include ${PETSC_DIR}/${PETSC_ARCH}/include)
	SET(PARALLEL_DOMAIN_AMDIS_SRC
		${SOURCE_DIR}/parallel/ParallelDomainBase.cc 
		${SOURCE_DIR}/parallel/StdMpi.cc
		${SOURCE_DIR}/parallel/ParallelDomainDbg.cc
		${SOURCE_DIR}/parallel/GlobalMatrixSolver.cc
		${SOURCE_DIR}/parallel/MpiHelper.cc)
	SET(COMPILEFLAGS "${COMPILEFLAGS} -DHAVE_PARALLEL_DOMAIN_AMDIS=1")
endif(ENABLE_PARALLEL_DOMAIN)

if(ENABLE_DEBUG)
	SET(COMPILEFLAGS "${COMPILEFLAGS} -g -O0 -DDEBUG=1")
endif(ENABLE_DEBUG)

if(ENABLE_OPENMP)
	if(ENABLE_INTEL)
		SET(COMPILEFLAGS "${COMPILEFLAGS} -openmp")
	else(ENABLE_INTEL)
		SET(COMPILEFLAGS "${COMPILEFLAGS} -fopenmp")
	endif(ENABLE_INTEL)
endif(ENABLE_OPENMP)

if(ENABLE_UMFPACK)
	include_directories(${LIB_DIR}/UFconfig ${LIB_DIR}/AMD/Include ${LIB_DIR}/UMFPACK/Include)
	SET(COMPILEFLAGS "${COMPILEFLAGS} -DHAVE_UMFPACK=1 -DMTL_HAS_UMFPACK")
endif(ENABLE_UMFPACK)

if(ENABLE_MKL)
	include_directories(${MKL_DIR})
	SET(COMPILEFLAGS "${COMPILEFLAGS} -DHAVE_MKL=1")
endif(ENABLE_MKL)

if(ENABLE_DUNE)
	include_directories(${DUNE_DIR})
	SET(COMPILEFLAGS "${COMPILEFLAGS} -DHAVE_DUNE=1")
endif(ENABLE_DUNE)

if(ENABLE_BOOST)
	SET(COMPILEFLAGS "${COMPILEFLAGS} -DHAVE_BOOST=1")
endif(ENABLE_BOOST)

SET(COMPOSITE_SOURCE_DIR compositeFEM/src)
SET(COMPOSITE_FEM_SRC ${COMPOSITE_SOURCE_DIR}/CFE_Integration.cc ${COMPOSITE_SOURCE_DIR}/CFE_NormAndErrorFcts.cc 
		      ${COMPOSITE_SOURCE_DIR}/CompositeFEMMethods.cc ${COMPOSITE_SOURCE_DIR}/LevelSetAdaptMesh.cc 
		      ${COMPOSITE_SOURCE_DIR}/PenaltyOperator.cc ${COMPOSITE_SOURCE_DIR}/ElementLevelSet.cc 
		      ${COMPOSITE_SOURCE_DIR}/CompositeFEMOperator.cc ${COMPOSITE_SOURCE_DIR}/SubPolytope.cc 
		      ${COMPOSITE_SOURCE_DIR}/SubElementAssembler.cc )

#mtl4 includes
include_directories(${LIB_DIR}/mtl4)
include_directories(${SOURCE_DIR})

add_library(amdis SHARED ${AMDIS_SRC} ${PARALLEL_AMDIS_SRC} ${PARALLEL_DOMAIN_AMDIS_SRC})
add_library(compositeFEM SHARED ${COMPOSITE_FEM_SRC})


SET_TARGET_PROPERTIES(amdis PROPERTIES COMPILE_FLAGS "${COMPILEFLAGS}")
if(ENABLE_MARMOT)
	Message("please set marmotcc manually")
endif(ENABLE_MARMOT)

install(TARGETS amdis compositeFEM 
	LIBRARY DESTINATION lib )

if(ENABLE_GUI)
	add_subdirectory(other/tools/amdis_gui)
endif(ENABLE_GUI)

if(ENABLE_TESTS)
#ENABLE_TESTING()
#add_test(demo_test run_test.sh)

#add_test(demo_test ${CMAKE_CTEST_COMMAND} --build-and-test "${CMAKE_SOURCE_DIR}/test/demo_test" "${CMAKE_BINARY_DIR}/test/demo_test" --build-generator "${CMAKE_GENERATOR}" --build-makeprogram "${CMAKE_MAKE_PROGRAM}" "${CMAKE_BINARY_DIR}/test/demo_test")
endif(ENABLE_TESTS)