From b1b5ab106122e6917f6b34452be95e617506f05d Mon Sep 17 00:00:00 2001 From: "Douglas B. Rumbaugh" Date: Mon, 25 Mar 2024 12:54:17 -0400 Subject: Updates for build on OpenBSD Necessary updates to get the codebase building under OpenBSD 7.5 with clang. This is a minimal set of changes to get building to work, which includes disabling several things that aren't directly compatable. More work will be necessary to get full functionality. In particular, Triespline, PGM, and the reference M-tree do not currently build on OpenBSD with clang due to GNU dependencies or other gcc specific features. --- benchmarks/include/benchmark_types.h | 4 +++- benchmarks/include/standard_benchmarks.h | 7 +++++++ benchmarks/watermark_testing.cpp | 6 +++++- 3 files changed, 15 insertions(+), 2 deletions(-) (limited to 'benchmarks') diff --git a/benchmarks/include/benchmark_types.h b/benchmarks/include/benchmark_types.h index 85e9565..fcdeac6 100644 --- a/benchmarks/include/benchmark_types.h +++ b/benchmarks/include/benchmark_types.h @@ -2,7 +2,6 @@ #include #include "psu-ds/BTree.h" -#include "mtree.h" #include "framework/interface/Record.h" /* TLX BTree definitions*/ @@ -46,5 +45,8 @@ struct euclidean_distance { } }; +#ifdef _GNU_SOURCE +#include "mtree.h" typedef mt::mtree MTree; +#endif diff --git a/benchmarks/include/standard_benchmarks.h b/benchmarks/include/standard_benchmarks.h index a42cdd6..5fc549d 100644 --- a/benchmarks/include/standard_benchmarks.h +++ b/benchmarks/include/standard_benchmarks.h @@ -102,8 +102,10 @@ static bool insert_tput_bench(DE &de_index, std::fstream &file, size_t insert_cn if (applied_deletes < delete_cnt && delete_idx < delete_vec.size() && gsl_rng_uniform(rng) < delete_prop) { if constexpr (std::is_same_v) { de_index.erase_one(delete_vec[delete_idx++].key); + #ifdef _GNU_SOURCE } else if constexpr (std::is_same_v) { de_index.remove(delete_vec[delete_idx++]); + #endif } else { de_index.erase(delete_vec[delete_idx++]); } @@ -111,11 +113,16 @@ static bool insert_tput_bench(DE &de_index, std::fstream &file, size_t insert_cn } // insert the record; + #ifdef _GNU_SOURCE if constexpr (std::is_same_v) { de_index.add(insert_vec[i]); } else { de_index.insert(insert_vec[i]); } + #else + de_index.insert(insert_vec[i]); + #endif + applied_inserts++; } auto insert_stop = std::chrono::high_resolution_clock::now(); diff --git a/benchmarks/watermark_testing.cpp b/benchmarks/watermark_testing.cpp index 5fa0c0d..c56fc63 100644 --- a/benchmarks/watermark_testing.cpp +++ b/benchmarks/watermark_testing.cpp @@ -12,6 +12,7 @@ #include "psu-util/timer.h" #include +#include typedef uint64_t K; typedef de::Record Rec; @@ -32,7 +33,10 @@ int main(int argc, char **argv) { keys[i] = i; } - std::random_shuffle(keys.begin(), keys.end()); + std::random_device rd; + std::mt19937 g(rd()); + + std::shuffle(keys.begin(), keys.end(), g); TIMER_INIT(); -- cgit v1.2.3