Skip to content

Commit 3c8fe41

Browse files
Update compile_tensorflow_cpp.md
1 parent 2b41107 commit 3c8fe41

File tree

1 file changed

+38
-4
lines changed

1 file changed

+38
-4
lines changed

compile_tensorflow_cpp.md

+38-4
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,41 @@ git checkout r2.7
7676
Configure the build:
7777
```bash
7878
./configure
79-
# I leave all answers empty, just Enter
79+
80+
You have bazel 3.7.2 installed.
81+
Please specify the location of python. [Default is /home/rketka/miniconda3/envs/deepcv/bin/python3]:
82+
83+
84+
Found possible Python library paths:
85+
/home/rketka/miniconda3/envs/deepcv/lib/python3.9/site-packages
86+
Please input the desired Python library path to use. Default is [/home/rketka/miniconda3/envs/deepcv/lib/python3.9/site-packages]
87+
88+
Do you wish to build TensorFlow with ROCm support? [y/N]: N
89+
No ROCm support will be enabled for TensorFlow.
90+
91+
Do you wish to build TensorFlow with CUDA support? [y/N]: N
92+
No CUDA support will be enabled for TensorFlow.
93+
94+
Do you wish to download a fresh release of clang? (Experimental) [y/N]: N
95+
Clang will not be downloaded.
96+
97+
Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -Wno-sign-compare]: n
98+
99+
100+
Would you like to interactively configure ./WORKSPACE for Android builds? [y/N]: n
101+
Not configuring the WORKSPACE for Android builds.
102+
103+
Preconfigured Bazel build configs. You can use any of the below by adding "--config=<>" to your build command. See .bazelrc for more details.
104+
--config=mkl # Build with MKL support.
105+
--config=mkl_aarch64 # Build with oneDNN and Compute Library for the Arm Architecture (ACL).
106+
--config=monolithic # Config for mostly static monolithic build.
107+
--config=numa # Build with NUMA support.
108+
--config=dynamic_kernels # (Experimental) Build kernels into separate shared objects.
109+
--config=v1 # Build with TensorFlow 1 API instead of TF 2 API.
110+
Preconfigured Bazel build configs to DISABLE default on features:
111+
--config=nogcp # Disable GCP support.
112+
--config=nonccl # Disable NVIDIA NCCL support.
113+
Configuration finished
80114
```
81115

82116
Let's compile using bazel `build` rule:
@@ -100,9 +134,9 @@ bazel query ...
100134

101135
Note:
102136

103-
1. Building TensorFlow can consume a lot of memory. So I prefer a small number of CPUs (`--jobs`).
104-
2. Limit RAM requested by bazel with `--local_ram_resources`. The value is either integer, .e.g., `4096` or % of total memory, e.g., 50% use `"HOST_RAM*.50"`.
105-
3. The whole process can take several hours.
137+
1. Building TensorFlow can consume a lot of memory. So I prefer a small number of CPUs (`--jobs`), e.g. 4 CPUs use `--jobs=4`.
138+
2. Limit RAM requested by bazel with `--local_ram_resources`. The value is either integer, .e.g., 2048 use `--local_ram_resources=2048` or % of total memory, e.g., 50% use `"HOST_RAM*.50"`.
139+
3. The whole process can take up to 1 hour.
106140
4. Add `-D_GLIBCXX_USE_CXX11_ABI=0` if you use GCC 5 or higher version.
107141
5. Flags for optimization: `--copt="-O3"`.
108142
6. Flasg for both AMD and Intel chips: `--copt=-mfma --copt=-msse4.1 --copt=-msse4.2 --copt=-mfpmath=both`.

0 commit comments

Comments
 (0)