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

Davor Cubranic cubranic at stat.ubc.ca
Wed Aug 15 18:49:43 CEST 2012


Works fine for me:

> bash-3.2$ R CMD INSTALL mypack --no-multiarch
> * installing to library '/Library/Frameworks/R.framework/Versions/2.15/Resources/library'
> * installing *source* package 'mypack' ...
> ** libs
> *** arch - x86_64
> g++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG  -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include"   -fPIC  -g -O2  -c Num.cpp -o Num.o
> g++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG  -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include"   -fPIC  -g -O2  -c rcpp_hello_world.cpp -o rcpp_hello_world.o
> g++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG  -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include"   -fPIC  -g -O2  -c rcpp_module.cpp -o rcpp_module.o
> g++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG  -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include"   -fPIC  -g -O2  -c stdVector.cpp -o stdVector.o
> g++ -arch x86_64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/lib -o mypack.so Num.o rcpp_hello_world.o rcpp_module.o stdVector.o /Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/lib/x86_64/libRcpp.a -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
> ld: warning: directory not found for option '-L/usr/local/lib'
> installing to /Library/Frameworks/R.framework/Versions/2.15/Resources/library/mypack/libs/x86_64
> ** R
> ** preparing package for lazy loading
> ** help
> Warning: /private/tmp/mypack/man/mypack-package.Rd:31: All text must be in a section
> Warning: /private/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)

sessionInfo:
> > sessionInfo()       
> R version 2.15.1 (2012-06-22)
> Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
> 
> locale:
> [1] C
> 
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base     
> 
> loaded via a namespace (and not attached):
> [1] tools_2.15.1

This is on 10.7.4 (Lion), using Xcode 4.4.

Davor


On 2012-08-15, at 7:32 AM, Dirk Eddelbuettel wrote:

> 
> On 15 August 2012 at 14:56, Florian Oswald wrote:
> | I tried out your RcppBDT package and I could build it without any
> | problem, and it works in R. It's quite strange. I've used Rcpp many
> | times before without problem, most of the time with inline tough. I'm
> | using the apple default compiler llvm-g++-4.2.
> | 
> | Thanks for any other suggestions. I'll try to reverse engineer RcppBDT
> | and see how far I get.
> 
> Weird.  I spent quite some time in March/April going over Rcpp modules and
> the loading code as John had made changes -- we were then forced to wait for
> R 2.15.1 to come out to use them.
> 
> The Rcpp modules vignette is mostly right. There are sort of two ways to do
> it, and you have to follow things closely.  But that is what the skeleton
> does so I am unsure what goes haywire here. 
> 
> Maybe someone else with an OS X box and R 2.15.1 can help?
> 
> Dirk
> 
> | Florian
> | 
> | On 15 August 2012 14:14, Dirk Eddelbuettel <edd at debian.org> wrote:
> | >
> | > 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
> 
> -- 
> Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com  
> _______________________________________________
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel



More information about the Rcpp-devel mailing list