Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

install.html 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  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">Prerequisites for DRI and hardware acceleration</a>
  10. <li><a href="#autoconf">Building with autoconf</a>
  11. <li><a href="#traditional">Building with traditional Makefiles</a>
  12. <li><a href="#libs">The Libraries</a>
  13. <li><a href="#demos">Running the demos
  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="#other">Other</a>
  19. </ol>
  20. <br>
  21. <a name="unix-x11">
  22. <H2>1. Unix/X11 Compilation and Installation</H1>
  23. <a name="prereq">
  24. <h3>1.1 Prerequisites for DRI and hardware acceleration</h3>
  25. <p>
  26. The following are required for DRI-based hardware acceleration with Mesa 7.3:
  27. </p>
  28. <ul>
  29. <li><a href="http://xorg.freedesktop.org/releases/individual/proto/">dri2proto</a> version 1.99.3 or later
  30. <li>Linux 2.6.28
  31. <li><a href="http://dri.freedesktop.org/libdrm/" target="_parent">libDRM</a>
  32. version 2.4.3 or later
  33. <li>Xorg server version 1.5 or later
  34. </ul>
  35. </p>
  36. <a name="autoconf">
  37. <h3>1.2 Building with Autoconf</h3>
  38. <p>
  39. Mesa may be <a href="autoconf.html">built using autoconf</a>.
  40. This should work well on most GNU-based systems.
  41. If that fails the traditional Mesa build system is available.
  42. <a name="traditional">
  43. <h3>1.3 Building with traditional Makefiles</h3>
  44. <p>
  45. The traditional Mesa build system is based on a collection of pre-defined
  46. system configurations.
  47. </p>
  48. <p>
  49. To see the list of configurations, just type <code>make</code>.
  50. Then choose a configuration from the list and type <code>make</code>
  51. <em>configname</em>.
  52. </p>
  53. <p>
  54. Mesa may be built in several different ways using the predefined configurations:
  55. </p>
  56. <ul>
  57. <li><b><em>Stand-alone/Xlib mode</em></b> - Mesa will be compiled as
  58. a software renderer using Xlib to do all rendering.
  59. The libGL.so library will be a self-contained rendering library that will
  60. allow you to run OpenGL/GLX applications on any X server (regardless of
  61. whether it supports the GLX X server extension).
  62. You will <em>not</em> be able to use hardware 3D acceleration.
  63. <p>
  64. To compile stand-alone Mesa type <code>make</code> in the top-level directory.
  65. You'll see a list of supported system configurations.
  66. Choose one from the list (such as linux-x86), and type:
  67. </p>
  68. <pre>
  69. make linux-x86
  70. </pre>
  71. <p>This will produce libGL.so and several other libraries</p>
  72. </li>
  73. <li><b><em>DRI/accelerated</em></b> - The DRI hardware drivers for
  74. accelerated OpenGL rendering (for ATI, Intel, Matrox, etc) will be built.
  75. The libGL.so library will support the GLX extension and will load/use
  76. the DRI hardware drivers.
  77. <p>
  78. Build Mesa and the DRI hardware drivers by running
  79. </p>
  80. <pre>
  81. make linux-dri
  82. </pre>
  83. <p>
  84. There are also <code>linux-dri-x86</code>, <code>linux-dri-x86-64</code>,
  85. and <code>linux-ppc</code> configurations which are optimized for those
  86. architectures.
  87. </p>
  88. <p>
  89. Make sure you have the prerequisite versions of DRM and Xserver mentioned
  90. above.
  91. </p>
  92. </li>
  93. </ul>
  94. <p>
  95. Later, if you want to rebuild for a different configuration run
  96. <code>make realclean</code> before rebuilding.
  97. </p>
  98. <a name="libs">
  99. <h3>1.4 The libraries</h3>
  100. <p>
  101. When compilation has finished, look in the top-level <code>lib/</code>
  102. (or <code>lib64/</code>) directory.
  103. You'll see a set of library files similar to this:
  104. </p>
  105. <pre>
  106. lrwxrwxrwx 1 brian users 10 Mar 26 07:53 libGL.so -> libGL.so.1*
  107. lrwxrwxrwx 1 brian users 19 Mar 26 07:53 libGL.so.1 -> libGL.so.1.5.060100*
  108. -rwxr-xr-x 1 brian users 3375861 Mar 26 07:53 libGL.so.1.5.060100*
  109. lrwxrwxrwx 1 brian users 11 Mar 26 07:53 libGLU.so -> libGLU.so.1*
  110. lrwxrwxrwx 1 brian users 20 Mar 26 07:53 libGLU.so.1 -> libGLU.so.1.3.060100*
  111. -rwxr-xr-x 1 brian users 549269 Mar 26 07:53 libGLU.so.1.3.060100*
  112. lrwxrwxrwx 1 brian users 12 Mar 26 07:53 libglut.so -> libglut.so.3*
  113. lrwxrwxrwx 1 brian users 16 Mar 26 07:53 libglut.so.3 -> libglut.so.3.7.1*
  114. -rwxr-xr-x 1 brian users 597754 Mar 26 07:53 libglut.so.3.7.1*
  115. lrwxrwxrwx 1 brian users 11 Mar 26 08:04 libGLw.so -> libGLw.so.1*
  116. lrwxrwxrwx 1 brian users 15 Mar 26 08:04 libGLw.so.1 -> libGLw.so.1.0.0*
  117. -rwxr-xr-x 1 brian users 20750 Mar 26 08:04 libGLw.so.1.0.0*
  118. lrwxrwxrwx 1 brian users 14 Mar 26 07:53 libOSMesa.so -> libOSMesa.so.6*
  119. lrwxrwxrwx 1 brian users 23 Mar 26 07:53 libOSMesa.so.6 -> libOSMesa.so.6.1.060100*
  120. -rwxr-xr-x 1 brian users 23871 Mar 26 07:53 libOSMesa.so.6.1.060100*
  121. </pre>
  122. <p>
  123. <b>libGL</b> is the main OpenGL library (i.e. Mesa).
  124. <br>
  125. <b>libGLU</b> is the OpenGL Utility library.
  126. <br>
  127. <b>libglut</b> is the GLUT library.
  128. <br>
  129. <b>libGLw</b> is the Xt/Motif OpenGL drawing area widget library.
  130. <br>
  131. <b>libOSMesa</b> is the OSMesa (Off-Screen) interface library.
  132. </p>
  133. <p>
  134. If you built the DRI hardware drivers, you'll also see the DRI drivers:
  135. </p>
  136. <pre>
  137. -rwxr-xr-x 1 brian users 15607851 Jul 21 12:11 ffb_dri.so
  138. -rwxr-xr-x 1 brian users 15148747 Jul 21 12:11 i810_dri.so
  139. -rwxr-xr-x 1 brian users 14497814 Jul 21 12:11 i830_dri.so
  140. -rwxr-xr-x 1 brian users 16895413 Jul 21 12:11 i915_dri.so
  141. -rwxr-xr-x 1 brian users 11320803 Jul 21 12:11 mach64_dri.so
  142. -rwxr-xr-x 1 brian users 11418014 Jul 21 12:12 mga_dri.so
  143. -rwxr-xr-x 1 brian users 11064426 Jul 21 12:12 r128_dri.so
  144. -rwxr-xr-x 1 brian users 11849858 Jul 21 12:12 r200_dri.so
  145. -rwxr-xr-x 1 brian users 16050488 Jul 21 12:11 r300_dri.so
  146. -rwxr-xr-x 1 brian users 11757388 Jul 21 12:12 radeon_dri.so
  147. -rwxr-xr-x 1 brian users 11232304 Jul 21 12:13 s3v_dri.so
  148. -rwxr-xr-x 1 brian users 11062970 Jul 21 12:13 savage_dri.so
  149. -rwxr-xr-x 1 brian users 11214212 Jul 21 12:13 sis_dri.so
  150. -rwxr-xr-x 1 brian users 11368736 Jul 21 12:13 tdfx_dri.so
  151. -rwxr-xr-x 1 brian users 10598868 Jul 21 12:13 trident_dri.so
  152. -rwxr-xr-x 1 brian users 10997120 Jul 21 12:13 unichrome_dri.so
  153. </pre>
  154. <a name="demos">
  155. <h3>1.5 Running the demos</h3>
  156. <p>
  157. If you downloaded/unpacked the MesaDemos-x.y.z.tar.gz archive or
  158. obtained Mesa from CVS, the <b>progs/</b> directory will contain a
  159. bunch of demonstration programs.
  160. </p>
  161. <p>
  162. Before running a demo, you'll probably have to set two environment variables
  163. to indicate where the libraries are located. For example:
  164. <p>
  165. <blockquote>
  166. <b>cd lib/</b>
  167. <br>
  168. <b>export LD_LIBRARY_PATH=${PWD}</b>
  169. <br>
  170. <b>export LIBGL_DRIVERS_PATH=${PWD}</b> (if using DRI drivers)
  171. </blockquote>
  172. <p>
  173. Next, change to the Mesa/demos/ directory:
  174. </p>
  175. <blockquote>
  176. <b>cd ../progs/demos</b>
  177. </blockquote>
  178. <p>
  179. Run a demo such as gears:
  180. </p>
  181. <blockquote>
  182. <b>./gears</b>
  183. </blockquote>
  184. <p>
  185. If this doesn't work, try the <b>Mesa/progs/xdemos/glxinfo</b> program
  186. and see that it prints the expected Mesa version number.
  187. </p>
  188. <p>
  189. If you're using Linux or a similar OS, verify that the demo program is
  190. being linked with the proper library files:
  191. </p>
  192. <blockquote>
  193. <b>ldd gears</b>
  194. </blockquote>
  195. <p>
  196. You should see something like this:
  197. </p>
  198. <pre>
  199. libglut.so.3 => /home/brian/Mesa/lib/libglut.so.3 (0x40013000)
  200. libGLU.so.1 => /home/brian/Mesa/lib/libGLU.so.1 (0x40051000)
  201. libGL.so.1 => /home/brian/Mesa/lib/libGL.so.1 (0x400e0000)
  202. libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
  203. libm.so.6 => /lib/i686/libm.so.6 (0x403da000)
  204. libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x403fc000)
  205. libXmu.so.6 => /usr/X11R6/lib/libXmu.so.6 (0x404da000)
  206. libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x404f1000)
  207. libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x40543000)
  208. libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x4054b000)
  209. libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x405fd000)
  210. libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x40605000)
  211. libpthread.so.0 => /lib/i686/libpthread.so.0 (0x40613000)
  212. /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
  213. libdl.so.2 => /lib/libdl.so.2 (0x40644000)
  214. libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x40647000)
  215. libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x40650000)
  216. </pre>
  217. <p>
  218. Retrace your steps if this doesn't look right.
  219. </p>
  220. <a name="install">
  221. <H3>1.6 Installing the header and library files</H3>
  222. <p>
  223. The standard location for the OpenGL header files on Unix-type systems is
  224. in <code>/usr/include/GL/</code>.
  225. The standard location for the libraries is <code>/usr/lib/</code>.
  226. For more information see, the
  227. <a href="http://oss.sgi.com/projects/ogl-sample/ABI/" target="_parent">
  228. Linux/OpenGL ABI specification</a>.
  229. </p>
  230. <p>
  231. If you'd like Mesa to co-exist with another implementation of OpenGL that's
  232. already installed, you'll have to choose different directories, like
  233. <code>/usr/local/include/GL/</code> and <code>/usr/local/lib/</code>.
  234. </p>
  235. <p>
  236. To install Mesa's headers and libraries, run <code>make install</code>.
  237. But first, check the Mesa/configs/default file and examine the values
  238. of the <b>INSTALL_DIR</b> and <b>DRI_DRIVER_INSTALL_DIR</b> variables.
  239. Change them if needed, then run <code>make install</code>.
  240. </p>
  241. <p>
  242. The variable
  243. <b>DESTDIR</b> may also be used to install the contents to a temporary
  244. staging directory.
  245. This can be useful for package management.
  246. For example: <code>make install DESTDIR=/somepath/</code>
  247. </p>
  248. <p>
  249. Note: at runtime you can use the LD_LIBRARY_PATH environment variable
  250. (on Linux at least) to switch
  251. between the Mesa libraries and other vendor's libraries whenever you want.
  252. This is a handy way to compare multiple OpenGL implementations.
  253. </p>
  254. <a name="pkg-config">
  255. <H3>1.7 Building OpenGL programs with pkg-config</H3>
  256. <p>
  257. Running <code>make install</code> will install package configuration files
  258. for the pkg-config utility.
  259. </p>
  260. <p>
  261. When compiling your OpenGL application you can use pkg-config to determine
  262. the proper compiler and linker flags.
  263. </p>
  264. <p>
  265. For example, compiling and linking a GLUT application can be done with:
  266. </p>
  267. <pre>
  268. gcc `pkg-config --cflags --libs glut` mydemo.c -o mydemo
  269. </pre>
  270. <br>
  271. <a name="windows">
  272. <H2>2. Windows Compilation and Installation</H1>
  273. <p>
  274. Please see the <a href="README.WIN32">README.WIN32</a> file.
  275. </p>
  276. <a name="other">
  277. <H2>3. Other systems</H1>
  278. <p>
  279. Documentation for other environments (some may be very out of date):
  280. </p>
  281. <UL>
  282. <li><A HREF="README.VMS">README.VMS</A> - VMS
  283. <LI><A HREF="README.GGI">README.GGI</A> - GGI
  284. <LI><A HREF="README.3DFX">README.3DFX</A> - 3Dfx/Glide driver
  285. <LI><A HREF="README.AMIWIN">README.AMIWIN</A> - Amiga Amiwin
  286. <LI><A HREF="README.BEOS">README.BEOS</A> - BeOS
  287. <LI><A HREF="README.D3D">README.D3D</A> - Direct3D driver
  288. <LI><A HREF="README.DJ">README.DJ</A> - DJGPP
  289. <LI><A HREF="README.LYNXOS">README.LYNXOS</A> - LynxOS
  290. <LI><A HREF="README.MINGW32">README.MINGW32</A> - Mingw32
  291. <LI><A HREF="README.NeXT">README.NeXT</A> - NeXT
  292. <LI><A HREF="README.OpenStep">README.OpenStep</A> - OpenStep
  293. <LI><A HREF="README.OS2">README.OS2</A> - OS/2
  294. <LI><A HREF="README.WINDML">README.WINDML</A> - WindML
  295. </UL>
  296. </body>
  297. </html>