Running on Linux LEAP, R 4.1.2 (latest official release for this OS) Trying to install (in Rstudio ) R package XML. It fails with this (relevant lines):
Checking directory of LIBXML_INCDIR
Located parser file /usr/include/libxml2/parser.h
Checking for 1.8: /usr/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’
But I HAVE zlib & libxml2 installed & up to date. Have specified correct paths for these libraries, and some other flags, in ~/.Renviron :
LIBXML_INCDIR=/usr/include/libxml2
LIBXML_LIBDIR=/usr/lib64
PKG_CONFIG_PATH=/usr/lib64/pkgconfig
PKG_LIBS=-L/lib64 -lz
PKG_LIBDIR=/lib64
LDFLAGS=-L/usr/include/libxml2
CPPFLAGS=-I/usr/include/libxml2
And verified with Sys.getenv that they are set correctly in the R session, before running the install. I think the output lines:
Located parser file /usr/include/libxml2/parser.h
Checking for 1.8: /usr/include/libxml2
Using libxml2.*
imply that it is looking in the right place and HAS found libxml2. Yet it then cant find xmlParseFile and exits with "libxml not found".
Things I tried (with a little bit of help from chatgpt...)
- Setting config vars in the R session and in the install.packages command itself ( configure.args or configure.vars)
- Installing from source
- Installing from source in bash with R CMD INSTALL (after exporting config vars in bash shell)
- installing from github using remotes package Everything gives the same error message. Not managing to get more info on the error - bash install doesnt produce a config.log , and setting Sys.setenv(R_INSTALL_STAGED = "yes") gives no additional info . Am totally stumped! any ideas would be so much appreciated...