r-lib / xml2

Bindings to libxml2
https://xml2.r-lib.org/
Other
220 stars 82 forks source link

Configuration error on Ubuntu 22.04.02 #392

Closed AdaemmerP closed 1 year ago

AdaemmerP commented 1 year ago

I am trying to install "xml2", but I get the following error message:

Found pkg-config cflags and libs!
Using PKG_CFLAGS=-I/usr/include/libxml2
Using PKG_LIBS=-lxml2
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libxml-2.0 was not found. Try installing:
 * deb: libxml2-dev (Debian, Ubuntu, etc)
 * rpm: libxml2-devel (Fedora, CentOS, RHEL)
 * csw: libxml2_dev (Solaris)
If libxml-2.0 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libxml-2.0.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'

However, I have installed the packagelibxml2-dev. The command which xml2-config yields /usr/bin/xml2-config. In addition, following the advice here, I have put the file "libxml-2.0.pc" also at /usr/lib/pkgconfig, but to no avail.

I also tried within R

Sys.setenv(PKG_CONFIG_PATH="/usr/lib/pkgconfig/")
install.packages("xml2")

and

Sys.setenv(PKG_CONFIG_PATH="/usr/lib/x86_64-linux-gnu/pkgconfig/")
install.packages("xml2") 

yet still receiving the same error message as above.

I am running Ubuntu 22.04.02 with Kernel 5.19.0-42.

AdaemmerP commented 1 year ago

Installing r-base-dev solved it.