You can also use Spack to install dependencies and the CB-Geo MPM code.
git clone https://github.com/spack/spack.git
. spack/share/spack/setup-env.shspack install boost+filesystem
spack install eigen
spack install tbb
spack install hdf5+hlOnce the dependencies are installed locally using Spack. You can use spack load or module load command to load installed dependencies.
Clone and run the MPM code as discussed in the compile section.
spack repo create $HOME/myspack; spack repo add $HOME/myspackspack create github:cb-geo/mpm.git -n mpm -t cmake -r myspack
Replace the mpm/package.py file with
from spack import *
class Mpm(CMakePackage):
"""CB-Geo Material Point Method"""
#homepage = "https://www.cb-geo.com/research/mpm"
version('develop', git='https://github.com/cb-geo/mpm.git', preferred=True)
depends_on('opengl')
depends_on('boost+filesystem')
depends_on('tbb')
depends_on('hdf5+hl')
def cmake_args(self):
args = ["-DCMAKE_EXPORT_COMPILE_COMMANDS=On -DENABLE_COVERAGE=Off"]
return argsRun spack spec -I mpm to check if spack has picked up the required mpm packages. The specification file for the MPM code can be edited by typing spack edit mpm once you have a mpm/package.py file in the myspack repo.
To compile and install the code use spack install mpm.