Fixes #6386, Use copies instead of symbolic files (#6396)

* Use copies instead of symbolic files

* bug fix

* Remove useless item
This commit is contained in:
peterjc123
2018-04-10 01:54:10 +08:00
committed by Soumith Chintala
parent d0f395f744
commit 5651695a99
5 changed files with 13 additions and 5 deletions

4
.gitignore vendored
View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -1 +0,0 @@
../../aten/src/ATen/common_with_cwrap.py