pairtools
pairtools copied to clipboard
Fix hardcoded full path for pysam libs.
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.
HI, @ccoulombe Thanks for your PR!
- Can you provide an example environment setting when the current version won't work?
- How robust is setting the paths relative to $ORIGIN?
- 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.
- 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 sincepysam
is required to be installed alongpairtools
, 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 thepysam
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.