PRISMS-PF Manual
Loading...
Searching...
No Matches
Installing from Source

Prerequisites

Before you can install PRISMS-PF, you will need to have some prerequisites installed on your machine. These include:

  • Git (to clone the repository)
  • A C++ compiler with C++20 support (we recommend GCC or Clang)
  • CMake (version 3.13.4 or higher)
  • LAPACK (for linear algebra operations)
  • MPI (we recommend OpenMPI or MPICH)
  • p4est (for adaptive octree meshing)
  • VTK (for file I/O) [optional]
  • Caliper (for profiling) [optional]
  • deal.II (version 9.6 or higher)

You can install these prerequisites however you like. The first five are typically available on most OSes through your package manager. For example, on Ubuntu, you can install them with:

sudo apt-get install git lsb-release git subversion wget bc libgmp-dev build-essential
autoconf automake cmake libtool gfortran python3 libboost-all-dev zlib1g-dev openmpi-bin
openmpi-common libopenmpi-dev libblas3 libblas-dev liblapack3 liblapack-dev
libsuitesparse-dev

To install p4est and deal.II, we recommend following the instructions on the deal.II installation guide. We suggest building deal.II and p4est using deal.II's automatic installation script candi.

git clone https://github.com/dealii/candi.git
cd candi

Modify the candi.cfg file, commenting out any PACKAGES other than dealii and p4est. Then run:

./candi.sh

or

./candi.sh -j <nprocs>

to compile with multiple processors (much faster). (Note that we have found that specifying too many processors can sometimes lead to build failures, so if you run into issues, try reducing the number of processors specified.)

This will install both p4est and deal.II in a local directory (by default,$HOME/dealii-candi/). Be sure to permanently set the DEAL_II_DIR environment variable to point to the deal.II installation.

To install VTK, we recommend installing from source.

git clone https://gitlab.kitware.com/vtk/vtk.git vtk-clone
mkdir vtk-build
mkdir vtk-install
cd vtk-build
cmake ../vtk-clone -DCMAKE_BUILD_TYPE=Release -DVTK_GROUP_ENABLE_QT=OFF
-DVTK_GROUP_ENABLE_MPI=YES -DVTK_USE_MPI=ON -DVTK_BUILD_TESTING=OFF
-DCMAKE_INSTALL_PREFIX=../vtk-install
make -j <numprocs> install

Be sure to permanently set the VTK_DIR environment variable to point to the VTK installation (e.g.,$HOME/vtk-install/lib/cmake/vtk-9.xx).

Installing PRISMS-PF

Once you have all the prerequisites installed, you can clone the PRISMS-PF repository from GitHub, configure the build with CMake, and compile the code:

git clone https://github.com/prisms-center/phaseField.git
cd phaseField
mkdir build
cd build
cmake -DPRISMS_PF_WITH_VTK=ON -DCMAKE_INSTALL_PREFIX=<prisms-install-dir> ..
make -j <nprocs> install

This will build the PRISMS-PF library in both debug and release modes. Next, set the PRISMS_PF_DIR environment variable to point to the PRISMS-PF installation directory (the directory containing the lib and include directories). You can now compile and run any of the applications in the applications directory. For example, to compile and run the allen_cahn_explicit application, you can use the following commands:

cd applications/allen_cahn_explicit
cmake .
make
mpirun -n <nprocs> ./main