From: maier cmake
and building with it.
+ library. This page provides more details about using the
+ deal.II CMake build system.
@@ -66,18 +66,18 @@
When configuring deal.II by
running cmake
, the cmake
program
creates a cache in the current (build) directory that contains
- the values of all variables that had previously been passed as
- command line arguments, been found through running tests, or had
- otherwise been set.
+ the values of all cached variables that had previously been passed
+ as command line arguments, been found through running tests,
+ or had otherwise been set.
Normally, one will then simply build the library in this
directory by calling make
and install it. If the
library changes, one would just call make
again and
- it would only re-compile those files that are depend on those
- sources that have changed. In other words, one will rarely have
- to deal with the cached variables at all.
+ it would only re-compile those files that depend on those sources
+ that have changed. In other words, one will rarely have to deal
+ with the cached variables at all.
@@ -95,10 +95,10 @@ this
- mkdir build - cd build - cmake -DCMAKE_INSTALL_PREFIX=/path/install/dir ../deal.II - cmake ../deal.II + mkdir build + cd build + cmake -DCMAKE_INSTALL_PREFIX=/path/install/dir ../deal.II + cmake ../deal.IIhas absolutely no effect: In particular, the second time around it uses the
CMAKE_INSTALL_PREFIX
value previously
@@ -108,35 +108,35 @@
- This cache has an important reason: one can modify all sorts of - configuration parameters and thereby interact with the - configuration system is rather powerful (and, possibly, - destructive) ways. For example, the following commands + The cache has an important reason: one can modify all sort of + configuration parameters and thereby interact with the configuration + system in rather powerful (and, possibly, destructive) ways. For + example, the following commands
- mkdir build - cd build - cmake ../deal.II - ccmake + mkdir build + cd build + cmake ../deal.II + ccmake- First configure a bare-bone setup and then call + first configure a bare-bone setup and then call the
ccmake
program -- an interactive editor for the
cached variables. Similarly,
- mkdir build - cd build - cmake ../deal.II - cmake -D<OPTION>=<VALUE> [...] ../deal.II + mkdir build + cd build + cmake ../deal.II + cmake -D<OPTION>=<VALUE> [...] ../deal.IIsets a variable the second time around without destroying all the configuration that has happened the first time around. Likewise,
- mkdir build - cd build - cmake ../deal.II - cmake -DDEAL_II_WITH_METIS=OFF ../ + mkdir build + cd build + cmake ../deal.II + cmake -DDEAL_II_WITH_METIS=OFF ../switches off support for the METIS library that may have been automatically detected the first time around but that we really @@ -145,7 +145,7 @@ -
Just like with simple make
, cmake
@@ -154,11 +154,12 @@
are. The most common scenario is that you only want to build
debug or optimized libraries. This can be achieved using the
following commands in the build directory:
+ TODO: This is a bit misleading, as make install
won't succeed
- make deal_II.g # only debug library - make deal_II # only release (optimized) library - make all # both + make deal_II.g # only debug library + make deal_II # only release (optimized) library + make all # both@@ -167,7 +168,7 @@ finer-grained control, do
- make help + make help@@ -176,14 +177,14 @@ command does. In that case, use the following:
- make deal_II.g VERBOSE=ON + make deal_II.g VERBOSE=ONThis will show, for every command executed, the exact command line with which it was invoked, including compiler arguments, - etc. Every command
cmake
executes starts at the
- build directory (rather than being executed by some recursively
- invoked makefile) so that the command line can be copied and
- executed from within the build directory.
+ etc. Every command cmake
executes starts with
+ a cd
command to change the current directory
+ appropriately so that the command line can be copied and executed
+ from anywhere within the build directory.
@@ -191,8 +192,11 @@
- The various configuration options of the deal.II library are organized in - three categories: feature, component and build/install configuration. + The various configuration options of the deal.II library are + organized in three categories: feature, + component, and + build/install + configuration.
@@ -258,9 +262,7 @@ no external library the bundled library will be used.- cmake -DCMAKE_PREFIX_PATH=~/workspace/local ../deal.II + cmake -DCMAKE_PREFIX_PATH=~/workspace/local ../deal.IIlibraries from ~/workspace/local will be preferred for dependency resolution. @@ -333,13 +335,13 @@ 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.IIwhere -D<library>_DIR takes precedence over environment. @@ -347,14 +349,15 @@
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) + + 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)@@ -373,7 +376,7 @@ You can get a list via
- ccmake ../deal.II (or $ make edit_cache) + make edit_cacheand entering advanced configuration mode by pressing [t]. Variables that could not be determined are suffixed with -NOTFOUND and