summaryrefslogtreecommitdiff
path: root/dev-cpp/benchmark
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2025-01-15 06:41:45 +0000
committerV3n3RiX <venerix@koprulu.sector>2025-01-15 06:41:45 +0000
commit8e26aeaca2a19592a9eea3917f3139bfde8641f0 (patch)
tree3ddb856d2a1de70a5caf3b8f7737425b7f8b0796 /dev-cpp/benchmark
parent6e1fc32629c46e29012a7e22b07085307d65ac96 (diff)
gentoo auto-resync : 15:01:2025 - 06:41:45
Diffstat (limited to 'dev-cpp/benchmark')
-rw-r--r--dev-cpp/benchmark/Manifest7
-rw-r--r--dev-cpp/benchmark/benchmark-1.8.4.ebuild2
-rw-r--r--dev-cpp/benchmark/benchmark-1.9.0.ebuild2
-rw-r--r--dev-cpp/benchmark/benchmark-1.9.1.ebuild91
-rw-r--r--dev-cpp/benchmark/files/benchmark-1.9.1-clock-detection-portability.patch205
5 files changed, 303 insertions, 4 deletions
diff --git a/dev-cpp/benchmark/Manifest b/dev-cpp/benchmark/Manifest
index 67ef3ff6aab8..57f5be8a6e04 100644
--- a/dev-cpp/benchmark/Manifest
+++ b/dev-cpp/benchmark/Manifest
@@ -1,6 +1,9 @@
AUX benchmark-1.9.0-fix-documentation-installation.patch 1476 BLAKE2B 7c5848f7542c14f9cfe3c79e01153efb416b1f8892945b1cc3962908a246e83945b191581f544a8dc6972da00fe9af217eb9a70c29ae02f2a6dcc84e20ff1ecf SHA512 f6a7aef337539f0057b3f4c4ffa3e79e1de7451c7d0cb6bbc9a0374e04da38488e7cba9891857d240d9f0cc4a5cfed9d4c67a613cc5919843c80db3328f35432
+AUX benchmark-1.9.1-clock-detection-portability.patch 7517 BLAKE2B 4937178e229aa17a94b253451623f0ccc4bff67ecb69af3ba6dfae575fc693a68d39e22a85025bbfb71c468e62d322e66e4459d7f57379043e0e9c93aea713ea SHA512 0195380e54470fa24f6867dcbb5cfd245b7ba97d8cc9ef9e808c1ceaa702a59917b739b5f548ef8963b7ab1e277256ab43f4fd6bb946f88a41f7d942a5effbdd
DIST benchmark-1.8.4.tar.gz 253916 BLAKE2B 78a290a5013d8371e87b7c918e518e3ec0e8247e25e211d160ab8dea51d8871d8dac54ee91ee0c512af86a60d1f4e9baedadc20d4a7fa28ef790411fda0399c8 SHA512 835d12b88fe52309ce6b2ffbc8b3c178ac594be7d249b5daca0373d1d03ec83ea3c7b94224f67f22d21919376985867eeff0d1c0721501cfd8a9e9b8a9c48882
DIST benchmark-1.9.0.tar.gz 253961 BLAKE2B fdac0018435622e3ee2c1cde02c8140a15f2579b9059d1592b588033e6935bd8d54c874f4ea912696e8e1d5f7eebae30ba849f77cc3f74f006b4b03c712685ed SHA512 0e91e0e5a2222d7650fd8bd9cafb2f0e7c1689cd1b87b2cc529c738db12bfef31162aa5a4da78f7b0aa7f0101dc08b626802c58d39862458f82f9fea9316ca25
-EBUILD benchmark-1.8.4.ebuild 878 BLAKE2B 6233945fe9650081b11d16dceaa507dd71c715a1a97e195e6928789edf70fcf49bd05ac34a4509b4d0689713764d1a9e28e783d47ebfd99bfe1e72c8d46b7d2e SHA512 613d30096278b361be2b1963507c4c295fab63e61bd9fa84214da5af0c24197fc6b33e4390d26d5588b772465fab0c018f0dd8c3142cf6956abd2d77925cea3a
-EBUILD benchmark-1.9.0.ebuild 1797 BLAKE2B 5a10e0ef59478139d8ff23fbc671e51381d418755d9d8662f93a756b7ca6f23f2a1bd5bb2ad3eadac660bcd498500c0ec18ea2b58f005cba629d8f6049e70eac SHA512 4001619fd0854a0af577b8b0a7c0af7b9f2e0e129ab31b664249b34963bd4ae19d2cfb8cf64a25b9d54b88f094889fc47fb39a308f48652d680ac925379bbffe
+DIST benchmark-1.9.1.tar.gz 255148 BLAKE2B 39b78afcb333c750960f476476b625d7f72b7cb787176deda1bd939d030e39b16fd008816c64447f7bb224983f2e80b047636f727a3d6d938f1b44dc25bddb55 SHA512 fc787d3d60a55abb3edaa575bf947c72e1ad1404a35bfddf585299411bcd04d32503bba563f9a36dccf128fce6261b97d460d6c293ed2c2d0807cf0154c86aa7
+EBUILD benchmark-1.8.4.ebuild 872 BLAKE2B 4a58422d71de47ad97de334a0d589276c551c1d59cb893dca46a40115c204783bae91804ae2c1790e59a88837d9c077be056acaf1803a1a1a4ba0f7a3f972065 SHA512 d26c963916dafa7ed2656e77f5209651a6ff1c9241f72e9f55df08fabbe3378d53d5a23757df56d4d12328db339ad67e5663884de29f8a8c53eb28c7802a11d3
+EBUILD benchmark-1.9.0.ebuild 1791 BLAKE2B 5ed606ceddfb53c7635d03f6b26bfc95051353f602c2e2dc80093a0e665de20990a110e89b6ee3661c445cae7663556d36aa3aceedee80f7f5aa706277af3083 SHA512 641003822aeec84055f399aebedb12ad2cf2a51802d858029b4727c1efb6481bcf119a1d03ab0fceffa33e63a40779a1395187847e3ca357d3583f617e153fce
+EBUILD benchmark-1.9.1.ebuild 2188 BLAKE2B 0bc159d5a0f057f934a15dc436aeace56f190cd4cc31d0915da7135a145fc96a652c0ba5219fc328ed5b1646cde3ea708db05695cb5f811c60563b4e4eab1d13 SHA512 9bf7b416e471be0a4521fc51413740a003e724ad2949efd548a284f9f60bb2d2f9e16fa823005e79ff8589a1f5c219c96524824760d0b9645a22ba5baeefbe62
MISC metadata.xml 1457 BLAKE2B c70e8a37a7fcb620faba4a5b72e6bcb6e5666e8c475d9447e4e2f7160de316bec003f9f5e8a2663f60a709eccac1a508cda6561cacc452837fd1f34269cd3e1d SHA512 c9ba9255ffe7a3d0a8dc91a6e4cae7569a027c0a0109432d6bda66990552776ca12e3dccf28e74e8364698d91ffd886cec4761a4085b49e17dd3edb759ee5f18
diff --git a/dev-cpp/benchmark/benchmark-1.8.4.ebuild b/dev-cpp/benchmark/benchmark-1.8.4.ebuild
index 3ba3a6651fab..b800d96f5d0f 100644
--- a/dev-cpp/benchmark/benchmark-1.8.4.ebuild
+++ b/dev-cpp/benchmark/benchmark-1.8.4.ebuild
@@ -11,7 +11,7 @@ SRC_URI="https://github.com/google/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
-KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~loong ppc ppc64 ~riscv x86"
+KEYWORDS="~alpha amd64 ~arm arm64 ~loong ppc ppc64 ~riscv x86"
IUSE="debug doc test"
RESTRICT="!test? ( test )"
diff --git a/dev-cpp/benchmark/benchmark-1.9.0.ebuild b/dev-cpp/benchmark/benchmark-1.9.0.ebuild
index 8340d18d7710..b20f08d030a7 100644
--- a/dev-cpp/benchmark/benchmark-1.9.0.ebuild
+++ b/dev-cpp/benchmark/benchmark-1.9.0.ebuild
@@ -12,7 +12,7 @@ HOMEPAGE="https://github.com/google/benchmark/"
SRC_URI="https://github.com/google/benchmark/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="0/$(ver_cut 1)"
-KEYWORDS="amd64 ~arm arm64 ~hppa ~loong ~ppc ppc64 ~riscv x86"
+KEYWORDS="amd64 ~arm arm64 ~loong ~ppc ppc64 ~riscv x86"
IUSE="doc +exceptions libcxx libpfm lto test +tools"
RESTRICT="!test? ( test )"
REQUIRED_USE="tools? ( ${PYTHON_REQUIRED_USE} )"
diff --git a/dev-cpp/benchmark/benchmark-1.9.1.ebuild b/dev-cpp/benchmark/benchmark-1.9.1.ebuild
new file mode 100644
index 000000000000..267541f48e8b
--- /dev/null
+++ b/dev-cpp/benchmark/benchmark-1.9.1.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{11..12} )
+
+inherit cmake-multilib flag-o-matic python-single-r1
+
+DESCRIPTION="A microbenchmark support library"
+HOMEPAGE="https://github.com/google/benchmark/"
+SRC_URI="https://github.com/google/benchmark/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0/$(ver_cut 1)"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~x86"
+IUSE="doc debug libpfm test +tools"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="tools? ( ${PYTHON_REQUIRED_USE} )"
+
+DEPEND="
+ libpfm? ( dev-libs/libpfm:= )
+"
+RDEPEND="
+ ${DEPEND}
+ tools? (
+ $(python_gen_cond_dep '
+ dev-python/numpy[${PYTHON_USEDEP}]
+ >=dev-python/scipy-1.10.0[${PYTHON_USEDEP}]
+ ')
+ ${PYTHON_DEPS}
+ )
+"
+BDEPEND="
+ doc? ( app-text/doxygen )
+ test? ( dev-cpp/gtest[${MULTILIB_USEDEP}] )
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-1.9.0-fix-documentation-installation.patch"
+ "${FILESDIR}/${P}-clock-detection-portability.patch"
+)
+
+pkg_setup() {
+ use tools && python-single-r1_pkg_setup
+}
+
+multilib_src_configure() {
+ # bug #943629
+ use debug || append-cppflags -DNDEBUG
+
+ local mycmakeargs=(
+ -DBENCHMARK_ENABLE_DOXYGEN="$(usex doc)"
+ -DBENCHMARK_ENABLE_GTEST_TESTS="$(usex test)"
+ # Users should control this via *FLAGS
+ -DBENCHMARK_ENABLE_LTO=OFF
+ -DBENCHMARK_ENABLE_LIBPFM="$(multilib_native_usex libpfm)"
+ -DBENCHMARK_ENABLE_TESTING="$(usex test)"
+ -DBENCHMARK_ENABLE_WERROR=OFF
+ -DBENCHMARK_INSTALL_DOCS="$(usex doc)"
+ -DBENCHMARK_USE_BUNDLED_GTEST=OFF
+ # This is determined by profile.
+ -DBENCHMARK_USE_LIBCXX=OFF
+ )
+
+ cmake_src_configure
+}
+
+multilib_src_test() {
+ CMAKE_SKIP_TESTS=(
+ # CMake already warns on these being brittle w/ diff
+ # compiler versions. Could do with investigation if bored
+ # but not critical. See bug #941538.
+ run_donotoptimize_assembly_test_CHECK
+ run_state_assembly_test_CHECK
+ run_clobber_memory_assembly_test_CHECK
+ )
+
+ cmake_src_test
+}
+
+multilib_src_install_all() {
+ dodoc CONTRIBUTING.md
+ dodoc CONTRIBUTORS
+
+ if use tools; then
+ python_domodule tools/gbench
+ python_doscript tools/compare.py
+ python_doscript tools/strip_asm.py
+ fi
+}
diff --git a/dev-cpp/benchmark/files/benchmark-1.9.1-clock-detection-portability.patch b/dev-cpp/benchmark/files/benchmark-1.9.1-clock-detection-portability.patch
new file mode 100644
index 000000000000..d9ecd9db56d2
--- /dev/null
+++ b/dev-cpp/benchmark/files/benchmark-1.9.1-clock-detection-portability.patch
@@ -0,0 +1,205 @@
+https://github.com/google/benchmark/commit/f65741b2bd92461dc2c816056eb9c996ae48ad62
+https://github.com/google/benchmark/commit/077db43001b42af3ad23e993b2bdcb4fadb7bcf8
+https://github.com/google/benchmark/commit/39be87d3004ff9ff4cdf736651af80c3d15e2497
+https://github.com/google/benchmark/commit/c24774dc4f4402c3ad150363321cc972ed2669e7
+
+From f65741b2bd92461dc2c816056eb9c996ae48ad62 Mon Sep 17 00:00:00 2001
+From: Helge Deller <deller@gmx.de>
+Date: Wed, 8 Jan 2025 13:03:53 +0100
+Subject: [PATCH] cycleclock: Support for PA-RISC (hppa) architecture (#1894)
+
+Co-authored-by: dominic <510002+dmah42@users.noreply.github.com>
+---
+ src/cycleclock.h | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/src/cycleclock.h b/src/cycleclock.h
+index bd62f5d7e7..7852f3df52 100644
+--- a/src/cycleclock.h
++++ b/src/cycleclock.h
+@@ -229,6 +229,16 @@ inline BENCHMARK_ALWAYS_INLINE int64_t Now() {
+ struct timeval tv;
+ gettimeofday(&tv, nullptr);
+ return static_cast<int64_t>(tv.tv_sec) * 1000000 + tv.tv_usec;
++#elif defined(__hppa__)
++ // HP PA-RISC provides a user-readable clock counter (cr16), but
++ // it's not syncronized across CPUs and only 32-bit wide when programs
++ // are built as 32-bit binaries.
++ // Use clock_gettime(CLOCK_MONOTONIC, ...) instead of gettimeofday
++ // because is provides nanosecond resolution.
++ // Initialize to always return 0 if clock_gettime fails.
++ struct timespec ts = {0, 0};
++ clock_gettime(CLOCK_MONOTONIC, &ts);
++ return static_cast<int64_t>(ts.tv_sec) * 1000000000 + ts.tv_nsec;
+ #else
+ // The soft failover to a generic implementation is automatic only for ARM.
+ // For other platforms the developer is expected to make an attempt to create
+
+From 077db43001b42af3ad23e993b2bdcb4fadb7bcf8 Mon Sep 17 00:00:00 2001
+From: Helge Deller <deller@gmx.de>
+Date: Wed, 8 Jan 2025 17:54:08 +0100
+Subject: [PATCH] cycleclock: Use cock_gettime() as fallback for any Linux
+ architecture (#1899)
+
+The Linux kernel provides the clock_gettime() functions since a long
+time already, so it's possible to use it as a generic fallback option
+for any architecture if no other (better) possibility has been provided
+instead.
+
+I noticed the benchmark package failed to build on debian on the SH-4
+architecture, so with this change SH-4 is now the first user of this
+fallback option.
+---
+ src/cycleclock.h | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/cycleclock.h b/src/cycleclock.h
+index 7852f3df5..03e02f805 100644
+--- a/src/cycleclock.h
++++ b/src/cycleclock.h
+@@ -229,10 +229,12 @@ inline BENCHMARK_ALWAYS_INLINE int64_t Now() {
+ struct timeval tv;
+ gettimeofday(&tv, nullptr);
+ return static_cast<int64_t>(tv.tv_sec) * 1000000 + tv.tv_usec;
+-#elif defined(__hppa__)
++#elif defined(__hppa__) || defined(__linux__)
++ // Fallback for all other architectures with a recent Linux kernel, e.g.:
+ // HP PA-RISC provides a user-readable clock counter (cr16), but
+ // it's not syncronized across CPUs and only 32-bit wide when programs
+ // are built as 32-bit binaries.
++ // Same for SH-4 and possibly others.
+ // Use clock_gettime(CLOCK_MONOTONIC, ...) instead of gettimeofday
+ // because is provides nanosecond resolution.
+ // Initialize to always return 0 if clock_gettime fails.
+From 39be87d3004ff9ff4cdf736651af80c3d15e2497 Mon Sep 17 00:00:00 2001
+From: Helge Deller <deller@gmx.de>
+Date: Thu, 9 Jan 2025 11:47:29 +0100
+Subject: [PATCH] Fix runtime crash when parsing /proc/cpuinfo fails (#1900)
+
+The testcase fails on sparc64, because the parsing of /proc/cpuinfo
+fails and thus currently returns "0" CPUs which finally leads
+to division-by-zero faults in the tests.
+
+Fix the issue by returning at least "1" CPU which allows the
+tests to run. A error message will be printed in any case.
+
+Long-term the code should be fixed to parse the cpuinfo output
+on sparch which looks like this:
+...
+type : sun4v
+ncpus probed : 48
+ncpus active : 48
+---
+ src/sysinfo.cc | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/sysinfo.cc b/src/sysinfo.cc
+index 49bff75e5..ce14b8d8e 100644
+--- a/src/sysinfo.cc
++++ b/src/sysinfo.cc
+@@ -561,10 +561,12 @@ int GetNumCPUsImpl() {
+ }
+
+ int GetNumCPUs() {
+- const int num_cpus = GetNumCPUsImpl();
++ int num_cpus = GetNumCPUsImpl();
+ if (num_cpus < 1) {
+ std::cerr << "Unable to extract number of CPUs. If your platform uses "
+ "/proc/cpuinfo, custom support may need to be added.\n";
++ /* There is at least one CPU which we run on. */
++ num_cpus = 1;
+ }
+ return num_cpus;
+ }
+From c24774dc4f4402c3ad150363321cc972ed2669e7 Mon Sep 17 00:00:00 2001
+From: Helge Deller <deller@gmx.de>
+Date: Thu, 9 Jan 2025 17:07:43 +0100
+Subject: [PATCH] Get number of CPUs with sysconf() on Linux (#1901)
+
+* Get number of CPUs with sysconf() on Linux
+
+Avoid parsing the /proc/cpuinfo just to get number of CPUs.
+Instead use the portable function provided by glibc.
+
+* Update sysinfo.cc
+---
+ src/sysinfo.cc | 54 +++-----------------------------------------------
+ 1 file changed, 3 insertions(+), 51 deletions(-)
+
+diff --git a/src/sysinfo.cc b/src/sysinfo.cc
+index ce14b8d8e..eddd430e6 100644
+--- a/src/sysinfo.cc
++++ b/src/sysinfo.cc
+@@ -492,14 +492,14 @@ int GetNumCPUsImpl() {
+ GetSystemInfo(&sysinfo);
+ // number of logical processors in the current group
+ return static_cast<int>(sysinfo.dwNumberOfProcessors);
+-#elif defined(BENCHMARK_OS_SOLARIS)
++#elif defined(__linux__) || defined(BENCHMARK_OS_SOLARIS)
+ // Returns -1 in case of a failure.
+- long num_cpu = sysconf(_SC_NPROCESSORS_ONLN);
++ int num_cpu = static_cast<int>(sysconf(_SC_NPROCESSORS_ONLN));
+ if (num_cpu < 0) {
+ PrintErrorAndDie("sysconf(_SC_NPROCESSORS_ONLN) failed with error: ",
+ strerror(errno));
+ }
+- return (int)num_cpu;
++ return num_cpu;
+ #elif defined(BENCHMARK_OS_QNX)
+ return static_cast<int>(_syspage_ptr->num_cpu);
+ #elif defined(BENCHMARK_OS_QURT)
+@@ -508,54 +508,6 @@ int GetNumCPUsImpl() {
+ hardware_threads.max_hthreads = 1;
+ }
+ return hardware_threads.max_hthreads;
+-#else
+- int num_cpus = 0;
+- int max_id = -1;
+- std::ifstream f("/proc/cpuinfo");
+- if (!f.is_open()) {
+- std::cerr << "Failed to open /proc/cpuinfo\n";
+- return -1;
+- }
+-#if defined(__alpha__)
+- const std::string Key = "cpus detected";
+-#else
+- const std::string Key = "processor";
+-#endif
+- std::string ln;
+- while (std::getline(f, ln)) {
+- if (ln.empty()) continue;
+- std::size_t split_idx = ln.find(':');
+- std::string value;
+-#if defined(__s390__)
+- // s390 has another format in /proc/cpuinfo
+- // it needs to be parsed differently
+- if (split_idx != std::string::npos)
+- value = ln.substr(Key.size() + 1, split_idx - Key.size() - 1);
+-#else
+- if (split_idx != std::string::npos) value = ln.substr(split_idx + 1);
+-#endif
+- if (ln.size() >= Key.size() && ln.compare(0, Key.size(), Key) == 0) {
+- num_cpus++;
+- if (!value.empty()) {
+- const int cur_id = benchmark::stoi(value);
+- max_id = std::max(cur_id, max_id);
+- }
+- }
+- }
+- if (f.bad()) {
+- PrintErrorAndDie("Failure reading /proc/cpuinfo");
+- }
+- if (!f.eof()) {
+- PrintErrorAndDie("Failed to read to end of /proc/cpuinfo");
+- }
+- f.close();
+-
+- if ((max_id + 1) != num_cpus) {
+- fprintf(stderr,
+- "CPU ID assignments in /proc/cpuinfo seem messed up."
+- " This is usually caused by a bad BIOS.\n");
+- }
+- return num_cpus;
+ #endif
+ BENCHMARK_UNREACHABLE();
+ }