forked from facebookarchive/caffe2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_local.sh
executable file
·30 lines (25 loc) · 973 Bytes
/
build_local.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/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