<div style="white-space:pre-wrap">I need to make some changes to stripper tonight.  Just to give you a heads up.</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Nov 28, 2016 at 2:13 PM Dean Bodenham <<a href="mailto:deanbodenhambsse@gmail.com">deanbodenhambsse@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div class="gmail_msg">Dear Dirk,</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Thank you for your last email - your suggestion worked perfectly!</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">To be clear (for others), creating a ~/.R/Makevars file containing:</div></div><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">DYLIB_LDFLAGS = -shared -fopenmp# $(CFLAGS) $(CPICFLAGS)</div><div class="gmail_msg">SHLIB_CXXLDFLAGS = -shared</div><div class="gmail_msg">SHLIB_CXX1XLDFLAGS = -shared</div><div class="gmail_msg">SHLIB_FCLDFLAGS = -shared</div><div class="gmail_msg">SHLIB_LDFLAGS = -shared# $(CFLAGS) $(CPICFLAGS)</div></div><div dir="ltr" class="gmail_msg"><div class="gmail_msg">PKG_LIBS= -Wl,-S</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">(where the first five lines are from /etc/R/Makeconf) resulted in a much smaller ffstream.so for me on Ubuntu 16.04.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I have just started playing around with Dan's r-stripper, but have not quite got it working yet.</div></div><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Dean </div></div><div class="gmail_extra gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg">On Sat, Nov 26, 2016 at 4:59 PM, Dan Dillon <span dir="ltr" class="gmail_msg"><<a href="mailto:dcdillon@gmail.com" class="gmail_msg" target="_blank">dcdillon@gmail.com</a>></span> wrote:<br class="gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">Dean,<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">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 <a href="https://github.com/dcdillon/r-stripper" class="gmail_msg" target="_blank">https://github.com/dcdillon/r-stripper</a>.  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.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">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".</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Thanks,</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Dan</div></div><div class="gmail_extra gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg"><div class="m_-1786942406420644306h5 gmail_msg">On Sat, Nov 26, 2016 at 7:55 AM, Dirk Eddelbuettel <span dir="ltr" class="gmail_msg"><<a href="mailto:edd@debian.org" class="gmail_msg" target="_blank">edd@debian.org</a>></span> wrote:<br class="gmail_msg"></div></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_msg"><div class="m_-1786942406420644306h5 gmail_msg"><span class="gmail_msg"><br class="gmail_msg">
On 26 November 2016 at 12:22, Dean Bodenham wrote:<br class="gmail_msg">
| Dear Dirk, <br class="gmail_msg">
|<br class="gmail_msg">
| Thank you very much for your detailed replies! <br class="gmail_msg">
|<br class="gmail_msg">
| The Ubuntu system does indeed seem to be using the -g flag. I did try a local<br class="gmail_msg">
| compile/installation with the ~/.R/Makevars file you suggested, but couldn't<br class="gmail_msg">
| quite get it to work - I get warnings "linking not done" for the .o files, and<br class="gmail_msg">
| then an error that the "ffstream.so" file is not found.<br class="gmail_msg">
<br class="gmail_msg">
</span>Well "it worked me for" but a better approach entirely outside of your<br class="gmail_msg">
package may be to take<br class="gmail_msg">
<br class="gmail_msg">
  edd@max:~$ grep shared /etc/R/Makeconf<br class="gmail_msg">
  DYLIB_LDFLAGS = -shared -fopenmp# $(CFLAGS) $(CPICFLAGS)<br class="gmail_msg">
  SHLIB_CXXLDFLAGS = -shared<br class="gmail_msg">
  SHLIB_CXX1XLDFLAGS = -shared<br class="gmail_msg">
  SHLIB_FCLDFLAGS = -shared<br class="gmail_msg">
  SHLIB_LDFLAGS = -shared# $(CFLAGS) $(CPICFLAGS)<br class="gmail_msg">
  edd@max:~$<br class="gmail_msg">
<br class="gmail_msg">
and add them to ~/.R/Makevars as<br class="gmail_msg">
<br class="gmail_msg">
  DYLIB_LDFLAGS = -shared -fopenmp# $(CFLAGS) $(CPICFLAGS)<br class="gmail_msg">
  SHLIB_CXXLDFLAGS = -shared<br class="gmail_msg">
  SHLIB_CXX1XLDFLAGS = -shared<br class="gmail_msg">
  SHLIB_FCLDFLAGS = -shared<br class="gmail_msg">
  SHLIB_LDFLAGS = -shared# $(CFLAGS) $(CPICFLAGS)<br class="gmail_msg">
<br class="gmail_msg">
When I do that without/with the change I get<br class="gmail_msg">
<br class="gmail_msg">
  edd@max:/tmp/ffstream$ ls -lh ffstream*/src/ffstream.so<br class="gmail_msg">
  -rwxrwxr-x 1 edd edd 9.0M Nov 26 07:52 ffstream.orig/src/ffstream.so<br class="gmail_msg">
  -rwxrwxr-x 1 edd edd 734K Nov 26 07:52 ffstream/src/ffstream.so<br class="gmail_msg">
  edd@max:/tmp/ffstream$<br class="gmail_msg">
<br class="gmail_msg">
I think it is an issue worth raising with on r-devel and I may do so.<br class="gmail_msg">
<span class="m_-1786942406420644306m_7258313908346336600im m_-1786942406420644306m_7258313908346336600HOEnZb gmail_msg"><br class="gmail_msg">
Dirk<br class="gmail_msg">
<br class="gmail_msg">
--<br class="gmail_msg">
<a href="http://dirk.eddelbuettel.com" rel="noreferrer" class="gmail_msg" target="_blank">http://dirk.eddelbuettel.com</a> | @eddelbuettel | <a href="mailto:edd@debian.org" class="gmail_msg" target="_blank">edd@debian.org</a><br class="gmail_msg">
</span></div></div><div class="m_-1786942406420644306m_7258313908346336600HOEnZb gmail_msg"><div class="m_-1786942406420644306m_7258313908346336600h5 gmail_msg">_______________________________________________<br class="gmail_msg">
Rcpp-devel mailing list<br class="gmail_msg">
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org" class="gmail_msg" target="_blank">Rcpp-devel@lists.r-forge.r-project.org</a><br class="gmail_msg">
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br class="gmail_msg">
</div></div></blockquote></div><br class="gmail_msg"></div>
</blockquote></div><br class="gmail_msg"></div>
</blockquote></div>