-
Notifications
You must be signed in to change notification settings - Fork 7
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
Python bindings cannot link dynamically against shared library #6
Comments
Why is it redundant for the python bindings to be linked against a static molassembler library? I think this was chosen specifically to reduce the amount of files and code present in the python packages. Molassembler code not reachable from python should then not be present in the python-loadable SO. |
For the Readuct build I can split the build in two stages, building the project without Python bindings first and afterwards building the Python bindings against the previously compiled shared library. This allows to reduce build times and package size, specially when building for many Python versions (currently CPython 3.7, 3.8, 3.9, 3.10 and PyPy 3.8, 3.9). I tried doing the same for molassembler, but here I usually run into a linking issue if I try to use the shared library for linking rather than the static one. |
What's different between readuct and molassembler that the same approach but with the static library variant isn't feasible? |
For readuct I'm rediscovering the installed library using the CMake config file, for molassembler I cannot do this because I'm building with There are several possibilities to work around this, like install the static library locally and reuse it in the next build stage or make the static library installable and create an additional package output ( |
The Python bindings statically link against an archive rather than the shared library even if
-DBUILD_SHARED_LIBS=ON
is set. Is there a way to reduce the redundancy in the Python bindings by just linking the already available shared library?The text was updated successfully, but these errors were encountered: