#31 CVS HEAD does not build (OS-X)

build (28)
Jack Jansen

I checked out PyOpenGL from CVS (because the most recent distribution doesn't support Mac OS X yet), but it doesn't build.

First it runs into a shallow error (missing semicolon) in interface/WGL/util.inc, but then it runs into serious problems compiling GL.ARB.matrix_palette.c: lots of undeclared variables, etc.

Tried the whole process again on Linux (to make sure it isn't a Mac OS specific problem) with exactly te same results.


  • Jack Jansen
    Jack Jansen

    Logged In: YES

    Update: I can now build from CVS, after downgrading SWIG to 1.3.9 (I started with the most recent SWIG, 1.3.11), and after fixing a few other things. The main thing I had to fix was add support for extra_link_args in the .cfg file, so I could pass the "-framework GLUT" needed for linking GLUT.

    Let me now I you want this patch,

  • Greg Copeland
    Greg Copeland

    Logged In: YES

    Would you mind submiting a patch for your changes? I think
    this may have some value for others!


    • summary: CVS HEAD does not build --> CVS HEAD does not build (OS-X)
  • Logged In: YES

    Changed summary to be a little more descriptive

  • Jack Jansen
    Jack Jansen

  • Jack Jansen
    Jack Jansen

    Logged In: YES

    Sorry for the delay, but here is the patch that I use to make PyOpenGL build on MacOSX. This is with Python 2.3a0 (i.e. the CVS version), MacOSX 10.2.3, developer tools Dec 2002 (but that shouldn't matter much) and swig 1.3.13 (this is very important). The patch to setup.py is needed for the current state of distutils in CVS, it may not be needed in the future.

  • Logged In: YES

    Patch looks fine to me, I was expecting something much
    larger. Jack, can you explain what the:

    self.output_dir = "" # Try by Jack

    in config.py line is trying to do and/or why it is needed?
    The comment isn't really that helpful ;) .

  • Jack Jansen
    Jack Jansen

    Logged In: YES

    The "self.output_dir = "" # Try by Jack" is a hack, and I'm not sure whether it is needed, or will be needed in the future.

    Distutils in CVS has changed to use the directory part of source files to create the path of the .o file. This was in response to an SF bug report that you couldn't have two source files of the same name in a single distribution, even if they were in different directories. Unfortunately this fix broke building PyOpenGL. After I added this line things work again for me, but it doesn't really look like the correct fix.

    The correct course of action would probably be to comment this out, test building PyOpenGL with CVS python without it, and submitting a Python bug report if it doesn't build.

  • Bob Ippolito
    Bob Ippolito

    Logged In: YES

    I have created a new patch (as soon as I figure out how to
    upload it), that allows PyOpenGL to build on stock python
    2.2 for OS X (but requires the Makefile.jaguar Python
    application bundle to be actually useful).. it works around
    (at least) three major bugs that make it hard to compile
    (1) stock python 2.2 can't have two C extensions with the
    same filename, so I renamed the __init___.so files to
    something else
    (2) OS X GLUT changes the working directory on glutInit
    (3) OS X requires ranlib for static libraries

    To compile, one must also change
    /usr/lib/python2.2/config/Makefile.. -arch i386 needs to be
    removed and this needs to be added (in place of their
    existing definitions):
    LDSHARED= $(CC) $(LDFLAGS) -bundle -bundle_loader
    BLDSHARED= $(CC) $(LDFLAGS) -bundle -bundle_loader

    The makefile changes fix problems regarding the dynamic
    linker in OS X, where exported symbols from multiple modules
    that use SWIG conflict when linked with flat_namespace...
    using bundle_loader and not flat_namespace uses two level
    namespaces and makes it happy.

    It should not harm compilation on any other platform, and it
    integrates Jack's changes as well. This is meant for CVS
    head of PyOpenGL with no additional changes.

    Also, I make have changed tabs to 4-spaces in some of these
    files.. sorry.

  • Logged In: YES

    We have at least one report of building w/out problem on
    OS-X, so I'm going to call this one closed.

    • labels: --> build
    • milestone: --> v2.0.1
    • assigned_to: nobody --> mcfletch
    • status: open --> closed-fixed