[R-pkg-devel] Portable method of stripping debug symbols
thibault.vatter at gmail.com
Thu Jan 4 00:27:44 CET 2018
We faced a problem when we tried Dirk's solution for our package
rvinecopulib: there is a strip binary on OS X but it doesn't work as the
As such, to avoid calling OS X's strip which doesn't work, we use:
if test -e "/usr/bin/strip" & test -e "/bin/uname" & [[ `uname` == "Linux"
]] ; then /usr/bin/strip --strip-debug $(SHLIB); fi
Hope this helps,
On Wed, Jan 3, 2018 at 11:13 PM, Dirk Eddelbuettel <edd at debian.org> wrote:
> On 3 January 2018 at 21:59, Christopher Lalansingh wrote:
> | I'm running into troubles with the total size of my package and I've
> found that when using Rcpp, one can reduce the size of shared objects by
> stripping out debug symbols by including `-Wl,-S' in PKG_LIBS.
> Unfortunately this is not portable with Solaris, and using ifeq in my
> Makevars file to check for SunOS isn't portable either.
> | I came across an Issue on github (https://github.com/RcppCore/
> Rcpp/issues/522) which addresses possible ways to do this portably, but I
> can't find reference to // [[Rcpp::plugins(strip)]] in any other
> documentation. If anyone has run into this before and has any suggestions
> it would be much appreciated.
> I have two writeups on this in my r^4 series:
> The earlier one has this snippet you can add to src/Makevars, and you could
> even do this conditionally (ie do it on Linux, don't do it on Solaris, or
> other way, or ...)
> strippedLib: $(SHLIB)
> if test -e "/usr/bin/strip"; then /usr/bin/strip --strip-debug
> $(SHLIB); fi
> .phony: strippedLib
> This will strip if and only if there is a strip binary. May work for yuo.
> http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
> R-package-devel at r-project.org mailing list
[[alternative HTML version deleted]]
More information about the R-package-devel