Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - sib

Pages: [1]
1
Python / Build/Install on OS X
« on: May 25, 2009, 11:47:33 pm »
Hi,

Using setup.py on a mac I was getting errors when the extension module compilation reached the linker stage. Something like "library not found".  This is due to the linker option -l, which doesn't work when you're linking against frameworks.

Solution to install on OS X which worked for me:

1. Install compiled frameworks (per standard SDK documentation) to /Library/Frameworks

2. run "python setup.py build" with the following modfications to the file:

Code: [Select]

#!/usr/bin/env python
# coding=UTF-8

from distutils.core import setup, Extension

setup(name='PySFML',
version='1.4',
description='Python binding for SFML (Simple and Fast Multimedia Library)',
author='RĂ©mi Koenig',
author_email='remi.k2620@gmail.com',
url='http://www.sfml-dev.org/',
license='zlib/png',
ext_modules=[ Extension('PySFML.sf', \
['src/Clock.cpp', 'src/Color.cpp', 'src/Drawable.cpp', \
'src/Event.cpp', 'src/Image.cpp', 'src/Input.cpp', 'src/Key.cpp', 'src/main.cpp', \
'src/Music.cpp', 'src/PostFX.cpp', 'src/Rect.cpp', 'src/RenderWindow.cpp', 'src/Sleep.cpp', \
'src/Sprite.cpp', 'src/String.cpp', 'src/VideoMode.cpp', 'src/View.cpp', 'src/Window.cpp', \
'src/Joy.cpp', 'src/Mouse.cpp', 'src/WindowStyle.cpp', 'src/Blend.cpp', 'src/Sound.cpp', \
'src/SoundBuffer.cpp', 'src/Listener.cpp', 'src/SoundRecorder.cpp', 'src/SoundBufferRecorder.cpp', \
'src/SoundStream.cpp', 'src/Font.cpp', 'src/Glyph.cpp', 'src/Shape.cpp', 'src/WindowSettings.cpp' ], \
extra_link_args=[\
'-framework', 'sfml-graphics', \
'-framework', 'sfml-window', \
'-framework', 'sfml-audio', \
'-framework', 'sfml-system'], \
include_dirs=['../include']
)],
package_dir = {'PySFML':'PySFML'},
packages=['PySFML'],
)


3. then run "python setup.py install" as usual...

Hope that helps some other people who are having trouble. Took me a little while to figure out, as I'm not very familiar with distools yet.



 :shock:  :o

Pages: [1]