Add check for x64 Python before setup (#17707)

Summary:
Fixes https://github.com/pytorch/pytorch/issues/17657.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/17707

Differential Revision: D14346705

Pulled By: ezyang

fbshipit-source-id: 5daafacdb99eb9a9c6517263d10f20c79f920d24
This commit is contained in:
peter
2019-03-06 10:41:20 -08:00
committed by Facebook Github Bot
parent 1e6acc676f
commit 08fb9021da

View File

@ -152,6 +152,7 @@ import distutils.command.clean
import distutils.sysconfig
import filecmp
import platform
import struct
import subprocess
import shutil
import sys
@ -258,6 +259,10 @@ def build_deps():
f.write("debug = {}\n".format(repr(DEBUG)))
f.write("cuda = {}\n".format(repr(CUDA_VERSION)))
if struct.calcsize("P") != 8:
report('PyTorch is only supported to run with 64-bit python.')
exit(1)
def check_file(f):
if not os.path.exists(f):
report("Could not find {}".format(f))