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

Windows C extension compilation issues #327

Closed
1 task done
hmaarrfk opened this issue Jan 19, 2025 · 8 comments · Fixed by conda-forge/vc-feedstock#90 or #328
Closed
1 task done

Windows C extension compilation issues #327

hmaarrfk opened this issue Jan 19, 2025 · 8 comments · Fixed by conda-forge/vc-feedstock#90 or #328
Labels
bug Something isn't working

Comments

@hmaarrfk
Copy link
Contributor

Solution to issue cannot be found in the documentation.

  • I checked the documentation.

Issue

conda-forge/sam-2-feedstock#16

Shows some errors in inspecting windows linked libraries.

I feel like it is similar to the challenges we faced moving the shared libraries around for Linux.

Installed packages

PyTorch CUDA 12.6 2.5.1

Environment info

Windows azure CI with CUDA build environment.
@hmaarrfk hmaarrfk added the bug Something isn't working label Jan 19, 2025
@isuruf
Copy link
Member

isuruf commented Jan 19, 2025

The issue is that libtorch on windows puts the DLLs in Lib/site-packages instead of Library/bin.

@hmaarrfk
Copy link
Contributor Author

Right. I just wanted to share this observation before too many downstream packages get rebuilt.

@hmaarrfk
Copy link
Contributor Author

What is the correct course of action on windows? I feel like the symlink trick we used for Linux isn’t appropriate for windows right?

cp ${SP_DIR}/torch/lib/libtorch_python${SHLIB_EXT} ${PREFIX}/lib

@mgorny
Copy link
Contributor

mgorny commented Jan 19, 2025

I'm also seeing TorchAudio fail to build because it can't find CMake files:

conda-forge/torchaudio-feedstock#14

I suppose I could try working it around by overriding CMake paths.

@hmaarrfk
Copy link
Contributor Author

Those azure links are flaky. Can you also link to the PR?

@mgorny
Copy link
Contributor

mgorny commented Jan 19, 2025

Updated. That said, passing Torch_ROOT worked.

@isuruf
Copy link
Member

isuruf commented Jan 19, 2025

What is the correct course of action on windows? I feel like the symlink trick we used for Linux isn’t appropriate for windows right?

The symlinks are not needed for windows. Just moving the .dlls should make it work. We might need to fix some places where downstreams look for .lib files.

@h-vetinari
Copy link
Member

Just moving the .dlls should make it work. We might need to fix some places where downstreams look for .lib files.

Do you mean moving the .lib files to LIBRARY_LIB as well? Or would you like to leave them in %SP_DIR%\..., while pointing to the respective DLL in %LIBRARY_BIN%?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
4 participants