From 5651695a99b12bc081299ecd7b7dc1effcaa5204 Mon Sep 17 00:00:00 2001 From: peterjc123 Date: Tue, 10 Apr 2018 01:54:10 +0800 Subject: [PATCH] Fixes #6386, Use copies instead of symbolic files (#6396) * Use copies instead of symbolic files * bug fix * Remove useless item --- .gitignore | 4 ++++ .jenkins/pytorch/win-build.sh | 2 -- README.md | 2 -- setup.py | 9 +++++++++ tools/shared/cwrap_common.py | 1 - 5 files changed, 13 insertions(+), 5 deletions(-) delete mode 120000 tools/shared/cwrap_common.py diff --git a/.gitignore b/.gitignore index 839049ffcf51..29eb2fe454ad 100644 --- a/.gitignore +++ b/.gitignore @@ -57,6 +57,9 @@ test/data/linear.pt # macOS dir files .DS_Store +# Symbolic files +tools/shared/cwrap_common.py + # Ninja files .ninja_deps .ninja_log @@ -144,6 +147,7 @@ cmake_build gen .setuptools-cmake-build .pytest_cache +aten/build/* # Bram plsdontbreak diff --git a/.jenkins/pytorch/win-build.sh b/.jenkins/pytorch/win-build.sh index eb0131f1a946..f3bb383cb2a8 100755 --- a/.jenkins/pytorch/win-build.sh +++ b/.jenkins/pytorch/win-build.sh @@ -76,8 +76,6 @@ set DISTUTILS_USE_SDK=1 set CMAKE_GENERATOR=Ninja -xcopy /Y aten\\src\\ATen\\common_with_cwrap.py tools\\shared\\cwrap_common.py - set NO_CUDA=1 python setup.py install diff --git a/README.md b/README.md index 40fc7b9419dc..c622daa7e294 100644 --- a/README.md +++ b/README.md @@ -209,8 +209,6 @@ MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ python setup.py install On Windows ```cmd -xcopy /Y aten\src\ATen\common_with_cwrap.py tools\shared\cwrap_common.py - set "VS150COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build" set CMAKE_GENERATOR=Visual Studio 15 2017 Win64 set DISTUTILS_USE_SDK=1 diff --git a/setup.py b/setup.py index 218b7ba4e82c..5645598b6f29 100644 --- a/setup.py +++ b/setup.py @@ -293,6 +293,15 @@ class build_deps(Command): libs += ['THD'] build_libs(libs) + # Use copies instead of symbolic files. + # Windows has very poor support for them. + sym_files = ['tools/shared/cwrap_common.py'] + orig_files = ['aten/src/ATen/common_with_cwrap.py'] + for sym_file, orig_file in zip(sym_files, orig_files): + if os.path.exists(sym_file): + os.remove(sym_file) + shutil.copyfile(orig_file, sym_file) + # Copy headers necessary to compile C++ extensions. # # This is not perfect solution as build does not depend on any of diff --git a/tools/shared/cwrap_common.py b/tools/shared/cwrap_common.py deleted file mode 120000 index 383d0f481e0d..000000000000 --- a/tools/shared/cwrap_common.py +++ /dev/null @@ -1 +0,0 @@ -../../aten/src/ATen/common_with_cwrap.py \ No newline at end of file