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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="generator" content="AsciiDoc 8.6.8">
<title>CompilingWithSMLNJ</title>
<link rel="stylesheet" href="./asciidoc.css" type="text/css">
<link rel="stylesheet" href="./pygments.css" type="text/css">
<script type="text/javascript" src="./asciidoc.js"></script>
<script type="text/javascript">
/*<![CDATA[*/
asciidoc.install();
/*]]>*/
</script>
<link rel="stylesheet" href="./mlton.css" type="text/css"/>
</head>
<body class="article">
<div id="banner">
<div id="banner-home">
<a href="./Home">MLton 20130715</a>
</div>
</div>
<div id="header">
<h1>CompilingWithSMLNJ</h1>
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<div class="paragraph"><p>You can compile MLton with <a href="SMLNJ">SML/NJ</a>, however the resulting
compiler will run much more slowly than MLton compiled by itself. We
don’t recommend using SML/NJ as a means of
<a href="PortingMLton">porting MLton</a> to a new platform or bootstrapping on a
new platform.</p></div>
<div class="paragraph"><p>If you do want to build MLton with SML/NJ, it is best to have a binary
MLton package installed. If you don’t, here are some issues you may
encounter when you run <span class="monospaced">make nj-mlton</span>.</p></div>
<div class="paragraph"><p>You will get (many copies of) the error message:</p></div>
<div class="listingblock">
<div class="content monospaced">
<pre>/bin/sh: mlton: not found</pre>
</div></div>
<div class="paragraph"><p>The <span class="monospaced">Makefile</span> calls <span class="monospaced">mlton</span> to determine dependencies, and can
proceed in spite of this error.</p></div>
<div class="paragraph"><p>If you don’t have a <span class="monospaced">mlton</span> executable, you will get the error
message:</p></div>
<div class="listingblock">
<div class="content monospaced">
<pre>Error: cannot upgrade basis because the compiler doesn't work</pre>
</div></div>
<div class="paragraph"><p>We use <span class="monospaced">upgrade-basis.sml</span> to work around basis library differences,
allowing a version of MLton written for a newer basis library to be
compiled by an older version of MLton. The file isn’t necessary when
building with SML/NJ, but is listed in <span class="monospaced">$(SOURCES)</span>, so the <span class="monospaced">Makefile</span>
is attempting to build it. Building <span class="monospaced">upgrade-basis.sml</span> requires the
old version of MLton to be around so that the right stubs can be
built.</p></div>
<div class="paragraph"><p>To work around this problem, do one of the following.</p></div>
<div class="ulist"><ul>
<li>
<p>
Manually tweak sources to remove <span class="monospaced">$(UP)</span> until you’re finished
building MLton with SML/NJ and have a working MLton.
</p>
</li>
<li>
<p>
Build <span class="monospaced">upgrade-basis.sml</span> on some other machine with a working MLton
and copy it over.
</p>
</li>
</ul></div>
<div class="paragraph"><p>If you don’t have an <span class="monospaced">mllex</span> executable, you will get the error
message:</p></div>
<div class="listingblock">
<div class="content monospaced">
<pre>mllex: Command not found</pre>
</div></div>
<div class="paragraph"><p>Building MLton requires <span class="monospaced">mllex</span> and <span class="monospaced">mlyacc</span> executables, which are
distributed with a binary package of MLton. The easiest solution is
to copy the front-end lexer/parser files from a different machine
(<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>,
<span class="monospaced">mlb.grm.sml</span>).</p></div>
</div>
</div>
</div>
<div id="footnotes"><hr></div>
<div id="footer">
<div id="footer-text">
</div>
<div id="footer-badges">
</div>
</div>
</body>
</html>
|