Skip to content

Commit cfaeab5

Browse files
authored
Merge pull request #311 from azarzadavila/docs
Update READMES
2 parents 0a91307 + d08392c commit cfaeab5

File tree

3 files changed

+202
-131
lines changed

3 files changed

+202
-131
lines changed

README.CI.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Mozart2 Continuous Integration
2+
3+
We use a continuous integration system for Mozart2. This means that at every
4+
change made in source code, we check if it did not break the build.
5+
More specifically, every commit sent to this repository triggers two builds. We
6+
use [Travis CI](https://travis-ci.org/) to build the pre-generated sources and Mozart2 on Linux. We also use
7+
[Appveyor](https://www.appveyor.com/) to build on Windows. If you wish to use those tools, you can fork this
8+
repository and active both Appveyor and Travis to your fork. The Travis CI job is probably
9+
the easiest way to rebuild the pre-generated sources.
10+
11+
## Travis CI
12+
13+
The build process is written in [.travis.yml](.travis.yml). Specifically, we use the
14+
[trusty](https://docs.travis-ci.com/user/reference/overview/#virtualisation-environment-vs-operating-system) environnement. Currently, we implement a build on
15+
Linux. We create two jobs. The first one, builds the pre-generated sources
16+
with LLVM and CLANG. It then compares the generated sources with those already
17+
in the repository. If this job succeed, a second one is started to build
18+
Mozart2.
19+
20+
## Appveyor
21+
22+
The build process is written in [appveyor.yml](appveyor.yml). It uses mainly MingW to build.
23+
The build uploads a Windows installer as an artifact.

README.Windows.md

Lines changed: 104 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -3,72 +3,116 @@
33
General information can be found in the [main Readme](README.md). Unless
44
otherwise specified here, instructions found in the main Readme apply.
55

6-
## Global configuration
7-
### Development tools
8-
Download and install the following tools:
9-
10-
* Java (required for building the boot compiler)
11-
* Python (required for building LLVM)
12-
* Git for Windows
13-
* CMake >= 2.8.6
6+
## Prerequisites
7+
In addition to what is specified in the main README download and install the following tools:
8+
149
* [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.
10+
* 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.
1611

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).
12+
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>`.
13+
Unless specified, all commands in this file are to be done in the MinGW terminal (shortcut available from the start menu).
1914

20-
### Mozart requirements
21-
Download and install :
15+
## Specific tools
2216

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
17+
We will assume for that you use the following directory layout, starting from
18+
the root :
2519

26-
We will refer to the installation directory of Emacs and Tcl/Tk by `<emacs>` and `<tcl>`, respectively.
20+
<projects>
21+
+ mozart2 // cloned from this repo
22+
+ build // build of Mozart
23+
+ tcl-release // source of tcl (see below)
24+
+ tk-release // source of tk (see below)
25+
+ boost // boost downloaded
26+
<tcltk> // directory in which we install tcl and tk
2727

28-
### Suggested directory layout
28+
We recommend to use a self-compiled Tcl/Tk. You can however use [Active Tcl](http://www.activestate.com/activetcl/downloads)
2929

30-
We suggest that you use the following directory layout, starting from a
31-
directory `<projects>` :
30+
### Tcl
3231

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.
32+
C:> cd C:\projects
33+
C:> wget -O tcl-release.tar.gz https://github.com/tcltk/tcl/archive/release.tar.gz
34+
C:> tar xf tcl-release.tar.gz
35+
C:> cd tcl-release/win/
36+
C:> bash configure --enable-threads --enable-64bit --prefix=C:/tcltk/
37+
C:> make
38+
C:> make install
5839

59-
## Compilation of GTest
40+
### Tk
6041

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 :
42+
C:> cd C:\projects
43+
C:> wget -O tk-release.tar.gz https://github.com/tcltk/tk/archive/release.tar.gz
44+
C:> tar xf tk-release.tar.gz
45+
C:> cd tk-release/win/
46+
C:> bash configure --enable-64bit --prefix=C:/tcltk/ --with-tcl=../../tcl-release/win/
47+
C:> make
48+
C:> make install
6349

64-
C:> cd <projects>\builds\gtest
65-
C:> cmake -G"MinGW Makefiles" ..\..\externals\gtest
66-
C:> mingw32-make
50+
### Boost
51+
52+
Once you downloaded boost, you need to install different modules.
53+
54+
C:> cd C:\projects\boost
55+
C:> call bootstrap.bat gcc
56+
C:> .\b2 toolset=gcc variant=release --with-thread --with-system --with-random --with-filesystem --with-program_options
57+
58+
### Emacs
59+
60+
The packaging manager we use, installs all the program used to install Emacs in
61+
its package. Which means, if you use MingW to install Emacs directly with
62+
pacman, you will include all MingW in your package. As a consequence, we
63+
decided to install Emacs with a lighter package manager :
64+
[chocolatey](https://chocolatey.org/). You can
65+
just run the following in a classic Windows prompt, in PowerShell :
66+
67+
C:> choco install emacs64
68+
69+
You can install emacs with MingW, it will just make your package heavy.
70+
71+
## Build
72+
73+
Mozart 2 is built with cmake. We add two CMake options to prepare the package :
74+
75+
* `-DISS_INCLUDE_EMACS=ON` will include your Emacs files in the package.
76+
* `-DISS_INCLUDE_TCL=ON` will include your Tcl/Tk files in the package.
77+
78+
The following steps will perform the build :
79+
80+
C:> mkdir C:\projects\mozart2\build
81+
C:> cd C:\projects\mozart2\build
82+
C:> cmake -DCMAKE_BUILD_TYPE=Release -G"MSYS Makefiles" -DCMAKE_PREFIX_PATH=C:\tcltk -DBOOST_ROOT=C:\projects\boost -DISS_INCLUDE_TCL=ON -DISS_INCLUDE_EMACS=ON C:\projects\mozart2
83+
C:> make install
84+
85+
### Installer
86+
87+
You can create an installer with the following command :
88+
89+
C:> cmake --build . --target installer -- VERBOSE=1
90+
91+
The installer can be found in C:\projects\mozart2\build.
92+
93+
## Running Mozart 2
94+
95+
For Mozart to run properly, you need to ensure :
96+
97+
* Tcl/Tk is in your PATH or its `lib` and `bin` subfolders are merged with
98+
Mozart ones
99+
* An environment variable `OZEMACS` is set to `<emacs>\bin\runemacs.exe`
100+
101+
Both should be set automatically with the created installer.
67102

68103
## 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 :
104+
If you want to build the pre-generated sources, you will need to install LLVM.
105+
To do so, you can follow the instructions below and then check the main README
106+
for information on how to build the pre-generated sources.
107+
1. Download [LLVM and Clang
108+
**3.3**](http://llvm.org/releases/download.html#3.3) source code.
109+
1. Extract the content of LLVM source archive in `C:\projects\externals\llvm`
110+
and the content of Clang source archive in
111+
`C:\projects\externals\llvm\tools\clang`.
112+
1. If you are targeting 64-bit builds, patch the files
113+
`C:\projects\externals\llvm\lib\ExecutionEngine\JIT\JIT.cpp` and
114+
`C:\projects\externals\llvm\lib\ExecutionEngine\MCJIT\SectionMemoryManager.cpp`
115+
by replacing :
72116

73117
// Determine whether we can register EH tables.
74118
#if (defined(__GNUC__) && !defined(__ARM_EABI__) && \
@@ -90,45 +134,16 @@ Throughout the following instructions, we will assume this layout.
90134

91135
1. In your MinGW terminal, type :
92136

93-
C:> cd <projects>\builds\llvm
137+
C:> cd C:\projects\builds\llvm
94138
C:> cmake -G"MinGW Makefiles" -DLLVM_TARGETS_TO_BUILD="X86" -DCMAKE_BUILD_TYPE=Release ..\..\externals\llvm
95139
C:> mingw32-make
96140

97-
## Compilation of Mozart 2
141+
## Compilation of GTest
142+
143+
1. Download [GTest](https://code.google.com/p/googletest/downloads/list) and
144+
extract the archive in `C:\projects\externals\gtest`.
98145
1. In your MinGW terminal, type :
99146

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
147+
C:> cd C:\projects\builds\gtest
148+
C:> cmake -G"MinGW Makefiles" ..\..\externals\gtest
105149
C:> mingw32-make
106-
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.
111-
112-
1. To copy all the binaries in the `redist` folder, type :
113-
114-
C:> mingw32-make install
115-
116-
## Running Mozart 2
117-
118-
For Mozart to run properly, you need to ensure :
119-
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`
122-
123-
## Making Mozart 2 packages
124-
125-
If you want to build setup files for Mozart, just type in your terminal :
126-
127-
C:> mingw32-make installer
128-
129-
The new setup file will be located in your build directory. Two more CMake options are then available :
130-
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.
133-
134-
Please note that ActiveTcl is not redistributable without an OEM license.

0 commit comments

Comments
 (0)