Make compiled files smaller than 5MB for Bioconductor submission?

Hello! I am working on an R package (GitHub - campbio/decontX: Methods for decontamination of single cell data) that used RStan and rstantools, and I am working to submit this package to the Bioconductor. However, it was rejected because src/DecontX.so and src/stanExports_shrinkage.o are more than 5MB. I am wondering if anyone has suggestions on how to make these files smaller?

Not sure if this is helpful information, but I am using rstan::vb to do inference and retrieve the point estimate after the inference (see how I used it: decontX/stan_helpers.R at main · campbio/decontX · GitHub). So there is no sampling involved.

Thank you for any help!

I’m not sure how it’s compiling now, but GCC has directives to minimize size (usually at the expense of efficiency). First, you want to make sure it compiles without any debug info (-g0 for GCC) and that it compiles optimized for size (-Os for GCC). You can customize our make flags in make.local file as laid out in the RStan doc.

You might also try just having the user build the binaries, but that will require a C++ toolchain (but then you already have that if you have installed RStan).

I’ve just built your package locally and didn’t run into the same issue. Would you be able to share the rejection note/letter? There might be some more information in there

Hi Bob, thanks for looking into the issue! I am not able to find make.local file in the package dir. I followed the rstantools tutorial to create the backbone of the package. I have Makevars files (

) that has make flags but there are comments in them saying they are created by rstantools and should not be editted by hand. Is the make.local file something I can add to the package dir and rebuild the package? I am pretty new to this so really appreciate your detailed help!

Hey Andew, thanks for looking into the issue! I don’t have issue building the package. It’s the message thrown when I try to submit the package to bioconductor that 2 files are over 5MB, see the link. I also have a local screenshot to show the 2 files sizes on my local machine.

When you submit packages you should not include the .o and .so files, as these are compiled and created on installation. I’d suggest removing these files and submitting again

1 Like

Aww works like a charm! Thanks :D