Open dawncc opened 7 years ago
MSYS2 is a software distro and building platform for Windows: http://www.msys2.org/
# 编辑 /etc/pacman.d/mirrorlist.mingw32 ,在文件开头添加:
Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/i686
# 编辑 /etc/pacman.d/mirrorlist.mingw64 ,在文件开头添加:
Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/x86_64
# 编辑 /etc/pacman.d/mirrorlist.msys ,在文件开头添加:
Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/msys/$arch
# 刷新更新
pacman -Sy
pacman -Syu
pacman -S mingw32/mingw-w64-i686-gcc
pacman -S mingw32/mingw-w64-i686-gdb
pacman -S mingw32/mingw-w64-i686-make
BAZEL_SH=c:/tools/msys64/usr/bin/bash.exe
这样就可以直接在命令行直接输入bash了。
使用Chocolatey安装
choco install bazel
https://www.bazel.build/ 安装问题参照:https://docs.bazel.build/versions/master/windows.html#requirements window安装前,需要配置系统参数
export JAVA_HOME="$(ls -d C:/Program\ Files/Java/jdk* | sort | tail -n 1)"
export BAZEL_SH=c:/tools/msys64/usr/bin/bash.exe
export PATH=c:/tools/msys64/usr/bin
从源码安装
git clone --recurse-submodules https://github.com/tensorflow/serving
cd serving
使用bazel编译serving
bazel build tensorflow_serving/...
报错: 原因是tensorflow要与tensorflow-serving在同一目录下
ERROR: error loading package '': Encountered error while reading extension file 'tensorflow/workspace.bzl': no such package '@org_tensorflow//tensorflow': No WORKSPACE file found in C:/users/cc/appdata/local/temp/_bazel_cc/c-ywu5vk/external/org_tensorflow.
INFO: Elapsed time: 0.536s
Chocolatey
Windows下的包管理器 https://chocolatey.org/ 用管理员权限使用cmd输入命令安装
如果要指定安装目录, 需要新建个环境变量ChocolateyInstall,并手动创建目录