mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Summary: Context: https://github.com/pytorch/pytorch/pull/53299#discussion_r587882857 These are the only hand-written parts of this diff: - the addition to `.github/workflows/lint.yml` - the file endings changed in these four files (to appease FB-internal land-blocking lints): - `GLOSSARY.md` - `aten/src/ATen/core/op_registration/README.md` - `scripts/README.md` - `torch/csrc/jit/codegen/fuser/README.md` The rest was generated by running this command (on macOS): ``` git grep -I -l ' $' -- . ':(exclude)**/contrib/**' ':(exclude)third_party' | xargs gsed -i 's/ *$//' ``` I looked over the auto-generated changes and didn't see anything that looked problematic. Pull Request resolved: https://github.com/pytorch/pytorch/pull/53406 Test Plan: This run (after adding the lint but before removing existing trailing spaces) failed: - https://github.com/pytorch/pytorch/runs/2043032377 This run (on the tip of this PR) succeeded: - https://github.com/pytorch/pytorch/runs/2043296348 Reviewed By: walterddr, seemethere Differential Revision: D26856620 Pulled By: samestep fbshipit-source-id: 3f0de7f7c2e4b0f1c089eac9b5085a58dd7e0d97
45 lines
1.4 KiB
Bash
Executable File
45 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
##############################################################################
|
|
# 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"}
|
|
mkdir -p $BUILD_ROOT
|
|
echo "Build Caffe2 raspbian into: $BUILD_ROOT"
|
|
|
|
# obtain dependencies.
|
|
echo "Installing dependencies."
|
|
sudo apt-get install \
|
|
cmake \
|
|
libgflags-dev \
|
|
libgoogle-glog-dev \
|
|
libprotobuf-dev \
|
|
libpython-dev \
|
|
python-pip \
|
|
python-numpy \
|
|
protobuf-compiler \
|
|
python-protobuf
|
|
# python dependencies
|
|
sudo pip install hypothesis
|
|
|
|
# Now, actually build the raspbian target.
|
|
echo "Building caffe2"
|
|
cd $BUILD_ROOT
|
|
|
|
# Note: you can add more dependencies above if you need libraries such as
|
|
# leveldb, lmdb, etc.
|
|
cmake "$CAFFE2_ROOT" \
|
|
-DCMAKE_VERBOSE_MAKEFILE=1 \
|
|
-DCAFFE2_CPU_FLAGS="-mfpu=neon -mfloat-abi=hard" \
|
|
|| exit 1
|
|
|
|
# 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.
|
|
make -j 2 || exit 1
|