Commit 5d4f9830 authored by Naumann, Andreas's avatar Naumann, Andreas

use the cmake-debug build and create umfpack and parmetis libraries, if desired

parent c1930d5c
......@@ -11,21 +11,22 @@ SET(SOURCE_DIR ${AMDiS_SOURCE_DIR})
#TODO: use the cmake build type
SET(MTL_DIR ${LIB_DIR}/mtl4/ CACHE PATH "mtl4 directory")
option(ENABLE_DEBUG "debug" false)
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")
#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)
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 PATH "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 PATH "MKL directory")
option(ENABLE_DUNE "use dune" false)
SET(DUNE_DIR "" CACHE PATH "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)
......@@ -37,20 +38,17 @@ if(ENABLE_INTEL)
#SET(CMAKE_C_COMPILER "icc")
endif(ENABLE_INTEL)
#if(ENABLE_BOOST)
SET(COMPILEFLAGS "${COMPILEFLAGS} -DHAVE_BOOST=1")
find_package(Boost 1.42 REQUIRED)
if(Boost_FOUND)
include_directories(${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)
link_directories(${Boost_LIBRARY_DIRS})
endif(Boost_FOUND)
#endif(ENABLE_BOOST)
find_package(Boost 1.42 REQUIRED)
if(Boost_FOUND)
include_directories(${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)
link_directories(${Boost_LIBRARY_DIRS})
endif(Boost_FOUND)
SET(LIB_DIR ./lib)
SET(SOURCE_DIR ${AMDiS_SOURCE_DIR})
......@@ -158,21 +156,23 @@ SET(AMDIS_SRC ${SOURCE_DIR}/DOFIndexed.cc
${SOURCE_DIR}/time/RosenbrockMethod.cc
)
if(ENABLE_PARMETIS)
if(ENABLE_PARALLEL_DOMAIN)
find_package(MPI REQUIRED)
INCLUDE (CMakeForceCompiler)
CMAKE_FORCE_C_COMPILER(mpicc "MPI C compiler")
CMAKE_FORCE_CXX_COMPILER(mpiCC "MPI C++ compiler")
add_custom_target(parmetis-lib ALL
make
WORKING_DIRECTORY ${LIB_DIR}/ParMetis-3.1
)
include_directories( ${LIB_DIR}/ParMetis-3.1)
INSTALL(FILES ${LIB_DIR}/ParMetis-3.1/parmetis.h
${LIB_DIR}/ParMetis-3.1/libparmetis.a
${LIB_DIR}/ParMetis-3.1/libmetis.a
DESTINATION lib/parmetis
)
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/ParMetisPartitioner.cc
......@@ -181,20 +181,18 @@ if(ENABLE_PARALLEL_DOMAIN)
${SOURCE_DIR}/parallel/ParallelDebug.cc
${SOURCE_DIR}/parallel/GlobalMatrixSolver.cc
${SOURCE_DIR}/parallel/MpiHelper.cc
${SOURCE_DIR}/parallel/ElementObjectData.cc)
${SOURCE_DIR}/parallel/ElementObjectData.cc
${SOURCE_DIR}/parallel/PetscSolver.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)
find_package(OpenMP)
if(OPENMP_FOUND)
SET(COMPILEFLAGS "${COMPILEFLAGS} ${OpenMP_CXX_FLAGS}")
else()
message(WARNING "your compiler seems support openmp")
endif()
endif(ENABLE_OPENMP)
if(ENABLE_UMFPACK)
......@@ -216,6 +214,18 @@ if(ENABLE_UMFPACK)
INSTALL(FILES ${HEADERS}
DESTINATION include/amdis/ufconfig/xerbla)
#add some rules to build the umfpack and amd libs
# message("adding command for libumfpack:${CMAKE_CURRENT_SOURCE_DIR}/${LIB_DIR}/UMFPACK/Lib/libumfpack.a ")
add_custom_target(umfpack-lib ALL
make
WORKING_DIRECTORY ${LIB_DIR}/UMFPACK
)
add_custom_target(amd-lib ALL
make
WORKING_DIRECTORY ${LIB_DIR}/AMD
)
INSTALL(FILES ${LIB_DIR}/UMFPACK/Lib/libumfpack.a
DESTINATION lib/amdis/umfpack/)
INSTALL(FILES ${LIB_DIR}/AMD/Lib/libamd.a
......@@ -228,11 +238,6 @@ if(ENABLE_MKL)
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)
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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment