[C++-sig] Re: help building hello world example on Debian

David Abrahams dave at boost-consulting.com
Sun Apr 11 15:13:00 CEST 2004


Daniel Holth <dholth at fastmail.fm> writes:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Faheem Mitha wrote:
>
> | Daniel Holth just wrote that distutils works for him on Linux
> | (apparently he uses Gentoo). He mentioned a Python extension
> | package of his called shoutpy which uses boost.python and
> | distutils, and it builds on Debian with no problem. Therefore, I
> | might give this a try.
>
> I'm very glad you've enjoyed my "exemplary" module. And I've also
> figured out boost.build v1. Definitely not harder to figure out than
> automake or even make. It's a very edifying way to build my little C++
> example, too.

I just updated the CVS with a better-commented example directory; see
http://boost-consulting.com/boost/libs/python/example/README, which
should be updated within the hour.  Daniel, it'd be a great idea for
you to make sure that your shoutpy example uses the same techniques,
if you're going to be passing it around as an example.

Why did you do this?  You don't need it:

  # Include definitions needed for Python modules
  SEARCH on python.jam = $(BOOST_BUILD_PATH) ;


> Version 0.5.2 now includes a Jamfile that builds the module.
> http://dingoskidneys.com/shoutpy/
>
> shoutpy is a wrapper that lets you use Python to send compressed audio
> to an icecast server for internet radio broadcast. The wrapper uses
> three files: a header and C++ file to wrap libshout2 in a C++ class,
> and the boost.python declarations in the third.

Nice!  What can one do with this library, in lay terms?

> http://www.xiph.org/~brendan/shout-python/ wraps the same library
> using the Python C api directly; my boost.python binary is 29 times
> larger than that when compiled by distutils and the boost-jam debug
> build is 165 times larger. When you run 'strip' on shoutpy.so the
> extension is only 18 times larger than the C version of almost the
> same thing. But as we know the boost.python wrapper gets written much
> more quickly and in a less dodgy way than often ad-hoc
> direct-to-Python-API code, and if we didn't care about programmer
> efficiency we wouldn't be using Python in the first place.

Well, yeah, and did you try a release build?

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com





More information about the Cplusplus-sig mailing list