About mpirun : error while loading shared libraries

Dear All,
I have already built DMP solver successfully. Then I tried to run MPI jobs with the standard MPI wrapper command, and the error happened:


how can I fix this error?

`

I’m not sure exactly what the issue is but libgfortran.so.4 is quite old, most systems have libgfortran.so.5. I would try updating the Fortran compiler and/or OpenMPI installation.

Can you build and run the MPI hello_world example?

share/mfix/src/tools/mpi/hello_world.f90

If that succeeds, please run mfixversioninfo and paste the output here. Thanks.

Hello cgw,
I have tried to run the MPI example, and yes, it also reported the same error. My MFIX is installed in a commercial remote computing server set. I’m not sure if there’s something wrong with my procedure.
load openmpi:


run the MPI example:

It looks like their is an incompatibilty between the mpi/openmpi/4.1.1-gcc7.3.0 module on your server and the libgfortran in Anaconda which is libgfortran.so.5. Note that gcc7 is several years old.

Suggestion: Either get your support people to update the openmpi module, or, probably easier, don’t activate that module at all and rather get your Fortran compiler and openmpi from Conda:

bash$ conda activate mfix-22.4.3
mfix-22.4.3$ conda -c conda-forge install openmpi gfortran

[Use mamba in place of conda if you have it installed]

This gets you a nice recent version of openMPI and gfortran:

mfix-22.4.3$ mpirun --version
mpirun (Open MPI) 4.1.5

mfix-22.4.3$ gfortran --version
GNU Fortran (conda-forge gcc 12.2.0-19) 12.2.0

GFortran12 will generate better (faster) code than GFortran7

Note that the MFiX installation will install a Fortran compiler for the Windows and MacOS platforms because we don’t expect one to be present. For Linux systems we don’t install a Fortran compiler by default because we assume users want to use the compiler that’s already present on their system which may be better. But in your case it seems like the Conda-forge sourced compiler is the better choice.

Thanks @cgw ,I have connected administrator, and he helped me to solve this problem.
I need to load gcc after openmpi. I don’t know why but it works. :joy:

module load mpi/openmpi/4.1.1-gcc7.3.0

module load gcc/7.3.-wzm

Thanks for your suggestions again, I will try those commands, maybe they can be an alternative method.