1. pygame
  2. pygame
  3. pygame
  4. Issues

Issues

Issue #103 resolved

Problem installing with Homebrew/pip on OS X Lion

dronir
created an issue

Trying in install Pygame on Lion, following the instructions from illume here: https://bitbucket.org/pygame/pygame/issue/82/homebrew-on-leopard-fails-to-install

I have the homebrew installation of Python as my default one. {{{ $ which python /usr/local/bin/python }}} Using the following commands: {{{ brew install sdl sdl_image sdl_mixer sdl_ttf smpeg portmidi pip install hg+http://bitbucket.org/pygame/pygame }}} (First of all portmidi fails to install from homebrew because a hash discrepancy, but I disregarded this for now.)

When building Pygame, I get warnings of the following kind:

{{{ building 'pygame.mixer' extension

/usr/bin/llvm-gcc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -O3 -w -pipe -march=core2 -msse4.1 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Ddarwin -D_THREAD_SAFE -I/usr/X11R6/include -I/usr/local/include/SDL -I/usr/local/include/SDL -I/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/mixer.c -o build/temp.macosx-10.5-intel-2.7/src/mixer.o

/usr/bin/llvm-gcc -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -isysroot / -L/usr/local/Cellar/readline/6.2.2/lib build/temp.macosx-10.5-intel-2.7/src/mixer.o -L/usr/local/lib -L/usr/local/lib -lSDLmain -lSDL -lSDL_mixer -o build/lib.macosx-10.5-intel-2.7/pygame/mixer.so -Wl,-framework,Cocoa

ld: warning: ignoring file /usr/local/lib/libSDLmain.a, file was built for archive which is not the architecture being linked (i386)

ld: warning: ignoring file /usr/local/lib/libSDL.dylib, file was built for unsupported file format which is not the architecture being linked (i386)

ld: warning: ignoring file /usr/local/lib/libSDL_mixer.dylib, file was built for unsupported file format which is not the architecture being linked (i386) }}} This happens to all extensions using SDL. Pygame does build despite the warnings, but functionality is lost. Spent a while with Google trying to figure out what to do about it, but couldn't find any solution.

Edit: separated the output lines for legibility.

Comments (8)

  1. René Dudfield
    • changed status to open

    Hi,

    it looks like your architechture is not i386... but it is building pygame for i386...

    I wonder what your architecture is for sdl? I am guessing it is x86_64 only.

    lipo -info /usr/local/lib/libSDL.dylib
    

    Perhaps try this before compiling pygame?

    export CFLAGS='-isysroot /Developer/SDKs/MacOSX10.6.sdk -arch x86_64'
    
  2. dronir reporter

    The SDL architecture is indeed x86_64.

    $ lipo -info /usr/local/lib/libSDL.dylib
    Non-fat file: /usr/local/lib/libSDL.dylib is architecture: x86_64
    

    Unfortunately that line you suggest does not work. Not only do I still get the same warnings as before, but additionally I get lots of these warnings:

    In file included from /usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:126,
                     from src/pygame.h:80,
                     from src/mixer.c:27:
    /usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/include/python2.7/modsupport.h:27: warning: ‘PyArg_ParseTuple’ is an unrecognized format function type
    

    I'm actually now even more interested in this problem, because I encountered the same problem at work, trying to build an otherwise unrelated Python module written in C that my coworker wrote.

  3. dronir reporter

    I wonder if this is related to the issue that uname -p returns i386 on OS X for some reason, even if it's a x86_64 system. At the same time uname -m does return x86_64.

  4. Log in to comment