Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Annotation of /branches/vis15/INSTALL.md
ViewVC logotype

Annotation of /branches/vis15/INSTALL.md

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5589 - (view) (download)

1 : jhr 5589 # Build instructions for the Diderot compiler
2 : jhr 123
3 : jhr 5589 These instructions are organized into two parts. First is a quick
4 :     guide to installing the Diderot system (including the prerequisite
5 :     software). Following the quick overview are detailed instructions
6 :     for acquiring and installing the prerequisite software.
7 : jhr 2456
8 : jhr 5589 ## QUICK GUIDE
9 : jhr 123
10 : jhr 5589 ### Prerequisite software
11 : jhr 1113
12 : jhr 5589 #### Software tools
13 : jhr 1113
14 : jhr 5589 To build *Teem*, you will need to have *cmake* installed. Instructions
15 :     for getting *cmake* are [below](#cmake-details).
16 : jhr 1113
17 : jhr 5589 The Diderot runtime system is written in **C++11** and the code generator
18 :     also produces **C++** code, so you will need to have a modern **C++** compiler
19 :     installed (*e.g.*, either version 4.8.1 or later of **g++**, or
20 :     version 3.3 or later of **clang++**).
21 : jhr 1113
22 : jhr 5589 #### Teem
23 : jhr 2456
24 : jhr 5589 You must have **Teem** installed, which you can get from
25 : glk 1266
26 : jhr 5589 >
27 :     > <http://teem.sourceforge.net/download/index.html>
28 :     >
29 : glk 1266
30 : jhr 5589 Make sure that your **Teem** installation is revision **r6294** or later.
31 :     More details about installing **Teem** can be found [below](#teem-details).
32 : jhr 1270
33 : jhr 5589 #### Standard ML of New Jersey
34 : jhr 1270
35 : jhr 5589 You also must have **Standard ML of New Jersey** (SML/NJ) installed,
36 :     which you can get from
37 : jhr 1113
38 : jhr 5589 >
39 :     > <http://smlnj.org/dist/working/index.html>
40 :     >
41 : jhr 1232
42 : jhr 5589 Make sure that you get version 110.98 or later. More details about
43 :     installing **SML/NJ** can be found [below](#smlnj-details).
44 : jhr 1232
45 : jhr 5589 #### MLton
46 : jhr 123
47 : jhr 5589 It is also possible to build **Diderot** using the **MLton**
48 :     Standard ML compiler, which you can get from
49 : jhr 123
50 : jhr 5589 >
51 :     > <http:/mlton.org>
52 :     >
53 : jhr 123
54 : jhr 5589 ### Getting the Diderot source
55 : jhr 123
56 : jhr 5589 You can checkout the stable version of the Diderot source tree from
57 :     <github.com> with the command:
58 : jhr 1113
59 : jhr 5589 ````bash
60 :     % git clone https://github.com/Diderot-Language/diderot.git
61 :     ````
62 : jhr 1640
63 : jhr 5589 or you can browse the source code
64 : jhr 1640
65 : jhr 5589 >
66 :     > <https://github.com/Diderot-Language/diderot>
67 :     >
68 : jhr 1640
69 : jhr 5589 ### Configuration
70 : jhr 1640
71 : jhr 5589 Once you have downloaded the **Diderot** source code, go to the root of
72 :     the source tree and configure the build for your machine.
73 : jhr 1640
74 : jhr 5589 ````bash
75 :     ./configure
76 :     ````
77 : jhr 1113
78 : jhr 5589 The `configure` script will try to find your **Teem** installation and
79 :     the **sml** command. You may need to specify these locations as follows.
80 : jhr 1113
81 : jhr 5589 The `configuration` script looks for **Teem** in either `/usr/local` or
82 :     `/usr/local/teem`. If **Teem** is installed elsewhere, use the command
83 : jhr 1113
84 : jhr 5589 ````bash
85 :     ./configure --with-teem=/path/to/teem
86 :     ````
87 : jhr 2456
88 : jhr 5589 where `/path/to/teem` is the full path of the directory containing the
89 :     **Teem** `lib` and `include` directories.
90 : jhr 2456
91 : jhr 5589 If the **sml** command is in your `PATH`, then you are set. Otherwise,
92 :     you can specify its location to `configure` using the command
93 : jhr 2456
94 : jhr 5589 ````bash
95 :     SMLNJ_CMD=/usr/local/smlnj/bin/sml ./configure
96 :     ````
97 : jhr 2456
98 : jhr 5589 assuming that `/usr/local/smlnj` is the installation directory for
99 :     **SML/NJ**.
100 :    
101 :     ### Building and installing the Diderot system
102 :    
103 :     From the root of the Diderot source tree, run the command
104 :    
105 :     ````bash
106 :     make local-install
107 :     ````
108 :    
109 :     This command will build the Diderot compiler (`diderotc`) and runtime
110 :     support. Assuming that `$ROOT` is the root of the Diderot tree, the
111 :     compiler will be located at `$ROOT/bin/diderotc`.
112 :    
113 :     ## DETAILS
114 :    
115 :     ### CMake <a name="cmake-details"></a>
116 :    
117 :     [CMake](https://cmake.org) is required to build **Teem**.
118 :     These utilities can be obtained via `apt-get` on Ubuntu/Debian
119 :     Linux, or via [Homebrew `brew`](http://brew.sh) or
120 :     [Mac Ports `port`](https://www.macports.org) on **macOS**.
121 :    
122 :     To get CMake:
123 :     * **Linux**: CMake can be installed for Ubuntu/Debian using
124 :     the command `sudo apt-get install cmake`.
125 :     * **macOS**: CMake can be installed from [Homebrew](http://brew.sh)
126 :     using the command `brew install cmake` or from
127 :     [Mac Ports](https://www.macports.org) using the command
128 :     `sudo port install cmake`.
129 :     * Alternatively, the [CMake download](https://cmake.org/download/)
130 :     page includes "Binary distributions" that have the executable
131 :     `cmake` you will need, as well as source-code distributions.
132 :    
133 :     ### Teem <a name="teem-details"></a>
134 :    
135 :     The Diderot run-time depends on [**Teem**](http://teem.sourceforge.net).
136 :     **Teem** is overdue for a release, but in the mean time you should
137 :     build it from source with **CMake**, because **Diderot** requires
138 :     the current source (revision **r6294** or later).
139 :    
140 :     It is best to build a **Teem** for Diderot that has *none* of the
141 :     optional libraries (PNG, zlib, etc) enabled. Experience has shown
142 :     that additional library dependencies from **Teem** will complicate
143 :     the linking that the Diderot compiler must do to create executables.
144 :    
145 :     Create a directory for **Teem**; assume that `$TEEMDIR` specifies the path to
146 :     that directory. Then run the following shell commands:
147 :    
148 :     ````bash
149 :     cd $TEEMDIR
150 :     svn co https://svn.code.sf.net/p/teem/code/teem/trunk teem-src
151 :     ````
152 :    
153 :     The next step is to create a build directory and to configure the build
154 :     using **CMake**. This step requires specifying a bunch of flags to
155 :     disable dependency on various libraries.
156 :    
157 :     **COMMENT: for macOS, I do not think that turing off shared libraries
158 :     is required. Also, it is not clear that one need to disable PNG, etc.
159 :     on macOS (at least when using shared libraries). -- JHR**
160 :    
161 :     ````bash
162 :     mkdir teem-build
163 :     cd teem-build
164 :     TEEMBUILD=`pwd`
165 :     cmake -Wno-dev \
166 :     -D BUILD_EXPERIMENTAL_APPS=OFF -D BUILD_EXPERIMENTAL_LIBS=OFF \
167 :     -D BUILD_SHARED_LIBS=OFF -D BUILD_TESTING=OFF \
168 :     -D CMAKE_BUILD_TYPE=Release \
169 :     -D Teem_BZIP2=OFF -D Teem_FFTW3=OFF -D Teem_LEVMAR=OFF -D Teem_PTHREAD=OFF \
170 :     -D Teem_PNG=OFF -D Teem_ZLIB=OFF \
171 :     -D CMAKE_INSTALL_PREFIX:PATH=$TEEMDIR \
172 :     ../teem-src
173 :     ````
174 :    
175 :     Lastly, you can build and install **Teem**.
176 :    
177 :     ````bash
178 :     make
179 :     make install
180 :     ````
181 :    
182 :     At this point you will have a `$TEEMDIR/bin`, `$TEEMDIR/lib`, and
183 :     `$TEEMDIR/include` directories that contain the various parts of
184 :     **Teem**.
185 :    
186 :     To make sure your build works, try:
187 :    
188 :     ````bash
189 :     $TEEMDIR/bin/unu --version
190 :     ````
191 :    
192 :     Note that we do **not** recommend adding this `teem-ddro/bin` to your path;
193 :     it's not very useful.
194 :    
195 :     ### SML/NJ <a name="smlnj-details"></a>
196 :    
197 :     #### Installing on Linux
198 :    
199 :     On Ubuntu or Debian Linux, `apt-get` may work to install a sufficiently recent
200 :     version. `apt-cache policy smlnj` reports what version you can get;
201 :     if that's at or above version 110.82, you can:
202 :    
203 :     ````bash
204 :     sudo apt-get install smlnj
205 :     sudo apt-get install ml-lpt
206 :     ````
207 :    
208 :     The second `apt-get` to get `ml-lpt` is required because without it, the later compilation
209 :     of the Diderot compiler (with the `sml` from `apt-get`) will stop with an error message
210 :     like `driver/sources.cm:16.3-16.18 Error: anchor $ml-lpt-lib.cm not defined`.
211 :    
212 :     #### Installing on macOS
213 :    
214 :     On **macOS** systems, the easiest way to install **SML/NJ** is by
215 :     downloading the signed installer package from <smlnj.org>. Running the
216 :     installer will place the system in `/usr/local/smlnj` and the path to the
217 :     **sml** command will be `/usr/local/smlnj/bin/sml`.
218 :    
219 :     As an alternative you can install SML/NJ from [Homebrew](https://brew.sh)
220 :     using the following commands:
221 :    
222 :     It is also possible to get SML/NJ from [Homebrew](https://brew.sh) for macOS.
223 :     Assuming that `brew info smlnj` mentions version 110.82 or higher, then
224 :    
225 :     ````bash
226 :     brew install smlnj
227 :     ````
228 :    
229 :     (possibly followed by `brew link smlnj`) should work.
230 :    
231 :     #### Installing from source ####
232 :    
233 :     It is also possible to install **SML/NJ** using the installation script
234 :     provided as part of the source downloads.
235 :    
236 :     First, create a directory to hold the downloaded files and the results
237 :     of the installation; assume that `$SMLDIR` denotes the path to that
238 :     directory. Then run the following command to download and unbundle
239 :     the `config` directory:
240 :    
241 :     ```` bash
242 :     curl -O http://smlnj.org/dist/working/110.98/config.tgz
243 :     tar -xzf config.tgz
244 :     ````
245 :    
246 :     Then you can build the system using the command
247 :    
248 :     ```` bash
249 :     config/install.sh
250 :     ````
251 :    
252 :     This command will download the necessary source and precompiled files from
253 :     <smlnj.org> and build the **SML/NJ** runtime, compiler, and libraries.
254 :     The path to the **sml** command will be `$SMLDIR/bin/sml`.

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0