-
Notifications
You must be signed in to change notification settings - Fork 31
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
🚸 Building Shared Libraries #538
Conversation
Ok. Getting shared libraries to work properly is more work than anticipated. |
8a20fbd
to
0cb680c
Compare
Just rebased this PR on top of main and cleaned up the commits a little bit. |
## Description This PR brings in a couple code quality improvements discovered when working on #538. ## Checklist: <!--- This checklist serves as a reminder of a couple of things that ensure your pull request will be merged swiftly. --> - [x] The pull request only contains commits that are related to it. - [x] I have added appropriate tests and documentation. - [x] I have made sure that all CI jobs on GitHub pass. - [x] The pull request introduces no new warnings and follows the project's style guidelines.
…ation` (#548) ## Description This PR ensures that all the different `Operation` sub-classes get a corresponding `typeinfo` and `vtable` symbol in the compiled binaries. This is important for RTTI when using shared libraries and ensured that `dynamic_cast`s across library boundaries work as intended. Specifically, the `CompoundOperation` class was only defined in a header, which led to the omission of said information. This is fixed by creating a dedicated `.cpp` file and moving at least one definition there. This was discovered while working on #538 in combination with mqt-ddsim. ## Checklist: <!--- This checklist serves as a reminder of a couple of things that ensure your pull request will be merged swiftly. --> - [x] The pull request only contains commits that are related to it. - [x] I have added appropriate tests and documentation. - [x] I have made sure that all CI jobs on GitHub pass. - [x] The pull request introduces no new warnings and follows the project's style guidelines.
0cb680c
to
edc95ed
Compare
Ok. Further progress here. To keep the history of this PR, I just squashed the previous commits and added another commit that reverts the respective changes. The current state of the PR just changes very few things and, at least locally, that was enough to allow building all of our top-level Python packages based on the installed mqt.core package. |
Adding some interesting articles on C++ ABI compatibility here: |
The Python errors on Windows are interesting as I can't quite make sense of them. This needs some further investigation. It has something to do with the The package check failure is due to the SONAME and Version symlinks as well as the shared libraries in a non-importable location. I am fairly sure it is fine to simply ignore these, but this also needs further investigation. |
Alright. The C++ tests working under Windows were simply because no shared libraries were built there. |
Signed-off-by: burgholzer <burgholzer@me.com>
This reverts commit 8eb3fd98e98126ff2871945eedc0dfae1c2c70c7.
this avoids codesign issues under macOS which does not allow to load libraries that have been tampered with, e.g., by modifying the rpath information during installation
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: Lukas Burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
483124e
to
efe17fa
Compare
# Conflicts: # include/mqt-core/operations/CompoundOperation.hpp # include/mqt-core/python/qiskit/QuantumCircuit.hpp # src/CMakeLists.txt
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #538 +/- ##
=====================================
Coverage 91.6% 91.6%
=====================================
Files 148 148
Lines 14738 14745 +7
Branches 2365 2365
=====================================
+ Hits 13506 13514 +8
+ Misses 1232 1231 -1
|
Closing in favor of #662 |
Description
This PR started out as a PR that should "just" improve the project installation before top-level projects eventually switch to the new
mqt-core
version. As part of that, it tried to address #530 by switching the library to build dynamic libraries by default. This considerably decreases the binary size and would, in general, be nice to support.The corresponding changes need appropriate testing across all different projects to make sure that nothing is missed.
I will open corresponding PRs in all top-level projects that use mqt-core to make sure that the new library structure works for all those projects.
In particular:
mqt-core
Python package mqt-qcec#355mqt-core
Python package mqt-qmap#418mqt-core
Python package mqt-ddsim#336Checklist: