Building B2000++

Thanks to Thomas Rothermel and others from the DLR the B2000++ package build process of B2000++ has been converted from the autotools to cmake.

cmake has some distinct advantages for the user that wants to build a program:

  • Better checks and error reports if any required packages are missing.

  • Better mechanisms for finding required libraries, includes, etc.

  • Fast make files configuration process.

However, programming cmake is not easy.

To build B2000++ without any options is straightforward (see also the top-level CMakeListst.txt file for a list of options). Go to the path where the git checked out package is located:

cd $SMR_SRC/b2000pp
mkdir -p _build       # create the build directory
cd _build
rm -rf *              # clean up
cmake ..              # Create the make files
make [-j <n>] install # -j option submits at most <n> parallel compile jobs

If you want to compile B2000++ with MPI activated for the MUMPS solver:

cd $SMR_SRC/b2000pp
mkdir -p _build       # create the build directory
cd _build
rm -rf *              # clean up
cmake -DUSE_MPI=ON .. # Create the make files, compile with MPI
make [-j <n>] install # -j option submits at most <n> parallel compile jobs

B2000++ examples and verification test cases are, by default not installed. If you want them installed, add the -DBUILD_B2TESTDATA=ON to the cmake command. The B2000++ examples and verification test cases will the be installed in $SMR_PREFIX/share/b2000pp/data.

Documentation

To build the API documentation you have to have Doxygen installed. To build the HTML manuals you have to have Sphinx installed, and if the Sphinx API is to be built, you also need to have Breathe installed.

Intersphinx is used to refer to other documentation projects. To resolve links to projects outside the b2000++ repository you need to set the corresponding paths as environment variables:

  • $B2DOCU_SIMPLES_DIR for simples

  • $B2DOCU_MCBROWSER_DIR for mcbrowser

  • $B2DOCU_PYMEMCOM_DIR for pymemcom

  • $B2DOCU_MEMCOMREL_DIR for memcomrelnotes

  • $B2DOCU_PACKAGEDOC_DIR for packagedoc

With the respective tools installed you can build the documentation targets:

  • api_doc: Builds the Doxygen API documentation in the build directory. The installation step will put that produced documentation into <prefix>/share/doc/b2000pp/api

  • sphinx_doc: builds the various manuals in the build directory The installation step will put that produced documentation into <prefix>/share/doc/b2000pp/*

  • all_doc: builds all of the above available targets.

  • sphinx_apidoc: Builds the Sphinx translation of the Doxygen API documentation with Breathe.

Warning

Building the sphinx_apidoc target takes very long!

If you want the sphinx_doc target to automatically include the sphinx_apidoc, configure cmake with the -DBUILD_SPHINXAPI=ON option. This also sets corresponding dependencies, such that the Intersphinx links can be resolved between the various documentation projects.

If you want the documentation to be included in the default target for your build, use the -DBUILD_DOCU=ON option.