mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Allow specifying cmake build directory in the build scripts
Summary: Closes https://github.com/caffe2/caffe2/pull/1496 Reviewed By: pietern Differential Revision: D6379743 Pulled By: bddppq fbshipit-source-id: 1cb2238e5708547767729de3ac1d3e1a76ed5ba1
This commit is contained in:
committed by
Facebook Github Bot
parent
77b78935f2
commit
303ed8af44
@ -34,7 +34,7 @@ else
|
||||
exit 1
|
||||
fi
|
||||
# We are going to build the target into build_android.
|
||||
BUILD_ROOT=$CAFFE2_ROOT/build_android
|
||||
BUILD_ROOT=${BUILD_ROOT:-"$CAFFE2_ROOT/build_android"}
|
||||
mkdir -p $BUILD_ROOT
|
||||
echo "Build Caffe2 Android into: $BUILD_ROOT"
|
||||
|
||||
@ -46,7 +46,7 @@ $CAFFE2_ROOT/scripts/build_host_protoc.sh || exit 1
|
||||
echo "Building caffe2"
|
||||
cd $BUILD_ROOT
|
||||
|
||||
cmake .. \
|
||||
cmake "$CAFFE2_ROOT" \
|
||||
-DCMAKE_TOOLCHAIN_FILE=../third_party/android-cmake/android.toolchain.cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=../install \
|
||||
-DANDROID_NDK=$ANDROID_NDK \
|
||||
|
@ -14,7 +14,7 @@
|
||||
set -e
|
||||
|
||||
CAFFE2_ROOT="$( cd "$(dirname -- "$0")"/.. ; pwd -P)"
|
||||
BUILD_ROOT=$CAFFE2_ROOT/build_host_protoc
|
||||
BUILD_ROOT=${BUILD_ROOT:-"$CAFFE2_ROOT/build_host_protoc"}
|
||||
mkdir -p $BUILD_ROOT/build
|
||||
cd $BUILD_ROOT/build
|
||||
|
||||
|
@ -17,7 +17,7 @@ BITCODE_FLAGS="-DCMAKE_C_FLAGS=-fembed-bitcode -DCMAKE_CXX_FLAGS=-fembed-bitcode
|
||||
$CAFFE2_ROOT/scripts/build_host_protoc.sh --other-flags $BITCODE_FLAGS
|
||||
|
||||
# Now, actually build the iOS target.
|
||||
BUILD_ROOT=$CAFFE2_ROOT/build_ios
|
||||
BUILD_ROOT=${BUILD_ROOT:-"$CAFFE2_ROOT/build_ios"}
|
||||
mkdir -p $BUILD_ROOT
|
||||
cd $BUILD_ROOT
|
||||
|
||||
@ -71,7 +71,7 @@ fi
|
||||
CMAKE_ARGS+=("-DCMAKE_C_FLAGS=-fembed-bitcode")
|
||||
CMAKE_ARGS+=("-DCMAKE_CXX_FLAGS=-fembed-bitcode")
|
||||
|
||||
cmake .. \
|
||||
cmake "$CAFFE2_ROOT" \
|
||||
-DCMAKE_INSTALL_PREFIX=../install \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
|
@ -21,7 +21,7 @@ if [ -n "${USE_HOST_PROTOC:-}" ]; then
|
||||
fi
|
||||
|
||||
# We are going to build the target into build.
|
||||
BUILD_ROOT="$CAFFE2_ROOT/build"
|
||||
BUILD_ROOT=${BUILD_ROOT:-"$CAFFE2_ROOT/build"}
|
||||
mkdir -p "$BUILD_ROOT"
|
||||
cd "$BUILD_ROOT"
|
||||
echo "Building Caffe2 in: $BUILD_ROOT"
|
||||
@ -36,7 +36,7 @@ if [ "$(uname)" == 'Darwin' ]; then
|
||||
fi
|
||||
|
||||
# Now, actually build the target.
|
||||
cmake .. \
|
||||
cmake "$CAFFE2_ROOT" \
|
||||
"${CMAKE_ARGS[@]}" \
|
||||
"$@"
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
CAFFE2_ROOT="$( cd "$(dirname -- "$0")"/.. ; pwd -P)"
|
||||
echo "Caffe2 codebase root is: $CAFFE2_ROOT"
|
||||
BUILD_ROOT=$CAFFE2_ROOT/build
|
||||
BUILD_ROOT=${BUILD_ROOT:-"$CAFFE2_ROOT/build"}
|
||||
mkdir -p $BUILD_ROOT
|
||||
echo "Build Caffe2 raspbian into: $BUILD_ROOT"
|
||||
|
||||
@ -34,7 +34,7 @@ cd $BUILD_ROOT
|
||||
|
||||
# Note: you can add more dependencies above if you need libraries such as
|
||||
# leveldb, lmdb, etc.
|
||||
cmake .. \
|
||||
cmake "$CAFFE2_ROOT" \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=1 \
|
||||
-DCAFFE2_CPU_FLAGS="-mfpu=neon -mfloat-abi=hard" \
|
||||
|| exit 1
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
CAFFE2_ROOT="$( cd "$(dirname -- "$0")"/.. ; pwd -P)"
|
||||
echo "Caffe2 codebase root is: $CAFFE2_ROOT"
|
||||
BUILD_ROOT=$CAFFE2_ROOT/build
|
||||
BUILD_ROOT=${BUILD_ROOT:-"$CAFFE2_ROOT/build"}
|
||||
mkdir -p $BUILD_ROOT
|
||||
echo "Build Caffe2 raspbian into: $BUILD_ROOT"
|
||||
|
||||
@ -52,7 +52,7 @@ cd $BUILD_ROOT
|
||||
# CUDA_USE_STATIC_CUDA_RUNTIME needs to be set to off so that opencv can be
|
||||
# properly used. Otherwise, opencv will complain that opencv_dep_cudart cannot
|
||||
# be found.
|
||||
cmake .. -DCUDA_USE_STATIC_CUDA_RUNTIME=OFF \
|
||||
cmake "$CAFFE2_ROOT" -DCUDA_USE_STATIC_CUDA_RUNTIME=OFF \
|
||||
|| exit 1
|
||||
|
||||
make -j 4 || exit 1
|
||||
|
@ -15,7 +15,7 @@ setup_environment(){
|
||||
|
||||
CAFFE2_ROOT="$( cd "$(dirname -- "$0")"/.. ; pwd -P)"
|
||||
echo "Caffe2 codebase root is: $CAFFE2_ROOT"
|
||||
BUILD_ROOT=$CAFFE2_ROOT/build
|
||||
BUILD_ROOT=${BUILD_ROOT:-"$CAFFE2_ROOT/build"}
|
||||
mkdir -p $BUILD_ROOT
|
||||
echo "Build Caffe2 Tizen into: $BUILD_ROOT"
|
||||
}
|
||||
@ -109,7 +109,7 @@ cd $BUILD_ROOT
|
||||
# Note: add more dependencies above if you need libraries such as leveldb, lmdb, etc.
|
||||
# If you have to disable a specific package due to a package absence
|
||||
# from https://git.tizen.org/cgit/, append -Dxxx_xxx=OFF option before executing cmake.
|
||||
cmake .. \
|
||||
cmake "$CAFFE2_ROOT" \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=1 \
|
||||
-DUSE_CUDA=OFF \
|
||||
-DUSE_OPENCV=OFF \
|
||||
|
Reference in New Issue
Block a user