| ############################################################################## |
| # Example command to build the Raspbian target. |
| ############################################################################## |
| # This script shows how one can build a Caffe2 binary for raspbian. The build |
| # is essentially much similar to a host build, with one additional change |
| # which is to specify -mfpu=neon for optimized speed. |
| CAFFE2_ROOT="$( cd "$(dirname -- "$0")"/.. ; pwd -P)" |
| echo "Caffe2 codebase root is: $CAFFE2_ROOT" |
| BUILD_ROOT=${BUILD_ROOT:-"$CAFFE2_ROOT/build"} |
| echo "Build Caffe2 raspbian into: $BUILD_ROOT" |
| echo "Installing dependencies." |
| sudo pip install hypothesis |
| # Now, actually build the raspbian target. |
| # Note: you can add more dependencies above if you need libraries such as |
| -DCMAKE_VERBOSE_MAKEFILE=1 \ |
| -DCAFFE2_CPU_FLAGS="-mfpu=neon -mfloat-abi=hard" \ |
| # Note: while Raspberry pi has 4 cores, running too many builds in parallel may |
| # cause out of memory errors so we will simply run -j 2 only. |