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

Henrik Bengtsson hb at maths.lth.se
Mon Nov 11 07:24:40 CET 2002

>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

  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"

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.
What should this something be for "unix" systems? Would this be an ok

Thank you!

Henrik Bengtsson

Home: 201/445 Royal Parade, 3052 Parkville
Office: Bioinformatics, WEHI, Parkville
+61 (0)412 269 734 (cell), +61 (0)3 9387 4791 (home), 
+61 (0)3 9345 2324 (lab), +1 (508) 464 6644 (global fax)
hb at wehi.edu.au, http://www.maths.lth.se/~hb/
Time zone: +11h UTC (Sweden +1h UTC, Calif. -8h UTC)

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