From e8d72fc980b96c170a84ba1ea4427a552ce54968 Mon Sep 17 00:00:00 2001 From: Peter Debacker Date: Wed, 3 May 2023 07:35:41 +0200 Subject: [PATCH 1/2] find script needs to export ALL include dirs needed to parse sparta header files (#425) --- sparta/cmake/FindSparta.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sparta/cmake/FindSparta.cmake b/sparta/cmake/FindSparta.cmake index d73991704f..9ca051f955 100644 --- a/sparta/cmake/FindSparta.cmake +++ b/sparta/cmake/FindSparta.cmake @@ -66,8 +66,10 @@ if(NOT SPARTA_FOUND) set_property(TARGET SPARTA::libsimdb PROPERTY IMPORTED_LOCATION "${SPARTA_simdb_LIBRARY}") add_library(SPARTA::sparta INTERFACE IMPORTED) + # Workaround as per https://github.com/jbeder/yaml-cpp/issues/774#issuecomment-927357017 + get_target_property(YAML_CPP_INCLUDE_DIR yaml-cpp INTERFACE_INCLUDE_DIRECTORIES) set_property(TARGET SPARTA::sparta - PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${SPARTA_INCLUDE_DIRS} ${RAPIDJSON_INCLUDE_DIR} ${RapidJSON_INCLUDE_DIR}) + PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${SPARTA_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${SQLite3_INCLUDE_DIRS} ${HDF5_CXX_INCLUDE_DIRS} ${RAPIDJSON_INCLUDE_DIR} ${RapidJSON_INCLUDE_DIR} ${YAML_CPP_INCLUDE_DIR}) set_property(TARGET SPARTA::sparta PROPERTY INTERFACE_LINK_LIBRARIES SPARTA::libsparta SPARTA::libsimdb HDF5::HDF5 SQLite::SQLite3 Boost::filesystem Boost::serialization Boost::timer Boost::program_options From ee642fcb575f3dbe28d41f64007fd4134a8d0d29 Mon Sep 17 00:00:00 2001 From: Zhen Wei Date: Thu, 11 May 2023 10:24:03 +0800 Subject: [PATCH 2/2] Let user define strings in pevent collector (#427) --- sparta/sparta/pevents/PeventCollector.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sparta/sparta/pevents/PeventCollector.hpp b/sparta/sparta/pevents/PeventCollector.hpp index 5474645f35..54ebbdc807 100644 --- a/sparta/sparta/pevents/PeventCollector.hpp +++ b/sparta/sparta/pevents/PeventCollector.hpp @@ -32,6 +32,7 @@ namespace pevents{ class PeventCollector : public PairCollector, public PeventCollectorTreeNode { + protected: using PairCollector::getPEventLogVector; using PairCollector::turnOn_; using PairCollector::turnOff_; @@ -180,14 +181,14 @@ namespace pevents{ * \brief Override the generateCollectionString_() of the bases PairCollector, * In this method, we use the pair_cache owned by PairCache. */ - virtual void generateCollectionString_() override final + virtual void generateCollectionString_() override { // Write the pevent to the log. std::stringstream ss; // Write the event name. ss << "ev=" << "\"" << event_name_ << "\" "; - // Now write the chached key values. + // Now write the cached key values. for(const auto & pair : getPEventLogVector()) { ss << pair.first << "=" << "\"" << pair.second << "\" "; @@ -199,7 +200,7 @@ namespace pevents{ ss << ";"; message_src_ << ss.str(); } - private: + const std::string event_name_; // We are going to use sparta's logger to output our pevents for ease. log::MessageSource message_src_;