[R] library() - Error: Package foo was built for Win32

ripley@stats.ox.ac.uk ripley at stats.ox.ac.uk
Tue Nov 12 10:32:29 CET 2002


On Tue, 12 Nov 2002, Henrik Bengtsson wrote:

> Thanks. I've got some other off-line comments about distributing a
> source package instead. The reason for not doing this is that I wanted
> to make life as simple as possible for people using my packages. For
> instance, I can not rely on the fact that Windows users all have perl
> etc installed, which is is required for an installation from source (I
> believe this is why there is the option to create binary
> packages/bundles for Windows (Rcmd build --binary) in the first place.

Sort of.  It's the etc that is the problem, not Perl.

> What you and others imply(?) is that it is quite certain that
> (non-advanced computer) users on other operating systems than Windows,
> i.e. Unix clones (Linux, Solaris, OSX) and MacOS. If this is correct, I
> will from now on do
>
>  1) 'Rcmd build --binary foo' to build a *binary* package/bundle for
> Windows (*.zip)
>  2) 'Rcmd build foo' to build a *source* package/bundle for everything
> else (*.tar.gz)
>
> (I do check my package with 'Rcmd check'). My guess and concern is that
> some MacOS users might have problem installing from source.

They might, but then they might also have trouble unzipping files, and
(see later) it is not clear that files from a Windows install always
work.

> Also, is it
> correct that a *.zip file should be assumed to be a *binary Windows*
> package/bundle and any *tar.gz file should be assumed to be a *source*
> package/bundle and never a *binary* distribution?

No.  One can never assume what a user will do, and R CMD build will build
binary distributions as .tar.gz files on Unix.

> BTW: Jari Oksanen kindly replied to me that replacing "Win32" with "-"
> in the Built: line of (the binary) DESCRIPTION file would indeed prevent
> library() to report the error "Error: Package foo was built for Win32"

Not necessarily: that relies on the system name containing -.  As from
R-devel, an empty platform name will succeed.

> and a pure R library would load fine on a Unix system too. However, this
> solution is very ad hoc and is probably not in line with the purpose of
> the test. (I've already noticed the problem with line-endings and I
> assert that any "\r" characters are removed from DESCRIPTION).

But that's not the problem.  A Windows build will generate html files with
CRLF line endings, a Unix one with LF line endings and a classic MacOS one
with CR line endings (I believe).  There is no guarantee that the browser
on another platform will read files with foreign line endings.  R itself
will (as far as we know) as a determined effort was made around version
1.2.0 to ensure this.

There are often also problems with installed documentation.

-- 
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 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list