Dear all,
I am trying to install the XML package via BiocLite, which I need for various other packages. Yet there seems to be a problem with libxml2. I run CentOS and have installed the libxml-devel package via yum which is encouraged online. R itself was installed using anaconda. The output is this:
> source("https://bioconductor.org/biocLite.R")
Bioconductor version 3.5 (BiocInstaller 1.26.1), ?biocLite for help
> biocLite("XML")
BioC_mirror: https://bioconductor.org
Using Bioconductor 3.5 (BiocInstaller 1.26.1), R 3.4.1 (2017-06-30).
Installing package(s) ‘XML’
trying URL 'https://cran.rstudio.com/src/contrib/XML_3.98-1.9.tar.gz'
Content type 'application/x-gzip' length 1599437 bytes (1.5 MB)
==================================================
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... 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... /bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking for xml2-config... /home/kkarius/anaconda3/bin/xml2-config
USE_XML2 = yes
SED_EXTENDED_ARG: -E
Minor 9, Patch 4 for 2.9.4
Located parser file -I/home/kkarius/anaconda3/include/libxml2 -I/home/kkarius/anaconda3/include/parser.h
Checking for 1.8: -I/home/kkarius/anaconda3/include/libxml2 -I/home/kkarius/anaconda3/include
Using libxml2.*
checking for gzopen in -lz... yes
checking for xmlParseFile in -lxml2... yes
You are trying to use a version 2.* edition of libxml
but an incompatible library. The header files and library seem to be
mismatched. If you have specified LIBXML_INCDIR, make certain to also
specify an appropriate LIBXML_LIBDIR if the libxml2 library is not in the default
directories.
ERROR: configuration failed for package ‘XML’
* removing ‘/home/kkarius/anaconda3/lib/R/library/XML’
The downloaded source packages are in
‘/tmp/RtmpY66UhU/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages(pkgs = doing, lib = lib, ...) :
installation of package ‘XML’ had non-zero exit status
While the sessionInfo() output is:
> sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)
Matrix products: default
BLAS: /home/kkarius/anaconda3/lib/R/lib/libRblas.so
LAPACK: /home/kkarius/anaconda3/lib/R/lib/libRlapack.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] BiocInstaller_1.26.1
loaded via a namespace (and not attached):
[1] compiler_3.4.1 tools_3.4.1
Any help?
Thanks in advance.
All the best
Looks like the new markdown functionality is affecting the last section`# Install XML` with an `a href` tags, but looks normal when I try to edit the post.
Rewritten here without markdown:
# Install XML
R -q --vanilla <
devtools::install("./XML",
force = TRUE,
args = "--configure-args='--with-libxml2'")
EOF
So ... i followed your advice (kind of):
setenv LIBXML_LIBDIR /home/***/anaconda3/lib/
setenv LIBXML_INCDIR /home/***/anaconda3/include/libxml2/
R CMD INSTALL XML
produces
* installing to library ‘/home/***/anaconda3/lib/R/library’
* installing *source* package ‘XML’ ...
** package ‘XML’ successfully unpacked and MD5 sums checked
checking for gcc... gcc
checking for C compiler default output file name... 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... /bin/sed
checking for pkg-config... /usr/bin/pkg-config
Checking directory of LIBXML_INCDIR
Located parser file /home/***/anaconda3/include/libxml2//parser.h
Checking for 1.8: /home/***/anaconda3/include/libxml2/
Using libxml2.*
checking for gzopen in -lz... no
checking for xmlParseFile in -lxml2... no
checking for xmlParseFile in -lxml... no
configure: error: "libxml not found"
ERROR: configuration failed for package ‘XML’
Any ideas?
Ah, so you're using Anaconda's R distribution. Why don'y you use the conda package for CRAN's XML (called r-xml)? To reproduce your problem I installed Anaconda3 4.4.0 on RedHat 7.4, then:
Pariksheet