[Rd] useDynLib in older versions e.g. (2.10)

Tobias Abenius tobias.abenius at chalmers.se
Thu Apr 21 11:30:43 CEST 2011


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)


More information about the R-devel mailing list