Error while instal G4mpi library

Hello, everyone.
I’m trying to run MPI example exMPI01 on an cluster, so at first i try to install G4mpi library onto the Geant4.10.03.p03 version.
When i’m installing this by instruction from i can see that configurating is done good, but when i’m trying to make, there is error on 71% of make, which you can see on the attached picture, or in the listning below:

[ 71%] Building CXX object CMakeFiles/G4mpi.dir/src/
/mnt/pool/4/rfibragimov/test/MPI/source/src/ In member function ‘void {anonymous}::MPIStatDouble::Pack(void*, int, int*, MPI::Intracomm&) const’:
/mnt/pool/4/rfibragimov/test/MPI/source/src/ error: invalid conversion from ‘const void*’ to ‘void*’ [-fpermissive]
/mnt/pool/4/rfibragimov/test/MPI/source/src/ error: invalid conversion from ‘const void*’ to ‘void*’ [-fpermissive]
/mnt/pool/4/rfibragimov/test/MPI/source/src/ In member function ‘void G4MPIscorerMerger::Pack(const G4VScoringMesh*)’:
/mnt/pool/4/rfibragimov/test/MPI/source/src/ error: invalid conversion from ‘const void*’ to ‘void*’ [-fpermissive]
make[2]: *** [CMakeFiles/G4mpi.dir/src/] Error 1
make[1]: *** [CMakeFiles/G4mpi.dir/all] Error 2
make: *** [all] Error 2

Do you have any guess what i’m doing wrong or what i can do to fix it?
Thankx in advance.

Based on the output, this looks like OpenMPI 2.1, which unfortunately isn’t supported by the example yet. Per the README for the current production release, the options for the MPI implementation are:

  • OpenMPI 1.8.1
  • MPICH 3.2
  • Intel MPI 5.0.1

so I would see if you can install one of these. If you’re on a cluster supporting MPI, it’s highly likely that one or more of these is available.

The MPI example is in need of maintenance, and longer term integration in the core toolkit. Unfortunately we don’t have the manpower to do this right now.

Thank you for advice, i will try to check it out when i get access to the cluster again, and will tell here about results.

I am having some issues while trying to install G4mpi libraries so I thought of posting here. On our cluster, when I type “make”, I get an error message:
error: ‘MPI’ does not name a type; did you mean ‘M_PI’?
const MPI::Intracomm* GetComm() const { return &COMM_G4COMMAND_; }

On my MacBook (Monterey 12.3.1), I get a similar error:
error: use of undeclared identifier ‘MPI’
const MPI::Intracomm* GetComm() const { return &COMM_G4COMMAND_; }

I would really appreciate any help regarding this.

Which MPI implementation/version is being found/used? G4mpi is no longer actively maintained, and only works with those listed above

I am using geant4 11.0.1 with openmpi-4.1.1. Thanks.

Apologies for the delay in replying - as noted above G4mpi is only known to work with OpenMPI 1.8.1 due to the deprecation of the C++ interface. Unfortunately, we don’t have any available FTE to work on updates or further support for MPI use at the moment.

I was able to install G4mpi libraries using Intel MPI. But I cannot build an example (exMPI04). I tried using the intel MPI compiler wrapper by setting the environment as “export I_MPI_CXX=icpc” but the build fails. I tried other compilers like igxx, icxx etc without success. I am not sure what the issue is so I’m going to attach the error message below. Thank you.

Here’s the build command: cmake -DGeant4_DIR=/path to Geant4-11.0.1 -DG4mpi_DIR=/path to G4mpi-11.0.1 /path to source

– Could NOT find MPI_C (missing: MPI_C_WORKS)
– Could NOT find MPI_CXX (missing: MPI_CXX_WORKS)
CMake Error at /usr/local/biotools/cmake/cmake-3.22.2/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find MPI (missing: MPI_C_FOUND MPI_CXX_FOUND)
Call Stack (most recent call first):
/usr/local/biotools/cmake/cmake-3.22.2/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
/usr/local/biotools/cmake/cmake-3.22.2/share/cmake-3.22/Modules/FindMPI.cmake:1830 (find_package_handle_standard_args)
/research/labs/radonc/beltranc/m254407/Particle/MPI/build/lib64/G4mpi-11.0.1/G4mpiConfig.cmake:36 (find_package)
CMakeLists.txt:23 (find_package)

  • You can recompile the openmpi as following:
./configure --prefix=/lustre/software/mpi/openmpi-4.1.4/install --enable-mpi-cxx
 make -j 100
 make install

And then compile the G4mpi like this:

cmake -DGeant4_DIR=/lustre/software/geant4/geant4-11.0.3/install/lib64/Geant4-11.0.3 -DCMAKE_INSTALL_PREFIX=/lustre/software/geant4/geant4-11.0.3/install/share/Geant4-11.0.3/examples/extended/parallel/MPI/install ../source/

The result is: