|
1 | 1 | # Windows-specific notes
|
2 | 2 |
|
3 | 3 | 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. |
7 | 5 |
|
| 6 | +## Global configuration |
| 7 | +### Development tools |
8 | 8 | Download and install the following tools:
|
9 | 9 |
|
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 |
13 | 13 | * 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 | +* [Inno Setup](http://www.jrsoftware.org/isdl.php) (with preprocessor, required for building setup files) |
| 15 | +* 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. |
17 | 16 |
|
18 |
| -We will refer to the installation directories of MinGW, CMake and Emacs by |
19 |
| -`<mingw>`, `<cmake>` and `<emacs>`, respectively. |
| 17 | +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>`. |
| 18 | +All commands in this file are to be done in the MinGW terminal (shortcut available from the start menu). |
20 | 19 |
|
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. |
| 20 | +### Mozart requirements |
| 21 | +Download and install : |
23 | 22 |
|
24 |
| -## Global configuration |
| 23 | +* Emacs for Windows |
| 24 | +* 32-bit or 64-bit (depending on MinGW) [Active Tcl](http://www.activestate.com/activetcl/downloads) or self-compiled Tcl/Tk >= 8.5 |
| 25 | + |
| 26 | +We will refer to the installation directory of Emacs and Tcl/Tk by `<emacs>` and `<tcl>`, respectively. |
| 27 | + |
| 28 | +### Suggested directory layout |
| 29 | + |
| 30 | +We suggest that you use the following directory layout, starting from a |
| 31 | +directory `<projects>` : |
| 32 | + |
| 33 | + <projects> |
| 34 | + + mozart2 // cloned from this repo |
| 35 | + + externals |
| 36 | + + boost // source of Boost (see below) |
| 37 | + + gtest // source of GTest (see below) |
| 38 | + + llvm // source of LLVM (see below) |
| 39 | + + builds |
| 40 | + + gtest // build of GTest |
| 41 | + + llvm // build of LLVM |
| 42 | + + mozart2 // build of Mozart |
| 43 | + + redist // export dir of Mozart (see below) |
| 44 | + |
| 45 | +Throughout the following instructions, we will assume this layout. |
| 46 | + |
| 47 | +## Compilation of Boost |
| 48 | +1. Download [Boost **>= 1.53**](http://www.boost.org/users/download/) and extract the archive in `<projects>\externals\boost`. |
| 49 | +1. In your MinGW terminal, type (`<arch>` depends on building 32-bit or 64-bit target) : |
| 50 | + |
| 51 | + C:> cd <projects>\externals\boost\tools\build\src\engine |
| 52 | + C:> build.bat mingw |
| 53 | + C:> cp bin.nt<arch>\*.* ..\..\..\..\ |
| 54 | + C:> cd ..\..\..\..\ |
| 55 | + C:> bjam --toolset=gcc |
| 56 | + |
| 57 | +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. |
| 58 | + |
| 59 | +## Compilation of GTest |
| 60 | + |
| 61 | +1. Download [GTest](https://code.google.com/p/googletest/downloads/list) and extract the archive in `<projects>\externals\gtest`. |
| 62 | +1. In your MinGW terminal, type : |
| 63 | + |
| 64 | + C:> cd <projects>\builds\gtest |
| 65 | + C:> cmake -G"MinGW Makefiles" ..\..\externals\gtest |
| 66 | + C:> mingw32-make |
| 67 | + |
| 68 | +## Compilation of LLVM |
| 69 | +1. Download [LLVM and Clang **3.3**](http://llvm.org/releases/download.html#3.3) source code. |
| 70 | +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`. |
| 71 | +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 : |
| 72 | + |
| 73 | + // Determine whether we can register EH tables. |
| 74 | + #if (defined(__GNUC__) && !defined(__ARM_EABI__) && \ |
| 75 | + !defined(__USING_SJLJ_EXCEPTIONS__)) |
| 76 | + #define HAVE_EHTABLE_SUPPORT 1 |
| 77 | + #else |
| 78 | + #define HAVE_EHTABLE_SUPPORT 0 |
| 79 | + #endif |
| 80 | + |
| 81 | + by : |
25 | 82 |
|
26 |
| -Put the following directories in your PATH: |
| 83 | + // Determine whether we can register EH tables. |
| 84 | + #if (defined(__GNUC__) && !defined(__ARM_EABI__) && \ |
| 85 | + !(defined(__USING_SJLJ_EXCEPTIONS__) || defined(_WIN64))) |
| 86 | + #define HAVE_EHTABLE_SUPPORT 1 |
| 87 | + #else |
| 88 | + #define HAVE_EHTABLE_SUPPORT 0 |
| 89 | + #endif |
27 | 90 |
|
28 |
| -* `<mingw>\bin` |
29 |
| -* `<cmake>\bin` |
30 |
| -* `<emacs>\bin` |
31 |
| -* `<projects>\builds\llvm-release\bin` |
| 91 | +1. In your MinGW terminal, type : |
32 | 92 |
|
33 |
| -Patch the file `<mingw>\include\c++\4.7.2\i686-pc-mingw32\bits\c++config.h` by |
34 |
| -replacing |
| 93 | + C:> cd <projects>\builds\llvm |
| 94 | + C:> cmake -G"MinGW Makefiles" -DLLVM_TARGETS_TO_BUILD="X86" -DCMAKE_BUILD_TYPE=Release ..\..\externals\llvm |
| 95 | + C:> mingw32-make |
35 | 96 |
|
36 |
| - /* Define if __float128 is supported on this host. */ |
37 |
| - #define _GLIBCXX_USE_FLOAT128 1 |
| 97 | +## Compilation of Mozart 2 |
| 98 | +1. In your MinGW terminal, type : |
38 | 99 |
|
39 |
| -by |
| 100 | + C:> set PATH=%PATH%;<projects>\builds\llvm\bin;<emacs>\bin;<tcl>\bin |
| 101 | + C:> cd <projects> |
| 102 | + C:> git clone --recursive https://github.com/mozart/mozart2.git |
| 103 | + C:> cd <projects>\builds\mozart2 |
| 104 | + 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 |
| 105 | + C:> mingw32-make |
40 | 106 |
|
41 |
| - /* Define if __float128 is supported on this host. */ |
42 |
| - #ifndef __clang__ |
43 |
| - #define _GLIBCXX_USE_FLOAT128 1 |
44 |
| - #endif |
| 107 | + If the script does not detect correctly where MinGW is installed, you can tell |
| 108 | + it using the option `-DMINGW_ROOT=<mingw>`. Similarly, if the version of GCC in |
| 109 | + your MinGW is not 4.9.1, you can tell it with |
| 110 | + `-DMINGW_COMPILER_VERSION=4.8.2`, e.g. |
45 | 111 |
|
46 |
| -## GTest and LLVM |
| 112 | +1. To copy all the binaries in the `redist` folder, type : |
47 | 113 |
|
48 |
| -Download them as specified in the main Readme. |
| 114 | + C:> mingw32-make install |
49 | 115 |
|
50 |
| -Configure and build GTest: |
| 116 | +## Running Mozart 2 |
51 | 117 |
|
52 |
| - gtest-debug>cmake -G "MinGW Makefiles" -DCMAKE_MAKE_PROGRAM=<mingw>/bin/make.exe -DCMAKE_BUILD_TYPE=Debug ../../externals/gtest |
53 |
| - gtest-debug>make |
| 118 | +For Mozart to run properly, you need to ensure : |
54 | 119 |
|
55 |
| -Configure and build LLVM with: |
| 120 | +* Tcl/Tk is in your PATH or its `lib` and `bin` subfolders are merged with Mozart ones |
| 121 | +* An environment variable `OZEMACS` is set to `<emacs>\bin\runemacs.exe` |
56 | 122 |
|
57 |
| - llvm-release>cmake -G "MinGW Makefiles" -DCMAKE_MAKE_PROGRAM=<mingw>/bin/make.exe -DCMAKE_BUILD_TYPE=Release ../../externals/llvm |
58 |
| - llvm-release>make |
| 123 | +## Making Mozart 2 packages |
59 | 124 |
|
60 |
| -## Configuration and build of Mozart2 |
| 125 | +If you want to build setup files for Mozart, just type in your terminal : |
61 | 126 |
|
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. |
| 127 | + C:> mingw32-make installer |
66 | 128 |
|
67 |
| -Configure and build Mozart with the following incantation. It might be |
68 |
| -necessary to open your command prompt with administrator privileges. |
| 129 | +The new setup file will be located in your build directory. Two more CMake options are then available : |
69 | 130 |
|
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 |
| 131 | +* `-DISS_INCLUDE_EMACS=ON` will include your Emacs files in the package. |
| 132 | +* `-DISS_INCLUDE_TCL=ON` will include your Tcl/Tk files in the package. |
73 | 133 |
|
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. |
| 134 | +Please note that ActiveTcl is not redistributable without an OEM license. |
0 commit comments