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

#1

Dear Dr Krishna Kumar,

I installed MPM using https://cb-geo.github.io/mpm-doc/#/user/compile/docker 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 quay.io/cbgeo/mpm
4 docker images
5 docker run -it quay.io/cbgeo/mpm:latest /bin/bash
6 git clone https://github.com/cb-geo/mpm.git
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!

Feng

#2

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

#3

Thanks Dr Krishna Kumar,

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

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 https://cb-geo.github.io/mpm-doc/#/user/preprocess/input.

#4

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

#5

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.

#6

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

#7


image

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 https://github.com/cb-geo/mpm-benchmarks.

#8

Could cbgeo run on Mac?

#9

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

#10

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++ …. Hererefers to the path to theCMakeLists.txt` file.’

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

I typed ./mpmtest -s and it works.

#11

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

#12

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.

cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++ …

#13

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 quay.io/cbgeo/mpm
5 docker images
6 docker run -it quay.io/cbgeo/mpm:latest /bin/bash
7 git clone https://github.com/cb-geo/mpm.git
image
8 mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++ …
image
9 make clean && make -j4
image
10 ctest -VV
image
11 ./mpm -f /home/yade/mpm-benchmarks-develop/2d/2d_uniaxial_stress/ -i mpm-explicit-usf.json
image


12 ./mpm --version
image

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

Feng

#14

Hi,

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.

#15

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.
image
Could you teach me I should input the ./mpm -f -i after which step or which terminal?

Thanks again,
Feng

#16

Hi Feng,

Thanks. Sorry the installation instructions weren’t very clear. I have updated the one on the website: https://mpm.cb-geo.com/#/user/compile/compile?id=ubuntu 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.

#18

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.

Feng

#19

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

#20

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/

#21

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