Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to install XML package in R on CentOS

Tags:

r

centos

When I try to install xml package in R on CENTOS i recieve such warning:

> install.packages("XML")
Installing package into ‘/opt/wpusers/r-mkosinski/R/x86_64-redhat-linux-gnu-library/3.1’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/XML_3.98-1.1.tar.gz'
Content type 'application/x-gzip' length 1582216 bytes (1.5 Mb)
opened URL
==================================================
downloaded 1.5 Mb

* installing *source* package ‘XML’ ...
** package ‘XML’ successfully unpacked and MD5 sums checked
checking for gcc... gcc
checking for C compiler default output file name... 
rm: cannot remove 'a.out.dSYM': Is a directory
a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for sed... /usr/bin/sed
checking for pkg-config... /bin/pkg-config
checking for xml2-config... no
Cannot find xml2-config
ERROR: configuration failed for package ‘XML’
* removing ‘/opt/wpusers/r-mkosinski/R/x86_64-redhat-linux-gnu-library/3.1/XML’
Warning in install.packages :
  installation of package ‘XML’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/Rtmp3rqP3n/downloaded_packages’

>

My session info is:

> session_info()
Session info --------------------------------------------------------------------
 setting  value                       
 version  R version 3.1.2 (2014-10-31)
 system   x86_64, linux-gnu           
 ui       RStudio (0.98.1091)         
 language (EN)                        
 collate  en_US.UTF-8                 
 tz       Europe/Warsaw               

Packages ------------------------------------------------------------------------
 package    * version   date       source                            
 archivist    1.2       2015-02-12 Github (pbiecek/archivist@d5305be)
 assertthat * 0.1       2013-12-06 CRAN (R 3.1.2)                    
 bitops     * 1.0-6     2013-08-17 CRAN (R 3.1.2)                    
 DBI          0.3.1     2014-09-24 CRAN (R 3.1.2)                    
 devtools     1.7.0     2015-01-17 CRAN (R 3.1.2)                    
 digest     * 0.6.8     2014-12-31 CRAN (R 3.1.2)                    
 dplyr        0.4.0     2015-01-08 CRAN (R 3.1.2)                    
 htmltools  * 0.2.6     2014-09-08 CRAN (R 3.1.2)                    
 httpuv     * 1.3.2     2014-10-23 CRAN (R 3.1.2)                    
 httr       * 0.6.1     2015-01-01 CRAN (R 3.1.2)                    
 lubridate    1.3.3     2013-12-31 CRAN (R 3.1.2)                    
 magrittr   * 1.5       2014-11-22 CRAN (R 3.1.2)                    
 memoise    * 0.2.1     2014-04-22 CRAN (R 3.1.2)                    
 mime       * 0.2       2014-09-26 CRAN (R 3.1.2)                    
 pbapply      1.1-1     2014-05-16 CRAN (R 3.1.2)                    
 plyr       * 1.8.1     2014-02-26 CRAN (R 3.1.2)                    
 R6         * 2.0.1     2014-10-29 CRAN (R 3.1.2)                    
 Rcpp       * 0.11.3    2014-09-29 CRAN (R 3.1.2)                    
 RCurl      * 1.95-4.5  2014-12-28 CRAN (R 3.1.2)                    
 RJSONIO    * 1.3-0     2014-07-28 CRAN (R 3.1.2)                    
 RSQLite      1.0.0     2014-10-25 CRAN (R 3.1.2)                    
 rstudio    * 0.98.1091 2015-01-19 local                             
 rstudioapi * 0.2       2014-12-31 CRAN (R 3.1.2)                    
 shiny        0.10.2.2  2014-12-08 CRAN (R 3.1.2)                    
 stringi      0.4-1     2014-12-14 CRAN (R 3.1.2)                    
 stringr    * 0.6.2     2012-12-06 CRAN (R 3.1.2)                    
 xtable     * 1.7-4     2014-09-12 CRAN (R 3.1.2) 

Maybe it is a matter of R version?

like image 458
Marcin Kosiński Avatar asked Mar 12 '15 15:03

Marcin Kosiński


Video Answer


1 Answers

You have two problems clearly stated in the output:

  1. The first is a warning, you may want to remove a.out/:
checking for C compiler default output file name... 
rm: cannot remove 'a.out.dSYM': Is a directory
a.out
checking whether the C compiler works... yes
  1. The second is an error and your dealbreaker -- you do not have libxml2-dev (or whatever CentOS calls this) installed:
checking for xml2-config... no
Cannot find xml2-config

Without the XML development tools provided by libxml2-dev you simply cannot build the package from source.

like image 100
Dirk Eddelbuettel Avatar answered Oct 06 '22 06:10

Dirk Eddelbuettel