ComputeLibrary:fix build error

* fix build error

Signed-off-by: xudandan <dandan@nj.iscas.ac.cn>
This commit is contained in:
xudandan 2022-12-23 13:15:17 +08:00
parent cd03cf506b
commit d9e33377cb
2 changed files with 210 additions and 15 deletions

View File

@ -1,18 +1,37 @@
%define so_ver 18
#
# spec file for package ComputeLibrary
#
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define so_ver 29
# Disable validation tests by default due to opencl needing to be set up
%bcond_with computelibrary_tests
Name: ComputeLibrary
Version: 22.11
Release: 2
Release: 1.1
Summary: ARM Compute Library
License: MIT
URL: https://developer.arm.com/technologies/compute-library
Source: https://github.com/ARM-software/ComputeLibrary/archive/refs/tags/v%{version}.zip#/v%{version}.zip
Source: https://github.com/ARM-software/ComputeLibrary/archive/v%{version}.tar.gz#/ComputeLibrary-%{version}.tar.gz
BuildRequires: gcc-c++
BuildRequires: git-core
BuildRequires: ocl-icd-devel
BuildRequires: scons >= 2.4
Recommends: %{name}-sample-data
ExclusiveArch: aarch64 x86_64
ExclusiveArch: aarch64 armv7l armv7hl x86_64
%description
A software library for computer vision and machine learning.
@ -27,10 +46,30 @@ A software library for computer vision and machine learning.
The Compute Library is a collection of low-level functions optimized for Arm CPU and GPU architectures targeted at image processing, computer vision, and machine learning.
Library part.
%package -n libarm_compute_core%{so_ver}
Summary: ARM Compute Library - Core part
%description -n libarm_compute_core%{so_ver}
A software library for computer vision and machine learning.
The Compute Library is a collection of low-level functions optimized for Arm CPU and GPU architectures targeted at image processing, computer vision, and machine learning.
Library part.
%package -n libarm_compute_graph%{so_ver}
Summary: ARM Compute Library - Graph part
%description -n libarm_compute_graph%{so_ver}
A software library for computer vision and machine learning.
The Compute Library is a collection of low-level functions optimized for Arm CPU and GPU architectures targeted at image processing, computer vision, and machine learning.
Library part.
%package devel
Summary: ARM Compute Library -- devel
Requires: %{name} = %{version}
Requires: libarm_compute%{so_ver} = %{version}
Requires: libarm_compute_core%{so_ver} = %{version}
Requires: libarm_compute_graph%{so_ver} = %{version}
# stb headers are required
Requires: stb-devel
%description devel
A software library for computer vision and machine learning.
@ -45,22 +84,26 @@ Summary: Compute Library sample data
Free *.npy and *.ppm files to use with example binaries.
%prep
%setup -q -n ComputeLibrary-%{version}
%autosetup -p1 -n ComputeLibrary-%{version}
%build
scons os=linux build=native \
scons os=linux \
build=native \
install_dir=install \
set_soname=1 \
examples=1 \
gles_compute=0 \
opencl=1 \
%if %{with computelibrary_tests}
validation_tests=1 \
%else
validation_tests=0 \
%endif
%ifarch aarch64
%ifarch aarch64 aarch64_ilp32
neon=1 arch=arm64-v8a \
%endif
%ifarch armv7l armv7hl
neon=0 arch=armv7a \
%endif
%ifarch x86_64
neon=0 arch=x86_64 \
%endif
@ -76,8 +119,9 @@ mkdir -p %{buildroot}%{_bindir}
install -Dm0755 build/examples/* %{buildroot}%{_bindir}/
mkdir -p %{buildroot}%{_libdir}
cp -a build/*.so* %{buildroot}%{_libdir}/
# FIXME: scons should install headers thanks to: install_dir=%%{buildroot}%%{_prefix} but this is broken
mkdir -p %{buildroot}%{_includedir}/
cp -a arm_compute/ include/half/ include/libnpy/ support/ utils/ %{buildroot}%{_includedir}/
cp -a arm_compute/ support/ utils/ include/half/ include/libnpy/ %{buildroot}%{_includedir}/
# Remove *.cpp files from includedir
rm -f $(find %{buildroot}%{_includedir}/ -name *.cpp)
# Install sample data
@ -85,6 +129,7 @@ mkdir -p %{buildroot}%{_datadir}/ComputeLibrary/%{sampledir}
cp -r data/* %{buildroot}%{_datadir}/ComputeLibrary/%{sampledir}
# Install scripts
install -Dm0755 scripts/* %{buildroot}%{_bindir}
rm -f %{buildroot}%{_bindir}/*.h
# Fix Python scripts interpreter
for pyfile in `ls %{buildroot}%{_bindir}/*.py`; do
sed -i -e 's|#!%{_bindir}/env python|#!%{_bindir}/python|' $pyfile
@ -93,6 +138,12 @@ done
%post -n libarm_compute%{so_ver} -p /sbin/ldconfig
%postun -n libarm_compute%{so_ver} -p /sbin/ldconfig
%post -n libarm_compute_core%{so_ver} -p /sbin/ldconfig
%postun -n libarm_compute_core%{so_ver} -p /sbin/ldconfig
%post -n libarm_compute_graph%{so_ver} -p /sbin/ldconfig
%postun -n libarm_compute_graph%{so_ver} -p /sbin/ldconfig
%if %{with computelibrary_tests}
%check
LD_LIBRARY_PATH="build/" build/tests/arm_compute_validation
@ -103,7 +154,15 @@ LD_LIBRARY_PATH="build/" build/tests/arm_compute_validation
%files -n libarm_compute%{so_ver}
%license LICENSE
%{_libdir}/*.so.%{so_ver}*
%{_libdir}/libarm_compute.so.%{so_ver}*
%files -n libarm_compute_core%{so_ver}
%license LICENSE
%{_libdir}/libarm_compute_core.so.%{so_ver}*
%files -n libarm_compute_graph%{so_ver}
%license LICENSE
%{_libdir}/libarm_compute_graph.so.%{so_ver}*
%files devel
%dir %{_includedir}/arm_compute
@ -123,8 +182,144 @@ LD_LIBRARY_PATH="build/" build/tests/arm_compute_validation
%{_datadir}/ComputeLibrary/%{sampledir}
%changelog
* Mon Jun 22 2020 Senlin Xia <xisenlin1@huawei.com> - 22.11-2
- fix build errors
* Mon May 10 2010 sinever <sinever@126.com>
- Initial release 22.11
* Mon Nov 28 2022 Guillaume GARDET <guillaume.gardet@opensuse.org>
- Update to 22.11:
* Public major release
* Documentation (API, changelogs, build guide,
contribution guide, errata, etc.) available here:
https://arm-software.github.io/ComputeLibrary/v22.11
* Tue Aug 30 2022 Guillaume GARDET <guillaume.gardet@opensuse.org>
- Update to 22.08:
* Public major release
* Documentation (API, changelogs, build guide,
contribution guide, errata, etc.) available here:
https://arm-software.github.io/ComputeLibrary/v22.08
- Drop upstream patch:
* fix-with-gcc12.patch
* Tue May 31 2022 Guillaume GARDET <guillaume.gardet@opensuse.org>
- Update to 22.05:
* Public major release
* Documentation (API, changelogs, build guide,
contribution guide, errata, etc.) available here:
https://arm-software.github.io/ComputeLibrary/v22.05
- Fix build with GCC12:
* fix-with-gcc12.patch
* Tue Mar 15 2022 Guillaume GARDET <guillaume.gardet@opensuse.org>
- Update to 22.02:
* Public major release
* Documentation (API, changelogs, build guide,
contribution guide, errata, etc.) available here:
https://arm-software.github.io/ComputeLibrary/v22.02
* Wed Dec 1 2021 Guillaume GARDET <guillaume.gardet@opensuse.org>
- Update to 21.11:
* Public major release
* Documentation (API, changelogs, build guide,
contribution guide, errata, etc.) available here:
https://arm-software.github.io/ComputeLibrary/v21.11/
* Thu Sep 9 2021 Guillaume GARDET <guillaume.gardet@opensuse.org>
- Update to 21.08:
* Public major release
* Documentation (API, changelogs, build guide,
contribution guide, errata, etc.) available here:
https://arm-software.github.io/ComputeLibrary/v21.08/
* Fri May 21 2021 Guillaume GARDET <guillaume.gardet@opensuse.org>
- Update to 21.05:
* Public major release
* Documentation (API, changelogs, build guide,
contribution guide, errata, etc.) available here:
https://arm-software.github.io/ComputeLibrary/v21.05/
- Drop patch which is not needed anymore:
* acl-fix-packaging-issue.patch
* Wed Apr 7 2021 Guillaume GARDET <guillaume.gardet@opensuse.org>
- Add patch to fix build of ArmNN with openCL:
* acl-fix-packaging-issue.patch
* Wed Apr 7 2021 Guillaume GARDET <guillaume.gardet@opensuse.org>
- Package separately libarm_compute_core and libarm_compute_graph
* Mon Mar 29 2021 Guillaume GARDET <guillaume.gardet@opensuse.org>
- Update to 21.02:
* Public major release
* Documentation (API, changelogs, build guide,
contribution guide, errata, etc.) available here:
https://arm-software.github.io/ComputeLibrary/v21.02/
* Wed Dec 9 2020 Guillaume GARDET <guillaume.gardet@opensuse.org>
- Update to 20.11:
* Public major release
* Deprecation notice:
Deprecated GLES functions and kernels
Deprecated Neon and OpenCL Computer Vision functions
* Documentation (API, changelogs, build guide,
contribution guide, errata, etc.) available here:
https://arm-software.github.io/ComputeLibrary/v20.11/
* Thu Sep 3 2020 Guillaume GARDET <guillaume.gardet@opensuse.org>
- Update to 20.08:
* Public major release
* Documentation (API, changelogs, build guide,
contribution guide, errata, etc.) available here:
https://arm-software.github.io/ComputeLibrary/v20.08/
* Thu Jun 4 2020 Guillaume GARDET <guillaume.gardet@opensuse.org>
- Update to 20.05:
* Public major release
* Documentation (API, changelogs, build guide,
contribution guide, errata, etc.) available here:
https://arm-software.github.io/ComputeLibrary/v20.05/
* Mon Mar 9 2020 Guillaume GARDET <guillaume.gardet@opensuse.org>
- Update to 20.02.1 (no upstream changelog)
* Tue Feb 25 2020 Tomáš Chvátal <tchvatal@suse.com>
- Update to 19.11.1:
* Fix offset calculation in NEReductionOperationKernel.
* Fix data layout in NEScaleKernel for nhwc.
* Retain configuration step data layout to avoid side-effects.
* Perform sqrt in double domain for L2 pooling.
* Fix output shape calculation for Reduce Mean.
* Tue Feb 25 2020 Tomáš Chvátal <tchvatal@suse.com>
- Cleanup a bit with spec-cleaner
* Fri Dec 6 2019 Guillaume GARDET <guillaume.gardet@opensuse.org>
- Update to 19.11 (no upstream changelog)
- Revert previous commit to disable neon on armv7
* Tue Nov 26 2019 Guillaume GARDET <guillaume.gardet@opensuse.org>
- Enable neon on armv7
* Wed Oct 9 2019 Guillaume GARDET <guillaume.gardet@opensuse.org>
- Fix Python scripts interpreter
- Fix -devel package dep
- Drop gcc 4.8 workaround
* Thu Sep 5 2019 Guillaume GARDET <guillaume.gardet@opensuse.org>
- Update to 19.08 (no upstream changelog)
* Mon Jun 3 2019 Guillaume GARDET <guillaume.gardet@opensuse.org>
- Add validation test option (disabled by default since CL is
unusable inside OBS)
* Mon Jun 3 2019 Guillaume GARDET <guillaume.gardet@opensuse.org>
- Update to 19.05 (no upstream changelog)
- Remove upstream patch:
* computelibrary-fix_opencl.patch
* Fri Apr 19 2019 Guillaume GARDET <guillaume.gardet@opensuse.org>
- Package scripts
* Thu Apr 11 2019 Guillaume GARDET <guillaume.gardet@opensuse.org>
- Add patch to fix build with openCL:
* computelibrary-fix_opencl.patch
* Wed Apr 3 2019 Guillaume GARDET <guillaume.gardet@opensuse.org>
- Update to 19.02
* Mon Jan 14 2019 Guillaume GARDET <guillaume.gardet@opensuse.org>
- Update to 18.11
* Thu Sep 13 2018 guillaume.gardet@opensuse.org
- Update to 18.08
- Remove upstreamed patches:
* fix_build_with_scons3.patch
* fix_c++11_syntax.patch
* Tue Jun 5 2018 guillaume.gardet@opensuse.org
- Add missing includes
- Add sample-data
* Mon Jun 4 2018 guillaume.gardet@opensuse.org
- Add soname option and require scons >= 2.4
- Add a -devel package
* Fri Jun 1 2018 guillaume.gardet@opensuse.org
- Rename from arm_compute to ComputeLibrary (upstream name)
- Split libraries to a separate package
* Fri Jun 1 2018 guillaume.gardet@opensuse.org
- Update to 18.05
- Add patches to fix builds on Leap 15.0+:
* fix_build_with_scons3.patch
* fix_c++11_syntax.patch
- Disable openCL on Leap 15.0+ since the build script is not yet
fully compatible with Python3 and breaks when openCL is enabled
* Mon Apr 3 2017 afaerber@suse.de
- Initial release 17.03.1