mpi icon indicating copy to clipboard operation
mpi copied to clipboard

Compilation failure with OpenMPI 5.0.2: MPI_Type_struct was removed in MPI-3.0.

Open m13253 opened this issue 1 year ago • 0 comments

Hello,

I am having trouble compiling this project using GCC and linking to OpenMPI 5.0.2. Can you help me troubleshoot what has gone wrong?

Thank you very much!

$ gcc --version
gcc (GCC) 13.2.1 20230801
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ mpiexec --version
mpiexec (Open MPI) 5.0.2

$ git clone -b 4.1.1 https://github.com/acdemiralp/mpi.git acdemiralp_mpi

$ cd acdemiralp_mpi

$ cmake -B build -S . -D CMAKE_C_COMPILER=gcc -D CMAKE_CXX_COMPILER=g++ -D MPI_BUILD_TESTS=ON -G Ninja
-- The C compiler identification is GNU 13.2.1
-- The CXX compiler identification is GNU 13.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found MPI_C: /usr/lib/libmpi.so (found version "3.1")
-- Found MPI: TRUE (found version "3.1") found components: C
-- Configuring done (1.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/user/acdemiralp_mpi/build

$ ninja -C build
ninja: Entering directory `build'
[3/14] Building CXX object CMakeFiles/c_interface_test.dir/tests/c_interface_test.cpp.o
FAILED: CMakeFiles/c_interface_test.dir/tests/c_interface_test.cpp.o
/usr/bin/g++  -I/home/user/acdemiralp_mpi/include -std=gnu++20 -MD -MT CMakeFiles/c_interface_test.dir/tests/c_interface_test.cpp.o -MF CMakeFiles/c_interface_test.dir/tests/c_interface_test.cpp.o.d -o CMakeFiles/c_interface_test.dir/tests/c_interface_test.cpp.o -c /home/user/acdemiralp_mpi/tests/c_interface_test.cpp
In file included from /home/user/acdemiralp_mpi/include/mpi/core/mpi.hpp:3,
                 from /home/user/acdemiralp_mpi/include/mpi/all.hpp:3,
                 from /home/user/acdemiralp_mpi/tests/c_interface_test.cpp:5:
/home/user/acdemiralp_mpi/tests/c_interface_test.cpp: In function ‘void DOCTEST_ANON_FUNC_2()’:
/home/user/acdemiralp_mpi/tests/c_interface_test.cpp:56:5: error: static assertion failed: MPI_Type_struct was removed in MPI-3.0.  Use MPI_Type_create_struct instead.
   56 |     MPI_Type_struct    (2, block_lengths.data(), displacements.data(), data_types.data(), &particle_data_type);
      |     ^~~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.

m13253 avatar Mar 20 '24 05:03 m13253