igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] Easier way to compile igraph on Windows?


From: Szabolcs Horvát
Subject: Re: [igraph] Easier way to compile igraph on Windows?
Date: Sun, 13 Sep 2015 14:57:17 +0200

On 7 September 2015 at 21:34, Tamas Nepusz <address@hidden> wrote:
>> I tried installing msys2 <https://msys2.github.io/> to be able to run the
>> configure script, and the mingw-w64 package to be able to compile for 64 bit
>> systems.  Unfortunately the build process stops when the compiler cannot
>> find <sys/times.h>.
> sys/times.h is not available in MinGW, only in Cygwin (as far as I
> know). The only place where igraph uses it is in f2c, which is a
> third-party library. In particular, the two occurrences are in
> src/f2c/dtime_.c and src/f2c/etime_.c. These files seem to use clock()
> and CLOCKS_PER_SECOND only. clock() is actually also available from
> <time.h>, so you could try including time.h instead of sys/time.h.
> Also, CLOCKS_PER_SECOND should probably be replaced with
> CLOCKS_PER_SEC because time.h defines CLOCKS_PER_SEC.
>
> Let me know if this worked for you.
>

Thanks for the hints Tamás! They helped me get a working igraph finally.

Looking at those files, it turns out that I need to #define MSDOS in
order to avoid using sys/times.h. Just getting rid of sys/times.h in
these files was not sufficient, but defining MSDOS resulted in a
successful compilation.  For future reference, here's what I did:

First I installed msys2 and the mingw-w64 toolchain based on the
instructions here: https://wiki.qt.io/MSYS2

After mingw-w64 is installed, you'll find a mingw64_shell.bat file in
the msys2 installation directory. Run this to get a shell where the
compiler is already in the PATH.  I used gcc 5.2.0.

Clone the git repo, then as usual,

export CFLAGS=-DMSDOS
./bootstrap.sh
./configure --disable-gmp --prefix=...

(In place of ... write the desired installation location.  I haven't
tried using GMP yet..)

make

This will produce libigraph-0.dll as well as static libraries.

Trying make check will fail unless the above mentioned dll is in the
path.  After fixing that, the following tests still fail:

 32 33 83 84 86 159

I'm still investigating this, but some are due to segfaults, some due
to wrong results and some due to missing headers.

The produced DLL appears to be compatible with MSVC, but depends on
the following due to using this version of MinGW:

libgcc_s_seh-1.dll
libstdc++-6.dll
libwinpthread-1.dll

I do have a (sort of) working igraph for Mathematica, but as you can
see this is not yet the final solution, so still investigating.

Szabolcs



reply via email to

[Prev in Thread] Current Thread [Next in Thread]