From 78f2e1433737d50ca5a4c604ed39282194f19d9d Mon Sep 17 00:00:00 2001
From: maier
- The various configuration options of the deal.II library are
- organized in three categories: feature,
- component, and
- build/install
+ The various configuration options of the
+ deal.II library are organized in three
+ categories: feature,
+ component, and build/install
configuration.
- deal.II provides (optional) interfaces to quite a number of external
- libraries. All of these are represented by
@@ -236,48 +237,56 @@
DEAL_II_WITH_ZLIB
They all have standard meaning with the exception of
- two: cmake
system
+
Fine tuning the configuration system
Feature configuration
cmake
- variables that are set to ON
if an external package
- is found and recognized and to OFF
otherwise. By
- explicitly setting it to off either on the command line or
- using ccmake
, you can prevent deal.II from using
- this external package, even if it is found.
+ deal.II provides (optional) interfaces to quite
+ a number of external libraries. All of these are represented by
+ cmake
variables that are set to ON
if
+ an external package is found or to OFF
otherwise. By
+ explicitly setting it to off either on the command line or using
+ ccmake
, you can prevent deal.II
+ from using this external package, even if it is found.
DEAL_II_WITH_BOOST
is always ON
- since the question is not whether or not to use BOOST but only
- whether to use a copy of BOOST found on the system or to fall
- back to the one found in the bundled/
directory of
- deal.II. Secondly, DEAL_II_WITH_THREADS
decides
- whether to use threads and if set to on also decides whether we
- interface to the Threading Building Blocks (TBB) library which
- we need in that case.
+ two:
+
+
DEAL_II_WITH_BOOST
is always ON
+ since BOOST is a mandatory build time dependency.
+
+ DEAL_II_WITH_THREADS
decides whether to use
+ threads and if set to ON
also decides whether
+ we interface to the Threading Building Blocks (TBB) library
+ which we need in that case.
+
If enabled, each of the features above will usually add one ore
more dependencies to external or 'bundled' (i.e. bundled with
- deal.II and residing under bundled/
) libraries.
+ deal.II and residing under bundled/
)
+ libraries.
There are some options to determine the behavior of the dependency
resolution. Specifically, the
option DEAL_II_ALLOW_BUNDLED
determines the
- following question:
+ following:
ON
external libraries still have
+ precedence. But if there is no external library the bundled
+ library will be used.
+
+ OFF
bundled libraries will not be
+ used and the dependency resolution will fail if there is no
+ external library
+
+ DEAL_II_FORCE_BUNDLED_<library>
forces
+ the use of the bundled library regardless whether
+ DEAL_II_ALLOW_BUNDLED
is set to OFF
+ or an external library is found. This applies to the options
+ DEAL_II_FORCE_BUNDLED_(BOOST|FUNCTIONPARSER|THREADS|UMFPACK)
.
- Thus, to ensure that no bundled library is used at all DEAL_II_ALLOW_BUNDLED,
- as well as every DEAL_II_FORCE_BUNDLED_<library> have to be set to OFF.
- Conversely, DEAL_II_FORCE_BUNDLED_<library>=ON will not automatically enable the
- corresponding DEAL_II_WITH_<feature> toggle. This has to be set
- separately.
+ Thus, to ensure that no bundled library is used at all
+ DEAL_II_ALLOW_BUNDLED
, as well as every
+ DEAL_II_FORCE_BUNDLED_<library>
+ have to be set to OFF
. Conversely,
+ DEAL_II_FORCE_BUNDLED_<library>=ON
+ will not automatically enable the corresponding
+ DEAL_II_WITH_<feature>
toggle. This has to be
+ set separately.
- As long as DEAL_II_WITH_<FEATURE> is not explicitly set to ON or OFF in the cache it
- will be automatically configured. If a toggle DEAL_II_WITH_<FEATURE> is
- defined it won't be altered.
- This means that the very first configuration run will set all
- available features to ON and the rest to OFF. In all subsequent
- configuration steps DEAL_II_WITH_<FEATURE> have to be
- changed by hand, see the first section above.
+ As long as DEAL_II_WITH_<FEATURE>
is
+ not explicitly set to ON
or OFF
+ in the cache it will be automatically configured. If a toggle
+ DEAL_II_WITH_<FEATURE>
is defined it won't
+ be altered.
+ This means that the very first configuration run will set
+ all available features to ON
and the rest
+ to OFF
. In all subsequent configuration steps
+ DEAL_II_WITH_<FEATURE>
has to be changed by hand,
+ see the previous section.
This behavior can be controlled via several variables:
DEAL_II_ALLOW_AUTODETECTION=OFF
: This will
+ disable any autoconfiguration by setting undefined
+ DEAL_II_WITH_<FEATURE>
toggles to
+ OFF
.
DEAL_II_FORCE_AUTODETECTION=ON
: This will
+ force the reconfiguration of every feature by undefining
+ DEAL_II_WITH_<FEATURE>
prior to
+ configuration, effectively overwriting any supplied or
+ cached value.
External libraries will be searched depending on hints in the following order: -
- Paths specified via CMAKE_PREFIX_PATH take precedence, e.g. with
+ Paths specified via CMAKE_PREFIX_PATH
take
+ precedence, e.g. with
- cmake -DCMAKE_PREFIX_PATH=~/workspace/local ../deal.II + cmake -DCMAKE_PREFIX_PATH=~/workspace/local ../deal.II- libraries from ~/workspace/local will be preferred for dependency - resolution. + libraries from
~/workspace/local
will be
+ preferred for dependency resolution.
- Hints given by <library>_DIR via command line or environment for - some libraries: -
+ Hints given by<library>_DIR
via command + line or environment for some libraries: +- cmake -DP4EST_DIR=~/workspace/p4est-install/ ../deal.II + cmake -DP4EST_DIR=~/workspace/p4est-install/ ../deal.IIor- export P4EST_DIR=~/workspace/p4est-install/ - cmake ../deal.II + export P4EST_DIR=~/workspace/p4est-install/ + cmake ../deal.II- where -D<library>_DIR takes precedence over environment. + where-D<library>_DIR
takes precedence + over environment.Currently, the following variables will be considered:
- HDF5_DIR - METIS_DIR, - MUMPS_DIR (and SCALAPACK_DIR, BLACS_DIR), - P4EST_DIR (and SC_DIR), - PETSC_DIR and PETSC_ARCH (forming ${PETSC_DIR}/${PETSC_ARCH}), - SLEPC_DIR and SLEPC_ARCH (forming ${SLEPC_DIR}/${SLEPC_ARCH}), - TRILINOS_DIR, - UMFPACK_DIR (and AMD_DIR, SUITESPARSECONFIG_DIR) + ARPACK_DIR, + HDF5_DIR, + METIS_DIR, + MUMPS_DIR (and SCALAPACK_DIR, BLACS_DIR), + P4EST_DIR (and SC_DIR), + PETSC_DIR and PETSC_ARCH (forming ${PETSC_DIR}/${PETSC_ARCH}), + SLEPC_DIR and SLEPC_ARCH (forming ${SLEPC_DIR}/${SLEPC_ARCH}), + TRILINOS_DIR, + UMFPACK_DIR (and AMD_DIR, SUITESPARSECONFIG_DIR)@@ -369,18 +386,19 @@- Alternatively, cached variables set by the Find<Module> mechanism may be - set, hinted or overwritten directly. - These variables are usually called <library>_INCLUDE_DIR(|S) and - <library>_(LIBRARY|LIBRARIES) (highly dependend of the actual library). - You can get a list via + Alternatively, cached variables set by the +
Find<Module>
mechanism may be set, + hinted or overwritten directly. These variables are usually + called<library>_INCLUDE_DIR(|S)
and +<library>_(LIBRARY|LIBRARIES)
(highly dependend + of the actual library). You can get a list via- make edit_cache + make edit_cacheand entering advanced configuration mode by pressing [t]. - Variables that could not be determined are suffixed with -NOTFOUND and - may be set by hand. + Variables that could not be determined are suffixed with +-NOTFOUND
and may be set by hand. @@ -388,30 +406,32 @@Component selection
- The following options control which components of deal.II will be - configured, built and installed: + The following options control which components of + deal.II will be configured, built and installed:
DEAL_II_COMPONENT_CONTRIB
:
+ Enable configuration and installation of programs
+ in contrib/
. This adds a component
+ contrib
to the build system.
DEAL_II_COMPONENT_COMPAT_FILES
:
+ Enable installation of legacy files and tools for
+ compatibility with the old build system This adds a component
+ compat_files
to the build system.
DEAL_II_COMPONENT_DOCUMENTATION
:
+ Enable configuration, build and installation of the
+ documentation. This adds a component documentation
+ to the build system.
DEAL_II_COMPONENT_EXAMPLES
:
Enable configuration and installation of the example steps.
- This adds a COMPONENT "examples" to the build system.
+ This adds a component examples
to the build system.
- deal.II will configure sensible default CFLAGS and CXXFLAGS depending on
- platform, compiler and build target. There are two options, if this is
- not desired:
+ deal.II will configure sensible default CFLAGS
and
+ CXXFLAGS
depending on platform, compiler and build
+ target. There are two options to override this behaviour:
DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS
to
+ OFF
. Beware of the fact that certain features
+ may still pull in necessary compiler flags.
- CMAKE_CXX_FLAGS - used during all builds - DEAL_II_CXX_FLAGS_DEBUG - additional flags for the debug library - DEAL_II_CXX_FLAGS_RELEASE - additional flags for the release library + CMAKE_CXX_FLAGS - used during all builds + DEAL_II_CXX_FLAGS_DEBUG - additional flags for the debug library + DEAL_II_CXX_FLAGS_RELEASE - additional flags for the release library- The content of the cached variables will be preserved and added - to the end of the default compiler flags, hence providing the possibility - for overwriting a flag. E.g.: -Wsign-compare, set by the build system, - can be overwritten by specifying: + The content of the cached variables will be preserved + and added to the end of the default compiler flags, + hence providing the possibility for overwriting a flag. E.g.: +
-Wsign-compare
, set by the build system, can be
+ overwritten by specifying:
- cmake -DCMAKE_CXX_FLAGS="-Wno-sign-compare" <...> + cmake -DCMAKE_CXX_FLAGS="-Wno-sign-compare" <...>
BUILD_SHARED_LIBS
: If set (default),
+ deal.II will be linked as a shared library
CMAKE_INSTALL_RPATH_USE_LINK_PATH
: If set
+ (default), the deal.II library will be
+ installed with rpaths set for all libraries outside of the
+ system search paths
- CMAKE_INSTALL_PREFIX determines the location, where the deal.II library
- will be installed.
- Please note that depending on whether DEAL_II_COMPONENT_COMPAT_FILES is
- set, there will be different folder structures:
+ CMAKE_INSTALL_PREFIX
determines the location,
+ where the deal.II library will be
+ installed to. Please note that depending on whether
+ DEAL_II_COMPONENT_COMPAT_FILES
is set, there will be
+ different directory structures:
DEAL_II_COMPONENT_COMPAT_FILES=ON
:
- ${CMAKE_INSTALL_PREFIX}/ - common - common/scripts - doc - examples - include - lib + ${CMAKE_INSTALL_PREFIX}/ + bin + cmake/macros + common + common/scripts + doc + examples + include + lib + lib/cmake/deal.II
DEAL_II_COMPONENT_COMPAT_FILES=OFF
:
- ${CMAKE_INSTALL_PREFIX}/ - include - lib${LIB_SUFFIX} - share/doc/deal.II/examples - share/doc/deal.II/html + ${CMAKE_INSTALL_PREFIX}/ + bin + include + lib${LIB_SUFFIX} + lib${LIB_SUFFIX}/cmake/deal.II + share/deal.II/ + share/deal.II/cmake/macros + share/doc/deal.II/examples + share/doc/deal.II/html
- DEAL_II_CMAKE_MACROS_RELDIR - DEAL_II_DOCUMENTATION_RELDIR - DEAL_II_EXAMPLES_RELDIR - DEAL_II_EXECUTABLE_RELDIR - DEAL_II_INCLUDE_RELDIR - DEAL_II_LIBRARY_RELDIR - DEAL_II_PROJECT_CONFIG_RELDIR + DEAL_II_CMAKE_MACROS_RELDIR + DEAL_II_DOCUMENTATION_RELDIR + DEAL_II_EXAMPLES_RELDIR + DEAL_II_EXECUTABLE_RELDIR + DEAL_II_INCLUDE_RELDIR + DEAL_II_LIBRARY_RELDIR + DEAL_II_PROJECT_CONFIG_RELDIR-
- Using deal.II in your own project is particularly simple if your
- project also uses cmake
. The following subsections
- describe this process.
+ Using deal.II in your own project is particularly
+ simple if your project also uses cmake
. The following
+ subsections describe this process.
- Finding the deal.II library should be no more than + Finding the deal.II library should be no more than
- FIND_PACKAGE(deal.II CONFIG REQUIRED) + FIND_PACKAGE(deal.II REQUIRED)- in your CMakeLists.txt file. - You may have to hint for the location of the deal.IIConfig.cmake file. - Either by directly specifying deal.II_DIR to point to the path were the - deal.IIConfig.cmake files are located: + in your CMakeLists.txt file. You may have to hint for the location + of the
deal.IIConfig.cmake
file. Either by directly
+ specifying deal.II_DIR
to point to the path were the
+ deal.IIConfig.cmake
file is located:
- cmake -Ddeal.II_DIR=/path/to/the/config/file <...> + cmake -Ddeal.II_DIR=/path/to/the/config/file <...>- or by specifying a search path via CMAKE_PREFIX_PATH, e.g. + or by specifying a search path via
CMAKE_PREFIX_PATH
,
+ e.g.
- $ cmake -DCMAKE_PREFIX_PATH=~/workspace/local + cmake -DCMAKE_PREFIX_PATH=~/workspace/local- In this case deal.IIConfig.cmake will be searched for in + In this case
deal.IIConfig.cmake
will be searched
+ for in
- ~/workspace/local/ - ~/workspace/local/lib/cmake/deal.II/ + ~/workspace/local/ + ~/workspace/local/lib/cmake/deal.II/@@ -562,33 +595,37 @@
- Importing the deal.IIConfig.cmake file via FIND_PACKAGE will set a bunch
- of variables and macros; all of the form DEAL_II_*. There is the usual
- duplet:
+ Importing the deal.IIConfig.cmake file via FIND_PACKAGE
+ will set a bunch of variables and macros; all of the form
+ DEAL_II_*
. There is the usual duplet:
- DEAL_II_INCLUDE_DIRS - DEAL_II_LIBRARIES + DEAL_II_INCLUDE_DIRS + DEAL_II_LIBRARIES- (with "debug" and "optimized" keywords. For compatibility there is - also DEAL_II_LIBRARIES_DEBUG and DEAL_II_LIBRARIES_RELEASE only - specifying the respective set of libraries.) + (with
debug
and optimized
keywords. For
+ compatibility there is also DEAL_II_LIBRARIES_DEBUG
+ and DEAL_II_LIBRARIES_RELEASE
only specifying the
+ respective set of libraries.)
+
+
+ Interesting additional variables might be:
- DEAL_II_USER_DEFINITIONS - DEAL_II_USER_DEFINITIONS_DEBUG - DEAL_II_USER_DEFINITIONS_RELEASE - DEAL_II_LINKER_FLAGS - DEAL_II_LINKER_FLAGS_DEBUG - DEAL_II_LINKER_FLAGS_RELEASE - DEAL_II_CXX_FLAGS - DEAL_II_CXX_FLAGS_RELEASE - DEAL_II_CXX_FLAGS_DEBUG - - DEAL_II_TARGET_CONFIG - DEAL_II_TARGET_DEBUG - DEAL_II_TARGET_RELEASE + DEAL_II_USER_DEFINITIONS + DEAL_II_USER_DEFINITIONS_DEBUG + DEAL_II_USER_DEFINITIONS_RELEASE + DEAL_II_LINKER_FLAGS + DEAL_II_LINKER_FLAGS_DEBUG + DEAL_II_LINKER_FLAGS_RELEASE + DEAL_II_CXX_FLAGS + DEAL_II_CXX_FLAGS_RELEASE + DEAL_II_CXX_FLAGS_DEBUG + + DEAL_II_TARGET_CONFIG + DEAL_II_TARGET_DEBUG + DEAL_II_TARGET_RELEASE@@ -598,212 +635,231 @@
- Usually for actually using deal.II the following configuration steps are - necessary. This can be either done by hand (1.), or set up via macros - (2.). + For actually using deal.II in your CMake + project some configuration steps are necessary. These can be + either set via macros or by hand:
+ deal.IIConfig.cmake
includes some convenience macros
+ to automatically setup all necessary configuration. A fully
+ functional, minimal example for the step-1 tutorial program is:
+
+ + FIND_PACKAGE(deal.II REQUIRED) + + DEAL_II_INITIALIZE_CACHED_VARIABLES() + + PROJECT(step-1) + + ADD_EXECUTABLE(step-1 step-1.cc) + DEAL_II_SETUP_TARGET(step-1) ++ + + +
- INCLUDE_DIRECTORIES( - # The deal.II include directories: - ${DEAL_II_INCLUDE_DIRS} - # External include directories necessary for user programs: - ${DEAL_II_EXTERNAL_INCLUDE_DIRS} - ) + INCLUDE_DIRECTORIES(${DEAL_II_INCLUDE_DIRS})
CMAKE_BUILD_TYPE
accordingly:
- SET(CMAKE_BUILD_TYPE "Debug" CACHE - "Choose the type of build, options are: Debug, Release" - ) + SET(CMAKE_BUILD_TYPE "Debug" CACHE + "Choose the type of build, options are: Debug, Release" + )A cached variable ensures that we can later switch the build type by editing the cache:
- ccmake <...> or $ make edit_cache + make edit_cache
- SET(CMAKE_CXX_FLAGS ${DEAL_II_CXX_FLAGS}) - SET(CMAKE_CXX_FLAGS_RELEASE ${DEAL_II_CXX_FLAGS_RELEASE}) - SET(CMAKE_CXX_FLAGS_DEBUG ${DEAL_II_CXX_FLAGS_DEBUG}) + SET(CMAKE_CXX_FLAGS ${DEAL_II_CXX_FLAGS}) + SET(CMAKE_CXX_FLAGS_RELEASE ${DEAL_II_CXX_FLAGS_RELEASE}) + SET(CMAKE_CXX_FLAGS_DEBUG ${DEAL_II_CXX_FLAGS_DEBUG})- (Optionally you can set them up with 'CACHE "..."' to be able - to edit them via ccmake or make edit_cache.) + (Optionally you can set up the variables with the +
CACHE
to be able to edit them via ccmake or
+ make edit_cache.)
- PROJECT(myProject) + PROJECT(myProject)- This ensures that the compiler detection and platform setup that - is issued by calling PROJECT(...) will run after we have set up - our cached variables. This way it is our choice of variables that - will be set and not the one determined in PROJECT(...)will be set - and not the one determined in PROJECT(...) + This ensures that the compiler detection and platform setup + that is issued by calling
PROJECT(...)
will run
+ after we have set up our cached variables. This way it is
+ our choice of variables that will be set and not the default
+ values determined by the PROJECT(...)
call.
- ADD_EXECUTABLE(step-1 step-1.cc) + ADD_EXECUTABLE(step-1 step-1.cc)you have to specify to link against deal.II and all external libraries:
- TARGET_LINK_LIBRARIES(step-1 - ${DEAL_II_LIBRARIES} - ) + TARGET_LINK_LIBRARIES(step-1 ${DEAL_II_LIBRARIES})-
- SET_TARGET_PROPERTIES(step-1 PROPERTIES - COMPILE_DEFINITIONS - "${DEAL_II_USER_DEFINITIONS}" - COMPILE_DEFINITIONS_DEBUG - "${DEAL_II_USER_DEFINITIONS_DEBUG}" - COMPILE_DEFINITIONS_RELEASE - "${DEAL_II_USER_DEFINITIONS_RELEASE}" - ) + SET_TARGET_PROPERTIES(step-1 PROPERTIES + COMPILE_DEFINITIONS + "${DEAL_II_USER_DEFINITIONS}" + COMPILE_DEFINITIONS_DEBUG + "${DEAL_II_USER_DEFINITIONS_DEBUG}" + COMPILE_DEFINITIONS_RELEASE + "${DEAL_II_USER_DEFINITIONS_RELEASE}" + )
- SET_TARGET_PROPERTIES(step-1 PROPERTIES - LINK_FLAGS - "${DEAL_II_LINKER_FLAGS}" - LINK_FLAGS_DEBUG - "${DEAL_II_LINKER_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE - "${DEAL_II_LINKER_FLAGS_RELEASE}" - ) + SET_TARGET_PROPERTIES(step-1 PROPERTIES + LINK_FLAGS + "${DEAL_II_LINKER_FLAGS}" + LINK_FLAGS_DEBUG + "${DEAL_II_LINKER_FLAGS_DEBUG}" + LINK_FLAGS_RELEASE + "${DEAL_II_LINKER_FLAGS_RELEASE}" + )And this it is.
- - FIND_PACKAGE(deal.II CONFIG REQUIRED) - - DEAL_II_INITIALIZE_CACHED_VARIABLES() - - PROJECT(step-1) - - ADD_EXECUTABLE(step-1 step-1.cc) - DEAL_II_SETUP_TARGET(step-1) -- - -
- - INCLUDE(${DEAL_II_TARGET_CONFIG}) -- After that there is a target ${DEAL_II_TARGET_DEBUG} and - ${DEAL_II_TARGET_RELEASE} available. +
+ For an advanced setup in a big CMake project
+ deal.IIConfig.cmake
+ provides information about the deal.II
+ installation with traditional variables, see
+ here, as well as external CMake
+ targets with link interface for direct inclusion:
+
+ + INCLUDE(${DEAL_II_TARGET_CONFIG}) ++ After that there is a target +
${DEAL_II_TARGET_DEBUG}
and
+ ${DEAL_II_TARGET_RELEASE}
available:
+ + + ADD_EXECUTABLE(step-1 + step-1.cc + ${DEAL_II_TARGET_DEBUG} + ) ++ TODO: Check and simplify +
cmake
system
- To keep things clean, only the following variables should appended in the
- platform checks and feature configuration (beside setting a lot of
- DEAL_II_* definitions...):
+ To keep things clean, only the following variables should be
+ appended in the platform checks and feature configuration (beside
+ setting a lot of DEAL_II_*
definitions...):
_DEBUG
or
+ _RELEASE
: Used for all targets
+ <...>_DEBUG
: additionally used for debug targets
+ <...>_RELEASE
: additionally used for release targets
CMAKE_SHARED_LINKER_FLAGS
+ DEAL_II_SHARED_LINKER_FLAGS_DEBUG
+ DEAL_II_SHARED_LINKER_FLAGS_RELEASE
-std=c++11
(if available):
CMAKE_CXX_FLAGS
(and CMAKE_C_FLAGS
)
+ DEAL_II_CXX_FLAGS_DEBUG
(and
+ DEAL_II_C_FLAGS_DEBUG
)
+ DEAL_II_CXX_FLAGS_RELEASE
(and
+ DEAL_II_C_FLAGS_RELEASE
)
INCLUDE_DIRECTORIES(...)
-D<...>
) for the compilation of the
+ deal.II library:
DEAL_II_DEFINITIONS
+ DEAL_II_DEFINITIONS_DEBUG
+ DEAL_II_DEFINITIONS_RELEASE
DEAL_II_EXTERNAL_LIBRARIES
+ DEAL_II_EXTERNAL_LIBRARIES_DEBUG
+ DEAL_II_EXTERNAL_LIBRARIES_RELEASE
DEAL_II_USER_DEFINITIONS
+ DEAL_II_USER_DEFINITIONS_DEBUG
+ DEAL_II_USER_DEFINITIONS_RELEASE
DEAL_II_USER_INCLUDE_DIRS
- Platform checks reside under cmake/check.
- We currently have
+ Platform checks reside under cmake/checks
. We currently have
cmake/check/check_for_compiler_bugs.cmake - cmake/check/check_for_compiler_bugs_*.cmake cmake/check/check_for_compiler_features.cmake cmake/check/check_for_cxx_features.cmake- Useful commands are: + +
+ Some Notes:
- CHECK_CXX_SOURCE_COMPILES(source variable) - Checks whether it is possible to compile _and_ link the code snipet - <source>. If succesful, variable is set to 1. + CHECK_CXX_SOURCE_COMPILES(source variable) + - Checks whether it is possible to compile _and_ link the code snipet + <source>. If succesful, variable is set to 1. - CHECK_CXX_SOURCE_RUNS(source variable) - variable is set to 1 if <source> coulde be succesfully compiled and - linked and the resulting program ran and exited wihtout error. + CHECK_CXX_SOURCE_RUNS(source variable) + - variable is set to 1 if <source> coulde be succesfully compiled and + linked and the resulting program ran and exited without error. - CHECK_CXX_COMPILER_BUG(source variable) - Inverts the logic of CHECK_CXX_SOURCE_COMPILES(), i.e. variable is - set to 1 if it was not possible to compile and link <source>. + CHECK_CXX_COMPILER_BUG(source variable) + - Inverts the logic of CHECK_CXX_SOURCE_COMPILES(), i.e. variable is + set to 1 if it was not possible to compile and link <source>. - CHECK_INCLUDE_FILE_CXX(header variable) - Check whether it is possible to compile and link a dummy program - including <header>. + CHECK_INCLUDE_FILE_CXX(header variable) + - Check whether it is possible to compile and link a dummy program + including <header>. - CHECK_FUNCTION_EXISTS(function variable) - Check for the existence of a function prototype with name - <function>. (Don't forget to specify the link libraries, see - below.) + CHECK_FUNCTION_EXISTS(function variable) + - Check for the existence of a function prototype with name + <function>. (Don't forget to specify the link libraries, see + below.) - CHECK_CXX_COMPILER_FLAG(flag variable) - Sets the variable to 1 if the compiler understands the flag. + CHECK_CXX_COMPILER_FLAG(flag variable) + - Sets the variable to 1 if the compiler understands the flag.
CMAKE_REQUIRED_FLAGS
. There are two small macros
+ that do this job nicely:
- PUSH_TEST_FLAG("-Werror") - CHECK_CXX_SOURCE_COMPILES(...) - POP_TEST_FLAG() + PUSH_TEST_FLAG("-Werror") + CHECK_CXX_SOURCE_COMPILES(...) + POP_TEST_FLAG()
CMAKE_REQUIRED_LIBRARIES
. It is best two hard set
+ this variable to a specific value and later on cleaning it,
+ instead of appending/removing:
- SET(CMAKE_REQUIRED_LIBRARIES <a list of libraries> - CHECK_CXX_SOURCE_COMPILES(...) - SET(CMAKE_REQUIRED_LIBRARIES) + SET(CMAKE_REQUIRED_LIBRARIES <a list of libraries> + CHECK_CXX_SOURCE_COMPILES(...) + SET(CMAKE_REQUIRED_LIBRARIES)
- General notes: + General notes:
include/deal.II/base/config.h.in
should have a
+ prominent comment explaining it and should be grouped by file
+ exporting the definition
- For a feature <feature> the following the following toggles, variables and
- macros should be defined
- (Note: <FEATURE> means all caps, <feature> means all lowercase):
+ For a feature <feature>
the following
+ the following toggles, variables and macros should be
+ defined (Note: <FEATURE>
means all caps,
+ <feature>
means all lowercase):
cmake/configure/configure_<feature>.cmake
+ defining how to configure <feature>
:
- FEATURE_<FEATURE>_DEPENDS (variable, optional) - a variable which contains an optional list of other features - this feature depends on (and which have to be enbled for this feature - to work.) The features must be given with the full option toggle: - DEAL_II_WITH_[...] - - FEATURE_<FEATURE>_FIND_EXTERNAL(var) (macro, mandatory) - which should set var to TRUE if all dependencies for the feature are - fulfilled. In this case all necessary variables for - FEATURE_<FEATURE>_CONFIGURE_EXTERNAL must be set. Otherwise - var should remain unset. - This macro must not give an error (SEND_ERROR or FATAL_ERROR). - - FEATURE_<FEATURE>_CONFIGURE_EXTERNAL(var) (macro, mandatory) - which should setup all necessary configuration for the feature with - external dependencies. var set to TRUE indicates success, - otherwise this script should issue a FATAL_ERROR. - - FEATURE_<FEATURE>_CONFIGURE_BUNDLED(var) (macro, optional) - which should setup all necessary configuration for the feature with - bundled source dependencies. var set to TRUE indicates success. - - FEATURE_<FEATURE>_CUSTOM_ERROR_MESSAGE() (variable, optional) - which should either be set to TRUE if FEATURE_<FEATURE>_ERROR_MESSAGE - is set up, or be undefined. - - FEATURE_<FEATURE>_ERROR_MESSAGE() (macro, optional) - which should print a meaningful error message (with FATAL_ERROR) for - the case that no external library was found (and bundled is not - allowed to be used.) If not defined, a suitable default error message - will be printed. + FEATURE_<FEATURE>_DEPENDS (variable, optional) + - a variable which contains an optional list of other features + this feature depends on (and which have to be enbled for this feature + to work.) The features must be given with the full option toggle + DEAL_II_WITH_[...] + + FEATURE_<FEATURE>_FIND_EXTERNAL(var) (macro, mandatory) + - which should set var to TRUE if all dependencies for the feature are + fulfilled. In this case all necessary variables for + FEATURE_<FEATURE>_CONFIGURE_EXTERNAL must be set. Otherwise + var should remain unset. + This macro must not give an error (SEND_ERROR or FATAL_ERROR). + + FEATURE_<FEATURE>_CONFIGURE_EXTERNAL(var) (macro, mandatory) + - which should setup all necessary configuration for the feature with + external dependencies. var set to TRUE indicates success, + otherwise this script should issue a FATAL_ERROR. + + FEATURE_<FEATURE>_CONFIGURE_BUNDLED(var) (macro, optional) + - which should setup all necessary configuration for the feature with + bundled source dependencies. var set to TRUE indicates success. + + FEATURE_<FEATURE>_CUSTOM_ERROR_MESSAGE() (variable, optional) + - which should either be set to TRUE if FEATURE_<FEATURE>_ERROR_MESSAGE + is set up, or be undefined. + + FEATURE_<FEATURE>_ERROR_MESSAGE() (macro, optional) + - which should print a meaningful error message (with FATAL_ERROR) for + the case that no external library was found (and bundled is not + allowed to be used.) If not defined, a suitable default error message + will be printed.
bundled/CMakeLists.txt
:
- DEAL_II_FORCE_BUNDLED_<FEATURE> (bool, optional) - If <feature> can be set up by bundled libraries, this - configuration option must be present to force the use of the bundled - dependencies + DEAL_II_FORCE_BUNDLED_<FEATURE> (bool, optional) + - If <feature> can be set up by bundled libraries, this + configuration option must be present to force the use of the bundled + dependencies - FEATURE_<FEATURE>_HAVE_BUNDLED (variable, optional) - which should either be set to TRUE if all necessary libraries of the - features comes bundled with deal.II and hence can be supported - without external dependencies, or unset. + FEATURE_<FEATURE>_HAVE_BUNDLED (variable, optional) + - which should either be set to TRUE if all necessary libraries of the + features comes bundled with deal.II and hence can be supported + without external dependencies, or unset.-
FEATURE_<FEATURE>_BUNDLED_CONFIGURED
is set.