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

Explore shared lib creation #645

Closed
1 task done
molpopgen opened this issue Jan 23, 2021 · 11 comments · Fixed by #702
Closed
1 task done

Explore shared lib creation #645

molpopgen opened this issue Jan 23, 2021 · 11 comments · Fixed by #702

Comments

@molpopgen
Copy link
Owner

molpopgen commented Jan 23, 2021

We should test the link in the answer here.

If this works, it'll probably improve build times by a lot.

Main question: does pip install still work?

To-do:

  • Test with dummy repo and report back here...
@molpopgen
Copy link
Owner Author

This works just fine on Linux. There are some questions re: the setup.py in that answer, but that should be easy to sort out. As always, gotta test independently on macOS.

@molpopgen
Copy link
Owner Author

This would be a great way to solve #625!

@molpopgen
Copy link
Owner Author

There are some questions re: the setup.py in that answer,

Aha: https://nehckl0.medium.com/creating-relocatable-linux-executables-by-setting-rpath-with-origin-45de573a2e98

@molpopgen
Copy link
Owner Author

Doing this right also means providing a Python API to find the shared lib, as we'll end up moving a good bit of the C++ back-end to the shared lib. We'll also want to enable LTO by default.

@molpopgen
Copy link
Owner Author

@molpopgen
Copy link
Owner Author

It is not obvious what auditwheel/delocate will do here. For example, they copy dependent libs to a new location. If we install our shared lib as package data, then it is possible that a plugin causes multiple versions of a symbol to be present at run time.

@molpopgen
Copy link
Owner Author

It is not obvious what auditwheel/delocate will do here.

All is fine on Linux! (Still requires #683 for stress testing, tho.)

@molpopgen
Copy link
Owner Author

All is fine on Linux! (Still requires #683 for stress testing, tho.)

There is a problem, actually. If the shared lib also links to GSL, then that dependency is not relocated by auditwheel.

@molpopgen
Copy link
Owner Author

If the shared lib also links to GSL, then that dependency is not relocated by auditwheel.

A partial solution is to build the shared lib in another directory, so that it looks "external". This relocates the shared lib, which is great for run time, but makes it difficult/impossible to have plug ins link to it.

@molpopgen
Copy link
Owner Author

molpopgen commented Mar 7, 2021

If the shared lib also links to GSL, then that dependency is not relocated by auditwheel.

A partial solution is to build the shared lib in another directory, so that it looks "external". This relocates the shared lib, which is great for run time, but makes it difficult/impossible to have plug ins link to it.

pypa/auditwheel#136 needs a solution before we can proceed.

@molpopgen
Copy link
Owner Author

We can close this. The best solution for now is the static lib approach introduced in 0.18.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant