I was trying to use a R package called "XML", aber hatte Probleme nach der Installation zu verwenden:Wie kann ich angeben, welche R lib bei der Installation eines R-Pakets verwendet werden soll?
# in R environment
> library("XML")
> XML::parseURI("")
Error in XML::parseURI("") : cannot parse URI
das Problem, dass R entpuppte nicht die aktuelle Version von "libxml2" installiert in meinem Verzeichnis gefunden:
echo $LD_LIBRARY_PATH /somewhere/Jun/Programme/libxml2-devel-2.9.1-2.1/usr/lib/:
Informationen über die Version der libxml2 Bibliothek "XML" abrufen
> path = unclass(getLoadedDLLs()[["XML"]])$path
> path
[1] "/misc/home/Jun/Programme/R-3.3.1/lib64/R/library/XML/libs/XML.so"
> system2("ldd",args=path)
linux-vdso.so.1 => (0x00007fff2a9e8000)
libxml2.so.2 => /usr/lib64/libxml2.so.2 (0x00002aefc088a000) # XML is using a common "libxml2.so.2" not the one I installed.
libz.so.1 => //home/Jun/Programme/zlib-1.2.11/lib/libz.so.1 (0x00002aefc0bc8000)
libm.so.6 => /lib64/libm.so.6 (0x00002aefc0de5000)
libdl.so.2 => /lib64/libdl.so.2 (0x00002aefc1068000)
...
Jeder zu
Verknüpfung Vorschlag, das zu tun?um "XML" Link zum libxml2 in meinem Verzeichnis installiert zu machen, gemacht ich solche Bemühungen:
Stellweg für libxml2:
echo $ LD_LIBRARY_PATH
/irgendwo/Jun/Programm/pcre-8.40/lib /:/irgendwo/Jun/Programm/xz-5.2.3/lib /:/irgendwo/Jun/Programm/zlib-1.2.11/include /:/irgendwo/Jun/Programm/zlib-1.2.11/lib /:/irgendwo/Jun/Programm/bzip2-1.0.6/lib /:/irgendwo/Jun/Programm/bzip2-1.0.6/includ e /:/irgendwo/Jun/Programm/gcc-6.1.0/lib /:/irgendwo/Jun/Programm/gcc-6.1.0/lib64 /:/irgendwo/Jun/Programm/libxml2-devel-2.9.1- 2.1/usr/lib /:/irgendwo/Jun/Programm/curl-7.52.1/lib /:/irgendwo/Jun/Programm/libtool_CentOS6_64/usr/lib64 /:/home/appl/openmpi-1.3.1/lib: /opt22/lsf83_exp/8.3/linux2.6-glibc2.3-x86_64/lib:/opt/ups/lib
recompile R mit Konfigurations lib mit "enable" -Argument Spezifizierungs
configure --prefix = $ HOME/Programm/R-3.3.1 --enable-R-shlib LDFLAGS = "- L/$ HOME/Programm/zlib-1.2.11/lib -L/$ HOME/Programm/bzip2-1.0 .6/lib -L/$ HOME/Programm/xz-5.2.3/lib -L/$ HOME/Programm/pcre-8.40/lib -L/$ HOME/Programm/curl-7.52.1/lib "CPPFLAGS = "-I/$ HOME/Programm/zlib-1.2.11/include -I/$ HOME/Programm/bzip2-1.0.6/include - I/$ HOME/Programm/xz-5.2.3/include -I/$ HOME/Programm/pcre-8.40/include -I/$ HOME/Programm/curl-7.52.1/include "
installieren" XML "mit Konfigurationsargumenten:
bioklische (" XML ", configure.args = '- mit-xml-config ="/irgendwo/Jun/Programm/libxml2-devel-2.9.1-2.1/usr/bin/xml2-config "') BioC_mirror: http://bioconductor.org Verwendung von Bioconductor 3.4 (BiocInstaller 1.24.0), R 3.3.1 (2016-06-21). Installation Paket (en) 'XML' versucht URL 'http://cran.rstudio.com/src/contrib/XML_3.98-1.5.tar.gz'
Inhaltstyp 'application/x-gzip' Länge 1.599.213 Byte (1,5 MB)
heruntergeladen 1.5 MB ...
aber keiner von ihnen schien zu funktionieren:
* 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
User defined xml-config: /somewhere/Jun/Programme/libxml2-devel-2.9.1-2.1/usr/bin/xml2-config, XML Version: 2, XML2: yes
USE_XML2 = yes
SED_EXTENDED_ARG: -r
Minor 9, Patch 1 for 2.9.1
Located parser file -I/usr/include/libxml2/parser.h
checking for gzopen in -lz... yes
checking for xmlParseFile in -lxml2... yes
checking for xmlHashSize in -lxml2... yes
Using built-in xmlHashSize
Checking DTD parsing (presence of externalSubset)...
checking for xmlHashSize in -lxml2... yes
Found xmlHashSize
checking for xmlOutputBufferCreateBuffer in -lxml2... yes
have xmlOutputBufferCreateBuffer()
checking for xmlDocDumpFormatMemoryEnc in -lxml2... yes
checking libxml/xmlversion.h usability... yes
checking libxml/xmlversion.h presence... yes
checking for libxml/xmlversion.h... yes
Expat: FALSE
Checking for return type of xmlHashScan element routine.
No return value for xmlHashScan
xmlNs has a context field
Checking for cetype_t enumeration
Using recent version of R with cetype_t enumeration type for encoding
checking for xmlsec1-config... /usr/bin/xmlsec1-config
nodegc default
xml-debug default
No XML_WITH_ZLIB enumeration value.
Version has xmlHasFeature()
****************************************
Configuration information:
Libxml settings
libxml include directory: -I/usr/include/libxml2
libxml library directory: -lxml2 -lz -lm -ldl -lz -lxml2
libxml 2: -DLIBXML2=1
Was ist die Ausgabe von '/somewhere/Jun/Programme/libxml2-devel-2.9.1-2.1/usr/bin/xml2-config --cflags --libs'? – nwellnhof
@nwellnhof, hallo nwellnhof, wie Sie vielleicht vermuten, 'xml2-config --cflags -I/usr/include/libxml2 xml2-config --libs -lxml2 lz -Im -ldl # die xml2-config Punkte in den Systembibliotheken. 'meine xml2-config zeigte nicht auf die lib die ich installiert habe. Ich löste mein Problem durch Neuinstallation durch Kompilieren statt mit "rpm". Danke für Ihre Aufmerksamkeit und Ihren Vorschlag. – Jun