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

Ulrich Bodenhofer bodenhofer at bioinf.jku.at
Mon Mar 23 14:38:13 CET 2015


Hi Nate,

Thanks a lot for your really quick help, your updated suggestions really 
work great! I could not yet take advantage from the new version of 
VariantAnnotation, since the changes have not been propagated to the 
package archive. It seems that currently many packages are broken, 
especially on Windows 
(http://bioconductor.org/checkResults/3.1/bioc-LATEST/), so I downloaded 
the previous version of VariantAnnotation, changed the Makevars file 
according to your suggestions, and built my own VariantAnnotation 
package. This worked instantly, so the issue is closed for me, thanks a 
lot again!

Best regards,
Ulrich


On 03/20/2015 11:02 PM, Nathaniel Hayden wrote:
> I've updated the Rsamtools Using samtools C libraries vignette. I've 
> also updated VariantAnnotation and other packages that link to 
> samtools libraries. They should be available tomorrow, or you can 
> download the source from subversion if you're in a hurry.
>
> Before you had for your Makevars (with the .Platform addition):
> 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)
>
> But if you just tweak it so that the .Platform[["r_arch"]] is the 
> second argument to system.file it will automatically add the path 
> separator in a platform-appropriate way (the path separator is not "/" 
> across all platforms):
> SAMTOOLS_PATH=\
>     `echo 'cat(system.file("usrlib", .Platform[["r_arch"]], \
>         package="Rsamtools", mustWork=TRUE))' |\
>         "${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)
>
> The change is reflected in the new vignette. Please let me know if 
> this doesn't work for you. Thanks.
>
> On 03/20/2015 10:02 AM, Nathaniel Hayden wrote:
>> The Makevars.win you say works for Windows is the current recommendation
>> for Makevars.win in the Rsamtools Using samtools C libraries vignette.
>> Regarding the Linux issue, yes, the r_arch argument to configure is
>> adding the intermediate subdirectory. It is my fault the current (Linux)
>> recommendation does not account for that. I was not aware ${R_ARCH} was
>> ever non-empty string on Linux. I will update the documentation. Thanks
>> for pointing it out!
>>
>> On 03/20/2015 06:39 AM, Ulrich Bodenhofer wrote:
>>> [list admins: please delete my previous incomplete message from the
>>> list; sorry for any inconvenience]
>>>
>>> Hi,
>>>
>>> Next update (I am deeply sorry for sending so many replies, but I
>>> think these might be interesting for users who face the same issues):
>>> I did another clean install on Windows and used the following
>>> Makevars.win (which I copied from VariantAnnotation):
>>>
>>>      SAMVARS=$(shell echo 'cat(system.file("usretc",
>>>      .Platform[["r_arch"]],\
>>>          "Rsamtools.mk", package="Rsamtools", mustWork=TRUE))' |\
>>>          "${R_HOME}/bin/R" --vanilla --slave)
>>>      include $(SAMVARS)
>>>
>>>      PKG_LIBS=$(SAMTOOLS_LIBS)
>>>      PKG_CPPFLAGS=$(SAMTOOLS_CPPFLAGS)
>>>
>>> Note that last two lines. I have no clue where the two variables
>>> SAMTOOLS_LIBS and SAMTOOLS_CPPFLAGS should come from, but this works
>>> on Windows, both for VariantAnnotation and my package. For Linux, the
>>> change to Makevars that I posted earlier worked, but I still cannot
>>> install VariantAnnotation 1.13.41 from source on Linux.
>>>
>>> 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
>>>>>



More information about the Bioc-devel mailing list