when I run pip install .
in the directory where I have my setup.py. I'm using pybind11 to build a python module for my C++ project. (also, on windows 10)
I get this error: https://pastebin.com/xGyFQQk2
Here is the module.cpp code:
Environment pyInitEnvironment(const py::list& pyList, const unsigned int allowedLayers, const unsigned int padding, const unsigned int maxTracersPerGroup) {
return Environment(listToContactVertexGroup(pyList), allowedLayers, padding, maxTracersPerGroup);
}
PYBIND11_MODULE(route_search_superfast, m) {
py::class_<Environment>(m, "Environment")
.def(py::init(&pyInitEnvironment));
py::class_<RandomModel>(m, "RandomModel");
}
And here is my setup.py:
import os, sys
from distutils.core import setup, Extension
from distutils import sysconfig
cpp_args = ['-std=c++11', '-stdlib=libc++', '-mmacosx-version-min=10.7']
rss_module = Extension(
'route_search_superfast',
sources=['module.cpp'],
include_dirs=['pybind11/include'],
language='c++',
extra_compile_args = cpp_args,
)
setup(
name = 'route_search_superfast',
version = '1.0',
description = 'Python package with superfastcode2 C++ extension (PyBind11)',
ext_modules = [rss_module],
)
The only thing that doesn't want to build is my Environment.h & Environment.cpp files. They're quite long, but I can assure you that Visual Studio does build them. Everything works perfectly fine. I can even generate the output .pyd file and import that into python and it will run everything. However, when I try to have the setup script build the C++ project, it throws that console stack (again, found here: https://pastebin.com/xGyFQQk2)
Since the .pyd file works (again, I'm able to import this into python and everything works perfect) is there a way that I can use distutils to simply use the .pyd when installing the package locally?