Skip to content
Prev 7183 / 21307 Next

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

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: