Posts Tagged ‘Panda3D’

Building Panda3D on Mac OS X

Friday, August 8th, 2008

I’ve just built Panda3D 1.5.2 on Mac OS X 10.5.4. I had some problems. However, I could solve those from Panda3D Forum and the following links.

Building Panda3D on Mac OS X (Leopard)
Panda3D on Mac OS X

Let’s go build.

1. Download the latest version of Panda3D and edit the fftCompressor.cxx file in panda/src/mathutil.

#include “rfftw.h” -> #include “drfftw.h”

2. Install the following libraries from MacPorts.

$ sudo port install jpeg
$ sudo port install tiff
$ sudo port install libpng
$ sudo port install libtar
$ sudo port install ode
$ sudo port install fftw
$ sudo port install freetype

3. Install the NVIDIA Cg Toolkit.

4. Build ppremake.

$ cd ppremake
$ aclocal
$ autoheader
$ automake --foreign -a
$ autoconf
$ ./configure
$ make
$ sudo make install

5. Configure the .bash_profile file.

export PATH=/usr/local/panda/bin:${PATH}
export PYTHONPATH=/usr/local/panda/lib:/usr/local/panda/lib/direct:${PYTHONPATH}
export DYLD_LIBRARY_PATH=/usr/local/panda/lib

6. Create the Config.pp file in /usr/local/panda.

#define PYTHON_IPATH /usr/include/python2.5
#define PYTHON_LPATH /usr/lib/python2.5
 
#define JPEG_IPATH /opt/local/include
#define JPEG_LPATH /opt/local/lib
 
#define PNG_IPATH /usr/X11/include/libpng
#define PNG_LPATH /usr/X11/lib/
 
#define TIFF_IPATH /opt/local/include
#define TIFF_LPATH /opt/local/lib
 
#define TAR_IPATH /opt/local/include
#define TAR_LPATH /opt/local/lib
 
#define HAVE_FFTW 1
#define FFTW_IPATH /opt/local/include
#define FFTW_LPATH /opt/local/lib
#define FFTW_LIBS dfftw drfftw
 
#define CG_IPATH /Library/Frameworks/Cg.framework/Headers
#define CG_LPATH /Library/Frameworks/Cg.framework
 
#define CG_LIBS
#define CG_FRAMEWORK Cg
#define HAVE_CG 1
 
#define CGGL_LIBS
#define CGGL_FRAMEWORK Cg
#define HAVE_CGGL 1
 
#define ZLIB_IPATH /opt/local/include
#define ZLIB_LPATH /opt/local/lib
 
#define ODE_IPATH /opt/local/include
#define ODE_LPATH /opt/local/lib

7. Build dtool.

$ cd dtool
$ ppremake
$ make
$ make install

8. Build panda.

$ cd panda
$ ppremake
$ make
$ make install

9. Build direct.

$ cd direct
$ ppremake
$ make
$ make install

10. Run genPyCode.

$ genPyCode

11. Create the Config.prc file in /usr/local/panda/etc. Read more here.

plugin-path /usr/local/panda/lib
default-model-extension .egg.pz
model-path .

12. Have fun!