Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting error "In function ‘igraph_write_graph_graphml’:" while installing igraph package in R

Tags:

r

I am trying to install igraph package in R.But getting error in the foreign-graphml.c below:

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
                                                           ^
foreign-graphml.c:1414:38: error: expected ‘)’ before ‘GRAPHML_NAMESPACE_URI’
   ret=fprintf(outstream, "         " GRAPHML_NAMESPACE_URI "/1.0/graphml.xsd\">
                                      ^
/usr/lib/R/etc/Makeconf:134: recipe for target 'foreign-graphml.o' failed
make: *** [foreign-graphml.o] Error 1
ERROR: compilation failed for package ‘igraph’
* removing ‘/home/evangeline/R/x86_64-pc-linux-gnu-library/3.2/igraph’

The downloaded source packages are in
    ‘/tmp/Rtmp9eBTml/downloaded_packages’
Warning message:
In install.packages("igraph") :
  installation of package ‘igraph’ had non-zero exit status  

Kindly help me out.

Please find the sessionInfo: sessionInfo:

R version 3.2.3 (2015-12-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.2 LTS

locale:
 [1] LC_CTYPE=en_IN       LC_NUMERIC=C         LC_TIME=en_IN       
 [4] LC_COLLATE=en_IN     LC_MONETARY=en_IN    LC_MESSAGES=en_IN   
 [7] LC_PAPER=en_IN       LC_NAME=C            LC_ADDRESS=C        
[10] LC_TELEPHONE=C       LC_MEASUREMENT=en_IN LC_IDENTIFICATION=C 

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base
like image 988
Evangeline Avatar asked Jul 26 '17 05:07

Evangeline


3 Answers

I had the saime issue and solved it by typing the following in the terminal

sudo apt-get install libssl-dev  
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libxml2-dev
like image 54
Djandli Avatar answered Nov 17 '22 02:11

Djandli


I had the same issue. Like the previous poster noted (zwartemond), its a bug in igraph. The owner of the github repo fixed the issue but it will take a while for the package to be updated on CRAN, you'll have to wait for some time(around 2 weeks?).

To install igraph package directly from source use devtools:

install.packages("devtools")
library(devtools)
install_github("igraph/rigraph")

This worked for me.

like image 16
kaykae Avatar answered Nov 17 '22 02:11

kaykae


There is a bug in igraph, check this out: https://github.com/igraph/rigraph/issues/213

like image 3
Zwartemond Avatar answered Nov 17 '22 00:11

Zwartemond