Compiling Feel++ from sources

Difficulty: difficulty advanced advanced!
For beginners, you can skip this section and go directly to containers section.

Before starting compiling Feel++, you need first to

1. For the impatient

To follow these steps, make sure that you first follow programming environment prerequisites steps.

First retrieve the source

$ git clone

Feel++ does not allow in-source cmake, the build must be done in separate directory.

Create a build directory
$ mkdir build
$ cd build
Configure Feel++
$ CXX=clang++ ../feelpp/configure -r
Compile the Feel++ library
$ cd feel (1)
$ make  (2)
$ make install (3)
1 go in feel subdirectory to compile the library
2 compile the library and its Dependencies
3 install the library
you can speed up the make process by passing the option -j<N> where N is the number of concurrent make sub-processes. It compiles N files at a time and respect dependencies. For example -j4 compiles 4 C++ files at a time.
Be aware that Feel++ consumes memory. The Feel++ library compile with 2Go of RAM. But to be more comfortable, 4Go or more would be best.
Compile your first Feel++ applications
$ cd quickstart (1)
$ make
1 compile the basic applications in the toplevel quickstart directory
Execute your first Feel++ application in sequential
$ ./feelpp_qs_laplacian_2d --config-file qs_laplacian_2d.cfg
Execute your first Feel++ application using 4 mpi processes
$ mpirun -np 4 feelpp_qs_laplacian_2d --config-file qs_laplacian_2d.cfg

2. Downloading sources

2.1. Using Tarballs

Feel++ is distributed as tarballs following each major release. The tarballs are available on the Feel++ Releases web page.

Download the latest tarball, then uncompress it with:

$ tar -xzf feelpp-X.YY.0.tar.gz
$ cd feelpp-X.YY.0

You can now move to the section Using cmake.

2.2. Using Git

Alternatively, you can download the sources of Feel++ directly from the Git repository.

$ git clone

You should read something like

Cloning into 'feelpp'...
remote: Counting objects: 129304, done.
remote: Compressing objects: 100% (18/18), done.
remote: Total 129304 (delta 6), reused 0 (delta 0), pack-reused 129283
Receiving objects: 100% (129304/129304), 150.52 MiB | 1.69 MiB/s, done.
Resolving deltas: 100% (94184/94184), done.
Checking out files: 100% (7237/7237), done.
$ cd feelpp

The first level directory tree is as follows

$ tree -L 1 -d | column
.			├── databases		├── research
├── applications	├── doc			├── testsuite
├── benchmarks		├── feel		└── tools
├── cmake		├── ports		14 directories
├── contrib		├── projects
├── data		├── quickstart

3. Configuring Feel++

For now on, we assume that clang++ has been installed in /usr/bin. Yor mileage may vary depending on your installation of course.

It is not allowed to build the library in the top source directory.

It is recommended to have a directory (e.g. FEEL) in which you have both the sources and build directories, as follows

$ ls FEEL
feelpp/ # Sources
feel.opt/ # Build directory

feelpp is the top directory where the source have been downloaded, using git or tarballs.

3.1. Using cmake

The configuration step with cmake is as follows

$ cd FEEL/feel.opt
$ cmake ../feelpp (1)
1 Run cmake with default configuration flags from toplevel Feel++ source directory in ../feelpp
Use ccmake to configure Feel++ using a graphical or text interface.
$ cd FEEL/feel.opt
$ cmake ../feelpp
 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-4.0  (1)
 -DCMAKE_C_COMPILER=/usr/bin/clang-4.0  (2)
 -DCMAKE_BUILD_TYPE=RelWithDebInfo (3)
1 set the C++ compiler to /usr/bin/clang++-4.0
2 set the C compiler to /usr/bin/clang++-4.0
3 set the cmake build type to RelWithDebInfo

CMake supports different build type that you can set with -DCMAKE_BUILD_TYPE (case insensitive) : * None * Debug : typically -g * Release : typically -O3 -DNDEBUG * MinSizeRel : typically -Os * RelWithDebInfo : typically -g -O2 -DNDEBUG

3.2. Using configure

Alternatively you can use the configure script which calls cmake. configure --help will provide the following help.

Listing Configure help
 -b, --build                         build type: Debug, Release, RelWithDebInfo
 -d, --debug                         debug mode
-rd, --relwithdebinfo                relwithdebinfo mode
 -r, --release                       release mode
     --std=c++xx                     c++ standard: c++14, c++1z (default: c++14)
     --stdlib=libxx                  c++ standard library: stdc++(GCC), c++(CLANG) (default: stdc++)
     --max-order=x                   maximum polynomial order to instantiate(default: 3)
     --cxxflags                      override cxxflags
     --cmakeflags                    add extra cmake flags
     --prefix=PATH                   define install path
 -v, --verbose                       enable verbose output
 -h, --help                          help page
     --<package>-dir=PACKAGE_PATH    define <package> install directory
     --disable-<package>             disable <package>
     --generator=GENERATOR           cmake generator

We display below a set of possible configurations:

Compile using Release build type, default c compiler and libstdc

Listing compiling using default compilers
$ ../feelpp/configure -r

Compile using Release build type, clang compiler and libstdc

Listing compiling using clang++
$ CXX=clang++ ../feelpp/configure -r

Compile using Debug build type, clang compiler and libc

Listing compiling using clang/libc in Debug mode
CXX=clang++ ../feelpp/configure -d -stdlib=c++

4. Compiling Feel++

Once cmake or configure have done their work successfully, you are ready to compile Feel++

$ make
$ make install
Parallel compilation

You can speed up the compilation process, if you have a multicore processor by specifying the number of parallel jobs make will be allowed to spawn using the -j flag:

Listing build Feel++ library using 4 concurrent jobs
$ make -j4 feelpp
From now on, all commands should be typed in build directory (e.g feel.opt) or its subdirectories.