Srecko
Srecko

Reputation: 199

installing igraph in R failed

I have R 3.4.1 on Linux Mint (platform i686-pc-linux-gnu), but the same problem happens with a previous version of R and on Windows as well. When I try to install igraph using install.packages(), this error happens:

foreign-graphml.c: In function ‘igraph_write_graph_graphml’:
foreign-graphml.c:1408:46: error: expected ‘)’ before ‘GRAPHML_NAMESPACE_URI’
   ret=fprintf(outstream, "<graphml xmlns=\"" GRAPHML_NAMESPACE_URI "\"\n");
                                              ^
foreign-graphml.c:1412:59: error: expected ‘)’ before ‘GRAPHML_NAMESPACE_URI’
   ret=fprintf(outstream, "         xsi:schemaLocation=\"" GRAPHML_NAMESPACE_URI "\n");
                                                           ^
foreign-graphml.c:1414:38: error: expected ‘)’ before ‘GRAPHML_NAMESPACE_URI’
   ret=fprintf(outstream, "         " GRAPHML_NAMESPACE_URI "/1.0/graphml.xsd\">\n");
                                      ^
/usr/lib/R/etc/Makeconf:159: recipe for target 'foreign-graphml.o' failed
make: *** [foreign-graphml.o] Error 1
ERROR: compilation failed for package ‘igraph’
* removing ‘/home/ninja/R/i686-pc-linux-gnu-library/3.4/igraph’
Warning in install.packages :
  installation of package ‘igraph’ had non-zero exit status

I tried installing from github as well, using something along those lines:

install_github("igraph/rigraph")

The second option works just fine, but installs igraph 1.1.0. What I need is 1.1.2, the version I would get with install.packages().

Any other options?

Upvotes: 1

Views: 5510

Answers (2)

yanchun zhang
yanchun zhang

Reputation: 1

Seems the libxml is not the latest version. For centos, run

yum install libxml2-devel

then
install.packages('igraph') And it worked for me.

Upvotes: 0

Wu Richard
Wu Richard

Reputation: 51

Just google-ed a solution, which helped me solve this.

sudo apt-get install libxml2-dev

before running install.packages('igraph')

Upvotes: 5

Related Questions