0%

# Install TensorFlow’s C++ interface

The tensorflow’s C++ interface will be compiled from the source code. Firstly one installs bazel. The bazel version 3.1.0 should be used. A full instruction of bazel installation can be found here.

Firstly get the source code of the tensorflow

You will answer a list of questions that help configure the building of tensorflow. You may want to answer the question like the following. If you do not want to add CUDA support, please answer no.

The library path for Python should be set accordingly.

Now build the shared library of tensorflow:

You may want to add options --copt=-msse4.2, --copt=-mavx, --copt=-mavx2 and --copt=-mfma to enable SSE4.2, AVX, AVX2 and FMA SIMD accelerations, respectively. It is noted that these options should be chosen according to the CPU architecture. If the RAM becomes an issue of your machine, you may limit the RAM usage by using --local_resources 2048,.5,1.0.

Now I assume you want to install tensorflow in directory \$tensorflow_root. Create the directory if it does not exists

Now, copy the libraries to the tensorflow’s installation directory:

# Troubleshooting

GitHub - njzjz/zhihubackup

## 使用

2019年5月，林峰邀请我暑假到北大实习，我欣然答应。拿到学士学位证书后，我在家里休息了一周，顺便处理了升学的各项事宜。这些全部搞定后，6月下旬，我启程前往北京。

Online report on Nov 5 2020 at 9:50 p.m. EST, at Westlake University.