Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

PREREQUISITES: XCODE AND COMPILERS

Download and decompress PETSc (3.6.1 at the time writing)

Configure debug

./configure Options: CC=clang CXX=clang++ FC=gfortran --download-mpich=1 --with-debugging=1

Build debug

make PETSC_DIR=/Users/mono/Programming/cpp/petsc-3.6.1 PETSC_ARCH=arch-darwin-c-debug all

Configure release

./configure Options: CC=clang CXX=clang++ FC=gfortran --download-mpich=1 --with-debugging=0
# with exodusii support (and dependencies)
./configure Options: CC=clang CXX=clang++ FC=gfortran --download-mpich=1 --with-debugging=0 --download-exodusii=1 --download-netcdf=1 --download-hdf5=1 --download-triangle=1

Build release

make PETSC_DIR=/Users/mono/Programming/cpp/petsc-3.6.1 PETSC_ARCH=arch-darwin-c-opt all

Test

make PETSC_DIR=/Users/mono/Programming/cpp/petsc-3.6.1 PETSC_ARCH=arch-darwin-c-debug test
make PETSC_DIR=/Users/mono/Programming/cpp/petsc-3.6.1 PETSC_ARCH=arch-darwin-c-debug streams NPMAX=2

Export path (modify path yourself) to bash profile and use path

echo -e "\n# PETSc binaries\n\nexport PATH=\$PATH:/Users/mono/Programming/cpp/petsc-3.6.1/arch-darwin-c-opt/bin\n" >> ~/.bash_profile
source ~/.bash_profile

Loosely based on http://lists.mcs.anl.gov/pipermail/petsc-users/2014-December/023826.html and http://lists.mcs.anl.gov/pipermail/petsc-dev/2013-October/013388.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.