Skip to content

Commit e2df241

Browse files
committed
Updated Windows README
Nuwen's MinGW does not support 32-bit anymore, clang 3.4 does not seem to work with MinGW and Boost...
1 parent ab86882 commit e2df241

File tree

1 file changed

+93
-50
lines changed

1 file changed

+93
-50
lines changed

README.Windows.md

Lines changed: 93 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,120 @@
11
# Windows-specific notes
22

33
General information can be found in the [main Readme](README.md). Unless
4-
othewise specified here, instructions found in the main Readme apply.
5-
6-
## Required software
4+
otherwise specified here, instructions found in the main Readme apply.
75

6+
## Global configuration
7+
### Development tools
88
Download and install the following tools:
99

10-
* TortoiseSVN and TortoiseGit
11-
* The [MinGW distro](http://nuwen.net/mingw.html) of nuwen.net,
12-
which includes a C++11 enabled GCC and Boost
10+
* Java (required for building the boot compiler)
11+
* Python (required for building LLVM)
12+
* Git for Windows
1313
* CMake >= 2.8.6
14-
* Emacs
15-
* [Active TCL](http://www.activestate.com/activetcl/downloads)
16-
_32 bits_ (even if you are running a 64-bit Windows), preferably v8.5
14+
* A recent 32-bit (i686) or 64-bit (x86_64) targeting [MinGW-64 distro](http://mingw-w64.sourceforge.net/download.php#mingw-builds) with gcc >= 4.7.1.
1715

18-
We will refer to the installation directories of MinGW, CMake and Emacs by
19-
`<mingw>`, `<cmake>` and `<emacs>`, respectively.
16+
These tools won't be needed at run time. We will refer to the installation directory of MinGW (in which the first `bin` subdirectory is found) by `<mingw>`.
17+
All commands in this file are to be done in the MinGW terminal (shortcut available from the start menu).
2018

21-
Also, each time we mention "4.7.2", we are referring to the version of GCC
22-
that accompanies MinGW. Make sure to adapt this to your version.
19+
### Mozart requirements
20+
Download and install :
2321

24-
## Global configuration
22+
* Emacs for Windows
23+
* 32-bit or 64-bit (depending on MinGW) [Active Tcl](http://www.activestate.com/activetcl/downloads) or self-compiled Tcl/Tk >= 8.5
24+
25+
We will refer to the installation directory of Emacs and Tcl/Tk by `<emacs>` and `<tcl>`, respectively.
26+
27+
### Suggested directory layout
28+
29+
We suggest that you use the following directory layout, starting from a
30+
directory `<projects>` :
31+
32+
<projects>
33+
+ mozart2 // cloned from this repo
34+
+ externals
35+
+ boost // source of Boost (see below)
36+
+ gtest // source of GTest (see below)
37+
+ llvm // source of LLVM (see below)
38+
+ builds
39+
+ gtest // build of GTest
40+
+ llvm // build of LLVM
41+
+ mozart2 // build of Mozart
42+
+ redist // export dir of Mozart (see below)
43+
44+
Throughout the following instructions, we will assume this layout.
45+
46+
## Compilation of Boost
47+
1. Download [Boost **>= 1.53**](http://www.boost.org/users/download/) and extract the archive in `<projects>\externals\boost`.
48+
1. In your MinGW terminal, type (`<arch>` depends on building 32-bit or 64-bit target) :
49+
50+
C:> cd <projects>\externals\boost\tools\build\src\engine
51+
C:> build.bat mingw
52+
C:> cp bin.nt<arch>\*.* ..\..\..\..\
53+
C:> cd ..\..\..\..\
54+
C:> bjam --toolset=gcc
55+
56+
1. From `<projects>\externals\boost`, copy `boost` subdirectory in your `<mingw>\<arch>-w64-mingw32\include` directory and merge `stage\lib` subdirectory with your `<mingw>\<arch>-w64-mingw32\lib` directory.
2557

26-
Put the following directories in your PATH:
58+
## Compilation of GTest
2759

28-
* `<mingw>\bin`
29-
* `<cmake>\bin`
30-
* `<emacs>\bin`
31-
* `<projects>\builds\llvm-release\bin`
60+
1. Download [GTest](https://code.google.com/p/googletest/downloads/list) and extract the archive in `<projects>\externals\gtest`.
61+
1. In your MinGW terminal, type :
3262

33-
Patch the file `<mingw>\include\c++\4.7.2\i686-pc-mingw32\bits\c++config.h` by
34-
replacing
63+
C:> cd <projects>\builds\gtest
64+
C:> cmake -G"MinGW Makefiles" ..\..\externals\gtest
65+
C:> mingw32-make
3566

36-
/* Define if __float128 is supported on this host. */
37-
#define _GLIBCXX_USE_FLOAT128 1
67+
## Compilation of LLVM
68+
1. Download [LLVM and Clang **3.3**](http://llvm.org/releases/download.html#3.3) source code.
69+
1. Extract the content of LLVM source archive in `<projects>\externals\llvm` and the content of Clang source archive in `<projects>\externals\llvm\tools\clang`.
70+
1. If you are targeting 64-bit builds, patch the files `<projects>\externals\llvm\lib\ExecutionEngine\JIT\JIT.cpp` and `<projects>\externals\llvm\lib\ExecutionEngine\MCJIT\SectionMemoryManager.cpp` by replacing :
3871

39-
by
72+
// Determine whether we can register EH tables.
73+
#if (defined(__GNUC__) && !defined(__ARM_EABI__) && \
74+
!defined(__USING_SJLJ_EXCEPTIONS__))
75+
#define HAVE_EHTABLE_SUPPORT 1
76+
#else
77+
#define HAVE_EHTABLE_SUPPORT 0
78+
#endif
4079

41-
/* Define if __float128 is supported on this host. */
42-
#ifndef __clang__
43-
#define _GLIBCXX_USE_FLOAT128 1
44-
#endif
80+
by :
4581

46-
## GTest and LLVM
82+
// Determine whether we can register EH tables.
83+
#if (defined(__GNUC__) && !defined(__ARM_EABI__) && \
84+
!(defined(__USING_SJLJ_EXCEPTIONS__) || defined(_WIN64)))
85+
#define HAVE_EHTABLE_SUPPORT 1
86+
#else
87+
#define HAVE_EHTABLE_SUPPORT 0
88+
#endif
4789

48-
Download them as specified in the main Readme.
90+
1. In your MinGW terminal, type :
4991

50-
Configure and build GTest:
92+
C:> cd <projects>\builds\llvm
93+
C:> cmake -G"MinGW Makefiles" -DLLVM_TARGETS_TO_BUILD="X86" -DCMAKE_BUILD_TYPE=Release ..\..\externals\llvm
94+
C:> mingw32-make
5195

52-
gtest-debug>cmake -G "MinGW Makefiles" -DCMAKE_MAKE_PROGRAM=<mingw>/bin/make.exe -DCMAKE_BUILD_TYPE=Debug ../../externals/gtest
53-
gtest-debug>make
96+
## Compilation of Mozart 2
97+
1. In your MinGW terminal, type :
5498

55-
Configure and build LLVM with:
99+
C:> set PATH=%PATH%;<projects>\builds\llvm\bin;<emacs>\bin;<tcl>\bin
100+
C:> cd <projects>
101+
C:> git clone --recursive https://github.com/mozart/mozart2.git
102+
C:> cd <projects>\builds\mozart2
103+
C:> cmake -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DLLVM_BUILD_DIR=..\llvm -DGTEST_BUILD_DIR=..\gtest -DGTEST_SRC_DIR=..\..\externals\gtest -DLLVM_SRC_DIR=..\..\externals\llvm -DBOOST_ROOT=..\..\externals\boost\ -DCMAKE_INSTALL_PREFIX=..\..\redist\ ..\..\mozart2
104+
C:> mingw32-make
56105

57-
llvm-release>cmake -G "MinGW Makefiles" -DCMAKE_MAKE_PROGRAM=<mingw>/bin/make.exe -DCMAKE_BUILD_TYPE=Release ../../externals/llvm
58-
llvm-release>make
106+
If the script does not detect correctly where MinGW is installed, you can tell
107+
it using the option `-DMINGW_ROOT=<mingw>`. Similarly, if the version of GCC in
108+
your MinGW is not 4.9.1, you can tell it with
109+
`-DMINGW_COMPILER_VERSION=4.8.2`, e.g.
59110

60-
## Configuration and build of Mozart2
111+
1. To copy all the binaries in the `redist` folder, type :
61112

62-
The "build" version (not "installed") of Mozart2 is very tedious to run on
63-
Windows. We suggest that you always `make install` (we do that ourselves).
64-
You can use the configuration option `-DCMAKE_INSTALL_PREFIX=C:/Where/You/Want`
65-
of CMake to specify in which directory you want it to be installed.
113+
C:> mingw32-make install
66114

67-
Configure and build Mozart with the following incantation. It might be
68-
necessary to open your command prompt with administrator privileges.
115+
## Running Mozart 2
69116

70-
mozart2-release>cmake -G "MinGW Makefiles" -DCMAKE_MAKE_PROGRAM=<mingw>/bin/make.exe -DCMAKE_BUILD_TYPE=Release -DGTEST_SRC_DIR=../../externals/gtest -DGTEST_BUILD_DIR=../gtest-debug -DLLVM_SRC_DIR=../../externals/llvm -DLLVM_BUILD_DIR=../llvm-release ../../mozart2
71-
mozart2-release>make
72-
mozart2-release>make install
117+
For Mozart to run properly, you need to ensure :
73118

74-
If the script does not detect correctly where MinGW is installed, you can tell
75-
it using the option `-DMINGW_ROOT=<mingw>`. Similarly, if the version of GCC in
76-
your MinGW is not 4.7.2, you can tell it with
77-
`-DMINGW_COMPILER_VERSION=4.7.1`, e.g.
119+
* Tcl/Tk is in your PATH or its `lib` and `bin` subfolders are merged with Mozart ones
120+
* An environment variable `OZEMACS` is set to `<emacs>\bin\runemacs.exe`

0 commit comments

Comments
 (0)