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

ripley@stats.ox.ac.uk ripley at stats.ox.ac.uk
Mon Nov 11 12:46:28 CET 2002


One good reason is line endings for information files, which need to be
different on Windows, Mac and Unix.

Your package should be able to be *installed* anywhere, so why don't
you do that?  Build a source package (like all those on CRAN) and test is
with Rcmd check on Windows.

On Mon, 11 Nov 2002, Henrik Bengtsson wrote:

> >From R v1.6.0 there has been a new test added to the library() code.
> This test is performed when library() is ran on a "unix" system and it
> verifies that the "Built" platform (from the DESCRIPTION file) is
> "compatible" with the current platform. Here is the code extract from
> the local function testRversion() of library() that I am talking about:
>
>             if (.Platform$OS.type == "unix") {
>                 platform <- builtFields[2]
>                 m <- agrep(platform, R.version$platform)
>                 if (!length(m))
>                   stop(paste("package", fields[1, "Package"],
>                     "was built for", platform), call. = FALSE)
>             }
>
> For example, I have built a package using pure (100%) R code, which
> should be able to run anywhere. However, since the "Built" line in my
> DESCRIPTION says
>
>   Built: R 1.5.1;  Win32;  2002-11-11 10:44:35
>
> It won't pass this test on a unix machine, e.g. OSX. Unfortunately, at
> the place I am the next few months I have no way of testing
> compatibility issues under Unix etc and learning more about this myself.
> However, I can not see the reason for this test at this step in the
> loading of a package? I would understand the test if the package loaded
> relies on native code etc, but not for packages written in pure R. An
> answer would most likely enlighten me or maybe suggest a less "brutal"
> test.
>
> My current idea for a workaround of this problem is simply to replace
> the "Win32" string in  "Built: R 1.5.1;  Win32;  2002-11-11 10:44:35"
> with something else for the *.tar.gz package.

DESCRIPTION files in source packages should not have that line at all.

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