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 hardcoded full path for pysam libs. #149

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ccoulombe
Copy link

Pysam include library directory and set libraries instead of providing full path.
Set rpath so libs are found when installed in a virtual environment or in user-space.

This allow to use pairtools in different environment and find libs at runtime instead of having them hardcoded at build time.

Pysam include library directory and set libraries instead of providing
full path. Set rpath so libs are found when installed in a virtual
environment or in user-space.
This allow to use pairtools in different environment.
@agalitsyna agalitsyna self-requested a review October 21, 2022 22:40
@agalitsyna
Copy link
Member

HI, @ccoulombe Thanks for your PR!

  1. Can you provide an example environment setting when the current version won't work?
  2. How robust is setting the paths relative to $ORIGIN?

@ccoulombe
Copy link
Author

ccoulombe commented Oct 25, 2022

  1. The current will not work when :
  • the package needs to be redistributed as a wheel
  • the package is installed in a different environment then the one used to build.
    Since the full path of the libraries from the build environment are used. For instance, a wheel from PyPI or from an HPC center that redistribute this software as pre-built wheel.
  1. Very robust, as this is only a complement and does not hurt to have this extra path.
    $ORIGIN always point to the origin of the library and since pysam is required to be installed along pairtools, the required libraries will always be at $PWD/../..pysam when installed in user-space or in a virtual environment since pip install packages in : lib/pythonX.Y/site-packages ( and pysam libraries live in the installation directory).
    Obviously, this does not apply when the packages are installed system-wide, in which case the linker should be able to find the pysam libraries from its config (e.g. another system-wide path).

In the end, this only add flexibility and make the package installable in different environment by not using hard coded paths.

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

Successfully merging this pull request may close these issues.

2 participants