Skip to content

Instantly share code, notes, and snippets.

@mortennobel
Last active February 2, 2020 04:56
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mortennobel/04a8e2c4e49525d6d714 to your computer and use it in GitHub Desktop.

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