How to compile FreeFem++ under Linux.
in tested FH (04/07/2017) on Ubuntu 16.04.4 LTS (form scatch) .
Before the build process check the installed software (here)
First download the tar.gz file contening source from
or you can get the latest source from an anonymous git SCM copy with the following unix shell commands :
git clone https://github.com/FreeFem/FreeFem-sources ff++
if your version of automake >= 1.13 , autoconf >= 2.69 do
autoreconf -i
else it's too old, then do
tar zxvf AutoGeneratedFile.tar.gz
To have correct configure script and Makefie
To compile with no additionnal sofware
./configure
make
make check (to test de version)
make install (under root)
To compile with lot of additionnal software.
./configure --enable-download --disable-pastix
make
make check (to test de version)
make install (under root)
To configure with petsc and hpddm (need c++ 11 features )
1) install git and cmake
sudo apt-get install git cmake
2) configure to def on compiler, mpi , ...
./configure --enable-download --disable-pastix .....
3) download and compile petsc, slepc in real and complex, ...
... Warning: Check that you can write in directory : path_install/ff-petsc
cd download/ff-petsc
make petsc-slepc SUDO=sudo (if need root access to install dir)
make petsc-slepc
.... wait , ... wait , wait ...
cd -
4) reconfigure with petsc, slepc in real and complex, ...
./reconfigure
make
make check
make install (under root)
Before you have to install some usefull package with apt-get under Debian / Ubuntu.
you can install this package software
sudo apt-get install cpp freeglut3-dev g++ gcc gfortran
sudo apt-get install ghostscript m4 make patch pkg-config wget python
# other lib of a full freefem++ can be change
sudo apt-get install libopenblas-dev liblapack-dev libhdf5-dev libgsl2-dev
# Remark: On old version pkg "libgsl2-dev" is "libgsl0-dev"
# Remark: the next package can be download automaticaly by FreeFem++"
sudo apt-get install libscotch-dev libfftw3-dev libarpack2-dev libsuitesparse-dev
sudo apt-get install libmumps-seq-dev libnlopt-dev coinor-libipopt-dev libgmm++-dev libtet1.5-dev
# Remark: superlu-dev package is too old on ubuntu Trusty (14.0.4)
# not mandatory package but usefull for developpement
sudo apt-get install autoconf automake autotools-dev bison flex gdb valgrind
# not mandatory package for download with git form https://git-scm.com/downloads
sudo apt-get install git
sudo apt-get install gnuplot-qt
# install de mpich for parallel version
sudo apt-get install mpich
Try to download and compile (add --enable-download flags to configure)
lot of related software, (Please read the licence of all with software,
if you use freefem++ for commercial purpose)
tetgen superlu fftw metis yams mshmet MUMPS
blacs parmetis scalapack scotch superludist MUMPS pastix hypre hips
For the link with mmg3d software put the tar.gz archive in .../dowload/pgk directory.
Remark, you can also copy all the download file in ../download/pgk if you have not internet connection.
To download all third party package do.
./download/getall -a
TO simplify the link and compilation part,
I have add 3 files
examples++-load/WHERE_LIBRARY
examples++-load/WHERE_LIBRARY-download
examples++-load/WHERE_LIBRARY-config
the files
examples++-load/WHERE_LIBRARY-config
examples++-load/WHERE_LIBRARY-download
are respectively created with ./configure commande ,
the compilation of all download software.
and the examples++-load/Makefile.
Some configure flags use to build the current version
-----------------------------------------------------
* Under Debian: ( 2008)
----------------
the installed packages + dependance are:
gcc g++ g77
libsuitesparse-dev
libarpack2-dev
libx11-dev libxt-dev libxext-dev
patch
wget
freeglut3-dev
- bluid the parallel version
openmpi-dev openmpi
- to rebuild de documentation:
imagemagick
tetex-base tetex-bin tetex-extra
./configure
make
make check (to test de version)
make install (under root)
* Under Ubuntu (2008)
---------------
the installed packages + dependance are:
gcc g++ g77
wget
m4 bison flex patch
libzip-dev
libx11-dev libxt-dev libxext-dev
libxpm4 libxpm4-dbg
libsuitesparse-dev libarpack2-devlibarpack2 libarpack2-dev
libfltk1.1 libfltk1.1-dbg libfltk1.1-dev
libopenmpi1 libopenmpi-dev
libopenmpi-dbg libxpm-dev
freeglut3 freeglut3-dev
libx11-dev libxt-dev libxext-dev
libglut3-dev
- bluid the parallel version
openmpi-dev openmpi
- to rebuild de documentation:
imagemagick
tetex-base tetex-bin tetex-extra
./configure --enable-download --disable-pastix --with-mpi=mpic++
# utility of parameter:
# --enable-download : for fft and tetgen ...
# --with-mpi=mpic++ : for mpi version# --disable-pastix : for mpi version
make
make check (to test de version)
make install (under root)