Skip to content

ttroy50/pybind11-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pybind11 example

This repo has a basic example of using pybind11 from CMake.

More details are available from here

Requirments:

  • CMake
  • pybind11 (v2.2 or higher)
  • gcc
  • python (and python-dev)

To build you can do

mkdir build
cd build
cmake ..
make 

To run the python example code, from the build directory run:

PYTHONPATH=. python3 ../bindings.py

or directly from CMake run

make test

Run in Docker

For ease of use I have a docker container based on Ubuntu 18.04 with all requirements installed.

To run this container you can do

docker run -it -v `pwd`:/data/code matrim/pybind-example /bin/bash

Then cd /data/code and build the example as per the instructions above.

About

Simple example of using pybind11.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published