Problem MPI_CXX during default Compilation

Asked by Steve Underwood on 2021-03-18


I wanted to do the default Compilation, however cmake couldn't find MPI_CXX. That is the Output from the Terminal:

 Could NOT find MPI_CXX (missing: MPI_CXX_WORKS)
CMake Error at /home/zszlobod/cmake-3.19.7/Modules/FindPackageHandleStandardArgs.cmake:218 (message):
  Could NOT find MPI (missing: MPI_CXX_FOUND) (found version "3.1")

      Reason given by package: MPI component 'Fortran' was requested, but language Fortran is not enabled.

Call Stack (most recent call first):
  /home/zszlobod/cmake-3.19.7/Modules/FindPackageHandleStandardArgs.cmake:582 (_FPHSA_FAILURE_MESSAGE)
  /home/zszlobod/cmake-3.19.7/Modules/FindMPI.cmake:1722 (find_package_handle_standard_args)
  CMakeLists.txt:590 (FIND_PACKAGE)

-- Configuring incomplete, errors occurred!
See also "/home/zszlobod/trunk-2020.01a/build/CMakeFiles/CMakeOutput.log".
See also "/home/zszlobod/trunk-2020.01a/build/CMakeFiles/CMakeError.log".

When I looked up CMakeError.log , it says test_mpi for CXX in mode normal failed to compile:

The MPI test test_mpi for CXX in mode normal failed to compile with the following output:
Change Dir: /home/zszlobod/trunk-2020.01a/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_3f232/fast && /usr/bin/make -f CMakeFiles/cmTC_3f232.dir/build.make CMakeFiles/cmTC_3f232.dir/build
make[1]: Entering directory '/home/zszlobod/trunk-2020.01a/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_3f232.dir/test_mpi.cpp.o
/usr/bin/c++ -isystem /usr/lib/x86_64-linux-gnu/openmpi/include/openmpi -isystem /usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent -isystem /usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent/include -isystem /usr/lib/x86_64-linux-gnu/openmpi/include -Werror -Wformat -Wformat-security -Wformat-nonliteral -Wall -Wextra -Wnarrowing -Wreturn-type -Wuninitialized -Wfloat-conversion -Wcast-align -Wdisabled-optimization -Wtrampolines -Wpointer-arith -Wswitch-bool -Wwrite-strings -Wnon-virtual-dtor -Wreturn-local-addr -Wno-error=maybe-uninitialized -Wno-comment -Wno-error=cpp -fdce -fstack-protector-strong -DYADE_GTS -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include -DQGLVIEWER_FOUND -DYADE_OPENGL -DYADE_QT5 -DYADE_CGAL -DFLOW_ENGINE -DFLOW_ENGINE -DLINSOLV -pthread -o CMakeFiles/cmTC_3f232.dir/test_mpi.cpp.o -c /home/zszlobod/trunk-2020.01a/build/CMakeFiles/FindMPI/test_mpi.cpp
clang: error: unknown argument: '-fdce'
CMakeFiles/cmTC_3f232.dir/build.make:84: recipe for target 'CMakeFiles/cmTC_3f232.dir/test_mpi.cpp.o' failed
make[1]: *** [CMakeFiles/cmTC_3f232.dir/test_mpi.cpp.o] Error 1
make[1]: Leaving directory '/home/zszlobod/trunk-2020.01a/build/CMakeFiles/CMakeTmp'
Makefile:140: recipe for target 'cmTC_3f232/fast' failed
make: *** [cmTC_3f232/fast] Error 2

I tried to reinstall openmpi and cmake, but that didn't work. Can anyone help me?
Compiler: gcc 7.5.0
cmake 3.19.7
openmpi 2.1.1
yade 2020.01a
Ubuntu 18.04.4 lts

Thank you in advance!

Question information

English Edit question
Yade Edit question
No assignee Edit question
Solved by:
Anton Gladky
Last query:
Last reply:


Are you using "gold" linker? [1]
If so, this is a known cmake issue (independent of yade, with still no idea how to fix) and I would suggest to disable either or disable MPI option.




Steve Underwood (bunsotvang) said : #2

No i use ld-linker. I would like to enable the MPI option to use Yade with Openfoam. Is there another way to enable MPI without facing problems with cmake?

Best Anton Gladky (gladky-anton) said : #3

It looks like you are using clang, which has problems with MPI. Please use gcc instead.

Steve Underwood (bunsotvang) said : #4

oh thank you this worked! I actually set the compiler to gcc but test_mpi somehow compiled with clang? I solved it by deleting clang to compile yade.

Steve Underwood (bunsotvang) said : #5

Thanks Anton Gladky, that solved my question.