[Rcpp-devel] Two problem trying to install a package with modules (e.g. testmod) on windows and on CRAN

Robin Girard robin.girard at mines-paristech.fr
Sat Jan 12 18:12:33 CET 2013


Merci ! 
Both problem were solved by starting everything from begin (with Rcpp skeleton). Note that it took me time to understand that the aim of option module in the Rcpp.skeleton is not to help you introduce you module but produce something that you can modify with your own module name. 

>From what I understood the only difference with what was before in my code is that
.onLoad <- function(libname, pkgname) {
loadRcppModules()
}
was replaced by loadModule("mymodule") 

This solved the first problem (the "note" asking for methods)
so I tried to upload the package on CRAN and it worked ... second problem solved in the same time ! 

Again I'm really impressed of how easy it was to port c++ code  with Rcpp module (not only high level function but objects and methods ...) on R, you guys are great ! 

Cheers

Robin



----- Mail original -----er
De: "Dirk Eddelbuettel" <edd at debian.org>
À: "Robin Girard" <robin.girard at mines-paristech.fr>
Cc: rcpp-devel at lists.r-forge.r-project.org
Envoyé: Vendredi 11 Janvier 2013 21:33:00
Objet: Re: [Rcpp-devel] Two problem trying to install a package with modules (e.g. testmod) on windows and on CRAN


Salut Robin,

Welcome, at long last, to rcpp-devel.

On 11 January 2013 at 21:10, Robin Girard wrote:
| (sorry for posting again , I sent the first one before confirmation of subscription) 
| 
| Dear rcpp-devel list, 
| 
| I am encountering 2 different problems with Rcpp modules (which by the way are sooo impressively great !) during the install phase of testmod, 
| 
| ---------1st problem
| while trying to check package testmod (to use module) I got : 
| 
| File 'testmod/R/zzz.R':
|   .onLoad calls:
|     require("methods", character = TRUE, quietly = TRUE)

You need to declare a dependency on the package "methods", just like the
error says.

| Package startup functions should not change the search path.
| See section 'Good practice' in ?.onAttach.
| 
| .onLoad: warning in require("methods", character = TRUE, quietly =
|   TRUE): correspondance partielle d'argument de 'character' par rapport 'character.only'
| 
| (Windows R v2.15.2, last Rtools, ...)
| I'm not really used to all these package stuff and clearly do not understand what's happening. Any solution ?
| 
| Actually I have the same error on another package I just tryied to submitt to CRAN but I guess that this won't be accepted ... 
| 
| 
| -----------2nd problem 
| 
| My package was actually rejected on CRAN because it does not compile on Uwe Ligges's windows system, logs are attached and start like that 
| 
| * installing *source* package 'ConConPiWiFun' ...
| ** libs
| 
| *** arch - i386
| g++  -I"D:/RCompile/recent/R/include" -DNDEBUG `Rscript -e 'Rcpp:::CxxFlags()'`   -I"d:/RCompile/CRANpkg/lib/3.0/Rcpp/include" -I"d:/Rcompile/CRANpkg/extralibs215/local215/include"     -O2 -Wall  -mtune=core2 -c OptimMargInt.cc -o OptimMargInt.o
| OptimMargInt.cc: In member function 'cplfunction& cplfunction::Etoile()':
| OptimMargInt.cc:254:34: warning: variable 'firstBreakVal' set but not used [-Wunused-but-set-variable]
| OptimMargInt.cc: In member function 'double cplfunction::Argmin()':
| OptimMargInt.cc:386:16: warning: 'res' may be used uninitialized in this function [-Wuninitialized]
| g++ -shared -s -static-libgcc -o ConConPiWiFun.dll tmp.def OptimMargInt.o d:/RCompile/CRANpkg/lib/3.0/Rcpp/lib/x64/libRcpp.a -Ld:/Rcompile/CRANpkg/extralibs215/local215/lib/i386 -Ld:/Rcompile/CRANpkg/extralibs215/local215/lib -LD:/RCompile/recent/R/bin/i386 -lR
| OptimMargInt.o:OptimMargInt.cc.text+0x6d): undefined reference to `vtable for Rcpp::RObject'
| OptimMargInt.o:OptimMargInt.cc.text+0xad): undefined reference to `Rcpp::RObject::setSEXP(SEXPREC*)'
| OptimMargInt.o:OptimMargInt.cc.text+0xbb): undefined reference to `void Rcpp::internal::r_init_vector<19>(SEXPREC*)'
| OptimMargInt.o:OptimMargInt.cc.text+0xe3): undefined reference to `Rcpp::RObject::~RObject()'
| OptimMargInt.o:OptimMargInt.cc.text+0x13d): undefined reference to `vtable for Rcpp::RObject'


Your linling instructions are wrong.

So it looks like you have some fundamental issues here with package
construction.  What I would do is the following:

  a) Either start from scratch (say via rcpp.package.skeleto() with the
     module=TRUE argument) to get a basic package using modules; try to then
     expand that by including your code

  b) Take an existing package from CRAN and examine it; for example my
     RcppCNPy is pretty recent, used modules and is small.

Good luck,  Dirk


| .....
| ...
| ..
| 
|  I do not understand the logs but I know 2 things : 
|           a- It compiles and works properly on my windows system (and on mac and linux actually).  
|           b- I had exactly the same error message 2 days ago while trying to run checks on testmod package and it get sorted when I updated my version of RTools. Is it possible that Uwe Ligges has an outdated version of Rtools ? or do you have any idea of where this can come from ? 
| 
| 
| Best regards 
| Robin 
| 
| 
| 
| ________________________________________________________
| Dr. Girard Robin
| Chargé de Recherche
| 
| MINES-ParisTech / PERSEE
| Centre Procédés, Energies Renouvelables & Systèmes Energétiques
| Center for Processes, Renewable Energies & Energy Systems  
| Renewable Energies & Smartgrids Group ERSEI
| 
| 1 Rue Claude Daunesse - CS 10207 - F-06904 Sophia Antipolis Cedex
| Tel: +33.4.93.67.89.64 (~99), Fax: +33.4.93.95.75.35
| e-mail : robin.girard at mines-paristech.fr
| 
| web page perso http://www.mines-paristech.fr/Services/Annuaire/&?id=8828
| statoverflow : http://stats.stackexchange.com/users/223/robin-girard
| web page centre PERSEE : http://www.cep.mines-paristech.fr/
| linkedin : http://www.linkedin.com/profile/view?id=14907272&trk=tab_pro
| 
| Le lien vaut mieux que le bien.
| ________________________________________________________
| 
| CONFIDENTIALITY : This  e-mail  and  any attachments are
| confidential and may be privileged. If  you are not a
| named recipient, please notify the sender immediately and
| do not disclose the contents to another person, use it for
| any purpose or store or copy the information in any medium.
| 
| CONFIDENTIALITE : Ce message et les éventuelles pièces
| attachées sontconfidentiels et peuvent être une
| communication protégée. Si vous n'êtes pas dans la liste
| des destinataires, veuillez informer l'expéditeur
| immédiatement et ne pas ouvrir ni divulguer le contenu
| à une tierce personne, ne pas l'utiliser pour quelque
| raison que ce soit, ne pas stocker ou copier l'information
| qu'il contient sur un quelconque support.
| _______________________________________________
| 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
-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com 


More information about the Rcpp-devel mailing list