Installing DOLFIN on Mac OS X

From The FEniCS project

Contents

Fetching and installing relevant dependencies

From Fink

This portion of the installation guide assumes you have a working installation of Fink on your Mac OS X box. Using Fink greatly expedites the building of FEniCS' projects as it provides a straightforward mechanism for obtaining and installing a number of their dependencies. You may need to enable the use of unstable repositories for some of these projects.

Using Fink, install the following packages (fink install foo):

  1. python25
  2. mercurial-py25
  3. numpy-py25
  4. boost1.33
  5. swig (1.3.31-2)
  6. suitesparse (3.0.0-1)
  7. gts (0.7.3-1003)
  8. vtk-py25

Additional dependencies for parallelisation (Optional)

If you're building DOLFIN on a multiprocessor (or multicore) machine, you might be interested in building it with the parallel partitioning and solver libraries mentioned below. This process is simplified in Mac OS X 10.5 as it contains an installation of Open MPI.

Building PETSc 2.3.3-p8

wget ftp://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-2.3.3-p8.tar.gz
tar -xzf petsc-2.3.3-p8.tar.gz
cd petsc-2.3.3-p8
export PETSC_DIR=$PWD
./config/configure.py --with-fc=0 --with-clanguage=cxx
make all test

Building SLEPc 2.3.3

wget http://www.grycap.upv.es/slepc/download/distrib/slepc-2.3.3.tgz
tar -xzf slepc-2.3.3.tgz
cd slepc-2.3.3
export SLEPC_DIR=$PWD
./config/configure.py
make all test

Building SCOTCH 5.0.5

wget http://gforge.inria.fr/frs/download.php/3795/scotch_5.0.5.tgz
tar -xzf scotch_5.0.5.tgz
cd scotch_5.0/src
ln -s Make.inc/Makefile.inc.i686_mac_darwin8 Makefile.inc
make scotch
make ptscotch

Fetching and installing relevant FEniCS projects

Once you've installed the dependencies mentioned previously, use mercurial to fetch (hg clone http://www.fenics.org/hg/bar) and the standard python build system to install (cd bar && python setup.py install) the following FEniCS projects in order.

  1. FIAT
  2. Instant
  3. Ferari
  4. UFC
  5. FFC
  6. Viper

Installing DOLFIN

With the dependencies mentioned above installed, we are now ready to build DOLFIN. Assuming that your Fink installation lives inside its default location, /sw/, run the following with the appropriate path structure:

PKG_CONFIG_PATH=/RANDOM/FEniCS/build/lib/pkgconfig PATH=$PATH:/RANDOM/FEniCS/build/bin \
./configure --prefix=/RANDOM/FEniCS/build --with-boost=/sw  --with-umfpack-lib=/sw/include \
--with-umfpack-include=/sw/include/suitesparse --with-amd-lib=/sw/lib  \
--with-amd-include=/sw/include/suitesparse
make
make install

If you're interested in a build of DOLFIN that takes advantage of multiple processors, install the additional dependencies mentioned above and run:

SLEPC_DIR="/SLEPSC/PATH/slepc-2.3.3" LDFLAGS="-L/SCOTCH/PATH/bin" \
CPPFLAGS="-I/SCOTCH/PATH/bin" PKG_CONFIG_PATH="/RANDOM/FEniCS/build/lib/pkgconfig" \
PATH=$PATH:/RANDOM/FEniCS/build/bin \
./configure --with-boost=/sw --with-umfpack-lib=/sw/include \
--with-umfpack-include=/sw/include/suitesparse --with-amd-lib=/sw/lib \
--with-amd-include=/sw/include/suitesparse --enable-mpi --enable-scotch \
--enable-petsc --with-petsc-dir=/PETSC/PATH/petsc-2.3.3-p8 \
--prefix=/RANDOM/FEniCS/build
make
make install

And that's about it!

Some additional notes

1. Before you compile the demos (make demo), add the following lines in the appropriate places to RANDOM/FEniCS/build/lib/pkgconfig/dolfin.pc.

-I/SLEPC/PATH/slepc-2.3.3/include 
-L/SCOTCH/PATH/scotch_5.0/bin

2. Currently, building DOLFIN with SLEPc appears to result in runtime linking errors. If you run into this, don't set the SLEPC_DIR variable in the ./configure step.

Personal tools