summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorDaniel Bermond2019-06-29 18:33:31 +0000
committerDaniel Bermond2019-06-29 18:33:31 +0000
commit51c53331361eaadeef73e3c514a0a3c0fc83d65f (patch)
tree68c6294d874cfbf4db974564bc807b52efa7e82a /PKGBUILD
parent67aa85638ca65dff021e2968adc5f00a5eb8eac7 (diff)
downloadaur-51c53331361eaadeef73e3c514a0a3c0fc83d65f.tar.gz
Use gcc from cuda. Add pytorch to conflicts. Cosmetic changes.
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD21
1 files changed, 10 insertions, 11 deletions
diff --git a/PKGBUILD b/PKGBUILD
index cd4a8173bd16..ae170dc19bab 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@ pkgbase=caffe2
pkgname=('caffe2' 'caffe2-cuda')
_pytorchver=1.1.0 # pytorch stable release version
pkgver="0.8.2_${_pytorchver}"
-pkgrel=1
+pkgrel=2
pkgdesc='A new lightweight, modular, and scalable deep learning framework'
arch=('x86_64')
url='https://caffe2.ai/'
@@ -16,6 +16,7 @@ optdepends=('python-flask' 'graphviz' 'python-hypothesis' 'python-matplotlib'
'python-scikit-image' 'python-scipy' 'python-setuptools'
'python-future' 'python-tornado' 'python-six' 'python-lmdb')
makedepends=('git' 'cmake' 'gtest' 'snappy' 'cuda' 'cudnn' 'nccl')
+conflicts=('python-pytorch')
options=('!emptydirs')
source=("git+https://github.com/pytorch/pytorch.git#tag=v${_pytorchver}"
'git+https://github.com/pybind/pybind11'
@@ -118,7 +119,7 @@ prepare() {
git config --local "submodule.third_party/nccl/nccl.url" "${srcdir}/nccl"
git config --local "submodule.third_party/gemmlowp/gemmlowp.url" "${srcdir}/gemmlowp"
- # special case (upstream uses third.party instead of third_party)
+ # special case (upstream uses third-party instead of third_party)
git config --local 'submodule.third-party/cpuinfo.url' "${srcdir}/cpuinfo"
git submodule update
@@ -149,9 +150,9 @@ build() {
cd pytorch/build-cuda
cmake \
"${_common_opts[@]}" \
- -DCMAKE_CXX_COMPILER:FILEPATH='/usr/bin/g++' \
- -DCMAKE_C_COMPILER:FILEPATH='/usr/bin/gcc' \
- -DCUDA_HOST_COMPILER:FILEPATH='/usr/bin/gcc' \
+ -DCMAKE_CXX_COMPILER:FILEPATH='/opt/cuda/bin/g++' \
+ -DCMAKE_C_COMPILER:FILEPATH='/opt/cuda/bin/gcc' \
+ -DCUDA_HOST_COMPILER:FILEPATH='/opt/cuda/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' \
@@ -173,17 +174,15 @@ _package_common() {
make DESTDIR="$pkgdir" install
# remove unneeded files
- local _entry
- local _exclude_dirs
rm "$pkgdir"/usr/include/*.h
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[@]}"
+ local _dir
+ while read -r -d '' _dir
do
- rm -rf "$_entry"
- done
+ rm -rf "$_dir"
+ done < <(find "${pkgdir}/usr/include" -mindepth 1 -maxdepth 1 -type d ! -name 'caffe*' ! -name 'c10' -print0)
# license
cd "${srcdir}/pytorch"