有時候我們需要源碼安裝tensorflow,這時逃不過的第一步就是安裝Bazel,如果沒有root權限的時候,這時我們就需要源碼安裝Bazel了。
4.? ?更新bashrc
? ?export PATH=$PATH:**/output/bazel?? ? ? ? ? ? ? ?
下面是安裝步驟,參考:https://docs.bazel.build/versions/master/install-compile-source.html
1.?Ensure that JDK 8, Python, Bash, zip, and the usual C++ build toolchain are installed on your system.
這里需要說明的是JDK8的安裝,一般centos默認安裝了openJDK,但不完整,因此我們改用oracle的java版本,具體安裝方法,見:《 安裝oracle-java,并覆蓋原先的OpenJDK》
2.?Download and unpack Bazel's distribution archive.
Download?bazel-<version>-dist.zip?
?from the?release page:https://github.com/bazelbuild/bazel/releases
3.?Build Bazel using?./compile.sh
.??
? ?
cd
?into the directory where you unpacked the distribution archive- run?
bash ./compile.sh
output/bazel下面。
4.? ?更新bashrc
? ?export PATH=$PATH:**/output/bazel?? ? ? ? ? ? ? ?
? 然后source ~/.bashrc即可。
?