Bioconductor / Rhtslib

HTSlib high-throughput sequencing library as an R package
https://bioconductor.org/packages/Rhtslib
11 stars 12 forks source link

[Mac OS] Post-install test: Unable to load shared object #14

Closed PikalaxALT closed 4 years ago

PikalaxALT commented 5 years ago

I am attempting to install Rhtslib using BiocManager in R 3.6.1 (Catalina Homebrew bottle). The package compiles without error, but R is unable to load it.

Command:

BiocManager::install("Rhtslib")

Result (last few lines of console output):

** installing vignettes
** testing if installed package can be loaded
Error: package or namespace load failed for ‘Rhtslib’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/usr/local/lib/R/3.6/site-library/Rhtslib/libs/Rhtslib.so':
  dlopen(/usr/local/lib/R/3.6/site-library/Rhtslib/libs/Rhtslib.so, 6): Symbol not found: _hts_version
  Referenced from: /usr/local/lib/R/3.6/site-library/Rhtslib/libs/Rhtslib.so
  Expected in: flat namespace
 in /usr/local/lib/R/3.6/site-library/Rhtslib/libs/Rhtslib.so
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/usr/local/lib/R/3.6/site-library/Rhtslib’
hpages commented 5 years ago

Using BiocManager::install("Rhtslib") on Mac should install the binary version of the package but it's hard to know because you're not showing the full output of the command.

Anyway Bioconductor users are not expected to install R or any package from source on Mac. More precisely, they're expected to use the "official R Mac binary" available here:

https://cran.r-project.org/bin/macosx/

This is basically what all Bioconductor users are using on Mac. People who need to use the latest version of R devel use the other "official R Mac binaries" provided here:

https://mac.r-project.org/

The reason why everybody uses this on Mac is that this is what CRAN and Bioconductor also use on their build machines to check packages and build the package binaries. FWIW here are the build results for Rhtslib on the Bioconductor build machines:

https://bioconductor.org/checkResults/release/bioc-LATEST/Rhtslib/

This means that the package Mac binaries are compatible with the "official R Mac binary". Because binaries are linked to system libraries via hardcoded paths on Mac, there is not guarantee that they'll be compatible with an R that is not installed at the "expected location", like an Homebrew installation of R.

In other words: The 2 main reasons almost everybody uses the "official R Mac binary" is that (1) it allows them to just install the Mac binary packages and these packages will just work, and (2) they don't need to install the developer tools. As a bonus, installing the binaries is much faster than installing from source.

Hope this helps, H.

hpages commented 4 years ago

No news = good news so I guess it's ok to close this.