Skip to content

Building LehrFEM

craffael edited this page Dec 16, 2018 · 1 revision

This page is intended for programmers that want to contribute to LehrFEM++. If you just want to use LehrFEM++, you don't have to build LehrFEM++ yourself, see the getting started guide

Building lehrfem++ with CMake

LehrFEM++ relies on CMake and the Hunter package manager. This makes building LehrFEM++ very simple and easy. Let's assume that you have cloned LehrFEM++ to the lehrfempp directory. You can now proceed as follows:

  1. Create a build directory mkdir lehrfempp/build
  2. Run CMake from the build directory:
    cd lehrfempp/build
    cmake ..
    
    Note that the first time this can take quite a while because Hunter will download all dependencies (boost, eigen, etc) and compile them.
  3. (Optional) Set CMake options (see below)
  4. Build LehrFEM++: make -j4
  5. (Optional) run tests: ctest

CMake options

Lehrfem++ has a few build options which are initialized to sensible defaults:

Option Name Description Default
LF_BUILD_EXAMPLES Set this to On/Off to build the examples, i.e. all projects in the folders examples and experiments. On
LF_ENABLE_CLING Set this to On if you want to link LehrFEM++ with libld. This is required in order to run LehrFEM++ with cling Off
LF_ENABLE_TESTING Set this to Off if you don't want to build the tests On
Clone this wiki locally