Setting up a MinGW-w64 build environment

From ASCEND
Revision as of 04:09, 9 August 2013 by Jpye (talk | contribs)
Jump to navigation Jump to search

This page documents our recommended software build environment for Windows, tested on Windows 7 Professional 64-bit. The build environment is capable of building both 64-bit and 32-bit software, although some manual editing of configuration files is required to switch between the two. We will be evolving these recommendations over time, so check back again to see more. With some fairly obvious changes, these instructions will also work for Windows XP 32-bit, but you can't (easily) build 64-bit Python extensions on that platform.

The suggested build environment includes

  • 7-zip file archive tool
  • Python 2.7.5 scripting language
  • GCC 4.x compiler suite
  • SCons 2.3.0 software build tool
  • gedit 2.30.1 text editor
  • SWIG 2.0.10 wrapper interface generator
  • NSIS installation package builder
  • Dependency Walker 2.2 library/program file dependency checker

First steps

  • Download and install the 64-bit version of 7-zip. We used the 64-bit version, 7z920-x64.msi.
  • Download and install the latest Python 2.7 release. We used the 64-bit version if 2.7.5, python-2.7.5.amd64.msi from this page. If you want to build Python extensions, as we do with ASCEND, then you need to use the 64-bit version of Python with the 64-bit C/C++ compiler, or the 32-bit version of Python with the 32-bit C/C++ compiler. If you install the 32-bit version of Python, we suggest you select the installation directory as c:\Python27_32, whereas for the 64-bit version, use the default c:\Python27.
  • Download and install the gedit text editor for Windows. We used this package: gedit-setup-2.30.1-1.exe (32-bit)

MinGW-w64

MinGW-w64 (Minimalist GNU for Windows, 64-bit) is a version of the earlier MinGW version of GCC (GNU Compiler Collection: C, C++ and Fortran compilers and associated tools) that was carefully extended to include support for 64-bit Windows. It works with both 32-bit and 64-bit Windows, but you need to make sure you download the right package according to which platform you want to target (and which platform you are building on, too).

Create a directory c:\mingw, and then a subdirectory c:\mingw\64. We will store all our 64-bit tools and libraries under this directory. Create another directory c:\mingw\32. We will use that directory for any 32-bit tools or libraries. building Download x86_64-w64-mingw32-gcc-4.8.0-win64_rubenvb.7z, which provides you with the 64-bit MinGW-w64 GCC compiler targeting 64-bit Windows. Extract this file into c:\mingw\64, so that the top-level folders appear simply, eg c:\mingw\64\bin and c:\mingw\64\include etc.

Optional. If you also want to build 32-bit stuff, download i686-w64-mingw32-gcc-4.8.0-win32_rubenvb.7z and extract the contents into c:\mingw\32. This is the compiler for making 32-bit packages, and it only requires 32-bit Windows to run, so all of the above should work fine even on native 32-bit Windows XP, for example, if you selected 32-bit Python and 7-zip above.

MSYS

MSYS provides a command-line interface to MinGW that looks and feels like Linux/Unix terminal and the Mac OSX terminal. It includes a large number of very useful utilities like 'wget', 'grep', and many others which will be useful when building software with GCC.

  • Open gedit and

Dependency Walker


--- ongoing ---