blob: af7e63bb6560b4e43cd2d895c410e85ee4fe1dfe [file] [log] [blame]
Andreas Bollecd5c7c2012-06-12 09:05:03 +02001<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<html lang="en">
3<head>
4 <meta http-equiv="content-type" content="text/html; charset=utf-8">
5 <title>Compiling and Installing</title>
6 <link rel="stylesheet" type="text/css" href="mesa.css">
7</head>
8<body>
Brian Paul0b27ace2003-03-08 17:38:57 +00009
Andreas Bollb5da52a2012-09-18 18:57:02 +020010<div class="header">
11 <h1>The Mesa 3D Graphics Library</h1>
12</div>
13
14<iframe src="contents.html"></iframe>
15<div class="content">
16
Andreas Bollecd5c7c2012-06-12 09:05:03 +020017<h1>Compiling and Installing</h1>
Brian Paul5f37abf2003-09-05 14:47:07 +000018
19<ol>
Brian Paul7103a182012-04-19 09:56:36 -060020<li><a href="#prereq-general">Prerequisites for building</a>
Brian Paul49a3fab2008-12-30 07:57:16 -070021 <ul>
Brian Paul7103a182012-04-19 09:56:36 -060022 <li><a href="#prereq-general">General prerequisites</a>
23 <li><a href="#prereq-dri">For DRI and hardware acceleration</a>
Brian Paul49a3fab2008-12-30 07:57:16 -070024 </ul>
Brian Paul7103a182012-04-19 09:56:36 -060025<li><a href="#autoconf">Building with autoconf (Linux/Unix/X11)</a>
Brian Pauladc58e92012-06-01 09:19:36 -060026<li><a href="#scons">Building with SCons (Windows/Linux)</a>
Brian Paul7103a182012-04-19 09:56:36 -060027<li><a href="#other">Building for other systems</a>
28<li><a href="#libs">Library Information</a>
Andreas Bolldf2be222012-06-12 09:05:22 +020029<li><a href="#pkg-config">Building OpenGL programs with pkg-config</a>
Brian Paul5f37abf2003-09-05 14:47:07 +000030</ol>
Brian Paul0b27ace2003-03-08 17:38:57 +000031
Brian Paul8bd70a72008-05-27 13:27:57 -060032
Andreas Bollcc418882012-06-12 09:05:33 +020033<h1 id="prereq-general">1. Prerequisites for building</h1>
Brian Paul32a11e52011-04-04 11:30:46 -060034
Brian Paul7103a182012-04-19 09:56:36 -060035<h2>1.1 General</h2>
Brian Paul32a11e52011-04-04 11:30:46 -060036<ul>
37<li>lex / yacc - for building the GLSL compiler.
38On Linux systems, flex and bison are used.
39Versions 2.5.35 and 2.4.1, respectively, (or later) should work.
Brian Paul4f869e92012-03-05 13:02:59 -070040<br>
41<br>
42On Windows with MinGW, install flex and bison with:
43<pre>mingw-get install msys-flex msys-bison</pre>
Brian Paul32a11e52011-04-04 11:30:46 -060044</li>
45<li>python - Python is needed for building the Gallium components.
46Version 2.6.4 or later should work.
Brian Paul4f869e92012-03-05 13:02:59 -070047<br>
48<br>
49To build OpenGL ES 1.1 and 2.0 you'll also need
50<a href="http://xmlsoft.org/sources/win32/python/libxml2-python-2.7.7.win32-py2.7.exe">libxml2-python</a>.
Brian Paul32a11e52011-04-04 11:30:46 -060051</li>
52</ul>
53
54
Andreas Bollcc418882012-06-12 09:05:33 +020055<h3 id="prereq-dri">1.2 For DRI and hardware acceleration</h3>
Brian Paul5f37abf2003-09-05 14:47:07 +000056
57<p>
Brian Paul90692482009-10-08 20:49:32 -060058The following are required for DRI-based hardware acceleration with Mesa:
Brian Paul8bd70a72008-05-27 13:27:57 -060059</p>
60
Brian Paul49a3fab2008-12-30 07:57:16 -070061<ul>
Andreas Bolla73c59b2012-09-18 19:31:28 +020062<li><a href="http://xorg.freedesktop.org/releases/individual/proto/">
63dri2proto</a> version 2.6 or later
64<li><a href="http://dri.freedesktop.org/libdrm/">libDRM</a>
Brian Paul7103a182012-04-19 09:56:36 -060065version 2.4.33 or later
Brian Paul2c56dd72009-01-10 11:52:55 -070066<li>Xorg server version 1.5 or later
Brian Paul7103a182012-04-19 09:56:36 -060067<li>Linux 2.6.28 or later
Brian Paul49a3fab2008-12-30 07:57:16 -070068</ul>
Alex Hultmanc3fe44c2012-03-16 09:46:42 -060069<p>
70If you're using a fedora distro the following command should install all
71the needed dependencies:
Andreas Bolldf2be222012-06-12 09:05:22 +020072</p>
Alex Hultmanc3fe44c2012-03-16 09:46:42 -060073<pre>
74 sudo yum install flex bison imake libtool xorg-x11-proto-devel libdrm-devel \
75 gcc-c++ xorg-x11-server-devel libXi-devel libXmu-devel libXdamage-devel git \
76 expat-devel llvm-devel
77</pre>
Brian Paul8bd70a72008-05-27 13:27:57 -060078
79
Brian Paul7103a182012-04-19 09:56:36 -060080
Andreas Boll210a27d2012-06-12 09:05:36 +020081<h1 id="autoconf">2. Building with autoconf (Linux/Unix/X11)</h1>
Brian Paul8bd70a72008-05-27 13:27:57 -060082
83<p>
Brian Paul7103a182012-04-19 09:56:36 -060084The primary method to build Mesa on Unix systems is with autoconf.
85</p>
Brian Paul8bd70a72008-05-27 13:27:57 -060086
87<p>
Brian Paul7103a182012-04-19 09:56:36 -060088The general approach is the standard:
Andreas Bolldf2be222012-06-12 09:05:22 +020089</p>
Brian Paul7103a182012-04-19 09:56:36 -060090<pre>
91 ./configure
92 make
93 sudo make install
94</pre>
Andreas Bolldf2be222012-06-12 09:05:22 +020095<p>
Brian Paul7103a182012-04-19 09:56:36 -060096But please read the <a href="autoconf.html">detailed autoconf instructions</a>
97for more details.
98</p>
99
100
101
Andreas Boll210a27d2012-06-12 09:05:36 +0200102<h1 id="scons">3. Building with SCons (Windows/Linux)</h1>
Brian Paul7103a182012-04-19 09:56:36 -0600103
104<p>
105To build Mesa with SCons on Linux or Windows do
106</p>
107<pre>
108 scons
109</pre>
110<p>
111The build output will be placed in
112build/<i>platform</i>-<i>machine</i>-<i>debug</i>/..., where <i>platform</i> is for
113example linux or windows, <i>machine</i> is x86 or x86_64, optionally followed
114by -debug for debug builds.
115</p>
116
117<p>
118To build Mesa with SCons for Windows on Linux using the MinGW crosscompiler toolchain do
119</p>
120<pre>
121 scons platform=windows toolchain=crossmingw machine=x86 mesagdi libgl-gdi
122</pre>
123<p>
124This will create:
125</p>
126<ul>
Andreas Bollfd64b392012-06-12 09:05:49 +0200127<li>build/windows-x86-debug/mesa/drivers/windows/gdi/opengl32.dll &mdash; Mesa + swrast, binary compatible with Windows's opengl32.dll
128<li>build/windows-x86-debug/gallium/targets/libgl-gdi/opengl32.dll &mdash; Mesa + Gallium + softpipe, binary compatible with Windows's opengl32.dll
Brian Paul7103a182012-04-19 09:56:36 -0600129</ul>
130<p>
131Put them all in the same directory to test them.
132</p>
133
134
135
Andreas Boll210a27d2012-06-12 09:05:36 +0200136<h1 id="other">4. Building for other systems</h1>
Brian Paul7103a182012-04-19 09:56:36 -0600137
138<p>
139Documentation for other environments (some may be very out of date):
140</p>
141
Andreas Boll210a27d2012-06-12 09:05:36 +0200142<ul>
143<li><a href="README.VMS">README.VMS</a> - VMS
144<li><a href="README.CYGWIN">README.CYGWIN</a> - Cygwin
145<li><a href="README.WIN32">README.WIN32</a> - Win32
146</ul>
Brian Paul7103a182012-04-19 09:56:36 -0600147
148
149
Andreas Boll210a27d2012-06-12 09:05:36 +0200150<h1 id="libs">5. Library Information</h1>
Brian Paul7103a182012-04-19 09:56:36 -0600151
152<p>
153When compilation has finished, look in the top-level <code>lib/</code>
154(or <code>lib64/</code>) directory.
155You'll see a set of library files similar to this:
156</p>
157<pre>
158lrwxrwxrwx 1 brian users 10 Mar 26 07:53 libGL.so -> libGL.so.1*
159lrwxrwxrwx 1 brian users 19 Mar 26 07:53 libGL.so.1 -> libGL.so.1.5.060100*
160-rwxr-xr-x 1 brian users 3375861 Mar 26 07:53 libGL.so.1.5.060100*
Brian Paul7103a182012-04-19 09:56:36 -0600161lrwxrwxrwx 1 brian users 14 Mar 26 07:53 libOSMesa.so -> libOSMesa.so.6*
162lrwxrwxrwx 1 brian users 23 Mar 26 07:53 libOSMesa.so.6 -> libOSMesa.so.6.1.060100*
163-rwxr-xr-x 1 brian users 23871 Mar 26 07:53 libOSMesa.so.6.1.060100*
164</pre>
165
166<p>
167<b>libGL</b> is the main OpenGL library (i.e. Mesa).
168<br>
Brian Paul7103a182012-04-19 09:56:36 -0600169<b>libOSMesa</b> is the OSMesa (Off-Screen) interface library.
170</p>
171
172<p>
173If you built the DRI hardware drivers, you'll also see the DRI drivers:
174</p>
175<pre>
176-rwxr-xr-x 1 brian users 16895413 Jul 21 12:11 i915_dri.so
177-rwxr-xr-x 1 brian users 16895413 Jul 21 12:11 i965_dri.so
178-rwxr-xr-x 1 brian users 11849858 Jul 21 12:12 r200_dri.so
179-rwxr-xr-x 1 brian users 16050488 Jul 21 12:11 r300_dri.so
180-rwxr-xr-x 1 brian users 11757388 Jul 21 12:12 radeon_dri.so
181</pre>
182
183<p>
184If you built with Gallium support, look in lib/gallium/ for Gallium-based
185versions of libGL and device drivers.
186</p>
187
188
Andreas Boll210a27d2012-06-12 09:05:36 +0200189<h1 id="pkg-config">6. Building OpenGL programs with pkg-config</h1>
Brian5bba58c2007-09-12 10:11:49 -0600190
191<p>
192Running <code>make install</code> will install package configuration files
193for the pkg-config utility.
194</p>
195
196<p>
197When compiling your OpenGL application you can use pkg-config to determine
198the proper compiler and linker flags.
199</p>
200
201<p>
202For example, compiling and linking a GLUT application can be done with:
203</p>
204<pre>
205 gcc `pkg-config --cflags --libs glut` mydemo.c -o mydemo
206</pre>
207
208<br>
Brian Paul5f37abf2003-09-05 14:47:07 +0000209
Andreas Bollb5da52a2012-09-18 18:57:02 +0200210</div>
Brian Paul0b27ace2003-03-08 17:38:57 +0000211</body>
212</html>