Building FreeFEM++ with Intel Software tools for developers

FreeFEM++ is a package that targeted for researchers who needs a powerful tool for solving partial differential equations.

It can be found at

By default build instructions for FreeFEM++ uses open-source products .

Intel provides for software developers a wonderful product Intel(R) Parallel Studio XE It can be used to get additional optimizations and performance of FreeFEM++ on Intel platforms.


Let's download Intel(R) Parallel Studio XE from and install it to <IPSXE_install_dir>.

Currently version 2018 Update 1 is released and will be used.

Prepare build directories structure:

	$ mkdir FreeFEM++
	$ cd FreeFEM++

Download FreeFED++:

	$ wget 

And unzip it

	$ tar -xzvf ./freefem++-3.59.tar.gz
	$ cd freefem++-3.59/ 


We will use Intel(R) Composer, Intel(R) Math Kernel Library(Intel(R) MKL) and Intel(R) MPI Library (Intel(R) MPI):

$ source <IPSXE_install_dir>/bin/ intel64

FreeFEM++ for building uses traditional autotools way: configure - make. So let's setup it with Intel tools (single line will be given below):

$ export OPTF=-xCOMMON-AVX512 
$ export CC=icc 
$ export CFLAGS=$OPTF 
$ export CXX=icpc 
$ export CXXFLAGS=$OPTF 
$ export FC=ifort 
$ export FCFLAGS=$OPTF 
$ export F77=ifort 
$ export FFLAGS=$OPTF 
$ ./configure --enable-download --with-mpiinc=-I${I_MPI_ROOT}/intel64/include --with-mpilibs="-L${I_MPI_ROOT}/intel64/lib/release_mt -L${I_MPI_ROOT}/intel64/lib -lmpicxx -lmpifort -lmpi -lmpigi -ldl -lrt -lpthread" --with-mpilibsc="-L${I_MPI_ROOT}/intel64/lib/release_mt -L${I_MPI_ROOT}/intel64/lib -lmpicxx -lmpifort -lmpi -lmpigi -ldl -lrt -lpthread"

Where icc is Intel(R) C compiler, icpc - Intel(R) C++ compiler, ifort - Intel(R) Fortran Compiler.

We are using --with-mpiinc and --with-mpilbs to notify FreeFEM++ how to build packages with Intel(R) MPI Library. Unfortunately traditional mpiicc, mpiicpc and mpiifort cause compatibility issues.

The same with single line is:

	$ CC=icc CFLAGS=-axCOMMON-AVX512 CXX=icpc CXXFLAGS=-axCOMMON-AVX512 FC=ifort FCFLAGS=-axCOMMON-AVX512 F77=ifort FFLAGS=-axCOMMON-AVX512 ./configure --enable-download --with-mpiinc=-I${I_MPI_ROOT}/intel64/include --with-mpilibs="-L${I_MPI_ROOT}/intel64/lib/release_mt -L${I_MPI_ROOT}/intel64/lib -lmpicxx -lmpifort -lmpi -lmpigi -ldl -lrt -lpthread" --with-mpilibsc="-L${I_MPI_ROOT}/intel64/lib/release_mt -L${I_MPI_ROOT}/intel64/lib -lmpicxx -lmpifort -lmpi -lmpigi -ldl -lrt -lpthread"

Also as we are using -xCOMMON-AVX512, so we need to set system default compiler to icc:

	$ alias cpp=icpc

And now we can build it all

	$ make

Unfortunately parallel build (-j<n>) is not supported, so it will take some time.


Enjoy your FreeFEM++ with Intel(R) Software Products for developers!

For more complete information about compiler optimizations, see our Optimization Notice.