Skip to content
Prev 18022 / 21312 Next

[Bioc-devel] lazy loading failure on macOS

Hi Waldir,

Like with this other post 
https://stat.ethz.ch/pipermail/bioc-devel/2021-April/018035.html this 
problem also seems to be related to an issue with the most recent 
versions of rgl.

Here is what I did:

- I went on machv2 (our Mac builder for the devel builds), which has the 
latest rgl (0.106.8) and ran:

   machv2:$ R CMD INSTALL cellmigRation
   * installing to library 
?/Library/Frameworks/R.framework/Versions/4.1/Resources/library?
   * installing *source* package ?cellmigRation? ...
   ** using staged installation
   ** R
   ** data
   ** inst
   ** byte-compile and prepare package for lazy loading
   ERROR: lazy loading failed for package ?cellmigRation?
   * removing 
?/Library/Frameworks/R.framework/Versions/4.1/Resources/library/cellmigRation?

   This is what you see on the build report. Unfortunately 'R CMD 
INSTALL' doesn't display anything useful here.

- However, after downgrading rgl to version 0.105.22, I can do:

   machv2:$ R CMD INSTALL cellmigRation
   * installing to library 
?/Library/Frameworks/R.framework/Versions/4.1/Resources/library?
   * installing *source* package ?cellmigRation? ...
   ** using staged installation
   ** R
   ** data
   ** inst
   ** byte-compile and prepare package for lazy loading
   Warning: 'rgl.init' failed, running with 'rgl.useNULL = TRUE'.
   ** help
   *** installing help indices
   ** building package indices
   ** installing vignettes
   ** testing if installed package can be loaded from temporary location
   Warning: 'rgl.init' failed, running with 'rgl.useNULL = TRUE'.
   ** testing if installed package can be loaded from final location
   Warning: 'rgl.init' failed, running with 'rgl.useNULL = TRUE'.
   ** testing if installed package keeps a record of temporary 
installation path
   * DONE (cellmigRation)

   Works without problem although there's a suspicious warning 
apparently coming from rgl.

Note that you only use rgl in your plot3DTracks() and plot3DAllTracks() 
functions so maybe it's not necessary to make rgl a "hard" dependency of 
your package. You could make it a "soft" dependency instead by moving it 
to the Suggests field. Then all you need to do is to edit the man pages 
for plot3DTracks() and plot3DAllTracks() to mention that these functions 
require rgl to work, and add something like

         if (!requireNamespace("rgl", quietly=TRUE))
             stop("Couldn't load the rgl package. Please install ",
                  "the rgl package in order to use plot3DTracks().")

at the beginning of the function's bodies.

That should at least solve the 'R CMD INSTALL cellmigRation' problem.

Then wait a couple of days and see what happens on the build report. If 
the plot3DTracks() and/or plot3DAllTracks() examples fail on machv2 
(during 'R CMD check'), then you'll need to disable them on Mac by 
wrapping them inside something like:

   if (Sys.info()[["sysname"]] != "Darwin") {
       ...
       ...
   }

Hope this helps,

H.
On 4/27/21 2:15 AM, Waldir Leoncio Netto wrote: