Closed christophfink closed 2 years ago
I found this ancient support thread discussing different CFLAGS: https://support.bioconductor.org/p/43325/
Tried all the suggestions from there, did not work.
I think you want to do R CMD ldd Rsamtools.so
which sets known library paths. This might not help, but the non-help would be informative. Is there an Arch Linux docker image that this can be reproduced on?
@christophfink The output of ldd Rsamtools.so
looks fine to me. We use static linking to /usr/lib/R/library/Rhtslib/usrlib/libhts.a
so ldd Rsamtools.so
won't report it.
Looks like you are using a system-wide R with packages already installed in a system-wide location (/usr/lib/R/library/
). I'm surprised that Rhtslib is already installed there but Rsamtools is not. Are we sure the stuff in /usr/lib/R/library/
was installed/compiled with R 4.2 and with the same compiler that you're using to install Rsamtools?
Can you please show us the output of:
which R
ls -l /usr/lib/R/library/
Then start R and show us the output of:
library(Rhtslib)
.libPaths()
sessionInfo()
H.
I built R under arch linux within docker. (docker pull archlinux). Commands to build R from source:
10 pacman -Sy gcc
11 pacman -Sy subversion
14 pacman -Sy db
24 pacman -Sy gcc-fortran
29 svn co https://svn.r-project.org/R/branches/R-4-2-branch R-4-2-src
31 cd R-4-2-src
32 cd tools
34 pacman -Sy rsync
35 ./rsync-recommended
36 cd ..
38 mkdir /R-4-2-dist
42 pacman -Sy xorg-server
45 pacman -Sy xorg-server-devel
47 pacman -Sy libx11
52 pacman -Sy libxt
54 ./configure --enable-R-shlib --prefix=/R-4-2-dist
56 pacman -Sy make
60 make -j 2
61 make install
With this R, install.packages("BiocManager"); BiocManager::install("Rsamtools")
produces a fine installation of Rsamtools.
The problem must be with the packaged R 4.2. I will now explore that.
With
[root@087b139859d1 /]# pacman -Q -i r
Name : r
Version : 4.2.0-1
Description : Language and environment for statistical computing and graphics
Architecture : x86_64
URL : https://www.r-project.org/
Licenses : GPL
Groups : None
Provides : None
Depends On : lapack libtiff pcre2 perl libxmu pango zip unzip curl icu which
Optional Deps : tk: tcl/tk interface
texlive-bin: latex sty files
gcc-fortran: needed to compile some CRAN packages [installed]
openblas: faster linear algebra
Required By : None
Optional For : None
Conflicts With : None
Replaces : None
Installed Size : 84.76 MiB
Packager : Antonio Rojas <arojas@archlinux.org>
Build Date : Fri 22 Apr 2022 08:39:47 AM UTC
Install Date : Fri 29 Apr 2022 08:49:51 PM UTC
Install Reason : Explicitly installed
Install Script : No
Validated By : Signature
I had no problem installing and using Rsamtools obtained via BiocManager.
I conclude that this is not a problem with Rsamtools and the difficulty should be raised in an appropriate forum related to arch linux.
Could you still leave this issue open, until we know a possible fix, as it affects only rsamtools? I'm certain that you have a point when you say that something in the way Arch compiles C causes the underlying issue, but it is, after all, triggered by something in rsamtools or samtools.
As for figuring out what causes this: Arch recently changed its compiler defaults to enable LTO by default. Could that have an influence? (I tried without LTO, and it didn't change things, but would that seem like an avenue worth exploring further?)
I'll try to build R itself without LTO, additionally to rhslib and rsamtools. Will report back here.
Quickly reporting back on a WIP intermediate success, in case someone else is facing the same problems: with the following options added to their respective PKGBUILDs, r
, r-rhtslib
and r-rsamtools
build fine:
r: !lto
r-rhtslib: !lto staticlibs
r-rsamtools: !lto !buildflags staticlibs
now trying to figure out the minimal set of changes
I reopened the issue on your request.
Actually, now, the issue can be closed, because it clearly is connected to the way Arch builds packages, and I’ve managed to identify a workaround. I filed a bug report with the R package for Arch, see https://bugs.archlinux.org/task/74609 . Thanks for reopening, though!
I’m having the very same problem as the now closed issue #35, also when installing using BiocManager:
It seems that the linker ‘forgets’ about htslib somehow:
I’m also on Arch Linux, with R 4.2.0, Rhtslib 1.28.0, and htslib 1.15.1.
Originally posted by @christophfink in https://github.com/Bioconductor/Rsamtools/issues/35#issuecomment-1113403648