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

Wenyi Wang wwang30 at jhmi.edu
Fri Sep 5 05:35:17 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.

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.

   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
" 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

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

Best Regards,

More information about the R-help mailing list