- Prerequisites
-
Ubuntu:
sudo apt-get install libibnetdisc-dev sudo apt-get install libblas-dev libatlas-dev liblapack-dev
- Install OpenMPI
-
Download OpenMPI: https://www.open-mpi.org/software/ompi/v1.10/
-
Extract and configure
cd ~/Downloads/openmpi-1.10.1 mkdir build cd build # I prefer to keep /usr/local clean, so I put it in /opt/openmpi ./configure --prefix=/opt/openmpi --with-devel-headers --enable-binaries make sudo make install
-
Add the following to your bash profile
-
OS X:
export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/opt/openmpi/lib export PATH=${PATH}:/opt/openmpi/bin
-
Ubuntu:
export LD_LIBRARY_PATH=LD_LIBRARY_PATH=/opt/openmpi/lib:$LD_LIBRARY_PATH export PATH=/opt/openmpi/bin:$PATH
-
-
Activate your conda environment
-
Install mpi4py
git clone https://github.com/mpi4py/mpi4py.git ./mpi4py.git
cd mpi4py.git
python setup.py build --mpicc=/opt/openmpi/bin/mpicc
python setup.py install
- PETSc and petsc4py
git clone https://bitbucket.org/petsc/petsc.git ./petsc.git
cd petsc.git
python setup.py build
python setup.py install
cd ..
git clone https://bitbucket.org/petsc/petsc4py.git ./petsc4py.git
cd petsc4py.git
python setup.py build
python setup.py install
Thank you for your instructions. Those have helped me a lot.
I want to add that the petsc repo moved to https://github.com/petsc/petsc.git and that it has helped me to run ./configure before building/installing petsc. Best regards, Tobi