Skip to content

Commit

Permalink
Fixed gcc 4.8 errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
bbuchfink committed Feb 22, 2023
1 parent 08777b5 commit 7ccb912
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/ChangeLog
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
2 changes: 1 addition & 1 deletion src/align/align.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Search::Hit>(), config.threads_);
statistics.inc(Statistics::TIME_SORT_SEED_HITS, timer.microseconds());

#ifndef OLD
Expand Down
18 changes: 10 additions & 8 deletions src/tools/greedy_vertex_cover.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <atomic>
#include <mutex>
#include <unordered_map>
#include <memory>
#include "../util/tsv/tsv.h"
#include "../util/tsv/file.h"
#include "../basic/config.h"
Expand All @@ -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;
Expand Down Expand Up @@ -132,23 +134,23 @@ void greedy_vertex_cover() {

timer.go("Generating output");
int64_t c = 0;
ofstream centroid_out;
unique_ptr<ofstream> 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<ofstream> 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;
}
2 changes: 1 addition & 1 deletion src/util/tsv/table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int64_t>(col), i);
ips4o::parallel::sort(v.begin(), v.end(), less<>(), threads);
ips4o::parallel::sort(v.begin(), v.end(), less<pair<int64_t, int64_t>>(), threads);
return shuffle(transform(v.begin(), Second<int64_t, int64_t>()), transform(v.end(), Second<int64_t, int64_t>()));
}

Expand Down

0 comments on commit 7ccb912

Please sign in to comment.