pybind11 Questions

3

Solved

I am trying to build a python module in C++ using pybind11. I have the following code: #include <pybind11/pybind11.h> #include <pybind11/stl.h> #include <pybind11/numpy.h> names...
Cowled asked 26/9, 2019 at 9:43

3

Solved

I am creating a starter project with CMake (3.16.3) and pybind11 (2.4.3) in VSCode (1.46.1) on Ubuntu (20.04) which has both Python 2.7 and 3.8 on it by default. I want to build a module for Python...
Heeler asked 7/7, 2020 at 11:4

1

Solved

I understand the difference between enums and enum classes in the context of C++, but in the context of binding enums and enum classes is there any real difference? Say for example: enum class opti...
Kotta asked 9/7, 2021 at 14:19

2

I've got a class structure similar to the one below, where I have two types A and B with similar signatures that only differ in argument/return type. I then use a class template to be able to proce...
Preset asked 5/7, 2017 at 11:32

1

Solved

A class template consists of pure virtual function and inherited by another class. I am not getting the right path to bind it. Following Error Message has appeared while trying to compile. I have g...
Alban asked 16/2, 2021 at 15:58

3

Solved

I want to build simple app with pybind11, pybind is already installed in my Ubuntu system with cmake (and make install). I use this simple cmake file: cmake_minimum_required(VERSION 3.0 FATAL_ERRO...
Atalanta asked 5/9, 2019 at 21:28

1

I'm trying to create and distribute (with pip) a Python package that has Python code, and C++ code compiled to a .pyd file with Pybind11 (using Visual Studio 2019). I also want to include .pyi stub...
Doralynn asked 24/1, 2021 at 22:55

2

I use a Python virtual environment. Basically, it works fine, but I run into problems when compiling some Python bindings, namely with libIGL and pybind11. CMake has the following Python-related v...
Unicameral asked 18/8, 2017 at 11:16

1

Solved

I have a C++ constructor file (formatting_SQ.cpp) of a header file formatting_SQ.h which I want to link to other constructor files of header files (neat.cpp nnode.cpp link.cpp etc...-> neat.h nn...
Janeyjangle asked 3/10, 2020 at 8:54

2

Solved

I have a c++ function using eigen, which is wrapped using pybind11 so that I can call it from python. A simple version of the intended function returns an Eigen::MatrixXd type, which pybind success...
Allonym asked 24/5, 2019 at 18:14

1

Solved

Does pybind11 work for C++14 and C++17 seamlessly ? I'm planning to use Boost.python for my project which is currently in C++11. In future I may have to upgrade to C++14 or C++17. So I wanted to un...
Adele asked 1/9, 2020 at 7:2

2

Solved

I designed a C++ system that invokes user defined callbacks from procedure running in a separate thread. Simplified system.hpp looks like this: #pragma once #include <atomic> #include <c...
Everrs asked 26/2, 2020 at 9:1

1

I'm currently trying to write a 'setup.py' script that when the user installs the python package automatically compiles my C++ extension bound with 'pybind11'. In Windows, I haven't got any problem...
Thrawn asked 11/6, 2020 at 13:18

2

Solved

Is it possible in Pybind11 to use mpi4py on the Python side and then to hand over the communicator to the C++ side? If so, how would it work? If not, is it possible for example with Boost? And i...
Booma asked 13/3, 2018 at 15:14

1

Solved

I use pybind11 as a wrapper of my C++ code into a python library. It happens that there are arguments that I can't provide or sometimes I want to do a conversion/initialization that I know in the ...
Marcy asked 10/6, 2020 at 17:22

1

Solved

The pybind11 documentation is generally good, but one area in which it is not is explaining the install process and the process of getting and running examples using cmake. I've managed to figure ...
Selfpossessed asked 13/4, 2020 at 20:34

1

Solved

Currently I'm trying to convert a py::dict into its counterpart C++s std::map. Trying to use the automatic conversion like this fails : #include <pybind11/stl.h> namespace py = pybind11; u...
Prokofiev asked 27/3, 2020 at 16:46

3

Solved

I'm trying to compile pybind11 on a Windows machine that has VisualStudio 2015 installed. I also have python 3.5.3 64bit installed, and cmake 2.8.12. I get the error: CMake Error at tools/FindPyth...
Parabasis asked 30/7, 2017 at 8:44

1

Solved

I am trying to add python bindings to a medium-sized C++ scientific code (some tens of thousands LOCs). I have managed to make it work without too many issues, but I have now incurred in an issue w...
Floris asked 22/3, 2020 at 13:32

1

Solved

My final goal is to compile Python C++ extension from my C++ code. Currently to get started I am following a simple example from the first steps of pybind11 documentation. My working environment is...
Impertinence asked 16/3, 2020 at 0:24

1

Solved

I'm trying to learn pybind11 and the first Google result is this page, where you should be guided towards compiling and running some test cases. From this page, I have installed bybind11 by: pip3 ...
Intercessory asked 27/1, 2020 at 20:38

1

Solved

I'm using pybind11 to wrap a C++ class method in a conversion lambda "shim" (I must do this because reasons). One of the method's arguments is defaulted in C++. class A { void meow(Eigen::Matrix...
Sanfred asked 29/7, 2019 at 5:11

1

I am trying to combine a few modules, created by pybind11 and unfortunately can't get it to work. Hopefully someone can help out. I have tried to simplify the problem as much as possible. Am tryin...
Albertinealbertite asked 9/5, 2018 at 16:3

1

Solved

Using Pybind11, I am trying to pass a numpy array to c++ into a std::vector, multiply it by 2, and return this std::vector to python as a numpy array. I have achieved the first step but the third i...
Inside asked 7/11, 2019 at 20:54

2

Solved

Can I use pybind1 to pass a three-dimensional numpy array to a c++ function accepting an Eigen::Tensor as argument. For example, consider the following c++ function: Eigen::Tensor<double, 3&gt...
Satirical asked 16/10, 2019 at 12:0

© 2022 - 2025 — McMap. All rights reserved.