[Rcpp-devel] Rcpp.package.skeleton(module=TRUE) fails to load

Dirk Eddelbuettel edd at debian.org
Wed Aug 15 15:14:55 CEST 2012


Florian,

I cannot reproduce that on Linux -- just did a quick test from the
command-line:

edd at max:~$ cd /tmp/
edd at max:/tmp$ r -lRcpp -e'Rcpp.package.skeleton("mypack",module=TRUE)'

Attaching package: ‘utils’

The following object(s) are masked from ‘package:Rcpp’:

    .DollarNames, prompt

Creating directories ...
Creating DESCRIPTION ...
Creating NAMESPACE ...
Creating Read-and-delete-me ...
Saving functions and data ...
Making help files ...
Done.
Further steps are described in './mypack/Read-and-delete-me'.

Adding Rcpp settings
 >> added RcppModules: yada
 >> added Depends: Rcpp
 >> added LinkingTo: Rcpp
 >> added useDynLib directive to NAMESPACE
 >> added Makevars file with Rcpp settings
 >> added Makevars.win file with Rcpp settings
 >> added example header file using Rcpp classes
 >> added example src file using Rcpp classes
 >> added example R file calling the C++ example
 >> added Rd file for rcpp_hello_world
 >> copied the example module file 
edd at max:/tmp$ R CMD INSTALL mypack
* installing to library ‘/usr/local/lib/R/site-library’
* installing *source* package ‘mypack’ ...
** libs
ccache g++-4.6 -I/usr/share/R/include -DNDEBUG   -I"/usr/local/lib/R/site-library/Rcpp/include"   -fpic  -g0 -O3 -Wall -pipe -Wno-variadic-macros -pedantic -c Num.cpp -o Num.o
ccache g++-4.6 -I/usr/share/R/include -DNDEBUG   -I"/usr/local/lib/R/site-library/Rcpp/include"   -fpic  -g0 -O3 -Wall -pipe -Wno-variadic-macros -pedantic -c rcpp_hello_world.cpp -o rcpp_hello_world.o
ccache g++-4.6 -I/usr/share/R/include -DNDEBUG   -I"/usr/local/lib/R/site-library/Rcpp/include"   -fpic  -g0 -O3 -Wall -pipe -Wno-variadic-macros -pedantic -c rcpp_module.cpp -o rcpp_module.o
ccache g++-4.6 -I/usr/share/R/include -DNDEBUG   -I"/usr/local/lib/R/site-library/Rcpp/include"   -fpic  -g0 -O3 -Wall -pipe -Wno-variadic-macros -pedantic -c stdVector.cpp -o stdVector.o
g++-4.6 -shared -o mypack.so Num.o rcpp_hello_world.o rcpp_module.o stdVector.o -L/usr/local/lib/R/site-library/Rcpp/lib -lRcpp -Wl,-rpath,/usr/local/lib/R/site-library/Rcpp/lib -L/usr/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/mypack/libs
** R
** preparing package for lazy loading
** help
Warning: /tmp/mypack/man/mypack-package.Rd:31: All text must be in a section
Warning: /tmp/mypack/man/mypack-package.Rd:32: All text must be in a section
*** installing help indices
** building package indices
** testing if installed package can be loaded

* DONE (mypack)
edd at max:/tmp$ r -lmypack -e'cat("Hello, world\n")'
Hello, world
edd at max:/tmp$ 

and dito in an R session I had open:

R> library(mypack)
R> mypack::foo()
[1] 1
R> 

Also note that these package.skeleton tests are part of the normal unit
tests. 

With Romain taking it a little easier these days, there is no committed
developer access to OS X so I am afraid you (or someone else) will have to
debug this.

One last thing: you could try my package RcppBDT and RcppCNPy which both use
Modules.  They are pretty small, see if you can get them built and loaded.

Dirk

-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com  


More information about the Rcpp-devel mailing list