How to compile FreeFem++ under Linux. 

in tested FH (08/03/2016) on Ubuntu 14.04.4 LTS (form scatch) .


Before the build process check the installed software (here)

First download the tar.gz file contening source from Source code: freefem++-3.51-3.tar.gz ( 24.8 Mb, Feb 23, 2017 22:15:45.)   

or you can get the latest source from an anonymous Mercurial SCM copy with the following unix shell commands :

hg clone http://www.freefem.org/ff++/ff++

i
f 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 

  make 

  make check    (to test de version)

  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 libgsl0-dev

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 develloppenemt

sudo apt-get install autoconf automake autotools-dev bison flex gdb valgrind

# not mandatory package for downlaod with hg / mercurail tool

sudo apt-get install mercurial

sudo apt-get install gnuplot-qt


# install de mpich for parallel version  

sudo apt-get install  mpich


To configure   with petsc and hpddm (need  c++ 11 features )


# compilation de PETSc 

wget http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.7.3.tar.gz

tar zxvf petsc-lite-3.7.3.tar.gz

cd petsc-3.7.3

#build the python, file ff-conf.py  python for configuration of PETSc 

cat >ff-conf.py <<EOF

#!/usr/bin/python

if __name__ == '__main__':

  import sys

  import os

  sys.path.insert(0, os.path.abspath('config'))

  import configure

  configure_options = [

    '--CFLAGS=-O2',

    '--COPTFLAGS=-O3',

    '--CXXFLAGS=-O2 -std=c++11',

    '--CXXOPTFLAGS=-O3',

    '--FFLAGS=-O2',

    '--FOPTFLAGS=-O3',

    '--download-fftw',

    '--download-hypre',

    '--download-metis',

    '--download-ml',

    '--download-mumps',

    '--download-parmetis',

    '--download-pastix',

    '--download-ptscotch',

    '--download-scalapack',

    '--download-suitesparse',

    '--download-superlu',

    '--prefix=(The dir install petsc)',

    '--with-blas-lapack-lib=-llapack -lblas',

    'PETSC_ARCH=arch-ff++',

  ]

  configure.petsc_configure(configure_options)

EOF

chmod a+x ff-conf.py

# Edite and launch the petsc configure and follow the instruction 

./ff-conf.py

make PETSC_DIR=(The dir install petsc) PETSC_ARCH=arch-ff++ all

sudo make PETSC_DIR=(The dir install petsc) PETSC_ARCH=arch-ff++ install


Now you can reconfigure freefem++ with petsc (need  c++ 11 features )


  Go in freefem++ directory. 


 ./configure --enable-download --with-petsc=(The dir install petsc)/lib/petsc/conf/petscvariables

  make 

  make check    (to test de version)

  make install  (under root)



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  --with-mpi=mpic++

#  utility of parameter:

#  --enable-download :  for fft and tetgen ... 

#  --with-mpi=mpic++ : for mpi version 

  make 

  make check    (to test de version)

  make install  (under root)