#125 build errors on OpenBSD 3.6 with partial solution

v2.0.1
open
nobody
build (28)
5
2005-02-02
2005-02-02
Sigma Nunki
No

I just downloaded PyOpenGL-2.0.2.01.tar.gz and
attempted to build, but I got errors that GL/glu.h, etc
wasn't there.

In config/openbsd.cfg:
include_dirs=/usr/include:/usr/local/include:/usr/X11/include

Should be:
include_dirs=/usr/include:/usr/local/include:/usr/X11R6/include

which I then got errors in
src/interface_util/interface_util.c:

src/interface_util/interface_util.c:8: syntax error
before `#'
src/interface_util/interface_util.c:xx: stray '\' in
program
...
src/interface_util/interface_util.c:13: syntax error
before `switch'
error: command 'cc' failed with exit status 1

Once the '\' were removed I still got (when starting
build_clib):
src/interface_util/interface_util.c:8: syntax error
before `#'
src/interface_util/interface_util.c:13: syntax error
before `switch'
error: command 'cc' failed with exit status 1

Which I cannot resolve. ie I don't know what's the
problem with:
#define _PyTuple_From(NAME, BASE, PY_OBJECT)\^M
PyObject* _PyTuple_From##NAME(int len, BASE* data)^M

Discussion

  • Logged In: YES
    user_id=34901

    Those ^M's are the unix-ish way of displaying a
    windows-style \r\n line ending. For some reason when you
    are unpacking the source it's not properly converting the
    line endings. This could be a problem with the source
    archive, but it would seem the compiler *should* handle
    foreign line-endings, no?

     
  • Sigma Nunki
    Sigma Nunki
    2005-02-04

    Logged In: YES
    user_id=67411

    The ^M's aren't the problem (I beleive that gcc ignores
    them). There are extra '\'s which (apparently) give errors.
    Though there is an error before that so that would be in
    question. I removed them just incase (probably should've
    mentioned that ;)). The errors with the '\'s might
    (probably?) be one of those errors that go away after you
    resolve the first one.

    So on line 7,8 of src/interface_util/interface_util.c we have:

    #define _PyTuple_From(NAME, BASE, PY_OBJECT)\^M
    PyObject* _PyTuple_From##NAME(int len, BASE* data)\^M

    But I have no clue with might be wrong here. I've never
    done something like this before. Apparently it has
    something to do with the ##.

    Or maybe it's the # in the #define and the error is in
    src/config.h?

    Here's the output from a clean extract, patched openbsd.cfg
    (python setup.py build):
    [snip]
    running build_clib
    building 'interface_util' library
    creating build/temp.openbsd-3.6-i386-2.3
    creating build/temp.openbsd-3.6-i386-2.3/src
    creating build/temp.openbsd-3.6-i386-2.3/src/interface_util
    cc -pthread -fno-strict-aliasing -DNDEBUG -O2
    -DTHREAD_STACK_SIZE=0x100000 -fPIC -fPIC -DGLX_PLATFORM
    -DNUMERIC -I/usr/local/include/python2.3 -I/usr/include
    -I/usr/local/include -I/usr/X11R6/include
    -I/usr/local/include/python2.3/Numeric -I/usr/include
    -I/usr/local/include -I/usr/X11R6/include
    -I/usr/local/include/python2.3/Numeric -c
    src/interface_util/interface_util.c -o
    build/temp.openbsd-3.6-i386-2.3/src/interface_util/interface_util.o
    src/interface_util/interface_util.c:8: syntax error before `#'
    src/interface_util/interface_util.c:8: stray '\' in program
    src/interface_util/interface_util.c:9: stray '\' in program
    src/interface_util/interface_util.c:10: stray '\' in program
    src/interface_util/interface_util.c:11: stray '\' in program
    src/interface_util/interface_util.c:12: stray '\' in program
    src/interface_util/interface_util.c:13: syntax error before
    `switch'
    error: command 'cc' failed with exit status 1

    Sorry if I've wasted some time here, but, as an after
    thought, I was poking around the output aside from the
    errors given and found that pyopengl requires (?) swig
    1.3.23. OBSD has only 1.3.21. Given that the name of this
    file is interface_util.c, could this be the issue? Or is
    1.3.21 ok? Or does this even matter given that it tries
    anyway?

    You fixed the openbsd.cfg, yes?

     
  • Sigma Nunki
    Sigma Nunki
    2005-02-05

    Logged In: YES
    user_id=67411

    I just noticed as well, in config/openbsd.cfg the same path
    is incorrect for the library_dirs:

    This:
    library_dirs=/usr/lib:/usr/local/lib:/usr/X11/lib^M

    Should be:
    library_dirs=/usr/lib:/usr/local/lib:/usr/X11R6/lib^M