Skip to content

Commit a59dba0

Browse files
seanpmorganWindQAQ
authored andcommitted
BLD: Update environment to ubuntu16.04 (#389)
* BLD: Update environment to ubuntu16.04 * Drop support for py34 * Remove install from loop * Update working manylinux2010 build * Update test cases for dtype autocasting * Add issue number Lint Add missing files Create crosstool_wrapper_driver_is_not_gcc.tpl Create msvc_wrapper_for_nvcc.py.tpl Update permission * Add comments to requirements * Move cuda clang tpl * Install buildifier for CI sanity * Fix sanity check * Correct cuda header path * Fix bazel dict join * Fix last gpu build and update install comment
1 parent fe1bc84 commit a59dba0

File tree

25 files changed

+2215
-70
lines changed

25 files changed

+2215
-70
lines changed

.travis.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,21 @@ jobs:
2020
include:
2121
# Linux Tests
2222
- stage: test
23-
name: "Test on Ubuntu 14.04"
23+
name: "Test on Ubuntu 16.04"
2424
script:
25-
- docker run --rm -v ${PWD}:/addons -w /addons tensorflow/tensorflow:nightly-custom-op make unit-test
25+
- docker run --rm -v ${PWD}:/addons -w /addons tensorflow/tensorflow:custom-op-ubuntu16 make unit-test
2626

2727
# Linux Builds
2828
- stage: build
29-
name: "Build on Ubuntu 14.04 for Python 2.7 3.4 3.5 3.6"
29+
name: "Build on Ubuntu 16.04 for Python 2.7 3.5 3.6 3.7"
3030
script:
31-
- docker run --rm -v $PWD:/addons -w /addons tensorflow/tensorflow:nightly-custom-op tools/ci_build/builds/release_linux.sh
31+
- docker run --rm -v $PWD:/addons -w /addons tensorflow/tensorflow:custom-op-ubuntu16 tools/ci_build/builds/release_linux.sh
3232
after_success:
3333
- twine upload -u $PYPI_USER -p $PYPI_PW wheelhouse/*.whl
3434

3535
# MacOS Builds
3636
- stage: build
37-
name: "Build on MacOS for Python 2.7 3.4 3.5 3.6"
37+
name: "Build on MacOS for Python 2.7 3.5 3.6 3.7"
3838
os: osx
3939
osx_image: xcode10
4040
script:

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ bash tools/run_docker.sh -c 'make unit-test'
7676
or run manually:
7777

7878
```bash
79-
docker run --rm -it -v ${PWD}:/addons -w /addons tensorflow/tensorflow:nightly-custom-op /bin/bash
79+
docker run --rm -it -v ${PWD}:/addons -w /addons tensorflow/tensorflow:custom-op-ubuntu16 /bin/bash
8080

8181
./configure.sh # Links project with TensorFlow dependency
8282

@@ -94,7 +94,7 @@ bash tools/run_docker.sh -d gpu -c 'make gpu-unit-test'
9494
or run manually:
9595

9696
```bash
97-
docker run --runtime=nvidia --rm -it -v ${PWD}:/addons -w /addons tensorflow/tensorflow:custom-op-gpu /bin/bash
97+
docker run --runtime=nvidia --rm -it -v ${PWD}:/addons -w /addons tensorflow/tensorflow:custom-op-gpu-ubuntu16 /bin/bash
9898
./configure.sh # Links project with TensorFlow dependency
9999

100100
bazel test -c opt -k \

build_deps/gpu/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc.tpl

100755100644
File mode changed.

build_deps/gpu/cuda_configure.bzl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def _get_win_cuda_defines(repository_ctx):
174174
# If we are not on Windows, return empty vaules for Windows specific fields.
175175
# This ensures the CROSSTOOL file parser is happy.
176176
if not _is_windows(repository_ctx):
177-
return {
177+
return dict({
178178
"%{msvc_env_tmp}": "",
179179
"%{msvc_env_path}": "",
180180
"%{msvc_env_include}": "",
@@ -184,7 +184,7 @@ def _get_win_cuda_defines(repository_ctx):
184184
"%{msvc_link_path}": "",
185185
"%{msvc_lib_path}": "",
186186
"%{cxx_builtin_include_directory}": "",
187-
}
187+
})
188188

189189
vc_path = find_vc_path(repository_ctx)
190190
if not vc_path:
@@ -957,6 +957,8 @@ def _get_cuda_config(repository_ctx):
957957
)
958958

959959
def _tpl(repository_ctx, tpl, substitutions = {}, out = None):
960+
if substitutions == None:
961+
substitutions = {}
960962
if not out:
961963
out = tpl.replace(":", "/")
962964
repository_ctx.template(
@@ -1301,7 +1303,7 @@ def _create_local_cuda_repository(repository_ctx):
13011303
_tpl(
13021304
repository_ctx,
13031305
"crosstool:CROSSTOOL",
1304-
cuda_defines + _get_win_cuda_defines(repository_ctx),
1306+
cuda_defines.update(_get_win_cuda_defines(repository_ctx)),
13051307
out = "crosstool/CROSSTOOL",
13061308
)
13071309

build_deps/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
tf-nightly-2.0-preview==2.0.0.dev20190731
1+
# TensorFlow greater than this date is manylinux2010 compliant
2+
tf-nightly-2.0-preview>=2.0.0.dev20190802

build_deps/requirements_gpu.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
tf-nightly-gpu-2.0-preview==2.0.0.dev20190731
1+
# TensorFlow greater than this date is manylinux2010 compliant
2+
tf-nightly-gpu-2.0-preview>=2.0.0.dev20190802

build_deps/tf_dependency/tf_configure.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def _symlink_genrule_for_dir(
168168

169169
# Copy the headers to create a sandboxable setup.
170170
cmd = "cp -f"
171-
command.append(cmd + ' "%s" "%s"' % (src_files[i], dest))
171+
command.append(cmd + ' "%s" "%s" | true' % (src_files[i], dest))
172172
outs.append(' "' + dest_dir + dest_files[i] + '",')
173173
genrule = _genrule(
174174
genrule_name,
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
# This file is expanded from a template by cuda_configure.bzl
2+
# Update cuda_configure.bzl#verify_build_defines when adding new variables.
3+
4+
load(":cc_toolchain_config.bzl", "cc_toolchain_config")
5+
6+
licenses(["restricted"])
7+
8+
package(default_visibility = ["//visibility:public"])
9+
10+
toolchain(
11+
name = "toolchain-linux-x86_64",
12+
exec_compatible_with = [
13+
"@bazel_tools//platforms:linux",
14+
"@bazel_tools//platforms:x86_64",
15+
],
16+
target_compatible_with = [
17+
"@bazel_tools//platforms:linux",
18+
"@bazel_tools//platforms:x86_64",
19+
],
20+
toolchain = ":cc-compiler-local",
21+
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
22+
)
23+
24+
cc_toolchain_suite(
25+
name = "toolchain",
26+
toolchains = {
27+
"local|compiler": ":cc-compiler-local",
28+
"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",
33+
"k8": ":cc-compiler-local",
34+
"piii": ":cc-compiler-local",
35+
"ppc": ":cc-compiler-local",
36+
"darwin": ":cc-compiler-darwin",
37+
},
38+
)
39+
40+
cc_toolchain(
41+
name = "cc-compiler-local",
42+
all_files = ":crosstool_wrapper_driver_is_not_gcc",
43+
compiler_files = ":empty",
44+
dwp_files = ":empty",
45+
linker_files = ":crosstool_wrapper_driver_is_not_gcc",
46+
objcopy_files = ":empty",
47+
strip_files = ":empty",
48+
# To support linker flags that need to go to the start of command line
49+
# we need the toolchain to support parameter files. Parameter files are
50+
# last on the command line and contain all shared libraries to link, so all
51+
# regular options will be left of them.
52+
supports_param_files = 1,
53+
toolchain_config = ":cc-compiler-local-config",
54+
toolchain_identifier = "local_linux",
55+
)
56+
57+
cc_toolchain_config(
58+
name = "cc-compiler-local-config",
59+
builtin_include_directories = [
60+
"/dt7/usr/include/c++/7",
61+
"/dt7/usr/include/c++/7/x86_64-pc-linux-gnu",
62+
"/dt7/usr/include/c++/7/backward",
63+
"/dt7/usr/lib/gcc/x86_64-pc-linux-gnu/7/include",
64+
"/dt7/usr/lib/gcc/x86_64-pc-linux-gnu/7/include-fixed",
65+
"/dt7/usr/include",
66+
"/usr/local/cuda-10.0/targets/x86_64-linux/include",
67+
"/usr/local/cuda-10.0/include",
68+
"/usr/local/cuda-10.0/extras/CUPTI/include",
69+
"/usr/include",
70+
],
71+
cpu = "local",
72+
extra_no_canonical_prefixes_flags = ["-fno-canonical-system-headers"],
73+
host_compiler_path = "clang/bin/crosstool_wrapper_driver_is_not_gcc",
74+
host_compiler_prefix = "/usr/bin",
75+
host_compiler_warnings = [],
76+
host_unfiltered_compile_flags = [],
77+
linker_bin_path = "/usr/bin",
78+
)
79+
80+
cc_toolchain(
81+
name = "cc-compiler-darwin",
82+
all_files = ":crosstool_wrapper_driver_is_not_gcc",
83+
compiler_files = ":empty",
84+
dwp_files = ":empty",
85+
linker_files = ":crosstool_wrapper_driver_is_not_gcc",
86+
objcopy_files = ":empty",
87+
strip_files = ":empty",
88+
supports_param_files = 0,
89+
toolchain_config = ":cc-compiler-local-darwin",
90+
toolchain_identifier = "local_darwin",
91+
)
92+
93+
cc_toolchain_config(
94+
name = "cc-compiler-local-darwin",
95+
builtin_include_directories = [
96+
"/dt7/usr/include/c++/7",
97+
"/dt7/usr/include/c++/7/x86_64-pc-linux-gnu",
98+
"/dt7/usr/include/c++/7/backward",
99+
"/dt7/usr/lib/gcc/x86_64-pc-linux-gnu/7/include",
100+
"/dt7/usr/lib/gcc/x86_64-pc-linux-gnu/7/include-fixed",
101+
"/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",
105+
"/usr/include",
106+
],
107+
cpu = "darwin",
108+
extra_no_canonical_prefixes_flags = ["-fno-canonical-system-headers"],
109+
host_compiler_path = "clang/bin/crosstool_wrapper_driver_is_not_gcc",
110+
host_compiler_prefix = "/usr/bin",
111+
host_compiler_warnings = [],
112+
host_unfiltered_compile_flags = [],
113+
linker_bin_path = "/usr/bin",
114+
)
115+
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+
154+
filegroup(
155+
name = "empty",
156+
srcs = [],
157+
)
158+
159+
filegroup(
160+
name = "crosstool_wrapper_driver_is_not_gcc",
161+
srcs = ["clang/bin/crosstool_wrapper_driver_is_not_gcc"],
162+
)
163+
164+
filegroup(
165+
name = "windows_msvc_wrapper_files",
166+
srcs = glob(["windows/msvc_*"]),
167+
)

0 commit comments

Comments
 (0)