Skip to content

Building packages on Windows fails

7 messages · Duncan Murdoch, Brian Ripley, Peter Kleiweg

#
What has changed in R for Windows from version 1.7.1 to
2.2.0 that won't allow me to build binary packages?

On 1.7.1 I built a packge with this command:

    Rcmd build --force --binary iL04

On 2.2.0 this fails. First I had to copy sh.exe from d:\bin to 
c:\bin. This got me over the first hurdle. But then I got stuck 
at a later point. Here are the last lines of output:

---------- Making package iL04 ------------
latex: not found
  adding build stamp to DESCRIPTION
latex: not found
latex: not found
latex: not found
  installing R files
latex: not found
  installing demos
  installing data files
latex: not found
  installing man source files
  installing indices
cat: d:/R-2.2.0/library/*/CONTENTS: No such file or directory
make[2]: *** [indices] Error 1
make[1]: *** [all] Error 2
make: *** [pkg-iL04] Error 2
*** Installation of iL04 failed ***
#
On Fri, 7 Oct 2005, Peter Kleiweg wrote:

            
Many things have changed; I don't know which is causing the failure you 
see.  One change is that instructions are now collected in the 
Installation and Administration manual. Try following the setup 
instructions there and see if it still fails.

Duncan Murdoch
#
Duncan Murdoch schreef op de 6e dag van de wijnmaand van het jaar 2005:
I can't find anything on building packages for Windows in that 
manual.

I did find a solution to the problem. On a Linux install, each 
package has a file CONTENTS. These are missing from the Windows 
install. I copied those files from my Linux install to my 
Windows install, and then I could build my own package. So I 
guess, these CONTENTS files should be included in the Windows 
install.

I got another error message when I remove a package, but I 
couldn't see what effect this error has. When I run:

    d:\>Rcmd REMOVE iL04

The package gets removed, but I get:

    make: *** No rule to make target `indices'.  Stop.

  
    
#
On Fri, 7 Oct 2005, Peter Kleiweg wrote:

            
Your problems was installing, so the section on `Installing Packages' 
should help you.

A binary build is an install plus wrapping-up.
And indeed they are, as the presence of 500+ packages on CRAN for
Windows will show you.

The recommended way to build a binary package on Windows is

R CMD INSTALL --build

since that is able to get HTML links made (on Windows, you need to install 
in the main library tree to do so).
That does seem a recent bug, soon to be fixed in R-patched.
#
Prof Brian Ripley schreef op de 7e dag van de wijnmaand van het jaar 2005:
Installing worked fine. Building a binary distribution (with 
compiled help files) is what didn't work.

This worked fine:

    Rcmd build iL04

But that just gave a gzip'ed tarfile, not a zip-file, and 
without the compiled helpfiles.

This didn't work:

    Rcmd build --force --binary iL04
Well, I just ran the install program for Windows, with compiled 
html help, but without the ordinary html help files. In that 
case, no CONTENTS files get installed.
Yes, that works. Even without the CONTENTS files. And this is 
recommended in the manual "Creating R packages", another manual 
than Duncan Murdoch was referring to.

I was using a method that was recommended in earlier versions. 
Perhaps that method should just be disabled, with a 
message about the current method, instead of having it fail for 
obscure reasons.
#
On Fri, 7 Oct 2005, Peter Kleiweg wrote:

            
Ah, that's the clue.  People normally build complete binary distributions: 
let's see if we can track that down.
It is not quite the same thing.  I have been in favour of removing it, but 
others have differed in their opinions.
#
Peter Kleiweg wrote:
I agree there should be only one method, and it should work.  The 
problem is:

  - Users with limited permissions can't run INSTALL, because it needs 
write access to R_HOME/library.

  - Because Windows doesn't have soft links, the only way we have to get 
cross references in the help files to work is to install to R_HOME/library.

I'd prefer to fix "Rcmd build --binary" so that it got the help links 
right and then have "Rcmd INSTALL --build" use it first, then install 
the .zip file, but I haven't taken the time to do this.  I don't like 
having two parallel tracks of very similar code (because of problems 
like yours, where the one I don't personnally use falls out of date and 
stops working).

Duncan Murdoch