Unable to build local solver with DMP in Ubuntu on latest version of MFix

Running python -m mfixgui.build_mfixsolver -j --dmp -DCMAKE_Fortran_COMPILER=mpifort --verbose
Building custom solver for tfm2d.mfx
Running cmake command:
cmake -DCMAKE_Fortran_COMPILER=mpifort -DENABLE_PYMFIX=ON -DENABLE_MPI=ON -G “Unix Makefiles” “-DCMAKE_INSTALL_PREFIX=/home/rohitkanchi/1 Hz Sinusoidal” “-DUDF_DIR=/home/rohitkanchi/1 Hz Sinusoidal” /home/rohitkanchi/miniforge3/envs/mfix-23.4.1/share/mfix/src

– Found Python3: /home/rohitkanchi/miniforge3/envs/mfix-23.4.1/bin/python3.10 (found version “3.10.13”) found components: Interpreter
– Setting build type to ‘RelWithDebInfo’ as none was specified.
– MFIX build settings summary:
– Build type = RelWithDebInfo
– CMake version = 3.28.3
– Fortran compiler = mpifort
– Fortran flags =
– ENABLE_MPI = ON
– ENABLE_OpenMP = OFF
– ENABLE_CTEST = OFF
– ENABLE_COVERAGE = OFF
– The Fortran compiler identification is GNU 13.2.0
– The C compiler identification is GNU 13.2.0
– Detecting Fortran compiler ABI info
– Detecting Fortran compiler ABI info - failed
– Check for working Fortran compiler: /home/rohitkanchi/miniforge3/envs/mfix-23.4.1/bin/mpifort
– Check for working Fortran compiler: /home/rohitkanchi/miniforge3/envs/mfix-23.4.1/bin/mpifort - broken
CMake Error at /home/rohitkanchi/miniforge3/envs/mfix-23.4.1/share/cmake-3.28/Modules/CMakeTestFortranCompiler.cmake:59 (message):
The Fortran compiler

"/home/rohitkanchi/miniforge3/envs/mfix-23.4.1/bin/mpifort"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: '/home/rohitkanchi/1 Hz Sinusoidal/build_dmp/CMakeFiles/CMakeScratch/TryCompile-Xc0O6o'

Run Build Command(s): /home/rohitkanchi/miniforge3/envs/mfix-23.4.1/bin/cmake -E env VERBOSE=1 /home/rohitkanchi/miniforge3/envs/mfix-23.4.1/bin/make -f Makefile cmTC_873e0/fast
/home/rohitkanchi/miniforge3/envs/mfix-23.4.1/bin/make  -f CMakeFiles/cmTC_873e0.dir/build.make CMakeFiles/cmTC_873e0.dir/build
make[1]: Entering directory '/home/rohitkanchi/1 Hz Sinusoidal/build_dmp/CMakeFiles/CMakeScratch/TryCompile-Xc0O6o'
Building Fortran object CMakeFiles/cmTC_873e0.dir/testFortranCompiler.f.o
/home/rohitkanchi/miniforge3/envs/mfix-23.4.1/bin/mpifort    -c "/home/rohitkanchi/1 Hz Sinusoidal/build_dmp/CMakeFiles/CMakeScratch/TryCompile-Xc0O6o/testFortranCompiler.f" -o CMakeFiles/cmTC_873e0.dir/testFortranCompiler.f.o
Linking Fortran executable cmTC_873e0
/home/rohitkanchi/miniforge3/envs/mfix-23.4.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_873e0.dir/link.txt --verbose=1
/home/rohitkanchi/miniforge3/envs/mfix-23.4.1/bin/mpifort CMakeFiles/cmTC_873e0.dir/testFortranCompiler.f.o -o cmTC_873e0
/home/rohitkanchi/miniforge3/envs/mfix-23.4.1/bin/../lib/gcc/x86_64-conda-linux-gnu/13.2.0/../../../../x86_64-conda-linux-gnu/bin/ld: /home/rohitkanchi/miniforge3/envs/mfix-23.4.1/lib/libmpi_mpifh.so: undefined reference to `memcpy@GLIBC_2.14'
/home/rohitkanchi/miniforge3/envs/mfix-23.4.1/bin/../lib/gcc/x86_64-conda-linux-gnu/13.2.0/../../../../x86_64-conda-linux-gnu/bin/ld: /home/rohitkanchi/miniforge3/envs/mfix-23.4.1/lib/./libpmix.so.2: undefined reference to `clock_gettime@GLIBC_2.17'
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_873e0.dir/build.make:99: cmTC_873e0] Error 1
make[1]: Leaving directory '/home/rohitkanchi/1 Hz Sinusoidal/build_dmp/CMakeFiles/CMakeScratch/TryCompile-Xc0O6o'
make: *** [Makefile:127: cmTC_873e0/fast] Error 2

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:11 (project)

– Configuring incomplete, errors occurred!

                 BUILD FAILED

==========================================================================

Unfortunately, there is a bug in OpenMPI version 5.0.1 in conda-forge. I have reported this to conda-forge but it’s not fixed yet -
https://github.com/conda-forge/openmpi-feedstock/issues/143

In the meawhile - with the MFiX environment activated, do

(mfix-23.4.1)$  mamba install openmpi=5.0.0

which will revert OpenMPI to the working 5.0.0 version.

Sorry for the trouble!

– Charles

1 Like

I figured this was happening. But thank you so much. It worked like a charm.

This bug also exist in OpenMPI version 5.0.2 in conda-forge. The solution also worked.

1 Like