[Inductor] Do not install g++12 by default (#90038)

Unless `TORCH_INDUCTOR_INSTALL_GXX` environment variable is define
(which is the case for CI)

Fixes #ISSUE_NUMBER

Pull Request resolved: https://github.com/pytorch/pytorch/pull/90038
Approved by: https://github.com/albanD
This commit is contained in:
Nikita Shulga 2022-12-02 04:13:56 +00:00 committed by PyTorch MergeBot
parent b058a02786
commit f623b123f0
2 changed files with 4 additions and 0 deletions

View file

@ -16,6 +16,7 @@ BUILD_RENAMED_DIR="build_renamed"
BUILD_BIN_DIR="$BUILD_DIR"/bin
export VALGRIND=ON
export TORCH_INDUCTOR_INSTALL_GXX=ON
if [[ "$BUILD_ENVIRONMENT" == *clang9* ]]; then
# clang9 appears to miscompile code involving c10::optional<c10::SymInt>,
# such that valgrind complains along these lines:

View file

@ -110,6 +110,9 @@ def cpp_compiler_search(search):
# according to https://anaconda.org/conda-forge/gxx/
if sys.platform != "linux":
continue
# Do not install GXX by default
if not os.getenv("TORCH_INDUCTOR_INSTALL_GXX"):
continue
from filelock import FileLock
lock_dir = get_lock_dir()