Open s-dakshin opened 1 week ago
I don't believe the vcpkg build supports Python out of the box.
You'd likely need to provide the Python variables to CMake as well so it knows what Python executable to run.
I'm just copying from the other issue so you'd need to change these values to what you have on your system.
-DPython3_EXECUTABLE="/home/mb230/anaconda3/envs/test/bin/python3" -DPython3_LIBRARY="/home/mb230/anaconda3/envs/test/lib/libpython3.10.so" -DPython3_INCLUDE_DIR="/home/mb230/anaconda3/envs/test/include/python3.10"
I don't believe the vcpkg build supports Python out of the box.
You'd likely need to provide the Python variables to CMake as well so it knows what Python executable to run.
I'm just copying from the other issue so you'd need to change these values to what you have on your system.
-DPython3_EXECUTABLE="/home/mb230/anaconda3/envs/test/bin/python3" -DPython3_LIBRARY="/home/mb230/anaconda3/envs/test/lib/libpython3.10.so" -DPython3_INCLUDE_DIR="/home/mb230/anaconda3/envs/test/include/python3.10"
Thanks for the suggestion, couple of follow ups -
On further investigation - I am getting python3 from vcpkg as well, I don't explicitly use the system python. I checked for some CMake variables, and they all seem to be set.
config-x64-windows-vs2022-rel-CMakeCache.txt.log -
//Generate Python documentation
PXR_BUILD_PYTHON_DOCUMENTATION:BOOL=OFF
//Enable Python based components for USD
PXR_ENABLE_PYTHON_SUPPORT:BOOL=ON
//Build with debug python
PXR_USE_DEBUG_PYTHON:BOOL=OFF
//Path to a program.
Python3_EXECUTABLE:FILEPATH=C:/Jenk/workspace/e_GHE_sd_USDSILTesting_WithFixes/_build/vcpkg_installed/x64-windows-vs2022/tools/python3/python.exe
//Path to a file.
Python3_INCLUDE_DIR:PATH=C:/Jenk/workspace/e_GHE_sd_USDSILTesting_WithFixes/_build/vcpkg_installed/x64-windows-vs2022/include/python3.11
//Path to a program.
Python_EXECUTABLE:FILEPATH=C:/Jenk/workspace/e_GHE_sd_USDSILTesting_WithFixes/_build/vcpkg_installed/x64-windows-vs2022/tools/python3/python.exe
//Path to a file.
Python_INCLUDE_DIR:PATH=C:/Jenk/workspace/e_GHE_sd_USDSILTesting_WithFixes/_build/vcpkg_installed/x64-windows-vs2022/include/python3.11
//The directory containing a CMake configuration file for boost_python311.
boost_python311_DIR:PATH=C:/Jenk/workspace/e_GHE_sd_USDSILTesting_WithFixes/_build/vcpkg_installed/x64-windows-vs2022/share/boost_python311
//Details about finding Boost
FIND_PACKAGE_MESSAGE_DETAILS_Boost:INTERNAL=[C:/Jenk/workspace/e_GHE_sd_USDSILTesting_WithFixes/_build/vcpkg_installed/x64-windows-vs2022/share/boost/BoostConfig.cmake][c ][v1.85.0()]
//Details about finding Python3
FIND_PACKAGE_MESSAGE_DETAILS_Python3:INTERNAL=[C:/Jenk/workspace/e_GHE_sd_USDSILTesting_WithFixes/_build/vcpkg_installed/x64-windows-vs2022/tools/python3/python.exe][optimized;C:/Jenk/workspace/e_GHE_sd_USDSILTesting_WithFixes/_build/vcpkg_installed/x64-windows-vs2022/lib/python311.lib;debug;C:/Jenk/workspace/e_GHE_sd_USDSILTesting_WithFixes/_build/vcpkg_installed/x64-windows-vs2022/debug/lib/python311_d.lib][C:/Jenk/workspace/e_GHE_sd_USDSILTesting_WithFixes/_build/vcpkg_installed/x64-windows-vs2022/include/python3.11][cfound components: Interpreter Development Development.Module Development.Embed ][v3.11.8()]
//Compiler reason failure
_Python3_Compiler_REASON_FAILURE:INTERNAL=
_Python3_DEVELOPMENT_EMBED_SIGNATURE:INTERNAL=c659e6d36c616d11438e93c3ffe5e090
_Python3_DEVELOPMENT_MODULE_SIGNATURE:INTERNAL=c659e6d36c616d11438e93c3ffe5e090
//Development reason failure
_Python3_Development_REASON_FAILURE:INTERNAL=
_Python3_EXECUTABLE:INTERNAL=C:/Jenk/workspace/e_GHE_sd_USDSILTesting_WithFixes/_build/vcpkg_installed/x64-windows-vs2022/tools/python3/python.exe
_Python3_INCLUDE_DIR:INTERNAL=C:/Jenk/workspace/e_GHE_sd_USDSILTesting_WithFixes/_build/vcpkg_installed/x64-windows-vs2022/include/python3.11
//Python3 Properties
_Python3_INTERPRETER_PROPERTIES:INTERNAL=Python;3;11;8;64;;cp311-win_amd64;;C:\Jenk\workspace\e_GHE_sd_USDSILTesting_WithFixes\_build\vcpkg_installed\x64-windows-vs2022\tools\python3\Lib;C:\Jenk\workspace\e_GHE_sd_USDSILTesting_WithFixes\_build\vcpkg_installed\x64-windows-vs2022\tools\python3\Lib;C:\Jenk\workspace\e_GHE_sd_USDSILTesting_WithFixes\_build\vcpkg_installed\x64-windows-vs2022\tools\python3\Lib\site-packages;C:\Jenk\workspace\e_GHE_sd_USDSILTesting_WithFixes\_build\vcpkg_installed\x64-windows-vs2022\tools\python3\Lib\site-packages
_Python3_INTERPRETER_SIGNATURE:INTERNAL=2727421381ca9e835a7611518d621e30
//Path to a library.
_Python3_LIBRARY_DEBUG:INTERNAL=C:/Jenk/workspace/e_GHE_sd_USDSILTesting_WithFixes/_build/vcpkg_installed/x64-windows-vs2022/debug/lib/python311_d.lib
//Path to a library.
_Python3_LIBRARY_RELEASE:INTERNAL=C:/Jenk/workspace/e_GHE_sd_USDSILTesting_WithFixes/_build/vcpkg_installed/x64-windows-vs2022/lib/python311.lib
//NumPy reason failure
_Python3_NumPy_REASON_FAILURE:INTERNAL=
//Path to a library.
_Python3_RUNTIME_LIBRARY_DEBUG:INTERNAL=C:/Jenk/workspace/e_GHE_sd_USDSILTesting_WithFixes/_build/vcpkg_installed/x64-windows-vs2022/debug/bin/python311_d.dll
//Path to a library.
_Python3_RUNTIME_LIBRARY_RELEASE:INTERNAL=C:/Jenk/workspace/e_GHE_sd_USDSILTesting_WithFixes/_build/vcpkg_installed/x64-windows-vs2022/bin/python311.dll
//Path to a program.
_Python_CONFIG:INTERNAL=_Python_CONFIG-NOTFOUND
//Compiler reason failure
_Python_Compiler_REASON_FAILURE:INTERNAL=
//Development reason failure
_Python_Development_REASON_FAILURE:INTERNAL=
_Python_INCLUDE_DIR:INTERNAL=C:/Jenk/workspace/e_GHE_sd_USDSILTesting_WithFixes/_build/vcpkg_installed/x64-windows-vs2022/include/python3.11
//Interpreter reason failure
_Python_Interpreter_REASON_FAILURE:INTERNAL=
//Path to a library.
_Python_LIBRARY_RELEASE:INTERNAL=_Python_LIBRARY_RELEASE-NOTFOUND
//NumPy reason failure
_Python_NumPy_REASON_FAILURE:INTERNAL=
For the other issue, I mean the issue you initially posted on https://github.com/PixarAnimationStudios/OpenUSD/issues/3401 . I was just copying the CMake flags out from there.
@asluk you're more familiar with the vcpkg setup. Any ideas? It seems like the VCPKG Python build is failing to get the Devel libs for it.
We generally build with a python install that's outside of the vcpkg setup, i.e., c:\path\to\my\python, and invoke build_usd.py with that. @pmolodo and @tylerm-nv might know more.
Filed as internal issue #USD-10409
We generally build with a python install that's outside of the vcpkg setup, i.e., c:\path\to\my\python, and invoke build_usd.py with that. @pmolodo and @tylerm-nv might know more.
IIRC, we invoke build_usd.py with it, AND pass the various python cmake vars.
(I think we first tried just invoking build_usd.py, but still ran into some issues with some interpreters, like those installed via venv. Both may not be required for most use cases... or even for our common use cases. But it also doesn't hurt...)
Thanks @pmolodo -- when you get a chance, can you copy/paste the build_usd.py and cmake command lines that get generated by our internal usd-ci?
I think I might have found the reason for the issue. I am getting python 3.11 from vcpkg, but the system was pre-installed with python 3.12 which seems to be having conflicting environment variables. I was able to solve the issue in two ways -
Thanks to all for looking into this issue, but this doesn't seem to be a USD+Python issue. Though it would be nice to have an override parameter that can explicitly look for python to build for USD - in this case to look into the vcpkg python.
Both the CMake and the build_usd.py allow for passing in information on how to find Python. I'm not sure who maintains the vcpkg package though or how vcpkg exposes overrides.
That would be nice to have for vcpkg, the only options I see are -
-DPXR_BUILD_ALEMBIC_PLUGIN:BOOL=OFF
-DPXR_BUILD_EMBREE_PLUGIN:BOOL=OFF
-DPXR_BUILD_IMAGING:BOOL=OFF
-DPXR_BUILD_MONOLITHIC:BOOL=OFF
-DPXR_BUILD_TESTS:BOOL=OFF
-DPXR_BUILD_USD_IMAGING:BOOL=OFF
-DPXR_BUILD_EXAMPLES:BOOL=OFF
-DPXR_BUILD_TUTORIALS:BOOL=OFF
-DPXR_ENABLE_PYTHON_SUPPORT:BOOL=ON
-DPXR_BUILD_USD_TOOLS:BOOL=ON
The problem is that to build USD Tools->Python and I don't see anywhere we can set it explicitly.
Description of Issue
Facing issue when building USD with Python tools on Windows 10, the same build seems to pass through on Windows 11. Getting USD through Vcpkg and building it using CMake for C++ project.
config-x64-windows-vs2022-out.log
vcpkg command log -
Steps to Reproduce
System Information (OS, Hardware)
OS - Windows 10, x64, MINGW
Package Versions
vcpkg package management program version 2024-08-01-fd884a0d390d12783076341bd43d77c3a6a15658 Cmake - 3.29.2 Triplet x64-windows-vs2022... Compiler found - 14.36.32532/bin/Hostx64/x64/cl.exe USD version - usd:x64-windows-vs2022@23.5#5
Build Flags
-DPXR_ENABLE_PYTHON_SUPPORT:BOOL=ON and -DPXR_BUILD_USD_TOOLS:BOOL=ON