Snow Leopard


#10

Tried to build with your new instructions. Result:

g++ -ftemplate-depth-30 -fPIC -c -o built/tmp/libputil_igate.o -I"/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Python.framework/Headers" -I"built/tmp" -I"built/include" -Ipanda/src/putil -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386   -O2 -DBUILDING_PANDA built/tmp/libputil_igate.cxx
built/tmp/libputil_igate.cxx: In function ‘PyObject* Dtool_BitArray_get_word_394(PyObject*, PyObject*, PyObject*)’:
built/tmp/libputil_igate.cxx:26276: error: conversion from ‘BitMaskNative’ to non-scalar type ‘BitMask<long unsigned int, 64>’ requested
built/tmp/libputil_igate.cxx: In function ‘PyObject* Dtool_BitArray_set_word_395(PyObject*, PyObject*, PyObject*)’:
built/tmp/libputil_igate.cxx:26350: error: no matching function for call to ‘BitArray::set_word(int, BitMask<long unsigned int, 64>&)’
built/include/bitArray.I:396: note: candidates are: void BitArray::set_word(int, BitMaskNative)
built/include/bitMask.I: In member function ‘int BitMask<WType, nbits>::get_num_on_bits() const [with WType = long unsigned int, int nbits = 64]’:
built/tmp/libputil_igate.cxx:21164:   instantiated from here
built/include/bitMask.I:408: error: call of overloaded ‘count_bits_in_word(const long unsigned int&)’ is ambiguous
built/include/pbitops.I:21: note: candidates are: int count_bits_in_word(PN_uint32)
built/include/pbitops.I:30: note:                 int count_bits_in_word(PN_uint64)
built/include/bitMask.I: In member function ‘int BitMask<WType, nbits>::get_num_off_bits() const [with WType = long unsigned int, int nbits = 64]’:
built/tmp/libputil_igate.cxx:21219:   instantiated from here
built/include/bitMask.I:420: error: call of overloaded ‘count_bits_in_word(long unsigned int)’ is ambiguous
built/include/pbitops.I:21: note: candidates are: int count_bits_in_word(PN_uint32)
built/include/pbitops.I:30: note:                 int count_bits_in_word(PN_uint64)
built/include/bitMask.I: In member function ‘int BitMask<WType, nbits>::get_lowest_on_bit() const [with WType = long unsigned int, int nbits = 64]’:
built/tmp/libputil_igate.cxx:21274:   instantiated from here
built/include/bitMask.I:432: error: call of overloaded ‘get_lowest_on_bit(const long unsigned int&)’ is ambiguous
built/include/pbitops.I:102: note: candidates are: int get_lowest_on_bit(PN_uint32)
built/include/pbitops.I:117: note:                 int get_lowest_on_bit(PN_uint64)
built/include/bitMask.I: In member function ‘int BitMask<WType, nbits>::get_highest_on_bit() const [with WType = long unsigned int, int nbits = 64]’:
built/tmp/libputil_igate.cxx:21384:   instantiated from here
built/include/bitMask.I:456: error: call of overloaded ‘get_highest_on_bit(const long unsigned int&)’ is ambiguous
built/include/pbitops.I:132: note: candidates are: int get_highest_on_bit(PN_uint32)
built/include/pbitops.I:143: note:                 int get_highest_on_bit(PN_uint64)
built/include/bitMask.I: In member function ‘int BitMask<WType, nbits>::get_next_higher_different_bit(int) const [with WType = long unsigned int, int nbits = 64]’:
built/tmp/libputil_igate.cxx:21495:   instantiated from here
built/include/bitMask.I:521: error: call of overloaded ‘count_bits_in_word(long unsigned int)’ is ambiguous
built/include/pbitops.I:21: note: candidates are: int count_bits_in_word(PN_uint32)
built/include/pbitops.I:30: note:                 int count_bits_in_word(PN_uint64)
built/include/bitMask.I: In member function ‘void BitMask<WType, nbits>::flood_down_in_place() [with WType = long unsigned int, int nbits = 64]’:
built/tmp/libputil_igate.cxx:23405:   instantiated from here
built/include/bitMask.I:879: error: call of overloaded ‘flood_bits_down(long unsigned int&)’ is ambiguous
built/include/pbitops.I:40: note: candidates are: PN_uint32 flood_bits_down(PN_uint32)
built/include/pbitops.I:55: note:                 PN_uint64 flood_bits_down(PN_uint64)
built/include/bitMask.I: In member function ‘void BitMask<WType, nbits>::flood_up_in_place() [with WType = long unsigned int, int nbits = 64]’:
built/tmp/libputil_igate.cxx:23464:   instantiated from here
built/include/bitMask.I:868: error: call of overloaded ‘flood_bits_up(long unsigned int&)’ is ambiguous
built/include/pbitops.I:71: note: candidates are: PN_uint32 flood_bits_up(PN_uint32)
built/include/pbitops.I:86: note:                 PN_uint64 flood_bits_up(PN_uint64)
built/include/bitMask.I: In member function ‘BitMask<WType, nbits> BitMask<WType, nbits>::flood_bits_down() const [with WType = long unsigned int, int nbits = 64]’:
built/tmp/libputil_igate.cxx:23523:   instantiated from here
built/include/bitMask.I:902: error: call of overloaded ‘flood_bits_down(const long unsigned int&)’ is ambiguous
built/include/pbitops.I:40: note: candidates are: PN_uint32 flood_bits_down(PN_uint32)
built/include/pbitops.I:55: note:                 PN_uint64 flood_bits_down(PN_uint64)
built/include/bitMask.I: In member function ‘BitMask<WType, nbits> BitMask<WType, nbits>::flood_bits_up() const [with WType = long unsigned int, int nbits = 64]’:
built/tmp/libputil_igate.cxx:23584:   instantiated from here
built/include/bitMask.I:890: error: call of overloaded ‘flood_bits_up(const long unsigned int&)’ is ambiguous
built/include/pbitops.I:71: note: candidates are: PN_uint32 flood_bits_up(PN_uint32)
built/include/pbitops.I:86: note:                 PN_uint64 flood_bits_up(PN_uint64)
Storing dependency cache.
Elapsed Time: 3 min 25 sec

make: *** [all] Error 1

Any idea ? :slight_smile:


#11

I doubt there will be any noticable change in speed unless the engine itself starts taking advantage of the new stuff in the underlaying os. But who knows ? I dont have anything to test with.


#12

Eh, can you try making the flag something like “-arch x86_64”?

After this you’ll need to make a clean build by deleting “built”, sorry.


#13

Here we go again. Some progress :slight_smile:

g++ -ftemplate-depth-30 -fPIC -c -o built/tmp/pipeline_composite.o -I"/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Python.framework/Headers" -I"built/tmp" -I"built/include" -Ipanda/src/pipeline -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch x86_64   -O2 -DBUILDING_PANDA panda/src/pipeline/pipeline_composite.cxx
gcc -fPIC -c -o built/tmp/pipeline_contextSwitch.o -I"/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Python.framework/Headers" -I"built/tmp" -I"built/include" -Ipanda/src/pipeline -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch x86_64   -O2 -DBUILDING_PANDA panda/src/pipeline/contextSwitch.c
panda/src/pipeline/contextSwitch.c: In function ‘setup_context_1’:
panda/src/pipeline/contextSwitch.c:261: error: ‘CS_JB_SP’ undeclared (first use in this function)
panda/src/pipeline/contextSwitch.c:261: error: (Each undeclared identifier is reported only once
panda/src/pipeline/contextSwitch.c:261: error: for each function it appears in.)
Storing dependency cache.
Elapsed Time: 2 min 45 sec

make: *** [all] Error 1

#14

What version of Panda are you building? I know that it’s fixed on latest CVS, but I think a source package of 1.6.1 and above should work too. If it’s an outdated CVS version, I highly suggest updating.

You can hack around it by editing panda/src/pipeline/contextSwitch.c and by finding this line:

#if defined(HAVE_UCONTEXT_H)

and replacing it with something that always evaluates to true.

#ifndef BLAAAHGR

#15

Im using the official panda3d.org/download/panda3d … mac.tar.gz source for os x :slight_smile:

Ill try the fix you describe.


#16

Im getting the more errors now. Should i try getting the latest version from cvs ?

gcc -fPIC -c -o built/tmp/pipeline_contextSwitch.o -I"/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Python.framework/Headers" -I"built/tmp" -I"built/include" -Ipanda/src/pipeline -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch x86_64   -O2 -DBUILDING_PANDA panda/src/pipeline/contextSwitch.c
panda/src/pipeline/contextSwitch.c: In function ‘init_thread_context’:
panda/src/pipeline/contextSwitch.c:34: error: ‘struct ThreadContext’ has no member named ‘_ucontext’
panda/src/pipeline/contextSwitch.c:36: error: ‘struct ThreadContext’ has no member named ‘_ucontext’
panda/src/pipeline/contextSwitch.c:37: error: ‘struct ThreadContext’ has no member named ‘_ucontext’
panda/src/pipeline/contextSwitch.c:38: error: ‘struct ThreadContext’ has no member named ‘_ucontext’
panda/src/pipeline/contextSwitch.c:39: error: ‘struct ThreadContext’ has no member named ‘_ucontext’
panda/src/pipeline/contextSwitch.c:41: error: ‘struct ThreadContext’ has no member named ‘_ucontext’
panda/src/pipeline/contextSwitch.c: In function ‘save_thread_context’:
panda/src/pipeline/contextSwitch.c:52: error: ‘struct ThreadContext’ has no member named ‘_ucontext’
panda/src/pipeline/contextSwitch.c: In function ‘switch_to_thread_context’:
panda/src/pipeline/contextSwitch.c:74: error: ‘struct ThreadContext’ has no member named ‘_ucontext’
Storing dependency cache.
Elapsed Time: 1 sec

make: *** [all] Error 1

#17

Er, sorry, you needed to make the same change to contextSwitch.h too.


#18

Hmm… more trouble…

g++ -ftemplate-depth-30 -fPIC -c -o built/tmp/pipeline_composite.o -I"/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Python.framework/Headers" -I"built/tmp" -I"built/include" -Ipanda/src/pipeline -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch x86_64   -O2 -DBUILDING_PANDA panda/src/pipeline/pipeline_composite.cxx
In file included from panda/src/pipeline/contextSwitch.h:38,
                 from panda/src/pipeline/threadSimpleImpl.h:26,
                 from panda/src/pipeline/mutexSimpleImpl.h:24,
                 from panda/src/pipeline/mutexTrueImpl.h:38,
                 from panda/src/pipeline/mutexDebug.h:19,
                 from panda/src/pipeline/pmutex.h:19,
                 from panda/src/pipeline/conditionVarDebug.h:19,
                 from panda/src/pipeline/conditionVar.h:19,
                 from panda/src/pipeline/conditionVar.cxx:15,
                 from panda/src/pipeline/pipeline_composite1.cxx:1,
                 from panda/src/pipeline/pipeline_composite.cxx:1:
/Developer/SDKs/MacOSX10.6.sdk/usr/include/ucontext.h:42:2: error: #error ucontext routines are deprecated, and require _XOPEN_SOURCE to be defined
Storing dependency cache.
Elapsed Time: 5 sec

make: *** [all] Error 1

[edit]
Added the -D_XOPEN_SOURCE compiler directive. Seems to work.
[/edit]


#19

Sheesh. Stupid Apple, deprecating a very useful interface without providing an equivalent replacement. Well, whatever. We’ll have to define this symbol in the Panda code, and one day (when Apple presumably removes the interface altogether) we won’t be able to build with SIMPLE_THREADS on Mac anymore.

David


#20

One more error. (Oh, i will make the build available for download if you want . If i come that far that is :slight_smile: ) (dont mind the warning)

flex -i -Peggyy -obuilt/tmp/lexer.lxx.cxx panda/src/egg/lexer.lxx
g++ -ftemplate-depth-30 -fPIC -c -o built/tmp/egg_lexer.o -I"/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Python.framework/Headers" -I"built/tmp" -I"built/include" -Ipanda/src/egg -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch x86_64 -D_XOPEN_SOURCE -O2 -DBUILDING_PANDAEGG built/tmp/lexer.lxx.cxx
In file included from /Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Python.framework/Headers/Python.h:8,
                 from built/include/threadSimpleImpl.h:31,
                 from built/include/mutexSimpleImpl.h:24,
                 from built/include/mutexTrueImpl.h:38,
                 from built/include/mutexDebug.h:19,
                 from built/include/lightMutex.h:19,
                 from panda/src/egg/lexer.lxx:16:
/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Python.framework/Headers/pyconfig.h:1058:1: warning: "_XOPEN_SOURCE" redefined
<command-line>: warning: this is the location of the previous definition
built/tmp/lexer.lxx.cxx: In function ‘int yy_get_next_buffer()’:
built/tmp/lexer.lxx.cxx:2563: error: invalid initialization of reference of type ‘int&’ from expression of type ‘yy_size_t’
panda/src/egg/lexer.lxx:164: error: in passing argument 2 of ‘void input_chars(char*, int&, int)’
Storing dependency cache.
Elapsed Time: 2 sec

make: *** [all] Error 1

#21

Hmm, looks like a flex version issue. Edit line 165 of panda/src/egg/lexer.lxx, change it from this:

input_chars(char *buffer, int &result, int max_size) {

To this:

input_chars(char *buffer, yy_size_t &result, int max_size) {

David


#22

I didnt get that to work. I will look into it more tomorrow, and im almost done with a xcode 3.2 template. Will make that available tomorrow to.


#23

I just committed a change to the lexer.lxx file on cvs that should also solve this problem. You could pick up the latest version of this one file from cvs (it shouldn’t have any conflicts with the 1.6.2 build, if that’s what you’re working with).

David


#24

Heres a XCode 3.2 template for all you lazy guys :=)
glawe.se/Panda3D/Panda3D_1.6 … mplate.zip

Copy the Panda3D 1.6.2 folder to:
/Developer/Library/Xcode/Project Templates/Other/

The template is missing the DYLD_LIBRARY_PATH so you will have to add that manually after or you will not be able to debug.

Go to the Target in the project tree. Doubleclick on the executable name.
Select arguments tab. Press the + on the variables and add:
Name: DYLD_LIBRARY_PATH Value: /Applications/Panda3D/1.6.2/lib

That should be it. If you have any problems… well… i just hope you dont :stuck_out_tongue:


#25

Panda runs after symlinking but I still get this error messages:

DirectStart: Starting the game.
Known pipe types:
  osxGraphicsPipe
(all display modules loaded.)
Thu Sep  3 18:58:44 XXX python2.5[332] <Error>: kCGErrorIllegalArgument: CGSCopyRegion : Null pointer
Thu Sep  3 18:58:44 XXX python2.5[332] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
Thu Sep  3 18:59:54 XXX python2.5[332] <Error>: kCGErrorIllegalArgument: _CGSFindSharedWindow: WID 156
Thu Sep  3 18:59:54 XXX python2.5[332] <Error>: kCGErrorIllegalArgument: CGSRemoveSurface: Invalid window 0x9c

Should I just ignore these?


#26

A stupid question: How to go to the Target in the project tree? In MacOs Finder doubleclicking opens in Python Launcher (actually, doesn’t).


#27

Hi. I’m not actually running Snow Leopard, but I have an updated X11 from MacOS Forge (http://xquartz.macosforge.org). The error message I’m getting is:

python Tut-Asteroids.py 
DirectStart: Starting the game.
:display(warning): Unable to load: dlopen(/Applications/Panda3D/1.6.2/lib/libpandagl.dylib, 6): Symbol not found: __glapi_Context
  Referenced from: /usr/X11/lib/libOSMesa.4.dylib
  Expected in: /usr/X11/lib/libGL.1.dylib

Known pipe types:
(all display modules loaded.)
Traceback (most recent call last):
  File "Tut-Asteroids.py", line 13, in <module>
    import direct.directbase.DirectStart
  File "Panda3D-tpl-rw/Panda3D/1.6.2/lib/direct/directbase/DirectStart.py", line 4, in <module>
  File "Panda3D-tpl-rw/Panda3D/1.6.2/lib/direct/showbase/ShowBase.py", line 229, in __init__
  File "Panda3D-tpl-rw/Panda3D/1.6.2/lib/direct/showbase/ShowBase.py", line 692, in openDefaultWindow
  File "Panda3D-tpl-rw/Panda3D/1.6.2/lib/direct/showbase/ShowBase.py", line 777, in openMainWindow
  File "Panda3D-tpl-rw/Panda3D/1.6.2/lib/direct/showbase/ShowBase.py", line 534, in openWindow
  File "Panda3D-tpl-rw/Panda3D/1.6.2/lib/direct/showbase/ShowBase.py", line 467, in makeDefaultPipe
  File "Panda3D-tpl-rw/Panda3D/1.6.2/lib/direct/directnotify/Notifier.py", line 130, in error
StandardError: No graphics pipe is available!
Your Config.prc file must name at least one valid panda display
library via load-display or aux-display.

Should I try compiling from the sources too? As to the symlinking, should I remove /usr/X11/lib/libOSMesa.4.dylib since it already exists on my system?


#28

Hm… does running software update fix it?


#29

No, I have the latest updates for Leopard + the updated X11 from MacOS Forge. I managed to get it work, though. I removed my existing libOSMesa.4.dylib and linked the libOSMesa.7.dylib as directed in the posts above.

sudo mv /usr/X11/lib/libOSMesa.4.dylib /usr/X11/lib/libOSMesa.4.dylib.backup 
sudo ln -s /usr/X11/lib/libOSMesa.7.dylib /usr/X11/lib/libOSMesa.4.dylib 

Wonder if this will affect other programs I run with X11…