Git Product home page Git Product logo

boost_python_exception's Introduction

Travis CI Build Status

boost_python_exception

This is a small library that makes it easier to work with Python exceptions in Boost.Python. The primary target for this project is people who are embedding Python in C++ programs and need to deal with exceptions coming from Python.

Building

The build system is based on waf. You just need Python installed to run the build. The first time you run the build (or after a distclean) you need to install the boost tool:

% python waf update --files=boost

After that, the standard waf commands are all you need:

% python waf configure
% python waf build

The build output will be in build_directory.

Running tests

The tests are built using the Boost Test Library. To run the tests, first do a full build (see above.) Then:

% ./build_directory/src/test/boost_python_exception_tests

This will run all of the tests.

Troubleshooting

Matching up Python and Boost.Python versions

The main place you might have trouble is making sure that you link against the same Python library as Boost.Python. This can be tricky, but use your system tools (e.g. otool, ldd, dependency walker, and so forth) to figure it out. In general, this mismatch will not be apparent except that the test suite will die miserably rather than pass all tests gloriously.

Hopefully we can find a way to figure this out for you (or at least detect the problem) sometime.

Mac OSX + Homebrew problems

It appears that homebrew does not install libpython into /usr/local/lib, and this causes problems since waf expects it to be there. So, if you experience wierd problems on OSX you may need to create a link for libpython:

% sudo ln -s /usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib /usr/local/lib

Or something like that.

This problem manifests itself by our build products linking against a different libpython than libboost_python does. To see if you're experiencing this problem, you can use otool. First, see which libboost_python you're linking against:

% otool -L build_directory/src/test/boost_python_exception_tests | grep libboost_python
... look for the path to libboost_python.dylib ...

Then run otool over that libboost_python:

% otool -L <path to libboost_python>

If they're linking to different libpython's, then you're seeing the problem.

boost_python_exception's People

Contributors

mathmagique avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.