在 CentOS 5.11 上安装 R 3.2.3 包 igraph

在 CentOS 5.11 上安装 R 3.2.3 包 igraph

** 与其投反对票,不如表达一下如何改进帖子。谢谢!

我正在尝试安装安装在 CentOS 5.11 系统上的 R (3.2.3) 的 igraph。错误尾部如下所示:

foreign-graphml.c:65: warning: excess elements in struct initializer
foreign-graphml.c:65: warning: (near initialization for ‘blankEntityStruct’)
foreign-graphml.c: In function ‘igraph_read_graph_graphml’:
foreign-graphml.c:1330: error: ‘XML_PARSE_HUGE’ undeclared (first use in this function)
foreign-graphml.c:1330: error: (Each undeclared identifier is reported only once
foreign-graphml.c:1330: error: for each function it appears in.)
make: *** [foreign-graphml.o] Error 1
ERROR: compilation failed for package ‘igraph’
* removing ‘/usr/lib64/R/library/igraph’

The downloaded source packages are in
    ‘/tmp/RtmpBDaixr/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("igraph") :
  installation of package ‘igraph’ had non-zero exit status

XML_PARSE_HUGE 引起了我的注意。快速谷歌搜索发现它直到 libxml2 2.7.3 才出现(https://lists.nongnu.org/archive/html/igraph-help/2015-10/msg00022.html)。看来我需要为该机器构建一个较新的版本,我之前曾在下面的链接中遇到过此机器。

在 CentOS 5.X 上安装 libxml2 2.7.X

当我使用以下命令运行安装程序时

yum localinstall --nogpgcheck /usr/src/redhat/RPMS/x86_64/libxml2-2.7.8-1.x86_64.rpm

我得到了这个

Error: Missing Dependency: libxml2.so.2 is needed by package eel2-2.16.1-1.el5.i386 (installed)
Error: Missing Dependency: libxml2.so.2 is needed by package evolution-data-server-1.12.3-18.el5.i386 (installed)
Error: Missing Dependency: libxml2.so.2 is needed by package 1:gnome-utils-2.16.0-5.el5.i386 (installed)
Error: Missing Dependency: libxml2.so.2 is needed by package libxslt-1.1.17-4.el5_8.3.i386 (installed)
Error: Missing Dependency: libxml2.so.2 is needed by package 7:kdenetwork-3.5.4-13.el5_6.1.i386 (installed)
Error: Missing Dependency: libxml2.so.2 is needed by package gnome-media-2.16.1-3.el5.i386 (installed)
Error: Missing Dependency: libxml2.so.2 is needed by package gnome-pilot-2.0.13-16.i386 (installed)
Error: Missing Dependency: libxml2.so.2 is needed by package 1:control-center-2.16.0-16.el5.i386 (installed)
You could try using --skip-broken to work around the problem
You could try running: package-cleanup --problems
                    package-cleanup --dupes
                    rpm -Va --nofiles --nodigest

我以为它可能需要 32 位软件包

rpmbuild --target i386 -ba /usr/src/redhat/SPECS/libxml2.spec
yum localinstall --nogpgcheck /usr/src/redhat/RPMS/i386/libxml2-2.7.8-1.i386.rpm 

哪个尾巴

Error: Missing Dependency: libxml2.so.2()(64bit) is needed by package gtkhtml2-2.11.0-3.x86_64 (installed)
Error: Missing Dependency: libxml2.so.2()(64bit) is needed by package nautilus-2.16.2-10.el5.x86_64 (installed)
Error: Missing Dependency: libxml2.so.2()(64bit) is needed by package libgnome-java-2.12.4-3.fc6.x86_64 (installed)
Error: Missing Dependency: libxml2.so.2()(64bit) is needed by package nautilus-cd-burner-2.16.0-7.el5.x86_64 (installed)
Error: Missing Dependency: libxml2.so.2()(64bit) is needed by package gnome-spell-1.0.7-3.1.x86_64 (installed)
Error: Missing Dependency: libxml2.so.2()(64bit) is needed by package 1:gnome-utils-2.16.0-5.el5.x86_64 (installed)
Error: Missing Dependency: libxml2.so.2()(64bit) is needed by package gok-1.2.0-2.el5.x86_64 (installed)
Error: Missing Dependency: libxml2.so.2()(64bit) is needed by package libglade-java-2.12.5-3.fc6.x86_64 (installed)
Error: Missing Dependency: libxml2.so.2()(64bit) is needed by package evolution-webcal-2.7.1-6.x86_64 (installed)
You could try using --skip-broken to work around the problem
You could try running: package-cleanup --problems
                    package-cleanup --dupes
                    rpm -Va --nofiles --nodigest

我有点紧张,不敢尝试使用 --skip-broken 和 package-cleanup,因为我需要一个可靠的迁移补丁来替换更改(它在生产机器上),而我对这一切并不像我应该的那样熟悉。我可能不得不启动一个虚拟机来测试。最终,我所寻找的只是系统上运行的 R igraph 包。有人有什么想法吗?

答案1

该解决方案源自邮政作者:Radek Simko:

wget ftp://xxmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
tar -xvf libxml2-2.7.8.tar.gz
cd libxml2-2.7.8
./configure
make
sudo make install

这很简单,只需从源代码进行编译即可安装。然后我可以:

install.packages("igraph")

成功登入R

相关内容