Mfix2013-1 build error

Hi,
I am trying to build the *.exe file of a case in 2013-1 version. It is because we got better results of the hydrodynamics of flow using some modifications in the code some years ago. So, I want to reevaluate them and implement the modifications in the new version. However, I face the following error even when I want to build the *.exe file for a tutorial case of that version:

…/OBJECT_FILES_OPT_DMP_GFOR/cfassign.o:cfassign.f:function cfassign_: error: undefined reference to 'ZGVbN2v_log’
…/OBJECT_FILES_OPT_DMP_GFOR/cfassign.o:cfassign.f:function cfassign
: error: undefined reference to 'ZGVbN2v_log’
…/OBJECT_FILES_OPT_DMP_GFOR/source_population_eq.o:source_population_eq.f:function source_population_eq
: error: undefined reference to 'ZGVbN2vv_pow’
…/OBJECT_FILES_OPT_DMP_GFOR/source_population_eq.o:source_population_eq.f:function source_population_eq
: error: undefined reference to 'ZGVbN2vv_pow’
…/OBJECT_FILES_OPT_DMP_GFOR/thermal_conductivity.o:thermal_conductivity.f:function thermal_conductivity
: error: undefined reference to 'ZGVbN2vv_pow’
…/OBJECT_FILES_OPT_DMP_GFOR/qmomk_time_march.o:qmomk_time_march.f:function qmomk_time_march
: error: undefined reference to ‘_ZGVbN2vv_pow’
collect2: error: ld returned 1 exit status
make: *** [mfix_l.make_gfor:510: mfix.exe] Error 1

*** File mfix.exe NOT created.

What is the problem?

Thanks,
Mohsen

The 2013.1 version recommends gnu (gfortran) compiler above 4.3 but it may not work with the most recent ones. I was able to build in serial and DMP (running the make_mfix script) with gnu/6.5.0 and openmpi/1.10.7_gnu6.5.

1 Like

@jeff.dietiker
Thanks for your response. I am trying to run the case on the ComputeCanada cluster and it does not have the gcc/6.5.0. However, I tried the following combinations:
1- gcc/6.4.0 and openmpi/2.1.1
2- gcc/5.4.0 and openmpi/2.0.2
and I got this error:
Fatal Error: Cannot read module file ‘param.mod’ opened at (1), because it was created by a different version of GNU Fortran
compilation terminated.
make: *** [mfix_l.make_gfor:1079: …/OBJECT_FILES_OPT_DMP_GFOR/constant.mod] Error 1
\nPlease wait . . .
make -f mfix_l.make_gfor mfix.exe
mpif90 -c -I. -fconvert=‘big-endian’ -ffree-form -ffree-line-length-0 -I/cvmfs/soft.computecanada.ca/easybuild/software/2017/avx2/Compiler/gcc6.4/openmpi/2.1.1/include -I…/OBJECT_FILES_OPT_DMP_GFOR/ -O3 constant_mod.f -o …/OBJECT_FILES_OPT_DMP_GFOR/constant_mod.o -J…/OBJECT_FILES_OPT_DMP_GFOR/
constant_mod.f:28:10:

   Use param
      1

Fatal Error: Cannot read module file ‘param.mod’ opened at (1), because it was created by a different version of GNU Fortran
compilation terminated.
make: *** [mfix_l.make_gfor:1079: …/OBJECT_FILES_OPT_DMP_GFOR/constant.mod] Error 1

*** File mfix.exe NOT created.

and using the gcc/5.4.0 and openmpi/1.10.7, I got a lot of error on constant_mod.f(…). The last part of this error is:

constant_mod.f(107): error #6841: An automatic object must not appear in the specification part of a module. [R_P]
DOUBLE PRECISION r_p(DIM_M, DIM_M)
-----------------------^
constant_mod.f(131): error #6841: An automatic object must not appear in the specification part of a module. [C]
DOUBLE PRECISION C (DIMENSION_C)
-----------------------^
constant_mod.f(131): error #6279: A specification expression object must be a dummy argument, a COMMON block object, or an object accessible through host or use association. [DIMENSION_C]
DOUBLE PRECISION C (DIMENSION_C)
--------------------------^
constant_mod.f(134): error #6841: An automatic object must not appear in the specification part of a module. [C_NAME]
CHARACTER*20 C_NAME (DIMENSION_C)
-----------------------^
compilation aborted for constant_mod.f (code 1)
make: *** [mfix_l.make_gfor:1079: …/OBJECT_FILES_OPT_DMP_GFOR/constant.mod] Error 1

*** File mfix.exe NOT created.

I will also attach my Files and the modified subroutines. Do you have any suggestion?
Processing: oldversion.tar.xz…
oldversion.zip (70.7 KB)

Mohsen -

Whenever you see errors like

Cannot read module file ‘param.mod’ opened at (1), because it was created by a different version of GNU Fortran

you should do make clean to get rid of the .mod files.

The errors in your first post look like a mismatch between glibc and the compiler. Before worring about mfix see if you can compile and run a trivial Fortran program on your cluster.

– Charles

Folks are reporting the same problem with other software. It’s not a specific MFiX problem. You may need to get some help from your local systems people.

https://fluka-forum.web.cern.ch/t/error-installing-in-cluster/251/1

@cgw
Hi Chalres,
I was first able to compile my code in serial on the cluster but now as you mentioned I face some errors regarding the “param.mod”. I tried the gcc/4.8.5 and openmpi/1.8.8 and I got the :
gfortran -c -I. -fconvert=‘big-endian’ -ffree-form -ffree-line-length-0 -I -I…/OBJECT_FILES_OPT_GFOR/ -O3 constant_mod.f -o …/OBJECT_FILES_OPT_GFOR/constant_mod.o -J…/OBJECT_FILES_OPT_GFOR/
Warning: Nonexistent include directory “-I…/OBJECT_FILES_OPT_GFOR/”
constant_mod.f:28.10:

  Use param
      1

Fatal Error: File ‘param.mod’ opened at (1) is not a GNU Fortran module file
make: *** [mfix_l_not.make:1079: …/OBJECT_FILES_OPT_GFOR/constant.mod] Error 1

If I need to do the make clean, how is it possible to do that? Is there any way to find the files and delete them manually?
Thanks,
Mohsen

Use the -clean flag when invoking make_mfix. mkmfix is an alias that points to mfix/model/make_mfix

Below is from the 2013-1 readme file:

1 Like

Hi Jeff,
I am using the -clean flag first and I get this:

   MFIX: Multiphase Flow with Intephase eXchanges

                  mfix.netl.doe.gov

                    Version 2013-1

==============================================================
Creating the MFIX-executable mfix.exe

MFIX directory is /home/moz455/projects/def-spiteri/moz455/mfix2013/model

Cleaning files from previous compilation…
Grabbing object and module files directory path from compilation
Object and module files directory path:

Object file directory

exists, so deleting object, module files.

Done.

However, when I compile after cleaning I face the same error as before:
make -f mfix_l_not.make mfix.exe
gfortran -c -I. -fconvert=‘big-endian’ -ffree-form -ffree-line-length-0 -I -I…/OBJECT_FILES_OPT_GFOR/ -O3 constant_mod.f -o …/OBJECT_FILES_OPT_GFOR/constant_mod.o -J…/OBJECT_FILES_OPT_GFOR/
f951: Warning: Nonexistent include directory ‘-I…/OBJECT_FILES_OPT_GFOR/’ [-Wmissing-include-dirs]
constant_mod.f:28:10:

28 | Use param
| 1
Fatal Error: Cannot read module file ‘param.mod’ opened at (1), because it was created by a different version of GNU Fortran
compilation terminated.
make: *** [mfix_l_not.make:1079: …/OBJECT_FILES_OPT_GFOR/constant.mod] Error 1

*** File mfix.exe NOT created.

I am using GCC 9.3.0 and mpirun (Open MPI) 4.0.3. What is the problem?

Thanks,
Mohsen

  1. Try typing make clean as I suggested earlier. It looks like the -clean flag maybe doesn’t delete everything it should.

  2. If that fails, find . -name \*.o -o -name \*.mod -delete. Or just make a new build directory.

  3. Why is it necessary to use the 2013 version of MFiX?

– Charles

Hi Charles,
When the results of the current version of the MFiX is compared with some results of the 2013 version, it seems that the older results are better . It happened to us that a former member of our group has implemented some modifications in the 2013 version of the code. So we suspect that the modifications are the main reason of difference between results. Because of this, I was trying to run the case using that version and if everything was OK, I will apply those changes to the current version of the code and let you know about the results!
BTW, MFiX 2013 successfully compiled on ComputeCanada using gcc /9.3.0 and mpirun/4.3.0. The main problem is mentioned in the following. Thank you again @cgw.
#################################################################################
Only the MPI version was problematic, with the glibc issue. The problem comes from the MPIHOME variable in the $HOME/.../mfix2013/model/make_mfix build script. The build script uses this variable but never sets it. The expression -L $MPIHOME/lib64 therefore becomes -L /lib64, leading the compilers to try to link libraries from that directory. This causes the glibc conflict. (In Bash scripts, substituting a variable that is not set returns an empty string but does not raise an error.)

To correct this, you can simply set this variable in your environment before building MFiX, with: export MPIHOME=$EBROOTOPENMPI.

Alternatively, you can correct the MFiX build script to set MPIHOME to the correct value before the variable is used.

Hi Mohsenclick,
I wonder where " export MPIHOME=$EBROOTOPENMPI "needs to be typed? I typed the position on the graph, it didn’t work.