mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Specify build dir as a global variable in BUILD_DIR in the build system.
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/23318 Test Plan: Imported from OSS Differential Revision: D16493987 Pulled By: ezyang fbshipit-source-id: 497e9dd924280f61dde095b4f2b50f5402d9da97
This commit is contained in:
committed by
Facebook Github Bot
parent
915261c8be
commit
82545ecc71
2
setup.py
2
setup.py
@ -276,7 +276,7 @@ elif sha != 'Unknown':
|
||||
version += '+' + sha[:7]
|
||||
report("Building wheel {}-{}".format(package_name, version))
|
||||
|
||||
cmake = CMake('build')
|
||||
cmake = CMake()
|
||||
|
||||
# all the work we need to do _before_ setup runs
|
||||
def build_deps():
|
||||
|
@ -20,4 +20,4 @@ if __name__ == '__main__':
|
||||
options = parser.parse_args()
|
||||
|
||||
build_caffe2(version=None, cmake_python_library=None, build_python=False,
|
||||
rerun_cmake=True, cmake_only=False, cmake=CMake('build'))
|
||||
rerun_cmake=True, cmake_only=False, cmake=CMake())
|
||||
|
@ -12,7 +12,7 @@ import distutils.sysconfig
|
||||
from distutils.version import LooseVersion
|
||||
|
||||
from . import escape_path, which
|
||||
from .env import (IS_64BIT, IS_DARWIN, IS_WINDOWS, check_env_flag, check_negative_env_flag, build_type)
|
||||
from .env import (BUILD_DIR, IS_64BIT, IS_DARWIN, IS_WINDOWS, check_env_flag, check_negative_env_flag, build_type)
|
||||
from .cuda import USE_CUDA
|
||||
from .dist_check import USE_DISTRIBUTED, USE_GLOO_IBVERBS
|
||||
from .numpy_ import USE_NUMPY, NUMPY_INCLUDE_DIR
|
||||
@ -35,7 +35,7 @@ USE_NINJA = (not check_negative_env_flag('USE_NINJA') and
|
||||
class CMake:
|
||||
"Manages cmake."
|
||||
|
||||
def __init__(self, build_dir):
|
||||
def __init__(self, build_dir=BUILD_DIR):
|
||||
self._cmake_command = CMake._get_cmake_command()
|
||||
self.build_dir = build_dir
|
||||
|
||||
|
@ -14,6 +14,8 @@ CONDA_DIR = os.path.join(os.path.dirname(sys.executable), '..')
|
||||
|
||||
IS_64BIT = (struct.calcsize("P") == 8)
|
||||
|
||||
BUILD_DIR = 'build'
|
||||
|
||||
|
||||
def check_env_flag(name, default=''):
|
||||
return os.getenv(name, default).upper() in ['ON', '1', 'YES', 'TRUE', 'Y']
|
||||
|
Reference in New Issue
Block a user