summaryrefslogtreecommitdiff
path: root/doc/install.html
diff options
context:
space:
mode:
Diffstat (limited to 'doc/install.html')
-rw-r--r--doc/install.html216
1 files changed, 216 insertions, 0 deletions
diff --git a/doc/install.html b/doc/install.html
new file mode 100644
index 00000000..b7211d21
--- /dev/null
+++ b/doc/install.html
@@ -0,0 +1,216 @@
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2<html>
3<head>
4<title>Installation</title>
5<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6<meta name="Author" content="Mike Pall">
7<meta name="Copyright" content="Copyright (C) 2005-2009, Mike Pall">
8<meta name="Language" content="en">
9<link rel="stylesheet" type="text/css" href="bluequad.css" media="screen">
10<link rel="stylesheet" type="text/css" href="bluequad-print.css" media="print">
11</head>
12<body>
13<div id="site">
14<a href="http://luajit.org"><span>Lua<span id="logo">JIT</span></span></a>
15</div>
16<div id="head">
17<h1>Installation</h1>
18</div>
19<div id="nav">
20<ul><li>
21<a href="luajit.html">LuaJIT</a>
22<ul><li>
23<a class="current" href="install.html">Installation</a>
24</li><li>
25<a href="running.html">Running</a>
26</li><li>
27<a href="api.html">API Extensions</a>
28</li></ul>
29</li><li>
30<a href="status.html">Status</a>
31<ul><li>
32<a href="changes.html">Changes</a>
33</li></ul>
34</li><li>
35<a href="faq.html">FAQ</a>
36</li><li>
37<a href="http://luajit.org/download.html">Download <span class="ext">&raquo;</span></a>
38</li></ul>
39</div>
40<div id="main">
41<p>
42LuaJIT is only distributed as a source package. This page explains
43how to build and install LuaJIT with different operating systems
44and C&nbsp;compilers.
45</p>
46<p>
47For the impatient (on POSIX systems):
48</p>
49<pre class="code">
50make &amp;&amp; sudo make install
51</pre>
52<p>
53LuaJIT currently builds out-of-the box on all popular x86 systems
54(Linux, Windows, OSX etc.). It builds and runs fine as a 32&nbsp;bit
55application under x64-based systems, too.
56</p>
57
58<h2>Configuring LuaJIT</h2>
59<p>
60The standard configuration should work fine for most installations.
61Usually there is no need to tweak the settings, except when you want to
62install to a non-standard path. The following three files hold all
63user-configurable settings:
64</p>
65<ul>
66<li><tt>src/luaconf.h</tt> sets some configuration variables, in
67particular the default paths for loading modules.</li>
68<li><tt>Makefile</tt> has settings for installing LuaJIT (POSIX
69only).</li>
70<li><tt>src/Makefile</tt> has settings for compiling LuaJIT under POSIX,
71MinGW and Cygwin.</li>
72<li><tt>src/msvcbuild.bat</tt> has settings for compiling LuaJIT with
73MSVC.</li>
74</ul>
75<p>
76Please read the instructions given in these files, before changing
77any settings.
78</p>
79
80<h2 id="posix">POSIX Systems (Linux, OSX, *BSD etc.)</h2>
81<h3>Prerequisites</h3>
82<p>
83Depending on your distribution, you may need to install a package for
84GCC (GCC 3.4 or later required), the development headers and/or a
85complete SDK.
86</p>
87<p>
88E.g. on a current Debian/Ubuntu, install <tt>libc6-dev</tt>
89with the package manager. Currently LuaJIT only builds as a 32&nbsp;bit
90application, so you actually need to install <tt>libc6-dev-i386</tt>
91when building on an x64 OS.
92</p>
93<p>
94Download the current source package (pick the .tar.gz), if you haven't
95already done so. Move it to a directory of your choice, open a
96terminal window and change to this directory. Now unpack the archive
97and change to the newly created directory:
98</p>
99<pre class="code">
100tar zxf LuaJIT-2.0.0-beta1.tar.gz
101cd LuaJIT-2.0.0-beta1
102</pre>
103<h3>Building LuaJIT</h3>
104<p>
105The supplied Makefiles try to auto-detect the settings needed for your
106operating system and your compiler. They need to be run with GNU Make,
107which is probably the default on your system, anyway. Simply run:
108</p>
109<pre class="code">
110make
111</pre>
112<h3>Installing LuaJIT</h3>
113<p>
114The top-level Makefile installs LuaJIT by default under
115<tt>/usr/local</tt>, i.e. the executable ends up in
116<tt>/usr/local/bin</tt> and so on. You need to have root privileges
117to write to this path. So, assuming sudo is installed on your system,
118run the following command and enter your sudo password:
119</p>
120<pre class="code">
121sudo make install
122</pre>
123<p>
124Otherwise specify the directory prefix as an absolute path, e.g.:
125</p>
126<pre class="code">
127sudo make install PREFIX=/opt/lj2
128</pre>
129<p>
130But note that the installation prefix and the prefix for the module paths
131(configured in <tt>src/luaconf.h</tt>) must match.
132</p>
133<p style="color: #c00000;">
134Note: to avoid overwriting a previous version, the beta test releases
135only install the LuaJIT executable under the versioned name (i.e.
136<tt>luajit-2.0.0-beta1</tt>). You probably want to create a symlink
137for convenience, with a command like this:
138</p>
139<pre class="code" style="color: #c00000;">
140sudo ln -sf luajit-2.0.0-beta1 /usr/local/bin/luajit
141</pre>
142
143<h2 id="windows">Windows Systems</h2>
144<h3>Prerequisites</h3>
145<p>
146Either install one of the open source SDKs
147(<a href="http://mingw.org/"><span class="ext">&raquo;</span>&nbsp;MinGW</a> or
148<a href="http://www.cygwin.com/"><span class="ext">&raquo;</span>&nbsp;Cygwin</a>) which come with modified
149versions of GCC plus the required development headers.
150</p>
151<p>
152Or install Microsoft's Visual C++ (MSVC) &mdash; the freely downloadable
153<a href="http://www.microsoft.com/Express/VC/"><span class="ext">&raquo;</span>&nbsp;Express Edition</a>
154works just fine.
155</p>
156<p>
157Next, download the source package and unpack it using an archive manager
158(e.g. the Windows Explorer) to a directory of your choice.
159</p>
160<h3>Building with MSVC</h3>
161<p>
162Open a "Visual Studio .NET Command Prompt" and <tt>cd</tt> to the
163directory where you've unpacked the sources. Then run this command:
164</p>
165<pre class="code">
166cd src
167msvcbuild
168</pre>
169<p>
170Then follow the installation instructions below.
171</p>
172<h3>Building with MinGW or Cygwin</h3>
173<p>
174Open a command prompt window and make sure the MinGW or Cygwin programs
175are in your path. Then <tt>cd</tt> to the directory where
176you've unpacked the sources and run this command for MinGW:
177</p>
178<pre class="code">
179cd src
180mingw32-make
181</pre>
182<p>
183Or this command for Cygwin:
184</p>
185<pre class="code">
186cd src
187make
188</pre>
189<p>
190Then follow the installation instructions below.
191</p>
192<h3>Installing LuaJIT</h3>
193<p>
194Copy <tt>luajit.exe</tt> and <tt>lua51.dll</tt>
195to a newly created directory (any location is ok). Add <tt>lua</tt>
196and <tt>lua\jit</tt> directories below it and copy all Lua files
197from the <tt>lib</tt> directory of the distribution to the latter directory.
198</p>
199<p>
200There are no hardcoded
201absolute path names &mdash; all modules are loaded relative to the
202directory where <tt>luajit.exe</tt> is installed
203(see <tt>src/luaconf.h</tt>).
204</p>
205<br class="flush">
206</div>
207<div id="foot">
208<hr class="hide">
209Copyright &copy; 2005-2009 Mike Pall
210<span class="noprint">
211&middot;
212<a href="contact.html">Contact</a>
213</span>
214</div>
215</body>
216</html>