RGLab / cytolib

c++ library for representing and interacting the gated cytometry data structure
GNU Affero General Public License v3.0
12 stars 11 forks source link

cytolib.dylib vs .so extension on macOS with R 4 #44

Closed jmarshall closed 3 years ago

jmarshall commented 4 years ago

The cytolibLibPath function returns the path to the shared library, and commit 3ca3d46cdb927d2036f423ab65a236d818c98563 (October 2019) changed it from cytolib.dylib to cytolib.so on macOS.

In building Bioconda's bioconductor-cytolib package for R 4.0.3 / Bioconductor 3.12, I found that the library was built as cytolib.dylib and I needed to revert this change to make packages that use cytolib work correctly. Without this change back to .dylib any attempt to use the bioconda-built cytolib produced:

> library(cytolib)
Warning message:
In fun(libname, pkgname) : cytolib library  not found.

and dlopen() errors complaining that various function symbols supplied by the library could not be resolved. (Notice the double space in library … not indicating that the string returned was the empty string.)

See bioconda/bioconda-recipes#25292, in particular @dpryan79's comment hinting that .so may have been needed on macOS for R 3.6 but is no longer correct for R 4.

mikejiang commented 4 years ago

But bioconductor still seems to build so file http://bioconductor.org/checkResults/3.12/bioc-LATEST/cytolib/merida1-install.html

dpryan79 commented 4 years ago

The Bioconductor build system doesn't represent the diversity of user systems.

jmarshall commented 4 years ago

Perhaps the thing to do would be to take advantage of SHLIB_EXT from etc/Makeconf rather than have cytolibLibPath contain its own per-platform guesses.

FerranC96 commented 3 years ago

I'm having the same issue with R.0.3 on macOS. Trying to get flowCore installed through conda seems to succeed but then the package can't be loaded within R (). The culprit seems to be cytolib which doesn't with library() either [showing the error in OP) . Could anyone point me in the right direction on how to get cytolib running? I would need it to get it working through conda since I need to deploy some code relying on it and can't go around manually changing the cytoLibPath function. Thanks!

mikejiang commented 3 years ago

try the latest bioc devel, cytolib is static lib now.

jmarshall commented 3 years ago

This is fixed in the bioconda package now. Bioconda of course packages the bioconductor stable release.

I assume the static library will appear in Bioconductor 3.13? In any case, as on your development branch the library is static and the cytolibLibPath function no longer appears, this bug in its original form is clearly fixed.

FerranC96 commented 3 years ago

I'm having the same issue with R.0.3 on macOS. Trying to get flowCore installed through conda seems to succeed but then the package can't be loaded within R (). The culprit seems to be cytolib which doesn't with library() either [showing the error in OP) . Could anyone point me in the right direction on how to get cytolib running? I would need it to get it working through conda since I need to deploy some code relying on it and can't go around manually changing the cytoLibPath function. Thanks!

@jmarshall 's fix is now live on bioconda and completely fixes the issue with cytolib.! Additionally, I can also confirm that the issues with loading flowCore are no longer present now that cytolib works as intended. Thanks again @jmarshall !