4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta name="generator" content="AsciiDoc 8.6.9">
6 <title>CompilingWithSMLNJ</title>
7 <link rel="stylesheet" href="./asciidoc.css" type="text/css">
8 <link rel="stylesheet" href="./pygments.css" type="text/css">
11 <script type="text/javascript" src="./asciidoc.js"></script>
12 <script type="text/javascript">
17 <link rel="stylesheet" href="./mlton.css" type="text/css">
19 <body class="article">
21 <div id="banner-home">
22 <a href="./Home">MLton 20180207</a>
26 <h1>CompilingWithSMLNJ</h1>
30 <div class="sectionbody">
31 <div class="paragraph"><p>You can compile MLton with <a href="SMLNJ">SML/NJ</a>, however the resulting
32 compiler will run much more slowly than MLton compiled by itself. We
33 don’t recommend using SML/NJ as a means of
34 <a href="PortingMLton">porting MLton</a> to a new platform or bootstrapping on a
35 new platform.</p></div>
36 <div class="paragraph"><p>If you do want to build MLton with SML/NJ, it is best to have a binary
37 MLton package installed. If you don’t, here are some issues you may
38 encounter when you run <span class="monospaced">make smlnj-mlton</span>.</p></div>
39 <div class="paragraph"><p>You will get (many copies of) the error messages:</p></div>
40 <div class="listingblock">
41 <div class="content monospaced">
42 <pre>/bin/sh: mlton: command not found</pre>
44 <div class="paragraph"><p>and</p></div>
45 <div class="listingblock">
46 <div class="content monospaced">
47 <pre>make[2]: mlton: Command not found</pre>
49 <div class="paragraph"><p>The <span class="monospaced">Makefile</span> calls <span class="monospaced">mlton</span> to determine dependencies, and can
50 proceed in spite of this error.</p></div>
51 <div class="paragraph"><p>If you don’t have an <span class="monospaced">mllex</span> executable, you will get the error
53 <div class="listingblock">
54 <div class="content monospaced">
55 <pre>mllex: Command not found</pre>
57 <div class="paragraph"><p>Building MLton requires <span class="monospaced">mllex</span> and <span class="monospaced">mlyacc</span> executables, which are
58 distributed with a binary package of MLton. The easiest solution is
59 to copy the front-end lexer/parser files from a different machine
60 (<span class="monospaced">ml.grm.sml</span>, <span class="monospaced">ml.grm.sig</span>, <span class="monospaced">ml.lex.sml</span>, <span class="monospaced">mlb.grm.sig</span>,
61 <span class="monospaced">mlb.grm.sml</span>).</p></div>
65 <div id="footnotes"><hr></div>
67 <div id="footer-text">
69 <div id="footer-badges">