This repository was archived by the owner on Oct 26, 2023. It is now read-only.
This repository was archived by the owner on Oct 26, 2023. It is now read-only.
XML install from source Rtools40 #3
Closed
Description
I am trying to install XML from source with install.packages("XML", type = "source") on Windows using your Rtools40 tool chain.
I have initially started with a fresh installation of rtools40 with no additional packages. This provided the below error.
C:/rtools/mingw32/bin/gcc -I"C:/PROGRA~1/R/R-35~1.1/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:
DocParse.h:18:10: fatal error: libxml/parser.h: No such file or directory
#include <libxml/parser.h>
^~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [C:/PROGRA~1/R/R-35~1.1/etc/i386/Makeconf:208: DocParse.o] Error 1
ERROR: compilation failed for package 'XML'
* removing 'C:/Program Files/R/R-3.5.1/library/XML'
In R CMD INSTALL
Warning in install.packages :
installation of package ‘XML’ had non-zero exit status
Its my understanding that the installer doesn't come with all of the dependencies required and that pacman allows you to install these at the command line. As such I ran the following to install what I think is the libxml2 package that XML depends on:
pacman -S mingw-w64-{i686,x86_64}-libxml2
Unfortunately I am still getting the same error even though I have confirmed this is installed. Is it the case that now this is installed I should be able to install XML from source or am I missing something?
Thanks for your help,
Adam
Activity
adamrobinson361 commentedon Oct 13, 2018
Looks like it should be the devel package that I should be installing. I've found this in the rtools section of the pacman repos linked but this can't be installed due to missing dependencies of libmxl2-devel.
Is it the case that the repository linked to pacman is one you maintain specifically for packages that work with r tools on windows? And sorry for my naivety, but how do these compare to say a linux repository with libxml2-devel in?
jeroen commentedon Oct 13, 2018
Unfortunately the XML package does not pick up on libxml2 automatically. See here for .a workaround: https://github.com/r-windows/checks/issues/5#issue-335598042
adamrobinson361 commentedon Oct 14, 2018
Thanks @jeroen - thats fixed it! Can I ask is this solution unique to rtools40 or does say 35 come with libxml2? I don't think I've ever had XML being able to restore from source on 34 or 35.
Really liking this revamp of RTools btw - I think the ability to easily install system dependencies via pacman could really make our r workflow on windows a lot more viable. Currently a number of our packrat repos struggle to restore due to some rogue missing dependency which is making dependency management quite a battle.
jeroen commentedon Oct 14, 2018
The same issue would appear on Rtools 3.5 and earlier. I'm guessing you haven't had to build XML from source on R 3.5 and earlier because CRAN provides binaries?
adamrobinson361 commentedon Oct 14, 2018
No I have experienced many times - I've just ended up adding this to external packages.
lofung commentedon Jul 8, 2022
link dead above. and it does not work.
slodge commentedon May 19, 2023
I found it on the wayback link - https://web.archive.org/web/20201004225623/https://github.com/r-windows/checks/issues/5
However... I've since fought the 32-bit build following the instructions there (I might have the 64-bit build kind of working)