From d132a0f90eb4700b881623b51486a07a8e1c6eb6 Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Thu, 9 Nov 2023 14:52:50 +0100 Subject: [PATCH] Allow building with latest fmt --- cmake/CMakeLists.txt.in | 2 +- src/StfBuilder/StfBuilderDevice.cxx | 2 +- src/StfBuilder/StfBuilderDevice.h | 2 +- src/common/MemoryUtils.h | 8 ++++---- src/common/ReadoutDataModel.cxx | 4 ++-- src/common/SubTimeFrameDataModel.cxx | 2 +- src/common/base/Utilities.h | 2 ++ src/common/rpc/TfSchedulerRpcClient.cxx | 8 ++++---- 8 files changed, 16 insertions(+), 14 deletions(-) diff --git a/cmake/CMakeLists.txt.in b/cmake/CMakeLists.txt.in index bb444fd..8c79061 100644 --- a/cmake/CMakeLists.txt.in +++ b/cmake/CMakeLists.txt.in @@ -20,7 +20,7 @@ project(DataDistribution-3rdparties NONE) include(ExternalProject) ExternalProject_Add(spdlog GIT_REPOSITORY "https://github.com/gabime/spdlog.git" - GIT_TAG "v1.9.2" + GIT_TAG "v1.12.0" GIT_SHALLOW TRUE GIT_PROGRESS TRUE diff --git a/src/StfBuilder/StfBuilderDevice.cxx b/src/StfBuilder/StfBuilderDevice.cxx index 4ca4b30..e5ce2b6 100644 --- a/src/StfBuilder/StfBuilderDevice.cxx +++ b/src/StfBuilder/StfBuilderDevice.cxx @@ -225,7 +225,7 @@ void StfBuilderDevice::InitTask() ChangeStateOrThrow(fair::mq::Transition::ErrorFound); return; } else { - IDDLOG("READOUT INTERFACE: Configured RDHv{}", ReadoutDataUtils::sRdhVersion); + IDDLOG("READOUT INTERFACE: Configured RDHv{}", (int)ReadoutDataUtils::sRdhVersion); RDHReader::Initialize(unsigned(ReadoutDataUtils::sRdhVersion)); } diff --git a/src/StfBuilder/StfBuilderDevice.h b/src/StfBuilder/StfBuilderDevice.h index 927d901..67896e9 100644 --- a/src/StfBuilder/StfBuilderDevice.h +++ b/src/StfBuilder/StfBuilderDevice.h @@ -213,7 +213,7 @@ class StfBuilderDevice : public DataDistDevice } if (!(lNextStage >= eStfFileSinkIn && lNextStage <= eStfNullIn)) { - EDDLOG("Stage error! next_stage={}", lNextStage); + EDDLOG("Stage error! next_stage={}", (int)lNextStage); } assert(lNextStage >= eStfFileSinkIn && lNextStage <= eStfNullIn); diff --git a/src/common/MemoryUtils.h b/src/common/MemoryUtils.h index 16b9223..d1579dc 100644 --- a/src/common/MemoryUtils.h +++ b/src/common/MemoryUtils.h @@ -506,7 +506,7 @@ class RegionAllocatorResource if (mCanFail && !lRet) { WDDLOG_GRL(10000, "RegionAllocatorResource: Allocation failed. region={} alloc={} region_size={} free={}", - mSegmentName, pSize, mRegion->GetSize(), mFree); + mSegmentName, pSize, mRegion->GetSize(), mFree.load()); WDDLOG_GRL(10000, "Memory region '{}' is too small, or there is a large backpressure.", mSegmentName); return nullptr; } @@ -514,7 +514,7 @@ class RegionAllocatorResource while (true) { using namespace std::chrono_literals; WDDLOG_RL(1000, "RegionAllocatorResource: waiting to allocate a message. region={} alloc={} region_size={} free={}", - mSegmentName, pSize, mRegion->GetSize(), mFree); + mSegmentName, pSize, mRegion->GetSize(), mFree.load()); WDDLOG_RL(1000, "Memory region '{}' is too small, or there is a large backpressure.", mSegmentName); if (lGen != mGeneration.load()) { break; // retry alloc @@ -533,7 +533,7 @@ class RegionAllocatorResource mFree -= pSizeUp; assert (mFree >= 0); - DDDLOG_GRL(5000, "DataRegionResource {} memory free={} allocated={}", mSegmentName, mFree, (mSegmentSize - mFree)); + DDDLOG_GRL(5000, "DataRegionResource {} memory free={} allocated={}", mSegmentName, mFree.load(), (mSegmentSize - mFree.load())); // If the allocated message was aligned up, set a first byte after the buffer to 0 if (pSizeUp > pSize) { @@ -584,7 +584,7 @@ class RegionAllocatorResource if (mFreeRanges.empty()) { if (mFree != 0) { - EDDLOG_GRL(1000, "DataRegionResource {} try_reclaim({}): FREE MAP is empty! free={}", mSegmentName, pSize, mFree); + EDDLOG_GRL(1000, "DataRegionResource {} try_reclaim({}): FREE MAP is empty! free={}", mSegmentName, pSize, mFree.load()); } return false; } diff --git a/src/common/ReadoutDataModel.cxx b/src/common/ReadoutDataModel.cxx index a5524ef..8782b4f 100644 --- a/src/common/ReadoutDataModel.cxx +++ b/src/common/ReadoutDataModel.cxx @@ -47,7 +47,7 @@ ReadoutDataUtils::getDataOrigin(const RDHReader &R) return lOrig; } else { EDDLOG_ONCE("Data origin in RDH is invalid: {}. Please configure the correct SYSTEM_ID in the hardware." - " Using the configuration value {}.", R.getSystemID(), sSpecifiedDataOrigin.as()); + " Using the configuration value {}.", R.getSystemID(), sSpecifiedDataOrigin.template as()); } } @@ -66,7 +66,7 @@ ReadoutDataUtils::getSubSpecification(const RDHReader &R) } else if (ReadoutDataUtils::sRawDataSubspectype == eFeeId) { lSubSpec = R.getFeeID(); } else { - EDDLOG("Invalid SubSpecification method={}", ReadoutDataUtils::sRawDataSubspectype); + EDDLOG("Invalid SubSpecification method={}", (int)ReadoutDataUtils::sRawDataSubspectype); } return lSubSpec; diff --git a/src/common/SubTimeFrameDataModel.cxx b/src/common/SubTimeFrameDataModel.cxx index 9e8041c..ee00b9d 100644 --- a/src/common/SubTimeFrameDataModel.cxx +++ b/src/common/SubTimeFrameDataModel.cxx @@ -129,7 +129,7 @@ void SubTimeFrame::mergeStf(std::unique_ptr pStf, const std::strin // make sure header values match if (mHeader.mOrigin != pStf->header().mOrigin) { EDDLOG_RL(5000, "Merging STFs error: STF origins do not match origin={} new_origin={} new_stfs_id={}", - mHeader.mOrigin, pStf->header().mOrigin, mStfSenderId); + (int)mHeader.mOrigin, (int)pStf->header().mOrigin, mStfSenderId); } if (mHeader.mFirstOrbit != pStf->header().mFirstOrbit) { diff --git a/src/common/base/Utilities.h b/src/common/base/Utilities.h index 8673588..22c0fae 100644 --- a/src/common/base/Utilities.h +++ b/src/common/base/Utilities.h @@ -61,7 +61,9 @@ constexpr auto operator+(const T p) noexcept -> std::enable_if_t // create threads using a object method template std::thread create_thread_member(const char* name, F&& f, Args&&... args) { +#if defined(__linux__) char *lName = strdup(name); +#endif return std::thread([=]{ #if defined(__linux__) pthread_setname_np(pthread_self(), lName); diff --git a/src/common/rpc/TfSchedulerRpcClient.cxx b/src/common/rpc/TfSchedulerRpcClient.cxx index 2d3cedb..b05aa10 100644 --- a/src/common/rpc/TfSchedulerRpcClient.cxx +++ b/src/common/rpc/TfSchedulerRpcClient.cxx @@ -54,7 +54,7 @@ bool TfSchedulerRpcClient::HeartBeat(const BasicInfo &pInfo) { return false; } - EDDLOG_GRL(1000, "HeartBeat: gRPC request error. code={} message={}", lStatus.error_code(), lStatus.error_message()); + EDDLOG_GRL(1000, "HeartBeat: gRPC request error. code={} message={}", (int)lStatus.error_code(), lStatus.error_message()); } return false; @@ -87,7 +87,7 @@ bool TfSchedulerRpcClient::NumStfSendersInPartitionRequest(std::uint32_t &pNumSt continue; // retry } - EDDLOG_GRL(1000, "gRPC request error. code={} message={}", lStatus.error_code(), lStatus.error_message()); + EDDLOG_GRL(1000, "gRPC request error. code={} message={}", (int)lStatus.error_code(), lStatus.error_message()); break; } @@ -266,7 +266,7 @@ bool TfSchedulerRpcClient::TfBuilderUpdate(TfBuilderUpdateMessage &pMsg) { return true; } - DDDLOG_GRL(1000, "gRPC: TfBuilderUpdate error. code={} message={}", lStatus.error_code(), lStatus.error_message()); + DDDLOG_GRL(1000, "gRPC: TfBuilderUpdate error. code={} message={}", (int)lStatus.error_code(), lStatus.error_message()); return false; } @@ -288,7 +288,7 @@ bool TfSchedulerRpcClient::StfSenderStfUpdate(StfSenderStfInfo &pMsg, SchedulerS return true; } - EDDLOG_GRL(2000, "gRPC: StfSenderStfUpdate error. code={} message={}", lStatus.error_code(), lStatus.error_message()); + EDDLOG_GRL(2000, "gRPC: StfSenderStfUpdate error. code={} message={}", (int)lStatus.error_code(), lStatus.error_message()); return false; }