A Homebrew tap to build FEniCS on OSX (and perhaps Linux) relying on pip.
First install Homebrew itself
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"If you are using Linux, try Linuxbrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/linuxbrew/go/install)"brew tap homebrew/science
brew tap optimizers/homebrew-fenicsEither install pip for use with system Python using
sudo easy_install pipor install Homebrew Python, which ships with pip:
brew install pythonFirst install virtualenv and virtualenvwrapper if you haven't already:
pip install virtualenv
pip install virtualenvwrapperConfigure virtualenvwrapper (see the documentation):
mkdir -p ~/.virtualenvs
echo "export WORKON_HOME=$HOME/.virtualenvs" >> ~/.bashrc
echo "source /usr/local/bin/virtualenvwrapper.sh" >> ~/.bashrcOpen a fresh terminal in order to activate the most recent settings. Then create a virtual environment and activate it:
mkvirtualenv fenics
workon fenicsThe Python dependencies require a flavor of MPI, petsc and slepc already installed:
brew install slepcThe command above will install open-mpi unless a flavor of MPI is already installed (either open-mpi or mpich), as well as petsc.
The virtual environment is a good place to install the Python dependencies without interfering with your system folders.
pip install ply
PETSC_DIR=/usr/local/opt/petsc/real SLEPC_DIR=/usr/local/opt/slepc/real pip install mpi4py petsc4py slepc4py
A full-featured dolfin based on the stable release can be installed with
brew install dolfin
Should you wish to install from the master branch, use
brew install dolfin --HEAD
There are options to activate or deactivate extentions. See brew options dolfin a complete list.
With everything included (nothing excluded with --without) the following should be produced (use brew install -v dolfin to verify or check the build logs in ~/Library/Logs/Homebrew/dolfin):
-- The following optional packages were found:
-- -------------------------------------------
-- (OK) MPI
-- (OK) PETSC
-- (OK) PETSC4PY
-- (OK) SLEPC
-- (OK) SLEPC4PY
-- (OK) TRILINOS
-- (OK) UMFPACK
-- (OK) CHOLMOD
-- (OK) PASTIX
-- (OK) SCOTCH
-- (OK) PARMETIS
-- (OK) ZLIB
-- (OK) PYTHON
-- (OK) SPHINX
-- (OK) HDF5
-- (OK) VTK
-- (OK) QT
--
-- The following optional packages were not enabled:
-- -------------------------------------------------
-- (--) OPENMP
Type brew test -v dolfin. You should see something similar to
$ brew test -v dolfin
Testing optimizers/fenics/dolfin
==> Using the sandbox
/usr/bin/sandbox-exec -f /tmp/homebrew20160301-44651-1g9sw6y.sb /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -W0 -I /usr/local/Library/Homebrew -- /usr/local/Library/Homebrew/test.rb /usr/local/Library/Taps/optimizers/homebrew-fenics/dolfin.rb -v
==> python poisson.py
Calling FFC just-in-time (JIT) compiler, this may take some time.
Calling DOLFIN just-in-time (JIT) compiler, this may take some time.
Calling DOLFIN just-in-time (JIT) compiler, this may take some time.
Calling FFC just-in-time (JIT) compiler, this may take some time.
Calling FFC just-in-time (JIT) compiler, this may take some time.
Solving linear variational problem.
Demos can be found under
/usr/local/opt/dolfin/share/dolfin/demo
See TROUBLESHOOTING.md.