R devtools fails while installing xml2

273 views Asked by At

I have R 3.2.0 in RHEL 5.

I try to install devtools

install.packages("devtools", dep=TRUE)

At the end it fails with the error

xml2_url.cpp: In function cpp::List url_parse(Rcpp::CharacterVector):
xml2_url.cpp:85: error: struct _xmlURI has no member named query_raw
xml2_url.cpp:85: error: struct _xmlURI has no member named query_raw
make: *** [xml2_url.o] Error 1
ERROR: compilation failed for package xml2

How do I fix this issue? It seems to be a version problem?

2

There are 2 answers

0
Michel Antonesco On

yes I have done that

[root@ask ~]# ls -l /etc/yum.repos.d/
total 56
-rw-r--r-- 1 root root 1991 Mar 28 06:25 CentOS-Base.repo
-rw-r--r-- 1 root root  647 Mar 28 06:25 CentOS-Debuginfo.repo
-rw-r--r-- 1 root root  289 Mar 28 06:25 CentOS-fasttrack.repo
-rw-r--r-- 1 root root  630 Mar 28 06:25 CentOS-Media.repo
-rw-r--r-- 1 root root 7989 Mar 28 06:25 CentOS-Vault.repo
-rw-r--r-- 1 root root  244 May 25 00:37 cPAddons.repo
-rw------- 1 root root  239 Apr 18 12:50 cpanel-plugins.repo
-rw-r--r-- 1 root root  175 Mar  7  2014 devtools-2.repo
-rw-r--r-- 1 root root  204 Aug  7  2015 EA4.repo
-rw-r--r-- 1 root root  957 Nov  4  2012 epel.repo
-rw-r--r-- 1 root root 1056 Nov  4  2012 epel-testing.repo
-rw-r--r-- 1 root root  267 Apr 18 14:24 MariaDB100.repo
-rw-r--r-- 1 root root  257 Apr 18 14:25 MariaDB101.repo

AND RAN THE yum install libxml2 libxslt

0
Andrii On

I have similar kind of problems with installing "xml2" on new R environment. Here is a solution that fixed my problem:

withr::with_makevars(c(CXX = "g++ -std=c++11"), 
   install.packages("xml2", verbose = TRUE))

Source: https://github.com/r-lib/xml2/issues/231