Strange build error in mfix 21.4

When I build the attached project by mfix 21.4 in unbuntu 16.04, the following error emerges. But if I build the same project by mfix 21.3 in the same computer, it’s OK. By the way, the attached project can be build successfully in another windows computer.
I have tried to input ‘-std=c99’ in compiler flags, but it does not work. How can I fix the problem?

erosion_2022-06-15T205927.356786.zip (1.1 MB)

Scanning dependencies of target mfixsolver_ext
Consolidate compiler generated dependencies of target mfixsolver_ext
[ 97%] Building Fortran object CMakeFiles/mfixsolver_ext.dir/pymfix/compar_mod.f90.o
[ 98%] Building Fortran object CMakeFiles/mfixsolver_ext.dir/pymfix/param_mod.f90.o
[ 98%] Building Fortran object CMakeFiles/mfixsolver_ext.dir/pymfix/machine_mod.f90.o
[ 99%] Building C object CMakeFiles/mfixsolver_ext.dir/f2pywrappers/mfixsolvermodule.c.o
[ 99%] Building Fortran object CMakeFiles/mfixsolver_ext.dir/f2pywrappers/mfixsolver-f2pywrappers.f.o
[ 99%] Building C object CMakeFiles/mfixsolver_ext.dir/home/liu/anaconda3/envs/mfix-21.4/lib/python3.8/site-packages/numpy/f2py/src/fortranobject.c.o
[ 99%] Building Fortran object CMakeFiles/mfixsolver_ext.dir/pymfix/parallel_mpi_mod.f90.o
[ 99%] Building Fortran object CMakeFiles/mfixsolver_ext.dir/pymfix/exit.f90.o
[ 99%] Building Fortran object CMakeFiles/mfixsolver_ext.dir/pymfix/run_mod.f90.o
[100%] Building Fortran object CMakeFiles/mfixsolver_ext.dir/pymfix/residual_pub_mod.f90.o
CMakeFiles/mfixsolver_ext.dir/build.make:268: recipe for target 'CMakeFiles/mfixsolver_ext.dir/home/liu/anaconda3/envs/mfix-21.4/lib/python3.8/site-packages/numpy/f2py/src/fortranobject.c.o' failed
CMakeFiles/Makefile2:156: recipe for target 'CMakeFiles/mfixsolver_ext.dir/all' failed
Makefile:135: recipe for target 'all' failed
==========================================================================
                     BUILD FAILED
==========================================================================
/home/liu/anaconda3/envs/mfix-21.4/lib/python3.8/site-packages/numpy/f2py/src/fortranobject.c: In function find_first_negative_dimension:
/home/liu/anaconda3/envs/mfix-21.4/lib/python3.8/site-packages/numpy/f2py/src/fortranobject.c:707:5: error: for loop initial declarations are only allowed in C99 or C11 mode
     for (int i = 0; i < rank; ++i) {
     ^
/home/liu/anaconda3/envs/mfix-21.4/lib/python3.8/site-packages/numpy/f2py/src/fortranobject.c:707:5: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
make[2]: *** [CMakeFiles/mfixsolver_ext.dir/home/liu/anaconda3/envs/mfix-21.4/lib/python3.8/site-packages/numpy/f2py/src/fortranobject.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/mfixsolver_ext.dir/all] Error 2
make: *** [all] Error 2
1 Like

You can change the code in /home/liu/anaconda3/envs/mfix-21.4/lib/python3.8/site-packages/numpy/f2py/src/fortranobject.c:707
图片1