[Rd] create R package include Fortran source code.
Charles Berry
ccberry at ucsd.edu
Tue Jul 22 06:13:06 CEST 2014
yiqun yang <emiliawxr <at> gmail.com> writes:
>
> Thank you for your reply.
> First I try "R CMD INSTALL barpkg", then it gives similiar things:
>
-------------------------------------------------------------
[deleted]
-------------------------------------------------------------
> 2) I don't know how to check the "compile" problem. I just try to
> "dyn.load" the shared object in /src-i386 and /src-x64 in the package, and
> they both work well.
>
> I am guessing there is some error in the R language.
> ".First.lib"<-function(libname,pkgname){library.dynam("barpkg",pkgname,
> libname)}
> barfun<-function(n,x){
> .Fortran("bar",as.integer(n),as.double(x))
> }
> package.skeleton(name="barpkg",list=c("barfun"))
>
> I am not sure about this part. Can anyone give me some suggestion?
?.First.lib
refers to the base-defunct {base} help page which says:
[...]
# Defunct in 2.14.0
.First.lib(lib, pkg)
[...]
Details
Some of these have stubs which report that they are defunct, but most have
been removed completely (apart from being documented here).
[...]
====
So, don't use .First.lib.
Try a useDynLib directive in your NAMESPACE file.
You probably need to spend some time pondering
Writing R Extensions
especially section
1.5.4 useDynLib
HTH,
Chuck
More information about the R-devel
mailing list