Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Windows pybind11 generation #532

Open
j-rivero opened this issue Apr 25, 2023 · 0 comments
Open

Support Windows pybind11 generation #532

j-rivero opened this issue Apr 25, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@j-rivero
Copy link
Contributor

Desired behavior

Current code disable the python generation on Windows. If we enable the compilation, the following problem arises: Build Status

  Angle.cc
  AxisAlignedBox.cc
  Capsule.cc
C:\vcpkg\installed\x64-windows\include\pybind11\detail/type_caster_base.h(482,26): error C2027: use of undefined type '_frame' (compiling source file C:\J\workspace\ign_math-pr-win\ws\gz-math\src\python_pybind11\src\Capsule.cc) [C:\J\workspace\ign_math-pr-win\ws\build\gz-math7\test\FAKE_INSTALL-prefix\src\FAKE_INSTALL-build\src\python_pybind11\math7.vcxproj]
C:\Program Files\Python311\include\pytypedefs.h(22): message : see declaration of '_frame' (compiling source file C:\J\workspace\ign_math-pr-win\ws\gz-math\src\python_pybind11\src\Capsule.cc) [C:\J\workspace\ign_math-pr-win\ws\build\gz-math7\test\FAKE_INSTALL-prefix\src\FAKE_INSTALL-build\src\python_pybind11\math7.vcxproj]
C:\vcpkg\installed\x64-windows\include\pybind11\detail/type_caster_base.h(482,26): error C2027: use of undefined type '_frame' (compiling source file C:\J\workspace\ign_math-pr-win\ws\gz-math\src\python_pybind11\src\_gz_math_pybind11.cc) [C:\J\workspace\ign_math-pr-win\ws\build\gz-math7\test\FAKE_INSTALL-prefix\src\FAKE_INSTALL-build\src\python_pybind11\math7.vcxproj]
C:\Program Files\Python311\include\pytypedefs.h(22): message : see declaration of '_frame' (compiling source file C:\J\workspace\ign_math-pr-win\ws\gz-math\src\python_pybind11\src\_gz_math_pybind11.cc) [C:\J\workspace\ign_math-pr-win\ws\build\gz-math7\test\FAKE_INSTALL-prefix\src\FAKE_INSTALL-build\src\python_pybind11\math7.vcxproj]
C:\vcpkg\installed\x64-windows\include\pybind11\detail/type_caster_base.h(482,26): error C2027: use of undefined type '_frame' (compiling source file C:\J\workspace\ign_math-pr-win\ws\gz-math\src\python_pybind11\src\AxisAlignedBox.cc) [C:\J\workspace\ign_math-pr-win\ws\build\gz-math7\test\FAKE_INSTALL-prefix\src\FAKE_INSTALL-build\src\python_pybind11\math7.vcxproj]
C:\Program Files\Python311\include\pytypedefs.h(22): message : see declaration of '_frame' (compiling source file C:\J\workspace\ign_math-pr-win\ws\gz-math\src\python_pybind11\src\AxisAlignedBox.cc) [C:\J\workspace\ign_math-pr-win\ws\build\gz-math7\test\FAKE_INSTALL-prefix\src\FAKE_INSTALL-build\src\python_pybind11\math7.vcxproj]
C:\vcpkg\installed\x64-windows\include\pybind11\detail/type_caster_base.h(482,26): error C2027: use of undefined type '_frame' (compiling source file C:\J\workspace\ign_math-pr-win\ws\gz-math\src\python_pybind11\src\Angle.cc) [C:\J\workspace\ign_math-pr-win\ws\build\gz-math7\test\FAKE_INSTALL-prefix\src\FAKE_INSTALL-build\src\python_pybind11\math7.vcxproj]
C:\Program Files\Python311\include\pytypedefs.h(22): message : see declaration of '_frame' (compiling source file C:\J\workspace\ign_math-pr-win\ws\gz-math\src\python_pybind11\src\Angle.cc) [C:\J\workspace\ign_math-pr-win\ws\build\gz-math7\test\FAKE_INSTALL-prefix\src\FAKE_INSTALL-build\src\python_pybind11\math7.vcxproj]
  Color.cc
  DiffDriveOdometry.cc
  Ellipsoid.cc
  Filter.cc

The buildfarm for Fortress and Garden uses the vcpkg formula pybind11:x64-windows 2.9.1 which seems to be the same version than in Ubuntu Jammy.

Implementation suggestion

Might be a problem with different versions of python mixed in the build: Python 3.11 coming from PATH and installed as a Windows system binary and Python 3.10 from vcpkg that supports well pybind11 2.9.

❯ grep -i python ~/Downloads/CMakeCache.txt  | grep '3[10,11]'
PYTHON_LIBRARY:FILEPATH=C:/vcpkg/installed/x64-windows/lib/python310.lib
FIND_PACKAGE_MESSAGE_DETAILS_PYTHON:INTERNAL=C:/Program Files/Python311/python.exe3.11.2
PYTHON_LIBRARIES:INTERNAL=C:/vcpkg/installed/x64-windows/lib/python310.lib
PYTHON_MODULE_EXTENSION:INTERNAL=.cp311-win_amd64.pyd
_Python3_EXECUTABLE:INTERNAL=C:/Program Files/Python311/python.exe
_Python3_INTERPRETER_PROPERTIES:INTERNAL=Python;3;11;2;64;;cp311-win_amd64;C:\Program Files\Python311\Lib;C:\Program Files\Python311\Lib;C:\Program Files\Python311\Lib\site-packages;C:\Program Files\Python311\Lib\site-packages
_Python3_LIBRARY_RELEASE:INTERNAL=C:/Program Files/Python311/libs/python311.lib
_Python3_RUNTIME_LIBRARY_RELEASE:INTERNAL=C:/Program Files/Python311/python311.dll

A possible test could be to pass GZ_PYTHON_VERSION (from gz-cmake) to be 3.10 and see if 3.11 is not in the mix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: To do
Development

No branches or pull requests

1 participant