Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install xbob.extension

How to install xbob.extension

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install xbob.extension
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
Windows (64-bit)
Mac OS X (10.5+)
Linux (32-bit)
Linux (64-bit)
0.2.1 Available View build log
0.2.1 Available View build log
 
Author
License
GPLv3
Dependencies
Imports
Lastest release
version 0.2.1 on Sep 20th, 2013

This package provides a pkg-config bridge for Python/C++ extensions for Bob. You use this package by including it in the setup_requires field of your setup.py file.

Building with zc.buildout is possible using the develop recipe in xbob.buildout. Follow the instructions described on that package for this recipe.

Preparing for C++ Compilation

Creating C++/Python bindings should be trivial. Firstly, edit your setup.py so that you include the following:

from xbob.extension import Extension
...

setup(

  name="xbob.myext",
  version="1.0.0",
  ...

  setup_requires=[
      'xbob.extension',
      ],

  ...
  ext_modules=[
    Extension("xbob.myext._myext",
      [
        "xbob/myext/ext/file1.cpp",
        "xbob/myext/ext/file2.cpp",
        "xbob/myext/ext/main.cpp",
      ],
      pkgconfig = [ #bob modules you depend on
        'bob-math',
        'bob-sp',
        ],
      include_dirs = [ #optionally, include directories
        "xbob/myext/ext/headers/",
        ],
      ),
    ... #add more extensions if you wish
  ],

  ...
  )

These modifications will allow you to compile extensions that are linked against the named pkg-config modules. You can specify the modules of Bob you want to link against. You don't have to specify bob-python, which is automatically added. Furthermore, you can specify any pkg-config module and that will be linked in (for example, opencv). Other modules and options can be set manually using the standard options for python extensions. To hook-in the building on the package through zc.buildout, add the following section to your buildout.cfg:

[xbob.myext]
recipe = xbob.buildout:develop

If you need to build multiple eggs, you will need one entry per project on your buildout.cfg. This includes, possibly, dependent projects. Currently, zc.buildout ignores the setup_requires entry on your setup.py file. The recipe above creates a new interpreter that hooks that package in and builds the project considering variables like prefixes into consideration.

Subscribe to package updates

Last updated Sep 20th, 2013

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.