License Public Domain
Lines 16
Keywords
Boost::Python (1) Scons (2)
Permissions
Owner: Stou S.
Viewable by Everyone
Editable by All Siafoo Users
Hide
Easily highlight source code for your blog with our Syntax Highlighter. Join Siafoo Now or Learn More

Cross platform Boost::Python modules with Scons Atom Feed 0

In Brief A SCons SConstruct script for generating Boost::Python modules under Linux and OS X.... more
# 's
 1env = Environment (CPPPATH=['/usr/include/python2.6', # Fedora 12
2 '../../include'])
3
4env.SharedLibrary (target='quark_star_ext',
5 source=['pyquark_star.cpp', '../quark_star.cpp'],
6 CPPDEFINES='BUILD_BINDINGS',
7 SHLIBPREFIX='',
8 LIBS=['boost_python'])
9
10# For OS X one mst also set DYLD_LIBRARY_PATH to the location
11# of the boost python dylib
12if env["PLATFORM"] == 'darwin':
13 env.Append(LIBPATH=['/Users/stou/local/lib'],
14 CPPPATH=['/usr/include/python2.5', # OS X
15 '/Users/stou/local/include'],
16 LINKFLAGS='-framework Python -shared')

A SCons SConstruct script for generating Boost::Python modules under Linux and OS X.

Make sure to edit the file to fit your system configuration.

Figuring out the right flags for OS X was quite painful... as painful as actually installing Boost::Python on OS X.

Comments

over 6 years ago (12 Feb 2010 at 10:09 PM) by David Isaacson
Dare I ask why the mac requires so many extra flags? Okay putting your libs in a weird place was part of it : )
over 6 years ago (12 Feb 2010 at 11:31 PM) by Stou S.
It only requires `-shared` and `-framework Python` and since my boost is in a random place it needs an extra couple of include directories. The OS X dev tools really should ship with Boost though.