File: compiling.tex

package info (click to toggle)
mlton 20041109-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 18,212 kB
  • ctags: 58,085
  • sloc: ansic: 10,386; makefile: 1,178; sh: 1,139; pascal: 256; asm: 97
file content (46 lines) | stat: -rw-r--r-- 2,476 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
\sec{Compiling {\mlton}}{compiling}{Compiling_MLton.html}
%
If you want to compile {\mlton}, you need either the source {\tt rpm}
or {\tt tgz}.  You can compile with either {\mlton} or {\smlnj}, but
we strongly recommend using {\mlton}, since it generates a much faster
and more robust executable.  
%
\subsection{Compiling with {\mlton}}

To compile with {\mlton}, you need the binary versions of {\tt mlton},
{\tt mllex}, and {\tt mlyacc} that come with the {\mlton} binary
package.  To be safe, you should use the same version of {\mlton} that
you are building.  However, older versions may work, as long as they
don't go back too far.  To build {\mlton}, run {\tt make} from within
the root directory of the sources.  This will build {\mlton} first
with the already installed binary version of {\mlton} and will then
rebuild {\mlton} with itself.

First, the {\tt Makefile} calls {\tt mllex} and {\tt mlyacc} to build
the lexer and parser, and then calls {\tt mlton} to compile itself.
When making {\mlton} using another version the {\tt Makefile}
automatically uses {\tt mlton-stubs.cm}, which will put in enough
stubs to emulate the {\tt MLton} structure.  Once {\mlton} is built,
the {\tt Makefile} will rebuild {\mlton} with itself, this time using
{\tt mlton.cm} and the real {\tt MLton} structure from the basis
library.  This second round of compilation is essential in order to
achieve a fast and robust {\mlton}.

Compiling {\mlton} requires at least 512M of actual RAM, and 1G is
preferable.  If your machine has less than 512M, self-compilation will
likely fail, or at least take a very long time due to paging.  Even if
you have enough memory, there simply may not be enough available, due
to memory consumed by other processes.  In this case, you may see an
{\tt Out of memory} message, or self-compilation may become extremely
slow.  The only fix is to make sure that enough memory is available.
%
\subsection{Compiling with {\smlnj}}

To compile with {\smlnj}, run {\tt make nj-mlton} from within the root
directory of the sources.  You must use the SML/NJ version 110.45,
which is what {\mlton} is tested with.  First, the {\tt Makefile}
calls {\tt mllex} and {\tt mlyacc} to build the lexer and parser.
Then, it calls {\smlnj} with the appropriate {\tt sources.cm} file.
Building with {\smlnj} takes some time (10 minutes on a 1.6GHz
machine).  Unless you are doing compiler development and need rapid
recompilation, we recommend compiling with {\mlton}.