optimad / mimmo

Surface manipulation and mesh morphing library
http://optimad.github.io/mimmo
GNU Lesser General Public License v3.0
99 stars 21 forks source link

Compile template project #177

Open MiladHB opened 3 years ago

MiladHB commented 3 years ago

Hi,

I have installed mimmo and all its dependencies. Also, I could create the executable files of its examples and get the result during the installation procedure but when I try to compile the recommended project for using mimmo (https://optimad.github.io/mimmo/downloads/mimmo-project.tar.gz). I get the following error: Screenshot from 2021-09-06 20-25-40 I appreciate it if you could help me.

Thanks, Milo

roccoarpa commented 3 years ago

Hello Milo, the problem seems related to PETSC: the cmake project try to scan the 2 enviroment variables PETSC_DIR and PETSC_ARCH but it seems it does not find the right path to installation, thus this triggers the PETSC_EXECUTABLE_RUNS finding error (that petsc uses to check if its installation is working).

I suggest you to check if those variables exists in your shell first. You should obtain something like PETSC_DIR=/home/mihabibi/Desktop/PET_INSTALL/petsc, PETSC_ARCH=arch-linux-c-debug. If nothing is set, Please export them as env variables (as the installation guide of petsc suggests) If this does not solve the problem, review your installation of petsc (be sure to perform all passages)

Meanwhile here you find an update version of the mimmo-project.tar.gz that solves other compiling issues. mimmo-project.tar.gz linked to issue #178

MiladHB commented 3 years ago

Hi, Thanks for your prompt reply. I have exported the PETSC_DIR, and PETSC_ARCH as you suggested in my bashrc as you can see: Screenshot from 2021-09-07 10-54-46 Also all the massages regarding the Petsc is double checked: (Meanwhile if you have suggestion for specific version/method installation of Petsc on ubuntu 18.04 I appreciate it to share it with me): Screenshot from 2021-09-07 11-02-17.

Also, I found a solution regarding PETSC_EXECUTABLE_RUNS problem by running the following code: cmake . -DPETSC_EXECUTABLE_RUNS=/usr/include/petsc About the updated version project, it gives me the following error: Screenshot from 2021-09-07 11-08-14

I would appreciate if you please could help me.

Thanks, Milo

roccoarpa commented 3 years ago

Hi Milo, it seems a problem of cmake copying the prism file from a path with a "(" inside. I suggest to copy the original mimmo_project folder to a plain path /home/milo/Desktop avoiding () character or blank spaces. Then access the build folder inside mimmo-project and run ccmake .., or cmake-gui to compile the data needed by the project (essentially your-mimmo-install-dir/lib/cmake/mimmo-1.4 as variable MIMMO_DIR).

MiladHB commented 3 years ago

Thanks for your prompt reply. I received the following results from ccmake .: Screenshot from 2021-09-07 15-37-27 Screenshot from 2021-09-07 15-39-13 Then after doing make, I get the following result: Screenshot from 2021-09-07 15-42-02

I would appreciate if you please let me know if you think the problem is solved.

Thanks, Milo

roccoarpa commented 3 years ago

Everything seems ok. Try to run the executable myprogram to have the final confirmation. A bunch of *.stl file should appear as results. You can use paraview to visualize them. Best, R.

MiladHB commented 3 years ago

Thanks for your reply. Unfortunately it gives the following error:

Screenshot from 2021-09-07 18-53-15

Thanks, Milo

roccoarpa commented 3 years ago

Hi Milo, let me check it the project sample is working correctly with MPI compiled mimmo, then i will revert to you.

roccoarpa commented 3 years ago

Hello Milo, here you find an update template project, which accounts of MPI initialize and finalize directives to run your sample program. mimmo-project.tar.gz

Please, download it and repeat the compiling/testing procedure as before, and see if the problem is fixed.

In case not, here a bunch of checks to understand better the problem: 1) Can you use the bitpit 1.7.x version to compile mimmo (mimmo is at end-of-dev, and it is guaranteed to work with bitpit 1.7). You are currently using the 1.8. To use the 1.7 check the bitpit git branch 1.7 and install it. Reinstall mimmo linking to it and so on. 2) Launch ctest command in the build folder of both bitpit and mimmo and see if errors are triggered.

Let us know. Best R.

MiladHB commented 3 years ago

Many thanks for your help. It is working now and created 5 .stl files. Screenshot from 2021-09-08 11-57-58.

I just have one naive question, since I have a old version mimmo code related to my project which does not work on my workstation. Can you explain to me what should I change on the codes (as you did on yours) which works on my workstation\mimmo version.(It is mainly related to main code or CMAKElists.txt files?)

Thanks again, Milo

roccoarpa commented 3 years ago

Hi Milo, you are actually using a MPI compiled version of the library. See into mimmo-project main.cpp, into the main method. You need to wrap your code in

if MIMMO_ENABLE_MPI

    MPI_Init(&argc, &argv);
#endif

.... .... YOUR CODE .... ....

if MIMMO_ENABLE_MPI

    MPI_Finalize();
#endif

That's to initialize MPI and finalize it before exiting. That's needed also if you want to use MPI directives into your code. Hope it helps. Best

R.