CMake Error at C:/Users/PS/.conda/envs/mfix-22.2.2/Library/share/cmake-3.31

hello everyone:
I installed the mfix-22.2.2 in anaconda-24.9.2 in win10 OS.
then, I test the tutorial case of “fluid_bed_dem_2d” with SMP, but error reported as below:

– Setting build type to ‘RelWithDebInfo’ as none was specified.
– MFIX build settings summary:
– Build type = RelWithDebInfo
– CMake version = 3.31.5
– Fortran compiler = gfortran
– Fortran flags =
– ENABLE_MPI = OFF
– ENABLE_OpenMP = 1
– ENABLE_CTEST = OFF
– ENABLE_COVERAGE = OFF
– The C compiler identification is GNU 5.3.0
– The Fortran compiler identification is unknown
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Check for working C compiler: C:/Users/PS/.conda/envs/mfix-22.2.2/Library/mingw-w64/bin/cc.exe - skipped
– Detecting C compile features
– Detecting C compile features - done
– Detecting Fortran compiler ABI info
– Detecting Fortran compiler ABI info - failed
– Check for working Fortran compiler: C:/Users/PS/.conda/envs/mfix-22.2.2/Library/mingw-w64/bin/gfortran.exe
– Check for working Fortran compiler: C:/Users/PS/.conda/envs/mfix-22.2.2/Library/mingw-w64/bin/gfortran.exe - broken
CMake Error at C:/Users/PS/.conda/envs/mfix-22.2.2/Library/share/cmake-3.31/Modules/CMakeTestFortranCompiler.cmake:59 (message):
The Fortran compiler

"C:/Users/PS/.conda/envs/mfix-22.2.2/Library/mingw-w64/bin/gfortran.exe"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: 'D:/sc/02-download/fluid_bed_dem_2d/build/CMakeFiles/CMakeScratch/TryCompile-9pdzdy'

Run Build Command(s): C:/Users/PS/.conda/envs/mfix-22.2.2/Library/bin/cmake.exe -E env VERBOSE=1 C:/Users/PS/.conda/envs/mfix-22.2.2/Library/mingw-w64/bin/mingw32-make.exe -f Makefile cmTC_9599d/fast
C:/Users/PS/.conda/envs/mfix-22.2.2/Library/mingw-w64/bin/mingw32-make.exe  -f CMakeFiles\cmTC_9599d.dir\build.make CMakeFiles/cmTC_9599d.dir/build
mingw32-make.exe[1]: Entering directory 'D:/sc/02-download/fluid_bed_dem_2d/build/CMakeFiles/CMakeScratch/TryCompile-9pdzdy'
Building Fortran object CMakeFiles/cmTC_9599d.dir/testFortranCompiler.f.obj
C:\Users\PS\.conda\envs\mfix-22.2.2\Library\mingw-w64\bin\gfortran.exe    -c D:\sc\02-download\fluid_bed_dem_2d\build\CMakeFiles\CMakeScratch\TryCompile-9pdzdy\testFortranCompiler.f -o CMakeFiles\cmTC_9599d.dir\testFortranCompiler.f.obj
<built-in>: internal compiler error: Segmentation fault
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://sourceforge.net/projects/msys2> for instructions.
CMakeFiles\cmTC_9599d.dir\build.make:79: recipe for target 'CMakeFiles/cmTC_9599d.dir/testFortranCompiler.f.obj' failed
mingw32-make.exe[1]: *** [CMakeFiles/cmTC_9599d.dir/testFortranCompiler.f.obj] Error 1
mingw32-make.exe[1]: Leaving directory 'D:/sc/02-download/fluid_bed_dem_2d/build/CMakeFiles/CMakeScratch/TryCompile-9pdzdy'
Makefile:133: recipe for target 'cmTC_9599d/fast' failed
mingw32-make.exe: *** [cmTC_9599d/fast] Error 2

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

– Configuring incomplete, errors occurred!

                 BUILD FAILED

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

then i tried to update the gcc and gfortran as below:
(mfix-22.2.2) C:\Users\PS>conda install -c conda-forge gcc gfortran
but, it fail:
Could not solve for environment specs
The following packages are incompatible
├─ gcc is installable and it requires
│ └─ gcc_impl_win-64 [13.2.0.* |13.3.0.* |14.1.0.* |14.2.0.* ], which requires
│ ├─ libgcc >=14.2.0 , which requires
│ │ └─ msys2-conda-epoch <0.0a0 , which can be installed;
│ └─ libgomp [>=13.2.0 |>=13.3.0 |>=14.1.0 ], which requires
│ └─ msys2-conda-epoch <0.0a0 , which can be installed;
├─ gfortran is installable and it requires
│ ├─ gcc [13.2.0.* |13.3.0.* |14.1.0.* ], which can be installed (as previously explained);
│ └─ gfortran_impl_win-64 14.2.0.* , which requires
│ └─ libgcc >=14.2.0 , which can be installed (as previously explained);
├─ mfix-solver is installable with the potential options
│ ├─ mfix-solver 18.1.5 would require
│ │ └─ python >=3.6,<3.7.0a0 , which can be installed;
│ ├─ mfix-solver [19.1.4|19.2.2|…|21.1.4] would require
│ │ └─ python >=3.7,<3.8.0a0 , which can be installed;
│ ├─ mfix-solver [21.2|21.3.2|21.4] would require
│ │ └─ python >=3.8,<3.9.0a0 , which can be installed;
│ ├─ mfix-solver 22.1.1 would require
│ │ └─ python >=3.9,<3.10.0a0 , which can be installed;
│ └─ mfix-solver [24.1|24.1.1|…|99.9.9] would require
│ └─ python >=3.11,<3.12.0a0 , which can be installed;
├─ mfix-solver [ |22.2.2 ] is not installable because it requires
│ └─ m2w64-toolchain, which requires
│ └─ msys2-conda-epoch [20160418 |>=20160418 ], which conflicts with any installable versions previously reported;
└─ pin-1 is not installable because it requires
└─ python 3.10.* , which conflicts with any installable versions previously reported.
what should i do???
bug report file is uploaded below:
fluid_bed_dem_2d_2025-02-21T115628.995729.zip (148.3 KB)

Does MFiX 24.4.1 work?

yes,mfix-24.4 works,
but, due to some reasons, i have to use the mfix-22.2.2.
Is there any methods can solve the problem?

can you help me with this issue, cgw?

I would like to help but it’s not clear what the problem is. I see that you are on the Windows platform. When compiling on Windows, we actually do not use the gfortran and gcc compiler packages, but the compilers from the m2w64 ports - the packages are called m2w64-gcc and m2w64-gcc-fortran. These are compiler version 5.3.0, as you can see in the build output, and have not been updated in a very long time. This did not change between mfix-22.2.2 and mfix-24.4.1 so it’s not easy to see why you are having this Internal compiler error with the 22.2 version but not 24.4.

We were stuck using this version because the gcc and gfortran packages are not supported on Windows - or at least this was the case until recently. I see there is now a gfortran_impl_win-64 14.2.0 which is very new, I did not know about this. This is very interesting. For a long time Windows was stuck using older gcc/gfortran but it looks like this is no longer the case. We have not yet attempted to compile MFiX with this compiler version and I have no idea if it will work. But it would be good to try. This will take a while to set up and test.

Update: I installed mfix 22.2.2 and I am able to reproduce the “Internal compiler error” problem. I will let you know if I find a fix for this.

Thanks for reporting this, and thanks for your patience.

– Charles

@songchao1
I have found a workaround for this problem.

Apparently there’s an incompatibility between the git package and the m2w64-gcc-gfortran compiler we use on Windows.

Do the following:

C> mamba activate mfix-22.2
C> mamba remove --force git
C> mamba install m2-git

This will remove the conflicting git package and replace it with a different, Windows implementation of git which does not have this conflict.

Be sure to include the --force flag on the remove command, otherwise all packages will be deleted!

Please let us know if this works for you.

– Charles

3Q,this solve my problem!!!

thank you cgw,
I removed the git package successfully, but the command " install m2-git" failed.

(mfix-22.2.2) C:\Users\PS>conda install m2-git
Channels:

CondaHTTPError: HTTP 401 UNAUTHORIZED for url https://mfix.netl.doe.gov/s3/79ddd23a/c20c54fa0f87b4298a9cf55fc2ac4ae6//conda/dist/win-64/repodata.json
Elapsed: 00:00.586718

The credentials you have provided for this URL are invalid.

You will need to modify your conda configuration to proceed.
Use conda config --show to view your configuration’s current state.
Further configuration help can be found at https://conda.io/docs/config.html.

Try with mamba install -c conda-forge m2-git instead of conda install m2-git