Thanks Dirk; that's the ticket.<div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Nov 30, 2012 at 6:40 PM, Dirk Eddelbuettel <span dir="ltr"><<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
On 30 November 2012 at 17:16, Thell Fowler wrote:<br>
| Ubuntu precise with clang 3.3 and gcc 4.6.3 with R 2.15.2 and Rcpp 0.10.1 when<br>
| calling sourceCpp gives output I'm not quite understanding...<br>
|<br>
| > sourceCpp("~/src/TestPackageDepends2/inst/examples/CallFunction.cpp",verbose=<br>
| T, rebuild=T)<br>
|<br>
| Generated Rcpp module declaration:<br>
| --------------------------------------------------------<br>
|<br>
| #include <Rcpp.h><br>
| RCPP_MODULE(sourceCpp_12634) {<br>
|     Rcpp::function("callFunction", &callFunction, Rcpp::List::create());<br>
| }<br>
|<br>
| Building shared library<br>
| --------------------------------------------------------<br>
|<br>
| DIR: /tmp/RtmpWMdYuo/sourcecpp_6275273d958b<br>
|<br>
| /usr/lib/R/bin/R CMD SHLIB -o 'sourceCpp_12634.so' --preclean<br>
| 'CallFunction.cpp'<br>
| "clang++" -I/usr/share/R/include -DNDEBUG    -I"/home/thell/R/library/Rcpp/<br>
| include" -I"/home/thell/R/library/TestPackageDepends/include"   -fpic  -O3<br>
| -pipe  -g  -c CallFunction.cpp -o CallFunction.o<br>
| g++ -shared -o sourceCpp_12634.so CallFunction.o -L/home/thell/R/library/Rcpp/<br>
| lib -lRcpp -Wl,-rpath,/home/thell/R/library/Rcpp/lib -L/usr/lib/R/lib -lR<br>
|<br>
|<br>
| What would make clang _not_ get used for both phases?  My Makevars shows<br>
|<br>
| CC="clang"<br>
| CXX="clang++"<br>
| CPP="clang-cpp"<br>
<br>
</div></div>Because the last step is the _linking_ step and perusing the source (been<br>
there, done that) leads to setting this at the end of my ~/.R/Makevars :<br>
<br>
  VER=4.6<br>
  CC=ccache gcc-$(VER)<br>
  CXX=ccache g++-$(VER)<br>
  SHLIB_CXXLD=g++-$(VER)      ## <-    this one<br>
  FC=ccache gfortran<br>
  F77=ccache gfortran<br>
  MAKE=make -j8<br>
<br>
  #CXX=clang++<br>
  #CC=clang<br>
  #CXXFLAGS=-Wall -O3<br>
<br>
<br>
By the way, you can also drop the quotes.<br>
<span class="HOEnZb"><font color="#888888"><br>
Dirk<br>
<br>
--<br>
Dirk Eddelbuettel | <a href="mailto:edd@debian.org">edd@debian.org</a> | <a href="http://dirk.eddelbuettel.com" target="_blank">http://dirk.eddelbuettel.com</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Sincerely,<br>Thell<br>
</div>