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