#142 Build failure on Mac, gcc-4.0

open
nobody
build (28)
5
2006-03-16
2006-03-16
Graham Cummins
No

I haven't been able to get a build of PyOpenGL to work on Macintosh
(10.4) for some time. I can build_w OK, but during build_ext I get lots
of errors of the form:

from src/interface/GL.3DFX._multisample.c:6:
/System/Library/Frameworks/Kernel.framework/Headers/sys/stat.h:
225: error: field 'st_atimespec' has incomplete type

This is for version 2.0.2.01, using python 2.4.2, on Mac OSX 10.4.5
with the gcc-4.0 provided by Xcode/Developer tools 2.2.1

I initially tried this on a MacBook pro (Intel), but have since seen the
same errors on a powerpc based Mac. I've also seen them in version
2.0.1.09, and the cvs source checked out today (3-15-06).

If I'm remembering correctly, this could be workd around (at least in
version 2.0.1.09) by compiling with gcc-3.3 rather than 4.0

I'm not sure that still works, but even if it does, it will be hard luck for
me, since the Intel based macs are only supported by gcc-4.0.

In any case, any help building on recent Macs would be greatly
appreciated. Thanks.

BTW: I also had to edit a line in setup/build_w.py in order to rebuild
the wrappers.
This is line 20:
data = stderr.read()
data = sout.read()+stderr.read()

I was getting the output of "swig -version" on stdout, not stderr, so the
original code resulted in an empty string for "data" and the swig
version check always failed.

Discussion

  • Graham Cummins
    Graham Cummins
    2006-03-17

    Logged In: YES
    user_id=1050793

    Found a solution for this.

    This error is caused by having /System/Library/Frameworks/
    Kernel.frameworks/Headers in the "include_dirs" defined in config/
    darwin.cfg. It seems that this causes Python.h to include the wrong stat.h.
    Removing that line fixes that issue.

    I got some other errors from files using #include <GL/glext.h>, but I was
    able to solve those with a (very) nasty hack of symlinking /System/Library/
    Frameworks/OpenGL.framework/Headers into itself under the alternate name
    "GL".

    I was still not able to compile 2.1.2.01, but I with these two modifications I
    could compile 2.0.1.09 for intel macintosh using gcc-4.0, which is good
    enough for me for now.

     
  • Logged In: NO

    This worked for me