diff options
author | Daniel Bermond | 2020-12-23 22:28:07 +0000 |
---|---|---|
committer | Daniel Bermond | 2020-12-23 22:28:07 +0000 |
commit | 38ed82fe41402b8be442e423068bf3aefcc7744d (patch) | |
tree | 44c993084d0480467902143841e2f52f7b0740f1 | |
download | aur-38ed82fe41402b8be442e423068bf3aefcc7744d.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 65 | ||||
-rw-r--r-- | 010-ade-disable-werror.patch | 11 | ||||
-rw-r--r-- | 020-openvino-cldnn-disable-werror.patch | 11 | ||||
-rw-r--r-- | 030-openvino-do-not-install-tbb.patch | 33 | ||||
-rw-r--r-- | PKGBUILD | 131 | ||||
-rw-r--r-- | openvino.conf | 3 | ||||
-rw-r--r-- | openvino.sh | 2 | ||||
-rw-r--r-- | setupvars.sh | 22 |
8 files changed, 278 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..785a3874dfc5 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,65 @@ +pkgbase = openvino + pkgdesc = A toolkit for developing artificial inteligence and deep learning applications + pkgver = 2021.2 + pkgrel = 1 + url = https://docs.openvinotoolkit.org/ + arch = x86_64 + license = Apache + makedepends = git + makedepends = git-lfs + makedepends = cmake + makedepends = libusb + makedepends = ocl-icd + makedepends = opencv + makedepends = python + makedepends = cython + makedepends = shellcheck + depends = protobuf + depends = tbb + optdepends = intel-compute-runtime: for GPU (clDNN) plugin + optdepends = ocl-icd: for GPU (clDNN) plugin + optdepends = libusb: for Myriad plugin + optdepends = python: for Python API + optdepends = python-numpy: for Python API + optdepends = cython: for Python API + optdepends = python-py-cpuinfo: for benchmark tool + optdepends = python-progress: for benchmark tool + optdepends = opencv: for benchmark and cross_check tools + provides = intel-openvino + conflicts = intel-openvino + replaces = intel-openvino + noextract = firmware_usb-ma2x8x_1522.zip + noextract = firmware_pcie-ma248x_1522.zip + noextract = GNA_02.00.00.1047.1.zip + options = !emptydirs + source = git+https://github.com/openvinotoolkit/openvino.git#tag=2021.2 + source = git+https://github.com/opencv/ade.git + source = git+https://github.com/openvinotoolkit/oneDNN.git + source = googletest-openvinotoolkit::git+https://github.com/openvinotoolkit/googletest.git + source = git+https://github.com/gflags/gflags.git + source = https://download.01.org/opencv/master/openvinotoolkit/thirdparty/unified/VPU/usb-ma2x8x/firmware_usb-ma2x8x_1522.zip + source = https://download.01.org/opencv/master/openvinotoolkit/thirdparty/unified/VPU/pcie-ma2x8x/firmware_pcie-ma2x8x_1522.zip + source = https://download.01.org/opencv/master/openvinotoolkit/thirdparty/unified/GNA/GNA_02.00.00.1047.1.zip + source = openvino.conf + source = openvino.sh + source = setupvars.sh + source = 010-ade-disable-werror.patch + source = 020-openvino-cldnn-disable-werror.patch + source = 030-openvino-do-not-install-tbb.patch + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = 95a93144f0bbfe6e35d3830e93e6b63e1e109f849a6a7c307cae9030e3a662aa + sha256sums = 6d061d21d90f1919ef375138066ba7a20ceb663901d2729d9cb1b639169df5da + sha256sums = 20820e07392a1e876cf5577430c1c4c74b924d8f34cc17bfa3e36e641555e05d + sha256sums = f485aa97d88d424dd3a223e0eddbbc382ec6c8d5094d51cbd3f0524b915e3d68 + sha256sums = 49a1cdd2357ac3c657b28d72aea1294e4af46389e41ed0d55ccbd12bd995058d + sha256sums = 093199ae759e8755166b9737562438866123eda9b1afbbef2f7107b3cf827be5 + sha256sums = 502fcbb3fcbb66aa5149ad2cc5f1fa297b51ed12c5c9396a16b5795a03860ed0 + sha256sums = 013c96d0842d8778b0719ee29b9d9d7d8b61dc9b3b8b4e03d2293a8948e15377 + sha256sums = c64d605faff70037e7381fdc501e6b71cc1569b84bc8230db2c61d1d28a230b7 + +pkgname = openvino + diff --git a/010-ade-disable-werror.patch b/010-ade-disable-werror.patch new file mode 100644 index 000000000000..bc242009c94c --- /dev/null +++ b/010-ade-disable-werror.patch @@ -0,0 +1,11 @@ +--- a/sources/ade/CMakeLists.txt ++++ b/sources/ade/CMakeLists.txt +@@ -11,7 +11,7 @@ file( GLOB_RECURSE sources source/*.cpp ) + file( GLOB_RECURSE include *.hpp ) + + if (CMAKE_CXX_COMPILER_ID STREQUAL GNU) +- set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -Wconversion -Wshadow -Wno-error=cpp -Wformat -Wformat-security" ) ++ set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wconversion -Wshadow -Wno-error=cpp -Wformat -Wformat-security" ) + endif() + + add_library( ${PROJECT_NAME} STATIC ${include} ${sources} ) diff --git a/020-openvino-cldnn-disable-werror.patch b/020-openvino-cldnn-disable-werror.patch new file mode 100644 index 000000000000..73ea94d4dcd9 --- /dev/null +++ b/020-openvino-cldnn-disable-werror.patch @@ -0,0 +1,11 @@ +--- a/inference-engine/thirdparty/clDNN/CMakeLists.txt ++++ b/inference-engine/thirdparty/clDNN/CMakeLists.txt +@@ -702,7 +702,7 @@ foreach(__CLDNN_CompilerFlagName IN ITEMS "CMAKE_CXX_FLAGS" "CMAKE_C_FLAGS") + MultiProcessorCompilation + DeadCodeEliminate + ExtensionsEnabled +- TreatWarnAsErrorEnabled ++ TreatWarnAsErrorDisabled + WarnLevel4 + NoFastMath + StackProtector diff --git a/030-openvino-do-not-install-tbb.patch b/030-openvino-do-not-install-tbb.patch new file mode 100644 index 000000000000..bdd2a20491bb --- /dev/null +++ b/030-openvino-do-not-install-tbb.patch @@ -0,0 +1,33 @@ +--- a/inference-engine/src/inference_engine/CMakeLists.txt ++++ b/inference-engine/src/inference_engine/CMakeLists.txt +@@ -213,30 +213,6 @@ ie_developer_export_targets(${TARGET_NAME} ${TARGET_NAME}_plugin_api xbyak) + + list(APPEND core_components ngraph) + +-if((THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO") AND TBBROOT MATCHES ${TEMP}) +- ie_cpack_add_component(tbb REQUIRED) +- list(APPEND core_components tbb) +- +- install(DIRECTORY "${TBB}/include" +- DESTINATION ${IE_CPACK_IE_DIR}/external/tbb +- COMPONENT tbb) +- install(DIRECTORY "${TBB}/lib" +- DESTINATION ${IE_CPACK_IE_DIR}/external/tbb +- COMPONENT tbb) +- if(EXISTS "${TBB}/bin") +- install(DIRECTORY "${TBB}/bin" +- DESTINATION ${IE_CPACK_IE_DIR}/external/tbb +- COMPONENT tbb) +- endif() +- install(FILES "${TBB}/LICENSE" +- DESTINATION ${IE_CPACK_IE_DIR}/external/tbb +- COMPONENT tbb) +- install(FILES "${TBB}/cmake/TBBConfig.cmake" +- "${TBB}/cmake/TBBConfigVersion.cmake" +- DESTINATION ${IE_CPACK_IE_DIR}/external/tbb/cmake +- COMPONENT tbb) +-endif() +- + ie_cpack_add_component(core REQUIRED DEPENDS ${core_components}) + + install(DIRECTORY "${IE_MAIN_SOURCE_DIR}/include" DESTINATION ${IE_CPACK_IE_DIR} diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..ef48d4d0b934 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,131 @@ +# Maintainer: Daniel Bermond <dbermond@archlinux.org> + +pkgname=openvino +pkgver=2021.2 +pkgrel=1 +pkgdesc='A toolkit for developing artificial inteligence and deep learning applications' +arch=('x86_64') +url='https://docs.openvinotoolkit.org/' +license=('Apache') +depends=('protobuf' 'tbb') +# GPU (clDNN) plugin: only Intel GPUs are supported: +# https://github.com/openvinotoolkit/openvino/issues/452#issuecomment-722941119 +optdepends=('intel-compute-runtime: for GPU (clDNN) plugin' + 'ocl-icd: for GPU (clDNN) plugin' + 'libusb: for Myriad plugin' + 'python: for Python API' + 'python-numpy: for Python API' + 'cython: for Python API' + 'python-py-cpuinfo: for benchmark tool' + 'python-progress: for benchmark tool' + 'opencv: for benchmark and cross_check tools') +makedepends=('git' 'git-lfs' 'cmake' 'libusb' 'ocl-icd' 'opencv' 'python' + 'cython' 'shellcheck') +options=('!emptydirs') +provides=('intel-openvino') +conflicts=('intel-openvino') +replaces=('intel-openvino') +# supported firmwares: VPU_SUPPORTED_FIRMWARES in inference-engine/cmake/vpu_dependencies.cmake +_firmware_ver=1522 # FIRMWARE_PACKAGE_VERSION in inference-engine/cmake/vpu_dependencies.cmake +_gnaver=02.00.00.1047.1 # GNA_VERSION (GNA2) in inference-engine/cmake/dependencies.cmake +source=("git+https://github.com/openvinotoolkit/openvino.git#tag=${pkgver}" + 'git+https://github.com/opencv/ade.git' + 'git+https://github.com/openvinotoolkit/oneDNN.git' + 'googletest-openvinotoolkit'::'git+https://github.com/openvinotoolkit/googletest.git' + 'git+https://github.com/gflags/gflags.git' + "https://download.01.org/opencv/master/openvinotoolkit/thirdparty/unified/VPU/usb-ma2x8x/firmware_usb-ma2x8x_${_firmware_ver}.zip" + "https://download.01.org/opencv/master/openvinotoolkit/thirdparty/unified/VPU/pcie-ma2x8x/firmware_pcie-ma2x8x_${_firmware_ver}.zip" + "https://download.01.org/opencv/master/openvinotoolkit/thirdparty/unified/GNA/GNA_${_gnaver}.zip" + 'openvino.conf' + 'openvino.sh' + 'setupvars.sh' + '010-ade-disable-werror.patch' + '020-openvino-cldnn-disable-werror.patch' + '030-openvino-do-not-install-tbb.patch') +noextract=("firmware_usb-ma2x8x_${_firmware_ver}.zip" + "firmware_pcie-ma248x_${_firmware_ver}.zip" + "GNA_${_gnaver}.zip") +sha256sums=('SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + '95a93144f0bbfe6e35d3830e93e6b63e1e109f849a6a7c307cae9030e3a662aa' + '6d061d21d90f1919ef375138066ba7a20ceb663901d2729d9cb1b639169df5da' + '20820e07392a1e876cf5577430c1c4c74b924d8f34cc17bfa3e36e641555e05d' + 'f485aa97d88d424dd3a223e0eddbbc382ec6c8d5094d51cbd3f0524b915e3d68' + '49a1cdd2357ac3c657b28d72aea1294e4af46389e41ed0d55ccbd12bd995058d' + '093199ae759e8755166b9737562438866123eda9b1afbbef2f7107b3cf827be5' + '502fcbb3fcbb66aa5149ad2cc5f1fa297b51ed12c5c9396a16b5795a03860ed0' + '013c96d0842d8778b0719ee29b9d9d7d8b61dc9b3b8b4e03d2293a8948e15377' + 'c64d605faff70037e7381fdc501e6b71cc1569b84bc8230db2c61d1d28a230b7') + +export GIT_LFS_SKIP_SMUDGE='1' + +prepare() { + git -C openvino lfs install --local + git -C openvino lfs pull "$(printf '%s' "${source[0]/git+/}" | sed 's/#.*$//')" + + git -C openvino submodule init + git -C openvino config --local submodule.inference-engine/thirdparty/ade.url "${srcdir}/ade" + git -C openvino config --local submodule.inference-engine/thirdparty/mkl-dnn.url "${srcdir}/oneDNN" + git -C openvino config --local submodule.inference-engine/tests/ie_test_utils/common_test_utils/gtest.url "${srcdir}/googletest-openvinotoolkit" + git -C openvino config --local submodule.inference-engine/samples/thirdparty/gflags.url "${srcdir}/gflags" + git -C openvino submodule update + + install -D -m644 "firmware_usb-ma2x8x_${_firmware_ver}.zip" -t thirdparty/unified/VPU/usb-ma2x8x + install -D -m644 "firmware_pcie-ma2x8x_${_firmware_ver}.zip" -t thirdparty/unified/VPU/pcie-ma2x8x + install -D -m644 "GNA_${_gnaver}.zip" -t thirdparty/unified/GNA + + patch -d openvino/inference-engine/thirdparty/ade -Np1 -i "${srcdir}/010-ade-disable-werror.patch" + patch -d openvino -Np1 -i "${srcdir}/020-openvino-cldnn-disable-werror.patch" + patch -d openvino -Np1 -i "${srcdir}/030-openvino-do-not-install-tbb.patch" +} + +build() { + local _ocvmaj + local _pyver + _ocvmaj="$(opencv_version | awk -F'.' '{ print $1 }')" + _pyver="$(python -c 'import sys; print("%s.%s" %sys.version_info[0:2])')" + + export IE_PATH_TO_DEPS="$srcdir" + export OpenCV_DIR="/usr/lib/cmake/opencv${_ocvmaj}" + + # note: does not accept 'None' build type + cmake -B build -S openvino \ + -DBUILD_TESTING:BOOL='OFF' \ + -DCMAKE_BUILD_TYPE:STRING='Release' \ + -DCMAKE_INSTALL_PREFIX:PATH='/opt/intel/openvino' \ + -DENABLE_AVX512F:BOOL='OFF' \ + -DENABLE_PROFILING_ITT:BOOL='OFF' \ + -DENABLE_PYTHON:BOOL='ON' \ + -DPYTHON_EXECUTABLE='/usr/bin/python' \ + -DPYTHON_LIBRARY="/usr/lib/libpython${_pyver}.so" \ + -DPYTHON_INCLUDE_DIR="/usr/include/python${_pyver}" \ + -DENABLE_SPEECH_DEMO:BOOL='OFF' \ + -DENABLE_OPENCV:BOOL='OFF' \ + -DNGRAPH_TEST_UTIL_ENABLE:BOOL='OFF' \ + -DNGRAPH_UNIT_TEST_ENABLE:BOOL='FALSE' \ + -DNGRAPH_USE_SYSTEM_PROTOBUF:BOOL='ON' \ + -DTBBROOT:PATH='/usr' \ + -DTBB_DIR:PATH='/usr/lib/cmake/TBB' \ + -DTREAT_WARNING_AS_ERROR:BOOL='OFF' \ + -Wno-dev + make -C build +} + +package() { + make -C build DESTDIR="$pkgdir" install + + install -D -m644 openvino.conf -t "${pkgdir}/etc/ld.so.conf.d" + install -D -m755 openvino.sh -t "${pkgdir}/etc/profile.d" + install -D -m755 setupvars.sh -t "${pkgdir}/opt/intel/openvino/bin" + + local _gnasover + local _gnadir="${pkgdir}/opt/intel/openvino/deployment_tools/inference_engine/external/gna" + _gnasover="$(find "openvino/inference-engine/temp/gna_${_gnaver}/linux/x64" \ + -type f -regextype 'posix-basic' -regex '.*/libgna\.so\.[0-9]*$' | sed 's/.*\.//')" + cp -dr --no-preserve='ownership' "openvino/inference-engine/temp/gna_${_gnaver}/include" "$_gnadir" + mv "${_gnadir}/lib/libgna.so" "${_gnadir}/lib/libgna.so.${_gnasover}" + ln -s "libgna.so.${_gnasover}" "${_gnadir}/lib/libgna.so" +} diff --git a/openvino.conf b/openvino.conf new file mode 100644 index 000000000000..a7ebeb4fa747 --- /dev/null +++ b/openvino.conf @@ -0,0 +1,3 @@ +/opt/intel/openvino/deployment_tools/inference_engine/lib/intel64 +/opt/intel/openvino/deployment_tools/inference_engine/external/gna/lib +/opt/intel/openvino/lib diff --git a/openvino.sh b/openvino.sh new file mode 100644 index 000000000000..0687ecd671cf --- /dev/null +++ b/openvino.sh @@ -0,0 +1,2 @@ +export INTEL_OPENVINO_DIR='/opt/intel/openvino' +export INTEL_CVSDK_DIR="$INTEL_OPENVINO_DIR" diff --git a/setupvars.sh b/setupvars.sh new file mode 100644 index 000000000000..77ed913c0010 --- /dev/null +++ b/setupvars.sh @@ -0,0 +1,22 @@ +[ -z "$INTEL_OPENVINO_DIR" ] && export INTEL_OPENVINO_DIR='/opt/intel/openvino' + +export InferenceEngine_DIR="${INTEL_OPENVINO_DIR}/deployment_tools/inference_engine/share" +export ngraph_DIR="${INTEL_OPENVINO_DIR}/cmake" + +if command -v python >/dev/null 2>&1 +then + _pyver=$(python -c 'import sys; print("%s.%s" %sys.version_info[0:2])') + export PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${INTEL_OPENVINO_DIR}/python/python${_pyver}" +fi + +export LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}${INTEL_OPENVINO_DIR}/deployment_tools/inference_engine/lib/intel64" +export LD_LIBRARY_PATH+=":${INTEL_OPENVINO_DIR}/deployment_tools/inference_engine/external/gna/lib" +export LD_LIBRARY_PATH+=":${INTEL_OPENVINO_DIR}/lib" + +export LIBRARY_PATH="${LIBRARY_PATH:+${LIBRARY_PATH}:}${INTEL_OPENVINO_DIR}/deployment_tools/inference_engine/lib/intel64" +export LIBRARY_PATH+=":${INTEL_OPENVINO_DIR}/deployment_tools/inference_engine/external/gna/lib" +export LIBRARY_PATH+=":${INTEL_OPENVINO_DIR}/lib" + +export CPATH="${CPATH:+${CPATH}:}${INTEL_OPENVINO_DIR}/deployment_tools/inference_engine/include" +export CPATH+=":${INTEL_OPENVINO_DIR}/deployment_tools/inference_engine/external/gna/include" +export CPATH+=":${INTEL_OPENVINO_DIR}/include" |