Compiling CB-Geo MPM code on ubuntu 18.04: Issue with VTK

Dear Dr Krishna Kumar,

I installed MPM using on Ubuntu 10.04.2.

The order in which I enter the terminal is:
1 sudo apt-get install -y cmake gcc git libboost-all-dev libeigen3-dev libhdf5-serial-dev libopenmpi-dev libtbb-dev libvtk7-dev
2 systemctl status docker
3 docker pull
4 docker images
5 docker run -it /bin/bash
6 git clone
7 mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release …

[cbgeo@9c3cb0bc9b50 build]$ ./mpm -f tests
bash: ./mpm: No such file or directory

Why it can’t find the mpm directory?

Thanks for your help!


Hi Thanks! You are missing a step, you need to run make -j to compile the code. The cmake step only creates the Makefile, not compile it

Thanks Dr Krishna Kumar,

1.I added 8 make clean && make -j4

Is it necessary to perform 5 to 8 steps each time I call json?

2.Then I created a mpm.json file in /home/yade3/Desktop and copied

No, it’s not necessary to compile each time to run mpm, it’s only required when the code is changed. In your command you are missing a / at the end: ./mpm -i mpm.json -f /home/yade3/Desktop/ assuming that’s where you have the input files

I think it is possible that I made a mistake in the 7th step.Because i just copied mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release … and did’t modified … I did’t know to modify it.

mpm is fine, you don’t seem to have an input file in /home/yade3/Desktop/ please use some benchmark examples from to get started. The folder you are pointing to with -f command should have the input files.


Thanks Dr Krishna Kumar again,

Is it as long as the ‘Built target mpmtest’ is displayed, it means there is no problem with my installation?

I downloaded all the code from

Could cbgeo run on Mac?

The CB-Geo Docker container could be used to run the code on a Mac

Is the reason it can’t find the input file i mentioned before that in compiling i just copied 'mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release … ‘in step 7.And from your document is ’ mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++ …. Here refers to the path to theCMakeLists.txt` file.’

Using ‘locate CMakeLists.txt’,i tried each way to subsitute … ,but it still not work.

I typed ./mpmtest -s and it works.

After ./mpm,can I successfully call the brenchmarks placed in any folder?

The CMakeLists.txt refers to the mpm code’s CMake file. So run the following command from within the build directory. The CMakeLists.txt is available in the root directory of the mpm code repo.


Sorry Dr Krishna Kumar,i still can’t run .json successfully.I rearranged it again so that you can point out my mistakes. Thank you in advance.

I installed MPM on Ubuntu 18.04.2.
The order in which I enter the terminal is:(Enter completely copied except number and show terminal running picture )

1 sudo apt-get update
sudo apt-get upgrade
sudo apt-get install
sudo apt-get autoremove
2 sudo apt-get install -y cmake gcc git libboost-all-dev libeigen3-dev libhdf5-serial-dev libopenmpi-dev libtbb-dev libvtk7-dev
3 systemctl status docker
4 docker pull
5 docker images
6 docker run -it /bin/bash
7 git clone
8 mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++ …
9 make clean && make -j4
10 ctest -VV
11 ./mpm -f /home/yade/mpm-benchmarks-develop/2d/2d_uniaxial_stress/ -i mpm-explicit-usf.json

12 ./mpm --version

Through the last picture, I think the mpm installation is successful. But I don’t know why the file was not found.



You are running a the mpm code inside the docker container, while you have your benchmarks loclly on your ubuntu machine. Either clone your mpm-benchmarks repo in the docker container or run mpm code locally, and not inside a docker container.

Dear Dr Krishna Kumar,thank you so much for your relpy and code.I really lack experience in installing software under linux.Sorry to trouble you.

I want to run mpm code locally.
Could you teach me I should input the ./mpm -f -i after which step or which terminal?

Thanks again,

Hi Feng,

Thanks. Sorry the installation instructions weren’t very clear. I have updated the one on the website: Could you follow the steps from this section on Ubuntu to all the way to running the ./mpmtest and see if that works? Let’s try this again, because previously you used the Docker container.

Dear Dr Krishna Kumar,

Thanks for your work,it’s very clear now!

I used g++8.2.0 to compile.
It can’t find MPI and VTK.But i think it is optional.
Trouble you point out my mistake.


Hi Feng, Thanks for this. You followed the steps correctly, looks like Ubuntu 18.04 is shipping a broken VTK7.1 library :slightly_frowning_face: You can try to remove VTK by doing apt-get remove libvtk7-dev and the mpm code will still compile without it. Could you try removing VTK and running steps from CMake again? You may want to remove everything inside the build directory before you proceed.

I will find a way about fixing Ubuntu’s broke VTK

Thanks Dr Krishna Kumar,

Maybe i input the following wrong command?
mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++ /home/yade2/mpm/

Hey Feng,

You are not doing anything incorrect. It’s just that some of the packages in ubuntu are broken! Please try this and then run your cmake command:

apt install python3-pip
apt remove cmake
pip3 install cmake --upgrade
ln -s /usr/local/bin/cmake /usr/bin/cmake