diff --git a/CMakeLists.txt b/CMakeLists.txt index 93042611..8336aeab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,6 +25,9 @@ message(STATUS include(CetCMakeEnv) cet_cmake_env() +# following art's approach, our CMake stuff is in `Modules` directory: +cet_cmake_module_directories(Modules BINARY) + cet_set_compiler_flags(DIAGS CAUTIOUS WERROR NO_UNDEFINED @@ -50,11 +53,13 @@ find_package( dk2nudata REQUIRED ) include(ArtDictionary) include(CetMake) include(BasicPlugin) +include(SBNutils) # add cet_find_library commands here when needed # ADD SOURCE CODE SUBDIRECTORIES HERE add_subdirectory(sbnobj) +add_subdirectory(Modules) # tests add_subdirectory(test) diff --git a/Modules/CMakeLists.txt b/Modules/CMakeLists.txt new file mode 100644 index 00000000..736f2bdd --- /dev/null +++ b/Modules/CMakeLists.txt @@ -0,0 +1,2 @@ +install(DIRECTORY ./ DESTINATION Modules + FILES_MATCHING PATTERN "*.cmake" PATTERN "[.#]*.cmake" EXCLUDE) diff --git a/Modules/SBNutils.cmake b/Modules/SBNutils.cmake new file mode 100644 index 00000000..e54e3306 --- /dev/null +++ b/Modules/SBNutils.cmake @@ -0,0 +1,98 @@ +# +# File: SBNmacros.cmake +# Purpose: Helpers for CMake actions in SBN. +# Author: Gianluca Petrillo (petrillo@slac.stanford.edu) +# Date: January 17, 2025 +# + +include_guard() + +cmake_minimum_required(VERSION 3.27 FATAL_ERROR) + +function(GetGITrepoName OutputVariableName) + # + # Gets the name of the current repository from the remote source `origin `URL. + # + # In case of failure from GIT call, the project name will be returned. + # + set(RepoDir ${CMAKE_CURRENT_SOURCE_DIR}) + + execute_process(COMMAND git -C "${RepoDir}" remote get-url origin + OUTPUT_VARIABLE GITrepoURL OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET RESULT_VARIABLE ErrorCode + ) + if(ErrorCode) + message(WARNING "Failed to retrieve GIT repository name for ${CMAKE_PROJECT_NAME} (error code ${ErrorCode})") + set(${OutputVariableName} "${CMAKE_PROJECT_NAME}") + else() + cmake_path(GET GITrepoURL STEM ${OutputVariableName}) + endif() + + return(PROPAGATE ${OutputVariableName}) + +endfunction(GetGITrepoName) + + +function(GetGITrepoVersion OutputVariableName) + # + # Gets the version/tag of the current branch in the current repository + # using `git describe`. + # + # In case of failure from GIT call, a error code will be returned in the + # variable. + # + set(RepoDir ${CMAKE_CURRENT_SOURCE_DIR}) + + execute_process(COMMAND git -C "${RepoDir}" describe --tags --dirty + OUTPUT_VARIABLE ${OutputVariableName} OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET RESULT_VARIABLE ErrorCode + ) + + if(ErrorCode) + set(${OutputVariableName} "n/a (GIT error code: ${ErrorCode})") + endif() + + return(PROPAGATE ${OutputVariableName}) + +endfunction(GetGITrepoVersion) + + +function(GenerateRepoVersionSource OutputPrefix) + # + # GenerateRepoVersionSource [OUTPUT_PREFIX prefix] + # * OUTPUT_PREFIX: prefix to the output variable names; default: ${CMAKE_PROJECT_NAME} + # + # Will generate a C++ header and source with the GIT repository describe + # string stored in a constant, using the `GITrepoVersion.{h,cxx}.in` template. + # The resulting code is written into ${CMAKE_CURRENT_BINARY_DIR} directory. + # In addition, it will set three variables: + # _GIT_REPO_NAME (typically matches the project name) + # _GIT_REPO_VERSION (GIT describe output) + # _GIT_REPO_VERSION_SOURCE (stem of the generated source code name); + # the actual files have the suffixes `.h` and `.cxx` + # + + if(NOT OutputPrefix) + set(OutputPrefix ${CMAKE_PROJECT_NAME}) + endif() + + if(OutputPrefix) + set(OutputPrefix "${OutputPrefix}_") + endif() + + # we could use `${CMAKE_PROJECT_NAME}`, provided that is up to date + GetGITrepoName(gitRepoName) + + GetGITrepoVersion(gitRepoVersion) + + set(gitRepoVersionSourceStem "RepositoryVersion_${gitRepoName}") + message(STATUS "GIT reported repository: ${gitRepoName} ${gitRepoVersion} (=> '${gitRepoVersionSourceStem}{.h,.cxx}')") + configure_file("GITrepoVersion.h.in" "${gitRepoVersionSourceStem}.h") + configure_file("GITrepoVersion.cxx.in" "${gitRepoVersionSourceStem}.cxx") + + # these are the output variables + set("${OutputPrefix}GIT_REPO_NAME" "${gitRepoName}" PARENT_SCOPE) + set("${OutputPrefix}GIT_REPO_VERSION" "${gitRepoVersion}" PARENT_SCOPE) + set("${OutputPrefix}GIT_REPO_VERSION_SOURCE" "${gitRepoVersionSourceStem}" PARENT_SCOPE) + +endfunction(GenerateRepoVersionSource) diff --git a/sbnobj/CMakeLists.txt b/sbnobj/CMakeLists.txt index 47c6517b..34c0b732 100644 --- a/sbnobj/CMakeLists.txt +++ b/sbnobj/CMakeLists.txt @@ -1,5 +1,6 @@ # basic source code CMakeLists.txt +add_subdirectory(Metadata) add_subdirectory(Common) add_subdirectory(ICARUS) add_subdirectory(SBND) diff --git a/sbnobj/Common/CMakeLists.txt b/sbnobj/Common/CMakeLists.txt index e44f4386..0d256ea1 100644 --- a/sbnobj/Common/CMakeLists.txt +++ b/sbnobj/Common/CMakeLists.txt @@ -7,3 +7,4 @@ add_subdirectory(SBNEventWeight) add_subdirectory(POTAccounting) add_subdirectory(EventGen) add_subdirectory(Trigger) +add_subdirectory(Metadata) diff --git a/sbnobj/Common/Metadata/CMakeLists.txt b/sbnobj/Common/Metadata/CMakeLists.txt new file mode 100644 index 00000000..c2b3c435 --- /dev/null +++ b/sbnobj/Common/Metadata/CMakeLists.txt @@ -0,0 +1,13 @@ +file(GLOB lib_srcs *.cxx details/*) +cet_make_library( + SOURCE + ${lib_srcs} + ) + +art_dictionary( + DICTIONARY_LIBRARIES + sbnobj::Common_Metadata + ) + +install_headers(SUBDIRS details) +install_source() diff --git a/sbnobj/Common/Metadata/JobEnvironmentInfo.cxx b/sbnobj/Common/Metadata/JobEnvironmentInfo.cxx new file mode 100644 index 00000000..c70b7f85 --- /dev/null +++ b/sbnobj/Common/Metadata/JobEnvironmentInfo.cxx @@ -0,0 +1,55 @@ +/** + * @file sbnobj/Common/Metadata/JobEnvironmentInfo.cxx + * @brief Information from the execution environment of the job. + * @author Gianluca Petrillo (petrillo@slac.stanford.edu) + * @date January 16, 2025 + * @see sbnobj/Common/Metadata/JobEnvironmentInfo.h + */ + +// library header +#include "sbnobj/Common/Metadata/JobEnvironmentInfo.h" + +// C/C++ standard libraries +#include +#include + + +// ----------------------------------------------------------------------------- +// --- sbn::JobEnvironmentInfo ----------------------------------------------- +// ----------------------------------------------------------------------------- +void sbn::JobEnvironmentInfo::dump(std::ostream& out) const { + + out << "Process name: '" << processName << "'"; + + out << "\n\nRelease of art framework: " << artVersion; + + out << "\n\nSource repository versions (" << sources.size() << ")\n" + << std::string(80, '-') << "\n\n"; + sources.dump(out); + + out << "\n\nEnvironment variables (" << variables.size() << ")\n" + << std::string(80, '-') << "\n\n"; + variables.dump(out); + +} // sbn::JobEnvironmentInfo::dump() + + +// ----------------------------------------------------------------------------- +std::string sbn::JobEnvironmentInfo::to_string() const { + + std::ostringstream sstr; + dump(sstr); + return sstr.str(); + +} + + +// ----------------------------------------------------------------------------- +// --- free functions -------------------------------------------------------- +// ----------------------------------------------------------------------------- +std::ostream& sbn::operator<< + (std::ostream& out, JobEnvironmentInfo const& info) + { info.dump(out); return out; } + + +// ----------------------------------------------------------------------------- diff --git a/sbnobj/Common/Metadata/JobEnvironmentInfo.h b/sbnobj/Common/Metadata/JobEnvironmentInfo.h new file mode 100644 index 00000000..2133f043 --- /dev/null +++ b/sbnobj/Common/Metadata/JobEnvironmentInfo.h @@ -0,0 +1,70 @@ +/** + * @file sbnobj/Common/Metadata/JobEnvironmentInfo.h + * @brief Information from the execution environment of the job. + * @author Gianluca Petrillo (petrillo@slac.stanford.edu) + * @date January 16, 2025 + * @see sbnobj/Common/Metadata/JobEnvironmentInfo.cxx + */ + + +#ifndef SBNOBJ_COMMON_METADATA_JOBENVIRONMENTINFO_H +#define SBNOBJ_COMMON_METADATA_JOBENVIRONMENTINFO_H + +// SBN libraries +#include "sbnobj/Common/Metadata/OrderedPairList.h" + +// C/C++ standard libraries +#include +#include +#include // std::pair +#include +#include // std::ostream + + +// ----------------------------------------------------------------------------- +namespace sbn { + struct JobEnvironmentInfo; + + /// Dump of a `JobEnvironmentInfo` object into a C++ output stream. + std::ostream& operator<< (std::ostream& out, JobEnvironmentInfo const& info); + +} + +// ----------------------------------------------------------------------------- +/** + * @brief Information from the execution environment of the job. + * + * Current information includes: + * * a complete snapshot of the environment variables (`getenv()`); + * * _art_ version; + * * a list of GIT tag for the package sources. + * + * Future extensions should include: + * * A list of packages recognised as SciSoft stack packages, their versions, + * qualifiers and paths. Probably not worth until build system is revamped. + * + */ +struct sbn::JobEnvironmentInfo { + + std::string processName; ///< Name of the _art_ process for the job. + + std::string artVersion; ///< Version of _art_. + + sbn::OrderedPairList sources; ///< Version of the source repositories. + + sbn::OrderedPairList variables; ///< Environment variables. + + + /// Dumps the entire content of the environment in human-readable form. + void dump(std::ostream& out) const; + + /// Returns the entire content of the environment in human-readable form. + std::string to_string() const; + +}; // sbn::JobEnvironmentInfo + + + +// ----------------------------------------------------------------------------- + +#endif // SBNOBJ_COMMON_METADATA_JOBENVIRONMENTINFO_H diff --git a/sbnobj/Common/Metadata/OrderedPairList.cxx b/sbnobj/Common/Metadata/OrderedPairList.cxx new file mode 100644 index 00000000..c72c9b9a --- /dev/null +++ b/sbnobj/Common/Metadata/OrderedPairList.cxx @@ -0,0 +1,106 @@ +/** + * @file sbnobj/Common/Metadata/OrderedPairList.cxx + * @brief Object holding a list of pairs. + * @author Gianluca Petrillo (petrillo@slac.stanford.edu) + * @date January 16, 2025 + * @see sbnobj/Common/Metadata/OrderedPairList.h + */ + +// library header +#include "sbnobj/Common/Metadata/OrderedPairList.h" + +// C/C++ standard libraries +#include // std::binary_search(), std::lower_bound() +#include +#include +#include // std::less +#include // std::true_type + + +// ----------------------------------------------------------------------------- +// --- sbn::OrderedPairList ------------------------------------------ +// ----------------------------------------------------------------------------- +bool sbn::OrderedPairList::contains(Key_t const& key) const noexcept { + + return std::binary_search(items.begin(), items.end(), key, ItemSorter{}); + +} + + +// ----------------------------------------------------------------------------- +auto sbn::OrderedPairList::getPtr(Key_t const& key) const -> Value_t const* { + + auto const it = findInsertionPoint(key); + return ((it == items.end()) || (std::get<0>(*it) != key)) + ? nullptr: &(std::get<1>(*it)); + +} + + +// ----------------------------------------------------------------------------- +auto sbn::OrderedPairList::get(Key_t const& key) const -> std::optional +{ + + Value_t const* ptr = getPtr(key); + return ptr? std::make_optional(*ptr): std::nullopt; + +} + + +// ----------------------------------------------------------------------------- +sbn::OrderedPairList& sbn::OrderedPairList::finish() { + + std::sort(items.begin(), items.end()); + + // remove duplicates + auto const itFirstDuplicate = std::unique(items.begin(), items.end()); + items.erase(itFirstDuplicate, items.end()); + + return *this; + +} // sbn::OrderedPairList::finish() + + +// ----------------------------------------------------------------------------- +bool sbn::OrderedPairList::insert(Key_t key, Value_t value) { + + auto const it = findInsertionPoint(key); + if ((it == items.end()) || (std::get<0>(*it) != key)) { // new key + items.emplace(it, std::move(key), std::move(value)); + return true; + } + else { + // using an index since the iterator is constant + items[std::distance(items.cbegin(), it)].second = std::move(value); + return false; + } + +} // sbn::OrderedPairList::insert() + + +// ----------------------------------------------------------------------------- +void sbn::OrderedPairList::dump(std::ostream& out) const { + + for (auto const& [ key, value ]: items) + out << key << " = " << value << "\n"; + +} // sbn::OrderedPairList::dump() + + +// ----------------------------------------------------------------------------- +auto sbn::OrderedPairList::findInsertionPoint(Key_t const& key) const + -> const_iterator +{ + return std::lower_bound(items.begin(), items.end(), key, ItemSorter{}); +} + + +// ----------------------------------------------------------------------------- +// --- free functions -------------------------------------------------------- +// ----------------------------------------------------------------------------- +std::ostream& sbn::operator<< + (std::ostream& out, OrderedPairList const& list) + { list.dump(out); return out; } + + +// ----------------------------------------------------------------------------- diff --git a/sbnobj/Common/Metadata/OrderedPairList.h b/sbnobj/Common/Metadata/OrderedPairList.h new file mode 100644 index 00000000..e458ee0d --- /dev/null +++ b/sbnobj/Common/Metadata/OrderedPairList.h @@ -0,0 +1,170 @@ +/** + * @file sbnobj/Common/Metadata/OrderedPairList.h + * @brief Information from the execution environment of the job. + * @author Gianluca Petrillo (petrillo@slac.stanford.edu) + * @date January 16, 2025 + * @see sbnobj/Common/Metadata/OrderedPairList.cxx + */ + + +#ifndef SBNOBJ_COMMON_METADATA_ORDEREDPAIRLIST_H +#define SBNOBJ_COMMON_METADATA_ORDEREDPAIRLIST_H + +// SBN libraries +#include "sbnobj/Common/Metadata/details/PairKeyComparer.h" + +// C/C++ standard libraries +#include +#include +#include // std::pair +#include +#include // std::ostream + + +// ----------------------------------------------------------------------------- +namespace sbn { + struct OrderedPairList; + + /// Dumps a `sbn::OrderedPairList` object into a C++ output stream. + std::ostream& operator<< + (std::ostream& out, OrderedPairList const& list); + +} + +// ----------------------------------------------------------------------------- +/** + * @brief Data object with a list of key-value pairs. + * + * This object is sort of a map (`std::map`), but with a simpler internal + * structure. It has lookup as fast as a `std::map`, but insertion is slow + * and not really supported by the interface. + * Keys are expected to be unique, although this is not enforced (i.e. duplicate + * keys yield undefined behaviour). + * + * The reason of this class is that its simpler structure makes it easier to be + * serialized. + * + * + * To fill the list, the suggested way is to add the pairs with + * `items.emplace_back()` and after insertion is over sort it with `finish()`. + * + */ +struct sbn::OrderedPairList { + + // maybe one day this will be a template. + using Key_t = std::string; ///< Type of the key. + using Value_t = std::string; ///< Type of the value. + + using Item_t = std::pair; ///< Type stored in the list. + using List_t = std::vector; ///< Implementation of the list./ + + using const_iterator = List_t::const_iterator; + using value_type = List_t::value_type; + using size_type = List_t::size_type; + + + /// Comparison functor ordering by key. + using ItemSorter = details::PairKeyComparer; + + /// All the variables: name -> value, lexicographically ordered by name. + List_t items; + + + // --- BEGIN --- Limited STL-like access ----------------------------------- + /// @name Limited STL-like access + /// @{ + + const_iterator begin() const noexcept { return items.begin(); } + + const_iterator end() const noexcept { return items.end(); } + + size_type size() const noexcept { return items.size(); } + + bool empty() const noexcept { return items.empty(); } + + + /// Returns whether there is an item with the specified `key`. + bool contains(Key_t const& key) const noexcept; + + /// @} + // --- END ----- Limited STL-like access ----------------------------------- + + + // --- BEGIN --- Access helpers -------------------------------------------- + /// @name Access helpers + /// @{ + + /// Returns a pointer to the value of the requested `key`, + /// or `nullptr` if none. + Value_t const* getPtr(Key_t const& key) const; + + /// Returns the value of the requested `key`, or `std::nullopt` if none. + std::optional get(Key_t const& key) const; + + /// Returns the value of the requested variable, or `defValue` if none. + std::string get(Key_t const& key, Value_t const& defValue) const + { return get(key).value_or(defValue); } + + /// @} + // --- END ----- Access helpers -------------------------------------------- + + + // --- BEGIN --- Writing helpers ------------------------------------------- + /** + * @name Writing helpers + * + * There are two main ways to write into this object: + * * bulk, for many entries at once: + * 1. add the entries directly with `items.emplace_back()` or equivalent; + * 2. sort the elements with `finish()`. + * * single entry: use `insert()` member function directly. + * + */ + /// @{ + + /// Makes sure the content is internally correctly organised. + /// @return this object + sbn::OrderedPairList& finish(); + + /** + * @brief Adds the specified key. + * @param key the key to insert + * @param value the value associated to that key + * @return whether the key was inserted anew (`false` if already present) + * + * The key is added to the `items`, in the correct place so that no `finish()` + * is needed afterwards. + * + * If the `key` is already present, its previous `value` is overwritten. + * + * If many keys need to be added at once, it is more efficient to add them + * directly to `items` (e.g. with `emplace_back()`) and then `finish()` the + * addition once for all. + */ + bool insert(Key_t key, Value_t value); + + /// @} + // --- END ----- Writing helpers ------------------------------------------- + + + /// Dumps the entire content of the list in human-readable form. + void dump(std::ostream& out) const; + + /// Returns the entire content of the list in human-readable form. + std::string to_string() const; + + + private: + + /// Returns the iterator to use with `insert()` to insert the specified `key`. + /// + /// If the key already exists, the iterator will point to it; otherwise it + /// will point to the element that would be next to `key`. + const_iterator findInsertionPoint(Key_t const& key) const; + +}; // sbn::OrderedPairList + + +// ----------------------------------------------------------------------------- + +#endif // SBNOBJ_COMMON_METADATA_ORDEREDPAIRLIST_H diff --git a/sbnobj/Common/Metadata/classes.h b/sbnobj/Common/Metadata/classes.h new file mode 100644 index 00000000..bd52c69b --- /dev/null +++ b/sbnobj/Common/Metadata/classes.h @@ -0,0 +1,12 @@ +#include "canvas/Persistency/Common/Wrapper.h" +#include "canvas/Persistency/Common/Ptr.h" + +#include "sbnobj/Common/Metadata/OrderedPairList.h" +#include "sbnobj/Common/Metadata/JobEnvironmentInfo.h" + +#include + +namespace { + sbn::OrderedPairList pairList; + sbn::JobEnvironmentInfo jobInfo; +} diff --git a/sbnobj/Common/Metadata/classes_def.xml b/sbnobj/Common/Metadata/classes_def.xml new file mode 100644 index 00000000..93eb7a15 --- /dev/null +++ b/sbnobj/Common/Metadata/classes_def.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sbnobj/Common/Metadata/details/PairKeyComparer.h b/sbnobj/Common/Metadata/details/PairKeyComparer.h new file mode 100644 index 00000000..5ffde676 --- /dev/null +++ b/sbnobj/Common/Metadata/details/PairKeyComparer.h @@ -0,0 +1,93 @@ +/** + * @file sbnobj/Common/Metadata/details/PairKeyComparer.h + * @brief Object holding a list of pairs. + * @author Gianluca Petrillo (petrillo@slac.stanford.edu) + * @date January 16, 2025 + * @see sbnobj/Common/Metadata/OrderedPairList.h + */ + +#ifndef SBNOBJ_COMMON_METADATA_DETAILS_PAIRKEYCOMPARER +#define SBNOBJ_COMMON_METADATA_DETAILS_PAIRKEYCOMPARER + + +// C/C++ standard libraries +#include // std::less +#include // std::get(), std::less, std::declval(), ... +#include // std::true_type, ... + + +// ----------------------------------------------------------------------------- +namespace sbn::details { + + /// Trait: `true` if `T` responds to `std::get<0>()`. + template + struct hasFirst; + + + /// Compares (`std::less`) two values via the first element of each. + struct PairKeyComparer; + + /* + * --- BEGIN --- Metaprogramming fury ---------------------------------------- + * + * The goal is to sort and match a list of pairs by their first element + * ("key"). + * + * Sorting itself does not require almost any art, since pairs sort by key + * first. Lookup by key only, in the other end, requires to deal with the + * second pair element. + * + * The idea here is to have a comparison operator that sorts pairs and keys, + * reacting to all combinations of `{ pair, key } < { pair, key }`. + * In this way algorithms like `std::binary_search()` can use `pair < key` to + * search for a specific key, without having to turn it into a pair (which + * would be problematic). + * + * So the following implementation is a trait that detects if an argument has + * a "first" element (responding to `std::get<0>()`) and a comparison object + * that detects via that traits when the arguments have a key, strips the rest + * and then performs the comparison. + */ + + template + struct hasFirst: std::false_type {}; + + template + struct hasFirst(std::declval()))>> + : std::true_type {}; + + template + constexpr bool hasFirst_v = hasFirst::value; + + + // --------------------------------------------------------------------------- + /// Compares (`std::less`) two values via the first element of each. + struct PairKeyComparer { + + /// Extracts the key of the argument. + template + static auto&& keyOf(T&& v) + { + if constexpr(hasFirst_v) return std::get<0>(std::forward(v)); + else return v; + } + + /// Returns whether `a`'s key is smaller than `b`'s. + template + static bool cmp(A const& a, B const& b) + { return std::less{}(keyOf(a), keyOf(b)); } + + /// Returns whether `a`'s key is smaller than `b`'s. + template + bool operator() (A const& a, B const& b) const + { return cmp(a, b); } + + }; // PairKeyComparer + + + // --------------------------------------------------------------------------- + +} // sbn::details + + +#endif // #define SBNOBJ_COMMON_METADATA_DETAILS_PAIRKEYCOMPARER diff --git a/sbnobj/Metadata/CMakeLists.txt b/sbnobj/Metadata/CMakeLists.txt new file mode 100644 index 00000000..93ab6253 --- /dev/null +++ b/sbnobj/Metadata/CMakeLists.txt @@ -0,0 +1,13 @@ +GenerateRepoVersionSource(${CMAKE_PROJECT_NAME}) + +message(DEBUG "Generated source file '${${CMAKE_PROJECT_NAME}_GIT_REPO_VERSION_SOURCE}.h'") + +cet_make_library( + SOURCE + "${${CMAKE_PROJECT_NAME}_GIT_REPO_VERSION_SOURCE}.h" + "${${CMAKE_PROJECT_NAME}_GIT_REPO_VERSION_SOURCE}.cxx" + ) + +install_headers(LIST "${CMAKE_CURRENT_BINARY_DIR}/${${CMAKE_PROJECT_NAME}_GIT_REPO_VERSION_SOURCE}.h") +install_source(LIST "${CMAKE_CURRENT_BINARY_DIR}/${${CMAKE_PROJECT_NAME}_GIT_REPO_VERSION_SOURCE}.cxx") + diff --git a/sbnobj/Metadata/GITrepoVersion.cxx.in b/sbnobj/Metadata/GITrepoVersion.cxx.in new file mode 100644 index 00000000..0d2a3515 --- /dev/null +++ b/sbnobj/Metadata/GITrepoVersion.cxx.in @@ -0,0 +1,16 @@ +/** + * @file ${gitRepoVersionSourceStem}.cxx + * @brief GIT version for repository `${gitRepoName}`. + * @author automatically generated; + * template: Gianluca Petrillo (petrillo@slac.stanford.edu) + * @date January 18, 2025 + * @see ${gitRepoVersionSourceStem}.h + */ + +#include "${gitRepoVersionSourceStem}.h" + +// ----------------------------------------------------------------------------- +const char RepositoryVersion_${gitRepoName}[] = "${gitRepoVersion}"; + + +// ----------------------------------------------------------------------------- diff --git a/sbnobj/Metadata/GITrepoVersion.h.in b/sbnobj/Metadata/GITrepoVersion.h.in new file mode 100644 index 00000000..a3210703 --- /dev/null +++ b/sbnobj/Metadata/GITrepoVersion.h.in @@ -0,0 +1,18 @@ +/** + * @file ${gitRepoVersionSourceStem}.h + * @brief GIT version for repository `${gitRepoName}`. + * @author automatically generated; + * template: Gianluca Petrillo (petrillo@slac.stanford.edu) + * @date January 18, 2025 + * @see ${gitRepoVersionSourceStem}.cxx + */ + +#ifndef ${gitRepoName}_${gitRepoVersionSourceStem}_H +#define ${gitRepoName}_${gitRepoVersionSourceStem}_H + + +/// Repository version for ${gitRepoName}. +extern const char RepositoryVersion_${gitRepoName}[]; + + +#endif // ${gitRepoName}_${gitRepoVersionSourceStem}_H diff --git a/ups/product_deps b/ups/product_deps index f8c72497..c54ecb58 100644 --- a/ups/product_deps +++ b/ups/product_deps @@ -246,7 +246,7 @@ defaultqual e26 # #################################### product version qual flags -lardataobj v09_19_00 - +lardataalg v09_17_07 - cetmodules v3_24_01 - only_for_build end_product_list #################################### @@ -302,11 +302,11 @@ end_product_list # case it is optional. # #################################### -qualifier lardataobj notes -c14:debug c14:debug -c14:prof c14:prof -e26:debug e26:debug -e26:prof e26:prof +qualifier lardataalg notes +c14:debug c14:debug +c14:prof c14:prof +e26:debug e26:debug +e26:prof e26:prof end_qualifier_list ####################################