mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Summary:
Uncached build: https://travis-ci.org/lukeyeager/caffe2/builds/239677224
Cached build: https://travis-ci.org/lukeyeager/caffe2/builds/239686725
* Parallel builds everywhere
* All builds use CCache for quick build times (help from https://github.com/pytorch/pytorch/pull/614, https://github.com/ccache/ccache/pull/145)
* Run ctests when available (continuation of https://github.com/caffe2/caffe2/pull/550)
* Upgraded from cuDNN v5 to v6
* Fixed MKL build (by updating pkg version)
* Fixed android builds (b6f905a67b (commitcomment-22404119))
* ~~Building NNPACK fails with no discernible error message (currently disabled entirely)~~
* ~~Android builds continue to fail with existing error:~~
* ~~OSX builds time-out:~~
| Before | After | Changes |
| --- | --- | --- |
| COMPILER=g++ | linux | without CUDA |
| COMPILER=g++-5 | linux-gcc5 | without CUDA |
| COMPILER=g++ | linux-cuda | updated to cuDNN v6 |
| BLAS=MKL | linux-mkl | updated pkg version |
| BUILD_TARGET=android | linux-android | |
| COMPILER=clang++ | osx | |
| BUILD_TARGET=ios | osx-ios | |
| BUILD_TARGET=android | osx-android | |
| QUICKTEST | **GONE** | |
| COMPILER=g++-4.8 | **GONE** | |
| COMPILER=g++-4.9 | **GONE** | |
Closes https://github.com/caffe2/caffe2/pull/735
Reviewed By: Yangqing
Differential Revision: D5228966
Pulled By: bwasti
fbshipit-source-id: 6cfa6f5ff05fbd5c2078beea79564f1f3b9812fe
55 lines
1.8 KiB
Bash
Executable File
55 lines
1.8 KiB
Bash
Executable File
#!/bin/bash
|
|
##############################################################################
|
|
# Example command to build the iOS target.
|
|
##############################################################################
|
|
#
|
|
# This script shows how one can build a Caffe2 binary for the iOS platform
|
|
# using ios-cmake. This is very similar to the android-cmake - see
|
|
# build_android.sh for more details.
|
|
|
|
CAFFE2_ROOT="$( cd "$(dirname "$0")"/.. ; pwd -P)"
|
|
echo "Caffe2 codebase root is: $CAFFE2_ROOT"
|
|
# We are going to build the target into build_ios.
|
|
BUILD_ROOT=$CAFFE2_ROOT/build_ios
|
|
mkdir -p $BUILD_ROOT
|
|
echo "Build Caffe2 ios into: $BUILD_ROOT"
|
|
|
|
# Build protobuf from third_party so we have a host protoc binary.
|
|
echo "Building protoc"
|
|
BITCODE_FLAGS="-DCMAKE_C_FLAGS=-fembed-bitcode -DCMAKE_CXX_FLAGS=-fembed-bitcode "
|
|
$CAFFE2_ROOT/scripts/build_host_protoc.sh --other-flags $BITCODE_FLAGS || exit 1
|
|
|
|
# Now, actually build the iOS target.
|
|
echo "Building caffe2"
|
|
cd $BUILD_ROOT
|
|
|
|
if [ -z ${IOS_PLATFORM+x} ]; then
|
|
# IOS_PLATFORM is not set, in which case we will default to OS, which
|
|
# builds iOS.
|
|
IOS_PLATFORM=OS
|
|
fi
|
|
|
|
cmake .. \
|
|
-DCMAKE_TOOLCHAIN_FILE=$CAFFE2_ROOT/third_party/ios-cmake/toolchain/iOS.cmake\
|
|
-DCMAKE_INSTALL_PREFIX=../install \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
-DIOS_PLATFORM=${IOS_PLATFORM} \
|
|
-DUSE_CUDA=OFF \
|
|
-DBUILD_TEST=OFF \
|
|
-DBUILD_BINARY=OFF \
|
|
-DCMAKE_C_FLAGS=-fembed-bitcode \
|
|
-DCMAKE_CXX_FLAGS=-fembed-bitcode \
|
|
-DUSE_LMDB=OFF \
|
|
-DUSE_LEVELDB=OFF \
|
|
-DBUILD_PYTHON=OFF \
|
|
-DPROTOBUF_PROTOC_EXECUTABLE=$CAFFE2_ROOT/build_host_protoc/bin/protoc \
|
|
-DCMAKE_VERBOSE_MAKEFILE=1 \
|
|
-DUSE_MPI=OFF \
|
|
-DBUILD_SHARED_LIBS=OFF \
|
|
-DCMAKE_THREAD_LIBS_INIT=-lpthread \
|
|
-DCMAKE_HAVE_THREADS_LIBRARY=1 \
|
|
-DCMAKE_USE_PTHREADS_INIT=1 \
|
|
$@ \
|
|
|| exit 1
|
|
cmake --build . -- "-j$(sysctl -n hw.ncpu)"
|