summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-02-01 06:18:09 +0000
committerCoprDistGit <infra@openeuler.org>2024-02-01 06:18:09 +0000
commit0c432bab387eda90603521bfbc2757ec71b866ae (patch)
treebf18dfb24afd2443e1eb1699cbfad160a21add07
parent064fd64eb2c1659e94884a1626d0ea5cd91d0ca0 (diff)
automatic import of cpuinfoopeneuler23.09
-rw-r--r--.gitignore1
-rw-r--r--0001-cpuinfo-fedora-cmake-changes.patch32
-rw-r--r--cpuinfo.spec110
-rw-r--r--sources1
4 files changed, 144 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..3c72797 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/cpuinfo-eb4a667.tar.gz
diff --git a/0001-cpuinfo-fedora-cmake-changes.patch b/0001-cpuinfo-fedora-cmake-changes.patch
new file mode 100644
index 0000000..c4926bf
--- /dev/null
+++ b/0001-cpuinfo-fedora-cmake-changes.patch
@@ -0,0 +1,32 @@
+From 5110e63726f127c3224d26c93d954871d69bedc8 Mon Sep 17 00:00:00 2001
+From: Tom Rix <trix@redhat.com>
+Date: Fri, 17 Mar 2023 11:05:11 -0700
+Subject: [PATCH] cpuinfo fedora cmake changes
+
+SO's need a version
+Use the YY.M.D of the last commit
+
+Signed-off-by: Tom Rix <trix@redhat.com>
+---
+ CMakeLists.txt | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 9f4d1d1..99a4d7e 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -223,6 +223,11 @@ ELSE()
+ MESSAGE(FATAL_ERROR "Unsupported library type ${CPUINFO_LIBRARY_TYPE}")
+ ENDIF()
+ ADD_LIBRARY(cpuinfo_internals STATIC ${CPUINFO_SRCS})
++
++# YY.M.D of last upstream commit to main
++set(cpuinfo_VERSION 23.2.14)
++set_target_properties(cpuinfo PROPERTIES VERSION ${cpuinfo_VERSION} SOVERSION ${cpuinfo_VERSION})
++
+ CPUINFO_TARGET_ENABLE_C99(cpuinfo)
+ CPUINFO_TARGET_ENABLE_C99(cpuinfo_internals)
+ CPUINFO_TARGET_RUNTIME_LIBRARY(cpuinfo)
+--
+2.40.0
+
diff --git a/cpuinfo.spec b/cpuinfo.spec
new file mode 100644
index 0000000..c8df545
--- /dev/null
+++ b/cpuinfo.spec
@@ -0,0 +1,110 @@
+%bcond_with check
+
+%global commit0 eb4a6674bfe9cf91b63b9817412ae5f6862c8432
+%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
+
+Summary: A library to detect information about host CPU
+Name: cpuinfo
+License: BSD-2-Clause
+# The project has no version, this is the last git commit date YY.M.D
+Version: 23.2.14
+Release: %{?shortcommit0}%{?dist}.1
+
+URL: https://github.com/pytorch/%{name}
+Source0: %{url}/archive/%{commit0}/%{name}-%{shortcommit0}.tar.gz
+
+Patch0: 0001-cpuinfo-fedora-cmake-changes.patch
+
+ExclusiveArch: x86_64 aarch64
+
+BuildRequires: cmake
+BuildRequires: gcc-c++
+%if %{with check}
+BuildRequires: gtest-devel
+%endif
+BuildRequires: make
+
+%description
+cpuinfo is a library to detect essential for performance
+optimization information about host CPU.
+
+Features
+* Cross-platform availability:
+ * Linux, Windows, macOS, Android, and iOS operating systems
+ * x86, x86-64, ARM, and ARM64 architectures
+* Modern C/C++ interface
+ * Thread-safe
+ * No memory allocation after initialization
+ * No exceptions thrown
+* Detection of supported instruction sets, up to AVX512 (x86)
+ and ARMv8.3 extensions
+* Detection of SoC and core information:
+ * Processor (SoC) name
+ * Vendor and microarchitecture for each CPU core
+ * ID (MIDR on ARM, CPUID leaf 1 EAX value on x86) for each CPU core
+* Detection of cache information:
+ * Cache type (instruction/data/unified), size and line size
+ * Cache associativity
+ * Cores and logical processors (hyper-threads) sharing the cache
+* Detection of topology information (relative between logical
+ processors, cores, and processor packages)
+* Well-tested production-quality code:
+ * 60+ mock tests based on data from real devices
+ * Includes work-arounds for common bugs in hardware and OS kernels
+ * Supports systems with heterogenous cores, such as big.LITTLE and Max.Med.Min
+* Permissive open-source license (Simplified BSD)
+
+%package devel
+Summary: Headers and libraries for cpuinfo
+Requires: %{name}%{?_isa} = %{version}-%{release}
+
+%description devel
+This package contains the developement libraries and headers
+for cpuinfo.
+
+%prep
+%autosetup -p1 -n %{name}-%{commit0}
+
+%build
+%cmake \
+%if %{with check}
+ -DCPUINFO_BUILD_UNIT_TESTS=ON \
+%else
+ -DCPUINFO_BUILD_UNIT_TESTS=OFF \
+%endif
+ -DCPUINFO_BUILD_MOCK_TESTS=OFF \
+ -DCPUINFO_BUILD_BENCHMARKS=OFF \
+ -B "./build" \
+ -S "."
+
+%{__cmake} --build "./build" -j --verbose
+
+%install
+DESTDIR="%{buildroot}" %{__cmake} --install "./build"
+
+%check
+%if %{with check}
+%ctest
+%endif
+
+%files
+%{_bindir}/isa-info
+%{_bindir}/cpu-info
+%{_bindir}/cache-info
+%ifarch x86_64
+%{_bindir}/cpuid-dump
+%endif
+%{_libdir}/lib%{name}.so.*
+
+%files devel
+%license LICENSE
+%doc README.md
+%dir %{_datadir}/%{name}
+%{_includedir}/%{name}.h
+%{_datadir}/%{name}/%{name}-*.cmake
+%{_libdir}/lib%{name}*.so
+%{_libdir}/pkgconfig/lib%{name}.pc
+
+%changelog
+* Sun Jan 28 2024 Binshuo Zu <274620705z@gmail.com> - 23.2.14.giteb4a667.1
+- Package init
diff --git a/sources b/sources
new file mode 100644
index 0000000..52519bf
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+8f4bfe5064fdb022af4ea3eee19c967a cpuinfo-eb4a667.tar.gz