I have an example with the following structure.
├── CMakeLists.txt
├── ext
│ └── pybind11
└── main.cpp
CMakeLists.txt
cmake_minimum_required(VERSION 3.5)
project(notworking)
add_subdirectory(ext/pybind11)
add_executable(notworking
main.cpp)
target_link_libraries(notworking PRIVATE python3.6m)
target_link_libraries(notworking PRIVATE pybind11)
main.cpp
#include <pybind11/pybind11.h>
namespace py = pybind11;
int main() { py::object decimal = py::module::import("decimal"); }
And now upon running
╰─ ./notworking
[1] 14879 segmentation fault (core dumped) ./notworking
What am I missing to get this module to load properly here? I have scoured the documentation, in particular the build systems section, but have come up empty.
It also seems to be the case for me when using other wrappers in pybind11 from C++.