Skip to content

Make Boost C++ libraries available for building Python C/C++ extensions

License

MIT, BSL-1.0 licenses found

Licenses found

MIT
LICENSE
BSL-1.0
Boost_1_74_0_LICENSE_1_0.txt
Notifications You must be signed in to change notification settings

mckib2/boostinator

Repository files navigation

boostinator

Make Boost C++ libraries available for building Python C/C++ extensions.

NOTE: currently header only supported; shared libraries may be availble in the future.

Installation

Easy pip install:

pip install boostinator

This should install all platform-independent boost headers (currently from boost 1.74.0).

Usage

Exposes a single function to get the include directory:

from boostinator import get_include_dir

# returns a pathlib.Path object
import pathlib
assert isinstance(get_include_dir(), pathlib.Path)

We can now use the libraries when compiling extensions, e.g.:

from distutils.core import setup
from setuptools import Extension
from boostinator import get_include_dir

setup(
...
    ext_modules=[
        Extension(
            'my.CoolExtension',
            sources=['myCythonFile.pyx', 'myCppFile.cpp'],
            include_dirs=[str(get_include_dir())], # include boost headers
            language='c++',
        ),
    ],
)

About

Make Boost C++ libraries available for building Python C/C++ extensions

Resources

License

MIT, BSL-1.0 licenses found

Licenses found

MIT
LICENSE
BSL-1.0
Boost_1_74_0_LICENSE_1_0.txt

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages