diff options
Diffstat (limited to 'cpuinfo.spec')
-rw-r--r-- | cpuinfo.spec | 110 |
1 files changed, 110 insertions, 0 deletions
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 |