-
Notifications
You must be signed in to change notification settings - Fork 319
Can't generate crossbuild FMU with CVODE on Windows #12855
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
Comments
Ref to the upstream ( |
Is maybe some path machinery going wrong here? That |
@adrpo could you please take care of that? |
Seems to be an issue with cmake and how the path to the sundials lib is assembled. Just had a similar issue on Fedora 41. The CMakeLists to build the fmu contains `set(CVODE_DIRECTORY "/opt/openmodelica-nightly/bin/../lib/${CMAKE_LIBRARY_ARCHITECTURE}/omc"` CMAKE_LIBRARY_ARCHITECTURE is the problem here. On may machine it returns "x86_64-redhat-linux-gnu", whereas the omc directory is just "x86_64-linux-gnu". I created a symlink and it works fine. Why not just hardcode the lib-paths for win and linux? You'll never know what cmake comes up with on any OS... |
It seems like it's actually the compiler that CMake gets differing folder names from, and not an issue with CMake? Presumably on your Redhat the location of that "system library search directory" is different?
I'm not sure if that would solve the original problem, though: this inserts a Linux arch string ( |
Ah ok, thanks for ponting that out.
My naive idea was not to use CMAKE_LIBRARY_ARCHITECTURE at all in the paths, so that nothing is inserted no matter if from cmake or the compiler. Just use C:/OpenModelica/lib on win and /openmodelica/lib/x86_64-linux-gnu/ on linux. But I'm certainly lacking some background here. And this would probably fail as soon as someone tries to build e.g. for arm64 |
@adrpo is there a path to fix multiplatform FMU export using CVode, with reasonable effort/time? Right now I am exporting separate FMUs, the Windows one using the installed OMEdit, and a Linux one with a fragile stack of scripts executing an openmodelica-minimal docker container. |
Did you try building it for Linux in WSL on Windows? This is how SimulationX does it. They just generate a makefile along with the fmu sources, build it in WSL and put the binary back in the fmu-zip. Windows-only of course and I don‘t know if the fmu-sources generated by OpenModelica are this kind of cross platform plug&play… |
I did not -- just opening, recompiling, repacking is an interesting approach! I'll have to check if the cmake config in the Windows FMU can deal with that. |
@adrpo is there something I can do on my side to troubleshoot/diagnose this to aid in fixing the problem? As it seems an upstream update won't be coming (multiarch/crossbuild#61) one possibility would be to update the |
@casella any chance you guys can take a look at unbreaking the multi-platform FMU export from OMEdit? |
Another "fun" aspect concerning the FMU out-of-the-box experience (#10174) is that the
crossbuild
image is based on such an old Debian that it ships an ancient CMake, with the consequence of clashing with current default flagsFrustratingly, using
--fmuRuntimeDepends=none
as a workaround recommended by the docs causes a subsequent failureWhich is no surprise, I guess, because we had to not include runtime dependencies!
In effect, I can't see a way to compile a Linux FMU (e.g. for use in a Docker container) from Windows, while avoiding the Euler solver.
How to work around that? Find another appropriate image with newer versions somehow? Is something that could be used instead of
multiarch/crossbuild
hosted on the OM docker repo?@AnHeuermann, any ideas?
Originally posted by @bilderbuchi in #10174 (comment)
The text was updated successfully, but these errors were encountered: