[Rcpp-devel] Large size of libs directory on some systems

Dan Dillon dcdillon at gmail.com
Sat Nov 26 16:59:11 CET 2016


Dean,

I too have been concerned about this and working on a solution for some
time.  I just formalized my work and put it in a repo at
https://github.com/dcdillon/r-stripper.  Basically this script adds the
appropriate commands to the PKG_LIBS variable to cause the linker to strip
the debugging symbols from the shared library that is created.

Feel free to try it out.  Right now it only knows how to do this for gcc,
g++, clang, and clang++ but adding others is no problem as long as I know
how to figure out which linker it is and know the option to pass to the
linker to achieve "stripping".

Thanks,

Dan

On Sat, Nov 26, 2016 at 7:55 AM, Dirk Eddelbuettel <edd at debian.org> wrote:

>
> On 26 November 2016 at 12:22, Dean Bodenham wrote:
> | Dear Dirk,
> |
> | Thank you very much for your detailed replies!
> |
> | The Ubuntu system does indeed seem to be using the -g flag. I did try a
> local
> | compile/installation with the ~/.R/Makevars file you suggested, but
> couldn't
> | quite get it to work - I get warnings "linking not done" for the .o
> files, and
> | then an error that the "ffstream.so" file is not found.
>
> Well "it worked me for" but a better approach entirely outside of your
> package may be to take
>
>   edd at max:~$ grep shared /etc/R/Makeconf
>   DYLIB_LDFLAGS = -shared -fopenmp# $(CFLAGS) $(CPICFLAGS)
>   SHLIB_CXXLDFLAGS = -shared
>   SHLIB_CXX1XLDFLAGS = -shared
>   SHLIB_FCLDFLAGS = -shared
>   SHLIB_LDFLAGS = -shared# $(CFLAGS) $(CPICFLAGS)
>   edd at max:~$
>
> and add them to ~/.R/Makevars as
>
>   DYLIB_LDFLAGS = -shared -fopenmp# $(CFLAGS) $(CPICFLAGS)
>   SHLIB_CXXLDFLAGS = -shared
>   SHLIB_CXX1XLDFLAGS = -shared
>   SHLIB_FCLDFLAGS = -shared
>   SHLIB_LDFLAGS = -shared# $(CFLAGS) $(CPICFLAGS)
>
> When I do that without/with the change I get
>
>   edd at max:/tmp/ffstream$ ls -lh ffstream*/src/ffstream.so
>   -rwxrwxr-x 1 edd edd 9.0M Nov 26 07:52 ffstream.orig/src/ffstream.so
>   -rwxrwxr-x 1 edd edd 734K Nov 26 07:52 ffstream/src/ffstream.so
>   edd at max:/tmp/ffstream$
>
> I think it is an issue worth raising with on r-devel and I may do so.
>
> Dirk
>
> --
> http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
> _______________________________________________
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20161126/2a564837/attachment.html>


More information about the Rcpp-devel mailing list