Any one up for OSX work.

!!! pview Works On OSX !!!

I am not a apple developer just a C programming hack. Need to get some other eyes on this work and possible even some help in posishing the rough edges.

I just committed a working OSX windows framework to the head of the tree. I used AGL for rendering and carbon for events and windows. Some CGL code for full screen. It’s in a new directory osxwindow .

Very little of this is linked to python yet just. Doing all my wok in native panda (C++). I am using pview as a test case. I have multi-windowing, shared GL contexts, full screen, keyboard and mouse events working. I ignored none mouse/keyboard input for know.

Using some test eggs I was able to load both models and animations and have them run as expected. I still need to find all the changes and get the committed to the CVS.

I next started to bring in the external packages. Opensll, fft, png, jpeg,.Being a FreeBSD diehard I deciding to use the Darwin ports collection to do all this. Turned out to be a breeze. No major problems. So know have c++ panda working with jpegs and png…

The next think I started to work on was the py bindings. When I stopped yesterday I had pandaexpress working inside python, But had to link libandaexpress by hand not using make enviorment.

So I am making good progress. What IS my environment?

1 All code from CVSs root.
2 Darwin 10.4 . 10.3 and earlier have a bug in dylib loader and c++ constructors.
3 External modules are loaded from Darwin ports collection .
4. Build enviorment is pprenake ( ./configure osx as target)
5. Python version is 2.4 from (used installers)

I know I have allot of files I have not committed to cvs yet. Ill try and get them asap.

Current section of work is making the panda build environment understand the difference between bundles and dynamic libraries. Arrg… caught me by surprise. … phpLang=en

Python plug-ins need to be bundles not dylibs … so I need to figure out how to add a new class target to ppremake that generates a different linker command for python plugins on OSX. I do not imagine this is hard just still hacking inside of ppremake and do not fully understand this environment.


hi there,

how is this effort coming along? would be interesting to see panda available on OS X.


Yes I can announce PAND3D runs OSX 10.4 or higher. ( only off head of CVS tree)

I need some one else to help clean up the builds and prove what I have done is repeatable. Still fiddling around trying to get some buffers and context sharing issues working. Kind of colliding with some other work going on the core glggs.

So What Works …
Python Bindings and repository. ( Native Interrogate)
GL / window system ( Stll hacking here )
KeyBord events
MultiLangual key Input
Mouse events and tracking
ppremake build environment

So what Does Not work or not tried.
NSP library and bindings…. not sure why It is need ?
Sound library
Pixel / fragment shaders
CMU build environment

I would love to get a couple of people to help and validate the build /install steps. By chance You up to some make/ppremake hacking and C compiling?


Wow… nice work. Nice progress. Its a shame that there are only few ppl are dev’ing for Panda3D outside of Disney… (and even less for MacOS X) If there is any support, a noobish’ non-Mac-User can give you (that even can’t compile the installing package using linux - dunno why), lemme know.
Would be great to see this architecture in the list of Panda’s “have” side :slight_smile:

Regards, Bigfoot29

I’m very excited to see Panda3D finally coming to OS X. I’m willing to help test it out, have just checked out from CVS head. What exactly do I need to get it compiled and tested?


I used a virgin OS 10.4 install ( cd)
Patch to current Apple Upgrades
Installed Dev Tools From same CD

1 Install Darwin Ports …
Fallow Current Instructions

  1. ports
    sudo port install jpeg
    sudo port install libpng
    sudo port install tiff (Will also Grab zlib)
    sudo port install freetype
    sudo port install fftw

fftw @2.1.5_2 (active)
freetype @2.1.10_1 (active)
jpeg @6b_1 (active)
libpng @1.2.8_2+darwin_8 (active)
tiff @3.8.0_0+darwin_8 (active)
zlib @1.2.3_0 (active)

By default the ports are installed into the /opt/ directory tree s set you path and such …
Get Python 2.4
Python version is 2.4 from (used installers)

My Bash Profile… …

C_INCLUDE_PATH=/usr/include/malloc/ ; export C_INCLUDE_PATH
CPLUS_INCLUDE_PATH=/usr/include/malloc/ ; export CPLUS_INCLUDE_PATH

PPREMAKE_CONFIG=/Users/roger/Config.pp ; export PPREMAKE_CONFIG

PYTHONPATH=/Users/roger/player:/usr/local/panda/lib; export PYTHONPATH

CVS_RSH=/usr/bin/ssh ; export CVS_RSH



sudo mkdir /usr/local/panda
sudo chmod 777 /usr/local/panda

mkdir player
cd player

cvs -d co ppremake
automake --foreign -a
./configure -with-platform=osx
make install

Create Local Config.pp
In home directory

… Config.pp looks like
#define OPTIMIZE 2
#define HAVE_GL 1
#define GENPYCODE_LIBS libtoontown libotp libpandaexpress libpanda libpandaphysics libdirect libpandafx


… dtools
cvs -d co dtool
cd dtools

make install

… panda

cvs -d co dtool
cd panda
make install

Hi Roger,

Do you think you could create a tarball of your developer CVS checkout? Sourceforge’s anonymous CVS servers haven’t synced in a few weeks. :frowning:

Thanks for all your great work on this! I can’t wait to start playing with it.

Well hmm I do not have a good place to park this for public consumption. The “rumorâ€

I almost got it all to compile, but then I get this wonky syntax error while compiling panda:

interrogate -od Opt2-osx/ -oc Opt2-osx/libpnmimage_igate.cxx -DCPPPARSER -D__STDC__=1 -D__cplusplus -D__ppc__ -D__const=const -Dvolatile -D__BIG_ENDIAN__ -D__inline__=inline -D__GNUC__ -S/usr/local/panda/include/parser-inc -S/usr/include -I/usr/local/panda/panda -I../express -I../linmath -I../pandabase -I../pipeline -I../putil -I/usr/local/panda/include -I/Library/Frameworks/Python.framework/Headers -D_DEBUG  -fnames -string -refcount -assert -python-native  -track-interpreter  -module "panda" -library "libpnmimage" config_pnmimage.h pnmbitio.h pnmFileType.h pnmFileTypeRegistry.h pnmImage.h pnmImageHeader.h pnmReader.h pnmWriter.h pnmimage_base.h ppmcmap.h pnmimage_composite1.cxx pnmimage_composite2.cxx
      *** Error in /usr/include/stdarg.h near line 49, column 2:
      parse error, expecting `'{'' or `';'' or `':'' or `'=''
Error parsing file: 'pnmimage_composite2.cxx'
make[1]: *** [Opt2-osx/libpnmimage_igate.cxx] Error 1
make: *** [install-pnmimage] Error 2

any ideas?


Going to need a little bit more info. I have basically the exact same line for my /panda/src/pnmimage interigate iyet it seems to get past this problem ? . I looked at my /usr/include/stdarg.h
An it only has a handful of lines…

/* This file is public domain. /
GCC uses its own copy of this header */
#if defined(GNUC)
#include_next <stdarg.h>
#elif defined(MWERKS)
#include “mw_stdarg.h”
#error “This header only supports MWERKS.”

I did find another stdargs on the machine but it is under the 3.3 compiler directories ?
If I can get you to look at you my /usr/include/stdarg.h… mayby this is a versioning issue.

Here are a cpuple of version dumps …
$ gcc –v

Reading specs from /usr/lib/gcc/powerpc-apple-darwin8/4.0.0/specs
Configured with: /private/var/tmp/gcc/gcc-4061.obj~8/src/configure --disable-checking --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^+.-]*/s//-4.0/ --with-gxx-include-dir=/include/gcc/darwin/4.0/c++ --build=powerpc-apple-darwin8 --host=powerpc-apple-darwin8 --target=powerpc-apple-darwin8
Thread model: posix
gcc version 4.0.0 20041026 (Apple Computer, Inc. build 4061)

uname -a
Darwin -power-mac-g4-agp-graphics.local 8.5.0 Darwin Kernel Version 8.5.0: Sun Jan 22 10:38:46 PST 2006; root:xnu-792.6.61.obj~1/RELEASE_PPC Power Macintosh powerpc

Not sure where to go from here… Any ideas ?


Hi I have followed your (Roger) instructions on my OSX 10.4.6 (PPC) install. And I have dtools compiled, but I’m having problems with panda.

Any suggestions on how to get by this, I did exactly as you’re post outlined.

In the bash_profile you set a DTOOL variable but don’t export it, is that right? (I haven’t exported it on mine but I was just wondering about it).

Also I’m assuming with the panda phase the cvs co is of the ‘panda’ module rather than the dtool module (again) :wink:

Thanks in advance for any help anyone can offer.


I’ve seen something similar while I was attempting to build on OS X under makepanda.

It may help to look at this forum post on the makepanda side: The basic issue is that interrogate isn’t generalized enough to parse the system header files whilst building the python wrappers; to prevent interrogate from traversing up the tree, you can put stub files in one of the source directories to stop interrogate from finding the system headers.

Best of luck,

Weird. There seems to be different version of the .h files running around not sure the exact problem here. Only reference I can find to this value is in float.h under /usr/include/gcc/darwin/3.3 I did use gcc 4.0 not 3.3 so not sure of the 3.3 behavior But looking at the floats.h it will not parse without the symbol present.

… But lets focus on a simple solution. For symbols that are hard defined in a compiler ( GCC) You can just transfer them to the interrogate preprocessor. Something like this .

  1. From the command line

gcc -E -dM - < /dev/null | grep “__FLT_EVAL”

  1. Then we need to let interrogate know what the compiler thinks this symbol. A simple answer is to modify the SYSTEM_IGATE_FLAGS in Config.osx.

#define SYSTEM_IGATE_FLAGS -D__ppc__ -D__const=const -Dvolatile -D__BIG_ENDIAN__ -D__inline__=inline -D__GNUC__ -D FLT_EVAL_METHOD=0

Again I am curious what compiler version you are using

Seeing a “cpp –v “ would be great … Here is mine.

cpp -v
Reading specs from /usr/lib/gcc/powerpc-apple-darwin8/4.0.0/specs
Configured with: /private/var/tmp/gcc/gcc-4061.obj~8/src/configure --disable-checking --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^+.-]*/s//-4.0/ --with-gxx-include-dir=/include/gcc/darwin/4.0/c++ --build=powerpc-apple-darwin8 --host=powerpc-apple-darwin8 --target=powerpc-apple-darwin8
Thread model: posix
gcc version 4.0.0 20041026 (Apple Computer, Inc. build 4061)
/usr/libexec/gcc/powerpc-apple-darwin8/4.0.0/cc1 -E -traditional-cpp -mconstant-cfstrings -quiet -v -I/usr/include -D__DYNAMIC__ -D__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__=1040 - -fPIC
ignoring nonexistent directory “/usr/local/include”
ignoring nonexistent directory “/usr/lib/gcc/powerpc-apple-darwin8/4.0.0/…/…/…/…/powerpc-apple-darwin8/include”
ignoring duplicate directory “/usr/include”
as it is a non-system directory that duplicates a system directory
#include “…” search starts here:
#include <…> search starts here:
End of search list.


That’s my cpp -v

I haven’t tried any of those solutions yet, but will do in a couple of hours.

My version = gcc version 4.0.0 20041026 (Apple Computer, Inc. build 4061)
Yours = gcc version 4.0.1 (Apple Computer, Inc. build 5250)

hmm yup you are on a newer version than me ;(. I guess I need to get a new version.


You did get the gist of the previous post. The gcc compiler has some hard coded “sort of ‘ preprocessor #defines and some of there .h files must have them to parse properly. The easiest way I know to get by this is to just.

  1. Query what the compiler has hard coded.
    a. For gcc use “gcc -E -dM - < /dev/nullâ€

Well what you suggested worked Roger, but then I hit another problem after about an hour of building (I’m building this on a laptop).

Any suggestions regarding this?

Well. This to is a problem. Man I really appreciate you jumping threw these hoops. At some point me and Josh owe you all a prebuilt running environment. Or at least a clean build tree for osx.

Three things seem to be actively changing in panda. One is a threaded renderer/ cull engine. The second is the way the graphic state guardian interacts and communicates with the lower level objects. The third is some people are mucking with some new GL features like shaders and looks like glquerry object interface. The issue here is that panda has a local glut definition file that is working agenst the apple glut file and Opengl.h . Odviously the “HACKSâ€

That’s fine Roger - I’m really keen on getting panda working.

Found it: panda_glext.h
I’ll do those changes and give it a try :slight_smile:

Thanks for your continual help.

Erm… I think it worked… I think

Make install completed… hrm - I don’t seem to have a ppython in my /usr/local/panda/bin directory

Any advice?

Cool. You have made it threw the hard part. Try pview. And see if you get basic functionality. There are some more complex samples in the model tree if you loaded that.

Pview mysample.egg

I am not even sure what ppython is. Maybe someone else can help here I just use the real python2.4 binary. Get python and panda in you path(s) and load a library you just generated and call sum functions….:slight_smile:. They are the *.so in the /usr/local/panda/lib directory.

Something like

import libpandaexpress

To go to the next step you will need direct and to successfully run the genpycode. Direct is small but is the glue to most of the python environment and a base repository as a kick start for a lot of peoples code.


Alter the line in your Config.pp file to read something like this

#define GENPYCODE_LIBS libpandaexpress libpanda libpandaphysics libdirect libpandafx