Question: Is BiocInstaller::biocLite incompatible with withr::with_makevars?
gravatar for mmfansler
15 months ago by
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/
 LAPACK: /admin/opt/common/CentOS_7/R/R-3.5.1/lib64/R/lib/

  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
  [9] LC_ADDRESS=C               LC_TELEPHONE=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 15 months ago by Martin Morgan ♦♦ 24k • written 15 months ago by mmfansler0
Answer: Is BiocInstaller::biocLite incompatible with withr::with_makevars?
gravatar for Martin Morgan
15 months ago by
Martin Morgan ♦♦ 24k
United States
Martin Morgan ♦♦ 24k 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 is 1.12.1. I reported this to the devtools repository ; 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

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 15 months ago • written 15 months ago by Martin Morgan ♦♦ 24k

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 15 months ago • written 15 months ago by mmfansler0


This problem should be addressed in Rhtslib 1.17.5. See

If every goes well on tomorrow's build report ( ), I'll port to the RELEASE310 branch.



ADD REPLYlink modified 11 weeks ago • written 12 weeks ago by Hervé Pagès ♦♦ 14k

I backported the fix yesterday to Rhtslib 1.16.2. Rhtslib 1.16.2 should become available via BiocManager::install() in the next 24h or so.



ADD REPLYlink written 11 weeks ago by Hervé Pagès ♦♦ 14k

Rhtslib 1.16.2 is now available:



ADD REPLYlink written 11 weeks ago by Hervé Pagès ♦♦ 14k
Please log in to add an answer.


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