pairtools icon indicating copy to clipboard operation
pairtools copied to clipboard

Fix hardcoded full path for pysam libs.

Open ccoulombe opened this issue 2 years ago • 2 comments

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.

ccoulombe avatar Oct 21 '22 21:10 ccoulombe

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?

agalitsyna avatar Oct 24 '22 18:10 agalitsyna

  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.

ccoulombe avatar Oct 25 '22 12:10 ccoulombe