Skip to content

Commit cbddd46

Browse files
committed
Set up configure scripts
Signed-off-by: Ryan Nett <rnett@calpoly.edu>
1 parent f6024dd commit cbddd46

File tree

7 files changed

+46
-15
lines changed

7 files changed

+46
-15
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,4 @@ gradleBuild
5555
**/target
5656
.tf_configure.bazelrc
5757
.clwb/
58+
/tensorflow-core/tensorflow-core-api/config.log

CONTRIBUTING.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@ complete build could be required to reflect the changes, otherwise `-Pdev` shoul
2424
### Native Builds
2525

2626
In some cases, like when adding GPU support or re-generating op classes, you will need to re-build the native library. 99% of this is building
27-
TensorFlow, which by default is configured for the [CI](.github/workflows/ci.yml). The build configuration can be customized using the same methods as
28-
TensorFlow, so if you're building locally, you may need to clone the [tensorflow](https://github.com/tensorflow/tensorflow) project, run its
29-
configuration script (`./configure`), and copy the resulting
30-
`.tf_configure.bazelrc` to `tensorflow-core-api`. This overrides the default options, and you can add to it manually (i.e. adding `build --copt="-g"`
31-
to build with debugging info).
27+
TensorFlow, which by default is configured for the [CI](.github/workflows/ci.yml). The build configuration can be customized using the `configure`
28+
scripts in `tensorflow-core-api`, which call the scripts downloaded with the tensorflow dependency. This overrides the default options, and you can
29+
add to it manually (i.e. adding `build --copt="-g"` to build with debugging info).
3230

3331
### GPU Support
3432

@@ -90,7 +88,8 @@ in [IntelliJ](https://github.com/google/styleguide/blob/gh-pages/intellij-java-g
9088

9189
### Dependencies
9290

93-
For dependencies, we can use anything compliant with [this list](https://opensource.google/docs/thirdparty/licenses/#notice), but we want to keep the core libraries as dependency free as possible.
91+
For dependencies, we can use anything compliant with [this list](https://opensource.google/docs/thirdparty/licenses/#notice), but we want to keep the
92+
core libraries as dependency free as possible.
9493

9594
### Code generation
9695

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.7.2

tensorflow-core/tensorflow-core-api/WORKSPACE

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,6 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
77
# the version of this archive (e.g. google protobuf)
88
http_archive(
99
name = "org_tensorflow",
10-
patches = [
11-
":tensorflow-visibility.patch",
12-
":tensorflow-macosx.patch",
13-
# ":tensorflow-windows.patch", # https://github.com/tensorflow/tensorflow/issues/25213
14-
":tensorflow-proto.patch",
15-
],
16-
patch_tool = "patch",
17-
patch_args = ["-p1"],
18-
patch_cmds = ["grep -rl 'java_package' tensorflow/core | xargs sed -i.bak 's/^\(.* java_package = \"org\.tensorflow\.\)\(.*\"\)/\\1proto.\\2'/"],
1910
urls = [
2011
"https://github.com/tensorflow/tensorflow/archive/v2.4.1.tar.gz",
2112
],

tensorflow-core/tensorflow-core-api/build.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
# Script to build native TensorFlow libraries
33
set -eu
44

5+
if [ ! -f .tf_configure.bazelrc ]; then
6+
echo "WARNING: No .tf_configure.bazelrc, using CI settings. For local builds, run the ./configure script." >&2
7+
fi
8+
59
# Allows us to use ccache with Bazel on Mac
610
export BAZEL_USE_CPP_ONLY_TOOLCHAIN=1
711

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
3+
#
4+
# /* Copyright 2021 The TensorFlow Authors. All Rights Reserved.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
# ==============================================================================*/
18+
#
19+
set -e
20+
21+
bazel fetch @org_tensorflow//- || true
22+
23+
BASE=$(bazel info output_base)
24+
/mnt/c/Users/jimne/_bazel_Ryan/drtzmoke/external/org_tensorflow/configure
25+
mv /mnt/c/Users/jimne/_bazel_Ryan/drtzmoke/external/org_tensorflow/.tf_configure.bazelrc .
26+
#"$BASE"/external/org_tensorflow/configure
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@echo off
2+
3+
bazel fetch @org_tensorflow//-
4+
5+
for /f %%i in ('bazel info output_base') do set VAR=%%i
6+
7+
CALL %VAR%\\external\\org_tensorflow\\configure.cmd
8+
9+
MOVE %VAR%\\external\\org_tensorflow\\.tf_configure.bazelrc .

0 commit comments

Comments
 (0)