Just to close this up:<br>I found out that my Rcpp installation must have occured when my R was not built with shared lib. Thus Rcpp was not linked to libR. Just reinstalling Rcpp from source solved the problem.<br><br>Regards,<br>

Jonas<br><br><div class="gmail_quote">On Fri, Aug 12, 2011 at 3:16 PM, Dirk Eddelbuettel <span dir="ltr">&lt;<a href="mailto:edd@debian.org">edd@debian.org</a>&gt;</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 12 August 2011 at 14:33, Jonas Rauch wrote:<br>
| Hi Dirk and Romain,<br>
|<br>
| Aparrently libR is not loaded by rpy2, at least not in a way such that Rcpp can<br>
| access it. I have solved the problem by adding -lR to the linker flags when<br>
| building Rcpp. Since for normal use of Rcpp from R this does not make a<br>
| difference, would you mind adding this to the Makevars file in a future version<br>
| of Rcpp? Or does this lead to problems in case R is build without libR.so?<br>
<br>
</div>I would be somewhat hesitant to do so as it may affect all users of Rcpp.<br>
<br>
Rcpp is for getting code into R, and we can take libR as given as R is always<br>
around when loading Rcpp.  I think the problem is really with the linker and<br>
passing symbols through from one end to the other.<br>
<br>
Other views, anyone?<br>
<br>
Dirk<br>
<div><div></div><div class="h5"><br>
<br>
| Best regards,<br>
| Jonas<br>
|<br>
| ---------- Forwarded message ----------<br>
| From: Jonas Rauch &lt;<a href="mailto:jonas.rauch@googlemail.com">jonas.rauch@googlemail.com</a>&gt;<br>
| Date: Fri, Aug 12, 2011 at 10:36 AM<br>
| Subject: Rcpp and rpy2<br>
| To: rcpp-devel &lt;<a href="mailto:rcpp-devel@r-forge.wu-wien.ac.at">rcpp-devel@r-forge.wu-wien.ac.at</a>&gt;<br>
|<br>
|<br>
| Is Rcpp compatible with rpy2?<br>
| I would like to call a very complex R function from python. My function depends<br>
| on code implemented with Rcpp. When I try to load Rcpp from python via<br>
|<br>
| import rpy2.robjects as robjects<br>
| robjects.r(&#39;library(Rcpp)&#39;)<br>
|<br>
| I get the following:<br>
|<br>
| Error in dyn.load(file, DLLpath = DLLpath, ...) :<br>
|   unable to load shared object &#39;/home/jonas/R/x86_64-unknown-linux-gnu-library<br>
| /2.13/Rcpp/libs/Rcpp.so&#39;:<br>
|   /home/jonas/R/x86_64-unknown-linux-gnu-library/2.13/Rcpp/libs/Rcpp.so:<br>
| undefined symbol: R_ClassSymbol<br>
| Error: package/namespace load failed for &#39;Rcpp&#39;<br>
| Traceback (most recent call last):<br>
|   File &quot;RcppTest.py&quot;, line 2, in &lt;module&gt;<br>
|     robjects.r(&#39;library(Rcpp)&#39;)<br>
|   File &quot;/usr/local/lib/python2.7/dist-packages/<br>
| rpy2-2.2.2dev_20110811-py2.7-linux-x86_64.egg/rpy2/robjects/__init__.py&quot;, line<br>
| 225, in __call__<br>
|     res = self.eval(p)<br>
|   File &quot;/usr/local/lib/python2.7/dist-packages/<br>
| rpy2-2.2.2dev_20110811-py2.7-linux-x86_64.egg/rpy2/robjects/functions.py&quot;, line<br>
| 82, in __call__<br>
|     return super(SignatureTranslatedFunction, self).__call__(*args,<br>
| **kwargs)<br>
|   File &quot;/usr/local/lib/python2.7/dist-packages/<br>
| rpy2-2.2.2dev_20110811-py2.7-linux-x86_64.egg/rpy2/robjects/functions.py&quot;, line<br>
| 34, in __call__<br>
|     res = super(Function, self).__call__(*new_args, **new_kwargs)<br>
| rpy2.rinterface.RRuntimeError: Error: package/namespace load failed for &#39;Rcpp&#39;<br>
|<br>
| From what I understand R_ClassSymbol is supplied by libR.so, which should by<br>
| loaded by rpy2 anyway in order to work at all, or am I totally wrong here?<br>
|<br>
| Running python 2.7.1, rpy2-2.2.2, R 2.13.0<br>
| I would appreciate any help.<br>
|<br>
| Regards,<br>
| Jonas<br>
|<br>
|<br>
</div></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>
<font color="#888888"><br>
--<br>
Two new Rcpp master classes for R and C++ integration scheduled for<br>
New York (Sep 24) and San Francisco (Oct 8), more details are at<br>
<a href="http://dirk.eddelbuettel.com/blog/2011/08/04#rcpp_classes_2011-09_and_2011-10" target="_blank">http://dirk.eddelbuettel.com/blog/2011/08/04#rcpp_classes_2011-09_and_2011-10</a><br>
<a href="http://www.revolutionanalytics.com/products/training/public/rcpp-master-class.php" target="_blank">http://www.revolutionanalytics.com/products/training/public/rcpp-master-class.php</a><br>
</font></blockquote></div><br>