From: "Dan Tenenbaum" <dtenenba at fredhutch.org>
To: "Aaron Lun" <alun at wehi.EDU.AU>
Cc: "bioc-devel" <bioc-devel at r-project.org>
Sent: Tuesday, May 24, 2016 8:51:30 AM
Subject: Re: [Bioc-devel] problems linking to Rhtslib on Mac OSX
----- Original Message -----
From: "Aaron Lun" <alun at wehi.EDU.AU>
To: "bioc-devel" <bioc-devel at r-project.org>
Sent: Tuesday, May 24, 2016 8:06:13 AM
Subject: Re: [Bioc-devel] problems linking to Rhtslib on Mac OSX
Dear Martin and List,
I have a problem with linking to Rhtslib on Mac OSX when my R installation
directory differs from the package installation directory. Trying to load csaw
(Bioc release version) gives me:
# ... whole lot of dependencies...
Loading required package: csaw
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object
'/Users/lun01/Library/R/3.3/library/csaw/libs/csaw.so':
dlopen(/Users/lun01/Library/R/3.3/library/csaw/libs/csaw.so, 6): Library not
loaded:
/Library/Frameworks/R.framework/Versions/3.3/Resources/library/Rhtslib/lib/libhts.0.dylib
Referenced from: /Users/lun01/Library/R/3.3/library/csaw/libs/csaw.so
Reason: image not found
... which is because my Rhtslib shared library is sitting instead at
/Users/lun01/Library/R/3.3/library/Rhtslib/lib/libhts.0.dylib (along with all
my other non-recommended, non-base packages). I presume this linking failure
occurs because the Makevars file (which would normally indicate where the
shared library is living) doesn't get run when installing a prebuilt binary?
The same issue occurs with deepSNV, which is the other package that links to
Rhtslib.
I can't reproduce this issue after installing the binaries of csaw and Rhtslib.
I believe that htslib is statically linked inside of Rhtslib so you don't need
your own installation of htslib on your machine in order to use it.If you look
at the Mac tarball
(https://bioconductor.org/packages/release/bioc/bin/macosx/mavericks/contrib/3.3/Rhtslib_1.4.2.tgz)
untar it and go to the Rhtslib/lib directory you see the following files:
libhts.0.dylib
libhts.a
libhts.dylib
...in addition to Rhtslib.so which is in Rhtslib/libs.