在Win7中构建Riggraph程序包 [英] Building R igraph package in Win7

查看:109
本文介绍了在Win7中构建Riggraph程序包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对igraph包的源代码做了一些小的更改,因为我想基于

I made a small change to the source code of the igraph package because I want to implement the forest fire method based on the breadth first search method.

我使用了 Rtools 来构建软件包,并按照以下步骤进行操作:此链接.但是,我收到一条错误消息:

I used Rtools to build the package and followed the steps as this link. But, I got a error message:

foreign-graphml.c:38:29: fatal error: libxml/encoding.h: No such file or directory.

我使用源代码进行了测试,但仍然存在相同的错误.

I tested using the source code, but still had the same error.

我还使用了 install.packages()方法.它仍然显示相同的错误.

I also used the install.packages() method. It still showed the same error.

更新: 我下载了Libxml2,并将bin位置设置为路径. libxml/encoding.h文件实际上位于"include"文件夹中.为什么显示此错误?

Update: I downloaded the Libxml2 and set the bin location to the path. The libxml/encoding.h file is actually in the 'include' folder. Why does this error show?

推荐答案

您可以在 http://win-builder.r-project.org/upload.aspx ,只是不要忘记更改DESCRIPTION文件以将您的电子邮件地址包括为维护者.

You can build it at http://win-builder.r-project.org/upload.aspx, just don't forget to change the DESCRIPTION file to include your email address as maintainer.

构建它实际上是非常棘手的,因为Rtools具有一些固定(?)路径,并且它正在特定位置寻找库,因此您需要将它们放在那里.我们用类似的东西构建它

It is actually quite tricky to build it because Rtools has some fixed (?) paths and it is looking for libraries at specific places, so you need to put them there. We build it with something like

...
if ! (subst | grep -qi ^d:); then
  subst d: c:\\
fi

pkg=`ls igraph*.tar.gz`
zip=`echo $pkg | sed 's/.tar.gz/.zip/'`
rfile="r-win/${zip}"

OLDPATH=$PATH
PATH=/cygdrive/c/Program\ Files/R/R-default/bin:/cygdrive/c/Rtools/bin:/cygdrive/c/Rtools/gcc-4.6.3/bin:$PATH

LIB_XML=c:/RCompile/CRANpkg/extralibs64/local R CMD INSTALL -l . $pkg
zip -r ${zip} igraph
PATH=$OLDPATH
...

这使用cygwin外壳.您可以在此处获得额外的库: http://www.stats.ox.ac.uk/pub/Rtools /libs.html

This uses a cygwin shell. You can get the extra libraries here: http://www.stats.ox.ac.uk/pub/Rtools/libs.html

这篇关于在Win7中构建Riggraph程序包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆