Enable 32 bit CPU build on Windows

Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/18176

Differential Revision: D14539884

Pulled By: ezyang

fbshipit-source-id: 0e4bd9c1ef1830cd9bcc40df36b87534f61def08
This commit is contained in:
peterjc123
2019-03-20 09:16:28 -07:00
committed by Facebook Github Bot
parent 19c13eee39
commit 2a6cbfaccf
3 changed files with 13 additions and 6 deletions

View File

@ -1,4 +1,4 @@
from .setup_helpers.env import (IS_ARM, IS_DARWIN, IS_LINUX, IS_PPC, IS_WINDOWS,
from .setup_helpers.env import (IS_64BIT, IS_ARM, IS_DARWIN, IS_LINUX, IS_PPC, IS_WINDOWS,
DEBUG, REL_WITH_DEB_INFO, USE_MKLDNN,
check_env_flag, check_negative_env_flag, hotpatch_build_env_vars)
@ -84,7 +84,8 @@ elif REL_WITH_DEB_INFO:
def overlay_windows_vcvars(env):
from distutils._msvccompiler import _get_vc_env
vc_env = _get_vc_env('x64')
vc_arch = 'x64' if IS_64BIT else 'x86'
vc_env = _get_vc_env(vc_arch)
for k, v in env.items():
lk = k.lower()
if lk not in vc_env:
@ -128,7 +129,10 @@ def run_cmake(version,
if USE_NINJA:
cmake_args.append('-GNinja')
elif IS_WINDOWS:
cmake_args.append('-GVisual Studio 15 2017 Win64')
if IS_64BIT:
cmake_args.append('-GVisual Studio 15 2017 Win64')
else:
cmake_args.append('-GVisual Studio 15 2017')
try:
import numpy as np
NUMPY_INCLUDE_DIR = np.get_include()