Hi, Has something changed regarding the useDynLib in the NAMESPACE file in packages? I've written a package that works in e.g. 2.12/2.13 but simply cannot find the dynamic library under windows. The version on CRAN is older than the one I'm talking about and depends on a newer version of R but I want to make the package available to people with older versions. > utils:::menuInstallLocal() package 'lassoshooting' successfully unpacked and MD5 sums checked > require(lassoshooting) Loading required package: lassoshooting Error in library.dynam(lib, package, package.lib) : shared library 'lassoshooting' not found In addition: Warning message: package 'lassoshooting' was built under R version 2.13.0 I'm usually under linux and don't know about the gory details of .dll files. NAMESPACE file -------------- useDynLib(lassoshooting) export(lassoshooting) happy easter! regards, Tobias -- Tobias Abenius Ph.D. Student, M.Sc. in Computer Science Mathematical Statistics Mathematical Sciences University of Gothenburg -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: 00install.out URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20110420/0cfb9712/attachment.pl>
Prof Brian Ripley
2011-Apr-21 08:15 UTC
[Rd] Window binary packages built for R 2.13.0 do not work in 2.10.0 (was useDynLib in older versions e.g. (2.10))
On Wed, 20 Apr 2011, Tobias Abenius wrote:> Hi, > > Has something changed regarding the useDynLib in the NAMESPACE file in > packages?No. As the FAQ asked re bug reports, please don't post speculation rather than problem description.> I've written a package that works in e.g. 2.12/2.13 but simply > cannot find the dynamic library under windows. The version on CRAN is older > than the one I'm talking about and depends on a newer version of R but I want > to make the package available to people with older versions.Do you mean 'make a binary version of the package ....'? Binary packages are (on all platforms, but specifically on Windows and Mac OS X) intended for use only on the same 2.x.[012] versions of R. That warning was not meant to be ignored! If you had bothered to read the CHANGES file you would known that the location of files on Windows binary installations changed in R 2.12.0: of course there is no way that R 2.10.0 (as the posting guide points out there is no '2.10') could know that was going to be changed a year later. The solution is for you to prepare a binary package for each version of R you want it available with and make it available on your own repository.>> utils:::menuInstallLocal() > package 'lassoshooting' successfully unpacked and MD5 sums checked >> require(lassoshooting) > Loading required package: lassoshooting > Error in library.dynam(lib, package, package.lib) : > shared library 'lassoshooting' not found > In addition: Warning message: > package 'lassoshooting' was built under R version 2.13.0 > > I'm usually under linux and don't know about the gory details of .dll files. > > NAMESPACE file > -------------- > useDynLib(lassoshooting) > export(lassoshooting) > > happy easter! > > regards, Tobias > -- > Tobias Abenius > Ph.D. Student, M.Sc. in Computer Science > > Mathematical Statistics > Mathematical Sciences > University of Gothenburg >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
On 20.04.2011 13:30, Tobias Abenius wrote:> Hi, > > Has something changed regarding the useDynLib in the NAMESPACE file in > packages? I've written a package that works in e.g. 2.12/2.13 but simply > cannot find the dynamic library under windows. The version on CRAN is > older than the one I'm talking about and depends on a newer version of R > but I want to make the package available to people with older versions. > > > utils:::menuInstallLocal() > package 'lassoshooting' successfully unpacked and MD5 sums checked > > require(lassoshooting) > Loading required package: lassoshooting > Error in library.dynam(lib, package, package.lib) : > shared library 'lassoshooting' not found > In addition: Warning message: > package 'lassoshooting' was built under R version 2.13.0Yes, your package was built doe R-2.13.0 but you are using R <= 2.12.0 where the dll files were located in a different directory. Hence a) time to upgrade your R version or b) Install the package from sources yourself for the (unstated) version of R on your Windows machine. Uwe Ligges> I'm usually under linux and don't know about the gory details of .dll > files. > > NAMESPACE file > -------------- > useDynLib(lassoshooting) > export(lassoshooting) > > happy easter! > > regards, Tobias > > > 00install.out > > > * installing *source* package 'lassoshooting' ... > ** libs > > *** arch - i386 > gcc -I"D:/RCompile/recent/R-2.13.0/include" -I"d:/Rcompile/CRANpkg/extralibs/local/include" -O3 -Wall -std=gnu99 -c ccd_common.c -o ccd_common.o > ccd_common.c: In function 'ccd_common': > ccd_common.c:118:2: warning: #warning Using R fortran BLAS calls > gcc -I"D:/RCompile/recent/R-2.13.0/include" -I"d:/Rcompile/CRANpkg/extralibs/local/include" -O3 -Wall -std=gnu99 -c ccd_r.c -o ccd_r.o > ccd_r.c: In function 'ccd': > ccd_r.c:163:5: warning: too many arguments for format > ccd_r.c:156:7: warning: unused variable 'ret' > ccd_r.c:18:11: warning: 'X' may be used uninitialized in this function > ccd_r.c:18:14: warning: 'y' may be used uninitialized in this function > gcc -shared -s -static-libgcc -o lassoshooting.dll tmp.def ccd_common.o ccd_r.o -Ld:/Rcompile/CRANpkg/extralibs/local/lib -LD:/RCompile/recent/R-2.13.0/bin/i386 -lRblas -lgfortran -LD:/RCompile/recent/R-2.13.0/bin/i386 -lR > installing to d:/RCompile/CRANguest/R-release/lib/lassoshooting/libs/i386 > > *** arch - x64 > x86_64-w64-mingw32-gcc -I"D:/RCompile/recent/R-2.13.0/include" -I"d:/Rcompile/CRANpkg/extralibs64new/local/include" -O2 -Wall -std=gnu99 -c ccd_common.c -o ccd_common.o > ccd_common.c: In function 'ccd_common': > ccd_common.c:118:2: warning: #warning Using R fortran BLAS calls > x86_64-w64-mingw32-gcc -I"D:/RCompile/recent/R-2.13.0/include" -I"d:/Rcompile/CRANpkg/extralibs64new/local/include" -O2 -Wall -std=gnu99 -c ccd_r.c -o ccd_r.o > ccd_r.c: In function 'ccd': > ccd_r.c:163:5: warning: too many arguments for format > ccd_r.c:156:7: warning: unused variable 'ret' > ccd_r.c:18:11: warning: 'X' may be used uninitialized in this function > ccd_r.c:18:14: warning: 'y' may be used uninitialized in this function > x86_64-w64-mingw32-gcc -shared -s -static-libgcc -o lassoshooting.dll tmp.def ccd_common.o ccd_r.o -Ld:/Rcompile/CRANpkg/extralibs64new/local/lib -LD:/RCompile/recent/R-2.13.0/bin/x64 -lRblas -lgfortran -LD:/RCompile/recent/R-2.13.0/bin/x64 -lR > installing to d:/RCompile/CRANguest/R-release/lib/lassoshooting/libs/x64 > ** R > ** preparing package for lazy loading > ** help > *** installing help indices > ** building package indices ... > ** testing if installed package can be loaded > * MD5 sums > packaged installation of 'lassoshooting' as lassoshooting_0.1.3-6.zip > > * DONE (lassoshooting) > > > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel
Dear R-devel, I investigated further by tracing into library.dynam. The .dll file export a symbol "ccd". In e.g. R 2.8.1 the following command succeeds, dyn.load('/Program Files/R/R-2.8.1/library/lassoshooting/libs/i386/lassoshooting.dll') and the external symbol "ccd" becomes available. However, inside library.dynam it doesn't add i386 to the path because .Platform$r_arch is "". One way would be to re-zip the package with a copy of the i386 version outside of the i386 directory, directly under libs. That would work, but then I know I cannot commit a binary package to CRAN. I guess I'm not the only one having this problem. Happy easter, Tobias -- Tobias Abenius Ph.D. Student, M.Sc. in Computer Science Mathematical Statistics Mathematical Sciences University of Gothenburg On 04/20/2011 01:30 PM, Tobias Abenius wrote:> Hi, > > Has something changed regarding the useDynLib in the NAMESPACE file in > packages? I've written a package that works in e.g. 2.12/2.13 but simply > cannot find the dynamic library under windows. The version on CRAN is > older than the one I'm talking about and depends on a newer version of R > but I want to make the package available to people with older versions. > > > utils:::menuInstallLocal() > package 'lassoshooting' successfully unpacked and MD5 sums checked > > require(lassoshooting) > Loading required package: lassoshooting > Error in library.dynam(lib, package, package.lib) : > shared library 'lassoshooting' not found > In addition: Warning message: > package 'lassoshooting' was built under R version 2.13.0 > > I'm usually under linux and don't know about the gory details of .dll > files. > > NAMESPACE file > -------------- > useDynLib(lassoshooting) > export(lassoshooting)