lawremi / rtracklayer

R interface to genome annotation files and the UCSC genome browser
Other
29 stars 17 forks source link

Hardcoded openssl version requirement conflicts with Mac Homebrew #32

Open ScottNortonPhD opened 4 years ago

ScottNortonPhD commented 4 years ago

Mac Homebrew has deprecated openssl 1.0.0 in favor of 1.1.0. This means that the older version of the library is substantially harder to acquire. Unfortunately, rtracklayer seems to have hardcoded the openssl-1.0.0 version dependency, so replacing it with 1.1.0 (which is required by other Homebrew packages) causes rtracklayer to break when trying to load. Everything that depends on rtracklayer breaks as well. The installation process uses the correct paths, but attempting to load rtracklayer at any point fails because somehow, somewhere, the path /usr/local/opt/openssl/libssl.1.0.0.dylib path is hardcoded.

As a workaround, repointing /usr/local/opt/openssl to the 1.0.2t directory in my Cellar allows me to install and run rtracklayer.

See messages below.

> library(rtracklayer)  # installed before openssl upgrade was forced
Loading required package: GenomicRanges
Loading required package: stats4
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: ‘BiocGenerics’

The following objects are masked from ‘package:parallel’:

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from ‘package:stats’:

    IQR, mad, sd, var, xtabs

The following objects are masked from ‘package:base’:

    anyDuplicated, append, as.data.frame, basename, cbind, colnames,
    dirname, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
    grepl, intersect, is.unsorted, lapply, Map, mapply, match, mget,
    order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
    rbind, Reduce, rownames, sapply, setdiff, sort, table, tapply,
    union, unique, unsplit, which, which.max, which.min

Loading required package: S4Vectors

Attaching package: ‘S4Vectors’

The following object is masked from ‘package:base’:

    expand.grid

Loading required package: IRanges
Loading required package: GenomeInfoDb
Error: package or namespace load failed for ‘rtracklayer’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/usr/local/lib/R/4.0/site-library/rtracklayer/libs/rtracklayer.so':
  dlopen(/usr/local/lib/R/4.0/site-library/rtracklayer/libs/rtracklayer.so, 6): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /usr/local/lib/R/4.0/site-library/rtracklayer/libs/rtracklayer.so
  Reason: image not found

> BiocManager::install("rtracklayer")  # to try and force it to use openssl 1.1.1h
Bioconductor version 3.11 (BiocManager 1.30.10), R 4.0.3 (2020-10-10)
Installing package(s) 'rtracklayer'
trying URL 'https://bioconductor.org/packages/3.11/bioc/src/contrib/rtracklayer_1.48.0.tar.gz'
Content type 'application/x-gzip' length 4012631 bytes (3.8 MB)
==================================================
downloaded 3.8 MB

* installing *source* package ‘rtracklayer’ ...
** using staged installation
checking for pkg-config... /usr/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for OPENSSL... yes
configure: creating ./config.status
config.status: creating src/Makevars
** libs
clang -I"/usr/local/Cellar/r/4.0.3/lib/R/include" -DNDEBUG -I/usr/local/Cellar/openssl@1.1/1.1.1h/include -DUSE_SSL -D_FILE_OFFSET_BITS=64 -I'/usr/local/lib/R/4.0/site-library/S4Vectors/include' -I'/usr/local/lib/R/4.0/site-library/IRanges/include' -I'/usr/local/lib/R/4.0/site-library/XVector/include' -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/include   -fPIC  -g -O2  -c S4Vectors_stubs.c -o S4Vectors_stubs.o

# TRIMMED

clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/Cellar/r/4.0.3/lib/R/lib -L/usr/local/opt/gettext/lib -L/usr/local/opt/readline/lib -L/usr/local/lib -o rtracklayer.so S4Vectors_stubs.o IRanges_stubs.o XVector_stubs.o R_init_rtracklayer.o readGFF.o bigWig.o chain_io.o twoBit.o handlers.o utils.o ucsc/bPlusTree.o ucsc/bbiRead.o ucsc/bbiWrite.o ucsc/bwgCreate.o ucsc/bwgQuery.o ucsc/cirTree.o ucsc/common.o ucsc/dnaseq.o ucsc/dnautil.o ucsc/errAbort.o ucsc/hash.o ucsc/linefile.o ucsc/localmem.o ucsc/sqlNum.o ucsc/zlibFace.o ucsc/dystring.o ucsc/hmmstats.o ucsc/obscure.o ucsc/pipeline.o ucsc/rangeTree.o ucsc/rbTree.o ucsc/memalloc.o ucsc/dlist.o ucsc/udc.o ucsc/net.o ucsc/bits.o ucsc/twoBit.o ucsc/_cheapcgi.o ucsc/internet.o ucsc/https.o ucsc/base64.o ucsc/verbose.o ucsc/os.o ucsc/wildcmp.o ucsc/_portimpl.o -lz -pthread -L/usr/local/Cellar/openssl@1.1/1.1.1h/lib -lssl -lcrypto -L/usr/local/Cellar/r/4.0.3/lib/R/lib -lR -lintl -Wl,-framework -Wl,CoreFoundation
installing to /usr/local/lib/R/4.0/site-library/00LOCK-rtracklayer/00new/rtracklayer/libs
** R
** data
** demo
** inst
** byte-compile and prepare 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 from temporary location
Error: package or namespace load failed for ‘rtracklayer’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/usr/local/lib/R/4.0/site-library/00LOCK-rtracklayer/00new/rtracklayer/libs/rtracklayer.so':
  dlopen(/usr/local/lib/R/4.0/site-library/00LOCK-rtracklayer/00new/rtracklayer/libs/rtracklayer.so, 6): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /usr/local/lib/R/4.0/site-library/00LOCK-rtracklayer/00new/rtracklayer/libs/rtracklayer.so
  Reason: image not found
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/usr/local/lib/R/4.0/site-library/rtracklayer’
* restoring previous ‘/usr/local/lib/R/4.0/site-library/rtracklayer’

The downloaded source packages are in
    ‘/private/var/folders/xg/1clp6x614c722qd1qvmwc72h0000gn/T/RtmpAoIfON/downloaded_packages’
lawremi commented 4 years ago

It's not hard coded to use 1.0, but it is linking the shared object to 1.0, which is then not found at runtime. You might look around for a stray libssl 1.0, such as in /usr/local/lib.

ScottNortonPhD commented 2 years ago

Has any work been done relating to this issue? The problem seems to rise from the configure script. There is a workaround but it really shouldn't be necessary.

First, install openssl@1.0 via Homebrew. Next, unlink the existing openssl. Manually create a symlink from /usr/local/opt/openssl@1.0 to /usr/local/opt/openssl. Configuration should proceed as normal.

Frustratingly, if the user specifies their own PKG_CONFIG_PATH in configure.vars, the configure script flat out ignores it on mac. It also appears to ignore the manual override of OPENSSL_LIBS and OPENSSL_CFLAGS, though I cannot parse why that happens from this portion of the script.