Build and prerequisite packages - geomechanics/mpm GitHub Wiki

Build

Background information on prerequisite packages can be found below. In general, first, find your Linux/Mac operating system and follow the instructions to get started. Then, install other dependencies. After completing the installation, you may want to visit the Compiling MPM in Linux or in ARM-based MacOS page.

Prerequisite packages

Optional

Fedora installation

Please run the following command:

dnf install -y boost boost-devel clang clang-analyzer clang-tools-extra cmake cppcheck dnf-plugins-core \
                   eigen3-devel findutils freeglut freeglut-devel gcc gcc-c++ git hdf5 hdf5-devel \
                   kernel-devel lcov libnsl make ninja-build openmpi openmpi-devel tar \
                   valgrind vim vtk vtk-devel wget

Ubuntu installation

Please run the following commands to install dependencies:

sudo apt update
sudo apt upgrade
sudo apt install -y gcc git libboost-all-dev libeigen3-dev libhdf5-serial-dev libopenmpi-dev libomp-dev

If you are running Ubuntu 18.04 or below, you may want to update the GCC version to 9 to have OpenMP 5 specifications support.

sudo apt install software-properties-common
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt install gcc-9 g++-9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90 --slave /usr/bin/g++ g++ /usr/bin/g++-9 --slave /usr/bin/gcov gcov /usr/bin/gcov-9

ARM-based MacOS installation

You need to install homebrew if you don't already have it, then please run the following commands to install dependencies:

brew update
brew upgrade
brew install gcc git boost eigen hdf5 open-mpi libomp

Install other dependencies

Install the following dependencies in order of appearance. All of these are required, apart from VTK which is necessary for ParaView (data analysis and visualization application).

CMake

Ubuntu

sudo apt-get install software-properties-common
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main'
sudo apt update
sudo apt upgrade

MacOS

brew install cmake

OpenGL and X11:Xt

Ubuntu

sudo apt-get install freeglut3-dev libxt-dev

MacOS

brew install freeglut libxt

LLVM

MacOS

brew install llvm

VTK

Both Ubuntu and MacOS

git clone https://gitlab.kitware.com/vtk/vtk.git VTK
cd VTK && mkdir build && cd build/
cmake -DCMAKE_BUILD_TYPE:STRING=Release ..
make -j
sudo make install

Advanced

Partio for Houdini SFX Visualization

Ubuntu

sudo dnf install -y libnsl freeglut freeglut-devel
mkdir -p ~/workspace && cd ~/workspace/ && git clone https://github.com/wdas/partio.git && \
    cd partio && cmake . && make

Houdini supported (*.bgeo) files will be generated. These can be rendered using the non-commercial Houdini Apprentice.