Skip to content

Commit bb0a3ed

Browse files
Merge pull request tensorflow#328 from joker-eph:aarch64_build_script
PiperOrigin-RevId: 569348690
2 parents d627674 + f738ef2 commit bb0a3ed

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

lingvo/lingvo.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"""Implements custom rules for Lingvo."""
22

33
def tf_copts():
4-
# TODO(drpng): autoconf this.
5-
return ["-std=c++17", "-Wno-sign-compare", "-mavx"] + select({
4+
# "-Wno-sign-compare", "-mavx" removed for compat with aarch64
5+
return ["-std=c++17"] + select({
66
"//lingvo:cuda": ["-DGOOGLE_CUDA=1"],
77
"//conditions:default": [],
88
})

pip_package/build.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function write_action_env_to_bazelrc() {
4444
[ -e .bazelrc ] && rm .bazelrc
4545

4646
write_to_bazelrc "build -c opt"
47-
write_to_bazelrc 'build --copt=-mavx --host_copt=-mavx'
47+
[[ $(uname -m) == "x86_64" ]] && write_to_bazelrc 'build --copt=-mavx --host_copt=-mavx'
4848
write_to_bazelrc 'build --cxxopt=-std=c++17'
4949
write_to_bazelrc 'build --auto_output_filter=subpackages'
5050
write_to_bazelrc 'build --copt="-Wall" --copt="-Wno-sign-compare"'
@@ -97,8 +97,10 @@ DST_DIR="/tmp/lingvo/dist"
9797

9898
# Note: constraining our release to plat==manylinux2014_x86_64 to match TF.
9999
# This corresponds to our use of the devtoolset-9 toolchain.
100-
find "$DST_DIR" -name "*cp3${PYTHON_MINOR_VERSION}*.whl" |\
101-
xargs -n1 ./third_party/auditwheel.sh repair --plat manylinux2014_x86_64 -w "$DST_DIR"
100+
if [[ $(uname -m) == "x86_64" ]]; then
101+
find "$DST_DIR" -name "*cp3${PYTHON_MINOR_VERSION}*.whl" |\
102+
xargs -n1 ./third_party/auditwheel.sh repair --plat manylinux2014_x86_64 -w "$DST_DIR"
103+
fi
102104

103105
rm .bazelrc
104106

0 commit comments

Comments
 (0)