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

vcpkg usd in debug mode: python linking error #3533

Open
ju-manns opened this issue Feb 17, 2025 · 5 comments
Open

vcpkg usd in debug mode: python linking error #3533

ju-manns opened this issue Feb 17, 2025 · 5 comments

Comments

@ju-manns
Copy link

Hi,
I am trying to build USD using version 25.2 of the usd vcpkg port on Windows.
I modified the portfile to enable python support using the vcpkg python. If I build in release mode only, all compiles fine. In debug mode however, I get the error

FAILED: pxr/external/boost/python/usd_python.dll pxr/external/boost/python/usd_python.lib
LINK : fatal error LNK1104: Cannot open file "python311.lib"

If I also pass -DPXR_USE_DEBUG_PYTHON:BOOL=ON in the portfile, I get LINK : fatal error LNK1104: Cannot open file "python311_d.lib" instead.
The linking command shows that the build system tries to link vcpkg_installed\x64-windows\lib\python3.lib.
However, when I remove the lines

I notice that the build system no longer tries to link vcpkg_installed\x64-windows\lib\python3.lib but the afforementioned error still shows up. Is there some duplicate linking of the python lib going on?

@meshula
Copy link
Member

meshula commented Feb 17, 2025

To the best of my knowledge vcpkg itself doesn't provide a debug build of python. Because msvc links to different runtimes for debug and release, I don't think you can accomplish a vcpkg based debug build without actually providing the python debug linked library yourself and setting up vcpkg to point to it, and that extends to any dependencies of python that might be supplied otherwise by vcpkg.

If someone else knows otherwise please let us know. What I wrote here is what I encountered when I attempted it. Unfortunately I don't have the recipe I used because I stopped when I realized dependencies like pyside would also need to be compiled for debug.

@jesschimein
Copy link
Collaborator

Filed as internal issue #USD-10678

(This is an automated message. See here for more information.)

@ju-manns
Copy link
Author

To the best of my knowledge vcpkg itself doesn't provide a debug build of python. Because msvc links to different runtimes for debug and release, I don't think you can accomplish a vcpkg based debug build without actually providing the python debug linked library yourself and setting up vcpkg to point to it, and that extends to any dependencies of python that might be supplied otherwise by vcpkg.

If someone else knows otherwise please let us know. What I wrote here is what I encountered when I attempted it. Unfortunately I don't have the recipe I used because I stopped when I realized dependencies like pyside would also need to be compiled for debug.

vcpkg does provide python debug builds and we have a working usd vcpkg debug build linked against vcpkg's python. This error only occurs now that we want to update to 25.02 and use the new internal boost-python. The linking error also only occurs for this new module.

@meshula
Copy link
Member

meshula commented Feb 18, 2025

Thanks for the note. For my own knowledge, since I can't find details via google (the information I reported above is what I have in my notes) how do you instruct vcpkg to use a debug python?

@ju-manns
Copy link
Author

ju-manns commented Feb 21, 2025

The issue seems to be related to microsoft/vcpkg#33724 which is the reason, why there is a python_d lib on windows but no python_d.exe.
However, boost_python manages to link python_d.dll on Windows despite this issue in the python port. That's why we used to have a working debug usd build linked against python on Windows.
Therefor I think this issue is indeed a problem with how the new external/boost/python module tries to link python.

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

No branches or pull requests

3 participants