summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Bermond2018-04-23 17:17:07 +0000
committerDaniel Bermond2018-04-23 17:17:07 +0000
commita6a85a911659c4f8aba3bf96cccb139c8020749e (patch)
tree762b34ee26f53e44615de1e5476dbf17c37f1694
parentf39bc06c770fd1dddc3362cadc9427e7f2186f11 (diff)
downloadaur-a6a85a911659c4f8aba3bf96cccb139c8020749e.tar.gz
Fix build: use gcc5. Switch to python3. Change source repo.
Fix build: use gcc5 ------------------- Unfortunatelly, the current git master branch of caffe2 does not build with the current cuda 9.1 and gcc6 from the official repositories. This prevented the package to be built for a long time. Details here: https://github.com/caffe2/caffe2/issues/1459 https://github.com/caffe2/caffe2/issues/1636 But it is possible to build with gcc5 from the AUR. Be warned that gcc5 from the AUR takes a lot of time to compile. Switch from python2 to python3 ------------------------------ Upstream now provides python3 support at git master branch. Change source to pytorch repository to match upstream changes ------------------------------------------------------------- Caffe2 source code moved to PyTorch repository. References ---------- https://github.com/caffe2/caffe2/issues/315#issuecomment-350974915 https://github.com/caffe2/caffe2/commit/a062b05d70c75a6005c6e76109a1dde482729a53#diff-04c6e90faac2675aa89e2176d2eec7d8
-rw-r--r--.SRCINFO114
-rw-r--r--PKGBUILD200
2 files changed, 194 insertions, 120 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 45df3fa0493..8372e8f928d 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,23 +1,20 @@
-# Generated by mksrcinfo v8
-# Thu Oct 19 17:21:45 UTC 2017
pkgbase = caffe2-git
pkgdesc = A new lightweight, modular, and scalable deep learning framework (git version, gpu enabled)
- pkgver = 0.8.1.r525.g20edf4eb
+ pkgver = 0.1.11.r7977.g3b63be063
pkgrel = 1
+ epoch = 1
url = http://caffe2.ai/
arch = x86_64
- license = APACHE
+ license = BSD
makedepends = git
makedepends = cmake
- makedepends = gcc6
- makedepends = ninja
- makedepends = confu-git
- makedepends = python-peachpy-git
+ makedepends = gcc5
depends = google-glog
depends = protobuf
- depends = python2
- depends = python2-numpy
- depends = python2-protobuf
+ depends = lapack
+ depends = python
+ depends = python-numpy
+ depends = python-protobuf
depends = cuda
depends = cudnn
depends = gflags
@@ -25,31 +22,32 @@ pkgbase = caffe2-git
depends = openmp
depends = leveldb
depends = lmdb
+ depends = numactl
depends = openmpi
depends = snappy
depends = zeromq
depends = hiredis
depends = ffmpeg
- depends = python2-flask
- depends = python2-future
+ depends = python-flask
+ depends = python-future
depends = graphviz
- depends = python2-hypothesis
- depends = python2-jupyter_core
- depends = python2-matplotlib
- depends = python2-pydot
- depends = python2-yaml
- depends = python2-requests
- depends = python2-scipy
- depends = python2-setuptools
- depends = python2-six
- depends = python2-tornado
- depends = python2-gflags
- depends = python2-pyzmq
- depends = python2-nvd3
- depends = python2-scikit-image
- depends = python2-glog
- depends = python2-leveldb
- depends = python2-lmdb
+ depends = python-hypothesis
+ depends = python-jupyter_core
+ depends = python-matplotlib
+ depends = python-pydot
+ depends = python-yaml
+ depends = python-requests
+ depends = python-scipy
+ depends = python-setuptools
+ depends = python-six
+ depends = python-tornado
+ depends = python-gflags
+ depends = python-pyzmq
+ depends = python-nvd3
+ depends = python-scikit-image
+ depends = python-glog
+ depends = python-leveldb
+ depends = python-lmdb
provides = caffe2
conflicts = caffe
conflicts = caffe-cpu
@@ -59,24 +57,44 @@ pkgbase = caffe2-git
conflicts = caffe2-cpu
conflicts = caffe2-cpu-git
options = !emptydirs
- source = caffe2-git::git+https://github.com/caffe2/caffe2.git
- source = submodule-pybind11::git+https://github.com/pybind/pybind11.git
- source = submodule-nccl::git+https://github.com/nvidia/nccl.git
- source = submodule-cub::git+https://github.com/NVlabs/cub.git
- source = submodule-eigen::git+https://github.com/RLovelett/eigen.git
- source = submodule-googletest::git+https://github.com/google/googletest.git
- source = submodule-nervanagpu::git+https://github.com/NervanaSystems/nervanagpu.git
- source = submodule-benchmark::git+https://github.com/google/benchmark.git
- source = submodule-protobuf::git+https://github.com/google/protobuf.git
- source = submodule-android-cmake::git+https://github.com/Yangqing/android-cmake.git
- source = submodule-ios-cmake::git+https://github.com/Yangqing/ios-cmake.git
- source = submodule-NNPACK::git+https://github.com/Maratyszcza/NNPACK.git
- source = submodule-gloo::git+https://github.com/facebookincubator/gloo
- source = submodule-NNPACK_deps-pthreadpool::git+https://github.com/Maratyszcza/pthreadpool.git
- source = submodule-NNPACK_deps-FXdiv::git+https://github.com/Maratyszcza/FXdiv.git
- source = submodule-NNPACK_deps-FP16::git+https://github.com/Maratyszcza/FP16.git
- source = submodule-NNPACK_deps-psimd::git+https://github.com/Maratyszcza/psimd.git
- source = submodule-aten::git+https://github.com/zdevito/ATen.git
+ source = pytorch-git::git+https://github.com/pytorch/pytorch.git
+ source = caffe2-submodule-aten-cpuinfo::git+https://github.com/Maratyszcza/cpuinfo
+ source = caffe2-submodule-aten-tbb_remote::git+https://github.com/01org/tbb#branch=tbb_2018
+ source = caffe2-submodule-aten-catch::git+https://github.com/catchorg/Catch2.git
+ source = caffe2-submodule-nanopb::git+https://github.com/nanopb/nanopb.git
+ source = caffe2-submodule-pybind11::git+https://github.com/pybind/pybind11.git
+ source = caffe2-submodule-nccl::git+https://github.com/nvidia/nccl.git
+ source = caffe2-submodule-cub::git+https://github.com/NVlabs/cub.git
+ source = caffe2-submodule-eigen::git+https://github.com/RLovelett/eigen.git
+ source = caffe2-submodule-googletest::git+https://github.com/google/googletest.git
+ source = caffe2-submodule-nervanagpu::git+https://github.com/NervanaSystems/nervanagpu.git
+ source = caffe2-submodule-benchmark::git+https://github.com/google/benchmark.git
+ source = caffe2-submodule-protobuf::git+https://github.com/google/protobuf.git
+ source = caffe2-submodule-ios-cmake::git+https://github.com/Yangqing/ios-cmake.git
+ source = caffe2-submodule-NNPACK::git+https://github.com/Maratyszcza/NNPACK.git
+ source = caffe2-submodule-gloo::git+https://github.com/facebookincubator/gloo
+ source = caffe2-submodule-NNPACK_deps-pthreadpool::git+https://github.com/Maratyszcza/pthreadpool.git
+ source = caffe2-submodule-NNPACK_deps-FXdiv::git+https://github.com/Maratyszcza/FXdiv.git
+ source = caffe2-submodule-NNPACK_deps-FP16::git+https://github.com/Maratyszcza/FP16.git
+ source = caffe2-submodule-NNPACK_deps-psimd::git+https://github.com/Maratyszcza/psimd.git
+ source = caffe2-submodule-zstd::git+https://github.com/facebook/zstd.git
+ source = caffe2-submodule-cpuinfo::git+https://github.com/Maratyszcza/cpuinfo.git
+ source = caffe2-submodule-python-enum::git+https://github.com/PeachPy/enum34.git
+ source = caffe2-submodule-python-peachpy::git+https://github.com/Maratyszcza/PeachPy.git
+ source = caffe2-submodule-python-six::git+https://github.com/benjaminp/six.git
+ source = caffe2-submodule-ComputeLibrary::git+https://github.com/ARM-software/ComputeLibrary.git
+ source = caffe2-submodule-onnx::git+https://github.com/onnx/onnx.git
+ source = caffe2-submodule-ideep::git+https://github.com/intel/ideep.git
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = SKIP
sha256sums = SKIP
sha256sums = SKIP
sha256sums = SKIP
diff --git a/PKGBUILD b/PKGBUILD
index bcc10046f2d..82fd9e11d04 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,45 +2,45 @@
# NOTE:
# In order to build with NCCL support, follow these steps:
-# - uncomment the nccl line in 'depends'
-# - in 'build()', change '-DUSE_NCCL:BOOL=OFF' from 'OFF' to 'ON'
-# - add these options to cmake command line:
+# 1) uncomment the nccl line in 'depends'
+# 2) in 'build()', change '-DUSE_NCCL:BOOL=OFF' from 'OFF' to 'ON'
+# 3) add these options to cmake command line:
# -DNCCL_INCLUDE_DIR:PATH='/opt/cuda/include'
-# -DNCCL_LIBRARY:FILEPATH='/opt/cuda/lib64/libnccl.so'
# -DNCCL_ROOT_DIR:PATH='/opt/cuda'
pkgname=caffe2-git
-pkgver=0.8.1.r525.g20edf4eb
+pkgver=0.1.11.r7977.g3b63be063
pkgrel=1
+epoch=1
pkgdesc='A new lightweight, modular, and scalable deep learning framework (git version, gpu enabled)'
arch=('x86_64')
url='http://caffe2.ai/'
-license=('APACHE')
+license=('BSD')
depends=(
# official repositories:
# required:
- 'google-glog' 'protobuf' 'python2' 'python2-numpy' 'python2-protobuf' 'cuda'
- 'cudnn'
+ 'google-glog' 'protobuf' 'lapack' 'python' 'python-numpy' 'python-protobuf'
+ 'cuda' 'cudnn'
# not required but enabled in build:
- 'gflags' 'gtest' 'openmp' 'leveldb' 'lmdb' 'openmpi' 'snappy' 'zeromq'
- 'hiredis' 'ffmpeg'
- # python2:
- 'python2-flask' 'python2-future' 'graphviz' 'python2-hypothesis'
- 'python2-jupyter_core' 'python2-matplotlib' 'python2-pydot' 'python2-yaml'
- 'python2-requests' 'python2-scipy' 'python2-setuptools' 'python2-six'
- 'python2-tornado' 'python2-gflags' 'python2-pyzmq'
+ 'gflags' 'gtest' 'openmp' 'leveldb' 'lmdb' 'numactl' 'openmpi' 'snappy'
+ 'zeromq' 'hiredis' 'ffmpeg'
+ # python:
+ 'python-flask' 'python-future' 'graphviz' 'python-hypothesis'
+ 'python-jupyter_core' 'python-matplotlib' 'python-pydot' 'python-yaml'
+ 'python-requests' 'python-scipy' 'python-setuptools' 'python-six'
+ 'python-tornado' 'python-gflags' 'python-pyzmq'
# AUR:
- # not required:
- # 'nccl'
- # python2:
- 'python2-nvd3' 'python2-scikit-image' 'python2-glog' 'python2-leveldb'
- 'python2-lmdb'
+ # not required and disabled in build:
+ #'nccl'
+ # python:
+ 'python-nvd3' 'python-scikit-image' 'python-glog' 'python-leveldb'
+ 'python-lmdb'
)
makedepends=(
# official repositories:
- 'git' 'cmake' 'gcc6' 'ninja'
+ 'git' 'cmake'
# AUR:
- 'confu-git' 'python-peachpy-git'
+ 'gcc5'
)
provides=('caffe2')
conflicts=('caffe' 'caffe-cpu' 'caffe-git' 'caffe-cpu-git'
@@ -48,25 +48,35 @@ conflicts=('caffe' 'caffe-cpu' 'caffe-git' 'caffe-cpu-git'
options=('!emptydirs')
source=(
# main source:
- "$pkgname"::'git+https://github.com/caffe2/caffe2.git'
+ 'pytorch-git'::'git+https://github.com/pytorch/pytorch.git'
# git submodules:
- 'submodule-pybind11'::'git+https://github.com/pybind/pybind11.git'
- 'submodule-nccl'::'git+https://github.com/nvidia/nccl.git'
- 'submodule-cub'::'git+https://github.com/NVlabs/cub.git'
- 'submodule-eigen'::'git+https://github.com/RLovelett/eigen.git'
- 'submodule-googletest'::'git+https://github.com/google/googletest.git'
- 'submodule-nervanagpu'::'git+https://github.com/NervanaSystems/nervanagpu.git'
- 'submodule-benchmark'::'git+https://github.com/google/benchmark.git'
- 'submodule-protobuf'::'git+https://github.com/google/protobuf.git'
- 'submodule-android-cmake'::'git+https://github.com/Yangqing/android-cmake.git'
- 'submodule-ios-cmake'::'git+https://github.com/Yangqing/ios-cmake.git'
- 'submodule-NNPACK'::'git+https://github.com/Maratyszcza/NNPACK.git'
- 'submodule-gloo'::'git+https://github.com/facebookincubator/gloo'
- 'submodule-NNPACK_deps-pthreadpool'::'git+https://github.com/Maratyszcza/pthreadpool.git'
- 'submodule-NNPACK_deps-FXdiv'::'git+https://github.com/Maratyszcza/FXdiv.git'
- 'submodule-NNPACK_deps-FP16'::'git+https://github.com/Maratyszcza/FP16.git'
- 'submodule-NNPACK_deps-psimd'::'git+https://github.com/Maratyszcza/psimd.git'
- 'submodule-aten'::'git+https://github.com/zdevito/ATen.git'
+ 'caffe2-submodule-aten-cpuinfo'::'git+https://github.com/Maratyszcza/cpuinfo'
+ 'caffe2-submodule-aten-tbb_remote'::'git+https://github.com/01org/tbb#branch=tbb_2018'
+ 'caffe2-submodule-aten-catch'::'git+https://github.com/catchorg/Catch2.git'
+ 'caffe2-submodule-nanopb'::'git+https://github.com/nanopb/nanopb.git'
+ 'caffe2-submodule-pybind11'::'git+https://github.com/pybind/pybind11.git'
+ 'caffe2-submodule-nccl'::'git+https://github.com/nvidia/nccl.git'
+ 'caffe2-submodule-cub'::'git+https://github.com/NVlabs/cub.git'
+ 'caffe2-submodule-eigen'::'git+https://github.com/RLovelett/eigen.git'
+ 'caffe2-submodule-googletest'::'git+https://github.com/google/googletest.git'
+ 'caffe2-submodule-nervanagpu'::'git+https://github.com/NervanaSystems/nervanagpu.git'
+ 'caffe2-submodule-benchmark'::'git+https://github.com/google/benchmark.git'
+ 'caffe2-submodule-protobuf'::'git+https://github.com/google/protobuf.git'
+ 'caffe2-submodule-ios-cmake'::'git+https://github.com/Yangqing/ios-cmake.git'
+ 'caffe2-submodule-NNPACK'::'git+https://github.com/Maratyszcza/NNPACK.git'
+ 'caffe2-submodule-gloo'::'git+https://github.com/facebookincubator/gloo'
+ 'caffe2-submodule-NNPACK_deps-pthreadpool'::'git+https://github.com/Maratyszcza/pthreadpool.git'
+ 'caffe2-submodule-NNPACK_deps-FXdiv'::'git+https://github.com/Maratyszcza/FXdiv.git'
+ 'caffe2-submodule-NNPACK_deps-FP16'::'git+https://github.com/Maratyszcza/FP16.git'
+ 'caffe2-submodule-NNPACK_deps-psimd'::'git+https://github.com/Maratyszcza/psimd.git'
+ 'caffe2-submodule-zstd'::'git+https://github.com/facebook/zstd.git'
+ 'caffe2-submodule-cpuinfo'::'git+https://github.com/Maratyszcza/cpuinfo.git'
+ 'caffe2-submodule-python-enum'::'git+https://github.com/PeachPy/enum34.git'
+ 'caffe2-submodule-python-peachpy'::'git+https://github.com/Maratyszcza/PeachPy.git'
+ 'caffe2-submodule-python-six'::'git+https://github.com/benjaminp/six.git'
+ 'caffe2-submodule-ComputeLibrary'::'git+https://github.com/ARM-software/ComputeLibrary.git'
+ 'caffe2-submodule-onnx'::'git+https://github.com/onnx/onnx.git'
+ 'caffe2-submodule-ideep'::'git+https://github.com/intel/ideep.git'
)
sha256sums=('SKIP'
'SKIP'
@@ -85,36 +95,58 @@ sha256sums=('SKIP'
'SKIP'
'SKIP'
'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
'SKIP')
prepare() {
- cd "$pkgname"
- local _submodule_list="pybind11 nccl cub eigen googletest nervanagpu benchmark \
- protobuf android-cmake ios-cmake NNPACK gloo \
- NNPACK_deps/pthreadpool NNPACK_deps/FXdiv NNPACK_deps/FP16 \
- NNPACK_deps/psimd aten"
+ cd pytorch-git
+
+ local _submodule_list="nanopb pybind11 nccl cub eigen googletest nervanagpu benchmark \
+ protobuf ios-cmake NNPACK gloo NNPACK_deps/pthreadpool \
+ NNPACK_deps/FXdiv NNPACK_deps/FP16 NNPACK_deps/psimd zstd \
+ python-enum python-peachpy python-six ComputeLibrary onnx ideep"
+
git submodule init
+
+ git config --local 'submodule.aten/src/ATen/cpu/cpuinfo.url' "${srcdir}/caffe2-submodule-aten-cpuinfo"
+ git config --local 'submodule.aten/src/ATen/cpu/tbb/tbb_remote.url' "${srcdir}/caffe2-submodule-aten-tbb_remote"
+ git config --local 'submodule.aten/src/ATen/utils/catch.url' "${srcdir}/caffe2-submodule-aten-catch"
+ git config --local 'submodule.third-party/cpuinfo.url' "${srcdir}/caffe2-submodule-cpuinfo"
+
for _submodule in $_submodule_list
do
- local _submodule_dir="submodule-$(printf '%s' "${_submodule}" | tr '/' '-')"
+ local _submodule_dir="caffe2-submodule-${_submodule/\//-}"
git config --local "submodule.third_party/${_submodule}.url" "${srcdir}/${_submodule_dir}"
done
- unset _submodule
+
git submodule update
- # allow building with cuda 9.0
- sed -i '/if[[:space:]](CMAKE_C_COMPILER_ID[[:space:]]STREQUAL[[:space:]]"GNU"[[:space:]]AND/s/(/(CUDA_VERSION VERSION_EQUAL 8.0 AND /' cmake/Dependencies.cmake
+ # fix build with if eigen is installed (use eigen from git submodule)
+ local _eigen=' message(STATUS "Using Eigen third party subdirectory for compatibility.")'
+ sed -i '/find_package(Eigen3)/s/^/#/' cmake/Dependencies.cmake
+ sed -i "/Did[[:space:]]not[[:space:]]find[[:space:]]system[[:space:]]Eigen/s/.*/${_eigen}/" cmake/Dependencies.cmake
}
pkgver() {
- cd "$pkgname"
+ cd pytorch-git
# git, tags available
git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^v//'
}
build() {
- cd "$pkgname"
+ cd pytorch-git
+
+ local _pythonver="$(python --version | sed 's/^Python[[:space:]]//' | grep -o '^[0-9]*\.[0-9]*')"
mkdir -p build
cd build
@@ -128,21 +160,24 @@ build() {
\
-DBUILD_TEST:BOOL='OFF' \
\
- -DCMAKE_BUILD_TYPE:STRING='Release' \
-DCMAKE_COLOR_MAKEFILE:BOOL='ON' \
- -DCMAKE_CXX_COMPILER='/usr/bin/g++-6' \
- -DCMAKE_C_COMPILER='/usr/bin/gcc-6' \
+ -DCMAKE_CXX_COMPILER='/usr/bin/g++-5' \
+ -DCMAKE_CXX_FLAGS:STRING="${CXXFLAGS/-fno-plt/}" \
+ -DCMAKE_C_COMPILER='/usr/bin/gcc-5' \
+ -DCMAKE_C_FLAGS:STRING="${CFLAGS/-fno-plt/}" \
+ -DCMAKE_INSTALL_LIBDIR:PATH='lib' \
-DCMAKE_INSTALL_PREFIX:PATH='/usr' \
-DCMAKE_SKIP_INSTALL_RPATH:BOOL='NO' \
-DCMAKE_SKIP_RPATH:BOOL='NO' \
-DCMAKE_VERBOSE_MAKEFILE:BOOL='FALSE' \
\
+ -DCUDA_ARCH_NAME:STRING='Auto' \
-DCUDA_64_BIT_DEVICE_CODE:BOOL='ON' \
-DCUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE:BOOL='ON' \
-DCUDA_BUILD_CUBIN:BOOL='OFF' \
-DCUDA_BUILD_EMULATION:BOOL='OFF' \
-DCUDA_HOST_COMPILATION_CPP:BOOL='ON' \
- -DCUDA_HOST_COMPILER:FILEPATH='/usr/bin/gcc-6' \
+ -DCUDA_HOST_COMPILER:FILEPATH='/usr/bin/gcc-5' \
-DCUDA_NVCC_EXECUTABLE:FILEPATH='/opt/cuda/bin/nvcc' \
-DCUDA_PROPAGATE_HOST_FLAGS:BOOL='ON' \
-DCUDA_SDK_ROOT_DIR:PATH='/opt/cuda' \
@@ -152,17 +187,22 @@ build() {
-DCUDA_USE_STATIC_CUDA_RUNTIME:BOOL='OFF' \
-DCUDA_VERBOSE_BUILD:BOOL='OFF' \
-DCUDNN_INCLUDE_DIR:PATH='/opt/cuda/include' \
+ -DCUDNN_LIBRARY:FILEPATH='/opt/cuda/lib64/libcudnn.so' \
-DCUDNN_ROOT_DIR:PATH='/opt/cuda' \
\
-DGLOO_STATIC_OR_SHARED:STRING='STATIC' \
\
-DOpenCV_DIR:PATH='/usr/share/OpenCV' \
\
- -DPYTHON_EXECUTABLE:FILEPATH='/usr/bin/python2.7' \
- -DPYTHON_INCLUDE_DIR:PATH='/usr/include/python2.7' \
- -DPYTHON_LIBRARY:FILEPATH='/usr/lib/libpython2.7.so' \
+ -DPYTHON_EXECUTABLE:FILEPATH="/usr/bin/python${_pythonver}" \
+ -DPYTHON_INCLUDE_DIR:PATH="/usr/include/python${_pythonver}m" \
+ -DPYTHON_LIBRARY:FILEPATH="/usr/lib/libpython${_pythonver}m.so" \
\
+ -DUSE_ACL:BOOL='OFF' \
+ -DUSE_ASAN:BOOL='OFF' \
+ -DUSE_ATEN:BOOL='OFF' \
-DUSE_CUDA:BOOL='ON' \
+ -DUSE_FFMPEG:BOOL='ON' \
-DUSE_GFLAGS:BOOL='ON' \
-DUSE_GLOG:BOOL='ON' \
-DUSE_GLOO:BOOL='ON' \
@@ -173,35 +213,51 @@ build() {
-DUSE_MOBILE_OPENGL:BOOL='OFF' \
-DUSE_MPI:BOOL='ON' \
-DUSE_NCCL:BOOL='OFF' \
- -DUSE_NERVANA_GPU:BOOL='ON' \
+ -DUSE_NERVANA_GPU:BOOL='OFF' \
+ -DUSE_NNAPI:BOOL='OFF' \
-DUSE_NNPACK:BOOL='ON' \
+ -DUSE_NUMA:BOOL='ON' \
-DUSE_OBSERVERS:BOOL='ON' \
+ -DUSE_OPENCL:BOOL='OFF' \
-DUSE_OPENCV:BOOL='OFF' \
- -DUSE_FFMPEG:BOOL='ON' \
-DUSE_OPENMP:BOOL='ON' \
+ -DUSE_PROF:BOOL='OFF' \
-DUSE_REDIS:BOOL='ON' \
-DUSE_ROCKSDB:BOOL='OFF' \
- -DUSE_THREADS:BOOL='ON' \
+ -DUSE_SNPE:BOOL='OFF' \
+ -DUSE_TENSORRT:BOOL='OFF' \
-DUSE_ZMQ:BOOL='ON' \
+ -DUSE_ZSTD:BOOL='ON' \
\
-Wno-dev \
..
- make
+
+ # NOTE:
+ # The recommended approach of running make in build() and make install in
+ # package() produces two compilations (being the second one unnecessary).
+ # A workaround is to suppress make in build() and run only make install
+ # in package().
+
+ #make
}
package() {
- cd "${pkgname}/build"
- make DESTDIR="$pkgdir" install
+ cd pytorch-git/build
- # directories creation
- mkdir -p "${pkgdir}/usr/lib/python2.7/site-packages"
- mkdir -p "${pkgdir}/usr/share/licenses/${pkgname}"
+ make DESTDIR="$pkgdir" install
- # move/rename folders to the right location
- mv -f "${pkgdir}/usr/caffe" "${pkgdir}/usr/lib/python2.7/site-packages"
- mv -f "${pkgdir}/usr/caffe2" "${pkgdir}/usr/lib/python2.7/site-packages"
+ # remove unneeded files
+ rm -rf "${pkgdir}/usr/include/google"
+ rm -rf "${pkgdir}/usr/lib/cmake/protobuf"
+ rm -f "$pkgdir"/usr/bin/{protoc,unzstd,zstd{cat,mt,}}
+ rm -f "$pkgdir"/usr/include/{{bitcasts,cpuinfo,fp16,fxdiv,nnpack,psimd,pthreadpool,zbuff,zdict,zstd*}.h,{__init__,avx{,2}}.py}
+ rm -f "$pkgdir"/usr/lib/lib{{cpuinfo,nnpack,protobuf-lite,protobuf,protoc,pthreadpool,zstd}.a,zstd.so*}
+ rm -f "$pkgdir"/usr/lib/pkgconfig/{protobuf-lite,protobuf}.pc
+ rm -f "$pkgdir"/usr/share/pkgconfig/libzstd.pc
+ rm -f "$pkgdir"/usr/share/man/man1/{unzstd,zstd{cat,}}.1
# license
- cd "${srcdir}/${pkgname}"
- install -D -m644 'LICENSE' "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ cd "${srcdir}/pytorch-git"
+ install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ install -D -m644 NOTICE "${pkgdir}/usr/share/licenses/${pkgname}/NOTICE"
}