diff options
author | lilac | 2020-05-31 09:59:43 +0800 |
---|---|---|
committer | lilac | 2020-05-31 09:59:43 +0800 |
commit | 3f610ad25d9678ea894f577b4f5318202283c0a3 (patch) | |
tree | 199711f00617ade969fa5c0aedf84a47007810b9 /PKGBUILD | |
parent | 7447a82a3fac720bbb85ba5cea5d99f7d6920690 (diff) | |
download | aur-3f610ad25d9678ea894f577b4f5318202283c0a3.tar.gz |
update by lilac
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 75 |
1 files changed, 23 insertions, 52 deletions
@@ -1,15 +1,14 @@ # Maintainer: Chih-Hsuan Yen <yan12125@gmail.com> -pkgbase=python-onnxruntime -pkgname=(python-onnxruntime python-onnxruntime-cuda) -pkgver=1.2.0 +pkgname=python-onnxruntime +pkgver=1.3.0 pkgdesc='Cross-platform, high performance scoring engine for ML models' -pkgrel=5 +pkgrel=2 arch=(x86_64) url='https://github.com/microsoft/onnxruntime' license=(MIT) depends=(protobuf re2 python-numpy) -makedepends=(git cmake cuda cudnn gtest gmock pybind11 python-setuptools cub nlohmann-json chrono-date) +makedepends=(git cmake pybind11 python-setuptools nlohmann-json chrono-date) # not de-vendored libraries # eigen: API changes a lot since extra/eigen 3.3.7 to the commit onnxruntime uses # onnx: onnxruntime uses different protobuf files than upstream onnx @@ -20,68 +19,54 @@ source=("git+https://github.com/microsoft/onnxruntime#tag=v$pkgver" "git+https://github.com/google/nsync.git" "git+https://github.com/onnx/onnx.git" "git+https://github.com/dcleblanc/SafeInt.git" + "git+https://github.com/microsoft/wil.git" build-fixes.patch - cmake-3.17.patch::https://github.com/microsoft/onnxruntime/commit/355f39ddee885237bf6fde9b587c7a5f80d22c53.patch) + gcc10.diff + protobuf-debundle.patch) sha512sums=('SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' - '4457e19e3e91195ea2976a70e31a70d07b1b5e2279f1493a537c7d128aef5695e317cfdb84a87a0ca8d2d53ba15d72edf0f95905ecff7fbfb250e3a97944313c' - '8804a5ecda6c5b2a341a723e918fc06f1e64a4500ea8fef835e76cca99ba4aba91465f2ddde8aac99ddf759bfa022a9b18641f9ec17c8592ec9e82eac69edef1') + 'SKIP' + '8ece04a7f2ffc89aa9da0a34db1febf31a0516dc2271f2fa711e8160577b2195ba746c150ed76506ce378e913be2888947e21d5745e52fe6d248b1d5aa7f2a83' + 'cc4fe39dba1d1565ebea51c90fa81ea18975d12db60468d6508b386d1423e5500b3579bce7c5d633a5504163248f5278aaaca6374b90c282344575b911dd852a' + 'a147afdd18d68f7aa5ba06f69993d06876e9c80bfe42dedf7e279576a2fc19a177f6441122cde905771b57fc747a561d215df8729cd0ca6289cf1fbc398efd30') prepare() { cd onnxruntime - # More protobuf debundling; inspired by https://github.com/microsoft/onnxruntime/pull/1928 - rm -v onnxruntime/core/util/protobuf_parsing_utils.h - echo "#include <google/protobuf/io/zero_copy_stream_impl.h>" >> onnxruntime/core/util/protobuf_parsing_utils.h patch -Np1 -i ../build-fixes.patch - patch -Np1 -i ../cmake-3.17.patch + # part of https://github.com/microsoft/onnxruntime/commit/e86214e5c00ffbb95b85478c111c8eb21de94fe9 + patch -Np1 -i ../gcc10.diff + patch -Np1 -i ../protobuf-debundle.patch git submodule init - for mod in eigen gemmlowp nsync onnx SafeInt; do + for mod in eigen gemmlowp nsync onnx SafeInt wil; do git config submodule.cmake/external/$mod.url "$srcdir"/$mod git submodule update cmake/external/$mod done - - mkdir build build-cuda } -_build() { +build() { + cd "$srcdir"/onnxruntime # Use protobuf-lite instead of full protobuf to workaround symbol conflicts # with onnx; see https://github.com/onnx/onnx/issues/1277 for details. - cmake ../cmake \ + cmake -B build -S cmake \ -Donnxruntime_ENABLE_PYTHON=ON \ -DONNX_CUSTOM_PROTOC_EXECUTABLE=/usr/bin/protoc \ -Donnxruntime_PREFER_SYSTEM_LIB=ON \ -Donnxruntime_USE_FULL_PROTOBUF=OFF \ - $@ + -Donnxruntime_BUILD_UNIT_TESTS=OFF + + cd build make python ../setup.py build } -build() { - cd "$srcdir"/onnxruntime/build - _build - - cd "$srcdir"/onnxruntime/build-cuda - # Uses the same compiler as CUDA, or there will be linker errors due to - # attempts on linking object files with libstdc++ from older GCC - CC=/opt/cuda/bin/gcc CXX=/opt/cuda/bin/g++ \ - _build -Donnxruntime_USE_CUDA=ON -Donnxruntime_CUDNN_HOME=/usr -} - -check() { - cd "$srcdir"/onnxruntime/build - make test - - cd "$srcdir"/onnxruntime/build-cuda - # make test # requires machines with CUDA-compatible devices -} - -_package() { +package() { + cd onnxruntime/build python ../setup.py install --root="$pkgdir" --skip-build --optimize=1 PY_SITE_DIR="$(python -c 'import site; print(site.getsitepackages()[0])')" @@ -90,17 +75,3 @@ _package() { ln -s "$PY_SITE_DIR/onnxruntime/$f" "$pkgdir"/usr/share/licenses/$pkgname/$f done } - -package_python-onnxruntime() { - cd onnxruntime/build - _package -} - -package_python-onnxruntime-cuda() { - depends+=(cuda cudnn) - conflicts=(python-onnxruntime) - provides=("python-onnxruntime=$pkgver") - - cd onnxruntime/build-cuda - _package -} |