[Bioc-devel] Linking to Rsamtools does not work on latest R-devel

Martin Morgan mtmorgan at fredhutch.org
Fri Mar 20 17:58:46 CET 2015


On 03/20/2015 04:50 AM, Ulrich Bodenhofer wrote:
> Hi,
>
> Sorry for bothering you with another update on this matter. I changed the
> Makevars file to the following:
>
>     SAMTOOLS_PATH=\
>          `echo 'cat(system.file("usrlib", package="Rsamtools",
>     mustWork=TRUE), .Platform[["r_arch"]], sep="/")' |\
>              "${R_HOME}/bin/R" --vanilla --slave`
>     SAMTOOLS_LIBS="$(SAMTOOLS_PATH)/libbam.a" "$(SAMTOOLS_PATH)/libbcf.a"\
>          "$(SAMTOOLS_PATH)/libtabix.a" -lz -pthread
>     SAMTOOLS_CPPFLAGS=-D_USE_KNETFILE -DBGZF_CACHE -D_FILE_OFFSET_BITS=64 \
>          -D_LARGEFILE64_SOURCE
>
>     PKG_LIBS=$(SAMTOOLS_LIBS)
>     PKG_CPPFLAGS=$(SAMTOOLS_CPPFLAGS)
>
> Note the ".Platform..." in the second line. As to be expected, now it works on
> R-devel 3.2.0. Is this a good approach to use? Should the documentation of
> Rsamtools be updated in that direction or is my R-devel wrongly putting the
> static libs in usrlib/x86_64?

I think on most Linux (well, on mine!) .Platform[["r_arch"]] == "", whereas I 
guess for you it is "x86_64" (via configure and the environment variable 
r_arch). system.file() seems to be robust to adding .Platform[["r_arch"]] when 
it is "", so your change above seems appropriate...

Martin

>
> The Windows problem I reported earlier today is more or less the same: the
> library objects are not found and therefore my package does not find call
> entries for the tabix API functions that I call from my package.
>
> Any help is gratefully appreciated!
>
> Best regards,
> Ulrich
>
>
> On 03/19/2015 06:11 PM, Nathaniel Hayden wrote:
>> Hi, Ulrich. I just built R-devel (on Ubuntu) from trunk and installed
>> Rsamtools using biocLite; the libraries ended up where I expect them:
>> > dir(system.file(package="Rsamtools", "usrlib"))
>> [1] "libbam.a"   "libbcf.a"   "libtabix.a"
>> > sessionInfo()
>> R Under development (unstable) (2015-03-19 r68032)
>> Platform: x86_64-unknown-linux-gnu (64-bit)
>> Running under: Ubuntu 14.04.2 LTS
>>
>> locale:
>>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
>>  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
>>  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
>>  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
>>  [9] LC_ADDRESS=C               LC_TELEPHONE=C
>> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>>
>> attached base packages:
>> [1] parallel  stats4    stats     graphics  grDevices utils datasets
>> [8] methods   base
>>
>> other attached packages:
>> [1] Rsamtools_1.19.44     Biostrings_2.35.11    XVector_0.7.4
>> [4] GenomicRanges_1.19.46 GenomeInfoDb_1.3.14   IRanges_2.1.43
>> [7] S4Vectors_0.5.22      BiocGenerics_0.13.7
>>
>> loaded via a namespace (and not attached):
>> [1] zlibbioc_1.13.2 bitops_1.0-6
>>
>> Have you seen the updated recommendations for linking to the libraries in the
>> Rsamtools Using samtools C libraries vignette?
>> http://bioconductor.org/packages/devel/bioc/vignettes/Rsamtools/inst/doc/Rsamtools-UsingCLibraries.pdf
>>
>>
>> It was a breaking change in how Rsamtools reverse dependencies are supposed to
>> find the libraries prompted by the new R CMD check warnings re: GNU
>> make-specific extensions in non-Windows Makevars.
>>
>> On 03/19/2015 07:59 AM, Ulrich Bodenhofer wrote:
>>> Hi,
>>>
>>>
>>>
>>> I am currently finishing a package for submission to Bioconductor 3.1
>>> and, therefore, I am trying to make everything work on the latest
>>> R-devel, but I have an issue with linking to Rsamtools. It seems that
>>> Rsamtools installs the libraries libbam, libbcf, and libtabix to the
>>> usrlib/x86_64/ directory in its package directory, but packages linking
>>> to Rsamtools seem to expect the libraries in usrlib/. Because of this
>>> problem, neither my package nor other packages relying on Rsamtools,
>>> e.g. VariantAnnotation, can be installed. The check results on
>>> http://bioconductor.org/checkResults/3.1/bioc-LATEST/ tell me that there
>>> is no such issue on the BioC build servers, but the R-devel used on
>>> these machines is much older than mine. Any clues?
>>>
>>>
>>>
>>> I am using "R Under development (unstable) (2015-03-18 r68019)" on
>>> 64-bit Linux which I installed today. However, the problem already
>>> occured on last week's R-devel. The problem is really serious for me
>>> because I cannot test my package as long as it cannot link to Rsamtools.
>>> I want to emphasize that my package passes
>>>
>>> all checks without any errors or warnings on R 3.1.2 and Bioconductor
>>> 3.1. So I do not think I am doing anything wrong (and the developers of
>>> VariantAnnotation neither).
>>>
>>>
>>>
>>> Any help is gratefully appreciated.
>>>
>>>
>>>
>>> Thanks,
>>>
>>> Ulrich
>>>
>>>
>>>
>>> _______________________________________________
>>>
>>> Bioc-devel at r-project.org mailing list
>>>
>>> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>>>
>>>
>>>
>
> _______________________________________________
> Bioc-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel


-- 
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M1 B861
Phone: (206) 667-2793



More information about the Bioc-devel mailing list