Any one up for OSX work.

i got cvs today and got pview running on 10.4

there was just one change i had to do to “dtool/Config.osx.pp” to get pass a compilation problem of the panda tree (the problem was described in this thread, seems the fixe didn’t make it into CVS?):

line 17, Config.osx.pp

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

(i just added -D__FLT__EVAL_METHOD__=0 define)

but i’m not quite sure how to proceed from here.

i cd’d into the “direct” subdirectory

ppremake
make install

and i still seem not to have the correct “direct” available (though it seems i have libdirect).

Python 2.4.3 (#1, Mar 30 2006, 11:02:15)
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
Type “help”, “copyright”, “credits” or “license” for more information.

import direct
Traceback (most recent call last):
File “”, line 1, in ?
ImportError: No module named direct
import libdirect

running genPyCode seems to stumble because of that

g5:~ kaweh$ genPyCode
Traceback (most recent call last):
File “/usr/local/panda/bin/genPyCode.py”, line 9, in ?
from direct.ffi import DoGenPyCode
ImportError: No module named direct.ffi
g5:~ kaweh$

any hints?

great work by everyone involved! i hope i will be able to run the tutorial soon. :wink:

ok, i figured that “direct” is not only a c++ module, but a python module. it seems it needs to be installed into “/usr/local/panda/lib” by hand (or - the way i did it" added to PYTHONPATH). is that correct?

running genPyCode does more now, though i had to edit genPyCode.py with my setup. i had to remove libtoontown (can’t find) and libotp (can’t find either) from genPyCode.py

DoGenPyCode.codeLibs = r’libpandaexpress libpanda libpandaphysics libdirect libpandafx libprc’.split()

now if i start genPyCode.py i get even an output… until it fails with libprc.

g5:~ kaweh$ genPyCode
Importing code library: libpandaexpress
Found extensions for class: Ramfile
Found extensions for class: StreamReader
Found extensions for class: HTTPChannel
Importing code library: libpanda
Found extensions for class: NodePath
Found extensions for class: Mat3
Found extensions for class: VBase4
Found extensions for class: NodePathCollection
Found extensions for class: VBase3
Importing code library: libpandaphysics
Importing code library: libdirect
Found extensions for class: CInterval
Importing code library: libpandafx
Importing code library: libprc
Traceback (most recent call last):
File “/usr/local/panda/bin/genPyCode.py”, line 27, in ?
DoGenPyCode.run()
File “/Users/kaweh/Projects/panda3d/direct/src/ffi/DoGenPyCode.py”, line 290, in run
generateNativeWrappers()
File “/Users/kaweh/Projects/panda3d/direct/src/ffi/DoGenPyCode.py”, line 253, in generateNativeWrappers
exec(‘import %s as module’ % moduleName)
File “”, line 1, in ?
ImportError: Loaded module does not contain symbol _initlibprc

this is all from CVS yesterday and i tried to follow the instructions in this thread as good as possible (as stated, i got pview to run).

now i’m stuck. i looked at dtool to understand libprc but to no avail till now.

any hints are appreciated.

That is correct. If you define:


#define INSTALL_PYTHON_SOURCE 1

in your Config.pp file, ppremake is supposed to generate Makefiles that copy the Python files into /usr/local/panda/lib. Or you can just put the source directory on your PYTHONPATH, as you have done.

libotp and libtoontown are closed-source modules used within the VR Studio. They are not part of the public Panda distribution, and should not be instrumented. They were added to genPyCode.py when you ran ppremake, based on the definition of GENPYCODE_LIBS in your Config.pp. An early post in this thread by Roger incorrectly indicated that this GENPYCODE_LIBS line should include libtoontown and libotp; a later post corrected this. You should correct GENPYCODE_LIBS and re-run ppremake and then make install, to install a correct genPyCode.py.

libprc, similarly, doesn’t belong on this list. Is that library mentioned by GENPYCODE_LIBS? Remove it if it is. If it’s not explicitly mentioned by GENPYCODE_LIBS, I’m not sure how it got into your genPyCode.py file.

David

thanks a million, david. worked out great.

i can now do a

from Python 2.4 and it works! yay!

next step: tutorial 1

it never reaches the “print ‘done’” statement, but i get a Abort Trap.

it seems to hang in the loading code. any hints how to debug that?

i got CVS for all modules at the same time, so it’s most probably not a de-sync (on saturday or sunday).

anyways i will go on testing this until we have that baby running on OS X. :slight_smile:

ps: pview loads the model without any problems. with pview i get this output

So you’re hitting the same problem that stopped paul, earlier in this thread.

It’s interesting that it works fine in pview, but fails when Python gets into the mix.

What version of gcc do you have? We had a similar problem when we first went to Fedora Core 4 on Linux, which shipped with gcc 4.0.1; a later version of gcc turned out to solve the problem.


gcc --version

David

seems i have an older version. i’ll check my Xcode and tools version on my machine and see what i find out.

g5:~/Projects/panda3d kaweh$ gcc --version
powerpc-apple-darwin8-gcc-4.0.0 (GCC) 4.0.0 (Apple Computer, Inc. build 5026)
Copyright © 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

i have Xcode 2.1 (with gcc 4.0.0) and currently i download Xcode 2.2.1 (with at least gcc 4.0.1), i will recompile and let you know the results.

unfortunatly moving to Xcode 2.2.1 and gcc 4.0.1 didn’t solve the problem. from python the loader crashes, pview is fine with the same model.

g5:~/Projects/pandatest kaweh$ gcc --version
powerpc-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5250)
Copyright © 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

it’s late, i’ll see what i can find out tomorrow. :wink:

4.0.0 and 4.0.1 both demonstrated the problem in FC4. Is there an earlier version of gcc available?

Roger, what version of gcc were you using?

David

i see gcc-3.3 on my system, is that version usable. can this be set for compilation (sorry, i’m not really an unix expert)?

thanks!

Well … Let me try the same test you are doing …

  1. Ill grab head of tree.
  2. Build dtool pand and direct
  3. see if pview laods egg file.
  4. See if python loads eggfile. Hop I can do all this from a telnet session :wink:
 Report Results and let you all know .. go from there

  Roger

hmmm Yes really not sure were to go …

I did what you did and all seems to be ok…

g++ -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=/[1][^+.-]*/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)

Well hmm looks like we are in trouble before we hit the loading message.
That line that reads
Python(21039) malloc: *** Deallocation of a pointer not malloced: 0x281def8; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug

Means we are in sum deep trouble. Do you all get this when you just load the module

I something like this … test.py file

import direct.directbase.DirectStart
print ‘start’
print ‘done’

 Roger

  1. cg ↩︎

i was wondering: which version of Python are you using exactly? because i use the universal build (though on a G5) which is already 2.4.3, but there is a PPC-only 2.4.1 version. maybe there is a problem, we are not aware of?

g5:~/Projects/pandatest kaweh$ python
Python 2.4.3 (#1, Mar 30 2006, 11:02:15) 
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.version
'2.4.3 (#1, Mar 30 2006, 11:02:15) \n[GCC 4.0.1 (Apple Computer, Inc. build 5250)]'

and if i try the reduced version (just import direct.directbase.DirectStart), i get following output. as it says “Python” of the beginning of the each problematic malloc, it might be a version clash between Python and panda? other than that the output would be the same as yours.

DirectStart: Starting the game.
Warning: DirectNotify: category 'Interval' already exists
:display: loading display module: libpandagl.dylib
Known pipe types:
  osxGraphicsPipe
(all display modules loaded.)
:05-18-2006 13:14:32 ShowBase(info): Default graphics pipe is OpenGL (osxGraphicsPipe).
osxGraphicsStateGuardian::osxGraphicsStateGuardian()
:display: Unable to set window properties: size=(800, 600) 
:audio(error):   LoadLibrary() failed, will use NullAudioManager
:audio(error):     dlopen(libmiles_audio.dylib, 6): image not found
:audio: NullAudioManager
:audio: NullAudioManager
Python(1468) malloc: ***  Deallocation of a pointer not malloced: 0x28a8ef8; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
:audio: NullAudioManager
:audio: NullAudioManager
Python(1468) malloc: ***  Deallocation of a pointer not malloced: 0x28a8f28; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
:05-18-2006 13:14:32 ShowBase(info): __dev__ == 0
start
done
:display: Closing osxGraphicsWindow
osxGraphicsStateGuardian::~osxGraphicsStateGuardian()
Python(1468) malloc: ***  Deallocation of a pointer not malloced: 0x28a8f40; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
Python(1468) malloc: ***  Deallocation of a pointer not malloced: 0x28a8f10; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
Python(1468) malloc: ***  Deallocation of a pointer not malloced: 0x28a9528; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
Python(1468) malloc: ***  Deallocation of a pointer not malloced: 0x28a9518; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
Python(1468) malloc: ***  Deallocation of a pointer not malloced: 0x28a9548; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
Python(1468) malloc: ***  Deallocation of a pointer not malloced: 0x28a9538; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug

there is a update package for Python 2.4.3 on pythonmac.org/packages/py24-fat/. i got it, but it doesn’t change the behaviour.

i still wonder if that’s a Python problem.

my first gdb debugging ever, so i’m not sure if this is helpful at all:

(gdb) bt
#0  0x90047e4c in kill ()
#1  0x9012dff4 in abort ()
#2  0x00590868 in dlfree (mem=0x0) at dlmalloc.c:4252
#3  0x2c96bda8 in load_egg_file (filename=@0x1, cs=3221221024) at load_egg_file.cxx:99
#4  0x2c96bea8 in LoaderFileTypeEgg::load_file (this=0x0, path=@0xa000416c) at loaderFileTypeEgg.cxx:74
#5  0x03490fbc in Loader::load_file (this=0x1, filename=@0x28aa2b0, options=@0x28a9da0) at loader.cxx:469
#6  0x0361b544 in Dtool_Loader_load_sync_1093 (self=0x0, args=0x28a9da0, kwds=0x28a8eb0) at ./loader.I:130
#7  0x0028b7fc in PyEval_EvalFrame (f=0x607fd0) at /Volumes/Data/Users/ronald/Universal/python24-fat/Python/ceval.c:3563
#8  0x0028da5c in PyEval_EvalCodeEx (co=0x16c56a60, globals=0x0, locals=0x25, args=0x60812c, argcount=2, kws=0x6088e4, kwcount=0, defs=0x16c3221c, defcount=2, closure=0x0) at /Volumes/Data/Users/ronald/Universal/python24-fat/Python/ceval.c:2736
#9  0x0028ba18 in PyEval_EvalFrame (f=0x608790) at /Volumes/Data/Users/ronald/Universal/python24-fat/Python/ceval.c:3656
#10 0x0028da5c in PyEval_EvalCodeEx (co=0x4d420, globals=0x0, locals=0x25, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at /Volumes/Data/Users/ronald/Universal/python24-fat/Python/ceval.c:2736
#11 0x0028dbe4 in PyEval_EvalCode (co=0x0, globals=0x0, locals=0xa000416c) at /Volumes/Data/Users/ronald/Universal/python24-fat/Python/ceval.c:484
#12 0x002b5ba8 in PyRun_FileExFlags (fp=0xa000db44, filename=0xbffff8b1 "pandatest.py", start=2, globals=0x1fa50, locals=0x1fa50, closeit=1, flags=0x4d420) at /Volumes/Data/Users/ronald/Universal/python24-fat/Python/pythonrun.c:1265
#13 0x002b5dbc in PyRun_SimpleFileExFlags (fp=0xa000db44, filename=0xbffff8b1 "pandatest.py", closeit=1, flags=0xbffff60c) at /Volumes/Data/Users/ronald/Universal/python24-fat/Python/pythonrun.c:860
#14 0x002c0bfc in Py_Main (argc=-2147483648, argv=0xbffff778) at /Volumes/Data/Users/ronald/Universal/python24-fat/Modules/main.c:501
#15 0x0000257c in _call_objcInit () at /SourceCache/Csu/Csu-58/crt.c:361
#16 0x00002424 in _start (argc=2, argv=0xbffff778, envp=0xbffff784) at /SourceCache/Csu/Csu-58/crt.c:205

i looked at the line in code and examined the variables in gdb. everything seemed fine as far as i can tell. there is something fishy happening. :slight_smile:

Well if I am reading this right.

dlfree (mem=0x0)

We are freeing a null pointer some where.

Hmmmmmmmmm

	Roger

Ah, I begin to understand. There is something fishy happening there; we had to put in a hack to work around an apparent compiler bug in gcc.
Put:


#define DO_MEMORY_USAGE

in your Config.pp, then ppremake and make install everywhere (e.g. dtool, panda, direct, and/or pandatool).

This will turn off the need to use that hack.

David

thanks david. i will give this a try.

update: unfortunatly i did re-get from CVS (to get a clean env again) and now i can’t compile panda anymore (and me idiot had deleted the old tree):

g++ -ftemplate-depth-30 -c -o Opt2-osx/glgsg_glgsg.o -I. -I/Users/kaweh/Projects/panda3d/panda -I../cull -I../display -I../downloader -I../effects -I../event -I../express -I../glstuff -I../gobj -I../gsgbase -I../lerp -I../linmath -I../mathutil -I../pandabase -I../pgraph -I../pipeline -I../pnmimage -I../pstatclient -I../putil -I/usr/local/panda/include -I/Library/Frameworks/Python.framework/Headers -I/usr/include   -D_DEBUG -Wall -g -O2 glgsg.cxx
../glstuff/glGraphicsStateGuardian_src.cxx: In destructor 'virtual GLGraphicsStateGuardian::~GLGraphicsStateGuardian()':
../glstuff/glGraphicsStateGuardian_src.cxx:282: error: no matching function for call to 'GLGraphicsStateGuardian::GraphicsStateGuardian()'
../display/graphicsStateGuardian.h:72: note: candidates are: virtual GraphicsStateGuardian::~GraphicsStateGuardian()
make[1]: *** [Opt2-osx/glgsg_glgsg.o] Error 1
make: *** [install-glgsg] Error 2

as it’s late here in vienna, i’ll try to fix this tomorrow.

This sort of thing happens from time to time when you’re working on the CVS trunk. I just checked in a fix.

David

unfortunatly that didn’t help.

again pview has no problem:

g5:~/Projects/pandatest kaweh$ pview
:display: loading display module: libpandagl.dylib
Known pipe types:
  osxGraphicsPipe
(all display modules loaded.)
osxGraphicsStateGuardian::osxGraphicsStateGuardian()
:display: Unable to set window properties: size=(800, 600) 
:display: Closing osxGraphicsWindow
3125 frames in 6.22945 seconds.
501.649 fps average (1.99342ms)
g5:~/Projects/pandatest kaweh$ 

but the situation within the python interpreter got worse:

g5:~/Projects/pandatest kaweh$ python
Python 2.4.3 (#1, Apr  7 2006, 10:54:33) 
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import direct.directbase.DirectStart
DirectStart: Starting the game.
Warning: DirectNotify: category 'Interval' already exists
:display: loading display module: libpandagl.dylib
Known pipe types:
  osxGraphicsPipe
(all display modules loaded.)
:05-21-2006 16:46:58 ShowBase(info): Default graphics pipe is OpenGL (osxGraphicsPipe).
osxGraphicsStateGuardian::osxGraphicsStateGuardian()
Abort trap

i get a exception i didn’t have before.

gdb debugging seems to be useless now (at least for me):

(gdb) file python
Reading symbols for shared libraries ... done
Reading symbols from /usr/local/bin/python...done.
(gdb) run pandatest.py
Starting program: /usr/local/bin/python pandatest.py
Reading symbols for shared libraries . done

Program received signal SIGTRAP, Trace/breakpoint trap.
0x8fe0100c in __dyld__dyld_start ()
(gdb) bt
#0  0x8fe0100c in __dyld__dyld_start ()
#1  0x00000000 in ?? ()
Cannot access memory at address 0x0
Cannot access memory at address 0xfeedface
Previous frame inner to this frame (corrupt stack?)

David, are you using dlmalloc in panda? is it possible to make panda use the normal malloc routines? or am i reading this wrongly?

Roger, i still suspect that there was a problem between Python (me using the latest unversial build) and panda. what version of python are you using exactly?

sorry, i don’t have better news.