Skip to content

Commit 0d610b4

Browse files
xuhdevfacebook-github-bot
authored andcommitted
Remove the support of build options like NO_*, WITH_* (pytorch#32447)
Summary: We will now use USE_*, BUILD_* consistently. The backward compatibility for NO_* and WITH_* is hereby removed in this commit, as promised in the comment (next release is beyond Feb 20): # Before we run the setup_helpers, let's look for NO_* and WITH_* variables and hotpatch environment with the USE_* # equivalent The use of NO_* and WITH_* is deprecated and will be removed in Feb 20, 2020. Pull Request resolved: pytorch#32447 Differential Revision: D19515536 Pulled By: ezyang fbshipit-source-id: 2f2c51e6d4674af690b190a1f0397b8f596b6a15
1 parent 44b270d commit 0d610b4

File tree

1 file changed

+0
-34
lines changed

1 file changed

+0
-34
lines changed

tools/setup_helpers/env.py

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -33,40 +33,6 @@ def lib_paths_from_base(base_path):
3333
return [os.path.join(base_path, s) for s in ['lib/x64', 'lib', 'lib64']]
3434

3535

36-
def hotpatch_var(var, prefix='USE_'):
37-
def print_warning(good_prefix, bad_prefix, var):
38-
print(("The use of {bad_prefix}{var} is deprecated and will be removed on Feb 20, 2020."
39-
"Please use {good_prefix}{var} instead.").format(
40-
good_prefix=good_prefix, bad_prefix=bad_prefix, var=var))
41-
42-
if check_env_flag('NO_' + var):
43-
print_warning(prefix, 'NO_', var)
44-
os.environ[prefix + var] = '0'
45-
elif check_negative_env_flag('NO_' + var):
46-
print_warning(prefix, 'NO_', var)
47-
os.environ[prefix + var] = '1'
48-
elif check_env_flag('WITH_' + var):
49-
print_warning(prefix, 'WITH_', var)
50-
os.environ[prefix + var] = '1'
51-
elif check_negative_env_flag('WITH_' + var):
52-
print_warning(prefix, 'WITH_', var)
53-
os.environ[prefix + var] = '0'
54-
55-
56-
def hotpatch_build_env_vars():
57-
# Before we run the setup_helpers, let's look for NO_* and WITH_* variables and hotpatch environment with the USE_*
58-
# equivalent The use of NO_* and WITH_* is deprecated and will be removed in Feb 20, 2020.
59-
use_env_vars = ['CUDA', 'CUDNN', 'FBGEMM', 'MKLDNN', 'NNPACK', 'DISTRIBUTED',
60-
'OPENCV', 'TENSORRT', 'QNNPACK', 'FFMPEG', 'SYSTEM_NCCL',
61-
'GLOO_IBVERBS']
62-
list(map(hotpatch_var, use_env_vars))
63-
64-
# Also hotpatch a few with BUILD_* equivalent
65-
build_env_vars = ['BINARY', 'TEST', 'CAFFE2_OPS']
66-
[hotpatch_var(v, 'BUILD_') for v in build_env_vars]
67-
68-
hotpatch_build_env_vars()
69-
7036
# We promised that CXXFLAGS should also be affected by CFLAGS
7137
if 'CFLAGS' in os.environ and 'CXXFLAGS' not in os.environ:
7238
os.environ['CXXFLAGS'] = os.environ['CFLAGS']

0 commit comments

Comments
 (0)