R Package Issues

1 XML | 1.1 Issue | 1.2 Resolve:

XML

Issue

When installing the R XML package either explicitly, or as part of a dependency to a parent package, XML package fails to install:

* installing *source* package ‘XML’ ... ** package ‘XML’ successfully unpacked and MD5 sums checked ** using staged installation checking for gcc... /apps/u/spack/gcc/8.5.0/gcc/12.2.0-orvuxnl/bin/gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether the compiler supports GNU C... yes checking whether /apps/u/spack/gcc/8.5.0/gcc/12.2.0-orvuxnl/bin/gcc accepts -g... yes checking for /apps/u/spack/gcc/8.5.0/gcc/12.2.0-orvuxnl/bin/gcc option to enable C11 features... none needed checking how to run the C preprocessor... /apps/u/spack/gcc/8.5.0/gcc/12.2.0-orvuxnl/bin/gcc -E checking for sed... /usr/bin/sed checking for pkg-config... /usr/bin/pkg-config User defined xml-config: /apps/u/spack/gcc/12.2.0/libxml2/2.10.1-yr4vwha/bin/xml2-config, XML Version: 2, XML2: yes checking for stdio.h... yes checking for stdlib.h... yes checking for string.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for strings.h... yes checking for sys/stat.h... yes checking for sys/types.h... yes checking for unistd.h... yes checking for libxml/parser.h... yes Found the libxml parser.h in /apps/u/spack/gcc/12.2.0/libxml2/2.10.1-yr4vwha/include/libxml2//libxml/ Located parser file -I/apps/u/spack/gcc/12.2.0/libxml2/2.10.1-yr4vwha/include/libxml2//parser.h checking for gzopen in -lz... yes checking for xmlParseFile in -lxml2... no checking for xmlParseFile in -lxml... no configure: error: "libxml not found" ERROR: configuration failed for package ‘XML’ * removing ‘/pfs/tc1/home/sthiongo/R/x86_64-pc-linux-gnu-library/4.2/XML’

Resolve:

# Load and start R: > Sys.setenv(XML_CONFIG="/apps/u/spack/gcc/12.2.0/libxml2/2.10.1-yr4vwha/bin/xml2-config") > install.packages('XML', configure.args=c('--with-libxml2=/apps/u/spack/gcc/12.2.0/libxml2/2.10.1-yr4vwha/bin/xml2-config LIBXML_LIBDIR=-L/apps/u/spack/gcc/12.2.0/libxml2/2.10.1-yr4vwha/lib/ LIBXML_INCDIR=/apps/u/spack/gcc/12.2.0/libxml2/2.10.1-yr4vwha/include/libxml2/'))