Skip to content

Commit 2b41107

Browse files
Update compile_tensorflow_cpp.md
1 parent f0fe92d commit 2b41107

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

compile_tensorflow_cpp.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ chmod +x bazel-3.7.2-installer-linux-x86_64.sh
5858

5959
### 3. Install Protobuf
6060

61-
I suggest installing protobuf after building TensorFlow so that we are able to check that which version of protobuf we should use.
61+
I suggest installing protobuf after building TensorFlow (see below) so that we are able to check that which version of protobuf we should use.
6262

6363
---
6464

@@ -100,14 +100,14 @@ bazel query ...
100100

101101
Note:
102102

103-
1. Building TensorFlow uses a lot of memory, 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
106-
4. Add `-D_GLIBCXX_USE_CXX11_ABI=0` if you use GCC 5 or higher
107-
5. Flags for optimization: `--copt="-O3"`
108-
6. Flasg for both AMD and Intel chips: `--copt=-mfma --copt=-msse4.1 --copt=-msse4.2 --copt=-mfpmath=both`
109-
7. Flags for Intel: `--copt=-mavx --copt=-mavx2`
110-
8. Rebuild with `--config=monolithic` if you want compile all TensorFlow C++ code into a single shared object
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.
106+
4. Add `-D_GLIBCXX_USE_CXX11_ABI=0` if you use GCC 5 or higher version.
107+
5. Flags for optimization: `--copt="-O3"`.
108+
6. Flasg for both AMD and Intel chips: `--copt=-mfma --copt=-msse4.1 --copt=-msse4.2 --copt=-mfpmath=both`.
109+
7. Flags for Intel: `--copt=-mavx --copt=-mavx2`.
110+
8. Rebuild with `--config=monolithic` if you want to compile all TensorFlow C++ code into a single shared object.
111111

112112
**optional**
113113
```bash

0 commit comments

Comments
 (0)