Skip to content

Problems compiling on Ubuntu 20.04 with MPI

The following is the extracted (from screenshot) error message @ShuangChen88 send me via email:

Imported target "MPI::MPI_C" includes non-existent path
"/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi"
in its INTERFACE_INCLUDE_DIRECTORIES.
Possible reasons include:
*
The path was deleted, renamed, or moved to another location.
*
An install or uninstall procedure did not complete successfully.
The installation package was faulty and references files it does not
provide.
Make Error in /home/schen/Desktop/code/debug/CMakeFiles/CMakeTmp/CMakeLists.txt:
Imported target "MPI:: MPI_C" includes non-existent path
"/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi"
in its INTERFACE_INCLUDE_DIRECTORIES.
Possible reasons include:
*
The path was deleted, renamed, or moved to another location.
*
An install or uninstall procedure did not complete successfully.
*
The installation package was faulty and references files it does not
provide.
CMake Error at /usr/share/cmake-3.19/Modules/FindMPI. cmake: 1214 (try_compile) :
Failed to generate test project build system.
Call Stack (most recent call first):
/usr/share/cmake-3.19/Modules/FindMPI.cmake:1265(_MPI_try_staged_settings)
/usr/share/cmake-3.19/Modules/FindMPI.cmake:1530 (_MPI_check_lang_works)
/home/schen/Desktop/code/debug/_deps/boost-src/libs/mpi.cmake:1 (find_package)
/home/schen/Desktop/code/debug/_deps/boost-src/CMakeLists.txt:71(include)

@ShuangChen88 How do configure your build?

For me this works on Ubuntu 20.04:

sudo apt install petsc-dev
cd ogs
cmake -S . --preset=release-petsc
...
-- Found MPI_C: /usr/bin/mpicc  
-- Found MPI_CXX: /usr/bin/mpic++
...  

Also the path /usr/lib/x86_64-linux-gnu/openmpi/include/openmpi is existing on my machine.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information