@@ -156,7 +156,8 @@ before it. The packages are, in order:
156156 support libraries (like HTTPClient) that Panda provides. At the
157157 moment, most people probably won't find anything useful here, but
158158 you're welcome to browse; and we will probably add more
159- applications later.
159+ applications later. You must build and install dtool, panda, anda
160+ pandatool before you can build pandaapp.
160161
161162In graphical form, here are the packages along with a few extras:
162163
@@ -208,65 +209,83 @@ platforms easily.
208209HOW TO CONFIGURE PANDA FOR YOUR ENVIRONMENT
209210
210211When you run ppremake within a Panda source tree, it reads in a number
211- of configure variable definitions given in the file Config.pp in the
212- root of the dtool package. Many of these variables will already have
213- definitions that are sensible for you; some will not. You must
214- customize these variables before you run ppremake.
212+ of configuration variable definitions given in the file Config.pp in
213+ the root of the dtool package, as well as in a custom Config.pp file
214+ that you specify. Many of the variables in dtool/Config.pp will
215+ already have definitions that are sensible for you; some will not.
216+ You must customize these variables before you run ppremake.
215217
216218Normally, rather than modifying dtool/Config.pp directly, you should
217- create your own, empty Config.pp file. By default, this file will be
218- found in the root of the Panda install directory, but you may put it
219- elsewhere if you prefer by setting the environment variable
220- PPREMAKE_CONFIG to its full filename path (more on this in the
221- platform-specific installation notes, below).
219+ create your own, empty Config.pp file. By default, this file should
220+ be stored in the root of the Panda install directory, as specified
221+ when you built ppremake, but you may put it elsewhere if you prefer by
222+ setting the environment variable PPREMAKE_CONFIG to its full filename
223+ path (more on this in the platform-specific installation notes,
224+ below).
222225
223226The definitions you give in your personal Config.pp file will override
224- those in the source directory . It is also possible simply to modify
225- dtool/Config.pp, but this is not recommended as it makes it difficult
226- to remember which customizations you have made, and makes installing
227- updated versions of Panda problematic.
227+ those given in the file within dtool . It is also possible simply to
228+ modify dtool/Config.pp, but this is not recommended as it makes it
229+ difficult to remember which customizations you have made, and makes
230+ installing updated versions of Panda problematic.
228231
229232The syntax of the Config.pp file is something like a cross between the
230- C preprocessor and Makefile syntax. The full syntax of ppremake
231- input scripts is described in more detail in another document, but the
232- most common thing you will need to do is set the value of a variable
233- using the #define statement. Look in dtool/Config.pp for numerous
234- examples of this.
233+ C preprocessor and Makefile syntax. The full syntax of ppremake input
234+ scripts is described in more detail in another document, but the most
235+ common thing you will need to do is set the value of a variable using
236+ the #define statement (or the mostly equivalent #defer statement).
237+ Look in dtool/Config.pp for numerous examples of this.
235238
236239Some of the variables you may define within the Config.pp file hold a
237240true or a false value by nature. It is important to note that you
238241indicate a variable is true by defining it to some nonempty string
239242(e.g. "yes" or "1"), and false by defining it to nothing. For
240243example:
244+
241245 #define HAVE_DX 1
246+
242247Indicates you have the DirectX SDK installed, while
248+
243249 #define HAVE_DX
244- Indicates you do not. Do not be tempted to define HAVE_DX to "no" or
245- "0"; since these are both nonempty strings, they are considered to
246- represent "true"!
250+
251+ Indicates you do not. Do not be tempted to define HAVE_DX to no or 0;
252+ since these are both nonempty strings, they are considered to
253+ represent true! Also, don't try to use a pair of quotation marks to
254+ represent the empty string, since the quotation marks become part of
255+ the string (which is thus nonempty).
247256
248257The comments within dtool/Config.pp describe a more complete list of
249258the variables you may define. The ones that you are most likely to
250259find useful are:
251260
252261 INSTALL_DIR - this is the prefix of the directory hierarchy into
253262 which Panda should be installed. If this is not defined, the
254- default for Unix systems is taken from the configure parameter to
255- ppremake (usually /usr/local/panda); for Windows machines the
256- default is C:\Panda3d.
263+ default value is compiled into ppremake. A full description on
264+ setting this parameter is given below in the section describing
265+ how to build ppremake. On Unix systems this is taken from the
266+ --prefix parameter to configure (usually /usr/local/panda); for
267+ Windows users it is specified in config_msvc.h, and is set to
268+ C:\Panda3d unless you modify it.
257269
258270 OPTIMIZE - define this to 1, 2, 3, or 4. This is not the same thing
259271 as compiler optimization level; our four levels of OPTIMIZE define
260272 broad combinations of compiler optimizations and debug symbols:
261273
262274 1 - No compiler optimizations, full debug symbols
263- 2 - Full compiler optimizations, full debug symbols
264- (if the compiler supports this)
265- 3 - Full compiler optimizations, no debug symbols, non-debug heap
275+ Windows: debug heap
276+ 2 - Full compiler optimizations, debug symbols
277+ Windows: debug heap
278+ 3 - Full compiler optimizations,
279+ Unix: no debug symbols
280+ Windows: non-debug heap, debug symbols available in pdb files
266281 4 - Full optimizations, no debug symbols, and asserts removed
282+ Windows: non-debug heap
267283
268- Usually OPTIMIZE 2 or 3 is the most appropriate choice for
269- development work.
284+ Usually OPTIMIZE 3 is the most appropriate choice for development
285+ work. We recommend OPTIMIZE 4 only for final QA and/or
286+ distribution of a shippable product, never for any development or
287+ alpha testing; and we recommend OPTIMIZE levels 1 and 2 only for
288+ active development of the C++ code within Panda.
270289
271290 PYTHON_IPATH / PYTHON_LPATH / PYTHON_LIBS - the full pathname to
272291 Python header files, if Python is installed on your system. As of
@@ -295,6 +314,9 @@ find useful are:
295314 somewhere else on your machine, you can fill in the pathnames
296315 here.)
297316
317+ Similar *_IPATH / *_LPATH / *_LIBS variables for other optional
318+ third-party libraries.
319+
298320
299321
300322HOW TO BUILD PANDA ON A UNIX SYSTEM
@@ -312,7 +334,6 @@ You may choose an alternate installation directory by using the
312334We recommend giving yourself write permission to this directory, so
313335that you can run 'make install' and similar scripts that will need to
314336write to this installation directory, without having to be root.
315-
316337 su root
317338 mkdir /usr/local/panda
318339 chown <your-user-name> /usr/local/panda
@@ -347,8 +368,8 @@ BUILD_FROM_CVS.txt in the ppremake source directory.
347368
348369As mentioned above, the default installation directory is
349370/usr/local/panda. Thus, ppremake will install itself into
350- /usr/local/panda/bin. If you prefer, you can install it in another
351- directory by doing something like this:
371+ /usr/local/panda/bin. If you prefer, you can install Panda into
372+ another directory by doing something like this:
352373
353374 ./configure --prefix=/my/install/directory
354375 make
@@ -368,11 +389,11 @@ In bash:
368389 PPREMAKE_CONFIG=~/Config.pp
369390 export PPREMAKE_CONFIG
370391
371- You may find it a good idea to make these environment settings in your
372- .cshrc or .bashrc file so that they will remain set for future sessions.
392+ You may find it a good idea to make this and other environment
393+ settings in your .cshrc or .bashrc file so that they will remain set
394+ for future sessions.
373395
374- Now that you have ppremake, you can test the configuration settings in
375- your Config.pp file.
396+ Now you can test the configuration settings in your Config.pp file:
376397
377398 cd ~/panda3d/dtool
378399 ppremake
@@ -386,10 +407,15 @@ way you expect.
386407
387408Note that ppremake will also try to create several subdirectories in
388409the install directory, so you must have write access to the install
389- directory in order for ppremake to run successfully.
410+ directory in order for ppremake to run completely successfully. If
411+ you did not choose to give yourself write access to the install
412+ directory, you may run ppremake as root; in this case we recommend
413+ running ppremake first as a normal user in order to compile, and then
414+ running ppremake again as root just before running make install as
415+ root.
390416
391- Now you can build the Panda3D sources. Begin with dtool (the current
392- directory):
417+ Now that you have run ppremake, you can build the Panda3D sources.
418+ Begin with dtool (the current directory):
393419
394420 make
395421 make install
@@ -405,9 +431,10 @@ build and install panda:
405431After installing panda, you are almost ready to run the program
406432"pview," which is a basic model viewer program that demonstrates some
407433Panda functionality. Successfully running pview proves that Panda is
408- now installed and configured correctly. However, you must set up a
409- Configrc file to set your runtime configuration options before you can
410- run Panda and open up a graphics window. See HOW TO RUN PANDA, below.
434+ installed and configured correctly (at least as a C++ library).
435+ However, you must set up a Configrc file to set your runtime
436+ configuration options before you can run Panda and open up a graphics
437+ window. See HOW TO RUN PANDA, below.
411438
412439If you wish, you may also build direct. You only need to build this
413440if you intend to use the Python interfaces.
@@ -573,7 +600,7 @@ PANDA FOR YOUR ENVIRONMENT, above.
573600 edit C:\Panda3d\Config.pp
574601
575602
576- Now you should be able to build dtool.
603+ Now you can test the configuration settings in your Config.pp file:
577604
578605 C:
579606 cd \Panda3d\dtool
@@ -586,10 +613,14 @@ settings of many of the options you have configured. You should
586613examine this file now to ensure that your settings have been made the
587614way you expect.
588615
616+ Now that you have run ppremake, you can build the Panda3D sources.
617+ Begin with dtool (the current directory):
618+
589619 make
590620 make install
591621
592- Once dtool is fully built and installed, you can build panda.
622+ Once you have successfully built and installed dtool, you can then
623+ build and install panda:
593624
594625 cd \Panda3d\panda
595626 ppremake
@@ -599,9 +630,10 @@ Once dtool is fully built and installed, you can build panda.
599630After installing panda, you are almost ready to run the program
600631"pview," which is a basic model viewer program that demonstrates some
601632Panda functionality. Successfully running pview proves that Panda is
602- now installed and configured correctly. However, you must set up a
603- Configrc file to set your runtime configuration options before you can
604- run Panda and open up a graphics window. See HOW TO RUN PANDA, below.
633+ now installed and configured correctly (at least as a C++ library).
634+ However, you must set up a Configrc file to set your runtime
635+ configuration options before you can run Panda and open up a graphics
636+ window. See HOW TO RUN PANDA, below.
605637
606638If you wish, you may also build direct. You only need to build this
607639if you intend to use the Python interfaces.
@@ -643,9 +675,9 @@ being found, check that your LD_LIBRARY_PATH setting (on Unix) or your
643675PATH (on Windows) includes the directory in which all of the Panda
644676libraries have been installed. (This is normally $INSTALL_DIR/lib, or
645677whatever you set INSTALL_DIR to followed by "lib". On Unix, this
646- defaults to /usr/local/panda/lib. If you have defined INSTALL_LIB_DIR
647- in your Config.pp, for instance to define Panda as a native Python
648- module, you should use this directory instead.)
678+ defaults to /usr/local/panda/lib. If you have redefined
679+ INSTALL_LIB_DIR in your Config.pp, for instance to define Panda as a
680+ native Python module, you should use that directory instead.)
649681
650682If you do get the above error message, you will need to create a
651683Configrc file to indicate some run-time parameters. This is different
@@ -659,8 +691,8 @@ convention, your custom Configrc file should not have any extension,
659691not even the extension ".txt"; this differentiates it from the
660692standard Configrc files which are also installed into the
661693$INSTALL_DIR/etc file (and having no extension causes your file to be
662- loaded first , so your personal settings will override those in the
663- other files).
694+ sorted to the top of the list , so that your personal settings will
695+ override those in the other files).
664696
665697For now, add just the line:
666698
@@ -692,8 +724,8 @@ wherever you put the Configrc file). Note that if you redefine
692724CONFIGRC_DIR, you will no longer automatically load the standard
693725Configrc files that were installed into $INSTALL_DIR/etc. It is
694726possible to configure Panda to search for Configrc files in more than
695- one directory, but this is a little more complicated and is outside
696- the scope of this document.
727+ one directory, but that's a little more complicated and is outside the
728+ scope of this document.
697729
698730
699731
@@ -713,7 +745,7 @@ Config.pp file, then Python should have been detected by ppremake, and
713745it would have generated makefiles to build these wrappers
714746automatically. (You would have seen the program "interrogate" running
715747within each directory as panda was building, and you will have a
716- number of *.in files installed into $INSTALL_DIR/etc.)
748+ number of *.in files now installed into $INSTALL_DIR/etc.)
717749
718750If, for some reason, the interrogate program did not run, perhaps
719751because you defined an invalid directory in PYTHON_IPATH, you can go
@@ -738,20 +770,20 @@ standard Python module, so that it is not necessary to modify your
738770PYTHONPATH variable; see "Installing Panda as a standard Python
739771module", below.
740772
741- The second part to the Python interface is a series of Python wrapper
742- classes that are generated , for each C++ class detected by
743- interrogate. These classes must be generated after all of the C++
744- code has been compiled and installed. Execute the following command
745- (you might need to type rehash first if you use csh):
773+ The second part to the Python interface is a series of generated
774+ Python wrapper classes , for each C++ class detected by interrogate.
775+ These classes must be generated after all of the C++ code has been
776+ compiled and installed. Execute the following command (you might need
777+ to type rehash first if you use csh):
746778
747779 genPyCode
748780
749781This is a script that was installed into $INSTALL_DIR/bin as part of
750782the build of direct. It invokes Python to read the *.in files
751783generated by interrogate, and generates the appropriate wrapper
752- functions, which are written into $INSTALL_DIR/lib/pandac. (There
753- will be several hundred generated Python modules, which are normally
754- "squeezed" into a single file called PandaModules.pyz using
784+ functions, which are then written into $INSTALL_DIR/lib/pandac.
785+ (There will be several hundred generated Python modules, which are
786+ normally "squeezed" into a single file called PandaModules.pyz using
755787PythonWare's SqueezeTool. This squeeze step gives a significant
756788load-time speedup, especially on Windows; but if it causes problems,
757789you can use the option -n, e.g. 'genPyCode -n', to avoid it.)
@@ -776,8 +808,8 @@ Config.pp:
776808 #define INSTALL_LIB_DIR /usr/lib/python2.2/site-packages
777809
778810Where you give the actual path to the site-packages directory for your
779- particular installation of Python. On Windows, this will probably be
780- something like this:
811+ particular installation of Python. On Windows, this will probably
812+ look something like this:
781813
782814 #define INSTALL_LIB_DIR C:\Python22\Lib\site-packages
783815
@@ -788,12 +820,44 @@ directory.
788820
789821You may also need to set your LD_LIBRARY_PATH (on Unix) or PATH (on
790822Windows) to reference this new directory instead of $INSTALL_DIR/lib,
791- especially if you want to be able run pview or any of the model
792- converters occasionally.
823+ especially if you want to be able to run any of the Panda standalone
824+ programs occasionally, like pview or any of the model converters .
793825
794826Unix users should note that you must have write permission to the
795827site-packages directory in order to install files there. You may
796828choose to run these install steps (ppremake, make install, genPyCode)
797829as root to avoid this problem. If you encounter difficulty running
798830genPyCode as root, make sure that you still have LD_LIBRARY_PATH
799831defined appropriately once you have become root.
832+
833+
834+ Testing the Python interface
835+
836+ Assuming that you have already set up your Configrc file and tested
837+ that pview works, as described above in HOW TO RUN PANDA, you should
838+ now be ready to try to run Panda from within Python. Start up a
839+ Python shell and type the following command:
840+
841+ Python 2.2.2 (#37, Feb 10 2003, 18:00:06) [MSC 32 bit (Intel)] on win32
842+ Type "help", "copyright", "credits" or "license" for more information.
843+ >>> import direct.directbase.DirectStart
844+
845+ You should see a graphics window come up, very similar to the one you
846+ saw when you ran pview. To load a particular model file into the
847+ scene, try something like this:
848+
849+ >>> m = loader.loadModel('/c/Panda3d/models/teapot.egg')
850+ >>> m.reparentTo(render)
851+
852+ Note that Panda expects a forward-slash convention for pathnames, with
853+ no leading drive letter, even on a Windows system. See the full
854+ description of how Panda maps these pathnames to Windows pathnames in
855+ HOW TO BUILD PANDA ON A WINDOWS SYSTEM, USING CYGWIN, above.
856+
857+ You can now move the teapot around with the mouse, just as in pview
858+ (you may need to pull the camera back with the right mouse button in
859+ order to see the teapot).
860+
861+ Congratulations! Panda 3D is now successfully installed. See the
862+ online documentation available at http://www.etc.cmu.edu/panda3d/ for
863+ more help about where to go next.
0 commit comments