diff options
author | Jingbei Li | 2019-07-02 15:10:14 +0800 |
---|---|---|
committer | Jingbei Li | 2019-07-02 15:10:14 +0800 |
commit | eb005e01cee8bec399a9dade6d2953af59a539b2 (patch) | |
tree | cb8a1146a9eabdcacc6462923a24a1081f5ed00e | |
parent | 0d088cb4e45235a6cebf68f02b7a3aa4277dc9a1 (diff) | |
download | aur-eb005e01cee8bec399a9dade6d2953af59a539b2.tar.gz |
upgraded to 2.7 (cpu only now)
-rw-r--r-- | .SRCINFO | 59 | ||||
-rw-r--r-- | PKGBUILD | 165 |
2 files changed, 176 insertions, 48 deletions
@@ -1,33 +1,66 @@ pkgbase = cntk pkgdesc = Microsoft Cognitive Toolkit (CNTK), an open source deep-learning toolkit - pkgver = 2.6 + pkgver = 2.7 pkgrel = 1 - url = https://github.com/Microsoft/CNTK + url = https://github.com/Microsoft/cntk arch = x86_64 license = CUSTOM makedepends = cmake + makedepends = gcc7 makedepends = git makedepends = inetutils + makedepends = nccl + makedepends = openblas-lapack + makedepends = python-numpy makedepends = python-pip + makedepends = python-scipy makedepends = python-setuptools makedepends = python-wheel makedepends = swig depends = boost - depends = cub - depends = cuda - depends = cudnn depends = libzip - depends = nccl - depends = nvidia-utils - depends = openblas-lapack - depends = opencv depends = openmp depends = openmpi depends = protobuf-static - depends = python-numpy - depends = python-scipy - optdepends = swig - source = git+https://github.com/Microsoft/CNTK#tag=v2.6 + source = cntk::git+https://github.com/Microsoft/cntk#tag=v2.7 + source = git+https://github.com/onnx/onnx + source = git+https://github.com/Microsoft/onnxruntime + source = git+https://github.com/Microsoft/Multiverso + source = gsl::git+https://github.com/Microsoft/GSL + source = git+https://github.com/google/benchmark + source = git+https://github.com/pybind/pybind11 + source = git+https://github.com/wjakob/clang-cindex-python3 + source = git+https://github.com/HowardHinnant/date + source = git+https://github.com/google/gemmlowp + source = git+https://github.com/google/googletest + source = git+https://github.com/google/nsync + source = git+https://github.com/stevenlix/onnx-tensorrt + source = git+https://github.com/google/protobuf + source = git+https://github.com/google/re2 + source = git+https://github.com/dmlc/tvm + source = git+https://github.com/dmlc/HalideIR + source = git+https://github.com/dmlc/dlpack + source = git+https://github.com/dmlc/dmlc-core + source = dcasgd::git+https://github.com/Microsoft/Delayed-Compensation-Asynchronous-Stochastic-Gradient-Descent-for-Multiverso + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP md5sums = SKIP pkgname = cntk @@ -1,51 +1,136 @@ # Maintainer: Jingbei Li <i@jingbei.li> pkgname=cntk -_gitname=CNTK -pkgver=2.6 +pkgver=2.7 pkgrel=1 pkgdesc="Microsoft Cognitive Toolkit (CNTK), an open source deep-learning toolkit" arch=('x86_64') -url="https://github.com/Microsoft/$_gitname" +url="https://github.com/Microsoft/cntk" license=('CUSTOM') -depends=('boost' 'cub' 'cuda' 'cudnn' 'libzip' 'nccl' 'nvidia-utils' 'openblas-lapack' 'opencv' 'openmp' 'openmpi' 'protobuf-static' 'python-numpy' 'python-scipy') -makedepends=('cmake' 'git' 'inetutils' 'python-pip' 'python-setuptools' 'python-wheel' 'swig') -optdepends=('swig') -source=("git+$url#tag=v$pkgver") -md5sums=('SKIP') +depends=('boost' 'libzip' 'openmp' 'openmpi' 'protobuf-static') +makedepends=('cmake' 'gcc7' 'git' 'inetutils' 'nccl' 'openblas-lapack' 'python-numpy' 'python-pip' 'python-scipy' 'python-setuptools' 'python-wheel' 'swig') +source=("${pkgname}::git+$url#tag=v$pkgver" + 'git+https://github.com/onnx/onnx' + 'git+https://github.com/Microsoft/onnxruntime' + 'git+https://github.com/Microsoft/Multiverso' + 'gsl::git+https://github.com/Microsoft/GSL' + 'git+https://github.com/google/benchmark' + 'git+https://github.com/pybind/pybind11' + 'git+https://github.com/wjakob/clang-cindex-python3' + 'git+https://github.com/HowardHinnant/date' + 'git+https://github.com/google/gemmlowp' + 'git+https://github.com/google/googletest' + 'git+https://github.com/google/nsync' + 'git+https://github.com/stevenlix/onnx-tensorrt' + 'git+https://github.com/google/protobuf' + 'git+https://github.com/google/re2' + 'git+https://github.com/dmlc/tvm' + 'git+https://github.com/dmlc/HalideIR' + 'git+https://github.com/dmlc/dlpack' + 'git+https://github.com/dmlc/dmlc-core' + 'dcasgd::git+https://github.com/Microsoft/Delayed-Compensation-Asynchronous-Stochastic-Gradient-Descent-for-Multiverso' +) +md5sums=('SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP') prepare(){ - cd $srcdir/$_gitname + if (pacman -Q cuda &>/dev/null) + then + echo "You can't build the CPU version of CNTK with CUDA installed." + echo "Build this package in a clean chroot." + echo "Or, install cntk-cuda if you want the GPU support." + return 1 + fi + + cd $srcdir/$pkgname + git config submodule.Source/CNTKv2LibraryDll/proto/onnx/onnx_repo.url $srcdir/onnx + git config submodule.Source/CNTKv2LibraryDll/proto/onnx/onnxruntime.url $srcdir/onnxruntime + git config submodule.Source/Multiverso.url $srcdir/Multiverso + git config submodule.external/gsl.url $srcdir/gsl + git submodule update --init + + cd $srcdir/$pkgname/Source/CNTKv2LibraryDll/proto/onnx/onnx_repo + git config submodule.third_party/benchmark.url $srcdir/benchmark + git config submodule.third_party/pybind11.url $srcdir/pybind11 + git submodule update --init + + cd $srcdir/$pkgname/Source/CNTKv2LibraryDll/proto/onnx/onnx_repo/third_party/pybind11 + git config submodule.tools/clang.url $srcdir/clang-cindex-python3 + git submodule update --init + + cd $srcdir/$pkgname/Source/CNTKv2LibraryDll/proto/onnx/onnxruntime + for i in date gemmlowp googletest gsl nsync onnx onnx-tensorrt re2 tvm + do + git config submodule.cmake/external/$i.url $srcdir/$i + done + git config submodule.external/protobuf.url $srcdir/protobuf + git submodule update --init + + cd $srcdir/$pkgname/Source/CNTKv2LibraryDll/proto/onnx/onnxruntime/cmake/external/onnx + git config submodule.third_party/benchmark.url $srcdir/benchmark + git config submodule.third_party/pybind11.url $srcdir/pybind11 + git submodule update --init + + cd $srcdir/$pkgname/Source/CNTKv2LibraryDll/proto/onnx/onnxruntime/cmake/external/onnx/third_party/pybind11 + git config submodule.tools/clang.url $srcdir/clang-cindex-python3 + git submodule update --init + + cd $srcdir/$pkgname/Source/CNTKv2LibraryDll/proto/onnx/onnxruntime/cmake/external/onnx-tensorrt + git config submodule.third_party/onnx.url $srcdir/onnx + git submodule update --init + + cd $srcdir/$pkgname/Source/CNTKv2LibraryDll/proto/onnx/onnxruntime/cmake/external/onnx-tensorrt/third_party/onnx + git config submodule.third_party/benchmark.url $srcdir/benchmark + git config submodule.third_party/pybind11.url $srcdir/pybind11 + git submodule update --init + + cd $srcdir/$pkgname/Source/CNTKv2LibraryDll/proto/onnx/onnxruntime/cmake/external/onnx-tensorrt/third_party/onnx/third_party/pybind11 + git config submodule.tools/clang.url $srcdir/clang-cindex-python3 + git submodule update --init + + cd $srcdir/$pkgname/Source/CNTKv2LibraryDll/proto/onnx/onnxruntime/cmake/external/protobuf + git config submodule.third_party/benchmark.url $srcdir/benchmark + git config submodule.third_party/googletest.url $srcdir/googletest + git submodule update --init + + cd $srcdir/$pkgname/Source/CNTKv2LibraryDll/proto/onnx/onnxruntime/cmake/external/tvm + git config submodule.HalideIR.url $srcdir/HalideIR + git config submodule.dlpack.url $srcdir/dlpack + git config submodule.dmlc-core.url $srcdir/dmlc-core + git submodule update --init + + cd $srcdir/$pkgname/Source/Multiverso + git config submodule.include/multiverso/updater/dcasgd.url $srcdir/dcasgd + git submodule update --init + + cd $srcdir/$pkgname git submodule update --init --recursive sed \ - -e 's|cuda/include/cudnn.h|include/cudnn.h|' \ -e 's/36/37/g' \ -i configure # https://github.com/Microsoft/CNTK/issues/62 sed 's|/var/lock/|/tmp/cntk/|g' -i `grep '/var/lock' . -rIl` - # https://github.com/Microsoft/CNTK/issues/3191 - sed '120s/.*/return cub::ShuffleIndex<CUB_PTX_WARP_THREADS>(input, srcLane, mask);/' -i Source/Math/CntkBatchNormalization.cuh - - # CUDA 10 - sed 's|device_functions.h|cuda_runtime_api.h|' -i Source/Math/GPUMatrixCUDAKernels.cuh - mkdir -p build - export OMPI_MPICXX=g++-7 - ./configure \ - --with-build-top=build \ - --with-openblas \ - --with-opencv \ - --with-py37-path \ - --with-cuda=/opt/cuda \ - --with-cub=/usr/include \ - --with-gdk-include=/opt/cuda/include \ - --with-gdk-nvml-lib=/opt/cuda/lib64/stubs \ - --with-cudnn=/opt/cuda \ - --with-nccl=/usr \ - --with-swig - #--with-kaldi=/opt/kaldi \ sed \ -e 's|$(CUDNN_PATH)/cuda|$(CUDNN_PATH)|g'\ -e 's/36/37/g'\ @@ -53,22 +138,32 @@ prepare(){ sed \ -e 's|libmpi.so.12|libmpi.so|g' \ -i bindings/python/cntk/train/distributed.py + + common_flags="--with-build-top=build --with-py37-path --with-swig" + + cd $srcdir/$pkgname + export OMPI_MPICXX=g++-7 + ./configure $common_flags \ + --with-openblas + } build() { - cd $srcdir/$_gitname/build + cd $srcdir/$pkgname/build + export OMPI_MPICXX=g++-7 make CXXFLAGS='-Wno-sign-compare -fPIC' } package() { + cd $srcdir/$pkgname/build + mkdir -p $pkgdir/usr - cd $srcdir/$_gitname/build cp -r bin lib $pkgdir/usr - cd $srcdir/$_gitname/build/python - PIP_CONFIG_FILE=/dev/null pip install --isolated --root="$pkgdir" --ignore-installed --no-deps ${pkgname}_gpu-$pkgver-cp37-cp37m-linux_x86_64.whl + cd $srcdir/$pkgname/build/python + PIP_CONFIG_FILE=/dev/null pip install --isolated --root="$pkgdir" --ignore-installed --no-deps ${pkgname}*-$pkgver-cp37-cp37m-linux_x86_64.whl rm -rf $pkgdir/usr/lib/python3.7/site-packages/$pkgname/libs - install -Dm644 $srcdir/$_gitname/LICENSE.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + install -Dm644 $srcdir/$pkgname/LICENSE.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" } |