mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 00:20:18 +01:00
This reverts commit67d313a032. Reverted https://github.com/pytorch/pytorch/pull/79154 on behalf of https://github.com/malfet due to Breaks bazel build:67d313a032
54 lines
2.2 KiB
Plaintext
54 lines
2.2 KiB
Plaintext
build --cxxopt=--std=c++14
|
|
build --copt=-I.
|
|
# Bazel does not support including its cc_library targets as system
|
|
# headers. We work around this for generated code
|
|
# (e.g. c10/macros/cmake_macros.h) by making the generated directory a
|
|
# system include path.
|
|
build --copt=-isystem --copt bazel-out/k8-fastbuild/bin
|
|
build --copt=-isystem --copt bazel-out/darwin-fastbuild/bin
|
|
build --experimental_ui_max_stdouterr_bytes=2048576
|
|
|
|
# Configuration to disable tty features for environments like CI
|
|
build:no-tty --curses no
|
|
build:no-tty --progress_report_interval 10
|
|
build:no-tty --show_progress_rate_limit 10
|
|
|
|
# Build with GPU support by default.
|
|
build --define=cuda=true
|
|
# rules_cuda configuration
|
|
build --@rules_cuda//cuda:enable_cuda
|
|
build --@rules_cuda//cuda:cuda_targets=sm_52
|
|
build --@rules_cuda//cuda:compiler=nvcc
|
|
build --repo_env=CUDA_PATH=/usr/local/cuda
|
|
|
|
# Configuration to build without GPU support
|
|
build:cpu-only --define=cuda=false
|
|
# define a separate build folder for faster switching between configs
|
|
build:cpu-only --platform_suffix=-cpu-only
|
|
# See the note on the config-less build for details about why we are
|
|
# doing this. We must also do it for the "-cpu-only" platform suffix.
|
|
build --copt=-isystem --copt=bazel-out/k8-fastbuild-cpu-only/bin
|
|
# rules_cuda configuration
|
|
build:cpu-only --@rules_cuda//cuda:enable_cuda=False
|
|
|
|
# Set additional warnings to error level.
|
|
#
|
|
# Implementation notes:
|
|
# * we use file extensions to determine if we are using the C++
|
|
# compiler or the cuda compiler
|
|
# * we use ^// at the start of the regex to only permit matching
|
|
# PyTorch files. This excludes external repos.
|
|
#
|
|
# Note that because this is logically a command-line flag, it is
|
|
# considered the word on what warnings are enabled. This has the
|
|
# unfortunate consequence of preventing us from disabling an error at
|
|
# the target level because those flags will come before these flags in
|
|
# the action invocation. Instead we provide per-file exceptions after
|
|
# this.
|
|
#
|
|
# On the bright side, this means we don't have to more broadly apply
|
|
# the exceptions to an entire target.
|
|
build \
|
|
--per_file_copt='^//.*\.(cpp|cc)$'@-Werror=type-limits \
|
|
--per_file_copt=^//.*\.cu$@--compiler-options=-Werror=type-limits
|