# general compilation options
build --cxxopt="-std=c++20" --copt="-fdiagnostics-color=always"
# If compiling with clang or intel compilers, you will need to adjust the linked OpenMP library from libgomp to libomp
build --copt="-fopenmp" --linkopt="-lgomp"

# workaround for a Bazel 7 issue with rules_foreign_cc: https://github.com/bazelbuild/rules_foreign_cc/issues/1129
build --sandbox_add_mount_pair=/tmp

# -fno-math-errno yields a few % of performance improvements and we don't check errno anyways
build:opt   -c opt --copt="-O3" --copt="-fno-math-errno"
build:perf  -c opt --copt="-O3" --copt="-fno-math-errno" --copt="-g" --strip=never --copt="-fno-omit-frame-pointer"
build:dbg   -c dbg --copt="-O0"
build:asan  -c dbg --features=asan --strip=never

# We observe CPU overloads when having too many OpenMP threads in parallel on the CI machines.
# So far, it looks similar to this issue: https://stackoverflow.com/q/70126350
# As of now, we use the solution to run the tests one after another,
# as suggested here: https://stackoverflow.com/a/70084246.
test --local_test_jobs=1
