[CMake] how to build cmake with mingw and msys?

Alan W. Irwin irwin at beluga.phys.uvic.ca
Tue Oct 16 20:19:52 EDT 2012


On 2012-08-16 08:42-0700 Alan W. Irwin wrote:

> I am not in a position to do MinGW/MSYS experiments on the Wine
> platform at the moment, but once that is possible (should be a couple
> of weeks from now) I will attempt to confirm on that platform that the
> bootstrap method of building CMake works for MinGW/MSYS provided that
> the correct PATH to the MSYS version of make.exe is set.

I finally got a chance to work on this so to take up this thread where
it left off two months ago I just now tried that experiment with
wine-1.3.15 which I recently built and installed under Linux (Debian
wheezy).  After some default configuration of Wine with winecfg, I
continued with the following steps:

* Used the latest version of the MinGW/MSYS installer obtained
with

wget \
http://prdownloads.sourceforge.net/mingw/Installer/mingw-get-inst/mingw-get-inst-20120426/mingw-get-inst-20120426.exe

N.B. This installer appears to give reliable downloads and installs of
MinGW/MSYS from scratch, but it is alpha software so some of its
updating functionality does not appear to work correctly.  For
example, others here have used the update function with no obvious
issues, but it turned out the installer silently did not update to the
latest MinGW/MSYS.  Thus, to get MinGW/MSYS results comparable to
mine, they had to use the "from scratch" method.

* Ran that Windows installer under wine to download and install
essentially all of the latest MinGW/MSYS versions on the Wine
platform. That only took a few minutes!  I then confirmed
bash.exe worked under wine, and then I put the MinGW binary directory
above the MSYS binary directory on the PATH, e.g.,

bash.exe-3.1$ echo $PATH
/z/home/wine/newstart/MinGW/bin/:/z/home/wine/newstart/MinGW/msys/1.0/bin/:/c/windows/system32:/c/windows:/c/windows/system32/wbem

* I unpacked a Unix version (the Unix line endings make no difference
for MinGW/MSYS, and I had this tarball downloaded already) of the
CMake-2.8.9 tarball under Linux.  Then I switched to the Wine
platform, changed to the unpacked CMake-2.8.9 directory, and ran
(--no-qt-gui for simplicity)

./bootstrap --no-qt-gui \
--prefix=/z/home/wine/newstart/bootstrap_cmake/install \
--parallel=8 >& bootstrap.out

make -j8 >& make.out
make -j8 install >& make_install.out

No errors or warnings showed up in those *.out files.
Also, the Windows file command (available from MSYS) gives the following
information about that CMake executable that was built on
MinGW/MSYS/wine:

bash.exe-3.1$ file install/bin/cmake
install/bin/cmake: PE32 executable for MS Windows (console) Intel
80386 32-bit

Note this is a 32-bit executable on my 64-bit hardware because I built
and installed the 32-bit version of wine which corresponds to a 32-bit
version of Windows.  I could have built a 64-bit version of wine, but
the 32-bit version is more heavily tested by wine users, that's the version that
has been a success for me in the past, and therefore I stuck with it
this time as well.

I then tested that Windows version of cmake that I had built with the
bootstrap method by using it to build and test one of my projects
(ephcom2, part of the Time Ephemerides project) on Wine.  That test
went well and produced results equivalent to the corresponding test
results for ephcom on Linux. So it appears the bootstrap build of
CMake works fine for MinGW/MSYS on the Wine version of Windows.
Therefore I expect it will also work fine for MinGW/MSYS on the
Microsoft version of Windows even though for now
http://www.cmake.org/cmake/help/install.html ignores this bootstrap
build possibility for Windows.

Note, this was all in the spirit of an experiment to see whether cmake
bootstrap builds actually work for MinGW/MSYS on a Windows platform.
An obvious alternative is just to download the binary CMake version
for Windows and use that instead.  But the experiment is also a good
test of the Windows build tools I installed with the latest MinGW/MSYS
installer on my Wine platform so I am glad I tried the experiment, and
I plan to use the resulting CMake executable for a number of software
builds on the Wine platform beyond the current ephcom one.

Alan
_________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list