Greetings, <div><br></div><div>Over the weekend I had wanted to compile an application using RInside and RCppEigen using icpc. I found the following two pieces of information helpful.</div><div><br></div><div>1. The order of the includes in important. In particular</div>

<div><br></div><div><div>#include "mpi.h"</div><div>#include <RInside.h></div><div>#include <Rcpp.h></div><div>#include <RcppEigen.h></div></div><div><br></div><div>mpi.h must be first. If mpi.h is after RInside.h, you get the following sort of errors:</div>

<div><br></div><div>-------------------------------</div><div><div>/usr/local/include/openmpi/ompi/mpi/cxx/datatype.h(142): error: expected a type specifier</div><div>    virtual void Free();</div><div>                 ^</div>

<div><br></div><div>/usr/local/include/openmpi/ompi/mpi/cxx/datatype.h(142): error: expected a ")"</div><div>    virtual void Free();</div><div>                 ^</div><div><br></div><div>/usr/local/include/openmpi/ompi/mpi/cxx/datatype.h(142): error: expected an identifier</div>

<div>    virtual void Free();</div><div>                 ^</div></div><div>--------------------------------</div><div><br></div><div>2. The compile string that I used was</div><div><br></div><div>icpc -I/usr/local/include -pthread -I/usr/share/R/include -I/usr/lib/R/site-library/Rcpp/include -I/usr/local/lib/R/site-library/RInside/include -O3 -pipe -g -Wall    sjb_simple_smle_with_Rinside.cpp  -pthread -L/usr/local/lib -lmpi_cxx -lmpi -ldl -lm -Wl,--export-dynamic -lrt -lnsl -lutil -L/usr/lib/R/lib -lR -lblas -llapack -L/usr/lib/R/site-library/Rcpp/lib -lRcpp -Wl,-rpath,/usr/lib/R/site-library/Rcpp/lib -L/usr/local/lib/R/site-library/RInside/lib -lRInside -Wl,-rpath,/usr/local/lib/R/site-library/RInside/lib -o sjb_simple_smle_with_Rinside -I/usr/local/lib/R/site-library/RcppEigen/include</div>

<div><br></div><div>This was based on the compile string generated by the make file for the mpi examples that come with RInside. This took me a while to figure out, so I hope it is useful for someone else.</div><div><br>
</div>
<div>Best regards and have a good week!</div><div>Stephen</div>