in Programming

Installing igraph C library on Cygwin

154px-cygwin_logoI’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.

 

Requirements:

01. Cygwin installed. Also, make sure you have development package installed.

Steps:

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
cd igraph-0.6.5
./configure
make
make install

03. Try compiling your first code.

Open your fav text editor. Paste this code below and save as igraph_test.c to $cygwindir$home

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

./igraph_test
Successful compile will result: Diameter of a random graph with average degree 5: 9

References:
http://commons.wikimedia.org/wiki/File:Cygwin_logo.svg
http://igraph.sourceforge.net/doc/html/index.html

Write a Comment

Comment

  1. Hi Wahyu Reza!
    I am Thanh Thanh. Can you give me your email? I have problems with igraph C, can I ask you via email? Thank you very much!

  2. Hello Wahyu Reza!
    Please help me! When I install Cygwin, What do i install development packages ? and I already installed Cygwin, so How can i add development packages?
    Thank you very much!
    Thanh Thanh