On Wed, Feb 18, 2009 at 6:58 AM, Laurence Muller
<address@hidden> wrote:
Hi,
Recently I modified the latest version of igraph 0.5.x to make it work with Visual Studio 2005.
While this modified version isn't bug free, it is in quite a usable state.
As far as I know, only the graph file reading/writing part is broken (GML GraphML etc).
The full (modified) source code (changelist below), developer binaries (include dir + lib file) and an example project are available at the following location:
http://www.multigesture.net/projects/igraph-05x-visual-studio-2005-fix/
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 */
------------------------------------------
Laurence Muller (M.Sc.)
Website/Blog/Portfolio:
http://www.multigesture.net/
_______________________________________________
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help