Open mmokrejs opened 5 years ago
This seems to be available:
from https://github.com/pysam-developers/pysam/blob/master/INSTALL
External
pysam can be combined with an externally installed htslib_ library. This is a good way to avoid duplication of libraries. To link against an externally installed library, set the environment variables
HTSLIB_LIBRARY_DIR
andHTSLIB_INCLUDE_DIR
before installing::export HTSLIB_LIBRARY_DIR=/usr/local/lib export HTSLIB_INCLUDE_DIR=/usr/local/include pip install pysam
Note that the location of the file :file:
libhts.so
needs to be known to the linker once you run pysam, for example by setting the environment-varirableLD_LIBRARY_PATH
.
But:
Is this also needed with python setup.py install
instead of pip install pysam
? That is: can we do without those export lines?
This because I do not see a different package being built when htslib and headers are installed in a way that fits the distribution set-up (i.e. configure should be able to find all required stuff)
EDIT: without native htslib installed pysam won't compile using above export statements, thus it works (but having the same versions of the libraries either installed or coming with pysam, a difference won't show in the installed pysam python-ware)
Hi, Gentoo Linux and especially @SoapGentoo (now as @SoapZA ?) has put an effort in the past to compile&link pysam against site-wide htslib and samtools. Since pysam-0.12.x series the setup.py has been rewamped, which is fine. The past changes need were https://gitweb.gentoo.org/repo/gentoo.git/tree/sci-biology/pysam/pysam-0.12.0.1.ebuild?id=5283acc5b86973e40e3a455a1eeaff7b81aa3232 with https://gitweb.gentoo.org/repo/gentoo.git/tree/sci-biology/pysam/files/pysam-0.12-fix-buildsystem.patch?id=5283acc5b86973e40e3a455a1eeaff7b81aa3232 on top of the sources.
The patch is not applicable due to the complete rewamp as of now. The changes to the ebuild file (the parent process calling setup.py) are maybe still needed. Would you mind thinking of the differences between the 0.12.0.1 and 0.15.2 and adjusting the setup.py in a way it works out-of-the-box for everybody? I believe other Linux distros have same need to get rid of the bundled htslib/samtools stuff to avoid mess with runtime library incompatibilities.
Basically, setup.py should detect site-wide htslib and samtools and not rely on the bundled copies. They can be different, no matter if older or newer, simply, different.
Currently I get:
It dies inside Gentoo code but is
not possible anymore before calling
setup.py
?