From 08fb9021da32e73bd7dec73104eea6a76dd44439 Mon Sep 17 00:00:00 2001 From: peter Date: Wed, 6 Mar 2019 10:41:20 -0800 Subject: [PATCH] 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 --- setup.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/setup.py b/setup.py index 4ce1993..042905b 100644 --- a/setup.py +++ b/setup.py @@ -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)) -- 2.7.4