mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 00:20:18 +01:00
Summary: Closes https://github.com/caffe2/caffe2/pull/147 Reviewed By: bwasti Differential Revision: D4564024 Pulled By: JoelMarcey fbshipit-source-id: 526a5ab700f9356a3c93a6c64dc38e44a173559c
31 lines
973 B
Bash
Executable File
31 lines
973 B
Bash
Executable File
#!/bin/bash
|
|
##############################################################################
|
|
# Example command to build Caffe2 locally without installing many dependencies
|
|
##############################################################################
|
|
#
|
|
# This script builds protoc locally and then sets the appropriate dependencies
|
|
# to remove the need for many external dependencies.
|
|
#
|
|
|
|
CAFFE2_ROOT="$( cd "$(dirname "$0")"/.. ; pwd -P)"
|
|
echo "Caffe2 codebase root is: $CAFFE2_ROOT"
|
|
|
|
# We are going to build the target into build.
|
|
BUILD_ROOT=$CAFFE2_ROOT/build
|
|
mkdir -p $BUILD_ROOT
|
|
echo "Build Caffe2 into: $BUILD_ROOT"
|
|
|
|
# Build protobuf from third_party so we have a host protoc binary.
|
|
echo "Building protoc"
|
|
$CAFFE2_ROOT/scripts/build_host_protoc.sh || exit 1
|
|
|
|
# Now, actually build the target.
|
|
echo "Building caffe2"
|
|
cd $BUILD_ROOT
|
|
|
|
cmake .. \
|
|
-DPROTOBUF_PROTOC_EXECUTABLE=$CAFFE2_ROOT/build_host_protoc/bin/protoc \
|
|
-DBUILD_SHARED_LIBS=OFF \
|
|
|| exit 1
|
|
make
|