Compile Metis 5 with MinGW

I tried to compile files manually and found only two points are needed.

  • Comment out or delete the line #include <sys/resource.h> in gk_arch.h.
  • Add 2 command options for GCC: -std=c99 and -DUSE_GKREGEX.

If CMake is used, only the first is necessary.

Advertisements
This entry was posted in Sparse matrix and tagged , . Bookmark the permalink.

8 Responses to Compile Metis 5 with MinGW

  1. john says:

    I’m tring to compile 5.1.0 now with MinGW. Not sure how to set -DUSE_GKREGEX..

  2. Oliver says:

    I’m having the same problem as John(?); I call:

    gcc -std=c99 -DUSE_GKREGEX -IGKlib -Iinclude -Ilibmetis libmetis/*.c programs/cmdline_gpmetis.c GKlib/*.c GKlib/test/*.c GKlib/conf/*.c -o gpmetis -w

    and get:

    GKlib/getopt.c:769:5: error: conflicting types for ‘gk_getopt’
    int gk_getopt(int argc, char **argv, char *options)
    ^
    In file included from GKlib/GKlib.h:69:0,
    from GKlib/getopt.c:37:
    GKlib/gk_getopt.h:55:12: note: previous declaration of ‘gk_getopt’ was here
    extern int gk_getopt(int __argc, char **__argv, char *__shortopts);
    ^
    GKlib/getopt.c:833:5: error: conflicting types for ‘gk_getopt_long’
    int gk_getopt_long( int argc, char **argv, char *options,
    ^
    In file included from GKlib/GKlib.h:69:0,
    from GKlib/getopt.c:37:
    GKlib/gk_getopt.h:56:12: note: previous declaration of ‘gk_getopt_long’ was here

    extern int gk_getopt_long(int __argc, char **__argv, char *__shortopts,
    ^
    GKlib/getopt.c:849:5: error: conflicting types for ‘gk_getopt_long_only’
    int gk_getopt_long_only(int argc, char **argv, char *options,
    ^
    In file included from GKlib/GKlib.h:69:0,
    from GKlib/getopt.c:37:
    GKlib/gk_getopt.h:58:12: note: previous declaration of ‘gk_getopt_long_only’ was
    here
    extern int gk_getopt_long_only (int __argc, char **__argv,

    • wildabc says:

      John tried TDM-MinGW, then there was no more problem, though I do not know why.

    • ceanwang says:

      Equation-GCC has this error output. I comments out all the extern lines in GKlib/gk_getopy.h and it can compile now. Using the CMakelists.txt provided by metis5.1.0, I also got the demos in Programs folder compiled. I tried the mpmetis.exe and it works.
      But I still have problem to use it with SU2.

  3. Thomas Sharpless says:

    I got the same weird error about gk_getopt as Oliver, with gcc 4.8.0, MinGW-builds. And used the same ugly fix.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s