Unable to load/install rtracklayer (v1.33.2) on OS X (possibly SSL-related?)
1
0
Entering edit mode
Peter Hickey ▴ 740
@petehaitch
Last seen 14 days ago
WEHI, Melbourne, Australia

I could do with some help figuring out why I can't load/properly install rtracklayer (v1.33.2) on my laptop running OS X. The error message suggests to me some issue with SSL, but I don't really understand what's going wrong. Please let me know if I can provide additional information to help solve this (I had to trim the output in order to get post under 15000 characters)

Help is much appreciated,

Pete
 

Just realised I have multiple versions of openssl  installed (unsure if helpful)

# Version installed by conda (and default on my system)
peters-mbp-2:~ Peter$ which openssl
/Users/Peter/anaconda/bin/openssl
peters-mbp-2:~ Peter$ openssl version
OpenSSL 1.0.2g  1 Mar 2016
# Version install by homebrew
peters-mbp-2:~ Peter$ /usr/local/Cellar/openssl/1.0.2d_1/bin/openssl version
OpenSSL 1.0.2d 9 Jul 2015

R details

> library(BiocInstaller)
Bioconductor version 3.4 (BiocInstaller 1.23.4), ?biocLite for help
> biocLite('rtracklayer')
BioC_mirror: https://bioconductor.org
Using Bioconductor 3.4 (BiocInstaller 1.23.4), R 3.3.0 (2016-05-03).
Installing package(s) ‘rtracklayer’
trying URL 'https://bioconductor.org/packages/3.4/bioc/bin/macosx/mavericks/contrib/3.3/rtracklayer_1.33.2.tgz'
Content type 'application/x-gzip' length 1908273 bytes (1.8 MB)
==================================================
downloaded 1.8 MB

The downloaded binary packages are in
    /var/folders/f1/6pjy5xbn0_9_7xwq6l7fj2yc0000gn/T//RtmpzfApQX/downloaded_packages

> suppressPackageStartupMessages(library(rtracklayer))
Error in dyn.load(file, DLLpath = DLLpath, ...) :
  unable to load shared object '/Library/Frameworks/R.framework/Versions/3.3/Resources/library/rtracklayer/libs/rtracklayer.so':
  dlopen(/Library/Frameworks/R.framework/Versions/3.3/Resources/library/rtracklayer/libs/rtracklayer.so, 6): Symbol not found: _BIO_new_ssl_connect
  Referenced from: /Library/Frameworks/R.framework/Versions/3.3/Resources/library/rtracklayer/libs/rtracklayer.so
  Expected in: flat namespace
 in /Library/Frameworks/R.framework/Versions/3.3/Resources/library/rtracklayer/libs/rtracklayer.so
Error: package or namespace load failed for ‘rtracklayer’

Trying to install from source ultimately leads to the same error (and looks like openssl isn't being picked up by configure?):
 

> biocLite("rtracklayer", type = "source")
BioC_mirror: https://bioconductor.org
Using Bioconductor 3.4 (BiocInstaller 1.23.4), R 3.3.0 (2016-05-03).
Installing package(s) ‘rtracklayer’
trying URL 'https://bioconductor.org/packages/3.4/bioc/src/contrib/rtracklayer_1.33.2.tar.gz'
Content type 'application/x-gzip' length 1378796 bytes (1.3 MB)
==================================================
downloaded 1.3 MB

* installing *source* package ‘rtracklayer’ ...
checking for pkg-config... /usr/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for OPENSSL... no
configure: creating ./config.status
config.status: creating src/Makevars
** libs
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/openssl/include -DUSE_SSL -D_FILE_OFFSET_BITS=64 -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.3/Resources/library/S4Vectors/include" -I"/Library/Frameworks/R.framework/Versions/3.3/Resources/library/IRanges/include" -I"/Library/Frameworks/R.framework/Versions/3.3/Resources/library/XVector/include"   -fPIC  -Wall -mtune=core2 -g -O2  -c S4Vectors_stubs.c -o S4Vectors_stubs.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/openssl/include -DUSE_SSL -D_FILE_OFFSET_BITS=64 -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.3/Resources/library/S4Vectors/include" -I"/Library/Frameworks/R.framework/Versions/3.3/Resources/library/IRanges/include" -I"/Library/Frameworks/R.framework/Versions/3.3/Resources/library/XVector/include"   -fPIC  -Wall -mtune=core2 -g -O2  -c IRanges_stubs.c -o IRanges_stubs.o

# Clip a bunch of output in order for post to have <= 15000 characters

installing to /Library/Frameworks/R.framework/Versions/3.3/Resources/library/rtracklayer/libs
** R
** data
** demo
** inst
** preparing package for lazy loading
Creating a generic function for ‘offset’ from package ‘stats’ in package ‘rtracklayer’
Creating a generic function from function ‘uri’ in package ‘rtracklayer’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
  unable to load shared object '/Library/Frameworks/R.framework/Versions/3.3/Resources/library/rtracklayer/libs/rtracklayer.so':
  dlopen(/Library/Frameworks/R.framework/Versions/3.3/Resources/library/rtracklayer/libs/rtracklayer.so, 6): Symbol not found: _BIO_new_ssl_connect
  Referenced from: /Library/Frameworks/R.framework/Versions/3.3/Resources/library/rtracklayer/libs/rtracklayer.so
  Expected in: flat namespace
 in /Library/Frameworks/R.framework/Versions/3.3/Resources/library/rtracklayer/libs/rtracklayer.so
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/rtracklayer’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/rtracklayer’

The downloaded source packages are in
    ‘/private/var/folders/f1/6pjy5xbn0_9_7xwq6l7fj2yc0000gn/T/RtmpzfApQX/downloaded_packages’
Warning message:
In install.packages(pkgs = doing, lib = lib, ...) :
  installation of package ‘rtracklayer’ had non-zero exit status

Here's my session info:
 

> sessionInfo()
R version 3.3.0 (2016-05-03)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.4 (El Capitan)

locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8

attached base packages:
[1] stats4    parallel  stats     graphics  grDevices utils     datasets
[8] methods   base

other attached packages:
[1] GenomicRanges_1.25.0 GenomeInfoDb_1.9.1   IRanges_2.7.1
[4] S4Vectors_0.11.2     BiocGenerics_0.19.0  BiocInstaller_1.23.4
[7] repete_0.0.0.9004    devtools_1.11.1

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.5                XVector_0.13.0
 [3] magrittr_1.5               GenomicAlignments_1.9.0
 [5] zlibbioc_1.19.0            BiocParallel_1.7.2
 [7] munsell_0.4.3              colorspace_1.2-6
 [9] stringr_1.0.0              plyr_1.8.3
[11] tools_3.3.0                SummarizedExperiment_1.3.2
[13] Biobase_2.33.0             withr_1.0.1
[15] digest_0.6.9               pryr_0.1.2
[17] bitops_1.0-6               codetools_0.2-14
[19] RCurl_1.95-4.8             memoise_1.0.0
[21] stringi_1.1.1              Rsamtools_1.25.0
[23] Biostrings_2.41.1          scales_0.4.0
[25] XML_3.98-1.4
rtracklayer bioc-devel ssl openssl • 3.9k views
ADD COMMENT
1
Entering edit mode
@michael-lawrence-3846
Last seen 2.9 years ago
United States

When building from source on the Mac, it looks specifically for the homebrew installation, even if the pkg-config query fails. I guess the conda openssl is coming first on the search path, so you end up with a binary incompatibility. I think you can fix this by setting the DYLD_LIBRARY_PATH environment variable to point to the directory containing the homebrew-installed library. I guess you will want to do this inside .Renviron so that it always works.

One general concern is that if the distributed Mac binary depends on having openssl available at run time, many will not be able to load rtracklayer. We might want to consider not building with openssl support on the Mac, or perhaps not distributing a binary at all. Another idea would be to automatically install openssl via homebrew, although I'm not sure it's worth it given how SSL support for bigwig files is a minor feature of the package.

ADD COMMENT
0
Entering edit mode

Thanks, Michael, but I'm still having problems. I tried the following:

Add DYLD_LIBRARY_PATH="/usr/local/Cellar/openssl/1.0.2d_1/lib" to .Renviron and confirmed this set in a new R session. Re-ran biocLite("rtracklayer", type = "source") and hit same error. 

ADD REPLY
0
Entering edit mode

Do a R CMD ldd path/to/your/rtracklayer.so, trying with and without the DYLD_LIBRARY_PATH. Might also try LD_LIBRARY_PATH.

ADD REPLY
0
Entering edit mode
$ R CMD ldd /Library/Frameworks/R.framework/Versions/3.3/Resources/library/rtracklayer/libs/rtracklayer.so
/Library/Frameworks/R.framework/Resources/bin/Rcmd: line 62: exec: ldd: not found
ADD REPLY
1
Entering edit mode

Sorry you need otool -L instead of ldd on the Mac.  Actually, I tried that myself and found that the libraries were not linking at runtime, and I fixed it just now in rtracklayer 1.33.4. Not sure why it wasn't breaking for me.

ADD REPLY
0
Entering edit mode

Thanks Michael! Would it make sense to backport this change to release?

ADD REPLY
0
Entering edit mode

The bug does not exist in release, since the homebrew support is only in devel (due to the potential for this sort of bug).

ADD REPLY
0
Entering edit mode

Wonderful, that fixed it. Installed from Bioconductor-mirror github repo (without setting DYLD_LIBRARY_PATH or modifying my default openssl or PATH). Thanks for your help, Michael.

ADD REPLY

Login before adding your answer.

Traffic: 837 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6