Nicolas Turenne
2006-Jun-12 15:02 UTC
[Rd] about integration of a library into package creation
hello, i try to create a package , and i call a library in the namespace file such as : useDynLib(quadprog) after checking my directory with the command "rcmd check" (i am on WindowsXP) i get an error: package / namespace load failed the path of the library is: D:\R\library\quadprog the path of the building files is: D:\RBuild\svcR and the comand i use to compile is: rcmd check D://RBuild//svcR i dont understand, it is a path problem about the dll related to the library ? thank for help Nicolas * checking package subdirectories ... WARNING Subdirectory 'src' contains no source files. * checking R files for syntax errors ... OK * checking R files for library.dynam ... OK * checking S3 generic/method consistency ... WARNING Erreur : le chargement du package / espace de noms a echoue' pour 'svcR' Sequence d'appel : 2: stop(gettextf("package/namespace load failed for '%s'", libraryPkgName(packag e)), call. = FALSE, domain = NA) 1: library(package, lib.loc = lib.loc, character.only = TRUE, verbose = FALSE) Execution arrete'e See section 'Generic functions and methods' of the 'Writing R Extensions' manual. * checking replacement functions ... WARNING Erreur : le chargement du package / espace de noms a echoue' pour 'svcR' Sequence d'appel : 2: stop(gettextf("package/namespace load failed for '%s'", libraryPkgName(packag e)),
Duncan Murdoch
2006-Jun-12 15:20 UTC
[Rd] about integration of a library into package creation
On 6/12/2006 11:02 AM, Nicolas Turenne wrote:> hello, > > i try to create a package , and i call a library in the namespace file > such as : useDynLib(quadprog) > > after checking my directory with the command "rcmd check" (i am on > WindowsXP) > i get an error: package / namespace load failed > the path of the library is: D:\R\library\quadprog > the path of the building files is: D:\RBuild\svcR > and the comand i use to compile is: rcmd check D://RBuild//svcR > > i dont understand, it is a path problem about the dll related to the > library ?You didn't show the results of installing your package. Did that work? Generally we advise to do a successful install before you try to run checks. Duncan Murdoch> > thank for help > Nicolas > > > * checking package subdirectories ... WARNING > Subdirectory 'src' contains no source files. > * checking R files for syntax errors ... OK > * checking R files for library.dynam ... OK > * checking S3 generic/method consistency ... WARNING > Erreur : le chargement du package / espace de noms a echoue' pour 'svcR' > Sequence d'appel : > 2: stop(gettextf("package/namespace load failed for '%s'", > libraryPkgName(packag > e)), > call. = FALSE, domain = NA) > 1: library(package, lib.loc = lib.loc, character.only = TRUE, verbose = > FALSE) > Execution arrete'e > See section 'Generic functions and methods' of the 'Writing R Extensions' > manual. > * checking replacement functions ... WARNING > Erreur : le chargement du package / espace de noms a echoue' pour 'svcR' > Sequence d'appel : > 2: stop(gettextf("package/namespace load failed for '%s'", > libraryPkgName(packag > e)), > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel
Duncan Murdoch
2006-Jun-12 16:28 UTC
[Rd] about integration of a library into package creation
On 6/12/2006 11:48 AM, Nicolas Turenne wrote:> > > > > >You didn't show the results of installing your package. Did that work? > > > >Generally we advise to do a successful install before you try to run > checks. > > > >Duncan Murdoch > > D:\RBuild\svcR> rcmd build D://RBuild//svcR --force --docs='all' --binary > hence i obtain the file svcR_1.0.zip > and following messages : > > D:\RBuild\svcR>rcmd build D://RBuild//svcR --force --docs='all' --binary > * checking for file 'D://RBuild//svcR/DESCRIPTION' ... OK > * preparing 'D://RBuild//svcR': > * checking DESCRIPTION meta-information ... OK > * cleaning src > * removing junk files > tar: svcR/svcR_1.0.tar: file is the archive; not dumped > * excluding invalid files from 'svcR' > Subdirectory 'R' contains invalid file names: > ade4.dll quadprog.dll spdep.dllYou shouldn't have .dll files in the R directory. Normally you have just one, built in the src directory, and then R will install it into the libs directory. If you want multiple .dlls, I believe you can build them in inst/libs, and they'll be copied to libs on installation. However, the names of your dlls match the names of R packages, which makes me think you are trying to incorporate routines from other packages in your code. If that's what you are doing, this is not the right way to do it. You should call other packages through their R interfaces. There are plans to allow direct calls into the dlls, but so far I don't think they exist. Duncan Murdoch> * checking for LF line-endings in source files > * checking for empty or unneeded directories > * building binary distribution > WARNING > * some HTML links may not be found > installing R.css in C:/DOCUME~1/Nicolas/LOCALS~1/Temp/Rinst249298526 > > Using auto-selected zip options '' > > ---------- Making package svcR ------------ > adding build stamp to DESCRIPTION > installing NAMESPACE file and metadata > installing R files > installing data files > installing man source files > installing indices > not zipping data > installing help > >>> Building/Updating help pages for package 'svcR' > Formats: text html latex example chm > iris_att text html latex chm > iris_mat text html latex chm > iris_var text html latex chm > svcR text html latex example chm > Microsoft HTML Help Compiler 4.74.8702 > > Compiling > c:\DOCUME~1\Nicolas\LOCALS~1\Temp\Rbuild249291931\svcR\chm\svcR.chm > > > Compile time: 0 minutes, 1 second > 5 Topics > 8 Local links > 1 Internet link > 1 Graphic > > > Created > c:\DOCUME~1\Nicolas\LOCALS~1\Temp\Rbuild249291931\svcR\chm\svcR.chm, 18, > 283 bytes > Compression increased file by 6,096 bytes. > preparing package svcR for lazy loading > adding MD5 sums > > packaged installation of package 'svcR' as svcR_1.0.zip > * DONE (svcR) > > > > in R environment (Rgui front-end) > i write: > > install.packages("D:/RBuild/svcR/svcR_1.0.zip", repos=NULL) > package 'svcR' successfully unpacked and MD5 sums checked > updating HTML package descriptions > > library(svcR) > > Attachement du package : 'svcR' > > > The following object(s) are masked _by_ .GlobalEnv : > > findModelCluster > > > > > > and finally when i typewrite my function > i obtain : > impossible de trouver la fonction "dudi.coa" > it can not find the function called in the library that i call in the R > source code > by library(ade4) > > if i call my function by source(), it works well > > thank you for help > > --------- > > Nicolas