The problem seems to be file privileges. When I run R as superuser, it works. When I run as a normal user, I continue getting

Error in dyn.load(libLFile) :
unable to load shared object '/tmp/RtmpTFHtzm/file1d365e7eaf51.so': /tmp/RtmpTFHtzm/file1d365e7eaf51.so: undefined symbol: _ZN4Rcpp8internal14r_vector_startILi14EdEEPT0_P7SEXPREC

Note that the names of the undefined symbol is the same for all of the ways and examples I have tested, which include:
cxxfunction (following the vignette)
cppFunction (following Hadley's tutorial)
R CMD INSTALL -l foo mypackage
where "mypackage" is created by Rcpp.package.skeleton("mypackage")
R CMD INSTALL -l foo somepackage.tar.gz
where "somepackage" is a package downloaded from CRAN which uses Rcpp.

I would very much appreciate a hint/suggestion as to which folders/directories/paths I may need to check to get the file permissions correct.

Does the name of the undefined symbol tell you anything? If you ignore some characters, it reads
...Rccp.internal..r_vector_start...SEXPR..

+glenn



On 12/12/2012 05:15 PM, Dirk Eddelbuettel wrote:
Works for me:

R>  require(Rcpp)
R>  require(inline)
Loading required package: inline
R>  inc<- '
+    using namespace Rcpp;
+    double norm( double x, double y ) {
+    return sqrt( x*x + y*y );
+    }
+    RCPP_MODULE(mod) {
+    function( "norm",&norm );
+    }
+ '
R>  fx<- cxxfunction(signature(), plugin="Rcpp", include=inc)
R>
R>  mod<- Module( "mod", getDynLib(fx) )
R>
R>  mod$norm( 3, 4 )
[1] 5
R>
R>  sessionInfo()
R version 2.15.2 (2012-10-26)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8 
       LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8
  [6] LC_MESSAGES=en_US.UTF-8    LC_PAPER=C                 LC_NAME=C           
       LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] inline_0.3.10   RQuantLib_0.3.9 Rcpp_0.10.1.5

loaded via a namespace (and not attached):
[1] compiler_2.15.2 tools_2.15.2
R>

That is with Rcpp from SVN but that shouldn't matter.

Dirk


--
--------------------------------------------------------------
Pirating science, because open access isn't always open enough
www.scipirate.com                                    @piratesci

     Dr. Glenn Lawyer
     +352 661 967 244
     Max-Planck-Institut für Informatik
     Computational Biology and Applied Algorithmics
     Campus E1 4
     66123 Saarbrücken, Germany
     http://bioinf.mpi-inf.mpg.de/~lawyer

_______________________________________________
Rcpp-devel mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to