Skip to content

Commit 304f73a

Browse files
committed
Use clang for PyTorch/XLA only.
1 parent d9c7858 commit 304f73a

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

infra/ansible/config/env.yaml

+8-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
# They'll be accessible for all processes on the host, also in the development image.
33
release_env:
44
common:
5-
CC: "/usr/lib/llvm-{{ clang_version }}/bin/clang"
6-
CXX: "/usr/lib/llvm-{{ clang_version }}/bin/clang"
5+
CC: gcc-10
6+
CXX: g++-10
77
LD_LIBRARY_PATH: "$LD_LIBRARY_PATH:/usr/local/lib"
88

99
tpu:
@@ -21,8 +21,8 @@ build_env:
2121
# Set explicitly to 0 as setup.py defaults this flag to true if unset.
2222
BUILD_CPP_TESTS: "{{ build_cpp_tests }}"
2323
# Force GCC because clang/bazel has issues.
24-
CC: "/usr/lib/llvm-{{ clang_version }}/bin/clang"
25-
CXX: "/usr/lib/llvm-{{ clang_version }}/bin/clang"
24+
CC: gcc-10
25+
CXX: g++-10
2626
PYTORCH_BUILD_NUMBER: 1
2727
TORCH_XLA_VERSION: "{{ package_version }}"
2828
PYTORCH_BUILD_VERSION: "{{ package_version }}"
@@ -45,3 +45,7 @@ build_env:
4545
ACCELERATOR: tpu
4646
TPUVM_MODE: 1
4747
BUNDLE_LIBTPU: "{{ bundle_libtpu }}"
48+
49+
clang_compiler:
50+
CC: /usr/lib/{{ clang_version }}/bin/clang
51+
CXX: /usr/lib/{{ clang_version }}/bin/clang++

infra/ansible/playbook.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
combine(build_env[arch] | default({}, true)) |
8383
combine(build_env[accelerator] | default({}, true))
8484
}}"
85+
clang_compiler: "{{ clang_compiler }}"
8586
when: stage == "build"
8687
tags: build_srcs
8788

@@ -92,6 +93,7 @@
9293
build_env.common | default({}, true) |
9394
combine(build_env[arch] | default({}, true)) |
9495
combine(build_env[accelerator] | default({}, true))
96+
combine(clang_compiler)
9597
}}"
9698
when: stage == "build_plugin"
9799
tags: build_plugin

infra/ansible/roles/build_srcs/tasks/main.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
ansible.builtin.command:
4747
cmd: python setup.py bdist_wheel
4848
chdir: "{{ (src_root, 'pytorch/xla') | path_join }}"
49-
environment: "{{ env_vars }}"
49+
environment: "{{ env_vars | combine(clang_compiler) }}"
5050

5151
- name: Find XLA *.whl files in pytorch/xla/dist
5252
ansible.builtin.find:

0 commit comments

Comments
 (0)