Clone of mesa.
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

install.html 8.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. <HTML>
  2. <TITLE>Compiling and Installing</TITLE>
  3. <link rel="stylesheet" type="text/css" href="mesa.css"></head>
  4. <BODY>
  5. <H1>Compiling and Installing</H1>
  6. <ol>
  7. <li><a href="#unix-x11">Unix / X11</a>
  8. <ul>
  9. <li><a href="#prereq-general">General prerequisites for building</a>
  10. <li><a href="#prereq-dri">Prerequisites for DRI and hardware acceleration</a>
  11. <li><a href="#autoconf">Building with autoconf</a>
  12. <li><a href="#traditional">Building with traditional Makefiles</a>
  13. <li><a href="#libs">The Libraries</a>
  14. <li><a href="#install">Installing the header and library files
  15. <li><a href="#pkg-config">Building OpenGL programs with pkg-config
  16. </ul>
  17. <li><a href="#windows">Windows</a>
  18. <li><a href="#scons">Building with SCons</a>
  19. <li><a href="#other">Other</a>
  20. </ol>
  21. <br>
  22. <a name="unix-x11">
  23. <H2>1. Unix/X11 Compilation and Installation</H1>
  24. <a name="prereq-general">
  25. <h3>1.1 General prerequisites for building</h3>
  26. <ul>
  27. <li>lex / yacc - for building the GLSL compiler.
  28. On Linux systems, flex and bison are used.
  29. Versions 2.5.35 and 2.4.1, respectively, (or later) should work.
  30. </li>
  31. <li>python - Python is needed for building the Gallium components.
  32. Version 2.6.4 or later should work.
  33. </li>
  34. </ul>
  35. <a name="prereq-dri">
  36. <h3>1.2 Prerequisites for DRI and hardware acceleration</h3>
  37. <p>
  38. The following are required for DRI-based hardware acceleration with Mesa:
  39. </p>
  40. <ul>
  41. <li><a href="http://xorg.freedesktop.org/releases/individual/proto/">dri2proto</a> version 1.99.3 or later
  42. <li>Linux 2.6.28
  43. <li><a href="http://dri.freedesktop.org/libdrm/" target="_parent">libDRM</a>
  44. version 2.4.15 or later
  45. <li>Xorg server version 1.5 or later
  46. </ul>
  47. </p>
  48. <a name="autoconf">
  49. <h3>1.3 Building with Autoconf</h3>
  50. <p>
  51. Mesa may be <a href="autoconf.html">built using autoconf</a>.
  52. This should work well on most GNU-based systems.
  53. If that fails the traditional Mesa build system is available.
  54. <a name="traditional">
  55. <h3>1.4 Building with traditional Makefiles</h3>
  56. <p>
  57. The traditional Mesa build system is based on a collection of pre-defined
  58. system configurations.
  59. </p>
  60. <p>
  61. To see the list of configurations, just type <code>make</code>.
  62. Then choose a configuration from the list and type <code>make</code>
  63. <em>configname</em>.
  64. </p>
  65. <p>
  66. Mesa may be built in several different ways using the predefined configurations:
  67. </p>
  68. <ul>
  69. <li><b><em>Stand-alone/Xlib mode</em></b> - Mesa will be compiled as
  70. a software renderer using Xlib to do all rendering.
  71. The libGL.so library will be a self-contained rendering library that will
  72. allow you to run OpenGL/GLX applications on any X server (regardless of
  73. whether it supports the GLX X server extension).
  74. You will <em>not</em> be able to use hardware 3D acceleration.
  75. <p>
  76. To compile stand-alone Mesa type <code>make</code> in the top-level directory.
  77. You'll see a list of supported system configurations.
  78. Choose one from the list (such as linux-x86), and type:
  79. </p>
  80. <pre>
  81. make linux-x86
  82. </pre>
  83. <p>This will produce libGL.so and several other libraries</p>
  84. </li>
  85. <li><b><em>DRI/accelerated</em></b> - The DRI hardware drivers for
  86. accelerated OpenGL rendering (for ATI, Intel, Matrox, etc) will be built.
  87. The libGL.so library will support the GLX extension and will load/use
  88. the DRI hardware drivers.
  89. <p>
  90. Build Mesa and the DRI hardware drivers by running
  91. </p>
  92. <pre>
  93. make linux-dri
  94. </pre>
  95. <p>
  96. There are also <code>linux-dri-x86</code>, <code>linux-dri-x86-64</code>,
  97. and <code>linux-ppc</code> configurations which are optimized for those
  98. architectures.
  99. </p>
  100. <p>
  101. Make sure you have the prerequisite versions of DRM and Xserver mentioned
  102. above.
  103. </p>
  104. </li>
  105. </ul>
  106. <p>
  107. Later, if you want to rebuild for a different configuration run
  108. <code>make realclean</code> before rebuilding.
  109. </p>
  110. <a name="libs">
  111. <h3>1.5 The libraries</h3>
  112. <p>
  113. When compilation has finished, look in the top-level <code>lib/</code>
  114. (or <code>lib64/</code>) directory.
  115. You'll see a set of library files similar to this:
  116. </p>
  117. <pre>
  118. lrwxrwxrwx 1 brian users 10 Mar 26 07:53 libGL.so -> libGL.so.1*
  119. lrwxrwxrwx 1 brian users 19 Mar 26 07:53 libGL.so.1 -> libGL.so.1.5.060100*
  120. -rwxr-xr-x 1 brian users 3375861 Mar 26 07:53 libGL.so.1.5.060100*
  121. lrwxrwxrwx 1 brian users 11 Mar 26 07:53 libGLU.so -> libGLU.so.1*
  122. lrwxrwxrwx 1 brian users 20 Mar 26 07:53 libGLU.so.1 -> libGLU.so.1.3.060100*
  123. -rwxr-xr-x 1 brian users 549269 Mar 26 07:53 libGLU.so.1.3.060100*
  124. lrwxrwxrwx 1 brian users 12 Mar 26 07:53 libglut.so -> libglut.so.3*
  125. lrwxrwxrwx 1 brian users 16 Mar 26 07:53 libglut.so.3 -> libglut.so.3.7.1*
  126. -rwxr-xr-x 1 brian users 597754 Mar 26 07:53 libglut.so.3.7.1*
  127. lrwxrwxrwx 1 brian users 14 Mar 26 07:53 libOSMesa.so -> libOSMesa.so.6*
  128. lrwxrwxrwx 1 brian users 23 Mar 26 07:53 libOSMesa.so.6 -> libOSMesa.so.6.1.060100*
  129. -rwxr-xr-x 1 brian users 23871 Mar 26 07:53 libOSMesa.so.6.1.060100*
  130. </pre>
  131. <p>
  132. <b>libGL</b> is the main OpenGL library (i.e. Mesa).
  133. <br>
  134. <b>libGLU</b> is the OpenGL Utility library.
  135. <br>
  136. <b>libglut</b> is the GLUT library.
  137. <br>
  138. <b>libOSMesa</b> is the OSMesa (Off-Screen) interface library.
  139. </p>
  140. <p>
  141. If you built the DRI hardware drivers, you'll also see the DRI drivers:
  142. </p>
  143. <pre>
  144. -rwxr-xr-x 1 brian users 16895413 Jul 21 12:11 i915_dri.so
  145. -rwxr-xr-x 1 brian users 11849858 Jul 21 12:12 r200_dri.so
  146. -rwxr-xr-x 1 brian users 16050488 Jul 21 12:11 r300_dri.so
  147. -rwxr-xr-x 1 brian users 11757388 Jul 21 12:12 radeon_dri.so
  148. </pre>
  149. <p>
  150. If you built with Gallium support, look in lib/gallium/ for Gallium-based
  151. versions of libGL and device drivers.
  152. </p>
  153. <a name="install">
  154. <H3>1.6 Installing the header and library files</H3>
  155. <p>
  156. The standard location for the OpenGL header files on Unix-type systems is
  157. in <code>/usr/include/GL/</code>.
  158. The standard location for the libraries is <code>/usr/lib/</code>.
  159. For more information see, the
  160. <a href="http://oss.sgi.com/projects/ogl-sample/ABI/" target="_parent">
  161. Linux/OpenGL ABI specification</a>.
  162. </p>
  163. <p>
  164. If you'd like Mesa to co-exist with another implementation of OpenGL that's
  165. already installed, you'll have to choose different directories, like
  166. <code>/usr/local/include/GL/</code> and <code>/usr/local/lib/</code>.
  167. </p>
  168. <p>
  169. To install Mesa's headers and libraries, run <code>make install</code>.
  170. But first, check the Mesa/configs/default file and examine the values
  171. of the <b>INSTALL_DIR</b> and <b>DRI_DRIVER_INSTALL_DIR</b> variables.
  172. Change them if needed, then run <code>make install</code>.
  173. </p>
  174. <p>
  175. The variable
  176. <b>DESTDIR</b> may also be used to install the contents to a temporary
  177. staging directory.
  178. This can be useful for package management.
  179. For example: <code>make install DESTDIR=/somepath/</code>
  180. </p>
  181. <p>
  182. Note: at runtime you can use the LD_LIBRARY_PATH environment variable
  183. (on Linux at least) to switch
  184. between the Mesa libraries and other vendor's libraries whenever you want.
  185. This is a handy way to compare multiple OpenGL implementations.
  186. </p>
  187. <a name="pkg-config">
  188. <H3>1.7 Building OpenGL programs with pkg-config</H3>
  189. <p>
  190. Running <code>make install</code> will install package configuration files
  191. for the pkg-config utility.
  192. </p>
  193. <p>
  194. When compiling your OpenGL application you can use pkg-config to determine
  195. the proper compiler and linker flags.
  196. </p>
  197. <p>
  198. For example, compiling and linking a GLUT application can be done with:
  199. </p>
  200. <pre>
  201. gcc `pkg-config --cflags --libs glut` mydemo.c -o mydemo
  202. </pre>
  203. <br>
  204. <a name="windows">
  205. <H2>2. Windows Compilation and Installation</H1>
  206. <p>
  207. Please see the <a href="#scons">instructions on building with SCons</a>.
  208. </p>
  209. <a name="scons">
  210. <H2>3. Building with SCons</H1>
  211. <p>
  212. To build Mesa with SCons on Linux or Windows do
  213. </p>
  214. <pre>
  215. scons
  216. </pre>
  217. <p>
  218. The build output will be placed in
  219. build/<i>platform</i>-<i>machine</i>-<i>debug</i>/..., where <i>platform</i> is for
  220. example linux or windows, <i>machine</i> is x86 or x86_64, optionally followed
  221. by -debug for debug builds.
  222. </p>
  223. <p>
  224. To build Mesa with SCons for Windows on Linux using the MinGW crosscompiler toolchain do
  225. </p>
  226. <pre>
  227. scons platform=windows toolchain=crossmingw machine=x86 mesagdi libgl-gdi
  228. </pre>
  229. <p>
  230. This will create:
  231. </p>
  232. <ul>
  233. <li>build/windows-x86-debug/mesa/drivers/windows/gdi/opengl32.dll &mdash; Mesa + swrast, binary compatible with Windows's opengl32.dll
  234. <li>build/windows-x86-debug/gallium/targets/libgl-gdi/opengl32.dll &mdash; Mesa + Gallium + softpipe, binary compatible with Windows's opengl32.dll
  235. </ul>
  236. <p>
  237. Put them all in the same directory to test them.
  238. </p>
  239. <a name="other">
  240. <H2>4. Other systems</H1>
  241. <p>
  242. Documentation for other environments (some may be very out of date):
  243. </p>
  244. <UL>
  245. <li><A HREF="README.VMS">README.VMS</A> - VMS
  246. <LI><A HREF="README.CYGWIN">README.CYGWIN</A> - Cygwin
  247. <LI><A HREF="README.WIN32">README.WIN32</A> - Win32
  248. </UL>
  249. </body>
  250. </html>