forked from kroma-network/tachyon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bazelrc
100 lines (82 loc) · 3.42 KB
/
.bazelrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Tachyon Bazel configuration file.
# This file tries to group and simply build option for Tachyon
#
# ----CONFIG OPTIONS----
#
# Other build options:
# dbg: Build with debug info
#
# Hardware support options:
# cuda: Build with NVIDIA GPU support (cuda).
# rocm: Build with AMD GPU support (rocm).
# numa: Enable numa using hwloc.
#
# Default build options. These are applied first and unconditionally.
# For projects which use Tachyon as part of a Bazel build process, putting
# nothing in a bazelrc will default to a monolithic build. The following line
# opts in to modular op registration support by default.
build -c opt
# Make Bazel print out all options from rc files.
build --announce_rc
# TODO(chokobole): Remove when `cc_shared_library` is enabled by default
build --experimental_cc_shared_library
build:macos_x86_64 --config=macos
build:macos_x86_64 --cpu=darwin_x86_64
build:macos_x86_64 --host_cpu=darwin_x86_64
build:macos_arm64 --config=macos
build:macos_arm64 --cpu=darwin_arm64
build:macos_arm64 --host_cpu=darwin_arm64
# This config refers to building sources with nvcc.
build:cuda --repo_env TACHYON_NEED_CUDA=1
build:cuda --crosstool_top=@local_config_cuda//crosstool:toolchain
build:cuda --@local_config_cuda//:enable_cuda
build:cuda --//:has_rtti
# This config refers to building sources with clang.
# NOTE(chokobole): I didn't test it, though!
build:cuda_clang --config=cuda
build:cuda_clang --repo_env TACHYON_CUDA_CLANG=1
build:cuda_clang --@local_config_cuda//:cuda_compiler=clang
# This config refers to building sources kernels.
build:rocm --crosstool_top=@local_config_rocm//crosstool:toolchain
build:rocm --define=using_rocm_hipcc=true
build:rocm --define=tensorflow_mkldnn_contraction_kernel=0
build:rocm --repo_env TACHYON_NEED_ROCM=1
# Options extracted from configure script
build:numa --//:has_numa
# Debug config
build:dbg -c dbg
# By default, build Tachyon in C++ 17 mode.
build:linux --cxxopt=-std=c++17
build:linux --host_cxxopt=-std=c++17
build:macos --cxxopt=-std=c++17
build:macos --host_cxxopt=-std=c++17
build:macos --objccopt=-std=c++17
build:windows --cxxopt=/std:c++17
build:windows --host_cxxopt=/std:c++17
# Instruction set optimizations
# TODO(chokobole): Create a feature in toolchains for avx/avx2 to
# avoid having to define linux/win separately.
build:avx_linux --copt=-mavx
build:avx2_linux --copt=-mavx2
build:avx512_linux --copt=-mavx512f
build:native_arch_linux --copt=-march=native
build:avx_windows --copt=/arch=AVX
build:avx2_windows --copt=/arch=AVX2
build:avx512_windows --copt=/arch=AVX512
# Enable googletest build with absl.
# See https://github.com/google/googletest/blob/v1.13.0/BUILD.bazel#L67C1-L70
build --define absl=1
# FIXME(chokobole): If this option is enabled, gtest cannot be built with nvcc.
build:cuda --define absl=0
# gmp needs exception.
build --//:has_exception
test --test_tag_filters -benchmark,-manual,-cuda,-rust
build:linux --build_tag_filters -objc,-cuda,-rust
build:macos --build_tag_filters -cuda,-rust,-doxygen
build:windows --build_tag_filters -objc,-cuda,-rust,-doxygen
# Halo2 uses subgroup generator of bn254 scalar field as 7.
# See https://github.com/kroma-network/halo2curves/blob/c0ac1935e5da2a620204b5b011be2c924b1e0155/src/bn256/fr.rs#L68-L70
build:halo2 --//tachyon/math/elliptic_curves/bn/bn254:fr_subgroup_generator=7
# Config-specific options should come above this line.
# Load rc file with user-specific options.
try-import %workspace%/.bazelrc.user