From bc7ab69183d61ff2369d3f5f7b1c85f6a20c4563 Mon Sep 17 00:00:00 2001 From: Kai Germaschewski Date: Wed, 5 Jun 2024 22:18:13 -0400 Subject: [PATCH 1/2] build: use gtest version 1.14.0 The hope was for this to fix a build issue with gcc13/arm64, which it did not, but using a gtest release is an improvement in any case. --- CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 97cb01087b..e88b5e8501 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,9 +69,7 @@ if (BUILD_TESTING) CPMAddPackage( NAME GTest GITHUB_REPOSITORY google/googletest - # post 1.10.0 with cmake_minimum_required updated - GIT_TAG 32f4f52d95dc99c35f51deed552a6ba700567f94 - VERSION 1.10.0 + VERSION 1.14.0 OPTIONS "INSTALL_GTEST OFF" "gtest_force_shared_crt ON" From d7e1cd765452c002e30ee9ab77df552ec80ce48c Mon Sep 17 00:00:00 2001 From: Kai Germaschewski Date: Wed, 5 Jun 2024 22:19:08 -0400 Subject: [PATCH 2/2] build: use std::shuffle rather than deprecated/removed std::random_shuffle --- src/libpsc/psc_collision/psc_collision_impl.hxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libpsc/psc_collision/psc_collision_impl.hxx b/src/libpsc/psc_collision/psc_collision_impl.hxx index 78d8dbc8c8..eadf79688e 100644 --- a/src/libpsc/psc_collision/psc_collision_impl.hxx +++ b/src/libpsc/psc_collision/psc_collision_impl.hxx @@ -8,6 +8,7 @@ #include #include +#include extern void* global_collision; // FIXME @@ -164,11 +165,11 @@ struct CollisionHost // ---------------------------------------------------------------------- // randomize_in_cell - static std::vector randomize_in_cell(int n_start, int n_end) + std::vector randomize_in_cell(int n_start, int n_end) { std::vector permute(n_end - n_start); std::iota(permute.begin(), permute.end(), n_start); - std::random_shuffle(permute.begin(), permute.end()); + std::shuffle(permute.begin(), permute.end(), rng_); return permute; } @@ -265,6 +266,8 @@ private: double nu_; int interval_; + std::mt19937 rng_; + public: // FIXME // for output Mfields mflds_stats_;