Import Debian changes 20180207-1
[hcoop/debian/mlton.git] / doc / guide / localhost / RunningOnNetBSD
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta name="generator" content="AsciiDoc 8.6.9">
6 <title>RunningOnNetBSD</title>
7 <link rel="stylesheet" href="./asciidoc.css" type="text/css">
8 <link rel="stylesheet" href="./pygments.css" type="text/css">
9
10
11 <script type="text/javascript" src="./asciidoc.js"></script>
12 <script type="text/javascript">
13 /*<![CDATA[*/
14 asciidoc.install();
15 /*]]>*/
16 </script>
17 <link rel="stylesheet" href="./mlton.css" type="text/css">
18 </head>
19 <body class="article">
20 <div id="banner">
21 <div id="banner-home">
22 <a href="./Home">MLton 20180207</a>
23 </div>
24 </div>
25 <div id="header">
26 <h1>RunningOnNetBSD</h1>
27 </div>
28 <div id="content">
29 <div id="preamble">
30 <div class="sectionbody">
31 <div class="paragraph"><p>MLton runs fine on <a href="http://www.netbsd.org/">NetBSD</a>.</p></div>
32 </div>
33 </div>
34 <div class="sect1">
35 <h2 id="_installing_the_correct_packages_for_netbsd">Installing the correct packages for NetBSD</h2>
36 <div class="sectionbody">
37 <div class="paragraph"><p>The NetBSD system installs 3rd party packages by a mechanism known as
38 pkgsrc. This is a tree of Makefiles which when invoked downloads the
39 source code, builds a package and installs it on the system. In order
40 to run MLton on NetBSD, you will have to install several packages for
41 it to work:</p></div>
42 <div class="ulist"><ul>
43 <li>
44 <p>
45 <span class="monospaced">shells/bash</span>
46 </p>
47 </li>
48 <li>
49 <p>
50 <span class="monospaced">devel/gmp</span>
51 </p>
52 </li>
53 <li>
54 <p>
55 <span class="monospaced">devel/gmake</span>
56 </p>
57 </li>
58 </ul></div>
59 <div class="paragraph"><p>In order to get graphical call-graphs of profiling information, you
60 will need the additional package</p></div>
61 <div class="ulist"><ul>
62 <li>
63 <p>
64 <span class="monospaced">graphics/graphviz</span>
65 </p>
66 </li>
67 </ul></div>
68 <div class="paragraph"><p>To build the documentation for MLton, you will need the addtional
69 package</p></div>
70 <div class="ulist"><ul>
71 <li>
72 <p>
73 <span class="monospaced">textproc/asciidoc</span>.
74 </p>
75 </li>
76 </ul></div>
77 </div>
78 </div>
79 <div class="sect1">
80 <h2 id="_tips_for_compiling_and_using_mlton_on_netbsd">Tips for compiling and using MLton on NetBSD</h2>
81 <div class="sectionbody">
82 <div class="paragraph"><p>MLton can be a memory-hog on computers with little memory. While
83 640Mb of RAM ought to be enough to self-compile MLton one might want
84 to do some tuning to the NetBSD VM subsystem in order to succeed. The
85 notes presented here is what <a href="JesperLouisAndersen">JesperLouisAndersen</a> uses for
86 compiling MLton on his laptop.</p></div>
87 <div class="sect2">
88 <h3 id="_the_netbsd_vm_subsystem">The NetBSD VM subsystem</h3>
89 <div class="paragraph"><p>NetBSD uses a VM subsystem named
90 <a href="http://www.ccrc.wustl.edu/pub/chuck/tech/uvm/">UVM</a>.
91 <a href="http://www.selonen.org/arto/netbsd/vm_tune.html">Tuning the VM system</a>
92 can be done via the <span class="monospaced">sysctl(8)</span>-interface with the "VM" MIB set.</p></div>
93 </div>
94 <div class="sect2">
95 <h3 id="_tuning_the_netbsd_vm_subsystem_for_mlton">Tuning the NetBSD VM subsystem for MLton</h3>
96 <div class="paragraph"><p>MLton uses a lot of anonymous pages when it is running. Thus, we will
97 need to tune up the default of 80 for anonymous pages. Setting</p></div>
98 <div class="listingblock">
99 <div class="content monospaced">
100 <pre>sysctl -w vm.anonmax=95
101 sysctl -w vm.anonmin=50
102 sysctl -w vm.filemin=2
103 sysctl -w vm.execmin=2
104 sysctl -w vm.filemax=4
105 sysctl -w vm.execmax=4</pre>
106 </div></div>
107 <div class="paragraph"><p>makes it less likely for the VM system to swap out anonymous pages.
108 For a full explanation of the above flags, see the documentation.</p></div>
109 <div class="paragraph"><p>The result is that my laptop goes from a MLton compile where it swaps
110 a lot to a MLton compile with no swapping.</p></div>
111 </div>
112 </div>
113 </div>
114 </div>
115 <div id="footnotes"><hr></div>
116 <div id="footer">
117 <div id="footer-text">
118 </div>
119 <div id="footer-badges">
120 </div>
121 </div>
122 </body>
123 </html>