Corrected python lib path on windows to be consistent with Linux (#13848)

Summary:
The python lib path on Windows was set to an incorrect path. This fixes it to be consistent with Linux.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13848

Differential Revision: D13030945

Pulled By: soumith

fbshipit-source-id: 7fb9013ffe66cff98018aea25fdb5cda03cbceb1
This commit is contained in:
CircleCI
2018-11-12 14:35:39 -08:00
committed by Facebook Github Bot
parent 53a3c46950
commit f1a2bc4eae
2 changed files with 11 additions and 4 deletions

View File

@ -231,9 +231,14 @@ rel_site_packages = distutils.sysconfig.get_python_lib(prefix='')
# full absolute path to the dir above
full_site_packages = distutils.sysconfig.get_python_lib()
# CMAKE: full path to python library
cmake_python_library = "{}/{}".format(
distutils.sysconfig.get_config_var("LIBDIR"),
distutils.sysconfig.get_config_var("INSTSONAME"))
if IS_WINDOWS:
cmake_python_library = "{}/libs/python{}.lib".format(
distutils.sysconfig.get_config_var("prefix"),
distutils.sysconfig.get_config_var("VERSION"))
else:
cmake_python_library = "{}/{}".format(
distutils.sysconfig.get_config_var("LIBDIR"),
distutils.sysconfig.get_config_var("INSTSONAME"))
cmake_python_include_dir = distutils.sysconfig.get_python_inc()

View File

@ -214,11 +214,12 @@ goto:eof
: Invalid escape sequence \i
: which is said to become an error in the future.
: As an alternative, we should use forward slashes instead.
: Here those paths should be espaced before passing to CMake.
: Here those paths should be escaped before passing to CMake.
set NVTOOLEXT_HOME=%NVTOOLEXT_HOME:\=/%
set CUDNN_INCLUDE_DIR=%CUDNN_INCLUDE_DIR:\=/%
set CUDNN_LIB_DIR=%CUDNN_LIB_DIR:\=/%
set CUDNN_LIBRARY=%CUDNN_LIBRARY:\=/%
set PYTORCH_PYTHON_LIBRARY=%PYTORCH_PYTHON_LIBRARY:\=/%
IF NOT "%PREBUILD_COMMAND%"=="" call "%PREBUILD_COMMAND%" %PREBUILD_COMMAND_ARGS%
if not exist build mkdir build
@ -226,6 +227,7 @@ goto:eof
cmake .. %CMAKE_GENERATOR_COMMAND% ^
-DCMAKE_BUILD_TYPE=%BUILD_TYPE% ^
-DTORCH_BUILD_VERSION="%PYTORCH_BUILD_VERSION%" ^
-DPYTHON_LIBRARY="%PYTORCH_PYTHON_LIBRARY%" ^
-DBUILD_TORCH="%BUILD_TORCH%" ^
-DNVTOOLEXT_HOME="%NVTOOLEXT_HOME%" ^
-DNO_API=ON ^