Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when exporting to FMU #2211

Closed
ishengyeh opened this issue Apr 28, 2024 · 4 comments
Closed

Issue when exporting to FMU #2211

ishengyeh opened this issue Apr 28, 2024 · 4 comments

Comments

@ishengyeh
Copy link

Hi,
First of all, many thanks for such a great software. I am experiencing trouble exporting a Hopsan hmf file to FMU, e.g., FMU 2 when updating to the latest release of Hopsan 2.21.1, It works fine till Hopsan 2.20. Here are attached the zipped hmf file and the error message. Your help will be highly appreciated.
Best
Isheng
--------- hmf file --------
case23_hopsan.zip
-------- error 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:/Users/iyeh/FMU/FMU_Manager_5.2_031724/dyna_key/case23_inv_pend_hopsan/fmu-build/fmu2_model.c
Generating C:/Users/iyeh/FMU/FMU_Manager_5.2_031724/dyna_key/case23_inv_pend_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
Makefile:18: recipe for target 'Component.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....
g++: error: Files/Hopsan/dependencies/fmi4c/include: No such file or directory
bin\mingw32-make.exe: *** [Component.o] Error 1

File 'C:/Users/iyeh/FMU/FMU_Manager_5.2_031724/dyna_key/case23_inv_pend_hopsan/fmu-stage/binaries/win64/case23_hopsan.dll' not found in directory ''

@robbr48
Copy link
Contributor

robbr48 commented Apr 29, 2024

This is already fixed by #2202 and will work in the next release, which is expected quite soon.

You may also fix it yourself by editing the Makefile and addint quotation marks around the path to fmi4c. It is located in the "fmu-build" directory in the export folder. Then call "compile.ps1". If everything works you can then manually zip the contents of the fmu-stage folder and rename the file to extention ".fmu".

@robbr48 robbr48 closed this as completed Apr 29, 2024
@ishengyeh
Copy link
Author

@robbr48 : thank you so much, highly appreciate it.

@ishengyeh
Copy link
Author

@robbr48 : I failed to locate this file: HopsanGenerator/src/generators/HopsanFMIGenerator.cpp in "program files/hopsan" and make the change as suggested in #2202 . Could you please let m w know where exactly it is? Thanks.

@ishengyeh
Copy link
Author

@robbr48 , please ignore my last question. I know what you mean now. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants