bertcarnell / lhs

Provides a number of methods for creating and augmenting Latin Hypercube Samples and Orthogonal Array Latin Hypercube Samples
https://bertcarnell.github.io/lhs/
GNU General Public License v3.0
44 stars 8 forks source link

Decrease size of library build to less than 5MB #31

Closed bertcarnell closed 3 years ago

bertcarnell commented 4 years ago

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

bertcarnell commented 3 years ago

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
bertcarnell commented 3 years ago

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?
bertcarnell commented 3 years ago

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

bertcarnell commented 3 years ago

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