Any one up for OSX work.

Hmm, sounds like something’s crazy in your graphics driver: it appears to be locking up as soon as you render any geometry. Can you run other OpenGL applications successfully?

David

Just another small tip for osx users… (at least the applies to my installation)

Do not try with leopard yet… (8hours trying to get panda3d compiled and not trough the panda dir)

Ill try to post a patch for the panda and the /usr/include which (in my unexperienced eyes) apple messed up… but i cant tell if anything else will still work with these applied

Yup, and I even write my own OpenGL stuff on a fairly regular basis.

Are there any build options I should try to perhaps enable more thorough debugging?

Try putting:

notify-level-display spam

in your Config.prc file.

David

Two things:
a) If I put a Config.prc file in my home directory, it doesn’t seem to override the global settings. If I edit /usr/local/panda/etc/20_panda.prc then the settings work. Probably not the source of the problem, but I figured it was worth mentioning.

b) When I change the run() statement, as recommended by Hypnos, combined with David’s recommendation of changing the notify-level-display, I get these lines in the log before the hang.

:egg2pg: Flattened 0 nodes.
next frame
:11-06-2007 18:45:30 ShowBase(info): Got window event: origin=(0, 0) size=(800, 600) title="Panda" !undecorated !fullscreen foreground !minimized open !cursor_hidden absolute 
:11-06-2007 18:45:30 ShowBase(info): Got window event: origin=(0, 0) size=(800, 600) title="Panda" !undecorated !fullscreen foreground !minimized open !cursor_hidden absolute 
:display(spam): render_frame() - frame 1

While trying to get panda3d compiled under osx (and creating the app with it) i encountered a problem i had during compilation. The source of the problem seems to be that under OSX /Developer/SDKs/MacOSX10.4u.sdk/usr/include should be included and not /usr/include. I need to know that for ppremake build style.

But… I dont know how i can define that…

Any idea’s?

Hmm, that sort of seems like a compiler configuration issue. We don’t explicitly include /usr/include, the compiler just knows that it should look there. It doesn’t seem like we should have to explicitly include the developer SDK’s, either.

But, you should be able to define EXTRA_IPATH to include whatever additional paths you need.

David

I think the EXTRA_IPATH does it, i also defined EXTRA_LPATH i found searching the sources of dtool.

As i understand it, this is really required, according to the email i sent to apple bug developer. Please correct me if i do understand it wrong, which is possible :slight_smile:

Well, I don’t know what Apple has in mind. That sounds like a cop-out: “don’t use the compiler with the default settings, it’s not supposed to work.” But, if the boss says don’t do it that way, I guess you shouldn’t do it that way.

For the record, I am able to build Panda on my iMac with no special reference to any Developer SDK. I don’t know what’s different between my environment and yours.

David

Oh that might be that im running leopard :slight_smile:, i have had no problems until i switched, but probably all of us will run into this problem sooner or later.

If you are running leopard as well then i am really screwed, as is a friend who recently also tried compiling under leopard fresh install.

That’s the reason im now trying to compile with the supposed includes, but up to now i only got errors i have never got before…

(documentations from my config.pp):
// WITH TAR ENABLED PRODUCES THIS ERROR:
// in ./src/express
// *** Error in patchfile.h near line 133, column 33:
// syntax error, unexpected IDENTIFIER, expecting ‘{’ or ‘;’ or ‘:’ or ‘=’
// Error parsing file: ‘patchfile.h’
// make[1]: *** [Opt3-OSX/libexpress_igate.cxx] Error 1
// make: *** [express] Error 2

(i disabled tar currently to prevent this error)

but i already got a new one…

it’s like easter, but egg’s are nicer then bugs :wink:

Well… next problem that arises:

interrogate doesnt seem to accept __BEGIN_DECLS

i might should start a new thread osx leopard?

interrogate -od Opt3-OSX/libdownloader.in -oc Opt3-OSX/libdownloader_igate.cxx -DCPPPARSER -D__STDC__=1 -D__cplusplus -D__FLT_EVAL_METHOD__=0  -D__i386__ -D__const=const -Dvolatile -D__LITTLE_ENDIAN__ -D__inline__=inline -D__GNUC__ -S/usr/local/panda/include/parser-inc -I/Volumes/OSX/_DOWNLOADS/_DEVELOPMENT/_LIBRARYS/Panda3d-CVS-pp/panda3d/panda -I../express -I../pandabase -I/Developer/SDKs/MacOSX10.5.sdk/usr/include -I/usr/local/panda/include -I/Library/Frameworks/Python.framework/Versions/2.4/include/python2.4 -I/opt/local/include   -fnames -string -refcount -assert -python-native    -module "pandaexpress" -library "libdownloader" config_downloader.h bioPtr.h bioStreamPtr.h bioStream.h bioStreamBuf.h chunkedStream.h chunkedStreamBuf.h decompressor.h documentSpec.h downloadDb.h download_utils.h extractor.h httpAuthorization.h httpBasicAuthorization.h httpChannel.h httpClient.h httpCookie.h httpDate.h httpDigestAuthorization.h httpEntityTag.h httpEnum.h identityStream.h identityStreamBuf.h multiplexStream.h multiplexStreamBuf.h patcher.h socketStream.h ssl_utils.h urlSpec.h downloader_composite1.cxx downloader_composite2.cxx
      *** Error in /Developer/SDKs/MacOSX10.5.sdk/usr/include/ctype.h near line 146, column 10:
      syntax error, unexpected KW_UNSIGNED, expecting '{' or ';' or ':' or '='
Error parsing file: 'downloader_composite2.cxx'
make[1]: *** [Opt3-OSX/libdownloader_igate.cxx] Error 1
make: *** [install-downloader] Error 2

this is the ctypes.h:
pastebin.be/6853

Well, I’m still running Tiger, so maybe that is the problem. Maybe these are just temporary growing pains with the new OS, that we can expect Apple to fix shortly?

You can fix the ctypes.h problem by masking ctypes.h from interrogate. Do this by adding an empty ctypes.h to the directory dtool/src/parser-inc, and adding the appropriate line to Sources.pp in that directory.

David

After more investigation i was told that any application which wants to be distributed (not only run locally) should include/link against the sdk’s, because the /usr/include\lib will change with every version you install and might not be backward compatible.

So with my understanding we should definately switch to use the recommended way (/Developer/SDKs). I actually succeded building osx under leopard (using /usr/include) and was trying to build the binary (features in development thread) (which was actually quite some pain to do). But in the end i was not able to run the libs it under tiger (and im pretty sure it’s not possible to fix that).

But… I have never developed anything for a mac, i am a bad c/c++ programmer so dont take this to seriously …

ill try the masking

tnx for your help :slight_smile:

Im up for the next compile error:

interrogate -od Opt3-OSX/libnativenet.in -oc Opt3-OSX/libnativenet_igate.cxx -DCPPPARSER -D__STDC__=1 -D__cplusplus -D__FLT_EVAL_METHOD__=0  -D__i386__ -D__const=const -Dvolatile -D__LITTLE_ENDIAN__ -D__inline__=inline -D__GNUC__ -S/usr/local/panda/include/parser-inc -I/Volumes/OSX/_DOWNLOADS/_DEVELOPMENT/_LIBRARYS/Panda3d-CVS-pp/panda3d/panda -I../express -I../pandabase -I/usr/local/panda/include -I/Library/Frameworks/Python.framework/Versions/2.4/include/python2.4 -I/opt/local/include   -fnames -string -refcount -assert -python-native    -module "panda" -library "libnativenet" buffered_datagramconnection.h buffered_datagramreader.h buffered_datagramreader.i ringbuffer.h ringbuffer.i socket_ip.h socket_tcp_listen.h time_accumulator.h time_out.h socket_address.h socket_portable.h time_base.h time_span.h buffered_datagramwriter.h socket_base.h socket_selector.h socket_udp.h socket_udp_incoming.h time_clock.h membuffer.h membuffer.i socket_fdset.h socket_tcp.h socket_udp_outgoing.h time_general.h nativenet_composite1.cxx
      *** Error in socket_portable.h near line 274, column 60:
      syntax error, unexpected IDENTIFIER
Error parsing file: 'buffered_datagramconnection.h'
make[1]: *** [Opt3-OSX/libnativenet_igate.cxx] Error 1
make: *** [nativenet] Error 2

once again i have noooo idea how to fix that… (btw its cvs head from 20.11.07)
I actually tried to do the same for this header file like i did before (masking from interrrogate). By creating the buffered_datagramconnection.h in parser-inc and adding the file to the Soruces.pp, but that doesnt seem to help in this case…

Btw. im interested to know what you think about making that the default way the osx installation is compiled?

change:

and i have this patch applied :wink:

(the next message contains the error without the patch applied, this patch fixed a problem when compiling against /usr/include on leopard)

? .DS_Store
? XX_cvs_diff.sh
? openal_ffmpeg-19-11-07-v2.diff
? openal_ffmpeg-19-11-07.diff
? direct/src/http/Makefile
? direct/src/motiontrail/Makefile
? panda/src/movies/Makefile
Index: dtool/Config.pp
===================================================================
RCS file: /cvsroot/panda3d/dtool/Config.pp,v
retrieving revision 1.217
diff -u -r1.217 Config.pp
--- dtool/Config.pp	29 Jun 2007 01:39:09 -0000	1.217
+++ dtool/Config.pp	19 Nov 2007 19:39:51 -0000
@@ -776,6 +776,13 @@
 #define FMODEX_LIBS fmodex
 #defer HAVE_FMODEX $[libtest $[FMODEX_LPATH],$[FMODEX_LIBS]]
 
+// Info for the OpenAL audio engine
+// note this may be overwritten in wintools Config.pp
+#define OPENAL_IPATH /usr/include
+#define OPENAL_LPATH /usr/lib
+#define OPENAL_LIBS openal
+#defer HAVE_OPENAL $[libtest $[OPENAL_LPATH],$[OPENAL_LIBS]]
+
 // Info for http://www.sourceforge.net/projects/chromium
 // note this may be overwritten in wintools Config.pp
 #define CHROMIUM_IPATH /usr/include/chromium/include
Index: dtool/LocalSetup.pp
===================================================================
RCS file: /cvsroot/panda3d/dtool/LocalSetup.pp,v
retrieving revision 1.124
diff -u -r1.124 LocalSetup.pp
--- dtool/LocalSetup.pp	20 Jul 2007 23:59:10 -0000	1.124
+++ dtool/LocalSetup.pp	19 Nov 2007 19:39:51 -0000
@@ -91,6 +91,11 @@
 #else
 #print - Did not find FMOD Ex sound library
 #endif
+#if $[HAVE_OPENAL]
+#print + OpenAL sound library
+#else
+#print - Did not find OpenAL sound library
+#endif
 #if $[HAVE_GTK]
 #print + gtk+-2
 #else
Index: dtool/Package.pp
===================================================================
RCS file: /cvsroot/panda3d/dtool/Package.pp,v
retrieving revision 1.60
diff -u -r1.60 Package.pp
--- dtool/Package.pp	16 Mar 2007 03:04:06 -0000	1.60
+++ dtool/Package.pp	19 Nov 2007 19:39:51 -0000
@@ -257,6 +257,11 @@
 #set FMODEX_LIBS $[FMODEX_LIBS]
 #set HAVE_FMODEX $[HAVE_FMODEX]
 
+#set OPENAL_IPATH $[unixfilename $[OPENAL_IPATH]]
+#set OPENAL_LPATH $[unixfilename $[OPENAL_LPATH]]
+#set OPENAL_LIBS $[OPENAL_LIBS]
+#set HAVE_OPENAL $[HAVE_OPENAL]
+
 #set CHROMIUM_IPATH $[unixfilename $[CHROMIUM_IPATH]]
 #set CHROMIUM_LPATH $[unixfilename $[CHROMIUM_LPATH]]
 #set CHROMIUM_LIBS $[CHROMIUM_LIBS]
Index: dtool/pptempl/Global.pp
===================================================================
RCS file: /cvsroot/panda3d/dtool/pptempl/Global.pp,v
retrieving revision 1.121
diff -u -r1.121 Global.pp
--- dtool/pptempl/Global.pp	3 Aug 2007 22:00:10 -0000	1.121
+++ dtool/pptempl/Global.pp	19 Nov 2007 19:39:52 -0000
@@ -343,6 +343,14 @@
   #define fmodex_libs $[FMODEX_LIBS]
 #endif
 
+#if $[HAVE_OPENAL]
+  #define openal_ipath $[wildcard $[OPENAL_IPATH]]
+  #define openal_lpath $[wildcard $[OPENAL_LPATH]]
+  #define openal_cflags $[OPENAL_CFLAGS]
+  #define openal_libs $[OPENAL_LIBS]
+  #define openal_framework $[OPENAL_FRAMEWORK]
+#endif
+
 #if $[HAVE_CHROMIUM]
   #define chromium_ipath $[wildcard $[CHROMIUM_IPATH]]
   #define chromium_lpath $[wildcard $[CHROMIUM_LPATH]]
Index: panda/src/audiotraits/Sources.pp
===================================================================
RCS file: /cvsroot/panda3d/panda/src/audiotraits/Sources.pp,v
retrieving revision 1.30
diff -u -r1.30 Sources.pp
--- panda/src/audiotraits/Sources.pp	20 Aug 2007 22:34:58 -0000	1.30
+++ panda/src/audiotraits/Sources.pp	19 Nov 2007 19:39:53 -0000
@@ -49,25 +49,30 @@
 
 #end lib_target
 
-//#begin lib_target
-//  #define TARGET openal_audio
-//  #define BUILD_TARGET $[HAVE_OPENAL]
-//  #define USE_PACKAGES openal
-//  #define BUILDING_DLL BUILDING_OPENAL_AUDIO
-//  #define LOCAL_LIBS audio event
-//  #define WIN_SYS_LIBS $[WIN_SYS_LIBS] user32.lib advapi32.lib winmm.lib
-//
-//  #define COMBINED_SOURCES $[TARGET]_composite1.cxx
-//
-//  #define SOURCES \
-//      config_openalAudio.h \
-//      openalAudioManager.h \
-//      openalAudioSound.I openalAudioSound.h
-//
-//  #define INCLUDED_SOURCES \
-//      config_openalAudio.cxx openalAudioManager.cxx openalAudioSound.cxx
-//
-//#end lib_target
+#begin lib_target
+  #print building openal
+  #define TARGET openal_audio
+  #define BUILD_TARGET $[HAVE_OPENAL]
+  #define USE_PACKAGES openal
+  #define BUILDING_DLL BUILDING_OPENAL_AUDIO
+  #define LOCAL_LIBS audio event
+  #define WIN_SYS_LIBS $[WIN_SYS_LIBS] user32.lib advapi32.lib winmm.lib
+
+  #define COMBINED_SOURCES $[TARGET]_composite1.cxx
+    
+  #define OTHER_LIBS dtoolconfig dtool dtoolbase:c dtoolutil:c \
+    putil:c prc:c interrogatedb:c dconfig:c movies:c
+
+  #define SOURCES \
+      config_openalAudio.h \
+      openalAudioManager.h \
+      openalAudioSound.I \
+      openalAudioSound.h
+
+  #define INCLUDED_SOURCES \
+      config_openalAudio.cxx openalAudioManager.cxx openalAudioSound.cxx
+
+#end lib_target
 
 //#begin lib_target
 //  #define TARGET audio_linux
Index: panda/src/audiotraits/openalAudioManager.h
===================================================================
RCS file: /cvsroot/panda3d/panda/src/audiotraits/openalAudioManager.h,v
retrieving revision 1.4
diff -u -r1.4 openalAudioManager.h
--- panda/src/audiotraits/openalAudioManager.h	29 Aug 2007 21:04:47 -0000	1.4
+++ panda/src/audiotraits/openalAudioManager.h	19 Nov 2007 19:39:53 -0000
@@ -30,8 +30,8 @@
 #include "pset.h"
 #include "movieAudioCursor.h"
 
-#include <AL/al.h>
-#include <AL/alc.h>
+#include <al.h>
+#include <alc.h>
 
 class OpenALAudioSound;
 
Index: panda/src/audiotraits/openalAudioSound.h
===================================================================
RCS file: /cvsroot/panda3d/panda/src/audiotraits/openalAudioSound.h,v
retrieving revision 1.4
diff -u -r1.4 openalAudioSound.h
--- panda/src/audiotraits/openalAudioSound.h	29 Aug 2007 21:04:47 -0000	1.4
+++ panda/src/audiotraits/openalAudioSound.h	19 Nov 2007 19:39:53 -0000
@@ -26,12 +26,12 @@
 
 #ifdef HAVE_OPENAL //[
 
+#include "openalAudioManager.h"
 #include "audioSound.h"
 #include "movieAudioCursor.h"
 #include "trueClock.h"
-
-#include <AL/al.h>
-#include <AL/alc.h>
+#include <al.h>
+#include <alc.h>
 
 class EXPCL_OPENAL_AUDIO OpenALAudioSound : public AudioSound {
   friend class OpenALAudioManager;
Index: panda/src/glstuff/glGraphicsStateGuardian_src.h
===================================================================
RCS file: /cvsroot/panda3d/panda/src/glstuff/glGraphicsStateGuardian_src.h,v
retrieving revision 1.128
diff -u -r1.128 glGraphicsStateGuardian_src.h
--- panda/src/glstuff/glGraphicsStateGuardian_src.h	19 Jul 2007 16:16:41 -0000	1.128
+++ panda/src/glstuff/glGraphicsStateGuardian_src.h	19 Nov 2007 19:39:54 -0000
@@ -18,6 +18,8 @@
 
 #include "pandabase.h"
 
+#include "gl.h"
+#include "panda_glext.h"
 #include "graphicsStateGuardian.h"
 #include "geomVertexColumn.h"
 #include "texture.h"
@@ -81,6 +83,28 @@
 typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
 typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
 typedef void (APIENTRY * PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face);
+// -- by reto spoerri (just so i know what i changed) --
+typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count);
+typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights);
+typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers);
+typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers);
+typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer);
+typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer);
+typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers);
+typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers);
+typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target);
+// -- end of reto spoerri --
 #endif  // __EDG__
 
 ////////////////////////////////////////////////////////////////////
Index: panda/src/grutil/ffmpegTexture.h
===================================================================
RCS file: /cvsroot/panda3d/panda/src/grutil/ffmpegTexture.h,v
retrieving revision 1.7
diff -u -r1.7 ffmpegTexture.h
--- panda/src/grutil/ffmpegTexture.h	20 Jul 2007 23:02:54 -0000	1.7
+++ panda/src/grutil/ffmpegTexture.h	19 Nov 2007 19:39:54 -0000
@@ -24,8 +24,10 @@
 
 #include "videoTexture.h"
 
-#include "avcodec.h"
-#include "avformat.h"
+extern "C" { 
+  #include "avcodec.h"
+  #include "avformat.h"
+}
 
 ////////////////////////////////////////////////////////////////////
 //       Class : OpenCVTexture
Index: panda/src/movies/ffmpegAudioCursor.cxx
===================================================================
RCS file: /cvsroot/panda3d/panda/src/movies/ffmpegAudioCursor.cxx,v
retrieving revision 1.3
diff -u -r1.3 ffmpegAudioCursor.cxx
--- panda/src/movies/ffmpegAudioCursor.cxx	2 Oct 2007 17:17:48 -0000	1.3
+++ panda/src/movies/ffmpegAudioCursor.cxx	19 Nov 2007 19:39:55 -0000
@@ -19,8 +19,10 @@
 #ifdef HAVE_FFMPEG
 
 #include "ffmpegAudioCursor.h"
-#include "avcodec.h"
-#include "avformat.h"
+extern "C" {
+  #include "avcodec.h"
+  #include "avformat.h"
+}
 
 TypeHandle FfmpegAudioCursor::_type_handle;
 
Index: panda/src/movies/ffmpegVideoCursor.cxx
===================================================================
RCS file: /cvsroot/panda3d/panda/src/movies/ffmpegVideoCursor.cxx,v
retrieving revision 1.4
diff -u -r1.4 ffmpegVideoCursor.cxx
--- panda/src/movies/ffmpegVideoCursor.cxx	26 Oct 2007 21:54:54 -0000	1.4
+++ panda/src/movies/ffmpegVideoCursor.cxx	19 Nov 2007 19:39:55 -0000
@@ -20,8 +20,10 @@
 
 #include "ffmpegVideoCursor.h"
 #include "config_movies.h"
-#include "avcodec.h"
-#include "avformat.h"
+extern "C" {
+  #include "avcodec.h"
+  #include "avformat.h"
+}
 #include "pStatCollector.h"
 #include "pStatTimer.h"
 
Index: panda/src/nativenet/socket_fdset.h
===================================================================
RCS file: /cvsroot/panda3d/panda/src/nativenet/socket_fdset.h,v
retrieving revision 1.4
diff -u -r1.4 socket_fdset.h
--- panda/src/nativenet/socket_fdset.h	7 Mar 2007 21:57:25 -0000	1.4
+++ panda/src/nativenet/socket_fdset.h	19 Nov 2007 19:39:55 -0000
@@ -36,7 +36,7 @@
     
     friend struct Socket_Selector;
     SOCKET _maxid;
-    fd_set _the_set;
+    mutable fd_set _the_set;
 };
 
 ////////////////////////////////////////////////////////////////////
Index: panda/src/osxdisplay/osxGraphicsPipe.h
===================================================================
RCS file: /cvsroot/panda3d/panda/src/osxdisplay/osxGraphicsPipe.h,v
retrieving revision 1.8
diff -u -r1.8 osxGraphicsPipe.h
--- panda/src/osxdisplay/osxGraphicsPipe.h	14 Jul 2007 05:49:43 -0000	1.8
+++ panda/src/osxdisplay/osxGraphicsPipe.h	19 Nov 2007 19:39:55 -0000
@@ -16,6 +16,8 @@
 #ifndef OSXGRAPHICSPIPE_H
 #define OSXGRAPHICSPIPE_H
 
+#include "gl.h"
+#include "panda_glext.h"
 #include "pandabase.h"
 #include "graphicspipe.h"
 
Index: panda/src/osxdisplay/osxGraphicsWindow.h
===================================================================
RCS file: /cvsroot/panda3d/panda/src/osxdisplay/osxGraphicsWindow.h,v
retrieving revision 1.18
diff -u -r1.18 osxGraphicsWindow.h
--- panda/src/osxdisplay/osxGraphicsWindow.h	2 Nov 2007 23:33:48 -0000	1.18
+++ panda/src/osxdisplay/osxGraphicsWindow.h	19 Nov 2007 19:39:55 -0000
@@ -19,6 +19,7 @@
 #include "pandabase.h"
 #include "graphicsWindow.h"
 #include "buttonHandle.h"
+#include "panda_glext.h"
 
 #include <Carbon/Carbon.h>
 
Index: panda/src/pandabase/pandabase.h
===================================================================
RCS file: /cvsroot/panda3d/panda/src/pandabase/pandabase.h,v
retrieving revision 1.6
diff -u -r1.6 pandabase.h
--- panda/src/pandabase/pandabase.h	13 Feb 2004 19:27:46 -0000	1.6
+++ panda/src/pandabase/pandabase.h	19 Nov 2007 19:39:55 -0000
@@ -20,6 +20,8 @@
    C or C++ file.  It must be compilable for C as well as C++ files,
    so no C++-specific code or syntax can be put here. */
 
+#define HAVE_OPENAL 1
+
 #ifndef PANDABASE_H
 #define PANDABASE_H
 

[/code]

About the compile error, like you might have seen it changes socket_fdset.h with the patch applied i get the above error, without the patch applied i get the error:

g++ -ftemplate-depth-30  -c -o Opt3-OSX/nativenet_nativenet_composite1.o -I. -I/Volumes/OSX/_DOWNLOADS/_DEVELOPMENT/_LIBRARYS/Panda3d-CVS-pp/panda3d/panda -I../express -I../pandabase -I/usr/local/panda/include -I/Library/Frameworks/Python.framework/Versions/2.4/include/python2.4 -I/opt/local/include    -g -O2 -fPIC nativenet_composite1.cxx
socket_fdset.h: In member function ‘bool Socket_fdset::isSetForNative(SOCKET) const’:
socket_fdset.h:80: error: invalid conversion from ‘const fd_set*’ to ‘fd_set*’
socket_fdset.h:80: error:   initializing argument 2 of ‘int __darwin_fd_isset(int, fd_set*)’
make: *** [Opt3-OSX/nativenet_nativenet_composite1.o] Error 1

but now it’s time to go to bed…

I also tried compiling Panda3D on OSX 10.5 and used some slightly different approach.

I used edalytical’s guide as starting point and all these additonal steps are necessary use his guide to compile Panda3D on Leopard.

  1. Config.pp
    In the Config.pp, TAR_IPATH and TAR_LPATH need to removed. Tar support runs into an error with interrogate I couldn’t fix and resorted to disabling tar support.

  2. dtool/pptempl/Global.pp
    interrogate went over lots of header in /usr/include and choked on many of them, especially _structs.h. I noticed that interrogate gets called with -S/usr/include and removing that option kept it from trying to parse the system headers. The option is hard-coded in the Global.pp on line 751.
    Changed the lin to:

#defer interrogate_ipath $[install_parser_inc_dir:%=-S%] $[target_ipath:%=-I%]

Panda and the python libararies compiled fine without this option but I’m not sure if some of the following problems are caused by this removal.

  1. panda/src/nativenet/socket_fdset.h
    I had to change line 39 to:
mutable fd_set _the_set;

Now, I thought the line was “const fd_set _the_set;” but in my current fresh CVS checkout it reads “fd_set _the_set;” so I dont’ know if this got fixed already.

  1. panda/src/nativenet/socket_portable.h
    interrogate couldn’t find some definitions used in socket_portable.h so I had to add them. fd_set and fd_mask actually get defined fine on compilation and wrapping the definitions in a #ifndef made both interrogate and the compiler happy. sockaddr_in gets defined in socket_adress.h but that doesn’t seem to get picked up in socket_portable.h for some reason…
    Add following lines after line 265 “#include <unistd.h>”:
typedef struct sockaddr_in AddressType;

#ifndef _FD_SET
typedef long fd_mask;
typedef struct fd_set {
	fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
} fd_set;
#endif
  1. panda/glstuff/glGraphicsStateGuardian_src.h
    There were some more definitions needed in glGraphicsStateGuardian_src.h and I added them following Hypnos’ instructions after line 83:
typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count);
typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights);
typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer);
typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer);
typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers);
typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers);
typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer);
typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer);
typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers);
typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers);
typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target);
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target);

I think that’s all I’ve done and it compiled and worked with a fresh CVS checkout.

Now I’m off to add OpenAL…

OpenAL is broken on OSX. I tried using the bundled library that comes with Leopard and freshly compiled one from the OpenAL CVS. They both output sound but playing two audio files concurrently produces a “corruption in stream queue” error eventually.

From looking at the code (openalAudioSound.cxx line 461) that prints this error, there’s a problem with OSX OpenAL’s buffer queue. The Panda OpenAL library keeps a local copy of the buffer queue and when it tries to clear the queue of used buffers the queue either returns garbage or doesn’t keep the buffers in the same order they are stored in the pandas local queue.

I then gave up trying to get OpenAL to work and moved on to FMOD and that turned out to work just fine!

  1. Download and install FMOD Ex programmers API from the FMOD homepage. I chose the development version 4.09.08.

  2. Rename the directory FMOD got installed in and remove the spaces.
    /Developer/FMOD Programmers API/
    to e.g.
    /Developer/FMOD_Programmers_API/

  3. Add following lines to your Config.pp

#define FMODEX_IPATH /Developer/FMOD_Programmers_API/api/inc
#define FMODEX_LPATH /Developer/FMOD_Programmers_API/api/lib
  1. Compile!

  2. The libfmod_audio links to ./libfmodex.dylib in the same directory. I suppose this is a feature to make redistributing your application with FMOD easier. Therefore you have to copy the library to the panda library directory:

cp /Developer/FMOD_Programmers_API/api/lib/libfmodex.dylib /usr/local/panda/lib/

I’ve only tested the Panda Musicbox example and playing four different mp3s concurrently on both the Sfx and Music channels. Both cases worked fine and the audio glitch I had with OpenAL is gone too.

I can build with libtar if I add a typedef for ssize_t in the file dtool/src/parser-inc/stdtypedefs.h

I’m including the diff for completeness.

--- panda3d-1.5.0/dtool/src/parser-inc/stdtypedefs.h	2008-01-17 12:27:54.000000000 -0700
+++ panda3d-1.5.0-patch/dtool/src/parser-inc/stdtypedefs.h	2008-03-26 09:26:01.000000000 -0700
@@ -25,6 +25,7 @@
 #define STDTYPEDEFS_H
 #ifndef __APPLE__
 typedef unsigned int size_t;
+typedef signed int ssize_t;
 typedef int off_t;
 typedef unsigned int time_t;
 typedef int clock_t;

Although it’s only useful for compressing animation tables into Panda’s binary bam format, I had to make the following changes for FFTW support.

In my Config.pp:

#define FFTW_IPATH /opt/local/include
#define FFTW_LPATH /opt/local/lib
#define FFTW_LIBS drfftw

In panda/src/mathutil/fftCompressor.cxx I had to change the include from “rfftw.h” to “drfftw.h”.

Again, I’m including the diff for completeness.

--- panda3d-1.5.0/panda/src/mathutil/fftCompressor.cxx	2007-06-22 05:33:47.000000000 -0700
+++ panda3d-1.5.0-patch/panda/src/mathutil/fftCompressor.cxx	2008-03-28 17:58:13.000000000 -0700
@@ -34,7 +34,7 @@
 #ifdef howmany
 #undef howmany
 #endif
-#include "rfftw.h"
+#include "drfftw.h"
 
 // These FFTW support objects can only be defined if we actually have
 // the FFTW library available.

These changes appear to be necessary because the library and include files are named differently when installed from MacPorts.

I have encountered a problem while trying to use ode (libpode).

the problem is that the module is named libpode.dylib/.so, the init function it searches at python import (genPyCode) is _initlibpode:
ImportError: Loaded module does not contain symbol _initlibpode

however it does contain a function which probably could be found using the name _initlibode. Just changing the name from libpode.dylib (and .so) to libode.dylib/.so doesnt help as it’s conflicting the the “real” libode.dylib.

Is there a way to change the panda ode library to be named pode instead of ode (internally), this should solve the problem afaik.

PS: sorry im got a cold and my mind is a bit clouded :wink: I hope you understand me never the less.

<problem solved, see next post>