An error about building solver

Hello, rencently I modified the code of CO2 absorption case, and the following error occurred during building solver. I am a beginner, and there may be some problems with the modified code, but it seems that this error appears in the source code, while I have not modified the source code, may I ask what the possible reason is? Thank you very much!

Running build_mfixsolver -j -DCMAKE_Fortran_COMPILER=gfortran
Building custom solver for 4.21.mfx
Running cmake command:
cmake -DCMAKE_Fortran_COMPILER=gfortran -DENABLE_PYMFIX=ON -DPython3_EXECUTABLE=C:\Users\DELL\anaconda3\envs\mfix-21.3.2\python.exe -DPython3_ROOT_DIR=C:\Users\DELL\anaconda3\envs\mfix-21.3.2 -G MinGW Makefiles -DCMAKE_INSTALL_PREFIX=C:\Users\DELL\Desktop\case2022\4.21 -DUDF_DIR=C:\Users\DELL\Desktop\case2022\4.21 -DVERSION=21.3.2 C:\Users\DELL\anaconda3\envs\mfix-21.3.2\share\mfix\src

-- Setting build type to 'RelWithDebInfo' as none was specified.
-- MFIX build settings summary: 
--    Build type        = RelWithDebInfo
--    CMake version     = 3.21.3
--    Fortran compiler  = gfortran
--    Fortran flags     = 
--    ENABLE_MPI        = OFF
--    ENABLE_OpenMP     = OFF
--    ENABLE_CTEST      = OFF
--    ENABLE_COVERAGE   = OFF
-- The C compiler identification is GNU 5.3.0
-- The Fortran compiler identification is GNU 5.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Users/DELL/anaconda3/envs/mfix-21.3.2/Library/mingw-w64/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: C:/Users/DELL/anaconda3/envs/mfix-21.3.2/Library/mingw-w64/bin/gfortran.exe - skipped
-- Checking whether C:/Users/DELL/anaconda3/envs/mfix-21.3.2/Library/mingw-w64/bin/gfortran.exe supports Fortran 90
-- Checking whether C:/Users/DELL/anaconda3/envs/mfix-21.3.2/Library/mingw-w64/bin/gfortran.exe supports Fortran 90 - yes
-- Found Git: C:/Users/DELL/anaconda3/envs/mfix-21.3.2/Library/bin/git.exe (found version "2.34.1.windows.1") 
-- Found PythonInterp: C:/Users/DELL/anaconda3/envs/mfix-21.3.2/python.exe (found version "3.8.12") 
-- 
Found UDFs:
C:/Users/DELL/Desktop/case2022/4.21/usr0.f;C:/Users/DELL/Desktop/case2022/4.21/usr1.f;C:/Users/DELL/Desktop/case2022/4.21/usr2.f;C:/Users/DELL/Desktop/case2022/4.21/usr_drag.f;C:/Users/DELL/Desktop/case2022/4.21/usr_init_namelist.f;C:/Users/DELL/Desktop/case2022/4.21/usr_mod.f;C:/Users/DELL/Desktop/case2022/4.21/usr_properties.f;C:/Users/DELL/Desktop/case2022/4.21/usr_rates.f;C:/Users/DELL/Desktop/case2022/4.21/usr_sources.f;C:/Users/DELL/Desktop/case2022/4.21/write_usr1.f;C:/Users/DELL/anaconda3/envs/mfix-21.3.2/share/mfix/src/model/usr_read_namelist.f;C:/Users/DELL/Desktop/case2022/4.21/species.inc
-- Found Python3: C:\Users\DELL\anaconda3\envs\mfix-21.3.2\python.exe (found version "3.8.12") found components: Interpreter NumPy Development.Module 
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/DELL/Desktop/case2022/4.21/build
Build command:

cmake --build . --target install -j 4

Scanning dependencies of target mfixcore
[ 94%] Built target mfixcore
[ 95%] Generating species.inc
Processing chemical reaction data from 4.21.mfx... 
done
Scanning dependencies of target udfs
[ 95%] Building Fortran object CMakeFiles/udfs.dir/C_/Users/DELL/Desktop/case2022/4.21/usr2.f.obj
[ 95%] Building Fortran object CMakeFiles/udfs.dir/C_/Users/DELL/Desktop/case2022/4.21/usr_properties.f.obj
[ 95%] Building Fortran object CMakeFiles/udfs.dir/C_/Users/DELL/Desktop/case2022/4.21/usr_rates.f.obj
[ 97%] Built target udfs
[ 98%] Generating f2py
[ 98%] Linking Fortran executable mfixsolver.exe
{'before': '', 'this': 'use', 'after': ', intrinsic  :: iso_c_binding, only: c_char, c_int, c_size_t, c_null_char '}
{'before': '', 'this': 'use', 'after': ', intrinsic  :: iso_c_binding, only: c_char, c_int, c_size_t '}
{'before': '', 'this': 'use', 'after': ', intrinsic:: iso_c_binding, only: c_int '}
rmbadname1: Replacing "index" with "index_bn".
rmbadname1: Replacing "index" with "index_bn".
rmbadname1: Replacing "index" with "index_bn".
rmbadname1: Replacing "index" with "index_bn".
rmbadname1: Replacing "index" with "index_bn".
rmbadname1: Replacing "index" with "index_bn".
rmbadname1: Replacing "index" with "index_bn".
rmbadname1: Replacing "index" with "index_bn".
analyzevars: charselector={'len': '1', 'kind': 'c_char'} unhandled.
analyzevars: charselector={'len': '1', 'kind': 'c_char'} unhandled.
analyzevars: charselector={'len': '80'} unhandled.
get_useparameters: mapping for {'only': 1, 'map': {'start_log': 'start_log', 'end_log': 'end_log'}} not impl.
get_useparameters: mapping for {'only': 1, 'map': {'get_run_id': 'get_run_id'}} not impl.
get_useparameters: mapping for {'only': 1, 'map': {'dim_n': 'dim_n', 'dim_m': 'dim_m'}} not impl.
get_useparameters: mapping for {'only': 1, 'map': {'dim_n': 'dim_n', 'dim_m': 'dim_m'}} not impl.get_useparameters: mapping for {'only': 1, 'map': {'dim_n': 'dim_n', 'dim_m': 'dim_m'}} not impl.get_useparameters: mapping for {'only': 1, 'map': {'dim_n': 'dim_n', 'dim_m': 'dim_m'}} not impl.
get_useparameters: mapping for {'only': 1, 'map': {'dim_n': 'dim_n', 'dim_m': 'dim_m'}} not impl.get_useparameters: mapping for {'only': 1, 'map': {'dim_n': 'dim_n', 'dim_m': 'dim_m'}} not impl.
get_useparameters: mapping for {'only': 1, 'map': {'dim_n': 'dim_n', 'dim_m': 'dim_m'}} not impl.get_useparameters: mapping for {'only': 1, 'map': {'dim_m': 'dim_m', 'dim_eqs': 'dim_eqs'}} not impl.
analyzevars: charselector={'len': '3'} unhandled.
get_useparameters: mapping for {'only': 1, 'map': {'dim_m': 'dim_m', 'dim_eqs': 'dim_eqs'}} not impl.get_useparameters: mapping for {'only': 1, 'map': {'time': 'time', 'tstop': 'tstop'}} not impl.get_useparameters: mapping for {'only': 1, 'map': {'time': 'time', 'tstop': 'tstop'}} not impl.
get_useparameters: mapping for {'only': 1, 'map': {'time': 'time', 'tstop': 'tstop'}} not impl.get_useparameters: mapping for {'only': 1, 'map': {'time': 'time', 'tstop': 'tstop'}} not impl.
model/libmfixcore.a(usr_properties.f.obj): In function `usr_prop_rog_':
C:/Users/DELL/anaconda3/envs/mfix-21.3.2/share/mfix/src/model/usr_properties.f:9: multiple definition of `usr_prop_rog_'
CMakeFiles\mfixsolver.dir/objects.a(usr_properties.f.obj):C:/Users/DELL/Desktop/case2022/4.21/usr_properties.f:9: first defined here
model/libmfixcore.a(usr_properties.f.obj): In function `usr_prop_cpg_':
C:/Users/DELL/anaconda3/envs/mfix-21.3.2/share/mfix/src/model/usr_properties.f:82: multiple definition of `usr_prop_cpg_'
CMakeFiles\mfixsolver.dir/objects.a(usr_properties.f.obj):C:/Users/DELL/Desktop/case2022/4.21/usr_properties.f:83: first defined here
model/libmfixcore.a(usr_properties.f.obj): In function `usr_prop_mug_':
C:/Users/DELL/anaconda3/envs/mfix-21.3.2/share/mfix/src/model/usr_properties.f:142: multiple definition of `usr_prop_mug_'
CMakeFiles\mfixsolver.dir/objects.a(usr_properties.f.obj):C:/Users/DELL/Desktop/case2022/4.21/usr_properties.f:142: first defined here
model/libmfixcore.a(usr_properties.f.obj): In function `usr_prop_kg_':
C:/Users/DELL/anaconda3/envs/mfix-21.3.2/share/mfix/src/model/usr_properties.f:191: multiple definition of `usr_prop_kg_'
CMakeFiles\mfixsolver.dir/objects.a(usr_properties.f.obj):C:/Users/DELL/Desktop/case2022/4.21/usr_properties.f:190: first defined here
model/libmfixcore.a(usr_properties.f.obj): In function `usr_prop_difg_':
C:/Users/DELL/anaconda3/envs/mfix-21.3.2/share/mfix/src/model/usr_properties.f:241: multiple definition of `usr_prop_difg_'
CMakeFiles\mfixsolver.dir/objects.a(usr_properties.f.obj):C:/Users/DELL/Desktop/case2022/4.21/usr_properties.f:238: first defined here
model/libmfixcore.a(usr_properties.f.obj): In function `usr_prop_ros_':
C:/Users/DELL/anaconda3/envs/mfix-21.3.2/share/mfix/src/model/usr_properties.f:290: multiple definition of `usr_prop_ros_'
CMakeFiles\mfixsolver.dir/objects.a(usr_properties.f.obj):C:/Users/DELL/Desktop/case2022/4.21/usr_properties.f:288: first defined here
model/libmfixcore.a(usr_properties.f.obj): In function `usr_prop_cps_':
C:/Users/DELL/anaconda3/envs/mfix-21.3.2/share/mfix/src/model/usr_properties.f:341: multiple definition of `usr_prop_cps_'
CMakeFiles\mfixsolver.dir/objects.a(usr_properties.f.obj):C:/Users/DELL/Desktop/case2022/4.21/usr_properties.f:414: first defined here
model/libmfixcore.a(usr_properties.f.obj): In function `usr_prop_mus_':
C:/Users/DELL/anaconda3/envs/mfix-21.3.2/share/mfix/src/model/usr_properties.f:403: multiple definition of `usr_prop_mus_'
CMakeFiles\mfixsolver.dir/objects.a(usr_properties.f.obj):C:/Users/DELL/Desktop/case2022/4.21/usr_properties.f:478: first defined here
model/libmfixcore.a(usr_properties.f.obj): In function `usr_prop_difs_':
C:/Users/DELL/anaconda3/envs/mfix-21.3.2/share/mfix/src/model/usr_properties.f:507: multiple definition of `usr_prop_difs_'
CMakeFiles\mfixsolver.dir/objects.a(usr_properties.f.obj):C:/Users/DELL/Desktop/case2022/4.21/usr_properties.f:621: first defined here
model/libmfixcore.a(usr_properties.f.obj): In function `usr_prop_gama_':
C:/Users/DELL/anaconda3/envs/mfix-21.3.2/share/mfix/src/model/usr_properties.f:565: multiple definition of `usr_prop_gama_'
CMakeFiles\mfixsolver.dir/objects.a(usr_properties.f.obj):C:/Users/DELL/Desktop/case2022/4.21/usr_properties.f:717: first defined here
model/libmfixcore.a(usr_properties.f.obj): In function `usr_prop_fss_':
C:/Users/DELL/anaconda3/envs/mfix-21.3.2/share/mfix/src/model/usr_properties.f:628: multiple definition of `usr_prop_fss_'
CMakeFiles\mfixsolver.dir/objects.a(usr_properties.f.obj):C:/Users/DELL/Desktop/case2022/4.21/usr_properties.f:993: first defined here
model/libmfixcore.a(usr_properties.f.obj): In function `usr_properties_':
C:/Users/DELL/anaconda3/envs/mfix-21.3.2/share/mfix/src/model/usr_properties.f:721: multiple definition of `usr_properties_'
CMakeFiles\mfixsolver.dir/objects.a(usr_properties.f.obj):C:/Users/DELL/Desktop/case2022/4.21/usr_properties.f:1229: first defined here
CMakeFiles\mfixsolver.dir/objects.a(usr1.f.obj): In function `usr1_':
C:/Users/DELL/Desktop
/case2022/4.21/usr1.f:60:0: undefined reference to `chem_solve_main_'
C:/Users/DELL/Desktop/case2022/4.21/usr1.f:63: undefined reference to `chem_solve_main_'
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe[2]: *** [mfixsolver.exe] Error 1
mingw32-make.exe[1]: *** [CMakeFiles/mfixsolver.dir/all] Error 2
mingw32-make.exe[1]: *** Waiting for unfinished jobs....
getctype: "integer(kind=c_int)" is mapped to C "int" (to override define dict(integer = dict(c_int="<C typespec>")) in C:\Users\DELL\Desktop\case2022\4.21\build/.f2py_f2cmap file).
getctype: "integer(kind=c_int)" is mapped to C "int" (to override define dict(integer = dict(c_int="<C typespec>")) in C:\Users\DELL\Desktop\case2022\4.21\build/.f2py_f2cmap file).
getctype: "integer(kind=c_int)" is mapped to C "int" (to override define dict(integer = dict(c_int="<C typespec>")) in C:\Users\DELL\Desktop\case2022\4.21\build/.f2py_f2cmap file).
CMakeFiles\mfixsolver.dir\build.make:104: recipe for target 'mfixsolver.exe' failed
CMakeFiles\Makefile2:128: recipe for target 'CMakeFiles/mfixsolver.dir/all' failed
Skipping interface unknown_interface
Skipping interface unknown_interface
Scanning dependencies of target mfixsolver_ext
Consolidate compiler generated dependencies of target mfixsolver_ext
[ 98%] Building C object CMakeFiles/mfixsolver_ext.dir/f2pywrappers/mfixsolvermodule.c.obj
[ 98%] Building Fortran object CMakeFiles/mfixsolver_ext.dir/f2pywrappers/mfixsolver-f2pywrappers.f.obj
[ 98%] Building Fortran object CMakeFiles/mfixsolver_ext.dir/f2pywrappers/mfixsolver-f2pywrappers2.f90.obj
In file included from C:/Users/DELL/anaconda3/envs/mfix-21.3.2/Lib/site-packages/numpy/core/include/numpy/ndarraytypes.h:1822:0,
                 from C:/Users/DELL/anaconda3/envs/mfix-21.3.2/Lib/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                 from C:/Users/DELL/anaconda3/envs/mfix-21.3.2/Lib/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                 from C:/Users/DELL/anaconda3/envs/mfix-21.3.2/Lib/site-packages/numpy/f2py/src/fortranobject.h:13,
                 from C:\Users\DELL\Desktop\case2022\4.21\build\f2pywrappers\mfixsolvermodule.c:16:
C:/Users/DELL/anaconda3/envs/mfix-21.3.2/Lib/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:14:9: note: #pragma message: C:/Users/DELL/anaconda3/envs/mfix-21.3.2/Lib/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h(14) : Warning Msg: Using deprecated NumPy API, disable it with #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
 #pragma message(_WARN___LOC__"Using deprecated NumPy API, disable it with " \
         ^
[ 98%] Linking Fortran shared library mfixsolver.cp38-win_amd64.pyd
model/libmfixcore.a(usr_properties.f.obj): In function `usr_prop_rog_':
C:/Users/DELL/anaconda3/envs/mfix-21.3.2/share/mfix/src/model/usr_properties.f:9: multiple definition of `usr_prop_rog_'
CMakeFiles\mfixsolver_ext.dir/objects.a(usr_properties.f.obj):C:/Users/DELL/Desktop/case2022/4.21/usr_properties.f:9: first defined here
model/libmfixcore.a(usr_properties.f.obj): In function `usr_prop_cpg_':
C:/Users/DELL/anaconda3/envs/mfix-21.3.2/share/mfix/src/model/usr_properties.f:82: multiple definition of `usr_prop_cpg_'
CMakeFiles\mfixsolver_ext.dir/objects.a(usr_properties.f.obj):C:/Users/DELL/Desktop/case2022/4.21/usr_properties.f:83: first defined here
model/libmfixcore.a(usr_properties.f.obj): In function `usr_prop_mug_':
C:/Users/DELL/anaconda3/envs/mfix-21.3.2/share/mfix/src/model/usr_properties.f:142: multiple definition of `usr_prop_mug_'
CMakeFiles\mfixsolver_ext.dir/objects.a(usr_properties.f.obj):C:/Users/DELL/Desktop/case2022/4.21/usr_properties.f:142: first defined here
model/libmfixcore.a(usr_properties.f.obj): In function `usr_prop_kg_':
C:/Users/DELL/anaconda3/envs/mfix-21.3.2/share/mfix/src/model/usr_properties.f:191: multiple definition of `usr_prop_kg_'
CMakeFiles\mfixsolver_ext.dir/objects.a(usr_properties.f.obj):C:/Users/DELL/Desktop/case2022/4.21/usr_properties.f:190: first defined here
model/libmfixcore.a(usr_properties.f.obj): In function `usr_prop_difg_':
C:/Users/DELL/anaconda3/envs/mfix-21.3.2/share/mfix/src/model/usr_properties.f:241: multiple definition of `usr_prop_difg_'
CMakeFiles\mfixsolver_ext.dir/objects.a(usr_properties.f.obj):C:/Users/DELL/Desktop/case2022/4.21/usr_properties.f:238: first defined here
model/libmfixcore.a(usr_properties.f.obj): In function `usr_prop_ros_':
C:/Users/DELL/anaconda3/envs/mfix-21.3.2/share/mfix/src/model/usr_properties.f:290: multiple definition of `usr_prop_ros_'
CMakeFiles\mfixsolver_ext.dir/objects.a(usr_properties.f.obj):C:/Users/DELL/Desktop/case2022/4.21/usr_properties.f:288: first defined here
model/libmfixcore.a(usr_properties.f.obj): In function `usr_prop_cps_':
C:/Users/DELL/anaconda3/envs/mfix-21.3.2/share/mfix/src/model/usr_properties.f:341: multiple definition of `usr_prop_cps_'
CMakeFiles\mfixsolver_ext.dir/objects.a(usr_properties.f.obj):C:/Users/DELL/Desktop/case2022/4.21/usr_properties.f:414: first defined here
model/libmfixcore.a(usr_properties.f.obj): In function `usr_prop_mus_':
C:/Users/DELL/anaconda3/envs/mfix-21.3.2/share/mfix/src/model/usr_properties.f:403: multiple definition of `usr_prop_mus_'
CMakeFiles\mfixsolver_ext.dir/objects.a(usr_properties.f.obj):C:/Users/DELL/Desktop/case2022/4.21/usr_properties.f:478: first defined here
model/libmfixcore.a(usr_properties.f.obj): In function `usr_prop_difs_':
C:/Users/DELL/anaconda3/envs/mfix-21.3.2/share/mfix/src/model/usr_properties.f:507: multiple definition of `usr_prop_difs_'
CMakeFiles\mfixsolver_ext.dir/objects.a(usr_properties.f.obj):C:/Users/DELL/Desktop/case2022/4.21/usr_properties.f:621: first defined here
model/libmfixcore.a(usr_properties.f.obj): In function `usr_prop_gama_':
C:/Users/DELL/anaconda3/envs/mfix-21.3.2/share/mfix/src/model/usr_properties.f:565: multiple definition of `usr_prop_gama_'
CMakeFiles\mfixsolver_ext.dir/objects.a(usr_properties.f.obj):C:/Users/DELL/Desktop/case2022/4.21/usr_properties.f:717: first defined here
model/libmfixcore.a(usr_properties.f.obj): In function `usr_prop_fss_':
C:/Users/DELL/anaconda3/envs/mfix-21.3.2/share/mfix/src/model/usr_properties.f:628: multiple definition of `usr_prop_fss_'
CMakeFiles\mfixsolver_ext.dir/objects.a(usr_properties.f.obj):C:/Users/DELL/Desktop/case2022/4.21/usr_properties.f:993: first defined here
model/libmfixcore.a(usr_properties.f.obj): In function `usr_properties_':
C:/Users/DELL/anaconda3/envs/mfix-21.3.2/share/mfix/src/model/usr_properties.f:721: multiple definition of `usr_properties_'
CMakeFiles\mfixsolver_ext.dir/objects.a(usr_properties.f.obj):C:/Users/DELL/Desktop/case2022/4.21/usr_properties.f:1229: first defined here
CMakeFiles\mfixsolver_ext.dir/objects.a(usr1.f.obj): In function `usr1_':
C:/Users/DELL/Desktop/case2022/4.21/usr1.f:60: undefined reference to `chem_solve_main_'
C:/Users/DELL/Desktop/case2022/4.21/usr1.f:63: undefined reference to `chem_solve_main_'
collect2.exe: error: ld returned 1 exit status
CMakeFiles\mfixsolver_ext.dir\build.make:357: recipe for target 'mfixsolver.cp38-win_amd64.pyd' failed
CMakeFiles\Makefile2:155: recipe for target 'CMakeFiles/mfixsolver_ext.dir/all' failed
Makefile:134: recipe for target 'all' failed
==========================================================================

                     BUILD FAILED
==========================================================================
mingw32-make.exe[2]: *** [mfixsolver.cp38-win_amd64.pyd] Error 1
mingw32-make.exe[1]: *** [CMakeFiles/mfixsolver_ext.dir/all] Error 2
mingw32-make.exe: *** [all] Error 2

Hi Chen. Your question is not clear to me. First you said you modified the code, then you said you did not modify it.

Looking at the error messages:

/case2022/4.21/usr1.f: undefined reference to chem_solve_main_

There is no function chem_solve in MFiX, I don’t know where this is coming from.

There are also some warnings about symbols being multiply-defined.

Clean up any .f files in the project directory that don’t belong there, and do a ‘make clean’ (click the “Clean” button in the build popup), and try again.

As always, please attach your project when seeking help. Go to the main menu and click “Submit bug report”, this will create a .zip file that contains everything we need.

Thanks,

– Charles

4.21.zip (214.1 KB)
Hi Charles,Thanks for your help. I modified the code of case without modifying the source code,but the reported problem appears to be with the source code.“There is no function ‘chem_solve’ in MFiX” appeared because I did not remove the function completely, now I have removed the unnecessary file .