Snow Leopard

Hello,

Anyone got panda to run on Snow Leopard ?

The Cg.Framework setup wont run so i copied it from the package contents, but when i ran the examples in the samples folder i got complaints that the libs where of the wrong architecture.

(Im running SL in 64bits mode, but are having the same problem when i try in 32 bits mode)

Can you please post the exact error messages?

sure :slight_smile:
Here is a dump when running python without any settings (or snow leopard default)

$ python Tut-Asteroids.py 
DirectStart: Starting the game.
Traceback (most recent call last):
  File "Tut-Asteroids.py", line 13, in <module>
    import direct.directbase.DirectStart
  File "/Applications/Panda3D/1.6.2/lib/direct/directbase/DirectStart.py", line 3, in <module>
    from direct.showbase import ShowBase
  File "/Applications/Panda3D/1.6.2/lib/direct/showbase/ShowBase.py", line 10, in <module>
    from pandac.PandaModules import *
  File "/Applications/Panda3D/1.6.2/lib/pandac/PandaModules.py", line 1, in <module>
    from libpandaexpressModules import *
  File "/Applications/Panda3D/1.6.2/lib/pandac/libpandaexpressModules.py", line 1, in <module>
    from extension_native_helpers import *
  File "/Applications/Panda3D/1.6.2/lib/pandac/extension_native_helpers.py", line 75, in <module>
    Dtool_PreloadDLL("libpandaexpress")
  File "/Applications/Panda3D/1.6.2/lib/pandac/extension_native_helpers.py", line 73, in Dtool_PreloadDLL
    imp.load_dynamic(module, pathname)
ImportError: /Applications/Panda3D/1.6.2/lib/libpandaexpress.dylib: no appropriate 64-bit architecture (see "man python" for running in 32-bit mode)

This is the dump from when using the export VERSIONER_PYTHON_PREFER_32_BIT=yes.

python Tut-Asteroids.py 
DirectStart: Starting the game.
:display(warning): Unable to load: dlopen(/Applications/Panda3D/1.6.2/lib/libpandagl.dylib, 6): Library not loaded: /usr/X11/lib/libOSMesa.4.dylib
  Referenced from: /Applications/Panda3D/1.6.2/lib/libpandagl.dylib
  Reason: image not found
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 "/Applications/Panda3D/1.6.2/lib/direct/directbase/DirectStart.py", line 4, in <module>
    ShowBase.ShowBase()
  File "/Applications/Panda3D/1.6.2/lib/direct/showbase/ShowBase.py", line 229, in __init__
    self.openDefaultWindow(startDirect = False, props=props)
  File "/Applications/Panda3D/1.6.2/lib/direct/showbase/ShowBase.py", line 692, in openDefaultWindow
    self.openMainWindow(*args, **kw)
  File "/Applications/Panda3D/1.6.2/lib/direct/showbase/ShowBase.py", line 777, in openMainWindow
    self.openWindow(*args, **kw)
  File "/Applications/Panda3D/1.6.2/lib/direct/showbase/ShowBase.py", line 534, in openWindow
    self.makeDefaultPipe()
  File "/Applications/Panda3D/1.6.2/lib/direct/showbase/ShowBase.py", line 467, in makeDefaultPipe
    "No graphics pipe is available!\n"
  File "/Applications/Panda3D/1.6.2/lib/direct/directnotify/Notifier.py", line 130, in error
    raise exception(errorString)
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.

Oh, all the enviornment variables seems to be in the right place.

[edit]
when checking the mesalib, this is what i get:

ls -la /usr/X11/lib/libOSMesa.*
-rwxr-xr-x  1 root  wheel  7108224 Jul  6 08:33 /usr/X11/lib/libOSMesa.7.2.dylib
lrwxr-xr-x  1 root  wheel       19 Aug 31 16:19 /usr/X11/lib/libOSMesa.7.dylib -> libOSMesa.7.2.dylib
lrwxr-xr-x  1 root  wheel       19 Aug 31 16:19 /usr/X11/lib/libOSMesa.dylib -> libOSMesa.7.2.dylib

[/edit]

/Manne

Okay, so apparently Snow Leopard just ships with a newer libOSMesa version. You can probably make a symlink or so.

But libpandagl is not supposed to link to libOSMesa at all. I’ll look into removing the libOSMesa dependency on that library.

Im trying to build from source now… have some problems with make trying to link with ppc binaries. Snow Leopard does not support ppc at all so i removed the -arch ppc from makepanda.py. Now i got this error. Any idea ? :slight_smile:

(I will try to symlink the mesalib)

............
terrogate_composite.cxx
g++ -o built/bin/interrogate -Lbuilt/lib -L/usr/X11R6/lib built/tmp/interrogate_composite.o built/tmp/libcppParser.a built/lib/libp3dtool.dylib built/lib/libp3dtoolconfig.dylib built/lib/libp3pystub.dylib -lcrypto -lssl -lpthread -ldl -isysroot /Developer/SDKs/MacOSX10.5.sdk -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk   -arch i386
ld: library not found for -lcrt1.10.6.o
collect2: ld returned 1 exit status
Storing dependency cache.
Elapsed Time: 1 min 14 sec

Does 10.6 have an SDK in /Developer/SDKs/ ? If so, you need to edit makepandacore.py and makepanda.py and replace “10.5” by “10.6”.
“rm -rf built” before you try again building.

Also, you can try finding the line in makepanda.py that contains “-lOSMesa” and try uncommenting it. I don’t know why it’s needed.

Symlinking worked great.

So, for thoose of you who dont know how. Here is a workaround to get Panda to work on Snow Leopard.

Download the Cg installation (Cg-2.2.0006) from nvidia. Rightclick on the installer and select show package contents. In Contents->Resources->Installer Items there is a file: NVIDIA_Cg.tgz. Copy this to your desktop. Doubleclick on it to unpack.
Now, copy the Cg.Framework in NVIDIA_Cg->Library->Frameworks to /Libraray/Frameworks.

Open a terminal and run this.
sudo ln -s /usr/X11/lib/libOSMesa.7.dylib /usr/X11/lib/libOSMesa.4.dylib

Now Panda should work.

hey Manne,

There is any difference on Panda running on Snow Leopard? Plz, post a review :slight_smile:

thanks,
Paulo

Nice job Manne, I’m glad that Panda runs on 10.6.

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:

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.

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.

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

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

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

Ill try the fix you describe.

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

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

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]

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

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