0
votes

I am trying to compile igraph 0.7.1 under Windows using MinGW. There are three steps for this.

configure
make
make install

configure is working fine. But I am getting the following error from make.

make all-recursive
make[1]: Entering directory `/home/874469/igraph-0.7.1'
Making all in src
make[2]: Entering directory `/home/874469/igraph-0.7.1/src'
make  all-am
make[3]: Entering directory `/home/874469/igraph-0.7.1/src'
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..    -DSkip_f2c_Undefs -I. -I../include -I../include -Wall -g -O2 -MT f2
c/libf2c_la-dtime_.lo -MD -MP -MF f2c/.deps/libf2c_la-dtime_.Tpo -c -o f2c/libf2c_la-dtime_.lo `test -f 'f2c/dtime_.c' || echo './'`f2c/dtime_.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -DSkip_f2c_Undefs -I. -I../include -I../include -Wall -g -O2 -MT f2c/libf2c_la-dtime_.lo -MD -MP
-MF f2c/.deps/libf2c_la-dtime_.Tpo -c f2c/dtime_.c  -DDLL_EXPORT -DPIC -o f2c/.libs/libf2c_la-dtime_.o
f2c/dtime_.c:16:23: fatal error: sys/times.h: No such file or directory
 #include "sys/times.h"
                       ^
compilation terminated.
make[3]: *** [f2c/libf2c_la-dtime_.lo] Error 1
make[3]: Leaving directory `/home/874469/igraph-0.7.1/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/874469/igraph-0.7.1/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/874469/igraph-0.7.1'
make: *** [all] Error 2

What is going wrong here? I am using gcc and g++ version 4.8.1.

Errors given after I followed suggestion by Tamas.

f2c/uninit.c: In function 'ieee0':
f2c/uninit.c:182:2: warning: implicit declaration of function '_control87' [-Wimplicit-function-declaration]
  _control87(EM_DENORMAL | EM_UNDERFLOW | EM_INEXACT, MCW_EM);
  ^
f2c/uninit.c:171:21: error: '_EM_DENORMAL' undeclared (first use in this function)
 #define EM_DENORMAL _EM_DENORMAL
                     ^
f2c/uninit.c:182:13: note: in expansion of macro 'EM_DENORMAL'
  _control87(EM_DENORMAL | EM_UNDERFLOW | EM_INEXACT, MCW_EM);
             ^
f2c/uninit.c:171:21: note: each undeclared identifier is reported only once for each function it appears in
 #define EM_DENORMAL _EM_DENORMAL
                     ^
f2c/uninit.c:182:13: note: in expansion of macro 'EM_DENORMAL'
  _control87(EM_DENORMAL | EM_UNDERFLOW | EM_INEXACT, MCW_EM);
             ^
f2c/uninit.c:174:22: error: '_EM_UNDERFLOW' undeclared (first use in this function)
 #define EM_UNDERFLOW _EM_UNDERFLOW
                      ^
f2c/uninit.c:182:27: note: in expansion of macro 'EM_UNDERFLOW'
  _control87(EM_DENORMAL | EM_UNDERFLOW | EM_INEXACT, MCW_EM);
                           ^
f2c/uninit.c:177:20: error: '_EM_INEXACT' undeclared (first use in this function)
 #define EM_INEXACT _EM_INEXACT
                    ^
f2c/uninit.c:182:42: note: in expansion of macro 'EM_INEXACT'
  _control87(EM_DENORMAL | EM_UNDERFLOW | EM_INEXACT, MCW_EM);
                                          ^
f2c/uninit.c:180:16: error: '_MCW_EM' undeclared (first use in this function)
 #define MCW_EM _MCW_EM
                ^
f2c/uninit.c:182:54: note: in expansion of macro 'MCW_EM'
  _control87(EM_DENORMAL | EM_UNDERFLOW | EM_INEXACT, MCW_EM);
                                                      ^
make[3]: *** [f2c/libf2c_la-uninit.lo] Error 1
make[3]: Leaving directory `/home/874469/igraph-0.7.1/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/874469/igraph-0.7.1/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/874469/igraph-0.7.1'
make: *** [all] Error 2
1
It seems others have stumbled into this issue as well when trying to compile igraph under MinGW; see this answer: stackoverflow.com/a/12766354/156771Tamás

1 Answers

2
votes

The sys/times.h header is not available on Windows. This header seems to be referred to from src/f2c/dtime_.c and src/f2c/etime_.c, but only if USE_CLOCK is not defined. Try recompiling igraph as follows:

CFLAGS=-DUSE_CLOCK ./configure
make
make install

Update: you will also need some other modifications as MinGW does not seem to support several other things that are used by f2c, a component of igraph. See this response on Stack Overflow for more things to tweak.