Search
Question: Is BiocInstaller::biocLite incompatible with withr::with_makevars?
0
gravatar for mmfansler
10 weeks ago by
mmfansler0
MSKCC | New York, NY
mmfansler0 wrote:

When compiling cram/cram_io.c during installation of Rhtslib, I recieved the following error:

cram/cram_io.c:57:19: fatal error: bzlib.h: No such file or directory
 #include <bzlib.h>

Usually, I can resolve such compiler/linker errors (arising from install.packages) using withr::with_makevars to supplement the package's Makevars with an include or linking directive. In this case I tried

withr::with_makevars(c(CFLAGS="-I/some/dir/include"), biocLite("Rhtslib"), assignment="+=")

Unfortunately, this ended in the same error and the specified flag was not included in the compilation commands. Are BiocInstaller::biocLite and withr::with_makevars incompatible?

In the end, I was able to install Rhtslib with

withr::with_makevars(c(CFLAGS="-I/some/dir/include"), devtools::install_bioc("Rhtslib"), assignment="+=")

I'm mainly just wondering if there is some additional syntax that is needed get with_makevars working with biocLite directly.


Session Info

> sessionInfo()
 R version 3.5.1 (2018-07-02)
 Platform: x86_64-pc-linux-gnu (64-bit)
 Running under: CentOS Linux 7 (Core)

 Matrix products: default
 BLAS: /admin/opt/common/CentOS_7/R/R-3.5.1/lib64/R/lib/libRblas.so
 LAPACK: /admin/opt/common/CentOS_7/R/R-3.5.1/lib64/R/lib/libRlapack.so

 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] stats     graphics  grDevices utils     datasets  methods   base

 loaded via a namespace (and not attached):
 [1] compiler_3.5.1       BiocInstaller_1.30.0 tools_3.5.1
 [4] withr_2.1.2          memoise_1.1.0        knitr_1.20
 [7] digest_0.6.16        devtools_1.13.6

On Mac OS X 10.13, there's a binary for Rhtslib, but I was able to generate a similar include error by forcing installation from source - i.e., biocLite("Rhtslib", type="source") - ending with clang failing to find lzma.h.

ADD COMMENTlink modified 10 weeks ago by Martin Morgan ♦♦ 22k • written 10 weeks ago by mmfansler0
2
gravatar for Martin Morgan
10 weeks ago by
Martin Morgan ♦♦ 22k
United States
Martin Morgan ♦♦ 22k wrote:

When I use devtools::install_bioc() I get a very old version of Rhtslib -- it does a checkout from (our no longer current) svn and installs

> packageVersion("Rhtslib")
[1] '1.9.2'

whereas the current version of Rhtslib (from https://bioconductor.org/packages/Rhtslib) is 1.12.1. I reported this to the devtools repository https://github.com/r-lib/devtools/issues/1858 ; it seems like some problem with the devtools release management, since the problem has been addressed in source for some time.

The underlying problem is that the current Rhtslib doesn't support user-specified flags; I reported this to the Rhtslib git repository https://github.com/Bioconductor/Rhtslib/issues/3

I think you would need to download the source for the package and manually edit src/htslib/Makevars.Rhtslib to correct this in the current version.

ADD COMMENTlink modified 10 weeks ago • written 10 weeks ago by Martin Morgan ♦♦ 22k

Good catch on the outdated devtools::install_bioc! I did think referencing the deprecated SVN was odd, but didn't check the version.

I cloned the Rhtslib repo. First, just to confirm the issue is with Rhtslib and not biocLite, I attempted using with_makevars on install.packages("local/Rhtslib", type="source", repos=NULL), which failed as above. Second, I added my include path to Makevars.Rhtslib, as you suggested. Installing from source then works fine.

BTW, I think you meant to link to the devtools issue you created.

ADD REPLYlink modified 10 weeks ago • written 10 weeks ago by mmfansler0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 398 users visited in the last hour