How do I use CMake to build a package using MinGW?

gknauth picture gknauth · Apr 21, 2016 · Viewed 8.9k times · Source

I'm trying to build some software from ECMWF called ECCODES.

  • It builds fine on GNU/Linux.
  • It builds fine on Mac OS X.
  • It builds fine on Windows/Cygwin.
  • Unfortunately (Ugh!!), I must use Windows and I can't use Cygwin.
  • I have to use something like MinGW.

The build instructions use CMake. I am no expert at CMake. The Windows system I am on has:

  • cygwin64
  • mingw64
  • a bare-bones Visual Studio 14

I've tried every incantation and override of the CMake variables/options:

-DCMAKE_C_COMPILER=... \
-DCMAKE_CXX_COMPILER=... \
-DCMAKE_Fortran_COMPILER=... \
-DCMAKE_MAKE_PROGRAM=... \
-G ...

to get ECCODES to build using MinGW, with no luck. I know some will ask, "Why not contact ECMWF?" The short answer is, the response time is very long (months/years). The FAQ page is empty, and you can't post questions on their Jira site (it's locked).

Would it be possible for someone who knows CMake and MinGW well to download the .tar.gz, build ECCODES using MinGW, and tell us how you did it?

http://www.ecmwf.int/

https://software.ecmwf.int/wiki/display/ECC/ecCodes+Home

https://software.ecmwf.int/wiki/download/attachments/45757960/eccodes-0.13.0-Source.tar.gz?api=v2

Answer