Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mckib2/boostinator
Make Boost C++ libraries available for building Python C/C++ extensions
https://github.com/mckib2/boostinator
Last synced: about 1 month ago
JSON representation
Make Boost C++ libraries available for building Python C/C++ extensions
- Host: GitHub
- URL: https://github.com/mckib2/boostinator
- Owner: mckib2
- License: mit
- Created: 2020-11-19T02:56:05.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2020-11-19T04:32:20.000Z (about 4 years ago)
- Last Synced: 2024-12-02T11:58:13.419Z (about 2 months ago)
- Language: Python
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
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:
.. code-block::
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:
.. code-block:: python
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.:
.. code-block:: python
from distutils.core import setup
from setuptools import Extension
from boostinator import get_include_dirsetup(
...
ext_modules=[
Extension(
'my.CoolExtension',
sources=['myCythonFile.pyx', 'myCppFile.cpp'],
include_dirs=[str(get_include_dir())], # include boost headers
language='c++',
),
],
)