<br><br><div class="gmail_quote">On Mon, Aug 13, 2012 at 5:20 AM, 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="im"><br>
On 13 August 2012 at 00:19, Stephen J. Barr wrote:<br>
| Greetings, <br>
|<br>
| Over the weekend I had wanted to compile an application using RInside and<br>
| RCppEigen using icpc. I found the following two pieces of information helpful.<br>
<br>
</div>Thanks for summarizing here.<br>
<div class="im"><br>
| 1. The order of the includes in important. In particular<br>
|<br>
| #include "mpi.h"<br>
| #include <RInside.h><br>
| #include <Rcpp.h><br>
| #include <RcppEigen.h><br>
<br>
</div>.... which is exactly what the existing example does:<br>
<br>
#include <mpi.h>     // mpi header file<br>
#include <RInside.h> // for the embedded R via RInside<br>
<br>
Note that the include for Rcpp.h is redundant, RInside gets you that.<br>
<div class="im"><br>
| mpi.h must be first. If mpi.h is after RInside.h, you get the following sort of<br>
| errors:<br>
|<br>
| -------------------------------<br>
| /usr/local/include/openmpi/ompi/mpi/cxx/datatype.h(142): error: expected a type<br>
| specifier<br>
|     virtual void Free();<br>
|                  ^<br>
|<br>
| /usr/local/include/openmpi/ompi/mpi/cxx/datatype.h(142): error: expected a ")"<br>
|     virtual void Free();<br>
|                  ^<br>
|<br>
| /usr/local/include/openmpi/ompi/mpi/cxx/datatype.h(142): error: expected an<br>
| identifier<br>
|     virtual void Free();<br>
|                  ^<br>
| --------------------------------<br>
|<br>
| 2. The compile string that I used was<br>
|<br>
| icpc -I/usr/local/include -pthread -I/usr/share/R/include -I/usr/lib/R/<br>
| site-library/Rcpp/include -I/usr/local/lib/R/site-library/RInside/include -O3<br>
| -pipe -g -Wall    sjb_simple_smle_with_Rinside.cpp  -pthread -L/usr/local/lib<br>
| -lmpi_cxx -lmpi -ldl -lm -Wl,--export-dynamic -lrt -lnsl -lutil -L/usr/lib/R/<br>
| lib -lR -lblas -llapack -L/usr/lib/R/site-library/Rcpp/lib -lRcpp -Wl,-rpath,/<br>
| usr/lib/R/site-library/Rcpp/lib -L/usr/local/lib/R/site-library/RInside/lib<br>
| -lRInside -Wl,-rpath,/usr/local/lib/R/site-library/RInside/lib -o<br>
| sjb_simple_smle_with_Rinside -I/usr/local/lib/R/site-library/RcppEigen/include<br>
<br>
</div>Is there a reason you avoid Makefiles?<br>
<br></blockquote><div><br></div><div>Learning CMake is on my list :) </div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
As an aside, RInside 0.2.7 is now on CRAN, and I added new examples<br>
directories for using it with RcppArmadillo and RcppEigen, respectively.<br>
<br></blockquote><div><br></div><div>Thank you for all the information and feedback.</div><div><br>Best,</div><div>Stephen</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


Dirk<br>
<div class="im"><br>
| This was based on the compile string generated by the make file for the mpi<br>
| examples that come with RInside. This took me a while to figure out, so I hope<br>
| it is useful for someone else.<br>
|<br>
| Best regards and have a good week!<br>
| Stephen<br>
|<br>
</div>| ----------------------------------------------------------------------<br>
| _______________________________________________<br>
| Rcpp-devel mailing list<br>
| <a href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-project.org</a><br>
| <a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br>
<span class="HOEnZb"><font color="#888888">--<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>