Hello, I’ve been trying to install the xml2 R package since its a dependency for GEOquery but haven’t been able to get past this compilation error:
==> Starting build()...
* installing *source* package ‘xml2’ ...
** package ‘xml2’ successfully unpacked and MD5 sums checked
** using staged installation
Found pkg-config cflags and libs!
Using PKG_CFLAGS=-I/usr/include/libxml2
Using PKG_LIBS=-lxml2 -lz -llzma -licui18n -licuuc -licudata -lm
** libs
using C compiler: ‘gcc (GCC) 13.2.1 20230801’
using C++ compiler: ‘g++ (GCC) 13.2.1 20230801’
g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -I../inst/include -I/usr/include/libxml2 -DUCHAR_TYPE=wchar_t -DU_SHOW_CPLUSPLUS_API=0 -I/usr/local/include -fvisibility=hidden -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c connection.cpp -o connection.o
gcc -I"/usr/include/R/" -DNDEBUG -I../inst/include -I/usr/include/libxml2 -DUCHAR_TYPE=wchar_t -DU_SHOW_CPLUSPLUS_API=0 -I/usr/local/include -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c init.c -o init.o
g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -I../inst/include -I/usr/include/libxml2 -DUCHAR_TYPE=wchar_t -DU_SHOW_CPLUSPLUS_API=0 -I/usr/local/include -fvisibility=hidden -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c xml2_doc.cpp -o xml2_doc.o
g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -I../inst/include -I/usr/include/libxml2 -DUCHAR_TYPE=wchar_t -DU_SHOW_CPLUSPLUS_API=0 -I/usr/local/include -fvisibility=hidden -fpic -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects -c xml2_init.cpp -o xml2_init.o
xml2_init.cpp: In function ‘SEXPREC* init_libxml2()’:
xml2_init.cpp:46:35: error: invalid conversion from ‘void (*)(void*, xmlError*)’ {aka ‘void (*)(void*, _xmlError*)’} to ‘xmlStructuredErrorFunc’ {aka ‘void (*)(void*, const _xmlError*)’} [-fpermissive]
46 | xmlSetStructuredErrorFunc(NULL, handleStructuredError);
| ^~~~~~~~~~~~~~~~~~~~~
| |
| void (*)(void*, xmlError*) {aka void (*)(void*, _xmlError*)}
In file included from xml2_init.cpp:8:
/usr/include/libxml2/libxml/xmlerror.h:898:57: note: initializing argument 2 of ‘void xmlSetStructuredErrorFunc(void*, xmlStructuredErrorFunc)’
898 | xmlStructuredErrorFunc handler);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
make: *** [/usr/lib64/R/etc/Makeconf:200: xml2_init.o] Error 1
ERROR: compilation failed for package ‘xml2’
* removing ‘/home/carolinkun/.cache/yay/r-xml2/src/build/xml2’
==> ERROR: A failure occurred in build().
Aborting...
-> error making: r-xml2-exit status 4
-> Failed to install the following packages. Manual intervention is required:
r-xml2 - exit status 4
I’ve checked for libxml2 and I do have it installed. My pkg-config path is also set correctly, not sure what else to do since I’m still fairly new.
Thanks in advance!