【发布时间】:2021-02-22 09:16:02
【问题描述】:
我正在尝试使用 Jmodelica 编译 Modelica 模型(内置于 Dymola),但出现以下错误:
编译器参数: 生成代码...
====== 模型编译成功======= OU44_ZoneR2C2_funcs.o:OU44_ZoneR2C2_funcs.c:(.text+0x24): 未定义对“ModelicaStandardTables_CombiTable1D_minimumAbscissa”的引用
OU44_ZoneR2C2_funcs.o:OU44_ZoneR2C2_funcs.c:(.text+0xbc): 未定义对“ModelicaStandardTables_CombiTable1D_maximumAbscissa”的引用 OU44_ZoneR2C2_funcs.o:OU44_ZoneR2C2_funcs.c:(.text+0x1e7):未定义对“ModelicaStandardTables_CombiTable1D_init2”的引用
collect2.exe:错误:ld 返回 1 个退出状态
mingw32-make1: *** [fmume20_] 错误 1
mingw32-make: *** [fmume20] 错误 2
"C:/Users/taoy/AppData/Roaming/JModelica.org-2.14/MinGW/bin/mingw32-make" -f "C:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install\Makefiles\ MakeFile" "PLATFORM_FLAG=-m64" "RUNTIMELIBRARY_LIB_DIR=C:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/lib/RuntimeLibrary64" "MINPACK_LIB_DIR=C:\Users\taoy\AppData\Roaming\JModelica. org-2.14\install/ThirdParty/Minpack/lib64" "SUNDIALS_LIB_DIR=C:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install\ThirdParty\Sundials/lib64" "WINPTHREADS_LIB_DIR=C:\Users\taoy\ AppData\Roaming\JModelica.org-2.14\install/ThirdParty/winpthreads/lib/winpthreads64" fmume20_
mingw32-make1:进入目录
'C:/Users/taoy/AppData/Local/Temp/1/jmc7241264750773945049out' "gcc" -m64 -std=c89 -pedantic -msse2 -mfpmath=sse -O1 "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/include/RuntimeLibrary" "-IC:\Users \taoy\AppData\Roaming\JModelica.org-2.14\install/ThirdParty/FMI/2.0" "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install\ThirdParty\Sundials/include" -c -o "OU44_ZoneR2C2_funcs.o" 来源/OU44_ZoneR2C2_funcs.c "gcc" -m64 -std=c89 -pedantic -msse2 -mfpmath=sse "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/include/RuntimeLibrary" "-IC:\Users\taoy \AppData\Roaming\JModelica.org-2.14\install/ThirdParty/FMI/2.0" "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install\ThirdParty\Sundials/include" -c -o “OU44_ZoneR2C2_init_independent.o”来源/OU44_ZoneR2C2_init_independent.c "gcc" -m64 -std=c89 -pedantic -msse2 -mfpmath=sse "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/include/RuntimeLibrary" "-IC:\Users\taoy \AppData\Roaming\JModelica.org-2.14\install/ThirdParty/FMI/2.0" "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install\ThirdParty\Sundials/include" -c -o “OU44_ZoneR2C2_init_dependent.o”来源/OU44_ZoneR2C2_init_dependent.c "gcc" -m64 -std=c89 -pedantic -msse2 -mfpmath=sse "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/include/RuntimeLibrary" "-IC:\Users\taoy \AppData\Roaming\JModelica.org-2.14\install/ThirdParty/FMI/2.0" "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install\ThirdParty\Sundials/include" -c -o “OU44_ZoneR2C2_base.o”来源/OU44_ZoneR2C2_base.c "gcc" -m64 -std=c89 -pedantic -msse2 -mfpmath=sse "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/include/RuntimeLibrary" "-IC:\Users\taoy \AppData\Roaming\JModelica.org-2.14\install/ThirdParty/FMI/2.0" "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install\ThirdParty\Sundials/include" -c -o “OU44_ZoneR2C2_equ.o”来源/OU44_ZoneR2C2_equ.c "gcc" -m64 -std=c89 -pedantic -msse2 -mfpmath=sse "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/include/RuntimeLibrary" "-IC:\Users\taoy \AppData\Roaming\JModelica.org-2.14\install/ThirdParty/FMI/2.0" "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install\ThirdParty\Sundials/include" -c -o “OU44_ZoneR2C2_equ_init.o”来源/OU44_ZoneR2C2_equ_init.c "gcc" -m64 -std=c89 -pedantic -msse2 -mfpmath=sse "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/include/RuntimeLibrary" "-IC:\Users\taoy \AppData\Roaming\JModelica.org-2.14\install/ThirdParty/FMI/2.0" "-IC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install\ThirdParty\Sundials/include" -c -o “OU44_ZoneR2C2.o”来源/OU44_ZoneR2C2.c
mkdir 二进制文件\win64 "C:\Users\taoy\AppData\Roaming\JModelica.org-2.14\MinGW\bin\g++" -m64 -shared -m64 -o "binaries/win64/OU44_ZoneR2C2.dll" OU44_ZoneR2C2_funcs.o OU44_ZoneR2C2_init_independent.o OU44_ZoneR2C2_init_dependent.o OU44_ZoneR2C2_base.o OU44_ZoneR2C2_equ.o OU44_ZoneR2C2_equ_init.o OU44_ZoneR2C2.o "-LC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/lib/RuntimeLibrary64" -lfmi2 -static-libstdc++ -static-libgcc -ljmi " -LC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/lib" -L"C:\Users\taoy\Documents\Modelica Standard Library 3.2.3\Modelica 3.2.3\Resources\Library/ win64/gcctdm510" -L"C:\Users\taoy\Documents\Modelica 标准库 3.2.3\Modelica 3.2.3\Resources\Library/win64" -L"C:\Users\taoy\Documents\Modelica 标准库3.2 .3\Modelica 3.2.3\Resources\Library" -lModelicaStandardTables -lModelicaIO -lModelicaMatIO -lzlib -lModelicaExternalC -ljmi_get_set_default -lModelicaStandardTables -lModelicaIO -lModelicaMatIO -lzlib -lModelicaExternalC -ljmi_get_ set_default -llapack -lblas -l:libgfortran.a -l:libquadmath.a -lModelicaExternalC -lzlib -ljmi "-LC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install\ThirdParty\Sundials/lib64" -l:libsundials_kinsol.a -l:libsundials_nvecserial.a -l:libsundials_cvode.a "-LC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/ThirdParty/Minpack/lib64" -l:libcminpack。 “-LC:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install/ThirdParty/winpthreads/lib/winpthreads64”-l:libwinpthread.a C:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install\Makefiles\MakeFile:214:目标“fmume20_”的配方失败 mingw32-make1: 离开目录'C:/Users/taoy/AppData/Local/Temp/1/jmc7241264750773945049out' C:\Users\taoy\AppData\Roaming\JModelica.org-2.14\install\Makefiles\MakeFile:210:目标“fmume20”的配方失败
未知程序错误,org.jmodelica.util.exceptions.CcodeCompilationException:生成的 C 代码编译失败。
C文件位置:C:\Users\taoy\AppData\Local\Temp\1\jmc7241264750773945049out\sources\OU44_ZoneR2C2.c
它说模型编译成功,但之后出现错误。我查看了模型,如果我从 Modelica 标准库中删除模型组件“CombiTable1D”,则错误已修复。似乎这个组件有问题。但是,这个组件在我的模型中是必需的。
如何解决这个问题?
【问题讨论】:
-
你能尝试用 Visual Studio 而不是 gcc 编译吗?我认为 MSL 表使用外部代码。
-
你的意思是在 Jmodelica 中使用编译器 Visual Studio 吗?但是我该如何设置呢,我可以在 Dymola 中使用 Visual Studio 进行编译。
标签: compilation modelica dymola jmodelica