cmake MPEG4环境中的链接错误:在ElmerFEM项目中找不到-ldl

wfveoks0  于 12个月前  发布在  其他
关注(0)|答案(1)|浏览(118)

我正在Windows上的MPEG4环境中编译ElmerFEM项目,在构建过程中遇到链接器错误。具体来说,链接Fortran共享库(msys-elmersolver.dll)时发生错误。错误消息如下:

[ 56%] Linking Fortran shared library msys-elmersolver.dll
cd "/c/Users/foo/OneDrive - bar/Desktop/Elmer/elmerfem/build/fem/src" && /usr/bin/cmake.exe -E cmake_link_script CMakeFiles/elmersolver.dir/link.txt --verbose=1
/c/tools/msys64/mingw64/bin/gfortran.exe  -fallow-argument-mismatch -O2 -g -DNDEBUG -shared -Wl,--enable-auto-import -o msys-elmersolver.dll -Wl,--out-implib,libelmersolver.dll.a -Wl,--major-image-version,0,--minor-image-version,0 CMakeFiles/elmersolver.dir/AddrFunc.o CMakeFiles/elmersolver.dir/NavierStokes.o CMakeFiles/elmersolver.dir/NavierStokesGeneral.o CMakeFiles/elmersolver.dir/NavierStokesCylindrical.o CMakeFiles/elmersolver.dir/Lists.o CMakeFiles/elmersolver.dir/DiffuseConvectiveAnisotropic.o CMakeFiles/elmersolver.dir/LoadMod.o CMakeFiles/elmersolver.dir/DiffuseConvectiveGeneralAnisotropic.o CMakeFiles/elmersolver.dir/PElementMaps.o CMakeFiles/elmersolver.dir/PElementBase.o CMakeFiles/elmersolver.dir/ElementDescription.o CMakeFiles/elmersolver.dir/Integration.o CMakeFiles/elmersolver.dir/ListMatrixArray.o CMakeFiles/elmersolver.dir/ModelDescription.o CMakeFiles/elmersolver.dir/GeneralUtils.o CMakeFiles/elmersolver.dir/Stress.o CMakeFiles/elmersolver.dir/StressGeneral.o CMakeFiles/elmersolver.dir/LinearAlgebra.o CMakeFiles/elmersolver.dir/CoordinateSystems.o CMakeFiles/elmersolver.dir/ListMatrix.o CMakeFiles/elmersolver.dir/CRSMatrix.o CMakeFiles/elmersolver.dir/BandMatrix.o CMakeFiles/elmersolver.dir/BandwidthOptimize.o CMakeFiles/elmersolver.dir/BlockSolve.o CMakeFiles/elmersolver.dir/MaterialModels.o CMakeFiles/elmersolver.dir/DirectSolve.o CMakeFiles/elmersolver.dir/IterSolve.o CMakeFiles/elmersolver.dir/IterativeMethods.o CMakeFiles/elmersolver.dir/TimeIntegrate.o CMakeFiles/elmersolver.dir/Types.o CMakeFiles/elmersolver.dir/SolveBand.o CMakeFiles/elmersolver.dir/ElementUtils.o CMakeFiles/elmersolver.dir/Radiation.o CMakeFiles/elmersolver.dir/fft.o CMakeFiles/elmersolver.dir/Load.o CMakeFiles/elmersolver.dir/Differentials.o CMakeFiles/elmersolver.dir/FreeSurface.o CMakeFiles/elmersolver.dir/Walls.o CMakeFiles/elmersolver.dir/SolverUtils.o CMakeFiles/elmersolver.dir/SolveSBand.o CMakeFiles/elmersolver.dir/CPUTime.o CMakeFiles/elmersolver.dir/Interpolation.o CMakeFiles/elmersolver.dir/MainUtils.o CMakeFiles/elmersolver.dir/Adaptive.o CMakeFiles/elmersolver.dir/EigenSolve.o CMakeFiles/elmersolver.dir/HashTable.o CMakeFiles/elmersolver.dir/MeshUtils.o CMakeFiles/elmersolver.dir/SaveUtils.o CMakeFiles/elmersolver.dir/SParIterGlobals.o CMakeFiles/elmersolver.dir/SParIterComm.o CMakeFiles/elmersolver.dir/SParIterPrecond.o CMakeFiles/elmersolver.dir/SParIterSolver.o CMakeFiles/elmersolver.dir/Messages.o CMakeFiles/elmersolver.dir/Multigrid.o CMakeFiles/elmersolver.dir/Smoothers.o CMakeFiles/elmersolver.dir/ClusteringMethods.o CMakeFiles/elmersolver.dir/ParallelUtils.o CMakeFiles/elmersolver.dir/ParallelEigenSolve.o CMakeFiles/elmersolver.dir/solve_cmplx.o CMakeFiles/elmersolver.dir/solve_real.o CMakeFiles/elmersolver.dir/MGPrec.o CMakeFiles/elmersolver.dir/DefUtils.o CMakeFiles/elmersolver.dir/MeshPartition.o CMakeFiles/elmersolver.dir/MeshRemeshing.o CMakeFiles/elmersolver.dir/RadiationFactors.o CMakeFiles/elmersolver.dir/f_stubs.o CMakeFiles/elmersolver.dir/ExchangeCorrelations.o CMakeFiles/elmersolver.dir/SolveHypre.o CMakeFiles/elmersolver.dir/amgx.o CMakeFiles/elmersolver.dir/SolverActivate_x.o CMakeFiles/elmersolver.dir/SolveTrilinos.o CMakeFiles/elmersolver.dir/SolveSuperLU.o CMakeFiles/elmersolver.dir/umf4_f77wrapper.o CMakeFiles/elmersolver.dir/VankaCreate.o CMakeFiles/elmersolver.dir/ParticleUtils.o CMakeFiles/elmersolver.dir/Feti.o CMakeFiles/elmersolver.dir/cholmod.o CMakeFiles/elmersolver.dir/InterpolateMeshToMesh.o CMakeFiles/elmersolver.dir/InterpVarToVar.o CMakeFiles/elmersolver.dir/LinearForms.o CMakeFiles/elmersolver.dir/H1Basis.o CMakeFiles/elmersolver.dir/CircuitUtils.o CMakeFiles/elmersolver.dir/BackwardError.o CMakeFiles/elmersolver.dir/ElmerSolver.o CMakeFiles/elmersolver.dir/MagnetoDynamicsUtils.o CMakeFiles/elmersolver.dir/ComponentUtils.o CMakeFiles/elmersolver.dir/ZirkaHysteresis.o CMakeFiles/elmersolver.dir/SolidMechanicsUtils.o CMakeFiles/elmersolver.dir/MatrixAssembly.o CMakeFiles/elmersolver.dir/OptimizationUtils.o CMakeFiles/elmersolver.dir/MeshGenerate.o CMakeFiles/elmersolver.dir/Lua.o   -L"/c/Users/foo/OneDrive - bar/Desktop/Elmer/elmerfem/build/fem/src"  -L"/c/Users/foo/OneDrive - bar/Desktop/Elmer/elmerfem/build/matc/src"  -L"/c/Users/foo/OneDrive - bar/Desktop/Elmer/elmerfem/build/umfpack/src/umfpack"  -L"/c/Users/foo/OneDrive - bar/Desktop/Elmer/elmerfem/build/umfpack/src/amd"  -L"/c/Users/foo/OneDrive - bar/Desktop/Elmer/elmerfem/build/fhutiter/src"  -L"/c/Users/foo/OneDrive - bar/Desktop/Elmer/elmerfem/build/fem/src/binio"  -L"/c/Users/foo/OneDrive - bar/Desktop/Elmer/elmerfem/build/mathlibs/src/arpack"  libmpi_stubs.dll.a ../../matc/src/libmatc.dll.a ../../umfpack/src/umfpack/libumfpack.a ../../umfpack/src/amd/libamd.a ../../fhutiter/src/libfhuti.dll.a binio/libbinio.a ../../mathlibs/src/arpack/libarpack.dll.a /mingw64/lib/libopenblas.dll.a /mingw64/lib/libopenblas.dll.a /mingw64/lib/libopenblas.dll.a -ldl -lm -lstdc++
C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -ldl: No such file or directory
collect2.exe: error: ld returned 1 exit status
make[2]: *** [fem/src/CMakeFiles/elmersolver.dir/build.make:1484: fem/src/msys-elmersolver.dll] Error 1
make[2]: Leaving directory '/c/Users/foo/OneDrive - bar/Desktop/Elmer/elmerfem/build'
make[1]: *** [CMakeFiles/Makefile2:16950: fem/src/CMakeFiles/elmersolver.dir/all] Error 2
make[1]: Leaving directory '/c/Users/foo/OneDrive - bar/Desktop/Elmer/elmerfem/build'
make: *** [Makefile:169: all] Error 2

字符串
解决这个问题的尝试包括在CMake中使用set(CMAKE_LINKER "/c/tools/msys64/mingw64/bin/ld.exe")显式设置链接器,但这并没有解决这个问题。
代码当前状态的分支在这里可用:ElmerFEM GitHub Branch - wip/windows
我正在寻找关于如何解决这个链接错误的见解或建议,特别是如何正确地在这个环境中包含libdl库,或者以与Maple/MinGW兼容的方式从链接过程中删除-ldl标志。
感谢您提供的任何帮助!

相关问题