Installation - apusok/FD-PDE GitHub Wiki
- Python/Anaconda Distribution
- Compilers
- PETSc
- FD-PDE framework
Other recommended software: Terminal
, Visual Studio Code for code editing/debugging, SourceTree and/or GitHub Desktop for management of git repositories. Recommended to create accounts on Bitbucket and/or Github.
Also check git
installation with which git
. It should be installed with XCode/Command line tools. Otherwise, install git using homebrew.
Update or install Anaconda Distribution. This will provide the entire python environment on the system: command line pip, conda
or Jupyter notebooks.
-
On Mac OSX you will need to install Xcode/Command Line Tools
-
Install
homebrew
or update withbrew update/upgrade
. Then installgcc
andmpich
(for parallel programming) in the following way
brew install gcc
brew install mpich
Restart the terminal and check that all compilers are consistent: gcc -v
, and then for g++/gfortran. PETSc requires fortran compilers, but Apple stopped the support some time ago.
If the system does not recognize the gcc compilers, set the links with (might need to remove them first with sudo rm <>)
sudo ln -s $(brew --prefix gcc)/bin/gcc /usr/local/bin/gcc
sudo ln -s $(brew --prefix gcc)/bin/gfortran /usr/local/bin/gfortran
sudo ln -s $(brew --prefix gcc)/bin/g++ /usr/local/bin/g++
and
sudo ln -s $(brew --prefix mpich)/bin/mpicc /usr/local/bin/mpicc
sudo ln -s $(brew --prefix mpich)/bin/mpicxx /usr/local/bin/mpicxx
sudo ln -s $(brew --prefix mpich)/bin/mpif90 /usr/local/bin/mpif90
and add the following to $PATH
export PATH=/usr/local/bin:$PATH
The PETSc version (v3.23) can be obtained from petsc
git clone -b maint https://gitlab.com/petsc/petsc.git petsc
cd petsc/
Configure options for Mac OSX Sequoia 15. OPTIMIZED version recommended for model runs (change <PATH_OPT>
accordingly):
./configure --prefix=<PATH_OPT> --download-fblaslapack --download-hdf5 --download-mumps --download-scalapack --download-parmetis --download-metis --download-cmake --with-debugging=0 --enable-shared --with-cxx-dialect=C++11 --download-superlu_dist --download-spooles --download-suitesparse --download-ml --download-hypre --download-hwloc --download-make --download-mpich --download-netlib-lapack --with-netlib-lapack-c-bindings --with-precision=double --with-shared-libraries=1 --with-scalar-type=real CC=clang CXX=clang++ FC=gfortran --FOPTFLAGS=-O2 --CXXOPTFLAGS=-O2 --COPTFLAGS=-O2
Follow with install instructions. Please get in touch with AP for DEBUG configure options recommended for code development.
Specify PETSc environment variable for bash (in ~/.bashrc
) or zsh (in ~/.zshrc
) shell:
export PETSC_DIR=<PATH_OPT>
In petsc/
do
make check
to run some test examples.
Clone the release FD-PDE repository from GitHub by typing in the command line
git clone https://github.com/apusok/FD-PDE.git ./FD-PDE
You could also fork the Github repository into another repository, which will allow you work with the FD-PDE framework and save changes, but sync with the release version.
To update the FD-PDE repository with the latest changes do
git pull
In src/
do
make clean_all
make tests
to compile the tests. Then go to tests/
and run a few tests. For example, run a simple test that creates and destroys a FD-PDE object with
./test_fdpde_ -log_view
You can also run the Duretz et al., 2011 SolCx benchmark with
./test_stokes_solcx_ -pc_type lu -pc_factor_mat_solver_type umfpack -pc_factor_mat_ordering_type external -nx 10 -nz 10 -log_view
although the output is not very informative. Instead, go to tests/python
and run
python test_stokes_solcx.py
A new directory was created /out_stokes_solcx
which contains the results for an error convergence test for two cases: a) isoviscous and b) viscosity contrast of
Back to HOME