Skip to content

Commit

Permalink
move _C.lib back to %SP_DIR%\torch
Browse files Browse the repository at this point in the history
  • Loading branch information
h-vetinari committed Feb 10, 2025
1 parent 04e1437 commit c92777a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 1 addition & 3 deletions recipe/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ if "%PKG_NAME%" == "libtorch" (

@REM Remove the python binary file, that is placed in the site-packages
@REM directory by the specific python specific pytorch package.
del %LIBRARY_BIN%\torch_python.* %LIBRARY_LIB%\torch_python.* %LIBRARY_LIB%\_C.lib
del %LIBRARY_BIN%\torch_python.* %LIBRARY_LIB%\torch_python.*
if %ERRORLEVEL% neq 0 exit 1

popd
Expand All @@ -217,7 +217,6 @@ if "%PKG_NAME%" == "libtorch" (
@REM Move libtorch_python and remove the other directories afterwards.
robocopy /NP /NFL /NDL /NJH /E %SP_DIR%\torch\bin\ %LIBRARY_BIN%\ torch_python.dll
robocopy /NP /NFL /NDL /NJH /E %SP_DIR%\torch\lib\ %LIBRARY_LIB%\ torch_python.lib
robocopy /NP /NFL /NDL /NJH /E %SP_DIR%\torch\lib\ %LIBRARY_LIB%\ _C.lib
rmdir /s /q %SP_DIR%\torch\lib
rmdir /s /q %SP_DIR%\torch\bin
rmdir /s /q %SP_DIR%\torch\share
Expand All @@ -228,7 +227,6 @@ if "%PKG_NAME%" == "libtorch" (
@REM Copy libtorch_python.lib back -- that's much easier than the for loop
@REM needed to remove everything else.
robocopy /NP /NFL /NDL /NJH /E %LIBRARY_LIB%\ torch\lib\ torch_python.lib
robocopy /NP /NFL /NDL /NJH /E %LIBRARY_LIB%\ torch\lib\ _C.lib
)

@REM Show the sccache stats.
Expand Down
2 changes: 2 additions & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ outputs:
# https://github.com/conda-forge/pytorch-cpu-feedstock/issues/24
- pip check
- python -c "import torch; print(torch.__version__)"
- python -c "import torch._C"
- python -c "import torch; assert torch.backends.mkldnn.m.is_available()" # [x86 and cuda_compiler_version == "None"]
- python -c "import torch; torch.tensor(1).to('cpu').numpy(); print('numpy support enabled!!!')"
# We have had issues with openmp .dylibs being doubly loaded in certain cases. These two tests catch the (observed) issue
Expand All @@ -413,6 +414,7 @@ outputs:
- test -f $PREFIX/lib/libtorch_python${SHLIB_EXT} # [unix]
- if not exist %LIBRARY_BIN%\torch_python.dll exit 1 # [win]
- if not exist %LIBRARY_LIB%\torch_python.lib exit 1 # [win]
- if not exist %SP_DIR%\torch\_C.lib exit 1 # [win]

# a reasonably safe subset of tests that should run under 15 minutes
{% set tests = " ".join([
Expand Down

0 comments on commit c92777a

Please sign in to comment.