From: vaeksare <42353187+vaeksare@users.noreply.github.com> Date: Tue, 2 Apr 2019 21:25:28 +0000 (-0700) Subject: Fix windows msbuild bug (#18748) X-Git-Tag: accepted/tizen/6.5/unified/20211028.231830~471 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=84a9694ed0c85c0bc844915adf9f2c8fd53bacb1;p=platform%2Fupstream%2Fpytorch.git Fix windows msbuild bug (#18748) Summary: Fix the bug introduced by #18681 where an undefined variable was being used to limit max cpu count when building for Windows without Ninja. Pull Request resolved: https://github.com/pytorch/pytorch/pull/18748 Differential Revision: D14733209 Pulled By: soumith fbshipit-source-id: 52fc0dd4dde99da75a6956b63f02da2e647eed4f --- diff --git a/tools/build_pytorch_libs.py b/tools/build_pytorch_libs.py index aa0ed89..9bcc405 100644 --- a/tools/build_pytorch_libs.py +++ b/tools/build_pytorch_libs.py @@ -265,6 +265,7 @@ def build_caffe2(version, check_call(['cmake', '--build', '.', '--target', 'install', '--config', build_type, '--', '-j', str(j)], cwd=build_dir, env=my_env) else: + j = max_jobs or str(multiprocessing.cpu_count()) check_call(['msbuild', 'INSTALL.vcxproj', '/p:Configuration={} /maxcpucount:{}'.format(build_type, j)], cwd=build_dir, env=my_env) else: