[R] Two questions about building R add-on package

Brian D Ripley ripley at stats.ox.ac.uk
Fri Sep 5 10:50:11 CEST 2003

> I am a new user of R and am building an R add-on package. I followed the
> "Writing R Extension" manual from cran website but still met some
> problems that I cannot solve. I build it under redhat linux 9.0 R1.7.0.
> Say foo is the name of the package.

Do read the instructions!

> First, after I wrote the Rd files for each function in the package, R
> CMD check keep giving error message:
> "*checking Rd files....OK
> .....................
> *checking foo-manual.tex....ERROR
> Could not creat DVI version.
> This typically indicates Rd problems."
> But if I use R CMD Rd2dvi with each Rd File (I have totally 8 Rd files
> for 8 functions), the dvi files are created with no problem.  Even after
> that, the R CMD check still give the same error message. I wonder if
> anyone has met similar problem before and how you solved it.
> Second, I was looking for a way to compile the package for Windows R.  I
> tried two ways to compile it.
>     a.I used cygwin,mwing32 and perl as provided on
> www.stats.ox.ac.uk/pub/Rtools, and compiled the package under windowsME
> MS-DOS window with those tools installed.  The major problem was
> incurred by .dll file.  As in the package, for the functions to work
> properly, we need to call a C file, which in windows R has to be
> converted to .dll file.  So even though foo.dll file was created by
> cygwin, I cannot dyn.load it under winME R1.7.1. Interestingly, I CAN
> dyn.load the same file under win2000 R1.5.1 and winXP R1.7.1.  But, as
> we are concerned about the users with WinME installed on their computer,
> we want to make the dll file work under winME as well.

We quite explicitly say Cygwin is not supported.

>    b. I also tried to cross-compile the package under linux, which was
> said able to solve the dll problem.  I followed "Building Microsoft
> Windows Versions of R and R packages under Intel Linux$)A!1 by Jun
> Yan and A. J. Rossini and used their Makefile.  But it kept giving error
> message:
> " making DLL...
>   console.c:22: config.h: No such file or directory
>   make[4]: *** [console.o] Error 1
>   make[3]: *** [libR] Error 2
>   make[2]: *** [src/foo.dll] Error 2
>   make[1]: *** [pkg-foo] Error 2
> ....."

We quite explicitly say you need to build R first.  If Yun-Rossini do not,
take this up with them.  In any case, I rather object: all the real work
was done by the R-Windows maintainers and supplied with the R sources.

> If anyone knows about these problems, please give me a hand.  Your help
> is very important to me.  Thank you very much.

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

More information about the R-help mailing list