Skip to content

[bazel] install Syntaxnet

Myungchul Shin edited this page Mar 14, 2018 · 9 revisions

OS X

#1) bazel 0.4.3 
$ curl -OL https://github.com/bazelbuild/bazel/releases/download/0.4.3/bazel-0.4.3-installer-darwin-x86_64.sh
$ chmod +x bazel-0.4.3-installer-darwin-x86_64.sh
$ ./bazel-0.4.3-installer-darwin-x86_64.sh --user
$ vi .bash_profile
  source ${HOME}/.bazelrc
  export PATH=${PATH}:${HOME}/bin

#2) swig
$ brew install swig

# 3) protobuf, mock, asciitree, numpy
$ sudo easy_install pip
$ pip install -U protobuf==3.0.0b2 --user
$ pip install mock --user
$ pip install asciitree --user
$ pip install numpy --user

# 4) clone and compile
$ git clone --recursive https://github.com/tensorflow/models.git
$ cd models/syntaxnet/tensorflow
$ ./configure
* you should set python library path to your local(ex, /Users/donghwon/Library/Python/2.7/lib/python/site-packages/)
$ cd ..
$ bazel test --linkopt=-headerpad_max_install_names syntaxnet/... util/utf8/...

CentOS 7

# basically same as 'OS X'
# except
$ sudo yum install swig.x86_64
$ bazel test ...

etc

  • bazel 0.2.2b
# install bazel 0.2.2b in CentOS
$ curl -OL https://github.com/bazelbuild/bazel/releases/download/0.2.2b/bazel-0.2.2b-installer-linux-x86_64.sh
$ chmod +x bazel-0.2.2b-installer-linux-x86_64.sh
$ cd ~
$ mkdir bazel-0.2.2b
$ cd -
$ ./bazel-0.2.2b-installer-linux-x86_64.sh --prefix=${HOME}/bazel-0.2.2b --bazelrc=${HOME}/bazel-0.2.2b/lib/bazel/etc/bazelrc
  • bashrc for bazel 0.2.2b
# bazel
source ${HOME}/.bazel/bin/bazel-complete.bash
export PATH=${HOME}/bin:${PATH}

# bazel 0.2.2b
#BAZEL_HOME=${HOME}/bazel-0.2.2b
#source ${BAZEL_HOME}/lib/bazel/bin/bazel-complete.bash
#export PATH=${BAZEL_HOME}/bin:${PATH}
  • bazel 0.11.1
# install bazel 0.11.1 in CentOS
$ curl -OL https://github.com/bazelbuild/bazel/releases/download/0.11.1/bazel-0.11.1-installer-linux-x86_64.sh
$ chmod +x bazel-0.11.1-installer-linux-x86_64.sh
$ cd ~
$ mkdir bazel-0.11.1
$ cd -
$ ./bazel-0.11.1-installer-linux-x86_64.sh --prefix=${HOME}/bazel-0.11.1 --user
Clone this wiki locally