No subject

Mon Jun 6 11:45:04 CEST 2011

loaded by rpy2 anyway in order to work at all, or am I totally wrong here?

Running python 2.7.1, rpy2-2.2.2, R 2.13.0
I would appreciate any help.


Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi Dirk and Romain,<br><br>Aparrently libR is not loaded by rpy2, at least =
not in a way such that Rcpp can access it. I have solved the problem by add=
ing -lR to the linker flags when building Rcpp. Since for normal use of Rcp=
p from R this does not make a difference, would you mind adding this to the=
 Makevars file in a future version of Rcpp? Or does this lead to problems i=
n case R is build without<br>

<br>Best regards,<br>Jonas<br><br><div class=3D"gmail_quote">---------- For=
warded message ----------<br>From: <b class=3D"gmail_sendername">Jonas Rauc=
h</b> <span dir=3D"ltr">&lt;<a href=3D"mailto:jonas.rauch at">j=
onas.rauch at</a>&gt;</span><br>

Date: Fri, Aug 12, 2011 at 10:36 AM<br>Subject: Rcpp and rpy2<br>To: rcpp-d=
evel &lt;<a href=3D"mailto:rcpp-devel at">rcpp-devel at r-f=</a>&gt;<br><br><br>Is Rcpp compatible with rpy2?<br>I wo=
uld like to call a very complex R function from python. My function depends=
 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>Erro=
r in dyn.load(file, DLLpath =3D DLLpath, ...) : <br>=A0 unable to load shar=
ed object &#39;/home/jonas/R/x86_64-unknown-linux-gnu-library/2.13/Rcpp/lib=

=A0 /home/jonas/R/x86_64-unknown-linux-gnu-library/2.13/Rcpp/libs/ =
undefined symbol: R_ClassSymbol<br>Error: package/namespace load failed for=
 &#39;Rcpp&#39;<br>Traceback (most recent call last):<br>=A0 File &quot;Rcp=;, line 2, in &lt;module&gt;<br>

=A0=A0=A0 robjects.r(&#39;library(Rcpp)&#39;)<br>=A0 File &quot;/usr/local/=
py2/robjects/;, line 225, in __call__<br>=A0=A0=A0 res =3D =

=A0 File &quot;/usr/local/lib/python2.7/dist-packages/rpy2-2.2.2dev_2011081=
1-py2.7-linux-x86_64.egg/rpy2/robjects/;, line 82, in __ca=
ll__<br>=A0=A0=A0 return super(SignatureTranslatedFunction, self).__call__(=
*args, **kwargs)<br>

=A0 File &quot;/usr/local/lib/python2.7/dist-packages/rpy2-2.2.2dev_2011081=
1-py2.7-linux-x86_64.egg/rpy2/robjects/;, line 34, in __ca=
ll__<br>=A0=A0=A0 res =3D super(Function, self).__call__(*new_args, **new_k=

rpy2.rinterface.RRuntimeError: Error: package/namespace load failed for &#3=
9;Rcpp&#39;<br><br>From what I understand R_ClassSymbol is supplied by libR=
.so, which should by 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 he=
lp.<br><br>Regards,<br><font color=3D"#888888">Jonas<br>


More information about the Rcpp-devel mailing list