Skip to content

Commit 0811550

Browse files
seanpmorganfacaiy
authored andcommitted
FIX MacOS Build (#452)
* * Reorganize toolchain directory * Remove windows toolchains for time being * Update releases scripts to include CPU optimizations * Update test scripts/docs * Lint * Move delocate install * Update pyenv * Revert move of delocate * Revert move of delocate
1 parent 3fe6f21 commit 0811550

File tree

9 files changed

+12
-276
lines changed

9 files changed

+12
-276
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ docker run --runtime=nvidia --rm -it -v ${PWD}:/addons -w /addons tensorflow/ten
9898

9999
bazel test -c opt -k \
100100
--test_timeout 300,450,1200,3600 \
101+
--crosstool_top=//build_deps/toolchains/gcc7_manylinux2010-nvcc-cuda10.0:toolchain \
101102
--test_output=all \
102103
--jobs=1 \
103104
//tensorflow_addons/...

build_deps/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda10.0/BUILD renamed to build_deps/toolchains/gcc7_manylinux2010-nvcc-cuda10.0/BUILD

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,7 @@ cc_toolchain_suite(
2626
toolchains = {
2727
"local|compiler": ":cc-compiler-local",
2828
"darwin|compiler": ":cc-compiler-darwin",
29-
"x64_windows|msvc-cl": ":cc-compiler-windows",
30-
"x64_windows": ":cc-compiler-windows",
31-
"arm": ":cc-compiler-local",
32-
"aarch64": ":cc-compiler-local",
3329
"k8": ":cc-compiler-local",
34-
"piii": ":cc-compiler-local",
35-
"ppc": ":cc-compiler-local",
3630
"darwin": ":cc-compiler-darwin",
3731
},
3832
)
@@ -99,9 +93,6 @@ cc_toolchain_config(
9993
"/dt7/usr/lib/gcc/x86_64-pc-linux-gnu/7/include",
10094
"/dt7/usr/lib/gcc/x86_64-pc-linux-gnu/7/include-fixed",
10195
"/dt7/usr/include",
102-
"/usr/local/cuda-10.0/targets/x86_64-linux/include",
103-
"/usr/local/cuda-10.0/include",
104-
"/usr/local/cuda-10.0/extras/CUPTI/include",
10596
"/usr/include",
10697
],
10798
cpu = "darwin",
@@ -113,44 +104,6 @@ cc_toolchain_config(
113104
linker_bin_path = "/usr/bin",
114105
)
115106

116-
cc_toolchain(
117-
name = "cc-compiler-windows",
118-
all_files = ":windows_msvc_wrapper_files",
119-
compiler_files = ":empty",
120-
dwp_files = ":empty",
121-
linker_files = ":windows_msvc_wrapper_files",
122-
objcopy_files = ":empty",
123-
strip_files = ":empty",
124-
supports_param_files = 1,
125-
toolchain_config = ":cc-compiler-windows-config",
126-
toolchain_identifier = "local_windows",
127-
)
128-
129-
cc_toolchain_config(
130-
name = "cc-compiler-windows-config",
131-
builtin_include_directories = [
132-
"/dt7/usr/include/c++/7",
133-
"/dt7/usr/include/c++/7/x86_64-pc-linux-gnu",
134-
"/dt7/usr/include/c++/7/backward",
135-
"/dt7/usr/lib/gcc/x86_64-pc-linux-gnu/7/include",
136-
"/dt7/usr/lib/gcc/x86_64-pc-linux-gnu/7/include-fixed",
137-
"/dt7/usr/include",
138-
"/usr/local/cuda-10.0/targets/x86_64-linux/include",
139-
"/usr/local/cuda-10.0/include",
140-
"/usr/local/cuda-10.0/extras/CUPTI/include",
141-
"/usr/include",
142-
],
143-
cpu = "x64_windows",
144-
msvc_cl_path = "msvc_not_used",
145-
msvc_env_include = "msvc_not_used",
146-
msvc_env_lib = "msvc_not_used",
147-
msvc_env_path = "msvc_not_used",
148-
msvc_env_tmp = "msvc_not_used",
149-
msvc_lib_path = "msvc_not_used",
150-
msvc_link_path = "msvc_not_used",
151-
msvc_ml_path = "msvc_not_used",
152-
)
153-
154107
filegroup(
155108
name = "empty",
156109
srcs = [],
@@ -160,8 +113,3 @@ filegroup(
160113
name = "crosstool_wrapper_driver_is_not_gcc",
161114
srcs = ["clang/bin/crosstool_wrapper_driver_is_not_gcc"],
162115
)
163-
164-
filegroup(
165-
name = "windows_msvc_wrapper_files",
166-
srcs = glob(["windows/msvc_*"]),
167-
)

build_deps/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda10.0/cc_toolchain_config.bzl renamed to build_deps/toolchains/gcc7_manylinux2010-nvcc-cuda10.0/cc_toolchain_config.bzl

File renamed without changes.

build_deps/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda10.0/clang/bin/crosstool_wrapper_driver_is_not_gcc renamed to build_deps/toolchains/gcc7_manylinux2010-nvcc-cuda10.0/clang/bin/crosstool_wrapper_driver_is_not_gcc

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python
2-
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
2+
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -26,11 +26,6 @@ DESCRIPTION:
2626
as is as a string to --compiler-options of nvcc. When "-x cuda" is not
2727
present, this wrapper invokes hybrid_driver_is_not_gcc with the input
2828
arguments as is.
29-
30-
NOTES:
31-
Changes to the contents of this file must be propagated from
32-
//third_party/gpus/crosstool/crosstool_wrapper_is_not_gcc to
33-
//third_party/gpus/crosstool/v*/*/clang/bin/crosstool_wrapper_is_not_gcc
3429
"""
3530

3631
from __future__ import print_function

build_deps/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda10.0/windows/msvc_wrapper_for_nvcc.py

Lines changed: 0 additions & 210 deletions
This file was deleted.

configure.sh

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,21 +78,18 @@ write_action_env_to_bazelrc "TF_SHARED_LIBRARY_DIR" ${TF_SHARED_LIBRARY_DIR}
7878
write_action_env_to_bazelrc "TF_SHARED_LIBRARY_NAME" ${TF_SHARED_LIBRARY_NAME}
7979
write_action_env_to_bazelrc "TF_CXX11_ABI_FLAG" ${TF_CXX11_ABI_FLAG}
8080

81-
write_to_bazelrc "build:manylinux2010 --crosstool_top=//build_deps/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda10.0:toolchain"
82-
write_to_bazelrc "build --config=manylinux2010"
83-
write_to_bazelrc "test --config=manylinux2010"
8481

8582
if [[ "$TF_NEED_CUDA" == "1" ]]; then
83+
write_action_env_to_bazelrc "TF_NEED_CUDA" ${TF_NEED_CUDA}
8684
write_action_env_to_bazelrc "CUDNN_INSTALL_PATH" "/usr/lib/x86_64-linux-gnu"
8785
write_action_env_to_bazelrc "TF_CUDA_VERSION" "10.0"
8886
write_action_env_to_bazelrc "TF_CUDNN_VERSION" "7"
8987
write_action_env_to_bazelrc "CUDA_TOOLKIT_PATH" "${CUDA_HOME:=/usr/local/cuda}"
90-
write_to_bazelrc "build --config=cuda"
91-
write_to_bazelrc "test --config=cuda"
9288

89+
write_to_bazelrc "test --config=cuda"
90+
write_to_bazelrc "build --config=cuda"
91+
write_to_bazelrc "build --spawn_strategy=local"
92+
write_to_bazelrc "build --strategy=Genrule=local"
9393
write_to_bazelrc "build:cuda --define=using_cuda=true --define=using_cuda_nvcc=true"
94-
write_to_bazelrc "build --spawn_strategy=standalone"
95-
write_to_bazelrc "build --strategy=Genrule=standalone"
96-
write_action_env_to_bazelrc "TF_NEED_CUDA" ${TF_NEED_CUDA}
9794

9895
fi

tools/ci_build/builds/release_linux.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ for version in ${PYTHON_VERSIONS}; do
3434

3535
# Build
3636
bazel build \
37+
-c opt \
3738
--noshow_progress \
3839
--noshow_loading_progress \
3940
--verbose_failures \
4041
--test_output=errors \
42+
--crosstool_top=//build_deps/toolchains/gcc7_manylinux2010-nvcc-cuda10.0:toolchain \
4143
build_pip_pkg
4244

4345
# Package Whl

tools/ci_build/builds/release_macos.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export PATH="$PATH:$HOME/bin"
2727
# Install delocate
2828
python3 -m pip install -q delocate
2929

30+
brew update && brew upgrade pyenv
3031
eval "$(pyenv init -)"
3132

3233
for version in ${PYTHON_VERSIONS}; do
@@ -41,6 +42,7 @@ for version in ${PYTHON_VERSIONS}; do
4142

4243
# Build
4344
bazel build \
45+
-c opt \
4446
--noshow_progress \
4547
--noshow_loading_progress \
4648
--verbose_failures \

tools/ci_testing/addons_gpu.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ yes 'y' | ./configure.sh
4343
bazel test -c opt -k \
4444
--jobs=${N_JOBS} --test_timeout 300,450,1200,3600 \
4545
--test_output=errors --local_test_jobs=8 \
46+
--crosstool_top=//build_deps/toolchains/gcc7_manylinux2010-nvcc-cuda10.0:toolchain \
4647
//tensorflow_addons/...
4748

4849
exit $?

0 commit comments

Comments
 (0)