igraph

Authors: Gábor Csárdi / Tamás Nepusz
Official site: http://cneurocvs.rmki.kfki.hu/igraph/index.html
Repository: http://bazaar.launchpad.net/~igraph/igraph

Notes on the mailing list: http://lists.nongnu.org/archive/html/igraph-help/2009-07/msg00013.html

downloads

note: these are unofficial and unsupported builds!
05-main-rev1294-vs8
Full source code (this is rev1294 with my fixes for visual studio 2005)
05-main-rev1294-vs8 binary include files and library only, use this if you just want to use igraph in visual studio 2005
05-main-rev1294-vs8 example Example project, requires the ‘binary’ package

Know issues

  • File reader/writers aren’t working (GML/Graphml/Pajek/Graphviz etc)

List of changes

Using revision 1294
Repository: https://code.launchpad.net/~igraph/igraph/0.5-main

1. bliss_timer.cc line 18, Remove or make the following line a comment:
#include <unistd.h>

2. Add #ifndef YY_NO_UNISTD_H at the top of the following files:
foreign-gml-lexer.c
foreign-lgl-lexer.c
foreign-ncol-lexer.c
foreign-pajek-lexer.c

After these ‘fixes’ the library will build (igraph.lib) but not work yet.
When trying the examples from:
http://cneurocvs.rmki.kfki.hu/igraph/doc/html/ch03s01.html
http://cneurocvs.rmki.kfki.hu/igraph/doc/html/ch03s03.html

3. Fix the missing _ifinite issue:
Add in random.c:
#include <float.h>

4. Fix the missing isnan issue (also in random.c, _isnan requires float.h):
int R_isnancpp(double x)
{
return (_isnan(x)!=0);
// return (isnan(x)!=0);
}

and

#ifdef __cplusplus
int R_isnancpp(double); /* in arithmetic.c */
#define ISNAN(x) R_isnancpp(x)
#else
//#define ISNAN(x) (isnan(x)!=0)
#define ISNAN(x) (_isnan(x)!=0)
#endif

5. Fix the missing round issue (also in random.c):
Add this line near the includes at the top:

int round (double x)
{
int i = (int) x;

if (x >= 0.0)
{
return ((x-i) >= 0.5) ? (i + 1) : (i);
}
else
{
return (-x+i >= 0.5) ? (i – 1) : (i);
}
}

6. Fix the missing isnan issue (in math.c)
change line 44:
return (!isnan(x) & (x != IGRAPH_POSINFINITY) & (x != IGRAPH_NEGINFINITY));
to
return (!_isnan(x) & (x != IGRAPH_POSINFINITY) & (x != IGRAPH_NEGINFINITY));

7. igraph.lib(structure_generators.obj):
error LNK2019: unresolved external symbol _strcasecmp referenced in function _igraph_famous
solution
http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/cf092a87-3256-4d02-81c6-57c707e71e13/

add this at the top of the file:
#if defined(WIN32) || defined(WIN64)
#define strcasecmp _stricmp
#endif /* Def WIN32 or Def WIN64 */