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