From 7ccb9121733aafc5a54f6b847cf1ba91b2f4e110 Mon Sep 17 00:00:00 2001 From: Benjamin Buchfink Date: Wed, 22 Feb 2023 11:48:23 +0100 Subject: [PATCH] Fixed gcc 4.8 errors. --- src/ChangeLog | 4 ++-- src/align/align.cpp | 2 +- src/tools/greedy_vertex_cover.cpp | 18 ++++++++++-------- src/util/tsv/table.cpp | 2 +- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index ed9f87f4..8af28be7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,7 +1,7 @@ [2.1.3] -- Fixed a compiler error for GCC 4.8. +- Fixed compiler errors for GCC 4.8. - Fixed a GCC compiler error. -- Fixed a `segfault` issue occuring when compiled using GCC 12 on ARM64 systems. +- Fixed a segfault issue occuring when compiled using GCC 12 on ARM64 systems. - Fixed an issue that caused missing support for AVX2. [2.1.2] diff --git a/src/align/align.cpp b/src/align/align.cpp index f5f12b2e..37c1a439 100644 --- a/src/align/align.cpp +++ b/src/align/align.cpp @@ -315,7 +315,7 @@ void align_queries(Consumer* output_file, Search::Config& cfg) message_stream << "Warning: resident size (" << (res_size + last_size) << ") exceeds memory limit." << std::endl; timer.go("Sorting trace points"); - ips4o::parallel::sort(hit_buf->data(), hit_buf->data() + hit_buf->size(), std::less<>(), config.threads_); + ips4o::parallel::sort(hit_buf->begin(), hit_buf->end(), std::less(), config.threads_); statistics.inc(Statistics::TIME_SORT_SEED_HITS, timer.microseconds()); #ifndef OLD diff --git a/src/tools/greedy_vertex_cover.cpp b/src/tools/greedy_vertex_cover.cpp index eb8bfd5e..a8fd7034 100644 --- a/src/tools/greedy_vertex_cover.cpp +++ b/src/tools/greedy_vertex_cover.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "../util/tsv/tsv.h" #include "../util/tsv/file.h" #include "../basic/config.h" @@ -12,6 +13,7 @@ #include "../util/algo/algo.h" #include "../util/system/system.h" +using std::unique_ptr; using std::ofstream; using std::mutex; using std::lock_guard; @@ -132,23 +134,23 @@ void greedy_vertex_cover() { timer.go("Generating output"); int64_t c = 0; - ofstream centroid_out; + unique_ptr centroid_out; if (!config.centroid_out.empty()) - centroid_out = ofstream(config.centroid_out); - ofstream out; + centroid_out.reset(new ofstream(config.centroid_out)); + unique_ptr out; if (!config.output_file.empty()) - out = ofstream(config.output_file); + out.reset(new ofstream(config.output_file)); for (int64_t i = 0; i < (int64_t)r.size(); ++i) { if (r[i] == i) { ++c; if (!config.centroid_out.empty()) - centroid_out << acc[i] << endl; + *centroid_out << acc[i] << endl; } if (!config.output_file.empty()) - out << acc[r[i]] << '\t' << acc[i] << endl; + *out << acc[r[i]] << '\t' << acc[i] << endl; } - centroid_out.close(); - out.close(); + centroid_out->close(); + out->close(); timer.finish(); message_stream << "#Centroids: " << c << endl; } \ No newline at end of file diff --git a/src/util/tsv/table.cpp b/src/util/tsv/table.cpp index fc1f89a0..c9e52000 100644 --- a/src/util/tsv/table.cpp +++ b/src/util/tsv/table.cpp @@ -132,7 +132,7 @@ Table Table::sorted(int col, int threads) { v.reserve(size()); for (int64_t i = 0; i < size(); ++i) v.emplace_back(this->operator[](i).get(col), i); - ips4o::parallel::sort(v.begin(), v.end(), less<>(), threads); + ips4o::parallel::sort(v.begin(), v.end(), less>(), threads); return shuffle(transform(v.begin(), Second()), transform(v.end(), Second())); }