Comment 3 for bug 1159053

Revision history for this message
Tamás Nepusz (ntamas) wrote : Re: [Bug 1159053] Re: Compilation fails with gcc 4.1.2 on CentOS 5.9

Damn, you are right. I will take care of the changes upstream and merge them back to igraph soon.

T.

On 23 Mar 2013, at 17:47, Gábor Csárdi <email address hidden> wrote:

> platform.h has:
>
> #ifdef _MSC_VER
> #define snprintf sprintf_s
> #define isnan(x) _isnan(x)
> #ifndef INFINITY
> # define INFINITY (DBL_MAX+DBL_MAX)
> #endif
>
> #ifndef NAN
> # define NAN (INFINITY-INFINITY)
> #endif
>
> #endif
>
> So this is for MSVC only, I guess. So you would need something like
> this:
>
> #include <math.h>
>
> #ifndef INFINITY
> # define INFINITY (1.0/0.0)
> #endif
>
> #ifndef NAN
> # define NAN (INFINITY-INFINITY)
> #endif
>
> --
> You received this bug notification because you are subscribed to igraph.
> https://bugs.launchpad.net/bugs/1159053
>
> Title:
> Compilation fails with gcc 4.1.2 on CentOS 5.9
>
> Status in The igraph library:
> New
>
> Bug description:
> /bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -I/usr/include/libxml2 -g -O2 -I/usr/include/libxml2 -MT gss.lo -MD -MP -MF .deps/gss.Tpo -c -o gss.lo `test -f 'plfit/gss.c' || echo './'`plfit/gss.c
> libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -I/usr/include/libxml2 -g -O2 -I/usr/include/libxml2 -MT gss.lo -MD -MP -MF .deps/gss.Tpo -c plfit/gss.c -fPIC -DPIC -o .libs/gss.o
> plfit/gss.c: In function 'gss':
> plfit/gss.c:92: error: 'NAN' undeclared (first use in this function)
> plfit/gss.c:92: error: (Each undeclared identifier is reported only once
> plfit/gss.c:92: error: for each function it appears in.)
> plfit/gss.c:93: error: 'INFINITY' undeclared (first use in this function)
> make[3]: *** [gss.lo] Error 1
> make[3]: Leaving directory `/home/csardi/src/igraph/igraph-0.6.5/src'
> make[2]: *** [all] Error 2
> make[2]: Leaving directory `/home/csardi/src/igraph/igraph-0.6.5/src'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/home/csardi/src/igraph/igraph-0.6.5'
> make: *** [all] Error 2
> [csardi@localhost igraph-0.6.5]$ gcc --version
> gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-54)
> Copyright (C) 2006 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
> [csardi@localhost igraph-0.6.5]$ uname -a
> Linux localhost.localdomain 2.6.18-348.el5 #1 SMP Tue Jan 8 17:53:53 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/igraph/+bug/1159053/+subscriptions