I’m not an expert on this, but here I will try to explain step by step installling igraph (graph library for complex network research) on Cygwin. Citing igraph on sourceforge, igraph is a free software package for creating and manipulating undirected and directed graphs. It includes implementations for classic graph theory problems like minimum spanning trees and network flow, and also implements algorithms for some recent network analysis methods, like community structure search. Those, windows user, who need this package the most might be interested to use and compile it using gcc via cygwin.
01. Cygwin installed. Also, make sure you have development package installed.
01. Download latest C library source code directly from it’s official sites.
Save to $cygwindir$home$user$. In my case, the latest release (igraph-0.6.5.tar.gz) is saved to C:cygwinhomewahyu.reza
02. Open Cygwin Terminal
First, change directory to saved file folder. Type these code in order
tar zxf igraph-0.6.5.tar.gz
03. Try compiling your first code.
Open your fav text editor. Paste this code below and save as igraph_test.c to $cygwindir$home
igraph_erdos_renyi_game(&graph, IGRAPH_ERDOS_RENYI_GNP, 1000, 5.0/1000,
igraph_diameter(&graph, &diameter, 0, 0, 0, IGRAPH_UNDIRECTED, 1);
printf("Diameter of a random graph with average degree 5: %dn",
Back to Cygwin Terminal, type this
gcc igraph.c -I/home/wahyu.reza/igraph-0.6.5/ -L/home/wahyu.reza/igraph-0.6.5/src/.libs -ligraph -o igraph_test
Note: The directory after the -I switch is the one containing the igraph.h file, while the one following -L should contain the library file itself, usually a file called libigraph.so, libigraph.a or igraph.dll
Successful compile will result: Diameter of a random graph with average degree 5: 9