OSX Mavericks Compile Issue

I’m running into this compile error when trying to build 1.8.1 from source using makepanda. It appears that panda_glext.h is auto generated, does anyone have a work around for this?

[ 47%] Building C++ object built/tmp/p3glgsg_config_glgsg.o
In file included from panda/src/glgsg/config_glgsg.cxx:16:
In file included from panda/src/glgsg/glgsg.h:86:
built/include/panda_glext.h:3411:22: error: typedef redefinition with different types
(‘unsigned int’ vs 'void ')
typedef unsigned int GLhandleARB; /
shader object handle */
^
/System/Library/Frameworks/OpenGL.framework/Headers/gltypes.h:65:15: note: previous definition is
here
typedef void *GLhandleARB;
^
1 error generated.

Hmm, try the latest version of panda_glext.h:
panda3d.cvs.sourceforge.net/view … da_glext.h

Though if you’re on OS X Mavericks, I would advise that you try to compile the latest CVS version of Panda instead.

I tried that as well. I modified the typedef in that file you mentioned to match the OpenGL framework which got past that compile issue. Unfortunately, I’m hitting a number of other different compile issues :confused:

One latest in CVS:

[ 41%] Building C++ object built/tmp/check_adler_check_adler.o
panda/src/downloadertools/check_adler.cxx:30:11: error: use of undeclared identifier
‘check_adler’
cout << check_adler(source_file);
^
1 error generated.

On Panda3D 1.8.1, first error is:

[ 48%] Building C++ object built/tmp/p3osxdisplay_composite1.o
In file included from panda/src/osxdisplay/p3osxdisplay_composite1.cxx:1:
In file included from panda/src/osxdisplay/config_osxdisplay.cxx:16:
panda/src/osxdisplay/osxGraphicsStateGuardian.h:69:3: error: unknown type name
‘CGTableCount’
CGTableCount _sampleCount;
^
In file included from panda/src/osxdisplay/p3osxdisplay_composite1.cxx:2:

I haven’t had time to poke at these compile issues to see if there’s a trivial fix or not yet tho.

Also, on latest in CVS, a compile flag needs to be added in order to fix a compile error on OSX Mavericks:

CFLAGS=-ftemplate-depth=120 // default is 30, which is too low

It looked like there were some templates to calculate some math constants that went a bit too recursive by default.

After fixing some of the compile issues locally, and removing the panda deploy tools (wasn’t correctly recognizing zlib), I’m getting a crash when it is trying to import the modules into python where the python exe is crashing.

[ 88%] Generating ‘pandac’ tree
Importing code library: panda3d.core
Found extensions for class: NodePath
Found extensions for class: Mat3
Found extensions for class: HTTPChannel
Found extensions for class: VBase3
Found extensions for class: VBase4
Importing code library: panda3d.direct
Found extensions for class: CInterval
Importing code library: panda3d.skel
Received SIGSEGV
Storing dependency cache.
Elapsed Time: 3 sec

I’d imagine this is because there’s some sort of mismatch in built python libs (guess)? Anyone else run into this or have any clues where to look?

After trying to compile panda3d and commented 2 lines in order to continue the build, here’s the error I have on Mac os X mavericks :

In file included from panda/src/glgsg/config_glgsg.cxx:16:
In file included from panda/src/glgsg/glgsg.h:88:
built/include/panda_glext.h:5569:22: error: typedef redefinition with different types (‘unsigned int’ vs ‘void *’)
typedef unsigned int GLhandleARB;
^
/System/Library/Frameworks/OpenGL.framework/Headers/gltypes.h:65:15: note: previous definition is here
typedef void *GLhandleARB;
^
1 error generated.
The following command returned a non-zero value: g++ -ftemplate-depth-30 -fPIC -c -o built/tmp/p3glgsg_config_glgsg.o -Ibuilt/tmp -Ibuilt/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -Ipanda/src/glgsg -Ipanda/src/glstuff -Wno-deprecated-declarations -pthread -msse2 -O2 -DBUILDING_PANDAGL panda/src/glgsg/config_glgsg.cxx
Storing dependency cache.
Elapsed Time: 14 min 10 sec
Build process aborting.
Build terminated.
In file included from panda/src/glgsg/glgsg.cxx:19:
In file included from panda/src/glgsg/glgsg.h:88:
built/include/panda_glext.h:5569:22: error: typedef redefinition with different types (‘unsigned int’ vs ‘void *’)
typedef unsigned int GLhandleARB;
^
/System/Library/Frameworks/OpenGL.framework/Headers/gltypes.h:65:15: note: previous definition is here
typedef void *GLhandleARB;
^

Did you have this issue peasus ?

Yeah, I got that issue as well, but I was able to get past it by modifying the source to match the OS X framework definition.

You can fix the typedef in:

panda/src/glstuff/panda_glext.h

#ifndef GL_ARB_shader_objects
/* GL types for program/shader text and shader object handles */
typedef char GLcharARB;
typedef void *GLhandleARB;
#endif

I checked in some fixes yesterday for both issues. I also updated my build at:
rdb.name/Panda3D-1.9.0.dmg

The issue with check_crc and check_adler is that you attempted to build without ZLIB support, which indicates that the thirdparty packages were missing. You can get an (incomplete) copy from:
rdb.name/thirdparty_mac_x86_64.tar.bz2

Thanks for the response RDB!

On 10.9.4, makepanda doesn’t seem to recognize that zlib is installed as I get this line when I run it:

WARNING: Could not locate thirdparty package zlib, excluding from build

I’ve installed zlib through homebrew, but it correctly points out that it’s already installed on my system. I haven’t had time to play around with makepanda to get it to recognize zlib using the supplied suggestion from homebrew:

This formula is keg-only, so it was not symlinked into /usr/local.

"Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you’ll need to add to your
build variables:

LDFLAGS:  -L/usr/local/opt/zlib/lib
CPPFLAGS: -I/usr/local/opt/zlib/include"

I’ll try re-grabbing SVN tonight to see if your fixes work.

If you have any suggestions as to things to try to fix the python import problem I posted about, I’m all ears :slight_smile:

Here’s the callstack as reported by Mac OS X:

Process: Python [2336]
Path: /usr/local/Cellar/python/2.7.7_2/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Identifier: Python
Version: 2.7.7 (2.7.7)
Code Type: X86-64 (Native)
Parent Process: Python [2261]
Responsible: Terminal [327]
User ID: 501

Date/Time: 2014-07-08 21:47:11.198 -0700
OS Version: Mac OS X 10.9.4 (13E28)
Report Version: 11
Anonymous UUID: 9B6C9DF8-C423-C04F-9E39-9E92BF2D7F96

Sleep/Wake UUID: 8E89A8B2-AF9E-491F-A6DC-6C2CC5E8B1BD

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000

VM Regions Near 0:
–>
__TEXT 0000000103d81000-0000000103d83000 [ 8K] r-x/rwx SM=COW /usr/local/Cellar/python/2.7.7_2/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 org.python.python 0x00000001095ad764 PyInt_FromLong + 36
1 physics.so 0x000000010a9a05f0 Dtool_PyModuleClassInit_BaseParticleEmitter(_object*) + 352 (libp3particlesystem_igate.cxx:30787)
2 physics.so 0x000000010aa21e35 BuildInstants(object*) + 21 (libp3particlesystem_igate.cxx:32783)
3 libp3dtoolconfig.1.9.dylib 0x000000010947a6c7 Dtool_PyModuleInitHelper(LibraryDef**, char const*) + 1623 (py_panda.cxx:491)
4 physics.so 0x000000010a90a4bd initphysics + 61
5 org.python.python 0x0000000103e26e02 PyImport_LoadDynamicModule + 140
6 org.python.python 0x0000000103e26b0f import_submodule + 274
7 org.python.python 0x0000000103e266d9 load_next + 280
8 org.python.python 0x0000000103e246c8 PyImport_ImportModuleLevel + 645
9 org.python.python 0x0000000103e0a0dc builtin___import
+ 135
10 org.python.python 0x0000000103e10ac1 PyEval_EvalFrameEx + 7714
11 org.python.python 0x0000000103e15145 fast_function + 192
12 org.python.python 0x0000000103e11c5b PyEval_EvalFrameEx + 12220
13 org.python.python 0x0000000103e15145 fast_function + 192
14 org.python.python 0x0000000103e11c5b PyEval_EvalFrameEx + 12220
15 org.python.python 0x0000000103e0eb0e PyEval_EvalCodeEx + 1608
16 org.python.python 0x0000000103e0e4c0 PyEval_EvalCode + 54
17 org.python.python 0x0000000103e2e2ec run_mod + 53
18 org.python.python 0x0000000103e2e38f PyRun_FileExFlags + 133
19 org.python.python 0x0000000103e2df2c PyRun_SimpleFileExFlags + 769
20 org.python.python 0x0000000103e3f47a Py_Main + 2970
21 libdyld.dylib 0x00007fff860325fd start + 1

Thread 0 crashed with X86 Thread State (64-bit):
rax: 0x00000001097180e0 rbx: 0x0000000000000000 rcx: 0x000000010aaa6390 rdx: 0x0000000000000000
rdi: 0x0000000000000000 rsi: 0x00000001044e8030 rbp: 0x00007fff5be7d870 rsp: 0x00007fff5be7d860
r8: 0x00007f89b2d74bc0 r9: 0x0000000109724610 r10: 0x00000000409a961b r11: 0x00000001095d1fb0
r12: 0x00007f89b3800600 r13: 0x00007f89b3800600 r14: 0x000000010a90a480 r15: 0x0000000103eb6138
rip: 0x00000001095ad764 rfl: 0x0000000000010287 cr2: 0x0000000000000000

Logical CPU: 2
Error Code: 0x00000006
Trap Number: 14

I wouldn’t mind debugging it this weekend, but I don’t know of a good way to generate an Xcode project with your tools, unless I’m missing something?

Ooop, here’s the build output in case that helps:

Importing code library: panda3d.core
Found extensions for class: NodePath
Found extensions for class: Mat3
Found extensions for class: HTTPChannel
Found extensions for class: VBase3
Found extensions for class: VBase4
Importing code library: panda3d.physics
Received SIGSEGV
Storing dependency cache.
Elapsed Time: 14 sec

Build terminated.

Thank you!

[ 66%] Building C++ object built/tmp/p3objegg_eggToObjConverter.o
pandatool/src/objegg/eggToObjConverter.cxx:156:18: error: cannot cast from type
‘ostream’ (aka ‘basic_ostream’) to pointer type ‘void *’
bool success = (void *)(*file) != NULL;

Looks like it should just be a NULL pointer check after fixing, everything fully compiles.

It appears the zlib error was either fixed, or it was an issue with having the homebrew install of zlib installed (I’ve since uninstalled that keg).

However, I’m still getting the crash during the final step :confused:

[ 92%] Generating ‘pandac’ tree
Importing code library: panda3d.core
Found extensions for class: NodePath
Found extensions for class: Mat3
Found extensions for class: HTTPChannel
Found extensions for class: VBase3
Found extensions for class: VBase4
Importing code library: panda3d.physics
Received SIGSEGV
Storing dependency cache.
Elapsed Time: 8 min 8 sec

Build terminated.

__TEXT                 000000010fe44000-000000010fe46000 [    8K] r-x/rwx SM=COW  /usr/local/Cellar/python/2.7.7_2/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 org.python.python 0x0000000112df6764 PyInt_FromLong + 36
1 physics.so 0x000000011418d376 Dtool_PyModuleClassInit_BaseParticleEmitter(_object*) + 166
2 physics.so 0x00000001141c367e BuildInstants(_object*) + 14
3 libp3dtoolconfig.1.9.dylib 0x0000000112d6ef39 Dtool_PyModuleInitHelper(LibraryDef**, char const*) + 345
4 physics.so 0x000000011415332d initphysics + 61
5 org.python.python 0x000000010fee4e02 _PyImport_LoadDynamicModule + 140
6 org.python.python 0x000000010fee4b0f import_submodule + 274
7 org.python.python 0x000000010fee46d9 load_next + 280
8 org.python.python 0x000000010fee26c8 PyImport_ImportModuleLevel + 645

Hi there:

Thanks for this thread, very helpful.

I’m experiencing a later compilation error (see below). Any suggestions would be great.
Thanks!

[ 67%] Building C++ object built/tmp/p3objegg_eggToObjConverter.o
pandatool/src/objegg/eggToObjConverter.cxx:156:18: error: cannot cast from type ‘ostream’ (aka ‘basic_ostream’) to pointer type ‘void *’
bool success = (void *)(*file) != NULL;
^~~~~~~~~~~~~~~
1 error generated.
Storing dependency cache.
Elapsed Time: 3 sec
The following command returned a non-zero value: g++ -ftemplate-depth-30 -fPIC -c -o built/tmp/p3objegg_eggToObjConverter.o -Ibuilt/tmp -Ibuilt/include -I/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/include/python2.7 -Ipandatool/src/objegg -Wno-deprecated-declarations -pthread -msse2 -O2 pandatool/src/objegg/eggToObjConverter.cxx
Build terminated.

Yep … also fixing the null pointer check in eggToObjConverter.cxx fixes my problem. I’m now experiencing the same issue reported just above by the OP.

I also disabled a bunch of libraries (physics, SKEL, etc), but still observe a crash at the same location, now when trying to import the panda3d.egg library.

[ 92%] Generating ‘pandac’ tree
Importing code library: panda3d.core
Found extensions for class: NodePath
Found extensions for class: Mat3
Found extensions for class: HTTPChannel
Found extensions for class: VBase3
Found extensions for class: VBase4
Importing code library: panda3d.direct
Found extensions for class: CInterval
Importing code library: panda3d.egg
Received SIGSEGV
Storing dependency cache.
Elapsed Time: 21 min 29 sec

Build terminated.

Any further thoughts on this?
Thanks!

I haven’t been able to put in any further time into looking at it :confused:

It would be useful to see a gdb stack trace. I think makepanda can show one automatically when you add the --verbose flag.

Verbose doesn’t yield any new useful output :confused: Is there an easy way of connecting a debugger to get you more information?

–verbose should add a lot of extra output, including gdb traceback. If that does not happen for some reason, you copy the command that makepanda runs (it is printed out in verbose mode) and you copy that into your shell, except you add “gdb --args” at the beginning, you type “run” in the gdb shell, and “bt” to get a stacktrace after it crashes.