bertcarnell/lhs

Decrease size of library build to less than 5MB

bertcarnell opened this issue · 4 comments

Fedora Clang build is currently over the 5 MB limit

Version: 1.1.1
Check: installed package size
Result: NOTE
installed size is 5.8Mb
sub-directories of 1Mb or more:
libs 5.4Mb
Flavor: r-devel-linux-x86_64-fedora-clang

https://www.stats.ox.ac.uk/pub/bdr/Rconfig/r-devel-linux-x86_64-fedora-clang

Possible culprits include the sstream and iostream libraries.

  1. ensure c++ libraries are dynamically linked to keep some of the std library functionality out of the library
  2. try to remove sstream and iostream and do everyting in the std::string library

Stripping debug symbols does the trick, but now there are 2 new questions

  1. Is this a good idea? debug symbols are defined by default for shared libraries in R, which means the R core team thinks they are important
  2. The -Wl,-S flag works for g++ and clang++, but will it also work on Solaris? Can I make sure it won't be passed to Solaris?

Another option might be to include directions on how to build and install a debug version.

CRAN checks no longer warn on library size over 5MB. Since other efforts were not successful at addressing for future versions, closing the issue.