Question

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.

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.

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

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?

Was it helpful?

Solution

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.

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
...

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top