From e584b266df174567cb2597e92d457a3c315a76aa Mon Sep 17 00:00:00 2001 From: Tony Butler Date: Thu, 1 Aug 2019 13:45:03 -0600 Subject: [PATCH] Build hwloc version string based on HWLOC_API_VERSION, whenever `hwlocVersion` object does not exist (<1.11.x) --- src/backend/cpu/platform/HwlocCpuInfo.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/backend/cpu/platform/HwlocCpuInfo.cpp b/src/backend/cpu/platform/HwlocCpuInfo.cpp index 23ee554f3..b2aa47d7c 100644 --- a/src/backend/cpu/platform/HwlocCpuInfo.cpp +++ b/src/backend/cpu/platform/HwlocCpuInfo.cpp @@ -167,7 +167,11 @@ xmrig::HwlocCpuInfo::HwlocCpuInfo() : BasicCpuInfo(), else # endif { - snprintf(m_backend, sizeof m_backend, "hwloc"); + snprintf(m_backend, sizeof m_backend, "hwloc/%d.%d.%d", + (HWLOC_API_VERSION>>16)&0x000000ff, + (HWLOC_API_VERSION>>8 )&0x000000ff, + (HWLOC_API_VERSION )&0x000000ff + ); } findCache(root, 2, 3, [this](hwloc_obj_t found) { this->m_cache[found->attr->cache.depth] += found->attr->cache.size; });