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

Note on building in windows given multiple Python installations #4245

Open
wants to merge 3 commits into
base: rolling
Choose a base branch
from

Conversation

coarsedamavand
Copy link

Added Note under the 'build the code in the workspace' section: https://docs.ros.org/en/rolling/Installation/Alternatives/Windows-Development-Setup.html#build-the-code-in-the-workspace

Informs users of cmake-args useful in setting specific Python directories for the windows build on a system with multiple Python installations.

Added Note under the 'build the code in the workspace' section: https://docs.ros.org/en/rolling/Installation/Alternatives/Windows-Development-Setup.html#build-the-code-in-the-workspace

Informs users of cmake-args useful in setting specific Python directories for the windows build on a system with multiple Python installations.
Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you try with --cmake-args -DPython3_EXECUTABLE=C:\path\to\exe? That is what we are going for elsewhere, and I think that is enough without all of the extra settings.

@coarsedamavand
Copy link
Author

coarsedamavand commented May 23, 2024

Can you try with --cmake-args -DPython3_EXECUTABLE=C:\path\to\exe? That is what we are going for elsewhere, and I think that is enough without all of the extra settings.

Not sure what's changed since I ran this last, but neither my commit nor your suggestion complete when building rosidl_generator_py, with the wrong python version being found at line 22 of rosidl_generator_py_generate_interfaces.cmake: find_package(Python3 REQUIRED COMPONENTS Interpreter Development NumPy)

However, building with the following cmake args DOES complete successfully:
-DPYTHON_EXECUTABLE=C:/Python38/python.exe
-DPython3_ROOT_DIR=C:/Python38
-DPython3_FIND_STRATEGY=LOCATION
-DPython3_FIND_REGISTRY=NEVER
I'll check if all 4 of these are necessary.

@coarsedamavand
Copy link
Author

I did indeed need all 4 cmake args. I'm running on Windows 10, with:
Python 3.8.3 installed from chocolatey in the default location, C:/Python38
And Python 3.9.12 from the web via exe installer, and opted to add it to path during installation.

I will update the documentation accordingly in another commit

Following testing, updated which CMake args are necessary to avoid build errors arising from incorrect python installs being found and used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants