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

Fix the locations and names of compiled libraries #66

Closed
Tracked by #62
jowr opened this issue Jun 19, 2022 · 5 comments
Closed
Tracked by #62

Fix the locations and names of compiled libraries #66

jowr opened this issue Jun 19, 2022 · 5 comments

Comments

@jowr
Copy link
Collaborator

jowr commented Jun 19, 2022

Fix the locations and names of compiled libraries in Resources/Library so that they are found by Dymola and OpenModelica both on Windows and Linux.

@jowr jowr mentioned this issue Jun 19, 2022
6 tasks
@jowr jowr changed the title Fix the locations and names of compiled libraries in Resources/Library so that they are found by Dymola and OpenModelica both on Windows and Linux Fix the locations and names of compiled libraries Jun 19, 2022
@jowr
Copy link
Collaborator Author

jowr commented Jun 19, 2022

I am not sure I get the point. I thought I had taken care of this in the CMake script? What is going wrong?

@casella
Copy link
Collaborator

casella commented Jun 22, 2022

There are some issues with the places where the compiled libraries are put in the Resources/Library directory.

Regarding Windows, both .dll and .lib are placed in win64/vs2007 etc, and there is one directory for each version of visual studio. This was necessary when compiling externalmedialib as a static library, because different versions of VS are not backwards compatible at the linker level.

In principle, this should no longer be necessary now that we have DLLs. However, for some reason (maybe you understand why) Dymola still uses a very small statically linked .lib library, so for Dymola under Windows keeping them in compiler-specific directories looks good.

On the other hand, OpenModelica doesn't need that statically linked library, and it just looks for the dll either in win64 or win32; BTW it doesn't use VS by default, it rather uses clang from mingw.

So, for Windows it is necessary to also copy the ExternalMediaLib.dll 32-bit DLL to win32 and the 64-bit DLL to win64. I guess you can use the ones compiled with the latest VS compiler.

There is also some problem with library locations on Linux, @fedetftpolimi can you please remind @jowr where the .so libraries should be copied, so that they work both in Dymola and OpenModelica?

@fedetftpolimi
Copy link
Collaborator

I checked on Linux and there are no problems The CMake build target installs libraries in Resources/Library/linux64 and both OpenModelica and Dymola can find them there. Please don't modify the Linux install target further.

I think only Windows remains an issue, as I remember @casella had to move the .dll to another directory to make the library work, I don't remember if the issue was with OpenModelica or Dymola though.

@fedetftpolimi
Copy link
Collaborator

I found and fixed a few likely copy-paste bugs in the CMake, that explain why

  • the automatic builds messed up the linux and macos shared libraries
  • building with MinGW was likely broken, as the dll would be installed in a wrongly named directory

I also modified the Windows install target to remove the compiler directory and install dlls directly in the win32/win64 directory. @casella is testing this, if it works this issue can be closed.

@fedetftpolimi
Copy link
Collaborator

Today me and @casella checked, and the current build in the CI works on both Windows (64bit, vs2017 is the only combination we tested) and Linux, with OpenModelica and Dymola, so I'm closing this.

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

3 participants