INSTALL-MK 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. ///////////////////////////////////////////////////////////////////////
  2. // Caution: there are two separate, independent build systems:
  3. // 'makepanda', and 'ppremake'. Use one or the other, do not attempt
  4. // to use both. This file is part of the 'makepanda' system.
  5. ///////////////////////////////////////////////////////////////////////
  6. Panda3D Install --- using the 'makepanda' system.
  7. MAKE SURE YOU HAVE ALL OF THE SOURCE CODE
  8. The easiest way to download the source for panda is to download the
  9. "source package" from the panda3d website. If you downloaded a file
  10. labeled "source package", then you have everything you need. Skip to
  11. the next section.
  12. Alternately, it is possible to download the source in pieces. There
  13. are three pieces:
  14. 1. Source code from Sourceforge.
  15. 2. Third-party tools.
  16. 3. Sample programs.
  17. You will need all three to use makepanda. You can download all three
  18. pieces from the panda website. Look for the files labeled "Panda3D
  19. source, piecewise, X of 3". You can also obtain the first piece
  20. directly from the sourceforge CVS server:
  21. CVSROOT=:pserver:[email protected]:/cvsroot/panda3d
  22. Make sure you have all three pieces. If you do, then your panda
  23. directory will contain the following subdirectories:
  24. direct - piece 1, source code from sourceforge
  25. dmodels - piece 1, source code from sourceforge
  26. doc - piece 1, source code from sourceforge
  27. dtool - piece 1, source code from sourceforge
  28. Makefile - piece 1, source code from sourceforge
  29. makepanda - piece 1, source code from sourceforge
  30. models - piece 1, source code from sourceforge
  31. panda - piece 1, source code from sourceforge
  32. pandatool - piece 1, source code from sourceforge
  33. ppremake - piece 1, source code from sourceforge
  34. contrib - piece 1, source code from sourceforge
  35. thirdparty - piece 2, third party tools
  36. samples - piece 3, sample programs
  37. If you have all of these, you're ready to go. If not, then you
  38. must have missed a piece.
  39. INVOKING MAKEPANDA
  40. Makepanda is a script that builds panda, all the way through. To
  41. invoke it under windows, change directory to the root of the panda
  42. source tree and type this:
  43. makepanda\makepanda.bat
  44. To invoke it under Linux or OSX, change directory to the root of
  45. the panda source tree and type this:
  46. makepanda/makepanda.py
  47. From this point forward, I will not be including the directory name or
  48. the extension in my examples. I will simply assume that you know to
  49. add the correct extension as demanded by your operating system.
  50. BUILDING PANDA: QUICK START
  51. The easy way to build panda is to type:
  52. makepanda --everything
  53. This will compile panda with all the features. It can take several
  54. hours, depending on the speed of your machine.
  55. The resulting copy of panda will be found in a subdirectory 'built'
  56. inside the source tree.
  57. TESTING THE COMPILED PANDA
  58. After building panda, you should test it before installing it.
  59. The first step is to add the built/bin directory to your PATH. This
  60. is not strictly necessary, you can run the panda programs by typing
  61. their paths explicitly, but it is much more convenient to set the
  62. PATH.
  63. Second, add the built/lib directory to your LD_LIBRARY_PATH. This is
  64. only necessary under Linux - Windows takes care of this automatically.
  65. It is also possible to use the system ld.so.conf configuration file to
  66. achieve the same effect, but LD_LIBRARY_PATH is more convenient for
  67. quick-and-dirty testing.
  68. Finally, change directory to one of the sample programs, and run the
  69. sample program using 'ppython'. For example,
  70. cd samples/Feature-Tutorials--Actors
  71. ppython Tut-Actors.py
  72. If this doesn't work, something is wrong, and there's no reason
  73. to continue with the installation process.
  74. INSTALLING PANDA
  75. If you are using Windows, OSX or Linux distribution that supports DEB or
  76. RPM packages, the recommended way to install Panda3D is to run makepanda
  77. with the --installer option and then install the resulting .exe, .deb, .rpm
  78. or .dmg package. This is a safe solution that makes sure all the files are
  79. installed in the correct places and all the paths are configured correctly.
  80. More information can be found below.
  81. If you want to install Panda3D manually, however, the first step is to
  82. copy 'samples' into the built subdirectory, and 'direct/src' into
  83. 'built/direct/src'. Then, move the built directory anywhere you like
  84. on your system. For example, Linux users might want to do this:
  85. cp --recursive samples built/samples
  86. cp --recursive direct/src built/direct/src
  87. mv built /usr/local/panda3d
  88. Windows users might want to do this:
  89. xcopy /IE samples built\samples
  90. xcopy /IE direct\src built\direct\src
  91. move built c:\Panda3D
  92. Then, add the panda bin directory to your PATH. Under Linux, it is
  93. also necessary to add the panda lib directory to the system library
  94. path. It is usually possible to do so by editing the
  95. file /etc/ld.so.conf.
  96. INSTALLATION AND THE UNIX STANDARD FILESYSTEM LAYOUT
  97. The installation instructions above will produce a fully-functional
  98. installation of panda with a minimum number of steps. However, the
  99. installation will not conform to the Unix standards for filesystem
  100. layout.
  101. If you want a conformant installation, the most sensible approach is
  102. to build a redhat RPM, debian DEB or MacOSX DMG, and then install
  103. the package. The installation process will distribute the files
  104. properly. Instructions for building a package can be found below.
  105. MAKEPANDA COMMAND-LINE OPTIONS
  106. The default invocation of makepanda is a good way to test panda on
  107. your machine. However, it compiles several features that you probably
  108. don't need. To disable the extra features, you need to specify
  109. command-line options to makepanda. If you invoke:
  110. makepanda --help
  111. it will show you the available command-line options:
  112. --help (print the help message you're reading now)
  113. --optimize X (optimization level can be 1,2,3,4)
  114. --installer (build an installer)
  115. --version (set the panda version number)
  116. --lzma (use lzma compression when building installer)
  117. --threads N (use the multithreaded build system. see manual)
  118. --use-maya6 --no-maya6 (enable/disable use of MAYA6)
  119. --use-maya65 --no-maya65 (enable/disable use of MAYA65)
  120. --use-maya7 --no-maya7 (enable/disable use of MAYA7)
  121. --use-maya8 --no-maya8 (enable/disable use of MAYA8)
  122. --use-maya85 --no-maya85 (enable/disable use of MAYA85)
  123. --use-maya2008 --no-maya2008 (enable/disable use of MAYA2008)
  124. --use-max6 --no-max6 (enable/disable use of MAX6)
  125. --use-max7 --no-max7 (enable/disable use of MAX7)
  126. --use-max8 --no-max8 (enable/disable use of MAX8)
  127. --use-max9 --no-max9 (enable/disable use of MAX9)
  128. --use-max2009 --no-max2009 (enable/disable use of MAX2009)
  129. --use-dx8 --no-dx8 (enable/disable use of DX8)
  130. --use-dx9 --no-dx9 (enable/disable use of DX9)
  131. --use-python --no-python (enable/disable use of PYTHON)
  132. --use-zlib --no-zlib (enable/disable use of ZLIB)
  133. --use-png --no-png (enable/disable use of PNG)
  134. --use-jpeg --no-jpeg (enable/disable use of JPEG)
  135. --use-tiff --no-tiff (enable/disable use of TIFF)
  136. --use-vrpn --no-vrpn (enable/disable use of VRPN)
  137. --use-fmod --no-fmod (enable/disable use of FMOD)
  138. --use-fmodex --no-fmodex (enable/disable use of FMODEX)
  139. --use-openal --no-openal (enable/disable use of OPENAL)
  140. --use-nvidiacg --no-nvidiacg (enable/disable use of NVIDIACG)
  141. --use-openssl --no-openssl (enable/disable use of OPENSSL)
  142. --use-freetype --no-freetype (enable/disable use of FREETYPE)
  143. --use-fftw --no-fftw (enable/disable use of FFTW)
  144. --use-artoolkit --no-artoolkit (enable/disable use of ARTOOLKIT)
  145. --use-ode --no-ode (enable/disable use of ODE)
  146. --use-directcam --no-directcam (enable/disable use of DIRECTCAM)
  147. --use-opencv --no-opencv (enable/disable use of OPENCV)
  148. --use-ffmpeg --no-ffmpeg (enable/disable use of FFMPEG)
  149. --use-pandatool --no-pandatool (enable/disable use of PANDATOOL)
  150. --nothing (disable every third-party lib)
  151. --everything (enable every third-party lib)
  152. Makepanda shows you all the available options, not all of which may be
  153. relevant to your operating system. For example, makepanda can build a
  154. plugin for 3D Studio Max. However, there is no 3D Studio Max for
  155. Linux, so the options --use-max# are irrelevant under Linux.
  156. SELECTING PANDA FEATURES
  157. Panda contains a large number of optional features. For example, if
  158. panda is compiled with PNG support, then panda will be able to load
  159. textures from PNG image files.
  160. Some of these features require the use of bulky third-party libraries.
  161. For example, 'helix' is a streaming video library from real networks.
  162. If you do not plan on using streaming video in your 3D world, then
  163. you may be interested in compiling panda without helix. This will
  164. shave several megabytes off of the panda libraries.
  165. To select panda features, you need to specify one of two different
  166. command-line options:
  167. makepanda --everything
  168. makepanda --nothing
  169. You can follow either of these with a list of specific exceptions.
  170. For example, you can say:
  171. makepanda --everything --no-helix --no-openssl
  172. makepanda --nothing --use-zlib --use-png
  173. Note that 'makepanda' is a new tool. The panda3d team has not had
  174. time to test every combination of options. It is likely that most
  175. combinations do not work. The only combination we can vouch for at
  176. this time is '--everything'. In the next release, we hope to be able
  177. to vouch for a large number of different combinations.
  178. USING YOUR OWN LIBRARIES
  179. Panda3D uses a number of third-party libraries: libpng, libjpeg,
  180. openssl, etc. If you are using a Unix variant, many of these
  181. libraries come with the operating system. Panda3D will use these
  182. OS-supplied libraries where possible, so if your OS comes with a copy
  183. of libpng, Panda3D uses that.
  184. For convenience, the panda source distribution includes precompiled
  185. copies of many of the third-party libraries. You will find these
  186. libraries in a subdirectory labeled 'thirdparty'. If you are happy
  187. with the versions we have provided, then you don't need to do anything
  188. special.
  189. If you are not satisfied with the versions of the libraries we have
  190. provided, you may supply your own versions. To do so, duplicate the
  191. 'thirdparty' tree, substitute your own libraries, and then use
  192. the --thirdparty option to point makepanda to your libraries.
  193. THE EDIT-COMPILE-DEBUG CYCLE
  194. A small caution: if you invoke 'makepanda' with one set of options,
  195. and then invoke 'makepanda' using the exact same set of options, the
  196. second time will be fast. It will see that everything has already
  197. been built, and it will do no actual compilation. As a result,
  198. makepanda can be used as part of an edit-compile-debug cycle.
  199. However, if you invoke makepanda with a *different* set of options,
  200. makepanda may need to recompile and relink a lot of files. This is
  201. because several of those options change the values of '#define'
  202. headers, so changing the options requires a recompilation.
  203. It is all too easy to accidentally invoke 'makepanda' with the wrong
  204. options, thereby triggering an hour-long recompilation. To avoid this
  205. situation, we recommend that you write a short script containing the
  206. options you intend to use regularly. For example, I regularly compile
  207. panda without helix. I have a very short Windows BAT file called
  208. "mkp.bat" that looks like this:
  209. @echo off
  210. makepanda --everything --no-helix
  211. This helps me avoid accidentally typing makepanda with the wrong
  212. options.
  213. BUILDING A WINDOWS INSTALLER
  214. Under Windows, makepanda can create an executable installer. All you
  215. need to do is pass the --installer option to makepanda. The makepanda
  216. option --lzma will cause the installer to be compressed with LZMA
  217. compression, which is better, but it takes a long time to do the
  218. compression.
  219. BUILDING A LINUX DEB OR RPM PACKAGE
  220. Under Linux, passing the --installer option to makepanda will
  221. cause makepanda to try to build a deb or rpm package. For this to
  222. work, you have to be using a Linux distribution that includes either
  223. the dpkg-deb or rpmbuild binary.
  224. BUILDING A MACOSX DMG PACKAGE
  225. Under Mac OSX, you can also use the --installer option, which will
  226. generate a .dmg archive containing the Panda3D installation, which
  227. needs to be placed in your /Applications/ directory.
  228. The .dmg also contains a shell script that automatically sets up the
  229. library and python search paths in your .bash_profile file so you don't
  230. have to do that yourself every time you want to use Panda3D.