Giter Site home page Giter Site logo

pinto0309 / bazel_bin Goto Github PK

View Code? Open in Web Editor NEW
23.0 5.0 8.0 55 KB

Bazel's pre-built binaries for armv7l / aarch64 / x86_64.

Home Page: https://qiita.com/PINTO

License: Apache License 2.0

Shell 100.00%
bazel ubuntu raspbian raspberrypi tx2 debian x86-64 jetson-nano

bazel_bin's Introduction

Bazel_bin

Bazel's prebuilt binary storehouse.

RaspberryPi4/3 ... Raspbian_armhf / Debian_Buster_aarch64 / Ubuntu1604_aarch64 / Ubuntu1910_aarch64
Ubuntu1604 ... Ubuntu1604_x86_64
Ubuntu1804 ... Ubuntu1804_x86_64 / Ubuntu1804_JetsonNano_aarch64
TX2 ... Ubuntu1604_aarch64

Usage

$ cd ~
$ git clone https://github.com/PINTO0309/Bazel_bin.git

$ cd Bazel_bin/0.17.2/Raspbian_armhf
or
$ cd Bazel_bin/0.17.2/Ubuntu1604_x86_64
or
$ cd Bazel_bin/0.17.2/Ubuntu1604_aarch64
$ sudo apt-get install -y openjdk-8-jdk

or
[Stable] Install openjdk-8-jdk safely in Raspbian Buster (Debian 10) environment
  

$ ./install.sh

Binary destination folder

/usr/local/bin

Execution exmaple

$ cd tensorflow
$ ./configure
$ sudo bazel build --config opt --local_resources 1024.0,0.5,0.5 \
--copt=-mfpu=neon-vfpv4 \
--copt=-ftree-vectorize \
--copt=-funsafe-math-optimizations \
--copt=-ftree-loop-vectorize \
--copt=-fomit-frame-pointer \
--copt=-DRASPBERRY_PI \
--host_copt=-DRASPBERRY_PI \
//tensorflow/tools/pip_package:build_pip_package

Supplement - Steps for building Bazel

Example: 0.19.2 or less

$ sudo apt-get install build-essential openjdk-8-jdk python zip unzip
$ cd ~
$ mkdir bazel;cd bazel
$ wget https://github.com/bazelbuild/bazel/releases/download/0.19.2/bazel-0.19.2-dist.zip
$ unzip bazel-0.19.2-dist.zip

#==== Only RaspberryPi ============================================================
$ nano scripts/bootstrap/compile.sh

#################################################################################
  run "${JAVAC}" -classpath "${classpath}" -sourcepath "${sourcepath}" \
      -d "${output}/classes" -source "$JAVA_VERSION" -target "$JAVA_VERSION" \
      -encoding UTF-8 ${BAZEL_JAVAC_OPTS} "@${paramfile}"
##################################################################################################################################################################
  run "${JAVAC}" -classpath "${classpath}" -sourcepath "${sourcepath}" \
      -d "${output}/classes" -source "$JAVA_VERSION" -target "$JAVA_VERSION" \
      -encoding UTF-8 ${BAZEL_JAVAC_OPTS} "@${paramfile}" -J-Xmx500M
#################################################################################
#==== Only RaspberryPi ============================================================

$ sudo bash ./compile.sh   #<--- Execute it directly under the bazel folder
$ sudo cp output/bazel /usr/local/bin   #<--- Always execute after completion of build

Example: 0.20.0 - 0.24.1

$ sudo apt-get install build-essential openjdk-8-jdk python zip unzip

#==== Do not run on aarch64. Device operation becomes unstable. ===================
$ wget https://github.com/PINTO0309/Tensorflow-bin/raw/master/zram.sh
$ chmod 755 zram.sh
$ sudo mv zram.sh /etc/init.d/
$ sudo update-rc.d zram.sh defaults
$ sudo reboot
#==== Do not run on aarch64. Device operation becomes unstable. ===================

$ cd ~
$ mkdir bazel;cd bazel
$ wget https://github.com/bazelbuild/bazel/releases/download/0.24.1/bazel-0.24.1-dist.zip
$ unzip bazel-0.24.1-dist.zip
$ env EXTRA_BAZEL_ARGS="--host_javabase=@local_jdk//:jdk"


$ nano compile.sh

#################################################################################
bazel_build "src:bazel_nojdk${EXE_EXT}" \
  --action_env=PATH \
  --host_platform=@bazel_tools//platforms:host_platform \
  --platforms=@bazel_tools//platforms:target_platform \
  || fail "Could not build Bazel"
##################################################################################################################################################################
bazel_build "src:bazel_nojdk${EXE_EXT}" \
  --host_javabase=@local_jdk//:jdk \
  --action_env=PATH \
  --host_platform=@bazel_tools//platforms:host_platform \
  --platforms=@bazel_tools//platforms:target_platform \
  || fail "Could not build Bazel"
#################################################################################

#==== Only RaspberryPi ============================================================
$ nano scripts/bootstrap/compile.sh

#################################################################################
  run "${JAVAC}" -classpath "${classpath}" -sourcepath "${sourcepath}" \
      -d "${output}/classes" -source "$JAVA_VERSION" -target "$JAVA_VERSION" \
      -encoding UTF-8 ${BAZEL_JAVAC_OPTS} "@${paramfile}"
##################################################################################################################################################################
  run "${JAVAC}" -classpath "${classpath}" -sourcepath "${sourcepath}" \
      -d "${output}/classes" -source "$JAVA_VERSION" -target "$JAVA_VERSION" \
      -encoding UTF-8 ${BAZEL_JAVAC_OPTS} "@${paramfile}" -J-Xmx800M
#################################################################################
#==== Only RaspberryPi ============================================================

$ sudo bash ./compile.sh   #<--- Execute it directly under the bazel folder
$ sudo cp output/bazel /usr/local/bin   #<--- Always execute after completion of build

Example: 0.26.1 or more

[Stable] Install openjdk-8-jdk safely in Raspbian Buster (Debian 10) environment

$ sudo apt-get install build-essential python zip unzip

#==== Do not run on aarch64. Device operation becomes unstable. ===================
$ wget https://github.com/PINTO0309/Tensorflow-bin/raw/master/zram.sh
$ chmod 755 zram.sh
$ sudo mv zram.sh /etc/init.d/
$ sudo update-rc.d zram.sh defaults
$ sudo reboot
#==== Do not run on aarch64. Device operation becomes unstable. ===================

$ cd ~
$ mkdir bazel;cd bazel
$ wget https://github.com/bazelbuild/bazel/releases/download/0.26.1/bazel-0.26.1-dist.zip
$ unzip bazel-0.26.1-dist.zip
$ env EXTRA_BAZEL_ARGS="--host_javabase=@local_jdk//:jdk"


$ nano compile.sh

#################################################################################
bazel_build "src:bazel_nojdk${EXE_EXT}" \
  --action_env=PATH \
  --host_platform=@bazel_tools//platforms:host_platform \
  --platforms=@bazel_tools//platforms:target_platform \
  || fail "Could not build Bazel"
##################################################################################################################################################################
bazel_build "src:bazel_nojdk${EXE_EXT}" \
  --host_javabase=@local_jdk//:jdk \
  --action_env=PATH \
  --host_platform=@bazel_tools//platforms:host_platform \
  --platforms=@bazel_tools//platforms:target_platform \
  || fail "Could not build Bazel"
#################################################################################

#==== Only RaspberryPi ============================================================
$ nano scripts/bootstrap/compile.sh

#################################################################################
  run "${JAVAC}" -classpath "${classpath}" -sourcepath "${sourcepath}" \
      -d "${output}/classes" -source "$JAVA_VERSION" -target "$JAVA_VERSION" \
      -encoding UTF-8 ${BAZEL_JAVAC_OPTS} "@${paramfile}"
##################################################################################################################################################################
  run "${JAVAC}" -classpath "${classpath}" -sourcepath "${sourcepath}" \
      -d "${output}/classes" -source "$JAVA_VERSION" -target "$JAVA_VERSION" \
      -encoding UTF-8 ${BAZEL_JAVAC_OPTS} "@${paramfile}" -J-Xmx800M
#################################################################################
#==== Only RaspberryPi ============================================================

$ sudo bash ./compile.sh   #<--- Execute it directly under the bazel folder
$ sudo cp output/bazel /usr/local/bin   #<--- Always execute after completion of build

bazel_bin's People

Contributors

pinto0309 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

bazel_bin's Issues

On what platform do you build bazel

On what platform do you build your bazel distro's? I've been trying to build on a rPi3b+ and having problems with running out of resources - heap. I've tried adjusting the java options but can't find anything that works. I have a 3.7.2 version of bazel from "bazel-bin" and have problems with building mediapipe from latest source with a symbol not defined error at runtime. So, if you could help me out I'd appreciate it.

Bad file descriptor on buster 27 and 28 armh builds

[Required] Your device (RaspberryPi3, LaptopPC, or other device name):
qemu on x86_64 docker

[Required] Your device's CPU architecture (armv7l, x86_64, or other architecture name):
arm7l

[Required] Your OS (Raspbian, Ubuntu1604, or other os name):
Debian Buster

[Required] Details of the work you did before the problem occurred:

[Required] Error message:

root@7a626b435c10:/tmp# ./bazel
Opening zip "/proc/self/exe": lseek(): Bad file descriptor
FATAL: Failed to open Bazel as a zip file: (error: 9): Bad file descriptor

[Required] Overview of problems and questions:
Am I missing any packages or is there something wrong with the build maybe?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.