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 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta name="robots" content="index,nofollow">
<title>Installation - MLton Standard ML Compiler (SML Compiler)</title>
<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="all" href="common.css">
<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="screen" href="screen.css">
<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="print" href="print.css">
<link rel="Start" href="Home">
</head>
<body lang="en" dir="ltr">
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-833377-1";
urchinTracker();
</script>
<table bgcolor = lightblue cellspacing = 0 style = "border: 0px;" width = 100%>
<tr>
<td style = "
border: 0px;
color: darkblue;
font-size: 150%;
text-align: left;">
<a class = mltona href="Home">MLton 20061025</a>
<td style = "
border: 0px;
font-size: 150%;
text-align: center;
width: 50%;">
Installation
<td style = "
border: 0px;
text-align: right;">
<table cellspacing = 0 style = "border: 0px">
<tr style = "vertical-align: middle;">
</table>
<tr style = "background-color: white;">
<td colspan = 3
style = "
border: 0px;
font-size:70%;
text-align: right;">
<a href = "Home">Home</a>
<a href = "Index">Index</a>
</table>
<div id="content" lang="en" dir="ltr">
MLton runs on a variety of platforms and is distributed in both source and binary form. The format for the binary package depends on the platform. The binary package will install under <tt>/usr</tt> or <tt>/usr/local</tt>, depending on the platform. A <tt>.tgz</tt> or <tt>.tbz</tt> binary package should be extracted in the root directory. If you install MLton somewhere else, you must set the <tt>lib</tt> variable in the <tt>/usr/bin/mlton</tt> script to the directory that contains the libraries (<tt>/usr/lib/mlton</tt> by default). <p>
MLton requires that you have the <a class="external" href="http://www.gnu.org/software/gmp/gmp.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">GNU multiprecision library</a> installed on your machine. MLton must be able to find both the <tt>gmp.h</tt> include file and the <tt>libgmp.a</tt> or <tt>libgmp.so</tt> library. If you see the error message <tt>gmp.h: No such file or directory</tt>, you should copy <tt>gmp.h</tt> to <tt>/usr/lib/mlton/self/include</tt>. If you see the error message <tt>/usr/bin/ld: cannot find -lgmp</tt>, you should add a <tt>-link-opt -L</tt> argument in the <tt>/usr/bin/mlton</tt> script so that the linker can find <tt>libgmp</tt>. If, for example, <tt>libgmp.a</tt> is in <tt>/tmp</tt>, then add <tt>-link-opt -L/tmp</tt>.
</p>
<p>
Installation of MLton creates the following files and directories.
</p>
<ul>
<li>
<p>
<tt>/usr/bin/mllex</tt>
</p>
</li>
<ul>
The <a class="nonexistent" href="MLLex">MLLex</a> lexer generator.
</ul>
<li class="gap">
<p>
<tt>/usr/bin/mlnlffigen</tt>
</p>
</li>
<ul>
The <a href="MLNLFFI">ML-NLFFI</a> tool.
</ul>
<li class="gap">
<p>
<tt>/usr/bin/mlprof</tt>
</p>
</li>
<ul>
A <a href="Profiling">Profiling</a> tool.
</ul>
<li class="gap">
<p>
<tt>/usr/bin/mlton</tt>
</p>
</li>
<ul>
A script to call the compiler. This script may be moved anywhere, however, it makes use of files in <tt>/usr/lib/mlton</tt>.
</ul>
<li class="gap">
<p>
<tt>/usr/bin/mlyacc</tt>
</p>
</li>
<ul>
The <a class="nonexistent" href="MLYacc">MLYacc</a> parser generator.
</ul>
<li class="gap">
<p>
<tt>/usr/lib/mlton</tt>
</p>
</li>
<ul>
Directory containing libraries and include files needed during compilation.
</ul>
<li class="gap">
<p>
<tt>/usr/share/man/man1/mllex.1</tt>, <tt>mlnlffigen.1</tt>, <tt>mlprof.1</tt>, <tt>mlton.1</tt>, <tt>mlyacc.1</tt>
</p>
</li>
<ul>
Man pages.
</ul>
<li class="gap">
<p>
<tt>/usr/share/doc/mlton</tt>
</p>
</li>
<ul>
Directory containing the user guide for MLton, mllex, and mlyacc, as well as example SML programs (in the <tt>examples</tt> dir), and license information.
</ul>
</ul>
<h2 id="head-0a0a9f2a6772942557ab5355d76af442f8f65e01">Hello, World!</h2>
<p>
Once you have installed MLton, create a file called <tt>hello-world.sml</tt> with the following contents.
</p>
<pre>print "Hello, world!\n";
</pre>Now create an executable, <tt>hello-world</tt>, with the following command.
<pre>mlton hello-world.sml
</pre>You can now run <tt>hello-world</tt> to verify that it works. There are more small examples in <tt>/usr/share/doc/mlton/examples</tt>. <h2 id="head-5a23e19b85078e1861c93e3cc0336d20456af4e0">Installation on Cygwin</h2>
<p>
When installing the Cygwin <tt>tgz</tt>, you should use Cygwin's <tt>bash</tt> and <tt>tar</tt>. The use of an archiving tool that is not aware of Cygwin's mounts will put the files in the wrong place.
</p>
</div>
<p>
<hr>
Last edited on 2005-12-08 16:14:00 by <span title="ppp-71-139-181-150.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
</body></html>
|