[R-pkg-devel] Trouble installing XML on Windows 7 (64-bit)

Haigh, Rowan Rowan.Haigh at dfo-mpo.gc.ca
Fri Dec 15 18:02:40 CET 2017

Hi Duncan,

Well I finally managed to install XML from source in Windows under R-devel. Basically it was a clue provided by user wlandau-lilly (last message on https://github.com/igraph/igraph/issues/915), and discussions between Gábor and user stewid (https://github.com/krlmlr-archive/r-portable/issues/3#issuecomment-72928971) that lead to success.

1. Download local323.zip from http://www.stats.ox.ac.uk/pub/Rtools/libs.html ;
2. Copy the files in local323.zip/include/libxml2/libxml/ directory to R-devel/include/libxml/ ;

3. Copy entire contents of local323.zip (directories include/ and lib/) to new directory C:/Apps/R/Rtools/local323/ ;

4. Change line 31 of two files `Makeconf' (in C:/Apps/R/Rdev/etc/i386/ and C:/Apps/R/Rdev/etc/x64/),  from `#LOCAL_SOFT' to `LOCAL_SOFT = C:/Apps/R/Rtools/local323'  ;

5. In R-devel, issue command `install.packages("XML", type = "source")'.

Cheers, Rowan
Tel. (250) 363-8718

-----Original Message-----
From: Duncan Murdoch [mailto:murdoch.duncan at gmail.com] 
Sent: Thursday, December 14, 2017 3:29 PM
To: Haigh, Rowan
Subject: Re: [R-pkg-devel] Trouble installing XML on Windows 7 (64-bit)

On 14/12/2017 1:59 PM, Haigh, Rowan wrote:
> Hi Duncan,
> R-devel I downloaded via FTP to CRAN base. In Windows it's simply a right click on the executable and "Run as administrator".
> For the XML package, I tried `install.packages("XML")', which succeeded, but the require(XML) command gave the message I reported below. This inability to load the package stops me Rchecking my package.
> Gabor suggested (and I had already tried):
> install.packages("XML", type = "source")
> but this just gave me:
> C:/Apps/R/Rtools/mingw_32/bin/gcc  -I"C:/Apps/R/Rdev/include" -DNDEBUG -I/include/libxml2 -I/include -D_R_=1 -DUSE_R=1 -DUSE_XML_VERSION_H=1 -DLIBXML -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DUMP_WITH_ENCODING=1 -DXML_ELEMENT_ETYPE=1  -DXML_ATTRIBUTE_ATYPE=1 -DLIBXML2=1 -DHAVE_XML_HAS_FEATURE -DLIBXML_STATIC         -O3 -Wall  -std=gnu99 -mtune=generic -c DocParse.c -o DocParse.o
> In file included from DocParse.c:10:0:
> DocParse.h:18:27: fatal error: libxml/parser.h: No such file or directory
>   #include <libxml/parser.h>
> which seems to call for something needed in the `include' directory.
> My problem is that I don't know what source files to put in the include directory form libxml for building XML from source. If libxml needs to be installed first, I'm not sure how to let the R install process know about the installation of libxml (or even how it handles the dual architecture).

Yes, I saw his message.  I think it's a CRAN issue that they are 
distributing 3.4 binaries for R-devel, when they are known to be 

Re building from source on Windows:  I used to know how to do that, but 
I don't do it any more.  I don't know if anyone really knows how these 
days.  I'd like to suggest abandoning that horrible platform, but that's 
likely not an option.  You can complain to Microsoft (perhaps MRAN has 
binary builds that work), but that likely won't lead anywhere.

So I'm afraid I can't help you.

Duncan Murdoch

> Cheers.
> -----Original Message-----
> From: Duncan Murdoch [mailto:murdoch.duncan at gmail.com]
> Sent: Thursday, December 14, 2017 10:23 AM
> To: Haigh, Rowan; r-package-devel at r-project.org
> Subject: Re: [R-pkg-devel] Trouble installing XML on Windows 7 (64-bit)
> On 14/12/2017 12:58 PM, Haigh, Rowan wrote:
>> I maintain a few packages on CRAN, one of which depends on the XML package.
>> Using the latest R-devel (2017-12-13 r73907), I can install the XML Windows binary from CRAN but I cannot load it:
> How exactly did you install XML, and how did you install R-devel?  There
> are several different binary versions of XML on CRAN, and lots of ways
> to build or download R-devel.
> I am currently building a copy of R-devel, and will try using
> install.packages("XML")
> to see if I can reproduce your problem.  I'm not certain my locally
> built copy will match the CRAN binary of R-devel, but we'll see.
> Duncan Murdoch
>>> require(XML)
>> Loading required package: XML
>> Error: package or namespace load failed for 'XML':
>> package 'XML' was installed by an R version with different internals; it needs to be reinstalled for use with this R version
>> I tried installing XML from source, but the compilation requires the libxml library.
>> Following the suggestions of various online users, I've tried putting libxml header files from different sources (www.omegahat.net/RSXML/<http://www.omegahat.net/RSXML/>, https://git.gnome.org/browse/libxml2/) in the R-devel/include/libxml directory, but C compilation fails (not surprisingly).
>> I'm not a C programmer and would appreciate any help on how to install the R package XML from source on a Windows system.
>> Thank-you.
>> Rowan Haigh
>> --------------------------------------------------------------------------------------------------
>> Research Biologist, Pacific Biological Station, Nanaimo, BC V9T 6N7
>> Offshore Section, Aquatic Resources Research & Assessment Division, Fisheries and Oceans Canada
>> tel. +1 250-363-8718 (IOS Rm 2443), fac simile +1 250-756-7053 (PBS), email rowan.haigh at dfo-mpo.gc.ca<mailto:rowan.haigh at dfo-mpo.gc.ca>
>> --------------------------------------------------------------------------------------------------
>> Biologiste de recherche, Station biologique du Pacifique, Nanaimo, C.-B. V9T 6N7
>> Section extrac�tier, Division de la recherche sur les ressources aquatiques et de l'�valuation, P�ches et Oc�ans Canada
>> t�l. +1 250-363-8718 (ISM ch 2443), t�l�copie +1 250-756-7053 (SBP), courriel rowan.haigh at dfo-mpo.gc.ca<mailto:rowan.haigh at dfo-mpo.gc.ca>
>> --------------------------------------------------------------------------------------------------
>> 	[[alternative HTML version deleted]]
>> ______________________________________________
>> R-package-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-package-devel

More information about the R-package-devel mailing list