Compile METIS-5.1.0/ParMETIS-4.0.3 in mingw64 gcc 5.2.0

Following three modifications are needed to compile METIS-5.1.0:

1.  Modify line 4 of CMakelists.txt from
set(GKLIB_PATH "GKlib" CACHE PATH "path to GKlib")
    to
set(GKLIB_PATH "${CMAKE_SOURCE_DIR}/GKlib" CACHE PATH "path to GKlib")

2. Delete POSIX include file #include <sys/resource.h> in gk_arch.h. Seems allright.

3.  Exclude
--------------
extern int gk_getopt(int __argc, char **__argv, char *__shortopts);
extern int gk_getopt_long(int __argc, char **__argv, char *__shortopts,
              struct gk_option *__longopts, int *__longind);
extern int gk_getopt_long_only (int __argc, char **__argv,
              char *__shortopts, struct gk_option *__longopts, int *__longind);
--------------
in file gk_getopt.h by, e.g.

#if !defined _MINGW64
extern int gk_getopt(int __argc, char **__argv, char *__shortopts);
extern int gk_getopt_long(int __argc, char **__argv, char *__shortopts,
              struct gk_option *__longopts, int *__longind);
extern int gk_getopt_long_only (int __argc, char **__argv,
              char *__shortopts, struct gk_option *__longopts, int *__longind);
#endif


To compile ParMETIS-4.0.3
1. Set GKLIB_PATH like
set(GKLIB_PATH "${CMAKE_SOURCE_DIR}/metis/GKlib" CACHE PATH "path to GKlib")

2.  Add a line "include( findMPI )" in front of  "include_directories(${MPI_INCLUDE_PATH})" inside CMAKElistx.txt
     For those who use MSMPI, you should be include <_mingw.h> in mpi.h of MSMPI. Otherwise there should be undefined data type errors.

3. Do above modification 2,3 for metis compile.

VS Code下cmake, c++编译,调试环境的构成步骤

1   下载必须extension      按[Ctrl+Shift+X]打开extension窗口,选择安装"C/C++", "CMake", "CMake Tools" 2   在VSCode下打开作业目录 ...