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

Change libomqwt to shared library. #11103

Merged
merged 1 commit into from
Aug 31, 2023
Merged

Conversation

mahge
Copy link
Contributor

@mahge mahge commented Aug 31, 2023

  • This reverts changes made in Build qwt as a static library. #9939 and Fix Windows CMake build. #9956.

  • It should be a shared library (a DLL on Windows at least) because it is used by both libOMPlotLib.dll and OMNoteBook.exe. However, OMNoteBook.exe links to libOMPlotLib.dll as well. CMake will add both libOMPlotLib.dll and libomqwt.a to the linking commandline of OMNoteBook.exe and that causes duplicates on some configurations (e.g. using clang on OMDev. Curiously the issue does not occur with gcc on OMDev).

    Another way to fix this problem would be to make the linking by libOMPlotLib.dll to static libomqwt.a a PRIVATE link (in CMake terms.) However, that will require us to manually add the definitions and include directives needed to use libomqwt.a by OMNoteBook.exe (think of it like OMNoteBook.exe uses both libOMPlotLib.dll and libomqwt.a, not just libOMPlotLib.dll). So the most logical and straightforward fix is to make libomqwt a shared lib.

  - This reverts changes made in OpenModelica#9939 and OpenModelica#9956.

  - It should be a shared library (a DLL on Windows at least) because it
   is used by both `libOMPlotLib.dll` and `OMNoteBook.exe`. However,
   `OMNoteBook.exe` links to `libOMPlotLib.dll` as well. CMake will add
   both `libOMPlotLib.dll` and `libomqwt.a` to the linking commandline
   of `OMNoteBook.exe` and that causes duplicates on some configurations
    (e.g. using `clang` on `OMDev`. Curiously the issue does not occur with `gcc` on `OMDev`).

  - Another way to fix this problem would be to make the linking by
  `libOMPlotLib.dll` to static `libomqwt.a` a PRIVATE link (in CMake terms.)
   However, that will require us to manually add the definitions and
   include directives needed to use `libomqwt.a` by `OMNoteBook.exe`
   (think of it like `OMNoteBook.exe` uses both `libOMPlotLib.dll` and
   `libomqwt.a`, not just `libOMPlotLib.dll`). So the most logical and
   straightforward fix is to make `libomqwt` a shared lib.
@mahge mahge added COMP/Build System Issue and pull request related to the build systems COMP/GUI/OMNotebook Issue and pull request related to OMNotebook COMP/GUI/OMPlot Issue and pull request related to OMPlot labels Aug 31, 2023
@mahge mahge self-assigned this Aug 31, 2023
@mahge mahge enabled auto-merge (squash) August 31, 2023 08:12
@mahge mahge merged commit 19b527c into OpenModelica:master Aug 31, 2023
2 checks passed
@mahge mahge deleted the libqwt_shared branch August 31, 2023 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
COMP/Build System Issue and pull request related to the build systems COMP/GUI/OMNotebook Issue and pull request related to OMNotebook COMP/GUI/OMPlot Issue and pull request related to OMPlot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant