File: Installation

package info (click to toggle)
mlton 20100608-5
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 36,624 kB
  • sloc: ansic: 18,441; lisp: 2,879; makefile: 1,572; sh: 1,326; pascal: 256; asm: 97
file content (138 lines) | stat: -rw-r--r-- 5,048 bytes parent folder | download | duplicates (3)
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
<!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 MLTONWIKIVERSION</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>
      &nbsp;<a href = "TitleIndex">Index</a>
      &nbsp;
</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 href="GnuMP"> GNU multiprecision</a> library 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> or <tt>libgmp.dylib</tt>) library. If you see the error message <tt>gmp.h:&nbsp;No&nbsp;such&nbsp;file&nbsp;or&nbsp;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:&nbsp;cannot&nbsp;find&nbsp;-lgmp</tt>, you should add a <tt>-link-opt&nbsp;-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&nbsp;-L/tmp</tt>. 
</p>
<p>
Installation of MLton creates the following files and directories. 
</p>

    <ul>

    <li>
<p>
 <tt>/usr/bin/mllex</tt>  <br>
The <a href="MLLex">MLLex</a> lexer generator. 
</p>
</li>
    <li class="gap">
<p>
 <tt>/usr/bin/mlnlffigen</tt>  <br>
The <a href="MLNLFFI">ML-NLFFI</a> tool. 
</p>
</li>
    <li class="gap">
<p>
 <tt>/usr/bin/mlprof</tt>  <br>
A <a href="Profiling">Profiling</a> tool. 
</p>
</li>
    <li class="gap">
<p>
 <tt>/usr/bin/mlton</tt>  <br>
A script to call the compiler.  This script may be moved anywhere,  however, it makes use of files in <tt>/usr/lib/mlton</tt>.  
</p>
</li>
    <li class="gap">
<p>
 <tt>/usr/bin/mlyacc</tt>  <br>
The <a href="MLYacc">MLYacc</a> parser generator. 
</p>
</li>
    <li class="gap">
<p>
 <tt>/usr/lib/mlton</tt>  <br>
Directory containing libraries and include files needed during  compilation. 
</p>
</li>
    <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>  <br>
Man pages. 
</p>
</li>
    <li class="gap">
<p>
 <tt>/usr/share/doc/mlton</tt>  <br>
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. 
</p>
</li>

    </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 2007-08-30 20:06:41 by <span title="fenrir.uchicago.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
</body></html>