Closed sarnold closed 4 years ago
Do you have an example with the new style attempt? This example already explicitly does not require or use CMake. You should just be able to drop most of the custom code and use Pybind11Extension.
Are you linking to an external library? Guessing so based on your comment in setup.py. If so, you need to add it and (if building wheels) include it with auditwheel (Linux) or dealocate (macOS). cibuildwheel will do that for you on CI.
Sorry, i didn't push the updated branch until just now: https://github.com/freepn/google-re2/tree/no-link
Also I just got it to build/test locally, so I'll go ahead and merge it into the PR branch. Thanks!
So, after more test variations on github windows the closest I can get with msvc compiler is something gets built, but doesn't load/run from the wheel. Even then I had to add static lib/include paths to setup.py to make anything build; there must a better way I'm not seeing...
I could not get this approach to work on the windows ci runner but it works fine on the unix-y OSs. I'm going to update the re2 python setup based on your cmake example instead.
This is working now on Linux/Macos/Windows: https://github.com/freepn/google-re2 The key thing for non-linux platforms is cmake find_package and/or the toolchain file for the platform (eg, vcpkg).
I have a (mostly) working build using an older/more conventional pybind11 setup.py but when I try to follow this example I get an undefined symbol error when loading the module, eg, to run tests, etc. Neither my setup.py nor the external library have anything to do with cmake, so it would be really helpful if you had an example of such an extension build using the
Pybind11Extension
shown in this example.