Hopsan / hopsan

Hopsan is a free multi-domain system simulation tool developed at the division of Fluid and mechatronic systems at Linköping university.
Apache License 2.0
146 stars 41 forks source link

Error when exporting FMU that contains other FMU #2228

Closed larsviktorlarsson closed 1 month ago

larsviktorlarsson commented 1 month ago

When exporting a Hopsan model file that contains another FMU, the generator crashes with the following message:

Loaded hopsangenerator
Copying HopsanCore source, header and dependencies...
Copying C:/Program Files/Hopsan/HopsanCore
Copying default component library...
Copying C:/Program Files/Hopsan/componentLibraries/defaultLibrary
Generating C:/SVN/eVeber-FMI_branchViktor/test_area/test_models/Hopsan/fmu-build/fmu2_model.c
Exporting model assets
Unable to copy file: C/SVN/eVeber-FMI_branchViktor/test_area/get_fmu/local/fmu/L90LS_UD_banan_K__.fmu to C:/SVN/eVeber-FMI_branchViktor/test_area/test_models/Hopsan/fmu-stage/resources/C/SVN/eVeber-FMI_branchViktor/test_area/get_fmu/local/fmu/L90LS_UD_banan_K__.fmu
Generating C:/SVN/eVeber-FMI_branchViktor/test_area/test_models/Hopsan/fmu-build/model.hpp
Replacing namespace
------------------------------------------------------------------------
Compiling FMU source code
------------------------------------------------------------------------
Generating Makefile
Generating compilation script
Calling compilation script
g++ -c -std=c++14 -DHOPSAN_INTERNALDEFAULTCOMPONENTS -DHOPSAN_INTERNAL_EXTRACOMPONENTS -DHOPSANCORE_NOMULTITHREADING -I"HopsanCore/include" -I"componentLibraries/defaultLibrary" -I"HopsanCore/dependencies/rapidxml" -I"HopsanCore/dependencies/indexingcsvparser/include" -I"HopsanCore/dependencies/libnumhop/include" -I"HopsanCore/dependencies/sundials-extra/include" -I"HopsanCore/dependencies/sundials/include" -IC:/Program Files/Hopsan/dependencies/fmi4c/include -c fmu2_model.c -o fmu2_model.o

g++ -c -std=c++14 -DHOPSAN_INTERNALDEFAULTCOMPONENTS -DHOPSAN_INTERNAL_EXTRACOMPONENTS -DHOPSANCORE_NOMULTITHREADING -I"HopsanCore/include" -I"componentLibraries/defaultLibrary" -I"HopsanCore/dependencies/rapidxml" -I"HopsanCore/dependencies/indexingcsvparser/include" -I"HopsanCore/dependencies/libnumhop/include" -I"HopsanCore/dependencies/sundials-extra/include" -I"HopsanCore/dependencies/sundials/include" -IC:/Program Files/Hopsan/dependencies/fmi4c/include -c HopsanCore/src/Component.cpp -o Component.o
Makefile:21: recipe for target 'fmu2_model.o' failed

g++: error: Files/Hopsan/dependencies/fmi4c/include: No such file or directory
bin\mingw32-make.exe: *** [fmu2_model.o] Error 1
bin\mingw32-make.exe: *** Waiting for unfinished jobs....

File 'C:/SVN/eVeber-FMI_branchViktor/test_area/test_models/Hopsan/fmu-stage/binaries/win64/FMU_UQ.dll' not found in directory ''
robbr48 commented 1 month ago

The issue is already resolved by #2202. The fix is included in release 2.22.0.