[Rcpp-devel] Stripping symbols and Cran

Michaël BENESTY michael at benesty.fr
Mon Sep 18 16:55:59 CEST 2017


Hi all,

Because of (the great) Rcpp, the size of my package was over 5Mb, which was
an issue for a Cran release.

I read with interest this article
http://dirk.eddelbuettel.com/blog/2017/08/14/#009_compact_shared_libraries

In particular, I was interested in the Makevars modification:

strippedLib: $(SHLIB)
        if test -e "/usr/bin/strip"; then /usr/bin/strip --strip-debug
$(SHLIB); fi

Unfortunately it crashed compilation on Mac OS because for some reason
--strip-debug doesn't exist.

But this small modification works:
strippedLib: $(SHLIB)
        if test -e "/usr/bin/strip" & test -e "/bin/uname" & [[
`uname` == "Linux" ]] ; then /usr/bin/strip --strip-debug $(SHLIB); fi

May be there is a way to make strip works correctly on Mac, but as I
have no size issue on both Windows and Mac OS... I don't care.

I thought it was useful enough to share it with you.

Kind regards,

________________
Michaël BENESTY
michael at benesty.fr
Please do not print this e-mail unless you really need to.


More information about the Rcpp-devel mailing list