> brew install petsc
The following instructions outline how PETSc can be installed.
The easiest way to configure PETSc for DAMASK is to let PETSc download and install all auxiliary libraries, automatically compile and install them alongside PETSc itself. This process can be done by executing the following configure command inside the directory to which PETSc was downloaded:
> ./configure \
--with-fc=$F90 --with-cc=$CC --with-cxx=$CXX \
--download-mpich \
--download-fftw \
--download-hdf5 \
--download-fblaslapack \
--download-chaco \
--download-hypre \
--download-metis \
--download-ml \
--download-mumps \
--download-parmetis \
--download-scalapack \
--download-suitesparse \
--download-superlu \
--download-superlu_dist \
--download-triangle \
--download-zlib \
--with-cxx-dialect=C++11 \
--with-c2html=0 \
--with-debugging=0 \
--with-ssl=0 \
--with-x=0 \
COPTFLAGS="-O3 -xHost -no-prec-div" CXXOPTFLAGS="-O3 -xHost -no-prec-div" FOPTFLAGS="-O3 -xHost -no-prec-div" \
PETSC_DIR=$(pwd)
where the variables $F90, $CC, and $CXX need to point to your Fortrtran, C, and C++ compiler.
After a successful configuration (watch out for error and warning messages), build PETSc with
> make > make testThis will compile and install a PETSc library with support for Fortran 2003 features, along with all necessary third-party libraries. FFTW, HDF5, BLAS/LAPACK and MPI are the minimum requirement in configuring PETSc for DAMASK spectral solver.
--with-c2html=0, --with-x=0, --with-ssl=0, and --with-debugging=0) is not mandatory.
COPTFLAGS, CXXOPTFLAGS, and FOPTFLAGS) might be adjusted.
> mpif90 -v # equivalent to ifort -v / gortran -v > mpicc -v # equivalent to icc -v / gcc -v > mpicxx -v # equivalent to icpc -v / g++ -vIn that case, alter the configuration to
--with-fc=$F90 \
--with-cc=$CC \
--with-cxx=$CXX \
--download-mpich \
--with-fc=mpif90 \
--with-cc=mpicc \
--with-cxx=mpicxx \
--download-fblaslapack, LAPACK, installed as a system package, can be used and will be autodetected:
--download-fblaslapack
alternatively, IMKL (located at $MKLROOT/lib/intel64) can be used with
--download-fblaslapack
--with-blaslapack-dir=$MKLROOT/lib/intel64
--download-fftw
--with-fftw-dir=/opt/fftw
--download-hdf5
--with-hdf5-dir=/opt/hdf5
--prefix option.
> ./configure \
--prefix=${deploymentDir} \
sudo. Use sudo su instead of sudo ./configure ...