Commit 1d0f5b90 authored by Reuther, Sebastian's avatar Reuther, Sebastian

Merge branch 'release/v1.2' into 'master'

Release/v1.2

See merge request !28
parents 31322270 9d352199
Pipeline #1658 passed with stages
in 48 minutes and 56 seconds
...@@ -17,8 +17,6 @@ build:9-debug-gcc: ...@@ -17,8 +17,6 @@ build:9-debug-gcc:
- install/ - install/
name: "$CI_BUILD_NAME" name: "$CI_BUILD_NAME"
expire_in: 6 hrs expire_in: 6 hrs
only:
- master
build:9-release-gcc: build:9-release-gcc:
stage: build stage: build
...@@ -29,8 +27,6 @@ build:9-release-gcc: ...@@ -29,8 +27,6 @@ build:9-release-gcc:
- install/ - install/
name: "$CI_BUILD_NAME" name: "$CI_BUILD_NAME"
expire_in: 6 hrs expire_in: 6 hrs
only:
- master
build:9-parallel-debug-gcc: build:9-parallel-debug-gcc:
stage: build stage: build
...@@ -41,8 +37,6 @@ build:9-parallel-debug-gcc: ...@@ -41,8 +37,6 @@ build:9-parallel-debug-gcc:
- install/ - install/
name: "$CI_BUILD_NAME" name: "$CI_BUILD_NAME"
expire_in: 6 hrs expire_in: 6 hrs
only:
- master
build:9-parallel-release-gcc: build:9-parallel-release-gcc:
stage: build stage: build
...@@ -53,8 +47,6 @@ build:9-parallel-release-gcc: ...@@ -53,8 +47,6 @@ build:9-parallel-release-gcc:
- install/ - install/
name: "$CI_BUILD_NAME" name: "$CI_BUILD_NAME"
expire_in: 6 hrs expire_in: 6 hrs
only:
- master
# compile the demos # compile the demos
...@@ -64,8 +56,6 @@ demo:9-debug-gcc: ...@@ -64,8 +56,6 @@ demo:9-debug-gcc:
- tools/build_amdis.sh --stage demo --config Debug - tools/build_amdis.sh --stage demo --config Debug
dependencies: dependencies:
- build:9-debug-gcc - build:9-debug-gcc
only:
- master
demo:9-release-gcc: demo:9-release-gcc:
stage: demo stage: demo
...@@ -73,8 +63,6 @@ demo:9-release-gcc: ...@@ -73,8 +63,6 @@ demo:9-release-gcc:
- tools/build_amdis.sh --stage demo --config Release - tools/build_amdis.sh --stage demo --config Release
dependencies: dependencies:
- build:9-release-gcc - build:9-release-gcc
only:
- master
demo:9-parallel-debug-gcc: demo:9-parallel-debug-gcc:
stage: demo stage: demo
...@@ -82,8 +70,6 @@ demo:9-parallel-debug-gcc: ...@@ -82,8 +70,6 @@ demo:9-parallel-debug-gcc:
- tools/build_amdis.sh --stage demo --config Debug --parallel - tools/build_amdis.sh --stage demo --config Debug --parallel
dependencies: dependencies:
- build:9-parallel-debug-gcc - build:9-parallel-debug-gcc
only:
- master
demo:9-parallel-release-gcc: demo:9-parallel-release-gcc:
stage: demo stage: demo
...@@ -91,8 +77,6 @@ demo:9-parallel-release-gcc: ...@@ -91,8 +77,6 @@ demo:9-parallel-release-gcc:
- tools/build_amdis.sh --stage demo --config Release --parallel - tools/build_amdis.sh --stage demo --config Release --parallel
dependencies: dependencies:
- build:9-parallel-release-gcc - build:9-parallel-release-gcc
only:
- master
# compiel and run the tests # compiel and run the tests
...@@ -102,8 +86,6 @@ test:9-debug-gcc: ...@@ -102,8 +86,6 @@ test:9-debug-gcc:
- tools/build_amdis.sh --stage test --config Debug - tools/build_amdis.sh --stage test --config Debug
dependencies: dependencies:
- build:9-debug-gcc - build:9-debug-gcc
only:
- master
test:9-release-gcc: test:9-release-gcc:
stage: test stage: test
...@@ -111,8 +93,6 @@ test:9-release-gcc: ...@@ -111,8 +93,6 @@ test:9-release-gcc:
- tools/build_amdis.sh --stage test --config Release - tools/build_amdis.sh --stage test --config Release
dependencies: dependencies:
- build:9-release-gcc - build:9-release-gcc
only:
- master
test:9-parallel-debug-gcc: test:9-parallel-debug-gcc:
stage: test stage: test
...@@ -120,8 +100,6 @@ test:9-parallel-debug-gcc: ...@@ -120,8 +100,6 @@ test:9-parallel-debug-gcc:
- tools/build_amdis.sh --stage test --config Debug --parallel - tools/build_amdis.sh --stage test --config Debug --parallel
dependencies: dependencies:
- build:9-parallel-debug-gcc - build:9-parallel-debug-gcc
only:
- master
test:9-parallel-release-gcc: test:9-parallel-release-gcc:
stage: test stage: test
...@@ -129,5 +107,3 @@ test:9-parallel-release-gcc: ...@@ -129,5 +107,3 @@ test:9-parallel-release-gcc:
- tools/build_amdis.sh --stage test --config Release --parallel - tools/build_amdis.sh --stage test --config Release --parallel
dependencies: dependencies:
- build:9-parallel-release-gcc - build:9-parallel-release-gcc
only:
- master
set(CMAKE_LEGACY_CYGWIN_WIN32 0) set(CMAKE_LEGACY_CYGWIN_WIN32 0)
cmake_minimum_required(VERSION 2.8 FATAL_ERROR) cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
project(AMDiS) project(AMDiS)
set(AMDiS_VERSION "1.1.0") set(AMDiS_VERSION "1.2.0")
set(BASE_DIR ${AMDiS_SOURCE_DIR}) set(BASE_DIR ${AMDiS_SOURCE_DIR})
set(SOURCE_DIR ${BASE_DIR}/src) set(SOURCE_DIR ${BASE_DIR}/src)
...@@ -17,11 +17,28 @@ endif () ...@@ -17,11 +17,28 @@ endif ()
# some options to control the build process # some options to control the build process
option(ENABLE_PARALLEL_DOMAIN "Use parallel domain decomposition" false) 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_UMFPACK "Enable support for the UMFPACK solver" true)
option(ENABLE_EXTENSIONS "Use extensions for AMDiS" false) option(ENABLE_EXTENSIONS "Use extensions for AMDiS" false)
option(ENABLE_HYPRE "Use HYPRE AMG solver" false) option(ENABLE_HYPRE "Use HYPRE AMG solver" false)
option(ENABLE_PNG "Use png reader/writer" false) option(ENABLE_PNG "Use png reader/writer" false)
option(ENABLE_SEQ_PETSC "Use sequential PETSc solvers" 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 # enable/disable some more features
option(ENABLE_COMPRESSION "Use output compression for vtu and arh files" true) option(ENABLE_COMPRESSION "Use output compression for vtu and arh files" true)
...@@ -33,6 +50,12 @@ mark_as_advanced(ENABLE_REINIT) ...@@ -33,6 +50,12 @@ mark_as_advanced(ENABLE_REINIT)
option(ENABLE_COMPOSITE_FEM "Compile compositeFEM library" true) option(ENABLE_COMPOSITE_FEM "Compile compositeFEM library" true)
mark_as_advanced(ENABLE_COMPOSITE_FEM) 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) option(BUILD_SHARED_LIBS "Build all libraries as shared or static, default: shared" true)
mark_as_advanced(BUILD_SHARED_LIBS) mark_as_advanced(BUILD_SHARED_LIBS)
...@@ -46,6 +69,7 @@ endif (MSVC) ...@@ -46,6 +69,7 @@ endif (MSVC)
# parallel of sequential version # parallel of sequential version
if (ENABLE_PARALLEL_DOMAIN) if (ENABLE_PARALLEL_DOMAIN)
set(ENABLE_MPI CACHE BOOL "Compile with MPI compiler and library" FORCE)
set(POSTFIX "-p") set(POSTFIX "-p")
else () else ()
set(POSTFIX "-s") set(POSTFIX "-s")
......
...@@ -182,6 +182,11 @@ list(APPEND AMDIS_SRC ...@@ -182,6 +182,11 @@ list(APPEND AMDIS_SRC
${SOURCE_DIR}/ProblemStatDbg.cc ${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(amdis_parallel)
include(muparser) include(muparser)
......
if (ENABLE_PARALLEL_DOMAIN) if (ENABLE_PARALLEL_DOMAIN)
option(ENABLE_ZOLTAN "Add support for the Parallel Partitioning suite Zoltan" false)
option(ENABLE_PARALLEL_SOLVERS "Add some problem dependent solver, e.g. Feti, Navier-Stokes and Cahn-Hilliard" true)
option(ENABLE_BDDCML "Add support for the BDDCML library" false)
mark_as_advanced(ENABLE_PARALLEL_SOLVERS)
mark_as_advanced(ENABLE_BDDCML)
set(PARALLEL_DOMAIN_AMDIS_SRC set(PARALLEL_DOMAIN_AMDIS_SRC
${SOURCE_DIR}/parallel/DofComm.cc ${SOURCE_DIR}/parallel/DofComm.cc
${SOURCE_DIR}/parallel/CheckerPartitioner.cc ${SOURCE_DIR}/parallel/CheckerPartitioner.cc
...@@ -26,7 +20,6 @@ if (ENABLE_PARALLEL_DOMAIN) ...@@ -26,7 +20,6 @@ if (ENABLE_PARALLEL_DOMAIN)
list(APPEND COMPILEFLAGS "-DHAVE_PARALLEL_DOMAIN_AMDIS=1") list(APPEND COMPILEFLAGS "-DHAVE_PARALLEL_DOMAIN_AMDIS=1")
enable_mpi(COMPILEFLAGS AMDIS_INCLUDE_DIRS _)
enable_petsc(COMPILEFLAGS AMDIS_INCLUDE_DIRS _) enable_petsc(COMPILEFLAGS AMDIS_INCLUDE_DIRS _)
# add support for the zoltan library # add support for the zoltan library
......
...@@ -12,22 +12,14 @@ macro(enable_mtl4 _FLAGS_ _INC_DIRS_ _LIBS_) ...@@ -12,22 +12,14 @@ macro(enable_mtl4 _FLAGS_ _INC_DIRS_ _LIBS_)
endif (LINK_EXECUTABLE) endif (LINK_EXECUTABLE)
list(APPEND ${_FLAGS_} "-DMTL_ASSERT_FOR_THROW=1") list(APPEND ${_FLAGS_} "-DMTL_ASSERT_FOR_THROW=1")
set (CXX_ELEVEN_FEATURE_LIST "MOVE" "AUTO" "RANGEDFOR" "INITLIST" "STATICASSERT" "DEFAULTIMPL")
if (ENABLE_CXX11 OR AMDIS_NEED_CXX11) foreach (feature ${CXX_ELEVEN_FEATURE_LIST})
set (CXX_ELEVEN_FEATURE_LIST "MOVE" "AUTO" "RANGEDFOR" "INITLIST" "STATICASSERT" "DEFAULTIMPL") list(APPEND ${_FLAGS_} "-DMTL_WITH_${feature}")
foreach (feature ${CXX_ELEVEN_FEATURE_LIST}) endforeach ()
list(APPEND ${_FLAGS_} "-DMTL_WITH_${feature}")
endforeach ()
endif ()
if (ENABLE_OPENMP) if (ENABLE_OPENMP)
find_package(OpenMP REQUIRED) find_package(OpenMP REQUIRED)
if (OPENMP_FOUND) list(APPEND ${_FLAGS_} "-DMTL_WITH_OPENMP" "-DHAVE_OPENMP" ${OpenMP_CXX_FLAGS})
list(APPEND ${_FLAGS_} "-DMTL_WITH_OPENMP" ${OpenMP_CXX_FLAGS})
else ()
message(FATAL_ERROR "OpenMP not found")
endif (OPENMP_FOUND)
endif (ENABLE_OPENMP) endif (ENABLE_OPENMP)
endmacro(enable_mtl4) endmacro(enable_mtl4)
set(AMDIS_NEED_CXX11 @ENABLE_CXX11@)
set(AMDIS_NEED_UMFPACK @ENABLE_UMFPACK@) set(AMDIS_NEED_UMFPACK @ENABLE_UMFPACK@)
set(AMDIS_NEED_COMPRESSION @ENABLE_COMPRESSION@) set(AMDIS_NEED_COMPRESSION @ENABLE_COMPRESSION@)
set(AMDIS_NEED_EXTENSIONS @ENABLE_EXTENSIONS@) set(AMDIS_NEED_EXTENSIONS @ENABLE_EXTENSIONS@)
...@@ -12,22 +11,23 @@ set(AMDIS_NEED_PNG @ENABLE_PNG@) ...@@ -12,22 +11,23 @@ set(AMDIS_NEED_PNG @ENABLE_PNG@)
set(AMDIS_NEED_SEQ_PETSC @ENABLE_SEQ_PETSC@) set(AMDIS_NEED_SEQ_PETSC @ENABLE_SEQ_PETSC@)
set(BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@) set(BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
set(CMAKE_BUILD_TYPE @CMAKE_BUILD_TYPE@)
add_library(amdis_base INTERFACE) add_library(amdis_base INTERFACE)
add_library(AMDiS ALIAS amdis_base) add_library(AMDiS ALIAS amdis_base)
target_compile_definitions(amdis_base INTERFACE) target_compile_definitions(amdis_base INTERFACE)
if (AMDIS_NEED_CXX11)
target_enable_cxx11(AMDIS_NEED_CXX11 amdis_base INTERFACE) target_enable_cxx14(SUPPORTS_CXX14 amdis_base INTERFACE)
if (NOT AMDIS_NEED_CXX11) if (NOT SUPPORTS_CXX14)
message(FATAL_ERROR "AMDiS was compiled with c++11 support, but the current compiler does not support this feature!") target_enable_cxx11(SUPPORTS_CXX11 amdis_base INTERFACE)
endif (NOT AMDIS_NEED_CXX11) endif ()
target_compile_definitions(amdis_base INTERFACE AMDIS_HAS_CXX11=1)
else () if (NOT SUPPORTS_CXX11 AND NOT SUPPORTS_CXX14)
target_compile_definitions(amdis_base INTERFACE AMDIS_HAS_CXX11=0) message(FATAL_ERROR "AMDiS was compiled with c++11 support, but the current compiler does not support this feature!")
endif (AMDIS_NEED_CXX11) endif ()
target_compile_definitions(amdis_base INTERFACE AMDIS_HAS_CXX11=1)
# try to detect the AMDiS include directory # try to detect the AMDiS include directory
...@@ -78,8 +78,7 @@ target_enable_boost(amdis_base INTERFACE ON) ...@@ -78,8 +78,7 @@ target_enable_boost(amdis_base INTERFACE ON)
# -------------------- # --------------------
if (AMDIS_NEED_UMFPACK) if (AMDIS_NEED_UMFPACK)
set(AMDIS_SuiteSparse_DIR @SuiteSparse_DIR@) set(AMDIS_SuiteSparse_DIR @SuiteSparse_DIR@)
set(AMDIS_UMFPACK_INCLUDE_DIR @UMFPACK_INCLUDE_DIRS@) set(AMDIS_UMFPACK_ROOT_DIR @UMFPACK_ROOT_DIR@)
set(AMDIS_UMFPACK_LIB_DIR ${AMDIS_UMFPACK_INCLUDE_DIR}/../include)
target_enable_umfpack(amdis_base INTERFACE ON) target_enable_umfpack(amdis_base INTERFACE ON)
endif (AMDIS_NEED_UMFPACK) endif (AMDIS_NEED_UMFPACK)
......
...@@ -23,12 +23,19 @@ add_library(AMDiS::base ALIAS amdis_base) ...@@ -23,12 +23,19 @@ add_library(AMDiS::base ALIAS amdis_base)
target_include_directories(amdis_base INTERFACE ${SOURCE_DIR}) target_include_directories(amdis_base INTERFACE ${SOURCE_DIR})
target_compile_definitions(amdis_base INTERFACE) target_compile_definitions(amdis_base INTERFACE)
target_enable_cxx11(ENABLE_CXX11 amdis_base INTERFACE)
if (ENABLE_CXX11) target_enable_cxx14(SUPPORTS_CXX14 amdis_base INTERFACE)
target_compile_definitions(amdis_base INTERFACE AMDIS_HAS_CXX11=1) if (SUPPORTS_CXX14)
target_compile_definitions(amdis_base INTERFACE AMDIS_HAS_CXX14=1)
else () else ()
target_compile_definitions(amdis_base INTERFACE AMDIS_HAS_CXX11=0) target_enable_cxx11(SUPPORTS_CXX11 amdis_base INTERFACE)
endif (ENABLE_CXX11) endif ()
if (NOT SUPPORTS_CXX11 AND NOT SUPPORTS_CXX14)
message(FATAL_ERROR "AMDiS needs c++11 support, but the current compiler does not support this feature!")
endif ()
target_compile_definitions(amdis_base INTERFACE AMDIS_HAS_CXX11=1)
target_enable_mtl4(amdis_base INTERFACE) target_enable_mtl4(amdis_base INTERFACE)
target_enable_boost(amdis_base INTERFACE) target_enable_boost(amdis_base INTERFACE)
...@@ -65,6 +72,7 @@ add_library(amdis ...@@ -65,6 +72,7 @@ add_library(amdis
${SOURCE_DIR}/DOFAdmin.cc ${SOURCE_DIR}/DOFAdmin.cc
${SOURCE_DIR}/DOFIndexed.cc ${SOURCE_DIR}/DOFIndexed.cc
${SOURCE_DIR}/DOFMatrix.cc ${SOURCE_DIR}/DOFMatrix.cc
${SOURCE_DIR}/DOFSerializer.cc
${SOURCE_DIR}/DOFVector.cc ${SOURCE_DIR}/DOFVector.cc
${SOURCE_DIR}/DirichletBC.cc ${SOURCE_DIR}/DirichletBC.cc
${SOURCE_DIR}/DualTraverse.cc ${SOURCE_DIR}/DualTraverse.cc
...@@ -171,6 +179,11 @@ add_library(amdis ...@@ -171,6 +179,11 @@ add_library(amdis
${SOURCE_DIR}/ProblemStatDbg.cc ${SOURCE_DIR}/ProblemStatDbg.cc
) )
if (ENABLE_MPI)
target_enable_mpi(amdis_base INTERFACE)
target_compile_definitions(amdis_base INTERFACE HAVE_MPI=1)
endif (ENABLE_MPI)
include(amdis_parallel) # adds sources to amdis include(amdis_parallel) # adds sources to amdis
include(amdis_extensions) # -> target AMDiS::extensions include(amdis_extensions) # -> target AMDiS::extensions
include(muparser) # -> target muparser include(muparser) # -> target muparser
......
if (ENABLE_PARALLEL_DOMAIN) if (ENABLE_PARALLEL_DOMAIN)
option(ENABLE_ZOLTAN "Add support for the Parallel Partitioning suite Zoltan" false)
option(ENABLE_PARALLEL_SOLVERS "Add some problem dependent solver, e.g. Feti, Navier-Stokes and Cahn-Hilliard" true)
mark_as_advanced(ENABLE_PARALLEL_SOLVERS)
add_library(amdis_parallel INTERFACE) add_library(amdis_parallel INTERFACE)
target_sources(amdis PRIVATE target_sources(amdis PRIVATE
${SOURCE_DIR}/parallel/DofComm.cc ${SOURCE_DIR}/parallel/DofComm.cc
...@@ -26,7 +22,6 @@ if (ENABLE_PARALLEL_DOMAIN) ...@@ -26,7 +22,6 @@ if (ENABLE_PARALLEL_DOMAIN)
target_compile_definitions(amdis_parallel INTERFACE target_compile_definitions(amdis_parallel INTERFACE
HAVE_PARALLEL_DOMAIN_AMDIS=1) HAVE_PARALLEL_DOMAIN_AMDIS=1)
target_enable_mpi(amdis_parallel INTERFACE)
target_enable_petsc(amdis_parallel INTERFACE) target_enable_petsc(amdis_parallel INTERFACE)
# add support for the zoltan library # add support for the zoltan library
......
...@@ -17,10 +17,8 @@ add_library(muparser STATIC ...@@ -17,10 +17,8 @@ add_library(muparser STATIC
target_include_directories(muparser PUBLIC ${MUPARSER_INCLUDE_DIR}) target_include_directories(muparser PUBLIC ${MUPARSER_INCLUDE_DIR})
set_property(TARGET muparser PROPERTY POSITION_INDEPENDENT_CODE ON) set_property(TARGET muparser PROPERTY POSITION_INDEPENDENT_CODE ON)
if (ENABLE_CXX11) target_enable_cxx11(MUPARSER_ENABLE_CXX11 muparser PRIVATE)
target_enable_cxx11(MUPARSER_ENABLE_CXX11 muparser PRIVATE) target_compile_definitions(muparser PRIVATE AMDIS_HAS_CXX11=1)
target_compile_definitions(muparser PRIVATE AMDIS_HAS_CXX11=1)
endif (ENABLE_CXX11)
# specify how to install this target: # specify how to install this target:
# ----------------------------------- # -----------------------------------
......
...@@ -19,7 +19,7 @@ macro(target_enable_bddcml _TARGET_ _SCOPE_) ...@@ -19,7 +19,7 @@ macro(target_enable_bddcml _TARGET_ _SCOPE_)
message(FATAL_ERROR "Could not find BDDCML headers.") message(FATAL_ERROR "Could not find BDDCML headers.")
endif() endif()
if (LINK_EXECUTABLE) if (LINK_EXECUTABLE OR APPLE)
find_library(BDDCML_LIB bddcml find_library(BDDCML_LIB bddcml
HINTS ENV LIBRARY_PATH HINTS ENV LIBRARY_PATH
DOC "BDDCML library") DOC "BDDCML library")
...@@ -29,7 +29,7 @@ macro(target_enable_bddcml _TARGET_ _SCOPE_) ...@@ -29,7 +29,7 @@ macro(target_enable_bddcml _TARGET_ _SCOPE_)
else() else()
message(FATAL_ERROR "Could not find the BDDCML library") message(FATAL_ERROR "Could not find the BDDCML library")
endif() endif()
endif (LINK_EXECUTABLE) endif (LINK_EXECUTABLE OR APPLE)
target_compile_definitions(${_TARGET_} ${_SCOPE_} HAVE_BDDCML=1) target_compile_definitions(${_TARGET_} ${_SCOPE_} HAVE_BDDCML=1)
endmacro(target_enable_bddcml) endmacro(target_enable_bddcml)
...@@ -28,9 +28,9 @@ macro(target_enable_boost _TARGET_ _SCOPE_) ...@@ -28,9 +28,9 @@ macro(target_enable_boost _TARGET_ _SCOPE_)
find_package(Boost ${BOOST_VERSION} REQUIRED ${BOOST_LIBS_REQUIRED}) find_package(Boost ${BOOST_VERSION} REQUIRED ${BOOST_LIBS_REQUIRED})
target_include_directories(${_TARGET_} ${_SCOPE_} ${Boost_INCLUDE_DIR}) target_include_directories(${_TARGET_} ${_SCOPE_} ${Boost_INCLUDE_DIR})
if (LINK_EXECUTABLE) if (LINK_EXECUTABLE OR APPLE)
target_link_libraries(${_TARGET_} ${_SCOPE_} ${Boost_LIBRARIES}) target_link_libraries(${_TARGET_} ${_SCOPE_} ${Boost_LIBRARIES})
endif (LINK_EXECUTABLE) endif (LINK_EXECUTABLE OR APPLE)
if (MSVC_SHARED_LIBS AND LINK_EXECUTABLE) if (MSVC_SHARED_LIBS AND LINK_EXECUTABLE)
link_directories(${Boost_LIBRARY_DIRS}) link_directories(${Boost_LIBRARY_DIRS})
......
include(CheckCXXCompilerFlag) include(CheckCXXCompilerFlag)
include(CheckCXXSourceCompiles) include(CheckCXXSourceCompiles)
macro(target_enable_cxx14 RESULT_VAR _TARGET_ _SCOPE_)
check_cxx_compiler_flag("-std=c++14" COMPILER_SUPPORTS_CXX14_FLAG)
set(CXX14_CODE "
auto f() { return 1; }
int main(){
auto f1 = [](auto const& y) { return y; };
auto y0 = f();
auto y1 = f1(1);
}")
if (COMPILER_SUPPORTS_CXX14_FLAG)
set(CMAKE_REQUIRED_FLAGS "-std=c++14")
check_cxx_source_compiles("${CXX14_CODE}" CXX14_COMPILES_WITH_CXX14_FLAG)
set(CMAKE_REQUIRED_FLAGS "")
endif ()
if (COMPILER_SUPPORTS_CXX14_FLAG AND CXX14_COMPILES_WITH_CXX14_FLAG)
target_compile_options(${_TARGET_} ${_SCOPE_} "-std=c++14")
set(${RESULT_VAR} true CACHE BOOL "Enable C++14 compiler features" FORCE)
else ()
check_cxx_source_compiles("${CXX14_CODE}" CXX14_COMPILES)
if (CXX14_COMPILES)
set(${RESULT_VAR} true CACHE BOOL "Enable C++14 compiler features" FORCE)
else ()
set(${RESULT_VAR} false CACHE BOOL "Enable C++14 compiler features" FORCE)
endif ()
endif ()
endmacro(target_enable_cxx14)
macro(target_enable_cxx11 RESULT_VAR _TARGET_ _SCOPE_) macro(target_enable_cxx11 RESULT_VAR _TARGET_ _SCOPE_)
check_cxx_compiler_flag("-std=c++11" COMPILER_SUPPORTS_CXX11_FLAG) check_cxx_compiler_flag("-std=c++11" COMPILER_SUPPORTS_CXX11_FLAG)
......
...@@ -21,7 +21,7 @@ macro(target_enable_hypre _TARGET_ _SCOPE_) ...@@ -21,7 +21,7 @@ macro(target_enable_hypre _TARGET_ _SCOPE_)
target_include_directories(${_TARGET_} ${_SCOPE_} ${HYPRE_INCLUDE_DIRECTORIES}) target_include_directories(${_TARGET_} ${_SCOPE_} ${HYPRE_INCLUDE_DIRECTORIES})
endif (_HYPRE_H) endif (_HYPRE_H)
if (LINK_EXECUTABLE) if (LINK_EXECUTABLE OR APPLE)
find_library(_HYPRE_LIB HYPRE find_library(_HYPRE_LIB HYPRE
HINTS ${PETSC_LIBRARY_DIRS}) HINTS ${PETSC_LIBRARY_DIRS})
...@@ -41,10 +41,10 @@ macro(target_enable_hypre _TARGET_ _SCOPE_) ...@@ -41,10 +41,10 @@ macro(target_enable_hypre _TARGET_ _SCOPE_)
find_package(LAPACK REQUIRED) find_package(LAPACK REQUIRED)
endif (LAPACK_LIB) endif (LAPACK_LIB)
target_link_libraries(${_TARGET_} ${_SCOPE_} ${LAPACK_LIBRARIES}) target_link_libraries(${_TARGET_} ${_SCOPE_} ${LAPACK_LIBRARIES})
endif (LINK_EXECUTABLE) endif (LINK_EXECUTABLE OR APPLE)
if (_HYPRE_H AND (NOT LINK_EXECUTABLE OR _HYPRE_LIB)) if (_HYPRE_H AND (NOT LINK_EXECUTABLE OR _HYPRE_LIB OR APPLE))
set(HAVE_HYPRE ON) set(HAVE_HYPRE ON)
target_compile_definitions(${_TARGET_} ${_SCOPE_} MTL_HAS_HYPRE) target_compile_definitions(${_TARGET_} ${_SCOPE_} MTL_HAS_HYPRE)
else () else ()
......
macro(target_enable_mtl4 _TARGET_ _SCOPE_) macro(target_enable_mtl4 _TARGET_ _SCOPE_)
if (${ARGC} GREATER 2) if (${ARGC} GREATER 2)
set(LINK_EXECUTABLE ON) set(LINK_EXECUTABLE ON)
else () else ()
set(LINK_EXECUTABLE OFF) set(LINK_EXECUTABLE OFF)
endif () endif ()
if (LINK_EXECUTABLE) if (LINK_EXECUTABLE)
target_include_directories(${_TARGET_} ${_SCOPE_} ${AMDIS_INCLUDE_DIR}/mtl4) target_include_directories(${_TARGET_} ${_SCOPE_} ${AMDIS_INCLUDE_DIR}/mtl4)
else () else ()
target_include_directories(${_TARGET_} ${_SCOPE_} ${BASE_DIR}/lib/mtl4) target_include_directories(${_TARGET_} ${_SCOPE_} ${BASE_DIR}/lib/mtl4)
endif (LINK_EXECUTABLE) endif (LINK_EXECUTABLE)