summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Bermond2019-05-02 02:20:25 +0000
committerDaniel Bermond2019-05-02 02:20:25 +0000
commit771c68485e5faa6e067a06f441b0f9df042d0152 (patch)
tree94e83d6d8889da6aa86840303319b63a39eb5fe1
parent0b318d8ec7f7cceabe1c0883aa4568b875fe3d36 (diff)
downloadaur-771c68485e5faa6e067a06f441b0f9df042d0152.tar.gz
Change to a split package. Update git submodules. Cosmetics.
-rw-r--r--.SRCINFO151
-rw-r--r--PKGBUILD294
2 files changed, 210 insertions, 235 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 2b5aeb3527c..d9b183b33d7 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,94 +1,72 @@
pkgbase = caffe2-git
- pkgdesc = A new lightweight, modular, and scalable deep learning framework (git version)
- pkgver = 0.8.2.r16592.g079093a662
+ pkgdesc = A new lightweight, modular, and scalable deep learning framework
+ pkgver = 0.8.2.r17706.g725ef26f34
pkgrel = 1
epoch = 1
url = https://caffe2.ai/
- arch = i686
arch = x86_64
license = BSD
makedepends = git
makedepends = cmake
+ makedepends = gtest
+ makedepends = snappy
+ makedepends = cuda
+ makedepends = cudnn
+ makedepends = nccl
depends = google-glog
depends = protobuf
- depends = lapack
depends = python
depends = python-numpy
depends = python-protobuf
- depends = gflags
- depends = gtest
- depends = openmp
- depends = leveldb
- depends = lmdb
- depends = numactl
- depends = openmpi
- depends = snappy
- depends = zeromq
- depends = hiredis
- depends = opencv
- depends = gtk3
- depends = ffmpeg
- depends = python-flask
- depends = python-future
- depends = graphviz
- 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 = rdma-core
- depends = python-nvd3
- depends = python-scikit-image
- depends = python-glog
- depends = python-leveldb
- depends = python-lmdb
- provides = caffe2
- provides = caffe2-cpu-git
- conflicts = caffe2
- conflicts = caffe2-cpu-git
- conflicts = python-pytorch
- replaces = caffe2-cpu-git
+ depends = blas
+ depends = lapack
+ depends = gflags
+ optdepends = python-flask
+ optdepends = graphviz
+ optdepends = python-hypothesis
+ optdepends = python-matplotlib
+ optdepends = python-pydot
+ optdepends = python-nvd3
+ optdepends = python-yaml
+ optdepends = python-requests
+ optdepends = python-scikit-image
+ optdepends = python-scipy
+ optdepends = python-setuptools
+ optdepends = python-future
+ optdepends = python-tornado
+ optdepends = python-six
+ optdepends = python-lmdb
options = !emptydirs
source = git+https://github.com/pytorch/pytorch.git
- source = git+https://github.com/pybind/pybind11.git
- source = git+https://github.com/NVlabs/cub.git
- source = git+https://github.com/eigenteam/eigen-git-mirror.git
- source = git+https://github.com/google/googletest.git
- source = git+https://github.com/google/benchmark.git
- source = git+https://github.com/google/protobuf.git
- source = git+https://github.com/Yangqing/ios-cmake.git
- source = git+https://github.com/Maratyszcza/NNPACK.git
- source = git+https://github.com/facebookincubator/gloo.git
- source = git+https://github.com/Maratyszcza/pthreadpool.git
- source = git+https://github.com/Maratyszcza/FXdiv.git
- source = git+https://github.com/Maratyszcza/FP16.git
- source = git+https://github.com/Maratyszcza/psimd.git
- source = git+https://github.com/facebook/zstd.git
- source = git+https://github.com/Maratyszcza/cpuinfo.git
- source = git+https://github.com/PeachPy/enum34.git
- source = git+https://github.com/Maratyszcza/PeachPy.git
- source = git+https://github.com/benjaminp/six.git
- source = git+https://github.com/ARM-software/ComputeLibrary.git
- source = git+https://github.com/onnx/onnx.git
- source = git+https://github.com/bddppq/onnx-tensorrt.git
- source = git+https://github.com/zdevito/sleef.git
- source = git+https://github.com/intel/ideep.git
+ source = git+https://github.com/pybind/pybind11
+ source = git+https://github.com/NVlabs/cub
+ source = git+https://github.com/eigenteam/eigen-git-mirror
+ source = git+https://github.com/google/googletest
+ source = git+https://github.com/google/benchmark
+ source = git+https://github.com/google/protobuf
+ source = git+https://github.com/Yangqing/ios-cmake
+ source = git+https://github.com/Maratyszcza/NNPACK
+ source = git+https://github.com/facebookincubator/gloo
+ source = git+https://github.com/Maratyszcza/pthreadpool
+ source = git+https://github.com/Maratyszcza/FXdiv
+ source = git+https://github.com/Maratyszcza/FP16
+ source = git+https://github.com/Maratyszcza/psimd
+ source = git+https://github.com/facebook/zstd
+ source = git+https://github.com/Maratyszcza/cpuinfo
+ source = git+https://github.com/PeachPy/enum34
+ source = git+https://github.com/Maratyszcza/PeachPy
+ source = git+https://github.com/benjaminp/six
+ source = git+https://github.com/onnx/onnx
+ source = git+https://github.com/onnx/onnx-tensorrt
+ source = sleef-zdevito::git+https://github.com/zdevito/sleef
+ source = git+https://github.com/intel/ideep
source = git+https://github.com/NVIDIA/nccl.git
- source = git+https://github.com/google/gemmlowp.git
- source = git+https://github.com/pytorch/QNNPACK.git
- source = git+https://github.com/intel/ARM_NEON_2_x86_SSE.git
- source = git+https://github.com/pytorch/fbgemm.git
- source = git+https://github.com/houseroad/foxi.git
- source = git+https://github.com/asmjit/asmjit.git
- sha256sums = SKIP
- sha256sums = SKIP
+ source = git+https://github.com/google/gemmlowp
+ source = git+https://github.com/pytorch/QNNPACK
+ source = git+https://github.com/intel/ARM_NEON_2_x86_SSE
+ source = git+https://github.com/pytorch/fbgemm
+ source = git+https://github.com/houseroad/foxi
sha256sums = SKIP
sha256sums = SKIP
sha256sums = SKIP
@@ -120,4 +98,29 @@ pkgbase = caffe2-git
sha256sums = SKIP
pkgname = caffe2-git
+ pkgdesc = A new lightweight, modular, and scalable deep learning framework (cpu only, git version)
+ provides = caffe2
+ provides = caffe2-cpu-git
+ conflicts = caffe2
+ conflicts = caffe2-cpu-git
+ replaces = caffe2-cpu-git
+
+pkgname = caffe2-cuda-git
+ pkgdesc = A new lightweight, modular, and scalable deep learning framework (with cuda support, git version)
+ depends = google-glog
+ depends = protobuf
+ depends = python
+ depends = python-numpy
+ depends = python-protobuf
+ depends = python-yaml
+ depends = blas
+ depends = lapack
+ depends = gflags
+ depends = cuda
+ depends = cudnn
+ depends = nccl
+ provides = caffe2
+ provides = caffe2-git
+ provides = caffe2-cuda
+ conflicts = caffe2
diff --git a/PKGBUILD b/PKGBUILD
index 3bd5e67e733..42f98fd0bf1 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,74 +1,51 @@
-# Maintainer : Daniel Bermond < gmail-com: danielbermond >
+# Maintainer : Daniel Bermond <dbermond@archlinux.org>
-pkgname=caffe2-git
-_srcname=pytorch
-pkgver=0.8.2.r16592.g079093a662
+pkgbase=caffe2-git
+pkgname=('caffe2-git' 'caffe2-cuda-git')
+pkgver=0.8.2.r17706.g725ef26f34
pkgrel=1
epoch=1
-pkgdesc='A new lightweight, modular, and scalable deep learning framework (git version)'
-arch=('i686' 'x86_64')
+pkgdesc='A new lightweight, modular, and scalable deep learning framework'
+arch=('x86_64')
url='https://caffe2.ai/'
license=('BSD')
-depends=(
- # official repositories:
- # required:
- 'google-glog' 'protobuf' 'lapack' 'python' 'python-numpy' 'python-protobuf'
- # not required but enabled in build:
- 'gflags' 'gtest' 'openmp' 'leveldb' 'lmdb' 'numactl' 'openmpi' 'snappy'
- 'zeromq' 'hiredis' 'opencv' 'gtk3' '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 but enabled in build:
- 'rdma-core'
- # python:
- 'python-nvd3' 'python-scikit-image' 'python-glog' 'python-leveldb'
- 'python-lmdb'
-)
-makedepends=('git' 'cmake')
-provides=('caffe2' 'caffe2-cpu-git')
-conflicts=('caffe2' 'caffe2-cpu-git' 'python-pytorch')
-replaces=('caffe2-cpu-git')
+depends=('google-glog' 'protobuf' 'python' 'python-numpy' 'python-protobuf'
+ 'python-yaml' 'blas' 'lapack' 'gflags')
+optdepends=('python-flask' 'graphviz' 'python-hypothesis' 'python-matplotlib'
+ 'python-pydot' 'python-nvd3' 'python-yaml' 'python-requests'
+ 'python-scikit-image' 'python-scipy' 'python-setuptools'
+ 'python-future' 'python-tornado' 'python-six' 'python-lmdb')
+makedepends=('git' 'cmake' 'gtest' 'snappy' 'cuda' 'cudnn' 'nccl')
options=('!emptydirs')
-source=(
- # main source:
- 'git+https://github.com/pytorch/pytorch.git'
- # git submodules:
- 'git+https://github.com/pybind/pybind11.git'
- 'git+https://github.com/NVlabs/cub.git'
- 'git+https://github.com/eigenteam/eigen-git-mirror.git'
- 'git+https://github.com/google/googletest.git'
- 'git+https://github.com/google/benchmark.git'
- 'git+https://github.com/google/protobuf.git'
- 'git+https://github.com/Yangqing/ios-cmake.git'
- 'git+https://github.com/Maratyszcza/NNPACK.git'
- 'git+https://github.com/facebookincubator/gloo.git'
- 'git+https://github.com/Maratyszcza/pthreadpool.git'
- 'git+https://github.com/Maratyszcza/FXdiv.git'
- 'git+https://github.com/Maratyszcza/FP16.git'
- 'git+https://github.com/Maratyszcza/psimd.git'
- 'git+https://github.com/facebook/zstd.git'
- 'git+https://github.com/Maratyszcza/cpuinfo.git'
- 'git+https://github.com/PeachPy/enum34.git'
- 'git+https://github.com/Maratyszcza/PeachPy.git'
- 'git+https://github.com/benjaminp/six.git'
- 'git+https://github.com/ARM-software/ComputeLibrary.git'
- 'git+https://github.com/onnx/onnx.git'
- 'git+https://github.com/bddppq/onnx-tensorrt.git'
- 'git+https://github.com/zdevito/sleef.git'
- 'git+https://github.com/intel/ideep.git'
+source=("git+https://github.com/pytorch/pytorch.git"
+ 'git+https://github.com/pybind/pybind11'
+ 'git+https://github.com/NVlabs/cub'
+ 'git+https://github.com/eigenteam/eigen-git-mirror'
+ 'git+https://github.com/google/googletest'
+ 'git+https://github.com/google/benchmark'
+ 'git+https://github.com/google/protobuf'
+ 'git+https://github.com/Yangqing/ios-cmake'
+ 'git+https://github.com/Maratyszcza/NNPACK'
+ 'git+https://github.com/facebookincubator/gloo'
+ 'git+https://github.com/Maratyszcza/pthreadpool'
+ 'git+https://github.com/Maratyszcza/FXdiv'
+ 'git+https://github.com/Maratyszcza/FP16'
+ 'git+https://github.com/Maratyszcza/psimd'
+ 'git+https://github.com/facebook/zstd'
+ 'git+https://github.com/Maratyszcza/cpuinfo'
+ 'git+https://github.com/PeachPy/enum34'
+ 'git+https://github.com/Maratyszcza/PeachPy'
+ 'git+https://github.com/benjaminp/six'
+ 'git+https://github.com/onnx/onnx'
+ 'git+https://github.com/onnx/onnx-tensorrt'
+ 'sleef-zdevito'::'git+https://github.com/zdevito/sleef'
+ 'git+https://github.com/intel/ideep'
'git+https://github.com/NVIDIA/nccl.git'
- 'git+https://github.com/google/gemmlowp.git'
- 'git+https://github.com/pytorch/QNNPACK.git'
- 'git+https://github.com/intel/ARM_NEON_2_x86_SSE.git'
- 'git+https://github.com/pytorch/fbgemm.git'
- 'git+https://github.com/houseroad/foxi.git'
- # others:
- 'git+https://github.com/asmjit/asmjit.git'
-)
+ 'git+https://github.com/google/gemmlowp'
+ 'git+https://github.com/pytorch/QNNPACK'
+ 'git+https://github.com/intel/ARM_NEON_2_x86_SSE'
+ 'git+https://github.com/pytorch/fbgemm'
+ 'git+https://github.com/houseroad/foxi')
sha256sums=('SKIP'
'SKIP'
'SKIP'
@@ -97,19 +74,35 @@ sha256sums=('SKIP'
'SKIP'
'SKIP'
'SKIP'
- 'SKIP'
- 'SKIP'
'SKIP')
prepare() {
- cd "$_srcname"
+ mkdir -p pytorch/{build-cpu-only,build-cuda}
+ cd pytorch
+
+ # submodules which clone dir coincide with the submodule name
+ local _submodule_list=('pybind11'
+ 'cub'
+ 'googletest'
+ 'benchmark'
+ 'protobuf'
+ 'ios-cmake'
+ 'NNPACK'
+ 'gloo'
+ 'zstd'
+ 'onnx'
+ 'onnx-tensorrt'
+ 'sleef'
+ 'ideep'
+ 'QNNPACK'
+ 'fbgemm'
+ 'foxi')
local _submodule
- local _submodule_list="pybind11 cub googletest benchmark protobuf ios-cmake \
- NNPACK gloo zstd ComputeLibrary onnx onnx-tensorrt \
- sleef ideep QNNPACK fbgemm foxi"
-
- git submodule init
+ for _submodule in "${_submodule_list[@]}"
+ do
+ git config --local "submodule.third_party/${_submodule}.url" "${srcdir}/${_submodule}"
+ done
# submodules which clone dir does not coincide with the submodule name
git config --local "submodule.third_party/eigen.url" "${srcdir}/eigen-git-mirror"
@@ -120,16 +113,11 @@ prepare() {
git config --local "submodule.third_party/python-enum.url" "${srcdir}/enum34"
git config --local "submodule.third_party/python-peachpy.url" "${srcdir}/PeachPy"
git config --local "submodule.third_party/python-six.url" "${srcdir}/six"
+ git config --local "submodule.third_party/sleef.url" "${srcdir}/sleef-zdevito"
git config --local "submodule.third_party/neon2sse.url" "${srcdir}/ARM_NEON_2_x86_SSE"
git config --local "submodule.third_party/nccl/nccl.url" "${srcdir}/nccl"
git config --local "submodule.third_party/gemmlowp/gemmlowp.url" "${srcdir}/gemmlowp"
- # submodules which clone dir coincide with the submodule name
- for _submodule in $_submodule_list
- do
- git config --local "submodule.third_party/${_submodule}.url" "${srcdir}/${_submodule}"
- done
-
# special case (upstream uses third.party instead of third_party)
git config --local 'submodule.third-party/cpuinfo.url' "${srcdir}/cpuinfo"
@@ -137,7 +125,7 @@ prepare() {
}
pkgver() {
- cd "$_srcname"
+ cd pytorch
local _version
local _revision
@@ -151,106 +139,90 @@ pkgver() {
}
build() {
- cd "$_srcname"
-
- local _pythonver
- _pythonver="$(python -c 'import sys; print("%s.%s" %sys.version_info[0:2])')"
-
- mkdir -p build
- cd build
+ local _common_opts=('..'
+ '-DBLAS:STRING=Eigen'
+ '-DBUILD_BINARY:BOOL=ON'
+ '-DBUILD_CUSTOM_PROTOBUF:BOOL=OFF'
+ '-DBUILD_SHARED_LIBS:BOOL=ON'
+ '-DCMAKE_BUILD_TYPE:STRING=None'
+ '-DCMAKE_INSTALL_LIBDIR:PATH=lib'
+ '-DCMAKE_INSTALL_PREFIX:PATH=/usr'
+ '-DCMAKE_SKIP_INSTALL_RPATH:BOOL=YES'
+ '-DCXX_AVX2_FOUND:BOOL=FALSE'
+ '-DCXX_AVX_FOUND:BOOL=FALSE'
+ '-DC_AVX2_FOUND:BOOL=FALSE'
+ '-DC_AVX_FOUND:BOOL=FALSE'
+ '-DUSE_GFLAGS:BOOL=ON'
+ '-DUSE_GLOG:BOOL=ON'
+ '-DUSE_MPI:BOOL=OFF'
+ '-DUSE_NUMA:BOOL=OFF'
+ '-DUSE_OPENCV:BOOL=OFF'
+ '-Wno-dev')
+ # caffe2-cuda
+ cd pytorch/build-cuda
cmake \
- -DBLAS:STRING='Eigen' \
- \
- -DBUILD_BINARY:BOOL='ON' \
- -DBUILD_DOCS:BOOL='OFF' \
- -DBUILD_PYTHON:BOOL='ON' \
- -DBUILD_SHARED_LIBS:BOOL='ON' \
- \
- -DCMAKE_INSTALL_LIBDIR:PATH='lib' \
- -DCMAKE_INSTALL_PREFIX:PATH='/usr' \
- \
- -DGLOO_STATIC_OR_SHARED:STRING='STATIC' \
- \
- -DOpenCV_DIR:PATH='/usr/share/OpenCV' \
- -DASMJIT_SRC_DIR:STRING="${srcdir}/asmjit" \
- \
- -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_CUDA:BOOL='OFF' \
- -DUSE_CUDNN:BOOL='OFF' \
- -DUSE_DISTRIBUTED:BOOL='ON' \
- -DUSE_FBGEMM:BOOL='ON' \
- -DUSE_FFMPEG:BOOL='ON' \
- -DUSE_GFLAGS:BOOL='ON' \
- -DUSE_GLOG:BOOL='ON' \
- -DUSE_GLOO:BOOL='ON' \
- -DUSE_GLOO_IBVERBS:BOOL='ON' \
- -DUSE_IBVERBS:BOOL='ON' \
- -DUSE_LEVELDB:BOOL='ON' \
- -DUSE_LITE_PROTO:BOOL='OFF' \
- -DUSE_LMDB:BOOL='ON' \
+ "${_common_opts[@]}" \
+ -DCMAKE_CXX_COMPILER:FILEPATH='/usr/bin/g++' \
+ -DCMAKE_C_COMPILER:FILEPATH='/usr/bin/gcc' \
+ -DCUDA_HOST_COMPILER:FILEPATH='/usr/bin/gcc' \
+ -DCUDA_NVCC_FLAGS:STRING='-Xfatbin -compress-all' \
+ -DTORCH_CUDA_ARCH_LIST='3.0;3.2;3.5;3.7;5.0;5.2;5.3;6.0;6.1;6.2;7.0;7.2;7.5' \
+ -DUSE_CUDA:BOOL='ON' \
+ -DUSE_CUDNN:BOOL='ON' \
-DUSE_METAL:BOOL='OFF' \
- -DUSE_MKLDNN:BOOL='OFF' \
- -DUSE_MPI:BOOL='ON' \
- -DUSE_NCCL:BOOL='OFF' \
- -DUSE_NNAPI:BOOL='ON' \
- -DUSE_NNPACK:BOOL='ON' \
- -DUSE_NUMA:BOOL='ON' \
- -DUSE_NUMPY:BOOL='ON' \
- -DUSE_NVRTC:BOOL='OFF' \
- -DUSE_OBSERVERS:BOOL='ON' \
- -DUSE_OPENCL:BOOL='OFF' \
- -DUSE_OPENCV:BOOL='ON' \
- -DUSE_OPENMP:BOOL='ON' \
- -DUSE_PROF:BOOL='OFF' \
- -DUSE_QNNPACK:BOOL='ON' \
- -DUSE_REDIS:BOOL='ON' \
- -DUSE_ROCKSDB:BOOL='OFF' \
- -DUSE_ROCM:BOOL='OFF' \
- -DUSE_SNPE:BOOL='OFF' \
- -DUSE_SYSTEM_EIGEN_INSTALL:BOOL='OFF' \
- -DUSE_SYSTEM_NCCL:BOOL='OFF' \
- -DUSE_TENSORRT:BOOL='OFF' \
- -DUSE_ZMQ:BOOL='ON' \
- -DUSE_ZSTD:BOOL='ON' \
- -DWITH_OPENMP:BOOL='ON' \
- \
- -Wno-dev \
- ..
-
+ -DUSE_NCCL:BOOL='ON' \
+ -DUSE_SYSTEM_NCCL:BOOL='ON'
+ ## fix: avoid a second compilation in package()
+ sed -i 's/^preinstall:[[:space:]]all/preinstall:/' Makefile
+ make
+
+ # caffe2 (cpu only, without cuda support)
+ cd "${srcdir}/pytorch/build-cpu-only"
+ cmake "${_common_opts[@]}" -DUSE_CUDA:BOOL='OFF' -DUSE_NCCL:BOOL='OFF'
make
}
-package() {
- cd "${_srcname}/build"
-
+_package_common() {
make DESTDIR="$pkgdir" install
# remove unneeded files
local _entry
local _exclude_dirs
- mapfile -t -d '' _exclude_dirs < <(find "${pkgdir}/usr/include" -mindepth 1 -maxdepth 1 -type d ! -name 'caffe*' -print0)
- rm "$pkgdir"/usr/bin/{protoc,unzstd,zstd{cat,mt,}}
rm "$pkgdir"/usr/include/*.h
- rm "$pkgdir"/usr/lib/*.a
- rm "$pkgdir"/usr/lib/lib{foxi,onnxifi,zstd}*
- rm -r "$pkgdir"/usr/lib/cmake/protobuf
- rm "$pkgdir"/usr/lib/pkgconfig/{protobuf-lite,protobuf}.pc
- rm "$pkgdir"/usr/share/pkgconfig/libzstd.pc
- rm -r "$pkgdir"/usr/share/{ATen,cmake/{ATen,ONNX,Gloo}}
- rm "$pkgdir"/usr/share/man/man1/{unzstd,zstd{cat,}}.1
+ rm "$pkgdir"/usr/lib/{*.a,lib{foxi*,onnxifi*}.so*}
+ rm -r "$pkgdir"/usr/share/{ATen,cmake/{ATen,Gloo,ONNX}}
+ rm -r "$pkgdir"/torch
+ mapfile -t -d '' _exclude_dirs < <(find "${pkgdir}/usr/include" -mindepth 1 -maxdepth 1 -type d ! -name 'caffe*' ! -name 'c10' -print0)
for _entry in "${_exclude_dirs[@]}"
do
rm -rf "$_entry"
done
# license
- cd "${srcdir}/${_srcname}"
+ cd "${srcdir}/pytorch"
install -D -m644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
install -D -m644 NOTICE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}
+
+package_caffe2-cuda-git() {
+ pkgdesc+=' (with cuda support, git version)'
+ depends+=('cuda' 'cudnn' 'nccl')
+ provides=('caffe2' 'caffe2-git' 'caffe2-cuda')
+ conflicts=('caffe2')
+
+ cd pytorch/build-cuda
+
+ _package_common
+}
+
+package_caffe2-git() {
+ pkgdesc+=' (cpu only, git version)'
+ provides=('caffe2' 'caffe2-cpu-git')
+ conflicts=('caffe2' 'caffe2-cpu-git')
+ replaces=('caffe2-cpu-git')
+
+ cd pytorch/build-cpu-only
+
+ _package_common
+}