Feel++

Building Feel++

Once the steps to install on Linux or MacOS X has been followed, we explain, in this section, how to download and build Feel++ from source.

For the impatient

First retrieve the source

$ git clone https://github.com/feelpp/feelpp.git

Create a build directory

$ mkdir build
$ cd build

Configure Feel++

$ CXX=clang++ ../feelpp/configure -r

Compile the Feel++ library

$ make feelpp
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. The more, the better.

Compile your first Feel++ applications

$ make quickstart

Execute your first Feel++ application in sequential

$ cd quickstart
$ ./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

Downloading sources

Using Tarballs

Feel is distributed as tarballs following each major release. The tarballs are available on the link:https://github.com/feelpp/feelpp/releases[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.

Using Git

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

$ git clone  https://github.com/feelpp/feelpp.git

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

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.

Using cmake

The configuration step with cmake is as follows

$ cd FEEL/feel.opt
$ cmake ../feelpp -DCMAKE_CXX_COMPILER=/usr/bin/clang++-3.6 -DCMAKE_C_COMPILER=/usr/bin/clang-3.6 -DCMAKE_BUILD_TYPE=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

Using configure

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

Listing Configure help
Options:
 -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++

Compiling Feel++

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

$ make

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.

Running the Feel++ Testsuite

If you encounter issues with Feel++, you can run the testsuite and send the resulting report. Feel++ has more than 300 tests running daily on our servers. Most of the tests are run both in sequential and in parallel.

The testsuite is in the testsuite directory.

$ cd testsuite

The following command will compile 10 tests at a time

$ make -j10
Listing: Running the Feel++ testsuite
$ ctest -j4 -R .

It will run 4 tests at a time thanks to the option -j4.