Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 645060 - sci-biology/pysam-0.12.0.1 - properly install libcsamtools.so
Summary: sci-biology/pysam-0.12.0.1 - properly install libcsamtools.so
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Science Biology related packages
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2018-01-19 21:50 UTC by Martin Mokrejš
Modified: 2020-08-03 21:11 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
pysam-0.15.1.ebuild (pysam-0.15.1.ebuild,1.17 KB, text/plain)
2018-12-23 20:36 UTC, Martin Mokrejš
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Mokrejš 2018-01-19 21:50:20 UTC
Hi,
 I think this is a pysam bug and not sci-biology/sga-9999::science. I do not understand what is wrong with the pythonic integration of pysam but it seems other tools cannot use it properly. sga-stat.py is distributed along sga package.


$ sga-astat.py 
Traceback (most recent call last):
  File "/usr/bin/sga-astat.py", line 6, in <module>
    import pysam
  File "/usr/lib64/python2.7/site-packages/pysam/__init__.py", line 5, in <module>
    from pysam.libchtslib import *
  File "pysam/libchtslib.pyx", line 1, in init pysam.libchtslib
ImportError: libcsamtools.so: cannot open shared object file: No such file or directory
$

$ equery files pysam | grep libcsamtools.so 
/usr/lib64/python2.7/site-packages/pysam/libcsamtools.so
$

I re-installed pysam to be sure it is not a compiler- or python-upgrade-related issue.

Would anybody mind fixing either of the two packages? Thank you.
Comment 1 Martin Mokrejš 2018-01-19 21:51:13 UTC
# emerge --info
Portage 2.3.19 (python 2.7.14-final-0, default/linux/amd64/17.0, gcc-6.3.0, glibc-2.26-r5, 4.14.13-default-pciehp x86_64)
=================================================================
System uname: Linux-4.14.13-default-pciehp-x86_64-Intel-R-_Core-TM-_i7-2640M_CPU_@_2.80GHz-with-gentoo-2.4.1
KiB Mem:    16366420 total,   3216224 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Fri, 19 Jan 2018 12:00:01 +0000
Head commit of repository gentoo: f67e4e7a576c620f3d53b129c8c587f3d4e35d73
sh bash 4.4_p12-r1
ld GNU ld (Gentoo 2.29.1 p3) 2.29.1
app-shells/bash:          4.4_p12-r1::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.26.9999::gentoo
dev-lang/python:          2.7.14-r1::gentoo, 3.4.6-r1::gentoo, 3.5.4-r1::gentoo, 3.6.4::gentoo
dev-util/cmake:           3.10.1::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.34.11::gentoo
sys-apps/sandbox:         2.12::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.11.6-r2::gentoo, 1.12.6-r1::gentoo, 1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15.1-r1::gentoo
sys-devel/binutils:       2.29.1-r1::gentoo
sys-devel/gcc:            4.3.6-r1::gentoo, 4.4.7::gentoo, 4.6.4::gentoo, 4.7.4::gentoo, 4.8.5::gentoo, 4.9.4::gentoo, 5.3.0::gentoo, 5.4.0-r3::gentoo, 6.2.0-r1::gentoo, 6.3.0::gentoo, 7.1.0-r1::gentoo, 7.2.0-r1::gentoo
sys-devel/gcc-config:     1.9.1::gentoo
sys-devel/libtool:        2.4.6-r4::gentoo
sys-devel/make:           4.2.1-r1::gentoo
sys-kernel/linux-headers: 4.14::gentoo (virtual/os-headers)
sys-libs/glibc:           2.26-r5::gentoo
Repositories:

gentoo
    location: /scratch/usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts: 

science
    location: /scratch/mmokrejs/proj/sci
    masters: gentoo
    priority: 0

layman
    location: /var/lib/layman
    masters: gentoo
    priority: 1

haskell
    location: /var/lib/layman/haskell
    masters: gentoo
    priority: 50

vmware
    location: /var/lib/layman/vmware
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA dlj-1.1 sun-bcla-java-vm Oracle-BCLA-JavaSE IBM-J1.6 skype-eula Nero-EULA-US AdobeFlash-10.3 skype-4.0.0.7-copyright AdobeFlash-11.x OPERA-2014 RAR Intel-SDP"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -mpclmul -mpopcnt -march=native -ftree-vectorize"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/lib64/libreoffice/program/sofficerc /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.2/conf /usr/share/maven-bin-3.3/conf /var/bind /var/lib/hsqldb /var/spool/torque"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.6/ext-active/ /etc/php/apache2-php7.1/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cgi-php7.1/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/php/cli-php7.1/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -mpclmul -mpopcnt -march=native -ftree-vectorize"
DISTDIR="/scratch/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news nostrip parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.wheel.sk/ http://ftp.fi.muni.cz/pub/linux/gentoo/ http://gentoo.mirror.web4u.cz/ rsync://gentoo.mirror.dkm.cz/gentoo/ ftp://gentoo.mirror.web4u.cz/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en_US en_GB en cs"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/scratch/var/tmp"
USE="R X acpi alsa amd64 amr apache apache2 asm avx berkdb bluetooth boost bzip2 cairo cgi cli coin consolekit cracklib crypt cryptlib cryptsetup cups cxx dbus device-mapper dhcp directfb dri drm dvd emboss encode fax fbcon ffmpeg flac fontconfig fortran fuse gbm gcrypt gd gdbm geoip geolocation gimp glpk gmp gnutls gpm gps gtk hal hpijs hwdb iconv id3tag imaging innodb inotify java javafx javascript jce jpeg jpg js jscript keymap ladspa lame lapack laptop lcms libnotify lm_sensors mad matroska mmx modemmanager modules mp3 multicore multilib multimedia mysql ncurses networkmanager nfs nls nptl nptlonly nscd ntfs ntfsdecrypt ntfsprogs objc ocr ogg opengl openmp pam parport pcre pcre16 pdf pdfimport pdl perl php pkcs11 plplot png policykit polkit postproc postscript ppds ppp pppd pptx pulseaudio python qt3support qt4 qt5 readline rendering resolvconf samba scanner sctp seccomp server session sha512 slideshow sna sndfile sqlite sse sse2 sse3 sse4_1 sse4_2 ssh ssh-agent ssl sslv2 sslv3 ssse3 startup-notification suexec svg syslog tcl tcpd threads tiff tk truetype twolame udev unicode upower usb v4l v4l2 vim-syntax vnc wavpack wifi x11 xattr xcb xml xorg xrandr xv xvid xvmc zlib" ABI_X86="64 32" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="alias authz_host auth_basic auth_digest cgi cgid deflate dir env filter include info mem_cache mime mime_magic negotiation remoteip setenvif status userdir vhost_alias rewrite usertrack cache file_cache disk_cache charset_lite log_config log_forensic" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="aivdm ashtech earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 navcom ntrip oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tnt tripmate tsip ublox fury geostar nmea0183 nmea2000 passthrough" GRUB_PLATFORMS="pc" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" L10N="en-US en en-GB cs" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_5" RUBY_TARGETS="ruby20 ruby21 ruby23 ruby24 ruby25" USERLAND="GNU" VIDEO_CARDS="vesa vmware fbdev intel i915 i965" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Martin Mokrejš 2018-01-25 10:47:44 UTC
Is something wrong with PYTHONPATH?

$ python
Python 2.7.14 (default, Jan 19 2018, 19:55:40) 
[GCC 6.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pysam
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/site-packages/pysam/__init__.py", line 5, in <module>
    from pysam.libchtslib import *
  File "pysam/libchtslib.pyx", line 1, in init pysam.libchtslib
ImportError: libcsamtools.so: cannot open shared object file: No such file or directory
>>> 


There is newer pysam-0.13.0 release but that requires htslib-1.6
Comment 3 Martin Mokrejš 2018-01-25 11:19:12 UTC
Maybe start reading similar reports down from https://github.com/pysam-developers/pysam/issues/495#issuecomment-312613500 ?
Comment 4 Martin Mokrejš 2018-01-25 12:43:05 UTC
From https://packages.debian.org/buster/python-pysam (go for a link to python-pysam_0.12.0.1+ds-4.debian.tar.xz in the right frame) I see Debian had also some issues with linking:

python-pysam (0.11.2.2+ds-3) unstable; urgency=medium

  * Team upload
  * Link with -Wl,--as-needed and avoid another Python 2.7
    compatibility symlink for libchtslib.so
Comment 5 Martin Mokrejš 2018-12-23 20:36:35 UTC
Created attachment 558430 [details]
pysam-0.15.1.ebuild

Same happens with the current version. The files/pysam-0.12-fix-buildsystem.patch does not apply anymore but I do not have issues building it from sources. The inlcude path points to the bundled copy of samtools-1.9, htslib-1.9 and bcftools-1.9. For example:



x86_64-pc-linux-gnu-gcc -O2 -pipe -mpclmul -mpopcnt -march=native -ftree-vectorize -fPIC -I/usr/include -I/scratch/var/tmp/portage/sci-biology/pysam-0.15.1/work/pysam-0.15.1/samtools -I/scratch/var/tmp/portage/sci-biology/pysam-0.15.1/work/pysam-0.15.1/samtools/lz4 -I/scratch/var/tmp/portage/sci-biology/pysam-0.15.1/work/pysam-0.15.1/bcftools -I/scratch/var/tmp/portage/sci-biology/pysam-0.15.1/work/pysam-0.15.1/pysam -I/scratch/var/tmp/portage/sci-biology/pysam-0.15.1/work/pysam-0.15.1 -I/usr/include/python3.6m -c bcftools/vcfnorm.c.pysam.c -o /scratch/var/tmp/portage/sci-biology/pysam-0.15.1/work/pysam-0.15.1-python3_6/temp.linux-x86_64-3.6/bcftools/vcfnorm.c.pysam.o -Wno-unused -Wno-strict-prototypes -Wno-sign-compare -Wno-error=declaration-after-statement

# equery files pysam | grep csamtools
/usr/lib64/python2.7/site-packages/pysam/csamtools_util.h
/usr/lib64/python2.7/site-packages/pysam/libcsamtools.pxd
/usr/lib64/python2.7/site-packages/pysam/libcsamtools.so
/usr/lib64/python3.6/site-packages/pysam/csamtools_util.h
/usr/lib64/python3.6/site-packages/pysam/libcsamtools.cpython-36m-x86_64-linux-gnu.so
/usr/lib64/python3.6/site-packages/pysam/libcsamtools.pxd
#

I do not know what are am talking about here but the files have .pxd extension instead of .pyx. The python-3.6-shared lib shoudl probably also be named libcsamtools.so instead of libcsamtools.cpython-36m-x86_64-linux-gnu.so.

$ python
Python 2.7.15 (default, Dec  6 2018, 22:48:17) 
[GCC 8.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pysam
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/site-packages/pysam/__init__.py", line 5, in <module>
    from pysam.libchtslib import *
  File "pysam/libchtslib.pyx", line 1, in init pysam.libchtslib
ImportError: libcsamtools.so: cannot open shared object file: No such file or directory
>>>
Comment 6 Larry the Git Cow gentoo-dev 2020-08-03 16:55:55 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=98949b9dddb793b4f2834beb4888df6204322699

commit 98949b9dddb793b4f2834beb4888df6204322699
Author:     David Seifert <soap@gentoo.org>
AuthorDate: 2020-08-03 16:54:29 +0000
Commit:     David Seifert <soap@gentoo.org>
CommitDate: 2020-08-03 16:54:29 +0000

    sci-biology/pysam: Bump to 0.16.0.1
    
    Bug: https://bugs.gentoo.org/645060
    Bug: https://bugs.gentoo.org/646986
    Bug: https://bugs.gentoo.org/718472
    Package-Manager: Portage-3.0.1, Repoman-2.3.23
    Signed-off-by: David Seifert <soap@gentoo.org>

 sci-biology/pysam/Manifest                         |  1 +
 .../pysam/files/pysam-0.16.0.1-fix-tests.patch     | 37 +++++++++++++
 sci-biology/pysam/pysam-0.16.0.1.ebuild            | 60 ++++++++++++++++++++++
 3 files changed, 98 insertions(+)
Comment 7 Larry the Git Cow gentoo-dev 2020-08-03 21:11:42 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ebcdc8895b15d89af6600d8241e5cda417a4f7e3

commit ebcdc8895b15d89af6600d8241e5cda417a4f7e3
Author:     David Seifert <soap@gentoo.org>
AuthorDate: 2020-08-03 21:11:13 +0000
Commit:     David Seifert <soap@gentoo.org>
CommitDate: 2020-08-03 21:11:13 +0000

    sci-biology/pysam: Remove old
    
    Closes: https://bugs.gentoo.org/645060
    Closes: https://bugs.gentoo.org/646986
    Closes: https://bugs.gentoo.org/718472
    Package-Manager: Portage-3.0.1, Repoman-2.3.23
    Signed-off-by: David Seifert <soap@gentoo.org>

 sci-biology/pysam/Manifest                         |  1 -
 .../pysam/files/pysam-0.12-fix-buildsystem.patch   | 63 ----------------------
 sci-biology/pysam/pysam-0.12.0.1.ebuild            | 47 ----------------
 3 files changed, 111 deletions(-)