From 62d6c6fee53b34ee58f5699e94173bf7f24d2fcb Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Wed, 27 Mar 2024 10:33:18 -0600 Subject: [PATCH 01/59] SLICE: Refactor wall decomposition to use weights --- .../seacas/applications/slice/SL_Decompose.C | 73 ++++++++++++++----- .../seacas/applications/slice/SL_Decompose.h | 8 +- .../seacas/applications/slice/SL_Version.h | 4 +- packages/seacas/applications/slice/Slice.C | 27 +++++-- 4 files changed, 83 insertions(+), 29 deletions(-) diff --git a/packages/seacas/applications/slice/SL_Decompose.C b/packages/seacas/applications/slice/SL_Decompose.C index caf0356b26..3534de80b0 100644 --- a/packages/seacas/applications/slice/SL_Decompose.C +++ b/packages/seacas/applications/slice/SL_Decompose.C @@ -230,7 +230,8 @@ namespace { template void decompose_zoltan(const Ioss::Region ®ion, int ranks, SystemInterface &interFace, - std::vector &elem_to_proc, IOSS_MAYBE_UNUSED INT dummy) + std::vector &elem_to_proc, const std::vector &weights, + IOSS_MAYBE_UNUSED INT dummy) { if (ranks == 1) { return; @@ -247,7 +248,8 @@ namespace { // Copy mesh data and pointers into structure accessible from callback fns. Zoltan_Data.ndot = element_count; - Zoltan_Data.vwgt = nullptr; + Zoltan_Data.vwgt = const_cast(Data(weights)); + if (interFace.ignore_x_ && interFace.ignore_y_) { Zoltan_Data.x = Data(z); } @@ -297,6 +299,7 @@ namespace { zz.Set_Param("DEBUG_LEVEL", "0"); std::string str = fmt::format("{}", ranks); zz.Set_Param("NUM_GLOBAL_PARTS", str); + zz.Set_Param("OBJ_WEIGHT_DIM", "1"); zz.Set_Param("LB_METHOD", interFace.decomposition_method()); zz.Set_Param("NUM_LID_ENTRIES", "0"); zz.Set_Param("REMAP", "0"); @@ -554,14 +557,17 @@ namespace { } } // namespace -template void decompose_elements(const Ioss::Region ®ion, SystemInterface &interFace, - std::vector &elem_to_proc, IOSS_MAYBE_UNUSED int dummy); -template void decompose_elements(const Ioss::Region ®ion, SystemInterface &interFace, - std::vector &elem_to_proc, IOSS_MAYBE_UNUSED int64_t dummy); +template std::vector decompose_elements(const Ioss::Region ®ion, SystemInterface &interFace, + const std::vector &weights, + IOSS_MAYBE_UNUSED int dummy); +template std::vector decompose_elements(const Ioss::Region ®ion, SystemInterface &interFace, + const std::vector &weights, + IOSS_MAYBE_UNUSED int64_t dummy); template -void decompose_elements(const Ioss::Region ®ion, SystemInterface &interFace, - std::vector &elem_to_proc, IOSS_MAYBE_UNUSED INT dummy) +std::vector decompose_elements(const Ioss::Region ®ion, SystemInterface &interFace, + const std::vector &weights, + IOSS_MAYBE_UNUSED INT dummy) { progress(__func__); // Populate the 'elem_to_proc' vector with a mapping from element to processor. @@ -570,6 +576,7 @@ void decompose_elements(const Ioss::Region ®ion, SystemInterface &interFace, size_t elem_per_proc = element_count / interFace.processor_count(); size_t extra = element_count % interFace.processor_count(); + std::vector elem_to_proc; elem_to_proc.reserve(element_count); fmt::print(stderr, "\nDecomposing {} elements across {} processors using method '{}'.\n", @@ -625,7 +632,7 @@ void decompose_elements(const Ioss::Region ®ion, SystemInterface &interFace, else if (interFace.decomposition_method() == "rcb" || interFace.decomposition_method() == "rib" || interFace.decomposition_method() == "hsfc") { #if USE_ZOLTAN - decompose_zoltan(region, interFace.processor_count(), interFace, elem_to_proc, dummy); + decompose_zoltan(region, interFace.processor_count(), interFace, elem_to_proc, weights, dummy); #else fmt::print(stderr, "ERROR: Zoltan library not enabled in this version of slice.\n" " The 'rcb', 'rib', and 'hsfc' methods are not available.\n\n"); @@ -798,6 +805,39 @@ void decompose_elements(const Ioss::Region ®ion, SystemInterface &interFace, } assert(elem_to_proc.size() == element_count); + return elem_to_proc; +} + +template std::vector line_decomp_weights(const Ioss::chain_t &element_chains, size_t element_count); +template std::vector line_decomp_weights(const Ioss::chain_t &element_chains, size_t element_count); + +template + std::vector line_decomp_weights(const Ioss::chain_t &element_chains, size_t element_count) +{ + std::map> chains; + + for (size_t i = 0; i < element_chains.size(); i++) { + auto &chain_entry = element_chains[i]; + if (chain_entry.link >= 0) { + chains[chain_entry.element].push_back(i + 1); + } + } + + std::vector weights(element_count, 1); + // Now, for each chain... + for (auto &chain : chains) { + if ((debug_level & 16) != 0) { + fmt::print("Chain Root: {} contains: {}\n", chain.first, fmt::join(chain.second, ", ")); + } + // * Set the weights of all elements in the chain... + // * non-root = 0, root = length of chain. + const auto &chain_elements = chain.second; + for (const auto &element : chain_elements) { + weights[element - 1] = 0; + } + weights[chain.first-1] = static_cast(chain_elements.size()); + } + return weights; } template void line_decomp_modify(const Ioss::chain_t &element_chains, @@ -846,17 +886,14 @@ void line_decomp_modify(const Ioss::chain_t &element_chains, std::vector &element_chains, std::vector -void decompose_elements(const Ioss::Region ®ion, SystemInterface &interFace, - std::vector &elem_to_proc, IOSS_MAYBE_UNUSED INT dummy); +std::vector decompose_elements(const Ioss::Region ®ion, SystemInterface &interFace, + const std::vector &weights, + IOSS_MAYBE_UNUSED INT dummy); template void line_decomp_modify(const Ioss::chain_t &element_chains, std::vector &elem_to_proc, @@ -21,3 +22,6 @@ void line_decomp_modify(const Ioss::chain_t &element_chains, std::vector void output_decomposition_statistics(const std::vector &elem_to_proc, int proc_count, size_t number_elements); + +template +std::vector line_decomp_weights(const Ioss::chain_t &element_chains, size_t element_count); diff --git a/packages/seacas/applications/slice/SL_Version.h b/packages/seacas/applications/slice/SL_Version.h index cb5e6cb057..873ea5ab4a 100644 --- a/packages/seacas/applications/slice/SL_Version.h +++ b/packages/seacas/applications/slice/SL_Version.h @@ -9,6 +9,6 @@ static const std::array qainfo{ "slice", - "2023/09/14", - "2.1.05", + "2024/03/27", + "2.2.00", }; diff --git a/packages/seacas/applications/slice/Slice.C b/packages/seacas/applications/slice/Slice.C index 7f7a574a85..9b420b0435 100644 --- a/packages/seacas/applications/slice/Slice.C +++ b/packages/seacas/applications/slice/Slice.C @@ -1367,20 +1367,33 @@ namespace { Ioss::PropertyManager properties = set_properties(interFace); + Ioss::chain_t element_chains; + std::vector weights; + if (interFace.lineDecomp_) { + element_chains = + Ioss::generate_element_chains(region, interFace.lineSurfaceList_, debug_level, dummy); + progress("Ioss::generate_element_chains"); + + if (interFace.decomposition_method() == "rcb" || interFace.decomposition_method() == "rib" || + interFace.decomposition_method() == "hsfc") { + weights = line_decomp_weights(element_chains, region.get_property("element_count").get_int()); + progress("generate_element_weights"); + } + } + + if (weights.empty()) { + weights.resize(region.get_property("element_count").get_int(), 1); + } + double start = seacas_timer(); - std::vector elem_to_proc; - decompose_elements(region, interFace, elem_to_proc, dummy); + auto elem_to_proc = decompose_elements(region, interFace, weights, dummy); double end = seacas_timer(); fmt::print(stderr, "Decompose elements = {:.5}\n", end - start); progress("exit decompose_elements"); - Ioss::chain_t element_chains; if (interFace.lineDecomp_) { - element_chains = - Ioss::generate_element_chains(region, interFace.lineSurfaceList_, debug_level, dummy); - progress("Ioss::generate_element_chains"); + // Make sure all elements on a chain are on the same processor rank... line_decomp_modify(element_chains, elem_to_proc, interFace.processor_count()); - progress("line_decomp_modify"); } if (debug_level & 32) { From 861b1f195276ba6411707b60ff48b1382fee0da5 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Wed, 27 Mar 2024 10:34:58 -0600 Subject: [PATCH 02/59] SLICE: clang-format --- .../seacas/applications/slice/SL_Decompose.C | 29 ++++++++++--------- .../seacas/applications/slice/SL_Decompose.h | 6 ++-- packages/seacas/applications/slice/Slice.C | 17 ++++++----- 3 files changed, 27 insertions(+), 25 deletions(-) diff --git a/packages/seacas/applications/slice/SL_Decompose.C b/packages/seacas/applications/slice/SL_Decompose.C index 3534de80b0..70386f208a 100644 --- a/packages/seacas/applications/slice/SL_Decompose.C +++ b/packages/seacas/applications/slice/SL_Decompose.C @@ -230,8 +230,8 @@ namespace { template void decompose_zoltan(const Ioss::Region ®ion, int ranks, SystemInterface &interFace, - std::vector &elem_to_proc, const std::vector &weights, - IOSS_MAYBE_UNUSED INT dummy) + std::vector &elem_to_proc, const std::vector &weights, + IOSS_MAYBE_UNUSED INT dummy) { if (ranks == 1) { return; @@ -248,7 +248,7 @@ namespace { // Copy mesh data and pointers into structure accessible from callback fns. Zoltan_Data.ndot = element_count; - Zoltan_Data.vwgt = const_cast(Data(weights)); + Zoltan_Data.vwgt = const_cast(Data(weights)); if (interFace.ignore_x_ && interFace.ignore_y_) { Zoltan_Data.x = Data(z); @@ -558,16 +558,15 @@ namespace { } // namespace template std::vector decompose_elements(const Ioss::Region ®ion, SystemInterface &interFace, - const std::vector &weights, - IOSS_MAYBE_UNUSED int dummy); + const std::vector &weights, + IOSS_MAYBE_UNUSED int dummy); template std::vector decompose_elements(const Ioss::Region ®ion, SystemInterface &interFace, - const std::vector &weights, - IOSS_MAYBE_UNUSED int64_t dummy); + const std::vector &weights, + IOSS_MAYBE_UNUSED int64_t dummy); template std::vector decompose_elements(const Ioss::Region ®ion, SystemInterface &interFace, - const std::vector &weights, - IOSS_MAYBE_UNUSED INT dummy) + const std::vector &weights, IOSS_MAYBE_UNUSED INT dummy) { progress(__func__); // Populate the 'elem_to_proc' vector with a mapping from element to processor. @@ -808,11 +807,13 @@ std::vector decompose_elements(const Ioss::Region ®ion, SystemInterface return elem_to_proc; } -template std::vector line_decomp_weights(const Ioss::chain_t &element_chains, size_t element_count); -template std::vector line_decomp_weights(const Ioss::chain_t &element_chains, size_t element_count); +template std::vector line_decomp_weights(const Ioss::chain_t &element_chains, + size_t element_count); +template std::vector line_decomp_weights(const Ioss::chain_t &element_chains, + size_t element_count); template - std::vector line_decomp_weights(const Ioss::chain_t &element_chains, size_t element_count) +std::vector line_decomp_weights(const Ioss::chain_t &element_chains, size_t element_count) { std::map> chains; @@ -835,7 +836,7 @@ template for (const auto &element : chain_elements) { weights[element - 1] = 0; } - weights[chain.first-1] = static_cast(chain_elements.size()); + weights[chain.first - 1] = static_cast(chain_elements.size()); } return weights; } @@ -888,7 +889,7 @@ void line_decomp_modify(const Ioss::chain_t &element_chains, std::vector std::vector decompose_elements(const Ioss::Region ®ion, SystemInterface &interFace, - const std::vector &weights, - IOSS_MAYBE_UNUSED INT dummy); + const std::vector &weights, IOSS_MAYBE_UNUSED INT dummy); template void line_decomp_modify(const Ioss::chain_t &element_chains, std::vector &elem_to_proc, @@ -24,4 +23,5 @@ void output_decomposition_statistics(const std::vector &elem_to_proc, int p size_t number_elements); template -std::vector line_decomp_weights(const Ioss::chain_t &element_chains, size_t element_count); +std::vector line_decomp_weights(const Ioss::chain_t &element_chains, + size_t element_count); diff --git a/packages/seacas/applications/slice/Slice.C b/packages/seacas/applications/slice/Slice.C index 9b420b0435..ce92e300e6 100644 --- a/packages/seacas/applications/slice/Slice.C +++ b/packages/seacas/applications/slice/Slice.C @@ -1368,26 +1368,27 @@ namespace { Ioss::PropertyManager properties = set_properties(interFace); Ioss::chain_t element_chains; - std::vector weights; + std::vector weights; if (interFace.lineDecomp_) { element_chains = Ioss::generate_element_chains(region, interFace.lineSurfaceList_, debug_level, dummy); progress("Ioss::generate_element_chains"); if (interFace.decomposition_method() == "rcb" || interFace.decomposition_method() == "rib" || - interFace.decomposition_method() == "hsfc") { - weights = line_decomp_weights(element_chains, region.get_property("element_count").get_int()); - progress("generate_element_weights"); + interFace.decomposition_method() == "hsfc") { + weights = + line_decomp_weights(element_chains, region.get_property("element_count").get_int()); + progress("generate_element_weights"); } } if (weights.empty()) { weights.resize(region.get_property("element_count").get_int(), 1); } - - double start = seacas_timer(); - auto elem_to_proc = decompose_elements(region, interFace, weights, dummy); - double end = seacas_timer(); + + double start = seacas_timer(); + auto elem_to_proc = decompose_elements(region, interFace, weights, dummy); + double end = seacas_timer(); fmt::print(stderr, "Decompose elements = {:.5}\n", end - start); progress("exit decompose_elements"); From 61ac762936cf58ef0c2588f583564ecaf0b8e865 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Wed, 27 Mar 2024 11:42:41 -0600 Subject: [PATCH 03/59] EXODUS: Add extern to dummy symbols [ci skip] --- packages/seacas/libraries/exodus/src/ex_create_par.c | 4 ++-- packages/seacas/libraries/exodus/src/ex_open_par.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/seacas/libraries/exodus/src/ex_create_par.c b/packages/seacas/libraries/exodus/src/ex_create_par.c index 04821eb03c..597e989220 100644 --- a/packages/seacas/libraries/exodus/src/ex_create_par.c +++ b/packages/seacas/libraries/exodus/src/ex_create_par.c @@ -1,5 +1,5 @@ /* - * Copyright(C) 1999-2021, 2023 National Technology & Engineering Solutions + * Copyright(C) 1999-2021, 2023, 2024 National Technology & Engineering Solutions * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with * NTESS, the U.S. Government retains certain rights in this software. * @@ -240,5 +240,5 @@ int ex_create_par_int(const char *path, int cmode, int *comp_ws, int *io_ws, MPI * Prevent warning in some versions of ranlib(1) because the object * file has no symbols. */ -const char exodus_unused_symbol_dummy_ex_create_par; +extern const char exodus_unused_symbol_dummy_ex_create_par; #endif diff --git a/packages/seacas/libraries/exodus/src/ex_open_par.c b/packages/seacas/libraries/exodus/src/ex_open_par.c index 97afa4f0ca..b219bcc361 100644 --- a/packages/seacas/libraries/exodus/src/ex_open_par.c +++ b/packages/seacas/libraries/exodus/src/ex_open_par.c @@ -1,5 +1,5 @@ /* - * Copyright(C) 1999-2023 National Technology & Engineering Solutions + * Copyright(C) 1999-2024 National Technology & Engineering Solutions * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with * NTESS, the U.S. Government retains certain rights in this software. * @@ -487,5 +487,5 @@ int ex_open_par_int(const char *path, int mode, int *comp_ws, int *io_ws, float * Prevent warning in some versions of ranlib(1) because the object * file has no symbols. */ -const char exodus_unused_symbol_dummy_ex_open_par; +extern const char exodus_unused_symbol_dummy_ex_open_par; #endif From dcc6e528341c067be5127f38dadcc13e35c90199 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Wed, 27 Mar 2024 12:20:16 -0600 Subject: [PATCH 04/59] IOSS: Fix some parallel no-discard warnigns --- .../libraries/ioss/src/cgns/Iocgns_ParallelDatabaseIO.C | 2 +- .../libraries/ioss/src/exodus/Ioex_DecompositionData.C | 2 +- .../libraries/ioss/src/exodus/Ioex_DecompositionData.h | 2 +- .../libraries/ioss/src/exodus/Ioex_ParallelDatabaseIO.C | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/seacas/libraries/ioss/src/cgns/Iocgns_ParallelDatabaseIO.C b/packages/seacas/libraries/ioss/src/cgns/Iocgns_ParallelDatabaseIO.C index dd320cee89..16f4bdd027 100644 --- a/packages/seacas/libraries/ioss/src/cgns/Iocgns_ParallelDatabaseIO.C +++ b/packages/seacas/libraries/ioss/src/cgns/Iocgns_ParallelDatabaseIO.C @@ -1107,7 +1107,7 @@ namespace Iocgns { // Check for sequential node map. // If not, build the reverse G2L node map... - entity_map.is_sequential(true); + (void)entity_map.is_sequential(true); entity_map.build_reverse_map(); } else { diff --git a/packages/seacas/libraries/ioss/src/exodus/Ioex_DecompositionData.C b/packages/seacas/libraries/ioss/src/exodus/Ioex_DecompositionData.C index 4df31f5cbe..9c4c15d45f 100644 --- a/packages/seacas/libraries/ioss/src/exodus/Ioex_DecompositionData.C +++ b/packages/seacas/libraries/ioss/src/exodus/Ioex_DecompositionData.C @@ -2182,7 +2182,7 @@ namespace Ioex { load_field_data(filePtr, Data(fileData), blockSubsetIndex, step, blockFieldData, blockComponentCount, fileConnOffset); - decompData->m_decomposition.communicate_entity_data(Data(fileData), data, + (void)decompData->m_decomposition.communicate_entity_data(Data(fileData), data, decompData->el_blocks, blockSubsetIndex, fileConnOffset, blockComponentCount); } diff --git a/packages/seacas/libraries/ioss/src/exodus/Ioex_DecompositionData.h b/packages/seacas/libraries/ioss/src/exodus/Ioex_DecompositionData.h index b77c4491a6..5ad1e1e407 100644 --- a/packages/seacas/libraries/ioss/src/exodus/Ioex_DecompositionData.h +++ b/packages/seacas/libraries/ioss/src/exodus/Ioex_DecompositionData.h @@ -52,7 +52,7 @@ namespace Ioex { virtual ~DecompositionDataBase() = default; IOSS_NODISCARD virtual int int_size() const = 0; - IOSS_NODISCARD virtual void decompose_model(int filePtr) = 0; + virtual void decompose_model(int filePtr) = 0; IOSS_NODISCARD virtual size_t ioss_node_count() const = 0; IOSS_NODISCARD virtual size_t ioss_elem_count() const = 0; diff --git a/packages/seacas/libraries/ioss/src/exodus/Ioex_ParallelDatabaseIO.C b/packages/seacas/libraries/ioss/src/exodus/Ioex_ParallelDatabaseIO.C index c87993c6c0..b565b761af 100644 --- a/packages/seacas/libraries/ioss/src/exodus/Ioex_ParallelDatabaseIO.C +++ b/packages/seacas/libraries/ioss/src/exodus/Ioex_ParallelDatabaseIO.C @@ -813,8 +813,8 @@ namespace Ioex { add_region_fields(); if (!is_input() && open_create_behavior() == Ioss::DB_APPEND) { - get_map(EX_NODE_BLOCK); - get_map(EX_ELEM_BLOCK); + (void)get_map(EX_NODE_BLOCK); + (void)get_map(EX_ELEM_BLOCK); } } @@ -1074,7 +1074,7 @@ namespace Ioex { // Check for sequential node map. // If not, build the reverse G2L node map... - entity_map.is_sequential(true); + (void)entity_map.is_sequential(true); entity_map.build_reverse_map(); } else { From 8a4ad3da1ea3de0554e75798e092d87e7eae90e4 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Wed, 27 Mar 2024 12:46:41 -0600 Subject: [PATCH 05/59] Update to latest TriBITs --- cmake/tribits/CHANGELOG.md | 37 ++ cmake/tribits/README.DIRECTORY_CONTENTS.rst | 53 +- .../CDashAnalyzeReportRandomFailures.py | 344 ++++++++++++ .../ci_support/CDashQueryAnalyzeReport.py | 58 +- .../ci_support/TribitsDumpDepsXmlScript.cmake | 8 +- .../TribitsGetExtraReposForCheckinTest.cmake | 3 +- .../TribitsWriteXmlDependenciesFiles.cmake | 3 + .../ci_support/cdash_analyze_and_report.py | 4 + .../common_tpls/utils/ParseLibraryList.cmake | 2 +- .../TribitsCMakePolicies.cmake | 0 .../TribitsConstants.cmake | 2 +- .../core/config_tests/fmangle/CMakeLists.txt | 2 +- .../package_arch/TribitsAddExecutable.cmake | 4 +- .../TribitsAddExecutableAndTest.cmake | 3 +- .../core/package_arch/TribitsAddLibrary.cmake | 4 +- .../TribitsAdjustPackageEnables.cmake | 26 +- .../package_arch/TribitsConfigureTiming.cmake | 97 ++++ .../TribitsCopyFilesToBinaryDir.cmake | 1 - .../TribitsFindMostRecentFileTimestamp.cmake | 3 + .../package_arch/TribitsGeneralMacros.cmake | 56 -- .../package_arch/TribitsGlobalMacros.cmake | 423 ++------------ .../package_arch/TribitsInstallHeaders.cmake | 2 +- ...ribitsInternalPackageWriteConfigFile.cmake | 84 +-- .../TribitsPackageDefineDependencies.cmake | 92 ++-- .../TribitsPackageDependencies.cmake | 3 +- .../package_arch/TribitsPackageMacros.cmake | 5 +- .../TribitsPackagingSupport.cmake | 354 ++++++++++++ .../TribitsProcessEnabledTpls.cmake | 55 +- .../TribitsProcessPackagesAndDirsLists.cmake | 12 +- .../TribitsProcessTplsLists.cmake | 2 +- .../core/package_arch/TribitsProject.cmake | 2 +- .../package_arch/TribitsProjectImpl.cmake | 10 +- ...adAllProjectDepsFilesCreateDepsGraph.cmake | 3 +- .../TribitsReadDepsFilesCreateDepsGraph.cmake | 35 +- ...itsSystemDataStructuresMacrosFunctions.rst | 125 +++-- .../tribits_get_version_date.cmake | 2 +- .../TribitsAddAdvancedTest.cmake | 59 +- .../TribitsAddAdvancedTestHelpers.cmake | 2 +- .../TribitsAddExecutableTestHelpers.cmake | 13 +- .../TribitsAddTest.cmake | 9 +- .../TribitsAddTestHelpers.cmake | 30 +- .../TribitsSetTribitsPackageName.cmake | 55 ++ .../TribitsTestCategories.cmake | 8 +- .../tribits/core/utils/AppendGlobalSet.cmake | 4 +- .../tribits/core/utils/AppendStringVar.cmake | 8 +- .../core/utils/AppendStringVarWithSep.cmake | 2 +- cmake/tribits/core/utils/ConcatStrings.cmake | 2 +- .../core/utils/DriveAdvancedTest.cmake | 12 +- cmake/tribits/core/utils/MessageWrapper.cmake | 2 +- cmake/tribits/core/utils/TimingUtils.cmake | 2 +- .../core/utils/TribitsDeprecatedHelpers.cmake | 6 +- .../TribitsGitRepoVersionInfo.cmake | 119 +++- .../utils/TribitsParseArgumentsHelpers.cmake | 2 +- .../utils/TribitsSetCacheVarAndDefault.cmake | 89 +++ ...TribitsSortListAccordingToMasterList.cmake | 42 +- .../TribitsAddDashboardTarget.cmake | 2 +- .../ctest_driver/TribitsCTestDriverCore.cmake | 22 +- .../TribitsGetCTestTestXmlDir.cmake | 2 +- .../tribits_ctest_update_commands.cmake | 2 +- ...ribits_ctest_update_commands_wrapper.cmake | 2 +- .../build_ref/TribitsBuildReferenceBody.rst | 82 ++- cmake/tribits/doc/guides/.gitignore | 3 + .../guides/Makefile.common_generated_files | 1 + .../guides/TribitsCoreDetailedReference.rst | 16 + .../tribits/doc/guides/TribitsGuidesBody.rst | 514 ++++++++++++------ .../TribitsSystemMacroFunctionDocTemplate.rst | 3 +- .../guides/UtilsMacroFunctionDocTemplate.rst | 2 + cmake/tribits/doc/guides/generate-guide.sh | 30 +- cmake/tribits/doc/utils/gen_doc_utils.sh | 3 +- .../DependsOnLAPACK/cmake/Dependencies.cmake | 2 +- .../packages/epetra/cmake/Dependencies.cmake | 4 +- .../epetraext/cmake/Dependencies.cmake | 9 +- .../packages/teuchos/cmake/Dependencies.cmake | 4 +- .../TribitsExampleApp2/AppHelperFuncs.cmake | 5 +- .../simple_cxx/cmake/Dependencies.cmake | 4 +- .../packages/package1/CMakeLists.raw.cmake | 23 + .../package1/CMakeLists.tribits.cmake | 5 + .../packages/package1/CMakeLists.txt | 22 +- .../package1/cmake/Dependencies.cmake | 2 +- .../cmake/raw/DefineAllLibsTarget.cmake | 11 + .../cmake/raw/EnableTribitsTestSupport.cmake | 10 + ...GeneratePackageConfigFileForBuildDir.cmake | 13 + ...neratePackageConfigFileForInstallDir.cmake | 15 + .../cmake/raw/Package1Config.cmake.in | 3 + .../package1/src/CMakeLists.raw.cmake | 23 + .../package1/src/CMakeLists.tribits.cmake | 4 + .../packages/package1/src/CMakeLists.txt | 23 +- .../packages/package1/src/Package1_Prg.cpp | 6 +- .../package1/test/CMakeLists.raw.cmake | 19 + .../package1/test/CMakeLists.tribits.cmake | 14 + .../packages/package1/test/CMakeLists.txt | 17 +- .../package2/cmake/Dependencies.cmake | 2 +- .../package3/cmake/Dependencies.cmake | 6 +- cmake/tribits/python_utils/gitdist-setup.sh | 8 +- cmake/tribits/python_utils/gitdist.py | 73 ++- 95 files changed, 2345 insertions(+), 1051 deletions(-) create mode 100644 cmake/tribits/ci_support/CDashAnalyzeReportRandomFailures.py rename cmake/tribits/core/{package_arch => common}/TribitsCMakePolicies.cmake (100%) rename cmake/tribits/core/{package_arch => common}/TribitsConstants.cmake (98%) create mode 100644 cmake/tribits/core/package_arch/TribitsConfigureTiming.cmake create mode 100644 cmake/tribits/core/package_arch/TribitsPackagingSupport.cmake rename cmake/tribits/core/{package_arch => test_support}/TribitsAddAdvancedTest.cmake (97%) rename cmake/tribits/core/{package_arch => test_support}/TribitsAddAdvancedTestHelpers.cmake (98%) rename cmake/tribits/core/{package_arch => test_support}/TribitsAddExecutableTestHelpers.cmake (92%) rename cmake/tribits/core/{package_arch => test_support}/TribitsAddTest.cmake (99%) rename cmake/tribits/core/{package_arch => test_support}/TribitsAddTestHelpers.cmake (96%) create mode 100644 cmake/tribits/core/test_support/TribitsSetTribitsPackageName.cmake rename cmake/tribits/core/{package_arch => test_support}/TribitsTestCategories.cmake (94%) rename cmake/tribits/core/{package_arch => utils}/TribitsGitRepoVersionInfo.cmake (60%) create mode 100644 cmake/tribits/core/utils/TribitsSetCacheVarAndDefault.cmake rename cmake/tribits/core/{package_arch => utils}/TribitsSortListAccordingToMasterList.cmake (62%) create mode 100644 cmake/tribits/examples/TribitsExampleProject2/packages/package1/CMakeLists.raw.cmake create mode 100644 cmake/tribits/examples/TribitsExampleProject2/packages/package1/CMakeLists.tribits.cmake create mode 100644 cmake/tribits/examples/TribitsExampleProject2/packages/package1/cmake/raw/DefineAllLibsTarget.cmake create mode 100644 cmake/tribits/examples/TribitsExampleProject2/packages/package1/cmake/raw/EnableTribitsTestSupport.cmake create mode 100644 cmake/tribits/examples/TribitsExampleProject2/packages/package1/cmake/raw/GeneratePackageConfigFileForBuildDir.cmake create mode 100644 cmake/tribits/examples/TribitsExampleProject2/packages/package1/cmake/raw/GeneratePackageConfigFileForInstallDir.cmake create mode 100644 cmake/tribits/examples/TribitsExampleProject2/packages/package1/cmake/raw/Package1Config.cmake.in create mode 100644 cmake/tribits/examples/TribitsExampleProject2/packages/package1/src/CMakeLists.raw.cmake create mode 100644 cmake/tribits/examples/TribitsExampleProject2/packages/package1/src/CMakeLists.tribits.cmake create mode 100644 cmake/tribits/examples/TribitsExampleProject2/packages/package1/test/CMakeLists.raw.cmake create mode 100644 cmake/tribits/examples/TribitsExampleProject2/packages/package1/test/CMakeLists.tribits.cmake diff --git a/cmake/tribits/CHANGELOG.md b/cmake/tribits/CHANGELOG.md index 5a982fcfff..b3f1edd1ef 100644 --- a/cmake/tribits/CHANGELOG.md +++ b/cmake/tribits/CHANGELOG.md @@ -2,6 +2,43 @@ ChangeLog for TriBITS ---------------------------------------- +## 2023-06-22: + +* **Added:** Packages are now determined to be missing if their dependencies + file `/cmake/Dependencies.cmake` is missing. If the package + directory `` exists but the dependencies file is missing, the + package is determined to be missing but a warning is printed. (This expands + behavior to gracefully deal with a situation where a package source + directory is only partially removed, such as with `git rm -r `, + but the base directory still exists. Therefore, this allows the project to + gracefully configure with the package being considered missing and avoids a + fatal error in this case.) + +## 2023-06-02: + +* **Added/Deprecated:** External packages/TPLs can now be (and should be) + listed in the `[TEST|LIB]_[REQUIRED|OPTIONAL]_PACKAGES` arguments/lists in + the macro `tribits_package_define_dependencies()` and the + `[TEST|LIB]_[REQUIRED|OPTIONAL]_TPLS` arguments/lists are deprecated (but + with no deprecation warning yet). This makes it easier to write + `/cmake/Dependencies.cmake` files for packages where the set of + internal and external upstream dependent packages is dynamic and changes + depending on the TriBITS project where these package are configured under. + (And conceptually, a downstream package should not care if an upstream + dependent package is pulled in as an external package or built as an + internal package.) + +## 2023-05-03: + +* **Added:** Added support for non-fully TriBITS-compatible external packages. + Now, a `Config.cmake` file need not define + `::all_libs` targets for all of its upstream dependencies. The + updated macro `tribits_process_enabled_tpls()` will find any missing + upstream external packages/TPLs as needed (see updated documentation in the + section "TriBITS-Compliant External Packages" in the "TriBITS Users Guide" + and the section "Processing of external packages/TPLs and TriBITS-compliant + external packages" in the "TriBITS Maintainers Guide"). + ## 2023-02-24: * **Changed:** Upgraded minimum required CMake version from 3.17 to 3.23. diff --git a/cmake/tribits/README.DIRECTORY_CONTENTS.rst b/cmake/tribits/README.DIRECTORY_CONTENTS.rst index 80067d5a83..a0f3d8ab74 100644 --- a/cmake/tribits/README.DIRECTORY_CONTENTS.rst +++ b/cmake/tribits/README.DIRECTORY_CONTENTS.rst @@ -22,9 +22,10 @@ TriBITS refactorings of TriBITS. .. _TriBITS Core: -**core/**: Core TriBITS package-based architecture for CMake projects. This -only depends on raw CMake and contains just the minimal support for building, -testing, installing, and deployment. Only depends on CMake and nothing else. +**core/**: Core TriBITS test support and package-based architecture for CMake +projects. This only depends on raw CMake and contains just the minimal support +for building, testing, installing, and deployment. This CMake code depends +only on CMake and nothing else. **python_utils/**: Some basic Python utilities that are not specific to TriBITS but are used in TriBITS CI and testing support software. There are @@ -86,3 +87,49 @@ subdirectory. It supports the argument ``--components`` with values ``core``, * ``examples`` => (external tribits installation) * ``doc`` => ``core``, ``ci_support``, ``examples`` * ``devtools_install`` => ``python_utils`` + + +TriBITS Core Directory Contents +............................... + +The TriBITS ``core/`` directory is broken down into several subdirectories of +its own: + +**core/utils**: General CMake utilities that are not specific to the TriBITS +system and can be reused in any CMake project. + +**core/common**: As small set of common modules that the different TriBITS +Core module files in different directories depend on. These include things +like common TriBITS constants and TriBITS CMake policies. + +**core/test_support**: Modules that help define CTest tests using functions +like `tribits_add_test()`_ and `tribits_add_advanced_test()`_. These can be +used in CMake projects that are not full-blown TriBITS projects. + +**core/config_tests**: Some basic configure-time tests used by the TriBITS +package architecture framework. + +**core/std_tpls**: Some ``Find.cmake`` files for key external +dependencies handled as TriBITS TPLs but are more central to the TriBITS +system. (Examples include CUDA and MPI support.) + +**core/installation**: A collection of ``*.cmake.in`` and related Cmake code +supporting installations. + +**core/package_arch**: Modules for the full-blown TriBITS package architecture +framework including package dependency management, multi-repository support, +installations (including the generation of ``Config.cmake`` files), +etc. + +The dependencies between these different TriBITS `core` subdirectories are: + +* ``core/utils`` => (external CMake) +* ``core/common`` => ``core/utils`` +* ``core/test_support`` => ``core/utils``, ``core/common`` +* ``core/config_tests`` => (external CMake) +* ``core/std_tpls`` => (external CMake) +* ``core/installation`` <=> ``core/package_arch`` (bidirectional) +* ``core/package_arch`` => ``core/utils``, ``core/common``, + ``core/test_support``, ``core/config_tests``, ``core/std_tpls``, + ``core/installation`` + diff --git a/cmake/tribits/ci_support/CDashAnalyzeReportRandomFailures.py b/cmake/tribits/ci_support/CDashAnalyzeReportRandomFailures.py new file mode 100644 index 0000000000..d869e48721 --- /dev/null +++ b/cmake/tribits/ci_support/CDashAnalyzeReportRandomFailures.py @@ -0,0 +1,344 @@ + +import os +import argparse +import datetime + +from FindGeneralScriptSupport import * +import CDashQueryAnalyzeReport as CDQAR +import cdash_build_testing_date as CBTD + + +class CDashAnalyzeReportRandomFailuresDriver: + + def __init__(self, versionInfoStrategy, extractBuildNameStrategy, + usageHelp=""): + self.versionInfoStrategy = versionInfoStrategy + self.extractBuildNameStrategy = extractBuildNameStrategy + self.args = None + self.usageHelp = usageHelp + + def runDriver(self): + + self.getCmndLineArgs() + + cdashProjectTestingDayStartTime = self.args.cdash_testing_day_start_time + cdashSiteUrl = self.args.cdash_site_url + cdashProjectName = self.args.cdash_project_name + initialNonpassingTestFilters = self.args.initial_nonpassing_test_filters + date = self.args.reference_date + groupName = self.args.group_name + daysOfHistory = self.args.days_of_history + printUrlMode = self.args.print_url_mode + writeEmailToFile = self.args.write_email_to_file + sendEmailFrom = self.args.send_email_from + sendEmailTo = self.args.send_email_to + emailSubjectPrefix = self.args.email_subject_prefix + + randomFailureSummaries = [] + + # A.1) Set up date range and directories + + # Construct date range for queryTests filter string + referenceDateDT = CDQAR.convertInputDateArgToYYYYMMDD( + cdashProjectTestingDayStartTime, date) + dateRangeStart, dateRangeEnd = self.getDateRangeTuple(referenceDateDT, daysOfHistory) + dateUrlField = "begin="+dateRangeStart+"&end="+dateRangeEnd + dateRangeStr = dateRangeStart+" to "+dateRangeEnd + + testQueriesCacheDir = os.getcwd()+"/test_queries_cache" + testHistoryCacheDir = testQueriesCacheDir+"/test_history_cache" + createDirsFromPath(testQueriesCacheDir) + createDirsFromPath(testHistoryCacheDir) + + # Construct queryTest.php filter for a date range + initialNonpassingTestQueryFilters = \ + dateUrlField+"&"+initialNonpassingTestFilters + + # A.2) Create starting email body and html string aggregation var + + cdashReportData = CDQAR.CDashReportData() + + cdashReportData.htmlEmailBodyTop += \ + "

Random test failure scan results for "+cdashProjectName\ + +" from "+dateRangeStr+"

\n\n" + + + # B.1) Get all failing test result for past daysOfHistory + + # Beginning of scanned details and links paragraph + cdashReportData.htmlEmailBodyTop +="

\n" + + print("\nGetting list of initial nonpassing tests from CDash from "+dateRangeStr) + + initialNonpassingTestsQueryUrl = CDQAR.getCDashQueryTestsQueryUrl( + cdashSiteUrl, cdashProjectName, None, initialNonpassingTestQueryFilters) + initialNonpassingTestBrowserUrl = CDQAR.getCDashQueryTestsBrowserUrl( + cdashSiteUrl, cdashProjectName, None, initialNonpassingTestQueryFilters) + + if printUrlMode == 'initial' or printUrlMode == 'all': + print("\nCDash nonpassing tests browser URL:\n\n"+\ + " "+initialNonpassingTestBrowserUrl+"\n") + print("\nCDash nonpassing tests query URL:\n\n"+\ + " "+initialNonpassingTestsQueryUrl+"\n") + + initialNonpassingTestsQueryCacheFile = testQueriesCacheDir +\ + "/initialCDashNonPassingTests_"+dateRangeStart+"_"+dateRangeEnd+".json" + + # List of dictionaries containing the cdash results in rows + initialNonpassingTestsLOD = CDQAR.downloadTestsOffCDashQueryTestsAndFlatten( + initialNonpassingTestsQueryUrl, initialNonpassingTestsQueryCacheFile,\ + alwaysUseCacheFileIfExists=True) + + cdashReportData.htmlEmailBodyTop += \ + "" +\ + "Nonpassing tests scanned on CDash=" +\ + str(len(initialNonpassingTestsLOD))+"
\n" + + # Ending of scanned details and links paragraph + # and start of scanning summaries and table + cdashReportData.htmlEmailBodyTop +="

\n\n

\n" + + # B.2) Get each nonpassing test's testing history + for nonpassingTest in initialNonpassingTestsLOD: + + # Remove unique jenkins run ID from build name + correctedBuildName = self.extractBuildNameStrategy.getCoreBuildName(nonpassingTest['buildName']) + + testNameBuildName = nonpassingTest['testname']+"_"+nonpassingTest['buildName'] + testNameBuildName = CDQAR.getCompressedFileNameIfTooLong(testNameBuildName) + + print("\n Getting history from "+dateRangeStr+" for\n"+\ + " Test name: "+nonpassingTest['testname']+"\n"+\ + " Build name: "+correctedBuildName) + + groupNameNormUrl, = CDQAR.normalizeUrlStrings(groupName) + + testHistoryFilters = \ + "filtercount=3&showfilters=1&filtercombine=and"+\ + "&field1=testname&compare1=63&value1="+nonpassingTest['testname']+\ + "&field2=groupname&compare2=63&value2="+groupNameNormUrl+\ + "&field3=buildname&compare3=63&value3="+correctedBuildName + + testHistoryQueryFilters = dateUrlField+"&"+testHistoryFilters + + testHistoryCacheFile = testHistoryCacheDir+"/"+\ + CDQAR.getCompressedFileNameIfTooLong(testNameBuildName+".json", ext=".json") + + print("\n Creating file to write test history:\n "+testHistoryCacheFile) + + testHistoryQueryUrl = CDQAR.getCDashQueryTestsQueryUrl( + cdashSiteUrl, cdashProjectName, None, testHistoryQueryFilters) + testHistoryBrowserUrl = CDQAR.getCDashQueryTestsBrowserUrl( + cdashSiteUrl, cdashProjectName, None, testHistoryQueryFilters) + + testHistoryLOD = CDQAR.downloadTestsOffCDashQueryTestsAndFlatten( + testHistoryQueryUrl, testHistoryCacheFile, alwaysUseCacheFileIfExists=True) + + print("\n Size of test history: "+str(len(testHistoryLOD))) + + if printUrlMode == 'all': + print("\n CDash test history browser URL for "+nonpassingTest['testname']+" "+\ + correctedBuildName+":\n\n"+" "+testHistoryBrowserUrl) + print("\n CDash test history query URL for "+nonpassingTest['testname']+" "+\ + correctedBuildName+":\n\n"+" "+testHistoryQueryUrl) + + if len(testHistoryLOD) < 2: + print("\n Size of test history too small for any comparisons, skipping ...\n") + continue + + # B.3) Split full testing history to passed and nonpassed lists of dicts + passingTestHistoryLOD = [test for test in testHistoryLOD if test.get("status") == "Passed"] + nonpassingTestHistoryLOD = [test for test in testHistoryLOD if test.get("status") == "Failed"] + nonpassingSha1Pairs = set() + + print("\n Num of passing tests in test history: "+str(len(passingTestHistoryLOD))) + print("\n Num of nonpassing tests in test history: "+str(len(nonpassingTestHistoryLOD))) + + buildSummaryCacheDir = testQueriesCacheDir+"/build_summary_cache/"+testNameBuildName + createDirsFromPath(buildSummaryCacheDir) + # NOTE: There is an argument to be made that test histories should get their own directory + # instead of build summaries and that build summaries should live inside of there + + # C.1) Get all nonpassing tests' sha1s into a set + for test in nonpassingTestHistoryLOD: + + buildId = self.getBuildIdFromTest(test) + + buildSummaryCacheFile = buildSummaryCacheDir+"/"+buildId + buildSummaryQueryUrl = CDQAR.getCDashBuildSummaryQueryUrl(cdashSiteUrl, buildId) + buildConfigOutput = self.downloadBuildSummaryOffCDash( + buildSummaryQueryUrl, buildSummaryCacheFile, verbose=printUrlMode =='all', + alwaysUseCacheFileIfExists=True)['configure']['output'] + + nonpassingSha1Pairs.add( + self.versionInfoStrategy.getTargetTopicSha1s(buildConfigOutput)) + + print("\n Test history failing sha1s: "+str(nonpassingSha1Pairs)) + + # C.2) Check if passing tests' sha1s exist in nonpassing sha1s set + for test in passingTestHistoryLOD: + + buildId = self.getBuildIdFromTest(test) + + buildSummaryCacheFile = buildSummaryCacheDir+"/"+buildId + buildSummaryQueryUrl = CDQAR.getCDashBuildSummaryQueryUrl(cdashSiteUrl, buildId) + buildConfigOutput = self.downloadBuildSummaryOffCDash( + buildSummaryQueryUrl, buildSummaryCacheFile, verbose=printUrlMode =='all', + alwaysUseCacheFileIfExists=True)['configure']['output'] + + passingSha1Pair = \ + self.versionInfoStrategy.getTargetTopicSha1s(buildConfigOutput) + + if self.versionInfoStrategy.checkTargetTopicRandomFailure(passingSha1Pair, nonpassingSha1Pairs): + print("\n Found passing sha1 pair, " + str(passingSha1Pair)+\ + " in set of nonpassing sha1 pairs: \n"+str(nonpassingSha1Pairs)) + + randomFailureSummaries.append( + RandomFailureSummary(test['buildName'], test['testname'], + testHistoryBrowserUrl, passingSha1Pair)) + + + print("\n*** CDash random failure analysis for " +\ + cdashProjectName+" "+groupName+" from " +dateRangeStr) + + print("Total number of initial failing tests: "+str(len(initialNonpassingTestsLOD))+"\n") + + print("Found random failing tests: "+str(len(randomFailureSummaries))+"\n") + + cdashReportData.htmlEmailBodyTop += \ + "Found random failing tests: "+str(len(randomFailureSummaries))+"
\n" + + if len(randomFailureSummaries) > 0: + cdashReportData.globalPass = False + + # Add number of random failing tests 'rft' found to summary data list + cdashReportData.summaryLineDataNumbersList.append( + "rft="+str(len(randomFailureSummaries))) + + # Add number of initial failing tests 'ift' scanned to summary + # data list + cdashReportData.summaryLineDataNumbersList.append( + "ift="+str(len(initialNonpassingTestsLOD))) + + for summary in randomFailureSummaries: + print(str(summary)) + summary.singleSummaryReporter(cdashReportData) + + summaryLine = CDQAR.getOverallCDashReportSummaryLine( + cdashReportData, cdashProjectName+" "+groupName, dateRangeStr) + print("\n"+summaryLine) + + # Finish HTML body paragraph + cdashReportData.htmlEmailBodyTop += "\n

" + + defaultPageStyle = CDQAR.getDefaultHtmlPageStyleStr() + subjectLine = emailSubjectPrefix+summaryLine + + if writeEmailToFile: + print("\nWriting HTML to file: "+writeEmailToFile+" ...") + htmlStr = CDQAR.getFullCDashHtmlReportPageStr(cdashReportData, + pageTitle=subjectLine, pageStyle=defaultPageStyle) + # print(htmlStr) + with open(writeEmailToFile, 'w') as outFile: + outFile.write(htmlStr) + + if sendEmailTo: + htmlStr = CDQAR.getFullCDashHtmlReportPageStr(cdashReportData, + pageStyle=defaultPageStyle) + for emailAddress in sendEmailTo.split(','): + emailAddress = emailAddress.strip() + print("\nSending email to '"+emailAddress+"' ...") + msg=CDQAR.createHtmlMimeEmail( + sendEmailFrom, emailAddress, subjectLine, "", htmlStr) + CDQAR.sendMineEmail(msg) + + def getCmndLineArgs(self): + parser = argparse.ArgumentParser(description=self.usageHelp) + + parser.add_argument("--cdash-site-url", default="", required=True, + help="Base CDash site (e.g. 'https://testing.sandia.gov/cdash')."+\ + " [REQUIRED]") + parser.add_argument("--cdash-project-name", default="", required=True, + help="CDash project name (e.g. TriBITS)."+\ + " [REQUIRED]") + parser.add_argument("--initial-nonpassing-test-filters", default="", required=True, + help="Partial URL fragment containing CDash filters for the initial set"+\ + " of nonpassing tests (e.g. 'filtercount=2&showfilters=1&filtercombine=and&field1=status&compare1=63&"+\ + "value1=Failed&field2=groupname&compare2=63&value2=Pull%%20Request')."+\ + " [REQUIRED]") + parser.add_argument("--group-name", default="", required=True, + help="Name of the build group index for filtering a set of test (e.g. 'Pull Request')."+\ + " [REQUIRED]") + parser.add_argument("--cdash-testing-day-start-time", default="00:00", + help="CDash project's testing day start time in UTC format ':'."+\ + " [default='00:00']") + parser.add_argument("--reference-date", default="yesterday", + help="Starting reference date for querying failing tests as or"+\ + " special values 'today' or 'yesterday.'"+\ + " [default='yesterday']") + parser.add_argument("--days-of-history", default=1, type=int, + help="Number of days of testing history to query starting from the reference and going"+\ + " backwards in time."+\ + " [default=1]") + parser.add_argument("--print-url-mode", choices=['none','initial','all'], default='none', + help="Mode of url printing."+\ + " [default=none]") + parser.add_argument("--write-email-to-file", default="", + help="Name of file to write built email HTML to."+\ + " [default='']") + parser.add_argument("--send-email-to", default="", + help="Target email address to send script summary results to."+\ + " [default='']") + parser.add_argument("--send-email-from", default="random-failure-script@noreply.org", + help="Addressed sender of the script summary results email."+\ + " [default='random-failure-script@noreply.org']") + parser.add_argument("--email-subject-prefix", default="", + help="Prefix string added to the email subject line."+\ + " [default='']") + + self.args = parser.parse_args() + + def getDateRangeTuple(self, referenceDateTime, dayTimeDelta): + beginDateTime = referenceDateTime - datetime.timedelta(days=(dayTimeDelta-1)) + beginDateTimeStr = CBTD.getDateStrFromDateTime(beginDateTime) + endDateTimeStr = CBTD.getDateStrFromDateTime(referenceDateTime) + return (beginDateTimeStr, endDateTimeStr) + + def getBuildIdFromTest(self, test): + return test['buildSummaryLink'].split("/")[-1] + + def downloadBuildSummaryOffCDash(self, + cdashBuildSummaryQueryUrl, buildSummaryCacheFile=None, + useCachedCDashData=False, alwaysUseCacheFileIfExists=False, + verbose='False' + ): + verbose = verbose == 'all' + buildSummaryJson = CDQAR.getAndCacheCDashQueryDataOrReadFromCache( + cdashBuildSummaryQueryUrl, buildSummaryCacheFile, useCachedCDashData, + alwaysUseCacheFileIfExists, verbose) + return buildSummaryJson + + +class RandomFailureSummary(object): + + def __init__(self, buildName, testName, testHistoryUrl, sha1Pair): + self.buildName = buildName + self.testName = testName + self.testHistoryUrl = testHistoryUrl + self.sha1Pair = sha1Pair + + def __str__(self): + myStr = "Test name: "+self.testName +\ + "\nBuild name: "+self.buildName +\ + "\nIdentical sha1 pairs: "+str(self.sha1Pair) +\ + "\nTest history browser URL: " +\ + "\n "+self.testHistoryUrl+"\n" + return myStr + + def singleSummaryReporter(self, cdashReportData): + cdashReportData.htmlEmailBodyTop += \ + "\n
Build name: "+ self.buildName +\ + "\n
Test name: "+ self.testName +\ + "\n
Test history URL: Link" +\ + "\n
Sha1 Pair : "+ str(self.sha1Pair) + diff --git a/cmake/tribits/ci_support/CDashQueryAnalyzeReport.py b/cmake/tribits/ci_support/CDashQueryAnalyzeReport.py index 157866a1b8..c5cc46b7e3 100644 --- a/cmake/tribits/ci_support/CDashQueryAnalyzeReport.py +++ b/cmake/tribits/ci_support/CDashQueryAnalyzeReport.py @@ -40,9 +40,11 @@ try: # Python 2 from urllib2 import urlopen + from urllib2 import quote as urlquote except ImportError: # Python 3 from urllib.request import urlopen + from urllib.parse import quote as urlquote import sys import hashlib @@ -716,46 +718,60 @@ def getAndCacheCDashQueryDataOrReadFromCache( return cdashQueryData +def normalizeUrlStrings(*args): + return [urlquote(x) for x in args] + + # Construct full cdash/api/v1/index.php query URL to pull data down given the # pieces def getCDashIndexQueryUrl(cdashUrl, projectName, date, filterFields): + # for legacy reasons, this function assumes we normalized projectName + projectName, = normalizeUrlStrings(projectName,) if date: dateArg = "&date="+date else: dateArg = "" return cdashUrl+"/api/v1/index.php?project="+projectName+dateArg \ - + "&"+filterFields + + "&"+filterFields # Construct full cdash/index.php browser URL given the pieces def getCDashIndexBrowserUrl(cdashUrl, projectName, date, filterFields): + # for legacy reasons, this function assumes we normalized projectName + projectName, = normalizeUrlStrings(projectName,) if date: dateArg = "&date="+date else: dateArg = "" return cdashUrl+"/index.php?project="+projectName+dateArg \ - + "&"+filterFields + + "&"+filterFields # Construct full cdash/api/v1/queryTests.php query URL given the pieces def getCDashQueryTestsQueryUrl(cdashUrl, projectName, date, filterFields): + # for legacy reasons, this function assumes we normalized projectName + projectName, = normalizeUrlStrings(projectName,) if date: dateArg = "&date="+date else: dateArg = "" cdashTestUrl = cdashUrl+"/api/v1/queryTests.php?project="+projectName+dateArg+"&"+filterFields - return replaceNonUrlCharsInUrl(cdashTestUrl) - - -# Replace non-URL chars and return new URL string -def replaceNonUrlCharsInUrl(url): - urlNew = url - urlNew = urlNew.replace(' ', '%20') - # ToDo: Replace other chars as needed - return urlNew + return cdashTestUrl # Construct full cdash/queryTests.php browser URL given the pieces def getCDashQueryTestsBrowserUrl(cdashUrl, projectName, date, filterFields): + # for legacy reasons, this function assumes we normalized projectName + projectName, = normalizeUrlStrings(projectName,) if date: dateArg = "&date="+date else: dateArg = "" return cdashUrl+"/queryTests.php?project="+projectName+dateArg+"&"+filterFields +# Construct full cdash/api/v1/buildSummary.php query URL given the buildId +def getCDashBuildSummaryQueryUrl(cdashUrl, buildId): + return cdashUrl+"/api/v1/buildSummary.php?buildid="+buildId + + +# Construct full cdash/build browser URL given the buildId +def getCDashBuildSummaryBrowserUrl(cdashUrl, buildId): + return cdashUrl+"/build/"+buildId + + # Copy a key/value pair from one dict to another if it eixsts def copyKeyDictIfExists(sourceDict_in, keyName_in, dict_inout): value = sourceDict_in.get(keyName_in, None) @@ -1701,29 +1717,33 @@ def __call__(self, testDict): dateRangeEndDateStr = self.__date beginEndUrlFields = "begin="+dateRangeBeginDateStr+"&end="+dateRangeEndDateStr + # normalize names for query + projectName_url, buildName_url, testname_url, site_url = normalizeUrlStrings( + projectName, buildName, testname, site) + # Define queryTests.php query filters for test history testHistoryQueryFilters = \ beginEndUrlFields+"&"+\ "filtercombine=and&filtercombine=&filtercount=3&showfilters=1&filtercombine=and"+\ - "&field1=buildname&compare1=61&value1="+buildName+\ - "&field2=testname&compare2=61&value2="+testname+\ - "&field3=site&compare3=61&value3="+site + "&field1=buildname&compare1=61&value1="+buildName_url+\ + "&field2=testname&compare2=61&value2="+testname_url+\ + "&field3=site&compare3=61&value3="+site_url # URL used to get the history of the test in JSON form testHistoryQueryUrl = \ - getCDashQueryTestsQueryUrl(cdashUrl, projectName, None, testHistoryQueryFilters) + getCDashQueryTestsQueryUrl(cdashUrl, projectName_url, None, testHistoryQueryFilters) # URL to embed in email to show the history of the test to humans testHistoryBrowserUrl = \ - getCDashQueryTestsBrowserUrl(cdashUrl, projectName, None, testHistoryQueryFilters) + getCDashQueryTestsBrowserUrl(cdashUrl, projectName_url, None, testHistoryQueryFilters) # URL for to the build summary on index.php page buildHistoryEmailUrl = getCDashIndexBrowserUrl( - cdashUrl, projectName, None, + cdashUrl, projectName_url, None, beginEndUrlFields+"&"+\ "filtercombine=and&filtercombine=&filtercount=2&showfilters=1&filtercombine=and"+\ - "&field1=buildname&compare1=61&value1="+buildName+\ - "&field2=site&compare2=61&value2="+site + "&field1=buildname&compare1=61&value1="+buildName_url+\ + "&field2=site&compare2=61&value2="+site_url ) # ToDo: Replace this with the the URL to just this one build the index.php # page. To do that, get the build stamp from the list of builds on CDash diff --git a/cmake/tribits/ci_support/TribitsDumpDepsXmlScript.cmake b/cmake/tribits/ci_support/TribitsDumpDepsXmlScript.cmake index f55d03364c..2d13260c0b 100644 --- a/cmake/tribits/ci_support/TribitsDumpDepsXmlScript.cmake +++ b/cmake/tribits/ci_support/TribitsDumpDepsXmlScript.cmake @@ -100,16 +100,16 @@ endif() get_filename_component( ${PROJECT_NAME}_TRIBITS_DIR "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE ) message("-- Setting ${PROJECT_NAME}_TRIBITS_DIR=${${PROJECT_NAME}_TRIBITS_DIR}") +include("${CMAKE_CURRENT_LIST_DIR}/../core/common/TribitsConstants.cmake") +tribits_asesrt_minimum_cmake_version() +include("${CMAKE_CURRENT_LIST_DIR}/../core/common/TribitsCMakePolicies.cmake" NO_POLICY_SCOPE) + set( CMAKE_MODULE_PATH "${${PROJECT_NAME}_TRIBITS_DIR}/core/utils" "${${PROJECT_NAME}_TRIBITS_DIR}/core/package_arch" "${${PROJECT_NAME}_TRIBITS_DIR}/ci_support" ) -include(TribitsConstants) -tribits_asesrt_minimum_cmake_version() -include(TribitsCMakePolicies NO_POLICY_SCOPE) - include(TribitsGlobalMacros) include(TribitsPrintDependencyInfo) include(TribitsWriteXmlDependenciesFiles) diff --git a/cmake/tribits/ci_support/TribitsGetExtraReposForCheckinTest.cmake b/cmake/tribits/ci_support/TribitsGetExtraReposForCheckinTest.cmake index d0afd980bd..36853a8d98 100644 --- a/cmake/tribits/ci_support/TribitsGetExtraReposForCheckinTest.cmake +++ b/cmake/tribits/ci_support/TribitsGetExtraReposForCheckinTest.cmake @@ -82,11 +82,12 @@ set(${PROJECT_NAME}_CHECK_EXTRAREPOS_EXIST ${CHECK_EXTRAREPOS_EXIST}) # B) Include files from TriBITS # +include("${CMAKE_CURRENT_LIST_DIR}/../core/common/TribitsCMakePolicies.cmake" NO_POLICY_SCOPE) + set( CMAKE_MODULE_PATH "${${PROJECT_NAME}_TRIBITS_DIR}/core/utils" "${${PROJECT_NAME}_TRIBITS_DIR}/core/package_arch" ) -include(TribitsCMakePolicies NO_POLICY_SCOPE) include(Split) include(AppendStringVar) include(SetDefaultAndFromEnv) # Used in ExtraRepositoriesList.cmake file? diff --git a/cmake/tribits/ci_support/TribitsWriteXmlDependenciesFiles.cmake b/cmake/tribits/ci_support/TribitsWriteXmlDependenciesFiles.cmake index 2360acf162..0173750f19 100644 --- a/cmake/tribits/ci_support/TribitsWriteXmlDependenciesFiles.cmake +++ b/cmake/tribits/ci_support/TribitsWriteXmlDependenciesFiles.cmake @@ -45,6 +45,9 @@ ################################################################################ +include(TribitsConfigureTiming) + + # @MACRO: tribits_write_xml_dependency_files() # # Usage:: diff --git a/cmake/tribits/ci_support/cdash_analyze_and_report.py b/cmake/tribits/ci_support/cdash_analyze_and_report.py index 6556b97615..201502a9ec 100755 --- a/cmake/tribits/ci_support/cdash_analyze_and_report.py +++ b/cmake/tribits/ci_support/cdash_analyze_and_report.py @@ -542,6 +542,10 @@ def getTestHistory(self, testLOD): # D.2.a) Get list of dicts of builds off cdash/index.phpp # + # @arghdos: note, we do not have to normalize the URLs from the input + # options because they are currently taken from the cdash site already + # (i.e., they are already in normalized form). + cdashIndexBuildsBrowserUrl = CDQAR.getCDashIndexBrowserUrl( inOptions.cdashSiteUrl, inOptions.cdashProjectName, inOptions.date, inOptions.cdashBuildsFilters) diff --git a/cmake/tribits/common_tpls/utils/ParseLibraryList.cmake b/cmake/tribits/common_tpls/utils/ParseLibraryList.cmake index 3f1423b312..74affbecc9 100644 --- a/cmake/tribits/common_tpls/utils/ParseLibraryList.cmake +++ b/cmake/tribits/common_tpls/utils/ParseLibraryList.cmake @@ -100,7 +100,7 @@ function(parse_library_list) endforeach() - # Now set output vairables + # Now set output variables set(${PARSE_ARGS_DEBUG} "${_debug_libs}" PARENT_SCOPE) set(${PARSE_ARGS_OPT} "${_opt_libs}" PARENT_SCOPE) set(${PARSE_ARGS_GENERAL} "${_gen_libs}" PARENT_SCOPE) diff --git a/cmake/tribits/core/package_arch/TribitsCMakePolicies.cmake b/cmake/tribits/core/common/TribitsCMakePolicies.cmake similarity index 100% rename from cmake/tribits/core/package_arch/TribitsCMakePolicies.cmake rename to cmake/tribits/core/common/TribitsCMakePolicies.cmake diff --git a/cmake/tribits/core/package_arch/TribitsConstants.cmake b/cmake/tribits/core/common/TribitsConstants.cmake similarity index 98% rename from cmake/tribits/core/package_arch/TribitsConstants.cmake rename to cmake/tribits/core/common/TribitsConstants.cmake index be4881abc1..b26d497c55 100644 --- a/cmake/tribits/core/package_arch/TribitsConstants.cmake +++ b/cmake/tribits/core/common/TribitsConstants.cmake @@ -39,7 +39,7 @@ # Define the TriBITS minimum required CMake version -set(TRIBITS_CMAKE_MINIMUM_REQUIRED 3.22.0) +set(TRIBITS_CMAKE_MINIMUM_REQUIRED 3.23.0) macro(tribits_asesrt_minimum_cmake_version) diff --git a/cmake/tribits/core/config_tests/fmangle/CMakeLists.txt b/cmake/tribits/core/config_tests/fmangle/CMakeLists.txt index f9e75b94e0..2112fa58a4 100644 --- a/cmake/tribits/core/config_tests/fmangle/CMakeLists.txt +++ b/cmake/tribits/core/config_tests/fmangle/CMakeLists.txt @@ -37,7 +37,7 @@ # ************************************************************************ # @HEADER -cmake_minimum_required(VERSION 3.22) +cmake_minimum_required(VERSION 3.23) project(fmangle C Fortran) add_definitions(${COMMON_DEFS}) set(CMAKE_VERBOSE_MAKEFILE ON) diff --git a/cmake/tribits/core/package_arch/TribitsAddExecutable.cmake b/cmake/tribits/core/package_arch/TribitsAddExecutable.cmake index ec989628f8..567d22f4c2 100644 --- a/cmake/tribits/core/package_arch/TribitsAddExecutable.cmake +++ b/cmake/tribits/core/package_arch/TribitsAddExecutable.cmake @@ -38,9 +38,9 @@ # @HEADER -include(TribitsAddExecutableTestHelpers) +include("${CMAKE_CURRENT_LIST_DIR}/../test_support/TribitsAddExecutableTestHelpers.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/../test_support/TribitsAddTestHelpers.cmake") include(TribitsCommonArgsHelpers) -include(TribitsAddTestHelpers) include(TribitsGeneralMacros) include(TribitsLibIsTestOnly) include(TribitsReportInvalidTribitsUsage) diff --git a/cmake/tribits/core/package_arch/TribitsAddExecutableAndTest.cmake b/cmake/tribits/core/package_arch/TribitsAddExecutableAndTest.cmake index 73148b8a8a..7328f18558 100644 --- a/cmake/tribits/core/package_arch/TribitsAddExecutableAndTest.cmake +++ b/cmake/tribits/core/package_arch/TribitsAddExecutableAndTest.cmake @@ -38,8 +38,9 @@ # @HEADER +include("${CMAKE_CURRENT_LIST_DIR}/../test_support/TribitsAddTest.cmake") + include(TribitsAddExecutable) -include(TribitsAddTest) include(TribitsDeprecatedHelpers) diff --git a/cmake/tribits/core/package_arch/TribitsAddLibrary.cmake b/cmake/tribits/core/package_arch/TribitsAddLibrary.cmake index 30036149db..0e249f4f9c 100644 --- a/cmake/tribits/core/package_arch/TribitsAddLibrary.cmake +++ b/cmake/tribits/core/package_arch/TribitsAddLibrary.cmake @@ -271,7 +271,7 @@ include(TribitsSetAndIncDirs) # ``${CMAKE_INSTALL_PREFIX}/lib/`` (actual install directory is given by # ``${PROJECT}_INSTALL_LIB_DIR``, see `Setting the install prefix`_). # However, this install target will not get created if -# `${PROJECT_NAME}_INSTALL_LIBRARIES_AND_HEADERS`_ is ``FASLE`` and +# `${PROJECT_NAME}_INSTALL_LIBRARIES_AND_HEADERS`_ is ``FALSE`` and # ``BUILD_SHARD_LIBS=OFF``. But when ``BUILD_SHARD_LIBS=ON``, the install # target will get added. Also, this install target will *not* get added if # ``TESTONLY`` or ``NO_INSTALL_LIB_OR_HEADERS`` are passed in. @@ -280,7 +280,7 @@ include(TribitsSetAndIncDirs) # added using ``install(FILES

...)``, but only if ``TESTONLY`` and # ``NO_INSTALL_LIB_OR_HEADERS`` are not passed in as well. Also, the install # target for the headers will not get added if -# `${PROJECT_NAME}_INSTALL_LIBRARIES_AND_HEADERS`_ is ``FASLE``. If this +# `${PROJECT_NAME}_INSTALL_LIBRARIES_AND_HEADERS`_ is ``FALSE``. If this # install target is added, then the headers get installed into the flat # directory ``${${PROJECT_NAME}_INSTALL_INCLUDE_DIR}/`` (default is # ``${CMAKE_INSTALL_PREFIX}/include/``, see `Setting the install prefix`_). diff --git a/cmake/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake b/cmake/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake index cc6da7aba6..814533ea35 100644 --- a/cmake/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake +++ b/cmake/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake @@ -853,7 +853,7 @@ macro(tribits_set_package_and_related_upstream_packages_to_external packageName tribits_set_upstream_dep_packages_as_external(${packageName} ${subpackageTriggeredParentPackageExternal}) - tribits_set_package_as_processed_by_downstream_tribits_external_package(${packageName}) + tribits_mark_package_as_upstream_of_tribits_compliant_external_package(${packageName}) endmacro() # NOTE: In the above macro, if ${packageName} is made EXTERNAL because it one @@ -1317,10 +1317,16 @@ macro(tribits_set_upstream_dep_packages_as_external packageName endmacro() -# Mark a package as being processed by a downstream TriBITS-compliant external -# package +# Mark a package as being upstream of a TriBITS-compliant external package +# (and therefore should be processed by a downstream TriBITS-complaint +# package) +# +# NOTE: These packages are initially marked by setting +# ``${packageName}_PROCESSED_BY_DOWNSTREAM_TRIBITS_EXTERNAL_PACKAGE=TRUE``. +# If this packages are not actually defined by a downstream TriBITS-compliant +# external package, then this variable will be set to ``FALSE`` later. # -macro(tribits_set_package_as_processed_by_downstream_tribits_external_package packageName) +macro(tribits_mark_package_as_upstream_of_tribits_compliant_external_package packageName) set_default(${packageName}_PROCESSED_BY_DOWNSTREAM_TRIBITS_EXTERNAL_PACKAGE FALSE) @@ -1344,10 +1350,10 @@ macro(tribits_set_package_as_processed_by_downstream_tribits_external_package p endif() if (packageEnable AND (NOT ${packageName}_IS_TRIBITS_COMPLIANT)) message("-- " - "NOTE: ${packageName} is ${directOrIndirectStr} downstream from a" + "NOTE: ${packageName} is ${directOrIndirectStr} upstream from a" " TriBITS-compliant external package${downstreamPkgStr}") endif() - set(${packageName}_PROCESSED_BY_DOWNSTREAM_TRIBITS_EXTERNAL_PACKAGE TRUE) + set(${packageName}_PROCESSED_BY_DOWNSTREAM_TRIBITS_EXTERNAL_PACKAGE TRUE) break() endif() @@ -1358,6 +1364,7 @@ macro(tribits_set_package_as_processed_by_downstream_tribits_external_package p endmacro() + # Macro that sets ``_ENABLE_=ON`` if not already # enabled for all enabled subpackages of a parent package. # @@ -1424,13 +1431,6 @@ macro(tribits_set_internal_package_to_external depPkgName) endmacro() -macro(tribits_set_as_processed_by_downstream_tribits_external_package packageName - depPkgName - ) - -endmacro() - - # Function to return if is to be treated as an EXTERNAL package # in processing of the package # diff --git a/cmake/tribits/core/package_arch/TribitsConfigureTiming.cmake b/cmake/tribits/core/package_arch/TribitsConfigureTiming.cmake new file mode 100644 index 0000000000..00db385c17 --- /dev/null +++ b/cmake/tribits/core/package_arch/TribitsConfigureTiming.cmake @@ -0,0 +1,97 @@ +# @HEADER +# ************************************************************************ +# +# TriBITS: Tribal Build, Integrate, and Test System +# Copyright 2013 Sandia Corporation +# +# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +# the U.S. Government retains certain rights in this software. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. Neither the name of the Corporation nor the names of the +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# ************************************************************************ +# @HEADER + + +include(TimingUtils) + + +# Optionally start CMake code configure timing +# +function(tribits_config_code_start_timer START_TIMER_SECONDS_VAR_OUT) + if (${PROJECT_NAME}_ENABLE_CONFIGURE_TIMING) + timer_get_raw_seconds(START_TIMER_SECONDS) + set(${START_TIMER_SECONDS_VAR_OUT} ${START_TIMER_SECONDS} PARENT_SCOPE) + endif() +endfunction() + + +# Optionally stop CMake code configure timing +# +function(tribits_config_code_stop_timer START_TIMER_SECONDS_VAR_IN + TIMER_STR + ) + if (${PROJECT_NAME}_ENABLE_CONFIGURE_TIMING) + timer_get_raw_seconds(TIMER_STOP_SECONDS) + timer_print_rel_time(${${START_TIMER_SECONDS_VAR_IN}} + ${TIMER_STOP_SECONDS} + "${TIMER_STR}") + endif() +endfunction() + + +# Optionally start CMake code **package** configure timing +# +function(tribits_package_config_code_start_timer START_TIMER_SECONDS_VAR_OUT) + if (${PROJECT_NAME}_ENABLE_CONFIGURE_TIMING + AND + ( ${PROJECT_NAME}_ENABLE_PACKAGE_CONFIGURE_TIMING + OR ${TRIBITS_PACKAGE}_PACKAGE_CONFIGURE_TIMING ) + ) + timer_get_raw_seconds(START_TIMER_SECONDS) + set(${START_TIMER_SECONDS_VAR_OUT} ${START_TIMER_SECONDS} PARENT_SCOPE) + endif() +endfunction() + + +# Optionally stop CMake code **package** configure timing +# +function(tribits_package_config_code_stop_timer START_TIMER_SECONDS_VAR_IN + TIMER_STR + ) + if (${PROJECT_NAME}_ENABLE_CONFIGURE_TIMING + AND + ( ${PROJECT_NAME}_ENABLE_PACKAGE_CONFIGURE_TIMING + OR ${TRIBITS_PACKAGE}_PACKAGE_CONFIGURE_TIMING ) + ) + timer_get_raw_seconds(TIMER_STOP_SECONDS) + timer_print_rel_time(${${START_TIMER_SECONDS_VAR_IN}} + ${TIMER_STOP_SECONDS} + "${TIMER_STR}") + endif() +endfunction() diff --git a/cmake/tribits/core/package_arch/TribitsCopyFilesToBinaryDir.cmake b/cmake/tribits/core/package_arch/TribitsCopyFilesToBinaryDir.cmake index f4e1e3bc75..ffeef4bdbb 100644 --- a/cmake/tribits/core/package_arch/TribitsCopyFilesToBinaryDir.cmake +++ b/cmake/tribits/core/package_arch/TribitsCopyFilesToBinaryDir.cmake @@ -38,7 +38,6 @@ # @HEADER -include(TribitsAddTestHelpers) include(CMakeParseArguments) diff --git a/cmake/tribits/core/package_arch/TribitsFindMostRecentFileTimestamp.cmake b/cmake/tribits/core/package_arch/TribitsFindMostRecentFileTimestamp.cmake index a136e8f341..b35afaea47 100644 --- a/cmake/tribits/core/package_arch/TribitsFindMostRecentFileTimestamp.cmake +++ b/cmake/tribits/core/package_arch/TribitsFindMostRecentFileTimestamp.cmake @@ -37,6 +37,9 @@ # ************************************************************************ # @HEADER + +include(TribitsConfigureTiming) + include(CMakeParseArguments) diff --git a/cmake/tribits/core/package_arch/TribitsGeneralMacros.cmake b/cmake/tribits/core/package_arch/TribitsGeneralMacros.cmake index 0dc079655a..8236e47a5b 100644 --- a/cmake/tribits/core/package_arch/TribitsGeneralMacros.cmake +++ b/cmake/tribits/core/package_arch/TribitsGeneralMacros.cmake @@ -46,62 +46,6 @@ include(TribitsDeprecatedHelpers) include(TribitsGetPackageEnableStatus) -# Optionally start CMake code configure timing -# -function(tribits_config_code_start_timer START_TIMER_SECONDS_VAR_OUT) - if (${PROJECT_NAME}_ENABLE_CONFIGURE_TIMING) - timer_get_raw_seconds(START_TIMER_SECONDS) - set(${START_TIMER_SECONDS_VAR_OUT} ${START_TIMER_SECONDS} PARENT_SCOPE) - endif() -endfunction() - - -# Optionally stop CMake code configure timing -# -function(tribits_config_code_stop_timer START_TIMER_SECONDS_VAR_IN - TIMER_STR - ) - if (${PROJECT_NAME}_ENABLE_CONFIGURE_TIMING) - timer_get_raw_seconds(TIMER_STOP_SECONDS) - timer_print_rel_time(${${START_TIMER_SECONDS_VAR_IN}} - ${TIMER_STOP_SECONDS} - "${TIMER_STR}") - endif() -endfunction() - - -# Optionally start CMake code **package** configure timing -# -function(tribits_package_config_code_start_timer START_TIMER_SECONDS_VAR_OUT) - if (${PROJECT_NAME}_ENABLE_CONFIGURE_TIMING - AND - ( ${PROJECT_NAME}_ENABLE_PACKAGE_CONFIGURE_TIMING - OR ${TRIBITS_PACKAGE}_PACKAGE_CONFIGURE_TIMING ) - ) - timer_get_raw_seconds(START_TIMER_SECONDS) - set(${START_TIMER_SECONDS_VAR_OUT} ${START_TIMER_SECONDS} PARENT_SCOPE) - endif() -endfunction() - - -# Optionally stop CMake code **package** configure timing -# -function(tribits_package_config_code_stop_timer START_TIMER_SECONDS_VAR_IN - TIMER_STR - ) - if (${PROJECT_NAME}_ENABLE_CONFIGURE_TIMING - AND - ( ${PROJECT_NAME}_ENABLE_PACKAGE_CONFIGURE_TIMING - OR ${TRIBITS_PACKAGE}_PACKAGE_CONFIGURE_TIMING ) - ) - timer_get_raw_seconds(TIMER_STOP_SECONDS) - timer_print_rel_time(${${START_TIMER_SECONDS_VAR_IN}} - ${TIMER_STOP_SECONDS} - "${TIMER_STR}") - endif() -endfunction() - - # Set the combined directory name taking into account '.' repos. # function(tribits_get_repo_name REPO_DIR REPO_NAME_OUT) diff --git a/cmake/tribits/core/package_arch/TribitsGlobalMacros.cmake b/cmake/tribits/core/package_arch/TribitsGlobalMacros.cmake index 5315bb0a6a..83c60cd5b5 100644 --- a/cmake/tribits/core/package_arch/TribitsGlobalMacros.cmake +++ b/cmake/tribits/core/package_arch/TribitsGlobalMacros.cmake @@ -38,11 +38,16 @@ # @HEADER # Standard TriBITS system includes -include(TribitsConstants) + +include("${CMAKE_CURRENT_LIST_DIR}/../utils/TribitsGitRepoVersionInfo.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/../common/TribitsConstants.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/../test_support/TribitsTestCategories.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/../test_support/TribitsAddTestHelpers.cmake") + include(TribitsSetupMPI) -include(TribitsTestCategories) include(TribitsGeneralMacros) -include(TribitsAddTestHelpers) include(TribitsVerbosePrintVar) include(TribitsProcessEnabledTpls) include(TribitsInstallHeaders) @@ -50,8 +55,8 @@ include(TribitsGetVersionDate) include(TribitsReportInvalidTribitsUsage) include(TribitsReadAllProjectDepsFilesCreateDepsGraph) include(TribitsAdjustPackageEnables) -include(TribitsGitRepoVersionInfo) include(TribitsSetUpEnabledOnlyDependencies) +include(TribitsConfigureTiming) # Standard TriBITS utilities includes include(TribitsAddOptionAndDefine) @@ -463,13 +468,6 @@ macro(tribits_define_global_options_and_define_extra_repos) "Make the ${PROJECT_NAME} configure process verbose." ) - if ("${${PROJECT_NAME}_TRACE_ADD_TEST_DEFAULT}" STREQUAL "") - set(${PROJECT_NAME}_TRACE_ADD_TEST_DEFAULT ${${PROJECT_NAME}_VERBOSE_CONFIGURE}) - endif() - advanced_set(${PROJECT_NAME}_TRACE_ADD_TEST ${${PROJECT_NAME}_TRACE_ADD_TEST_DEFAULT} - CACHE BOOL - "Show a configure time trace of every test added or not added any why (one line)." ) - advanced_option(${PROJECT_NAME}_DUMP_LINK_LIBS "Dump the link libraries for every library and executable created." "${${PROJECT_NAME}_VERBOSE_CONFIGURE}" ) @@ -688,6 +686,9 @@ macro(tribits_define_global_options_and_define_extra_repos) CACHE BOOL "Generate the ${PROJECT_NAME}RepoVersion.txt file.") + tribits_advanced_set_cache_var_and_default(${PROJECT_NAME}_SHOW_GIT_COMMIT_PARENTS + BOOL OFF "Show parents' commit info in the repo version output.") + if ("${${PROJECT_NAME}_GENERATE_VERSION_DATE_FILES_DEFAULT}" STREQUAL "") set(${PROJECT_NAME}_GENERATE_VERSION_DATE_FILES_DEFAULT OFF) endif() @@ -1133,106 +1134,6 @@ macro(tribits_setup_installation_paths) endmacro() -# -# Macros to process repository specializaiton call-back functions -# -# NOTE: The Tribits system promises to only include these call-back files once -# (in order) and to only the call call-back macros they provide once (in -# order). -# - - -macro(create_empty_tribits_repository_setup_extra_options) - macro(tribits_repository_setup_extra_options) - endmacro() -endmacro() - - -macro(tribits_repository_setup_extra_options_runner REPO_NAME) - set(CALLBACK_SETUP_EXTRA_OPTIONS_FILE - "${${REPO_NAME}_SOURCE_DIR}/cmake/CallbackSetupExtraOptions.cmake") - #print_var(CALLBACK_SETUP_EXTRA_OPTIONS_FILE) - if (EXISTS ${CALLBACK_SETUP_EXTRA_OPTIONS_FILE}) - if (${PROJECT_NAME}_VERBOSE_CONFIGURE) - message("Processing call-back file and macros in" - " '${CALLBACK_SETUP_EXTRA_OPTIONS_FILE}'") - endif() - # Define the callback macros as empty in case it is not defined - # in this file. - create_empty_tribits_repository_setup_extra_options() - # Include the file which will define the callback macros - set(REPOSITORY_NAME ${REPO_NAME}) - tribits_trace_file_processing(REPOSITORY INCLUDE - "${CALLBACK_SETUP_EXTRA_OPTIONS_FILE}") - include(${CALLBACK_SETUP_EXTRA_OPTIONS_FILE}) - # Call the callback macros to inject repository-specific behavir - tribits_repository_setup_extra_options() - # Set back the callback macros to empty to ensure that nonone calls them - create_empty_tribits_repository_setup_extra_options() - endif() -endmacro() - - -macro(create_empty_tribits_repository_define_packaging) - macro(tribits_repository_define_packaging) - endmacro() -endmacro() - - -macro(tribits_repository_define_packaging_runner REPO_NAME) - set(CALLBACK_DEFINE_PACKAGING_FILE - "${${REPO_NAME}_SOURCE_DIR}/cmake/CallbackDefineRepositoryPackaging.cmake") - #print_var(CALLBACK_DEFINE_PACKAGING_FILE) - if (EXISTS ${CALLBACK_DEFINE_PACKAGING_FILE}) - if (${PROJECT_NAME}_VERBOSE_CONFIGURE) - message("Processing call-back file and macros in" - " '${CALLBACK_DEFINE_PACKAGING_FILE}'") - endif() - # Define the callback macros as empty in case it is not defined - # in this file. - create_empty_tribits_repository_define_packaging() - # Include the file which will define the callback macros - tribits_trace_file_processing(REPOSITORY INCLUDE - "${CALLBACK_DEFINE_PACKAGING_FILE}") - include(${CALLBACK_DEFINE_PACKAGING_FILE}) - # Call the callback macros to inject repository-specific behavir - tribits_repository_define_packaging() - # Set back the callback macros to empty to ensure that nonone calls them - create_empty_tribits_repository_define_packaging() - endif() -endmacro() - - -macro(create_empty_tribits_project_define_packaging) - macro(tribits_project_define_packaging) - endmacro() -endmacro() - - -macro(tribits_project_define_packaging_runner) - set(CALLBACK_DEFINE_PACKAGING_FILE - "${PROJECT_SOURCE_DIR}/cmake/CallbackDefineProjectPackaging.cmake") - #print_var(CALLBACK_DEFINE_PACKAGING_FILE) - if (EXISTS ${CALLBACK_DEFINE_PACKAGING_FILE}) - if (${PROJECT_NAME}_VERBOSE_CONFIGURE) - message("Processing call-back file and macros in" - " '${CALLBACK_DEFINE_PACKAGING_FILE}'") - endif() - # Define the callback macros as empty in case it is not defined - # in this file. - create_empty_tribits_project_define_packaging() - # Include the file which will define the callback macros - tribits_trace_file_processing(PROJECT INCLUDE - "${CALLBACK_DEFINE_PACKAGING_FILE}") - include(${CALLBACK_DEFINE_PACKAGING_FILE}) - # Call the callback macros to inject project-specific behavir - tribits_project_define_packaging() - # Set back the callback macros to empty to ensure that nonone calls them - create_empty_tribits_project_define_packaging() - endif() -endmacro() - - # Read in the Project's native repositories. # # On output, the variable ${PRJOECT_NAME}_NATIVE_REPOSITORIES is set. @@ -1310,48 +1211,41 @@ endmacro() # Get the versions of all the git repos # -function(tribits_generate_repo_version_file_string PROJECT_REPO_VERSION_FILE_STRING_OUT) +function(tribits_generate_repo_version_file_string projectRepoVersionFileStrOut) - set(REPO_VERSION_FILE_STR "") + set(projectRepoVersionFileStr "") tribits_generate_single_repo_version_string( - ${CMAKE_CURRENT_SOURCE_DIR} - SINGLE_REPO_VERSION) - string(APPEND REPO_VERSION_FILE_STR + ${CMAKE_CURRENT_SOURCE_DIR} singleRepoVersionStr + INCLUDE_COMMIT_PARENTS ${${PROJECT_NAME}_SHOW_GIT_COMMIT_PARENTS}) + string(APPEND projectRepoVersionFileStr "*** Base Git Repo: ${PROJECT_NAME}\n" - "${SINGLE_REPO_VERSION}\n" ) + "${singleRepoVersionStr}\n" ) - set(EXTRAREPO_IDX 0) - foreach(EXTRA_REPO ${${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES}) - - #print_var(EXTRA_REPO) - #print_var(EXTRAREPO_IDX) - #print_var(${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_DIRS) + set(extraRepoIdx 0) + foreach(extraRepo ${${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES}) if (${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_DIRS) # Read from an extra repo file with potentially different dir. - list(GET ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_DIRS ${EXTRAREPO_IDX} - EXTRAREPO_DIR ) + list(GET ${PROJECT_NAME}_ALL_EXTRA_REPOSITORIES_DIRS ${extraRepoIdx} + extraRepoDir ) else() # Not read from extra repo file so dir is same as name - set(EXTRAREPO_DIR ${EXTRA_REPO}) + set(extraRepoDir ${extraRepo}) endif() - #print_var(EXTRAREPO_DIR) tribits_generate_single_repo_version_string( - "${CMAKE_CURRENT_SOURCE_DIR}/${EXTRAREPO_DIR}" - SINGLE_REPO_VERSION) - string(APPEND REPO_VERSION_FILE_STR - "*** Git Repo: ${EXTRAREPO_DIR}\n" - "${SINGLE_REPO_VERSION}\n" ) - - #print_var(REPO_VERSION_FILE_STR) + "${CMAKE_CURRENT_SOURCE_DIR}/${extraRepoDir}" singleRepoVersionStr + INCLUDE_COMMIT_PARENTS ${${PROJECT_NAME}_SHOW_GIT_COMMIT_PARENTS}) + string(APPEND projectRepoVersionFileStr + "*** Git Repo: ${extraRepoDir}\n" + "${singleRepoVersionStr}\n" ) - math(EXPR EXTRAREPO_IDX "${EXTRAREPO_IDX}+1") + math(EXPR extraRepoIdx "${extraRepoIdx}+1") endforeach() - set(${PROJECT_REPO_VERSION_FILE_STRING_OUT} ${REPO_VERSION_FILE_STR} PARENT_SCOPE) + set(${projectRepoVersionFileStrOut} ${projectRepoVersionFileStr} PARENT_SCOPE) endfunction() @@ -1363,17 +1257,17 @@ endfunction() # function(tribits_generate_repo_version_output_and_file) # Get the repos versions - tribits_generate_repo_version_file_string(PROJECT_REPO_VERSION_FILE_STRING) + tribits_generate_repo_version_file_string(projectRepoVersionFileStr) # Print the versions message("\n${PROJECT_NAME} repos versions:\n" "--------------------------------------------------------------------------------\n" - "${PROJECT_REPO_VERSION_FILE_STRING}" + "${projectRepoVersionFileStr}" " --------------------------------------------------------------------------------\n" ) #) Write out the version file file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${${PROJECT_NAME}_REPO_VERSION_FILE_NAME}" - "${PROJECT_REPO_VERSION_FILE_STRING}") + "${projectRepoVersionFileStr}") endfunction() @@ -2171,17 +2065,20 @@ macro(tribits_configure_enabled_packages) tribits_trace_file_processing(PACKAGE ADD_SUBDIR "${TRIBITS_PACKAGE_CMAKELIST_FILE}") if (NOT ${TRIBITS_PACKAGE}_SOURCE_DIR STREQUAL ${PROJECT_NAME}_SOURCE_DIR) - add_subdirectory(${${TRIBITS_PACKAGE}_SOURCE_DIR} ${${TRIBITS_PACKAGE}_BINARY_DIR}) + add_subdirectory(${${TRIBITS_PACKAGE}_SOURCE_DIR} + ${${TRIBITS_PACKAGE}_BINARY_DIR}) else() include("${TRIBITS_PACKAGE_CMAKELIST_FILE}") endif() - if (NOT ${PACKAGE_NAME}_TRIBITS_PACKAGE_POSTPROCESS) + if ((NOT ${PACKAGE_NAME}_TRIBITS_PACKAGE_POSTPROCESS) AND + (NOT TARGET ${PACKAGE_NAME}::all_libs) + ) tribits_report_invalid_tribits_usage( "ERROR: Forgot to call tribits_package_postprocess() in" " ${TRIBITS_PACKAGE_CMAKELIST_FILE}") endif() - list(APPEND ENABLED_PACKAGE_LIBS_TARGETS ${TRIBITS_PACKAGE}_libs) + list(APPEND ENABLED_PACKAGE_LIBS_TARGETS ${TRIBITS_PACKAGE}::all_libs) list(APPEND ${PROJECT_NAME}_LIBRARIES ${${TRIBITS_PACKAGE}_LIBRARIES}) tribits_package_config_code_stop_timer(PROCESS_THIS_PACKAGE_TIME_START_SECONDS @@ -2297,150 +2194,6 @@ macro(tribits_configure_enabled_packages) endmacro() -# Set up for packaging and distribution -# -macro(tribits_setup_packaging_and_distribution) - - tribits_config_code_start_timer(CPACK_SETUP_TIME_START_SECONDS) - - # K.1) Run callback function for the base project. - - tribits_project_define_packaging_runner() - # The above must define the basic project settings for CPACK that are - # specific to the project and should not be provided by the user. - - # K.2) Removing any packages or packages not enabled from the tarball - - if (${PROJECT_NAME}_EXCLUDE_DISABLED_SUBPACKAGES_FROM_DISTRIBUTION) - set(tribitsPackageList ${${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES}) - else() - set(tribitsPackageList ${${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES}) - endif() - - tribits_get_sublist_nonenabled(tribitsPackageList nonEnabledTribitsPackage "") - - foreach(TRIBITS_PACKAGE ${nonEnabledTribitsPackage}) - - # Determine if this is a package to not ignore - find_list_element(TRIBITS_CPACK_PACKAGES_TO_NOT_IGNORE - ${TRIBITS_PACKAGE} TRIBITS_PACKAGE_DONT_IGNORE) - - if (NOT TRIBITS_PACKAGE_DONT_IGNORE) - - # Checking if we have a relative path to the package's files. Since the - # exclude is a regular expression any "../" will be interpreted as / which would never match the package's actual - # directory. There isn't a direct way in cmake to convert a relative - # path into an absolute path with string operations so as a way of - # making sure that we get the correct path of the package we use a - # find_path for the CMakeLists.txt file for the package. Since the - # package has to have this file to work correctly it should be - # guaranteed to be there. - string(REGEX MATCH "[.][.]/" RELATIVE_PATH_CHARS_MATCH - ${${TRIBITS_PACKAGE}_REL_SOURCE_DIR}) - if ("${RELATIVE_PATH_CHARS_MATCH}" STREQUAL "") - set(CPACK_SOURCE_IGNORE_FILES - "${PROJECT_SOURCE_DIR}/${${TRIBITS_PACKAGE}_REL_SOURCE_DIR}/" - ${CPACK_SOURCE_IGNORE_FILES}) - else() - find_path(ABSOLUTE_PATH CMakeLists.txt PATHS - "${PROJECT_SOURCE_DIR}/${${TRIBITS_PACKAGE}_REL_SOURCE_DIR}" - NO_DEFAULT_PATH) - if ("${ABSOLUTE_PATH}" STREQUAL "ABSOLUTE_PATH-NOTFOUND") - message(AUTHOR_WARNING "Relative path found for disabled package" - " ${TRIBITS_PACKAGE} but package was missing a CMakeLists.txt file." - " This disabled package will likely not be excluded from a source release") - endif() - set(CPACK_SOURCE_IGNORE_FILES ${ABSOLUTE_PATH} ${CPACK_SOURCE_IGNORE_FILES}) - endif() - endif() - - endforeach() - - # Add excludes for VC files/dirs - set(CPACK_SOURCE_IGNORE_FILES - ${CPACK_SOURCE_IGNORE_FILES} - /[.]git/ - [.]gitignore$ - ) - - # Print the set of excluded files - if(${PROJECT_NAME}_VERBOSE_CONFIGURE OR - ${PROJECT_NAME}_DUMP_CPACK_SOURCE_IGNORE_FILES - ) - message("Exclude files when building source packages") - foreach(item ${CPACK_SOURCE_IGNORE_FILES}) - message(${item}) - endforeach() - endif() - - # K.3) Set up install component dependencies - - tribits_get_sublist_enabled( - ${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES - enabledInternalToplevelPackages "") - - foreach(pkgName ${enabledInternalToplevelPackages}) - if(NOT "${${pkgName}_LIB_ENABLED_DEPENDENCIES}" STREQUAL "") - string(TOUPPER ${pkgName} upperPkgName) - set(CPACK_COMPONENT_${upperPkgName}_DEPENDS ${${pkgName}_LIB_ENABLED_DEPENDENCIES}) - # ToDo: The above needs to be changed to the list of *internal* enabled - # package dependencies! (But there are no tests for this currently and - # I am not sure who is using this.) - endif() - endforeach() - - # K.4) Resetting the name to avoid overwriting registry keys when installing - - if(WIN32) - set(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-${${PROJECT_NAME}_VERSION}") - if (TPL_ENABLE_MPI) - set(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-mpi") - ELSE () - set(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-serial") - endif() - set(CPACK_GENERATOR "NSIS") - set(CPACK_NSIS_MODIFY_PATH OFF) - endif() - - # K.5) Determine the source generator - if ("${${PROJECT_NAME}_CPACK_SOURCE_GENERATOR_DEFAULT}" STREQUAL "") - set(${PROJECT_NAME}_CPACK_SOURCE_GENERATOR_DEFAULT "TGZ") - endif() - set(${PROJECT_NAME}_CPACK_SOURCE_GENERATOR - ${${PROJECT_NAME}_CPACK_SOURCE_GENERATOR_DEFAULT} - CACHE STRING - "The types of source generators to use for CPACK_SOURCE_GENERATOR.") - set(CPACK_SOURCE_GENERATOR ${${PROJECT_NAME}_CPACK_SOURCE_GENERATOR}) - - # K.6) Loop through the Repositories and run their callback functions. - foreach(REPO ${${PROJECT_NAME}_ALL_REPOSITORIES}) - tribits_get_repo_name_dir(${REPO} REPO_NAME REPO_DIR) - if (${PROJECT_NAME}_VERBOSE_CONFIGURE) - message("Processing packaging call-backs for ${REPO_NAME}") - endif() - tribits_repository_define_packaging_runner(${REPO_NAME}) - endforeach() - - # K.7) Include RepoVersion.txt if generated - set(PROJECT_REPO_VERSION_FILE - "${CMAKE_CURRENT_BINARY_DIR}/${${PROJECT_NAME}_REPO_VERSION_FILE_NAME}") - if (EXISTS "${PROJECT_REPO_VERSION_FILE}") - foreach(SOURCE_GEN ${CPACK_SOURCE_GENERATOR}) - set(CPACK_INSTALL_COMMANDS ${CPACK_INSTALL_COMMANDS} - "${CMAKE_COMMAND} -E copy '${PROJECT_REPO_VERSION_FILE}' '${CMAKE_CURRENT_BINARY_DIR}/_CPack_Packages/Linux-Source/${SOURCE_GEN}/${CPACK_PACKAGE_NAME}-${${PROJECT_NAME}_VERSION}-Source/${${PROJECT_NAME}_REPO_VERSION_FILE_NAME}'") - endforeach() - endif() - - # K.8) Finally process with CPack - include(CPack) - - tribits_config_code_stop_timer(CPACK_SETUP_TIME_START_SECONDS - "Total time to set up for CPack packaging") - -endmacro() - - # Create custom 'install_package_by_package' target # function(tribits_add_install_package_by_package_target) @@ -2488,104 +2241,6 @@ macro(tribits_setup_for_installation) endmacro() - -# @MACRO: tribits_exclude_files() -# -# Exclude package files/dirs from the source distribution by appending -# ``CPACK_SOURCE_IGNORE_FILES``. -# -# Usage:: -# -# tribits_exclude_files( ...) -# -# This is called in the top-level parent package's -# `/CMakeLists.txt`_ file and each file or directory name -# ```` is actually interpreted by CMake/CPack as a regex that is -# prefixed by the project's and package's source directory names so as to not -# exclude files and directories of the same name and path from other packages. -# If ```` is an absolute path it is not prefixed but is appended to -# ``CPACK_SOURCE_IGNORE_FILES`` unmodified. -# -# In general, do **NOT** put in excludes for files and directories that are -# not under this package's source tree. If the given package is not enabled, -# then this command will never be called! For example, don't put in excludes -# for PackageB's files in PackageA's ``CMakeLists.txt`` file because if -# PackageB is enabled but PackageA is not, the excludes for PackageB will -# never get added to ``CPACK_SOURCE_IGNORE_FILES``. -# -# Also, be careful to note that the ```` arguments are actually regexes -# and one must be very careful to understand how CPack will use these regexes -# to match files that get excluded from the tarball. For more details, see -# `Creating Source Distributions`_. -# -macro(tribits_exclude_files) - - if (NOT "${${PACKAGE_NAME}_PARENT_PACKAGE}" STREQUAL "") - message(FATAL_ERROR - "ERROR: tribits_exclude_files() was called in a subpackage CmakeLists.txt file!" - " Instead, move this call to the file" - " ${${${PACKAGE_NAME}_PARENT_PACKAGE}_SOURCE_DIR}/CMakeLists.txt" - " and adjust the paths accordingly!" ) - endif() - - set(FILES_TO_EXCLUDE ${ARGN}) - - # Need to add "///" to each file to prevent - # someone from trying to exclude a file like "readme" and having it - # inadvertently exclude a file matching that name in another package. - set(MODIFIED_FILES_TO_EXCLUDE "") - - set(${PROJECT_NAME}_SOURCE_PATH ${${PROJECT_NAME}_SOURCE_DIR}) - - foreach(FILE ${FILES_TO_EXCLUDE}) - #Ensure that if the full path was specified for the file that we don't add - #"///" again. - set(MATCH_STRING "${${PACKAGE_NAME}_SOURCE_DIR}") - string(REGEX MATCH ${MATCH_STRING} MATCHED ${FILE} ) - if(NOT MATCHED) - list(APPEND MODIFIED_FILES_TO_EXCLUDE - "${${PACKAGE_NAME}_SOURCE_DIR}/${FILE}") - else() - list(APPEND MODIFIED_FILES_TO_EXCLUDE ${FILE}) - endif() - endforeach() - -#Leaving in for debugging purposes -# message("List of files being excluded for package ${PACKAGE_NAME}") -# foreach(NEW_FILE ${MODIFIED_FILES_TO_EXCLUDE}) -# message(${NEW_FILE}) -# endforeach() - - list(APPEND CPACK_SOURCE_IGNORE_FILES ${MODIFIED_FILES_TO_EXCLUDE}) - if (NOT ${PROJECT_NAME}_BINARY_DIR STREQUAL ${PACKAGE_NAME}_BINARY_DIR) - set(CPACK_SOURCE_IGNORE_FILES ${CPACK_SOURCE_IGNORE_FILES} PARENT_SCOPE) - endif() - -endmacro() - - -# Exclude files only for the packages that will not be supporting autotools. -# -macro(tribits_exclude_autotools_files) # PACKAGE_NAME LIST_RETURN) - set(AUTOTOOLS_FILES - configure.ac$ - configure$ - Makefile.am$ - Makefile.in$ - bootstrap$ - .*[.]m4$ - config/ - ) - - set(FILES_TO_EXCLUDE) - foreach(FILE ${AUTOTOOLS_FILES}) - list(APPEND FILES_TO_EXCLUDE ${FILE} \(.*/\)*${FILE}) - endforeach() - - tribits_exclude_files(${FILES_TO_EXCLUDE}) - -endmacro() - # LocalWords: # LocalWords: Sandia SANDIA Redistributions # LocalWords: tribits TriBITS TRIBITS diff --git a/cmake/tribits/core/package_arch/TribitsInstallHeaders.cmake b/cmake/tribits/core/package_arch/TribitsInstallHeaders.cmake index c1bf530397..7ac01b81ed 100644 --- a/cmake/tribits/core/package_arch/TribitsInstallHeaders.cmake +++ b/cmake/tribits/core/package_arch/TribitsInstallHeaders.cmake @@ -76,7 +76,7 @@ include(CMakeParseArguments) # If specified, then ``COMPONENT `` will be passed into # ``install()``. Otherwise, ``COMPONENT ${PROJECT_NAME}`` will get used. # -# If `${PROJECT_NAME}_INSTALL_LIBRARIES_AND_HEADERS`_ is ``FASLE``, then the +# If `${PROJECT_NAME}_INSTALL_LIBRARIES_AND_HEADERS`_ is ``FALSE``, then the # headers will not get installed. # function(tribits_install_headers) diff --git a/cmake/tribits/core/package_arch/TribitsInternalPackageWriteConfigFile.cmake b/cmake/tribits/core/package_arch/TribitsInternalPackageWriteConfigFile.cmake index 914825ffad..e820d6222e 100644 --- a/cmake/tribits/core/package_arch/TribitsInternalPackageWriteConfigFile.cmake +++ b/cmake/tribits/core/package_arch/TribitsInternalPackageWriteConfigFile.cmake @@ -84,12 +84,12 @@ function(tribits_write_package_client_export_files PACKAGE_NAME) tribits_write_flexible_package_client_export_files(${EXPORT_FILES_ARGS}) - tribits_write_package_client_export_files_install_targets(${EXPORT_FILES_ARGS}) + tribits_write_package_client_export_files_export_and_install_targets(${EXPORT_FILES_ARGS}) endfunction() -# @FUNCTION: tribits_write_package_client_export_files_install_targets() +# @FUNCTION: tribits_write_package_client_export_files_export_and_install_targets() # # Create the ``ConfigTargets.cmake`` file and install rules and the # install() target for the previously generated @@ -98,7 +98,7 @@ endfunction() # # Usage:: # -# tribits_write_package_client_export_files_install_targets( +# tribits_write_package_client_export_files_export_and_install_targets( # PACKAGE_NAME # PACKAGE_CONFIG_FOR_BUILD_BASE_DIR # PACKAGE_CONFIG_FOR_INSTALL_BASE_DIR @@ -107,7 +107,7 @@ endfunction() # The install() commands must be in a different subroutine or CMake will not # allow you to call the routine, even if you if() it out! # -function(tribits_write_package_client_export_files_install_targets) +function(tribits_write_package_client_export_files_export_and_install_targets) cmake_parse_arguments( #prefix @@ -333,10 +333,10 @@ endfunction() # @FUNCTION: tribits_write_flexible_package_client_export_files() # -# Utility function for writing ``${PACKAGE_NAME}Config.cmake`` files for -# package ``${PACKAGE_NAME}`` with some greater flexibility than what is -# provided by the function ``tribits_write_package_client_export_files()`` and -# to allow unit testing the generation of these files.. +# Utility function for writing the ``${PACKAGE_NAME}Config.cmake`` files for +# the build dir and/or for the install dir for the package ```` +# with some flexibility . (See NOTE below for what is actually generated and +# what is *NOT* generated.) # # Usage:: # @@ -352,7 +352,8 @@ endfunction() # ``PACKAGE_NAME `` # # Gives the name of the TriBITS package for which the export files should -# be created. +# be created. (This must match the export set for the libraries for the +# generated/exported ``ConfigTargets.cmake`` file.) # # ``EXPORT_FILE_VAR_PREFIX `` # @@ -362,28 +363,39 @@ endfunction() # # ``PACKAGE_CONFIG_FOR_BUILD_BASE_DIR `` # -# If specified, then the package's ``Config.cmake`` file and -# supporting files will be written under the directory -# ``/`` (and any subdirs that does exist -# will be created). The generated file ``Config.cmake`` is -# for usage of the package in the build tree (not the install tree) and -# points to include directories and libraries in the build tree. +# If specified, then the package's ``Config.cmake`` file will +# be written under the directory ``/`` (and +# any subdirs that do not exist will be created). The generated file +# ``Config.cmake`` is for usage of the package in the build +# tree (not the install tree) and points to include directories and +# libraries in the build tree. (NOTE: The included +# ``Targets.cmake`` file is *NOT* generated in this +# function.) # # ``PACKAGE_CONFIG_FOR_INSTALL_BASE_DIR `` # # If specified, then the package's ``Config_install.cmake`` -# file and supporting files will be written under the directory -# ``/`` (and any subdirs that does exist +# file will be written under the directory +# ``/`` (and any subdirs that do not exist # will be created). The file ``${PACKAGE_NAME}Config_install.cmake`` is # meant to be installed renamed as ``Config.cmake`` in the # install tree and it points to installed include directories and -# libraries. -# -# NOTE: This function does *not* contain any ``install()`` command itself -# because CMake will not allow those to even be present in scripting mode that -# is used for unit testing this function. Instead, the commands to install -# the files are added by the function -# ``tribits_write_package_client_export_files_install_targets()``. +# libraries. (NOTE: The included ``Targets.cmake`` +# file is *NOT* generated in this function.) +# +# NOTE: This function does *not* generate the ``Config.cmake`` +# files (which will be created later using ``export()`` or ``include()`) which +# are included in these generated package config files and this function. +# Also, this function does *not* invoke the ``install()`` command to install +# the package config file for the install directory. The ``export()`` and +# ``install()`` project commands are bot allowed in `cmake -P` scripting mode +# that is used for unit testing this function. Instead, the commands to +# generate the ``Targets.cmake`` files and install the package +# config file for the install tree are produced by the function +# ``tribits_write_package_client_export_files_export_and_install_targets()`` +# which is called after this function. This allows this function +# ``tribits_write_package_client_export_files()`` to be run in unit testing +# with a `cmake -P` script. # function(tribits_write_flexible_package_client_export_files) @@ -525,25 +537,35 @@ function(tribits_append_dependent_package_config_file_includes_and_enables_str p # Include configurations of dependent packages string(APPEND configFileStr "\n# Include configuration of dependent packages\n") + set(DOLLAR "$") + set(externalPkgsDir + "${DOLLAR}{CMAKE_CURRENT_LIST_DIR}/../../${${PROJECT_NAME}_BUILD_DIR_EXTERNAL_PKGS_DIR}") foreach(depPkg IN LISTS ${packageName}_LIB_ENABLED_DEPENDENCIES) - set(packageConfigBaseDir "") # Initially, no add include() + set(findDepPkgCode "") # Start out not including anything if (${depPkg}_PACKAGE_BUILD_STATUS STREQUAL "INTERNAL") - set(packageConfigBaseDir "\${CMAKE_CURRENT_LIST_DIR}/../${depPkg}") + set(findDepPkgCode + " include(\"${DOLLAR}{CMAKE_CURRENT_LIST_DIR}/../${depPkg}/${depPkg}Config.cmake\")\n") elseif (${depPkg}_PACKAGE_BUILD_STATUS STREQUAL "EXTERNAL") if (NOT "${${depPkg}_TRIBITS_COMPLIANT_PACKAGE_CONFIG_FILE_DIR}" STREQUAL "") - set(packageConfigBaseDir "${${depPkg}_TRIBITS_COMPLIANT_PACKAGE_CONFIG_FILE_DIR}") + set(findDepPkgCode + " include(\"${${depPkg}_TRIBITS_COMPLIANT_PACKAGE_CONFIG_FILE_DIR}/${depPkg}Config.cmake\")\n") + elseif (${depPkg}_FINDMOD STREQUAL "TRIBITS_PKG") + assert_defined(${depPkg}_CONFIG) + string(APPEND findDepPkgCode + " include(\"${${depPkg}_CONFIG}\")\n" + " set(${depPkg}_CONFIG \"${${depPkg}_CONFIG}\")\n") else() - set(packageConfigBaseDir - "\${CMAKE_CURRENT_LIST_DIR}/../../${${PROJECT_NAME}_BUILD_DIR_EXTERNAL_PKGS_DIR}/${depPkg}") + set(findDepPkgCode + " include(\"${externalPkgsDir}/${depPkg}/${depPkg}Config.cmake\")\n") endif() else() message(FATAL_ERROR "ERROR:" " ${depPkg}_PACKAGE_BUILD_STATUS='${${depPkg}_PACKAGE_BUILD_STATUS}' invalid!") endif() - if (packageConfigBaseDir) + if (findDepPkgCode) string(APPEND configFileStr "if (NOT TARGET ${depPkg}::all_libs)\n" - " include(\"${packageConfigBaseDir}/${depPkg}Config.cmake\")\n" + "${findDepPkgCode}" "endif()\n" ) endif() diff --git a/cmake/tribits/core/package_arch/TribitsPackageDefineDependencies.cmake b/cmake/tribits/core/package_arch/TribitsPackageDefineDependencies.cmake index c2136eb745..5f916c10e9 100644 --- a/cmake/tribits/core/package_arch/TribitsPackageDefineDependencies.cmake +++ b/cmake/tribits/core/package_arch/TribitsPackageDefineDependencies.cmake @@ -57,12 +57,12 @@ include(TribitsGeneralMacros) # [LIB_OPTIONAL_TPLS ...] # [TEST_REQUIRED_TPLS ...] # [TEST_OPTIONAL_TPLS ...] -# [REGRESSION_EMAIL_LIST ] # [SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS # # # ... # ] +# [REGRESSION_EMAIL_LIST ] # ) # # Every argument in this macro is optional (that is, an package can have no @@ -84,9 +84,9 @@ include(TribitsGeneralMacros) # ``TEST_REQUIRED_PACKAGES`` # # List of additional upstream packages that must be enabled in order to -# build and/or run the tests and/or examples in this package. If any -# of these upstream packages are not enabled, then there will be no -# tests or examples defined or run for this package. +# build and/or run the tests and/or examples in this package. If any of +# these upstream packages are not enabled, then there will be no tests or +# examples defined or run for this package. # # ``TEST_OPTIONAL_PACKAGES`` # @@ -94,39 +94,52 @@ include(TribitsGeneralMacros) # tests in this package. These upstream packages need not be enabled in # order to run some basic tests or examples for this package. Typically, # extra tests that depend on optional test packages involve integration -# testing of some type. +# testing of some type. Not enabling these optional upstream packages +# will result in diminished tests or examples. # # ``LIB_REQUIRED_TPLS`` # -# List of required upstream TPLs that must be enabled in order to build -# and use the libraries (or capabilities) in this package. +# **DEPRECATED:** List of required upstream TPLs that must be enabled in +# order to build and use the libraries (or capabilities) in this package. +# (Add these to ``LIB_REQUIRED_PACKAGES`` instead.) # # ``LIB_OPTIONAL_TPLS`` # -# List of additional optional upstream TPLs that can be used in this -# package if enabled. These upstream TPLs need not be enabled in order to -# use this package but not enabling one or more of these optional upstream -# TPLs will result in diminished capabilities of this package. +# **DEPRECATED:** List of additional optional upstream TPLs that can be +# used in this package if enabled. These upstream TPLs need not be +# enabled in order to use this package but not enabling one or more of +# these optional upstream TPLs will result in diminished capabilities of +# this package. (Add these to ``LIB_OPTIONAL_PACKAGES`` instead.) # # ``TEST_REQUIRED_TPLS`` # -# List of additional upstream TPLs that must be enabled in order to build -# and/or run the tests and/or examples in this package. If any of -# these upstream TPLs are not enabled, then there will be no tests or -# examples defined or run for this package. +# **DEPRECATED:** List of additional upstream TPLs that must be enabled in +# order to build and/or run the tests and/or examples in this package. If +# any of these upstream TPLs are not enabled, then there will be no tests +# or examples defined or run for this package. (Add these to +# ``TEST_REQUIRED_PACKAGES`` instead.) # # ``TEST_OPTIONAL_TPLS`` # -# List of additional optional upstream TPLs that can be used by the tests -# in this package. These upstream TPLs need not be enabled in order to -# run basic tests for this package. Typically, extra tests that depend -# on optional TPLs involve integration testing or some additional testing -# of some type. +# **DEPRECATED:** List of additional optional upstream TPLs that can be +# used by the tests in this package. These upstream TPLs need not be +# enabled in order to run basic tests for this package. Typically, extra +# tests that depend on optional TPLs involve integration testing or some +# additional testing of some type. (Add these to +# ``TEST_OPTIONAL_PACKAGES`` instead.) +# +# NOTE: The above ``XXX_TPLS`` arguments/lists are **deprecated**. At the +# package level, there is no distinction between upstream internal and +# external packages/TPLs, so all upstream package dependencies can (and should) +# be listed in the ``XXX_PACKAGES`` arguments/lists. (There is no change in +# behavior listing upstream packages in ``XXX_PACKAGES`` or the ``XXX_TPLS`` +# arguments/lists.) # # Only upstream packages can be listed (as defined by the order the packages # are listed in `tribits_repository_define_packages()`_ in the -# `/PackagesList.cmake`_ file). Otherwise an error will occur and -# processing will stop. Misspelled package names are caught as well. +# `/PackagesList.cmake`_ or `/TPLsList.cmake`_ files). +# Otherwise an error will occur and processing will stop. Misspelled package +# names are caught as well. # # Only direct package dependencies need to be listed. Indirect package # dependencies are automatically handled. For example, if this package @@ -136,26 +149,20 @@ include(TribitsGeneralMacros) # The dependency on ``PKG1`` will be taken care of automatically by the # TriBITS dependency management system. # -# However, currently, all TPL dependencies must be listed, even the indirect -# ones. This is a requirement that will be dropped in a future version of -# TriBITS. -# # The packages listed in ``LIB_REQUIRED_PACKAGES`` are implicitly also # dependencies in ``TEST_REQUIRED_PACKAGES``. Likewise # ``LIB_OPTIONAL_PACKAGES`` are implicitly also dependencies in -# ``TEST_OPTIONAL_PACKAGES``. Same goes for TPL dependencies. +# ``TEST_OPTIONAL_PACKAGES``. # # The upstream dependencies within a single list do not need to be listed in -# any order. For example if ``PKG2`` depends on ``PKG1``, and this given -# package depends on both, then one can list:: +# any particular order. For example, if ``PKG2`` depends on ``PKG1``, and +# this given package depends on both, then one can list the dependencies as:: # # LIB_REQUIRED_PACKAGES PKG2 PKG1 # # or:: # -# "LIB_REQUIRED_PACKAGES PKG1 PKG2 -# -# Likewise the order that dependent TPLs are listed is not significant. +# LIB_REQUIRED_PACKAGES PKG1 PKG2 # # If some upstream packages are allowed to be missing, this can be specified # by calling the macro `tribits_allow_missing_external_packages()`_. @@ -199,27 +206,6 @@ include(TribitsGeneralMacros) # argument is missing, then the email list that CDash errors go to is # determined by other means (see `CDash regression email addresses`_). # -# NOTE: All this macro really does is to just define the variables: -# -# * ``LIB_REQUIRED_DEP_PACKAGES`` -# * ``LIB_OPTIONAL_DEP_PACKAGES`` -# * ``TEST_REQUIRED_DEP_PACKAGES`` -# * ``TEST_OPTIONAL_DEP_PACKAGES`` -# * ``LIB_REQUIRED_DEP_TPLS`` -# * ``LIB_OPTIONAL_DEP_TPLS`` -# * ``TEST_REQUIRED_DEP_TPLS`` -# * ``TEST_OPTIONAL_DEP_TPLS`` -# * ``REGRESSION_EMAIL_LIST`` -# * ``SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS`` -# -# which are then read by the TriBITS cmake code to build the package -# dependency graph. The advantage of using this macro instead of just -# directly setting the variables is that an package only needs to list -# dependencies that exist. Otherwise, the ``Dependencies.cmake`` file will -# need to set all of the above local variables, even those that are empty. -# This is an error checking property of the TriBITS system to avoid misspelling -# the names of these variables. -# macro(tribits_package_define_dependencies) cmake_parse_arguments( diff --git a/cmake/tribits/core/package_arch/TribitsPackageDependencies.cmake b/cmake/tribits/core/package_arch/TribitsPackageDependencies.cmake index 0f4a956dd7..5f2e31595b 100644 --- a/cmake/tribits/core/package_arch/TribitsPackageDependencies.cmake +++ b/cmake/tribits/core/package_arch/TribitsPackageDependencies.cmake @@ -50,7 +50,8 @@ include_guard() -include(TribitsCMakePolicies NO_POLICY_SCOPE) +include("${CMAKE_CURRENT_LIST_DIR}/../common/TribitsCMakePolicies.cmake" + NO_POLICY_SCOPE) include(TribitsParseArgumentsHelpers) include(MessageWrapper) diff --git a/cmake/tribits/core/package_arch/TribitsPackageMacros.cmake b/cmake/tribits/core/package_arch/TribitsPackageMacros.cmake index 0a091c4d2d..d7931c4067 100644 --- a/cmake/tribits/core/package_arch/TribitsPackageMacros.cmake +++ b/cmake/tribits/core/package_arch/TribitsPackageMacros.cmake @@ -51,13 +51,14 @@ include(PrependGlobalSet) include(RemoveGlobalDuplicates) include(TribitsGatherBuildTargets) +include("${CMAKE_CURRENT_LIST_DIR}/../test_support/TribitsAddTest.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/../test_support/TribitsAddAdvancedTest.cmake") + include(TribitsAddOptionAndDefine) include(TribitsPkgExportCacheVars) include(TribitsLibraryMacros) include(TribitsAddExecutable) include(TribitsAddExecutableAndTest) -include(TribitsAddTest) -include(TribitsAddAdvancedTest) include(TribitsCopyFilesToBinaryDir) include(TribitsReportInvalidTribitsUsage) diff --git a/cmake/tribits/core/package_arch/TribitsPackagingSupport.cmake b/cmake/tribits/core/package_arch/TribitsPackagingSupport.cmake new file mode 100644 index 0000000000..e4dc246368 --- /dev/null +++ b/cmake/tribits/core/package_arch/TribitsPackagingSupport.cmake @@ -0,0 +1,354 @@ +# @HEADER +# ************************************************************************ +# +# TriBITS: Tribal Build, Integrate, and Test System +# Copyright 2013 Sandia Corporation +# +# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +# the U.S. Government retains certain rights in this software. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. Neither the name of the Corporation nor the names of the +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# ************************************************************************ +# @HEADER + + +# TriBITS package_arch includes +include(TribitsConfigureTiming) +include(TribitsGetPackageSublists) + +# TriBITS utils includes +include(FindListElement) + + +# @MACRO: tribits_exclude_files() +# +# Exclude package files/dirs from the source distribution by appending +# ``CPACK_SOURCE_IGNORE_FILES``. +# +# Usage:: +# +# tribits_exclude_files( ...) +# +# This is called in the top-level parent package's +# `/CMakeLists.txt`_ file and each file or directory name +# ```` is actually interpreted by CMake/CPack as a regex that is +# prefixed by the project's and package's source directory names so as to not +# exclude files and directories of the same name and path from other packages. +# If ```` is an absolute path it is not prefixed but is appended to +# ``CPACK_SOURCE_IGNORE_FILES`` unmodified. +# +# In general, do **NOT** put in excludes for files and directories that are +# not under this package's source tree. If the given package is not enabled, +# then this command will never be called! For example, don't put in excludes +# for PackageB's files in PackageA's ``CMakeLists.txt`` file because if +# PackageB is enabled but PackageA is not, the excludes for PackageB will +# never get added to ``CPACK_SOURCE_IGNORE_FILES``. +# +# Also, be careful to note that the ```` arguments are actually regexes +# and one must be very careful to understand how CPack will use these regexes +# to match files that get excluded from the tarball. For more details, see +# `Creating Source Distributions`_. +# +macro(tribits_exclude_files) + + if (NOT "${${PACKAGE_NAME}_PARENT_PACKAGE}" STREQUAL "") + message(FATAL_ERROR + "ERROR: tribits_exclude_files() was called in a subpackage CmakeLists.txt file!" + " Instead, move this call to the file" + " ${${${PACKAGE_NAME}_PARENT_PACKAGE}_SOURCE_DIR}/CMakeLists.txt" + " and adjust the paths accordingly!" ) + endif() + + set(FILES_TO_EXCLUDE ${ARGN}) + + # Need to add "///" to each file to prevent + # someone from trying to exclude a file like "readme" and having it + # inadvertently exclude a file matching that name in another package. + set(MODIFIED_FILES_TO_EXCLUDE "") + + set(${PROJECT_NAME}_SOURCE_PATH ${${PROJECT_NAME}_SOURCE_DIR}) + + foreach(FILE ${FILES_TO_EXCLUDE}) + #Ensure that if the full path was specified for the file that we don't add + #"///" again. + set(MATCH_STRING "${${PACKAGE_NAME}_SOURCE_DIR}") + string(REGEX MATCH ${MATCH_STRING} MATCHED ${FILE} ) + if(NOT MATCHED) + list(APPEND MODIFIED_FILES_TO_EXCLUDE + "${${PACKAGE_NAME}_SOURCE_DIR}/${FILE}") + else() + list(APPEND MODIFIED_FILES_TO_EXCLUDE ${FILE}) + endif() + endforeach() + +#Leaving in for debugging purposes +# message("List of files being excluded for package ${PACKAGE_NAME}") +# foreach(NEW_FILE ${MODIFIED_FILES_TO_EXCLUDE}) +# message(${NEW_FILE}) +# endforeach() + + list(APPEND CPACK_SOURCE_IGNORE_FILES ${MODIFIED_FILES_TO_EXCLUDE}) + if (NOT ${PROJECT_NAME}_BINARY_DIR STREQUAL ${PACKAGE_NAME}_BINARY_DIR) + set(CPACK_SOURCE_IGNORE_FILES ${CPACK_SOURCE_IGNORE_FILES} PARENT_SCOPE) + endif() + +endmacro() + + +# Set up for packaging and distribution +# +macro(tribits_setup_packaging_and_distribution) + + tribits_config_code_start_timer(CPACK_SETUP_TIME_START_SECONDS) + + # K.1) Run callback function for the base project. + + tribits_project_define_packaging_runner() + # The above must define the basic project settings for CPACK that are + # specific to the project and should not be provided by the user. + + # K.2) Removing any packages or packages not enabled from the tarball + + if (${PROJECT_NAME}_EXCLUDE_DISABLED_SUBPACKAGES_FROM_DISTRIBUTION) + set(tribitsPackageList ${${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES}) + else() + set(tribitsPackageList ${${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES}) + endif() + + tribits_get_sublist_nonenabled(tribitsPackageList nonEnabledTribitsPackage "") + + foreach(TRIBITS_PACKAGE ${nonEnabledTribitsPackage}) + + # Determine if this is a package to not ignore + find_list_element(TRIBITS_CPACK_PACKAGES_TO_NOT_IGNORE + ${TRIBITS_PACKAGE} TRIBITS_PACKAGE_DONT_IGNORE) + + if (NOT TRIBITS_PACKAGE_DONT_IGNORE) + + # Checking if we have a relative path to the package's files. Since the + # exclude is a regular expression any "../" will be interpreted as / which would never match the package's actual + # directory. There isn't a direct way in cmake to convert a relative + # path into an absolute path with string operations so as a way of + # making sure that we get the correct path of the package we use a + # find_path for the CMakeLists.txt file for the package. Since the + # package has to have this file to work correctly it should be + # guaranteed to be there. + string(REGEX MATCH "[.][.]/" RELATIVE_PATH_CHARS_MATCH + ${${TRIBITS_PACKAGE}_REL_SOURCE_DIR}) + if ("${RELATIVE_PATH_CHARS_MATCH}" STREQUAL "") + list(PREPEND CPACK_SOURCE_IGNORE_FILES + "${PROJECT_SOURCE_DIR}/${${TRIBITS_PACKAGE}_REL_SOURCE_DIR}/") + else() + find_path(ABSOLUTE_PATH CMakeLists.txt PATHS + "${PROJECT_SOURCE_DIR}/${${TRIBITS_PACKAGE}_REL_SOURCE_DIR}" + NO_DEFAULT_PATH) + if ("${ABSOLUTE_PATH}" STREQUAL "ABSOLUTE_PATH-NOTFOUND") + message(AUTHOR_WARNING "Relative path found for disabled package" + " ${TRIBITS_PACKAGE} but package was missing a CMakeLists.txt file." + " This disabled package will likely not be excluded from a source release") + endif() + list(PREPEND CPACK_SOURCE_IGNORE_FILES "${ABSOLUTE_PATH}") + endif() + endif() + + endforeach() + + # Add excludes for VC files/dirs + list(APPEND CPACK_SOURCE_IGNORE_FILES + /[.]git/ + [.]gitignore$ + ) + + # K.3) Set up install component dependencies + + tribits_get_sublist_enabled( + ${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES + enabledInternalToplevelPackages "") + + foreach(pkgName ${enabledInternalToplevelPackages}) + if(NOT "${${pkgName}_LIB_ENABLED_DEPENDENCIES}" STREQUAL "") + string(TOUPPER ${pkgName} upperPkgName) + set(CPACK_COMPONENT_${upperPkgName}_DEPENDS ${${pkgName}_LIB_ENABLED_DEPENDENCIES}) + # ToDo: The above needs to be changed to the list of *internal* enabled + # package dependencies! (But there are no tests for this currently and + # I am not sure who is using this.) + endif() + endforeach() + + # K.4) Resetting the name to avoid overwriting registry keys when installing + + if(WIN32) + set(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-${${PROJECT_NAME}_VERSION}") + if (TPL_ENABLE_MPI) + set(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-mpi") + ELSE () + set(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-serial") + endif() + set(CPACK_GENERATOR "NSIS") + set(CPACK_NSIS_MODIFY_PATH OFF) + endif() + + # K.5) Determine the source generator + if ("${${PROJECT_NAME}_CPACK_SOURCE_GENERATOR_DEFAULT}" STREQUAL "") + set(${PROJECT_NAME}_CPACK_SOURCE_GENERATOR_DEFAULT "TGZ") + endif() + set(${PROJECT_NAME}_CPACK_SOURCE_GENERATOR + ${${PROJECT_NAME}_CPACK_SOURCE_GENERATOR_DEFAULT} + CACHE STRING + "The types of source generators to use for CPACK_SOURCE_GENERATOR.") + set(CPACK_SOURCE_GENERATOR ${${PROJECT_NAME}_CPACK_SOURCE_GENERATOR}) + + # K.6) Loop through the Repositories and run their callback functions. + foreach(REPO ${${PROJECT_NAME}_ALL_REPOSITORIES}) + tribits_get_repo_name_dir(${REPO} REPO_NAME REPO_DIR) + if (${PROJECT_NAME}_VERBOSE_CONFIGURE) + message("Processing packaging call-backs for ${REPO_NAME}") + endif() + tribits_repository_define_packaging_runner(${REPO_NAME}) + endforeach() + + # K.7) Include RepoVersion.txt if generated + set(PROJECT_REPO_VERSION_FILE + "${CMAKE_CURRENT_BINARY_DIR}/${${PROJECT_NAME}_REPO_VERSION_FILE_NAME}") + if (EXISTS "${PROJECT_REPO_VERSION_FILE}") + foreach(SOURCE_GEN ${CPACK_SOURCE_GENERATOR}) + set(CPACK_INSTALL_COMMANDS ${CPACK_INSTALL_COMMANDS} + "${CMAKE_COMMAND} -E copy '${PROJECT_REPO_VERSION_FILE}' '${CMAKE_CURRENT_BINARY_DIR}/_CPack_Packages/Linux-Source/${SOURCE_GEN}/${CPACK_PACKAGE_NAME}-${${PROJECT_NAME}_VERSION}-Source/${${PROJECT_NAME}_REPO_VERSION_FILE_NAME}'") + endforeach() + endif() + + # Print the set of excluded files + if(${PROJECT_NAME}_VERBOSE_CONFIGURE OR + ${PROJECT_NAME}_DUMP_CPACK_SOURCE_IGNORE_FILES + ) + message("Exclude files when building source packages:") + foreach(item IN LISTS CPACK_SOURCE_IGNORE_FILES) + message(${item}) + endforeach() + endif() + + # K.8) Finally process with CPack + include(CPack) + + tribits_config_code_stop_timer(CPACK_SETUP_TIME_START_SECONDS + "Total time to set up for CPack packaging") + +endmacro() + + +macro(tribits_project_define_packaging_runner) + set(CALLBACK_DEFINE_PACKAGING_FILE + "${PROJECT_SOURCE_DIR}/cmake/CallbackDefineProjectPackaging.cmake") + #print_var(CALLBACK_DEFINE_PACKAGING_FILE) + if (EXISTS ${CALLBACK_DEFINE_PACKAGING_FILE}) + if (${PROJECT_NAME}_VERBOSE_CONFIGURE) + message("Processing call-back file and macros in" + " '${CALLBACK_DEFINE_PACKAGING_FILE}'") + endif() + # Define the callback macros as empty in case it is not defined + # in this file. + create_empty_tribits_project_define_packaging() + # Include the file which will define the callback macros + tribits_trace_file_processing(PROJECT INCLUDE + "${CALLBACK_DEFINE_PACKAGING_FILE}") + include(${CALLBACK_DEFINE_PACKAGING_FILE}) + # Call the callback macros to inject project-specific behavir + tribits_project_define_packaging() + # Set back the callback macros to empty to ensure that no-one calls them + create_empty_tribits_project_define_packaging() + endif() +endmacro() + + +macro(create_empty_tribits_repository_setup_extra_options) + macro(tribits_repository_setup_extra_options) + endmacro() +endmacro() + + +macro(tribits_repository_setup_extra_options_runner REPO_NAME) + set(CALLBACK_SETUP_EXTRA_OPTIONS_FILE + "${${REPO_NAME}_SOURCE_DIR}/cmake/CallbackSetupExtraOptions.cmake") + #print_var(CALLBACK_SETUP_EXTRA_OPTIONS_FILE) + if (EXISTS ${CALLBACK_SETUP_EXTRA_OPTIONS_FILE}) + if (${PROJECT_NAME}_VERBOSE_CONFIGURE) + message("Processing call-back file and macros in" + " '${CALLBACK_SETUP_EXTRA_OPTIONS_FILE}'") + endif() + # Define the callback macros as empty in case it is not defined + # in this file. + create_empty_tribits_repository_setup_extra_options() + # Include the file which will define the callback macros + set(REPOSITORY_NAME ${REPO_NAME}) + tribits_trace_file_processing(REPOSITORY INCLUDE + "${CALLBACK_SETUP_EXTRA_OPTIONS_FILE}") + include(${CALLBACK_SETUP_EXTRA_OPTIONS_FILE}) + # Call the callback macros to inject repository-specific behavir + tribits_repository_setup_extra_options() + # Set back the callback macros to empty to ensure that nonone calls them + create_empty_tribits_repository_setup_extra_options() + endif() +endmacro() + + +macro(create_empty_tribits_repository_define_packaging) + macro(tribits_repository_define_packaging) + endmacro() +endmacro() + + +macro(tribits_repository_define_packaging_runner REPO_NAME) + set(CALLBACK_DEFINE_PACKAGING_FILE + "${${REPO_NAME}_SOURCE_DIR}/cmake/CallbackDefineRepositoryPackaging.cmake") + #print_var(CALLBACK_DEFINE_PACKAGING_FILE) + if (EXISTS ${CALLBACK_DEFINE_PACKAGING_FILE}) + if (${PROJECT_NAME}_VERBOSE_CONFIGURE) + message("Processing call-back file and macros in" + " '${CALLBACK_DEFINE_PACKAGING_FILE}'") + endif() + # Define the callback macros as empty in case it is not defined + # in this file. + create_empty_tribits_repository_define_packaging() + # Include the file which will define the callback macros + tribits_trace_file_processing(REPOSITORY INCLUDE + "${CALLBACK_DEFINE_PACKAGING_FILE}") + include(${CALLBACK_DEFINE_PACKAGING_FILE}) + # Call the callback macros to inject repository-specific behavir + tribits_repository_define_packaging() + # Set back the callback macros to empty to ensure that nonone calls them + create_empty_tribits_repository_define_packaging() + endif() +endmacro() + + +macro(create_empty_tribits_project_define_packaging) + macro(tribits_project_define_packaging) + endmacro() +endmacro() diff --git a/cmake/tribits/core/package_arch/TribitsProcessEnabledTpls.cmake b/cmake/tribits/core/package_arch/TribitsProcessEnabledTpls.cmake index b161a9edef..bcc591d638 100644 --- a/cmake/tribits/core/package_arch/TribitsProcessEnabledTpls.cmake +++ b/cmake/tribits/core/package_arch/TribitsProcessEnabledTpls.cmake @@ -43,13 +43,20 @@ include(TribitsExternalPackageWithImportedTargetsFindTplModuleHelpers) include(TribitsExternalPackageWriteConfigFile) include(TribitsTplFindIncludeDirsAndLibraries) include(TribitsGeneralMacros) +include(TribitsConfigureTiming) # Standard TriBITS utilities includes include(AppendStringVar) include(TribitsStandardizePaths) +include(TribitsCreateReverseList) -# Gather information from enabled TPLs +# @MACRO: tribits_process_enabled_tpls() +# +# Gather information and targets from enabled TPLs +# +# For more info, see `Processing of external packages/TPLs and +# TriBITS-compliant external packages`_. # macro(tribits_process_enabled_tpls) @@ -65,10 +72,13 @@ macro(tribits_process_enabled_tpls) if (projectHasTribitsCompliantExternalPackages) message("") message("Getting information for all enabled TriBITS-compliant" - " or upstream external packages/TPLs ...") + " or upstream external packages/TPLs in reverse order ...") message("") - foreach(TPL_NAME IN LISTS ${PROJECT_NAME}_enabledExternalTopLevelPackages) + tribits_create_reverse_list(${PROJECT_NAME}_enabledExternalTopLevelPackages + ${PROJECT_NAME}_reverseEnabledExternalTopLevelPackages) + + foreach(TPL_NAME IN LISTS ${PROJECT_NAME}_reverseEnabledExternalTopLevelPackages) if (${TPL_NAME}_IS_TRIBITS_COMPLIANT OR ${TPL_NAME}_PROCESSED_BY_DOWNSTREAM_TRIBITS_EXTERNAL_PACKAGE ) @@ -108,16 +118,37 @@ macro(tribits_process_enabled_tribits_compliant_or_upstream_tpl TPL_NAME) message("${tplProcessingString}") if (NOT ${PROJECT_NAME}_TRACE_DEPENDENCY_HANDLING_ONLY) - if (NOT ${TPL_NAME}_PROCESSED_BY_DOWNSTREAM_TRIBITS_EXTERNAL_PACKAGE) + if ( (NOT TARGET ${TPL_NAME}::all_libs) AND ${TPL_NAME}_IS_TRIBITS_COMPLIANT ) tribits_process_enabled_tribits_compliant_tpl(${TPL_NAME}) - else() + set(${TPL_NAME}_PROCESSED_BY_DOWNSTREAM_TRIBITS_EXTERNAL_PACKAGE FALSE) + elseif (TARGET ${TPL_NAME}::all_libs) + message("-- " + "The external package/TPL ${TPL_NAME} was defined by a downstream" + " TriBITS-compliant external package already processed") + elseif (${TPL_NAME}_FINDMOD AND (NOT ${TPL_NAME}_FINDMOD STREQUAL "TRIBITS_PKG")) message("-- " - "The external package/TPL ${TPL_NAME} will be read in by a downstream" - " TriBITS-compliant external package") + "The external package/TPL ${TPL_NAME} was *NOT* defined by a downstream" + " TriBITS-compliant external package and must be found again in below loop") + set(${TPL_NAME}_PROCESSED_BY_DOWNSTREAM_TRIBITS_EXTERNAL_PACKAGE FALSE) + else() + message(FATAL_ERROR + "Error, the external package/TPL ${TPL_NAME} was *NOT* defined by a downstream" + " TriBITS-compliant external package and has not find module!") endif() endif() endmacro() +# NOTE: Above, handles the case where an upstream external package/TPL should +# have been defined a downstream external package that was already processed +# but it was not defined (because the downstream packages was not a fully +# TriBITS-compliant external package). For a TriBITS-compliant external +# package/TPL that should have been defined by a downstream TriBITS-compliant +# an external package/TPL, the first if-statement above takes care of that +# case by calling find_package(${TPL_NAME}) (because ${TPL_NAME}::all_libs +# will not be defined). However, if the upstream external package/TPL is +# *NOT* TriBITS-compliant, then it may be a legacy TriBITS TPL which means +# that it must be processed in ascending order in order to build the +# downstream TriBITS TPLs correctly. # @MACRO: tribits_process_enabled_standard_tpl() @@ -160,13 +191,19 @@ function(tribits_get_enabled_tpl_processing_string TPL_NAME tplProcessingStrin endfunction() -# Process an enabled TPL defined using a TriBITS-compliant external -# packages Config.cmake file +# Process an enabled TPL defined using a TriBITS-compliant external package +# Config.cmake file # macro(tribits_process_enabled_tribits_compliant_tpl TPL_NAME) message("-- " "Calling find_package(${TPL_NAME}) for TriBITS-compliant external package") find_package(${TPL_NAME} CONFIG REQUIRED) + if (${TPL_NAME}_DIR) + message("-- " "Found ${TPL_NAME}_DIR='${${TPL_NAME}_DIR}'") + else() + message(FATAL_ERROR + "ERROR! Failed to find TriBITS-compliant external package ${TPL_NAME}!") + endif() endmacro() diff --git a/cmake/tribits/core/package_arch/TribitsProcessPackagesAndDirsLists.cmake b/cmake/tribits/core/package_arch/TribitsProcessPackagesAndDirsLists.cmake index 447f98265c..4fd5f1d96b 100644 --- a/cmake/tribits/core/package_arch/TribitsProcessPackagesAndDirsLists.cmake +++ b/cmake/tribits/core/package_arch/TribitsProcessPackagesAndDirsLists.cmake @@ -535,7 +535,8 @@ macro(tribits_process_packages_and_dirs_lists REPOSITORY_NAME REPOSITORY_DIR) endif() - if (EXISTS ${PACKAGE_ABS_DIR}) + set(packageDependenciesFile "${PACKAGE_ABS_DIR}/cmake/Dependencies.cmake") + if (EXISTS "${packageDependenciesFile}") set(PACKAGE_EXISTS TRUE) else() set(PACKAGE_EXISTS FALSE) @@ -557,9 +558,16 @@ macro(tribits_process_packages_and_dirs_lists REPOSITORY_NAME REPOSITORY_DIR) ) message( "\n***" - "\n*** Error, the package ${TRIBITS_PACKAGE} directory ${PACKAGE_ABS_DIR} does not exist!" + "\n*** Error, the package ${TRIBITS_PACKAGE} dependencies file" + " '${packageDependenciesFile}' does *NOT* exist!" "\n***\n" ) message(FATAL_ERROR "Stopping due to above error!") + elseif((NOT PACKAGE_EXISTS) AND (EXISTS "${PACKAGE_ABS_DIR}") + AND (${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES STREQUAL "WARNING") + ) + message(WARNING "${TRIBITS_PACKAGE}: Package base directory '${PACKAGE_ABS_DIR}'" + " exists but the dependencies file '${packageDependenciesFile}' does *NOT*" + " exist! Package is being ignored anyway!") endif() if (PACKAGE_EXISTS OR ${PROJECT_NAME}_IGNORE_PACKAGE_EXISTS_CHECK) diff --git a/cmake/tribits/core/package_arch/TribitsProcessTplsLists.cmake b/cmake/tribits/core/package_arch/TribitsProcessTplsLists.cmake index f5e5a6e55d..a30a094045 100644 --- a/cmake/tribits/core/package_arch/TribitsProcessTplsLists.cmake +++ b/cmake/tribits/core/package_arch/TribitsProcessTplsLists.cmake @@ -38,7 +38,7 @@ # @HEADER -include(TribitsConstants) +include("${CMAKE_CURRENT_LIST_DIR}/../common/TribitsConstants.cmake") include(TribitsListHelpers) include(PrintVar) diff --git a/cmake/tribits/core/package_arch/TribitsProject.cmake b/cmake/tribits/core/package_arch/TribitsProject.cmake index 035e089e3a..c2385f1665 100644 --- a/cmake/tribits/core/package_arch/TribitsProject.cmake +++ b/cmake/tribits/core/package_arch/TribitsProject.cmake @@ -66,7 +66,7 @@ if (${PROJECT_NAME}_VERBOSE_CONFIGURE) endif() # Overrides that we have for CMake functions -include(TribitsCMakePolicies NO_POLICY_SCOPE) +include("${CMAKE_CURRENT_LIST_DIR}/../common/TribitsCMakePolicies.cmake" NO_POLICY_SCOPE) include(TribitsProjectImpl) diff --git a/cmake/tribits/core/package_arch/TribitsProjectImpl.cmake b/cmake/tribits/core/package_arch/TribitsProjectImpl.cmake index f27caa3e66..8eab07d42c 100644 --- a/cmake/tribits/core/package_arch/TribitsProjectImpl.cmake +++ b/cmake/tribits/core/package_arch/TribitsProjectImpl.cmake @@ -47,6 +47,8 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${${PROJECT_NAME}_TRIBITS_DIR}/core/utils + ${${PROJECT_NAME}_TRIBITS_DIR}/core/common + ${${PROJECT_NAME}_TRIBITS_DIR}/core/test_support ${${PROJECT_NAME}_TRIBITS_DIR}/core/package_arch ${${PROJECT_NAME}_TRIBITS_DIR}/core/config_tests ${${PROJECT_NAME}_TRIBITS_DIR}/core/modules @@ -57,10 +59,11 @@ if (${PROJECT_NAME}_VERBOSE_CONFIGURE) message("CMAKE_MODULE_PATH='${CMAKE_MODULE_PATH}'") endif() -include(TribitsConstants) +include("${CMAKE_CURRENT_LIST_DIR}/../common/TribitsConstants.cmake") tribits_asesrt_minimum_cmake_version() -include(TribitsCMakePolicies NO_POLICY_SCOPE) +include("${CMAKE_CURRENT_LIST_DIR}/../common/TribitsCMakePolicies.cmake" NO_POLICY_SCOPE) +# TriBITS package_arch includes include(TribitsIncludeDirectories) include(TribitsFindPythonInterp) include(TribitsGlobalMacros) @@ -68,7 +71,10 @@ include(TribitsConfigureCTestCustom) include(TribitsGenerateResourceSpecFile) include(TribitsPackageDependencies) include(TribitsPrintDependencyInfo) +include(TribitsPackagingSupport) +include(TribitsConfigureTiming) +# TriBITS utils includes include(AdvancedSet) include(AdvancedOption) include(TimingUtils) diff --git a/cmake/tribits/core/package_arch/TribitsReadAllProjectDepsFilesCreateDepsGraph.cmake b/cmake/tribits/core/package_arch/TribitsReadAllProjectDepsFilesCreateDepsGraph.cmake index 2b71d82885..14175ee5ad 100644 --- a/cmake/tribits/core/package_arch/TribitsReadAllProjectDepsFilesCreateDepsGraph.cmake +++ b/cmake/tribits/core/package_arch/TribitsReadAllProjectDepsFilesCreateDepsGraph.cmake @@ -39,11 +39,12 @@ # Standard TriBITS system includes -include(TribitsConstants) +include("${CMAKE_CURRENT_LIST_DIR}/../common/TribitsConstants.cmake") include(TribitsProcessExtraRepositoriesList) include(TribitsProcessPackagesAndDirsLists) include(TribitsProcessTplsLists) include(TribitsReadDepsFilesCreateDepsGraph) +include(TribitsConfigureTiming) # Standard TriBITS utilities includes include(TimingUtils) diff --git a/cmake/tribits/core/package_arch/TribitsReadDepsFilesCreateDepsGraph.cmake b/cmake/tribits/core/package_arch/TribitsReadDepsFilesCreateDepsGraph.cmake index 4c193adeff..43b0063368 100644 --- a/cmake/tribits/core/package_arch/TribitsReadDepsFilesCreateDepsGraph.cmake +++ b/cmake/tribits/core/package_arch/TribitsReadDepsFilesCreateDepsGraph.cmake @@ -182,8 +182,7 @@ macro(tribits_read_all_package_deps_files_create_deps_graph) set(${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES "") # Packages and subpackages foreach(TRIBITS_PACKAGE IN LISTS ${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES) - tribits_read_toplevel_package_deps_files_add_to_graph(${TRIBITS_PACKAGE} - ${${TRIBITS_PACKAGE}_REL_SOURCE_DIR}) + tribits_read_toplevel_package_deps_files_add_to_graph(${TRIBITS_PACKAGE}) endforeach() list(LENGTH ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES @@ -456,15 +455,21 @@ macro(tribits_process_package_dependencies_lists packageName) set(${packageName}_LIB_DEFINED_DEPENDENCIES "") set(${packageName}_TEST_DEFINED_DEPENDENCIES "") + # Append the XXX_TPLS list on the end of the XXX_PACKAGES list + list(APPEND LIB_REQUIRED_DEP_PACKAGES ${LIB_REQUIRED_DEP_TPLS}) + list(APPEND LIB_OPTIONAL_DEP_PACKAGES ${LIB_OPTIONAL_DEP_TPLS}) + list(APPEND TEST_REQUIRED_DEP_PACKAGES ${TEST_REQUIRED_DEP_TPLS}) + list(APPEND TEST_OPTIONAL_DEP_PACKAGES ${TEST_OPTIONAL_DEP_TPLS}) + set(LIB_REQUIRED_DEP_TPLS "") + set(LIB_OPTIONAL_DEP_TPLS "") + set(TEST_REQUIRED_DEP_TPLS "") + set(TEST_OPTIONAL_DEP_TPLS "") + # Fill the backward dependency vars tribits_set_dep_packages(${packageName} LIB REQUIRED PACKAGES) tribits_set_dep_packages(${packageName} LIB OPTIONAL PACKAGES) - tribits_set_dep_packages(${packageName} LIB REQUIRED TPLS) - tribits_set_dep_packages(${packageName} LIB OPTIONAL TPLS) tribits_set_dep_packages(${packageName} TEST REQUIRED PACKAGES) tribits_set_dep_packages(${packageName} TEST OPTIONAL PACKAGES) - tribits_set_dep_packages(${packageName} TEST REQUIRED TPLS) - tribits_set_dep_packages(${packageName} TEST OPTIONAL TPLS) # Fill forward deps lists #63 tribits_append_forward_dep_packages(${packageName} LIB) @@ -512,7 +517,7 @@ macro(tribits_set_dep_packages packageName testOrLib requiredOrOptional pkgs if (${depPkg} STREQUAL ${packageName}) tribits_abort_on_self_dep("${packageName}" "${inputListType}") endif() - tribits_is_pkg_defined(${depPkg} ${pkgsOrTpls} depPkgIsDefined) + tribits_is_pkg_defined(${depPkg} depPkgIsDefined) if (depPkgIsDefined) list(APPEND ${packageName}_${testOrLib}_DEFINED_DEPENDENCIES ${depPkg}) if ("${requiredOrOptional}" STREQUAL "REQUIRED") @@ -534,18 +539,12 @@ endmacro() # Determine if a (internal or external) package is defined or not # -function(tribits_is_pkg_defined depPkg pkgsOrTpls depPkgIsDefinedOut) +function(tribits_is_pkg_defined depPkg depPkgIsDefinedOut) set(depPkgIsDefined FALSE) - if (pkgsOrTpls STREQUAL "PACKAGES") - if (${depPkg}_SOURCE_DIR) - set(depPkgIsDefined TRUE) - endif() - elseif(pkgsOrTpls STREQUAL "TPLS") - if (${depPkg}_FINDMOD) - set(depPkgIsDefined TRUE) - endif() - else() - message(FATAL_ERROR "Invalid value for pkgsOrTpls = '${pkgsOrTpls}'") + if (${depPkg}_SOURCE_DIR) + set(depPkgIsDefined TRUE) + elseif(${depPkg}_FINDMOD) + set(depPkgIsDefined TRUE) endif() set(${depPkgIsDefinedOut} ${depPkgIsDefined} PARENT_SCOPE) endfunction() diff --git a/cmake/tribits/core/package_arch/TribitsSystemDataStructuresMacrosFunctions.rst b/cmake/tribits/core/package_arch/TribitsSystemDataStructuresMacrosFunctions.rst index f30a089c67..32e2d10d31 100644 --- a/cmake/tribits/core/package_arch/TribitsSystemDataStructuresMacrosFunctions.rst +++ b/cmake/tribits/core/package_arch/TribitsSystemDataStructuresMacrosFunctions.rst @@ -334,7 +334,9 @@ the dependencies for each external package/TPL and internal package: This list of all **define direct** extra package test required and optional upstream external package/TPL and internal package dependencies. This list is set regardless if the package ``${PACKAGE_NAME}`` is enabled - or not. + or not. NOTE: This list does **not** contain the items in the list + `${PACKAGE_NAME}_LIB_DEFINED_DEPENDENCIES`_ (but those are implicitly also + required/optional test dependencies as well). .. _${PACKAGE_NAME}_TEST_ENABLED_DEPENDENCIES: @@ -460,76 +462,89 @@ Processing of external packages/TPLs and TriBITS-compliant external packages +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ The processing of external packages/TPLs is influenced by whether the external -package is a regular TriBITS TPL or is a TriBITS-compliant external -package. Here, a **TriBITS-Compliant External Package** has a -``Config.cmake`` file that satisfies the following properties: - -* Has the target ``::all_libs``. -* Calls ``find_dependency()`` for all upstream packages it depends on. -* Every upstream dependent package ```` has the target - ``::all_libs``. - -That means that when calling ``find_package()`` for a TriBITS-compliant +package is a regular TriBITS TPL (i.e with a ``FindTPL.cmake`` +modules) or is a TriBITS-compliant external package. Here, a +**TriBITS-Compliant External Package** has a ``Config.cmake`` file +that satisfies the following properties: + +* Has the target ``::all_libs`` which is a fully specified modern + CMake target. +* Calls ``find_dependency()`` or the equivalent for all upstream packages that + it depends on. +* Every upstream dependent package ```` has the target + ``::all_libs``. (But a minimally TriBITS-compliant external + package need not define this for all of its upstream dependencies.) + +That means that when calling ``find_package()`` for a fully TriBITS-compliant external package, there is no need to worry about finding any of its upstream dependent external packages. That means that any external packages/TPLs -defined a TriBITS project which is upstream from a TriBITS-compliant -external package will be uniquely defined by calling ``find_package()`` on the -most downstream TriBITS-compliant external package that depends on it. -Therefore, defining the external packages and their targets in this set of -external packages just involves calling ``find_package()`` on the terminal -TriBITS-compliant external packages (i.e. TriBITS-compliant -external packages that don't have any downstream dependencies that are -external packages). Then the remaining subset of external packages/TPLs that -don't have a downstream TriBITS-compliant external package dependency -will be defined as usual. (ToDo: Put in a more detailed examples explaining -how this works.) +defined a TriBITS project which is upstream from a TriBITS-compliant external +package will be uniquely defined by calling ``find_package()`` on the most +downstream TriBITS-compliant external package that depends on it. Therefore, +defining the external packages and their targets in this set of external +packages just involves calling ``find_package()`` on the terminal +TriBITS-compliant external packages (i.e. TriBITS-compliant external packages +that don't have any downstream dependencies that are external packages). Then +the remaining subset of external packages/TPLs that don't have a downstream +TriBITS-compliant external package dependency will be defined as usual. +(However, as mentioned above, some of these are not fully TriBITS compliant and +don't fully define the ``::all_libs`` for all of their upstream +dependencies (see below).) + +By having all fully TriBITS-compliant external packages, an external +dependency is never found more than once. The variables that are set internally to define these different subsets of external packages/TPLs are: * ``_IS_TRIBITS_COMPLIANT``: Set the ``TRUE`` if the package - ```` provides the ``::all_libs`` target for itself and all - of its upstream dependent (internal or external) packages (whether this - package is treated as an internal or external package). + ```` provides the ``::all_libs`` by just calling + ``find_package( CONFIG REQUIRED)``. * ``_PROCESSED_BY_DOWNSTREAM_TRIBITS_EXTERNAL_PACKAGE``: Set to - ``TRUE`` if the external package/TPL will be processed by downstream TriBITS - compliant package. In this case, we just print that we are skipping the - find operation and explain why. + ``TRUE`` if the external package/TPL should be (or was after the fact) + defined by a downstream TriBITS-compliant external package. An external package with ``_IS_TRIBITS_COMPLIANT=TRUE`` **AND** ``_PROCESSED_BY_DOWNSTREAM_TRIBITS_EXTERNAL_PACKAGE=FALSE`` is the one for which ``find_package( CONFIG REQUIRED)`` will be called and does not have any downstream packages that are being treated as external -packages. +packages. Also, ``find_package( CONFIG REQUIRED)`` will be called on +TriBITS-compliant external packages if ``::all_libs`` was not defined +by a downstream non fully TriBITS-compliant external package. -The variable ``_IS_TRIBITS_COMPLIANT`` is set right when the -packages are initially defined by reading in the various input files. That -is, all initially internal packages that are listed in a +The variable ``_IS_TRIBITS_COMPLIANT`` is set right when the packages +are initially defined by reading in the various input files. That is, all +initially internal packages that are listed in a `/PackagesList.cmake`_ file will have -``_IS_TRIBITS_COMPLIANT=TRUE`` set. While all external -packages/TPLs listed in a `/TPLsList.cmake`_ file will have -``_IS_TRIBITS_COMPLIANT=FALSE`` set (except for those tagged -with ``TRIBITS_PKG`` which will have -``_IS_TRIBITS_COMPLIANT=FALSE`` set). - -NOTE: When a TriBITS TPL (i.e. ``_IS_TRIBITS_COMPLIANT=FALSE``) -is being processed, we can't assume where its -``Config.cmake`` file exists so we must find upstream -dependencies using ``set(_DIR ...)`` and -``find_dependency( CONFIG REQUIRED)``. - -So the first loop over external packages/TPLs will be those external -packages/TPLs that have ``_IS_TRIBITS_COMPLIANT=TRUE`` **OR** -``_PROCESSED_BY_DOWNSTREAM_TRIBITS_EXTERNAL_PACKAGE=TRUE``. And we -only call ``find_package()`` for those TriBITS-compliant external -packages that have ``_IS_TRIBITS_COMPLIANT=TRUE`` **AND** -``_PROCESSED_BY_DOWNSTREAM_TRIBITS_EXTERNAL_PACKAGE=FALSE``. - -The second loop are those external packages/TPLs that don't have a downstream -TriBITS-compliant external package which are all of those external -packages for which ``_IS_TRIBITS_COMPLIANT=FALSE`` **AND** -``_PROCESSED_BY_DOWNSTREAM_TRIBITS_EXTERNAL_PACKAGE=FALSE``. +``_IS_TRIBITS_COMPLIANT=TRUE`` set while all external packages/TPLs +listed in a `/TPLsList.cmake`_ file will have +``_IS_TRIBITS_COMPLIANT=FALSE`` set (except for those tagged with +``TRIBITS_PKG`` which will have ``_IS_TRIBITS_COMPLIANT=FALSE`` set). + +The processing of external packages/TPLs is done in two loops: + +* The first loop over external packages/TPLs will be those external + packages/TPLs that have ``_IS_TRIBITS_COMPLIANT=TRUE`` **OR** + ``_PROCESSED_BY_DOWNSTREAM_TRIBITS_EXTERNAL_PACKAGE=TRUE``. And we + only call ``find_package()`` for those TriBITS-compliant external packages + that have ``_IS_TRIBITS_COMPLIANT=TRUE`` **AND** don't have + ``::all_libs`` already defined. This is a reverse loop to give an + opportunity for downstream TriBITS-compliant external packages to define + their upstream external packages/TPLs. NOTE: If + ``_PROCESSED_BY_DOWNSTREAM_TRIBITS_EXTERNAL_PACKAGE`` was set to + ``TRUE`` before this loop starts, it will be set to ``FALSE`` for + non-TriBITS-compliant external packages + (i.e. ``_IS_TRIBITS_COMPLIANT=FALSE``). + +* The second loop processes remaining external packages/TPLs that where not + defined by a downstream TriBITS-compliant external package in the first + loop. These are all TriBITS TPLs for which + ``_IS_TRIBITS_COMPLIANT=FALSE`` **AND** + ``_PROCESSED_BY_DOWNSTREAM_TRIBITS_EXTERNAL_PACKAGE=FALSE`` **AND** + for which ``_FINDMOD`` is not empty and is not ``TRIBITS_PKG``. + +For more details, see the implementation in `tribits_process_enabled_tpls()`_. Other package-related variables diff --git a/cmake/tribits/core/package_arch/tribits_get_version_date.cmake b/cmake/tribits/core/package_arch/tribits_get_version_date.cmake index c2bcbd1e83..3b941efc4d 100644 --- a/cmake/tribits/core/package_arch/tribits_get_version_date.cmake +++ b/cmake/tribits/core/package_arch/tribits_get_version_date.cmake @@ -11,7 +11,7 @@ # -P tribits_get_version_date.cmake # -cmake_minimum_required(VERSION 3.22.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.23.0 FATAL_ERROR) # A) Validate input diff --git a/cmake/tribits/core/package_arch/TribitsAddAdvancedTest.cmake b/cmake/tribits/core/test_support/TribitsAddAdvancedTest.cmake similarity index 97% rename from cmake/tribits/core/package_arch/TribitsAddAdvancedTest.cmake rename to cmake/tribits/core/test_support/TribitsAddAdvancedTest.cmake index b1904b985b..21deffdea1 100644 --- a/cmake/tribits/core/package_arch/TribitsAddAdvancedTest.cmake +++ b/cmake/tribits/core/test_support/TribitsAddAdvancedTest.cmake @@ -37,14 +37,16 @@ # ************************************************************************ # @HEADER -include(TribitsCMakePolicies NO_POLICY_SCOPE) +include("${CMAKE_CURRENT_LIST_DIR}/../common/TribitsCMakePolicies.cmake" NO_POLICY_SCOPE) +include("${CMAKE_CURRENT_LIST_DIR}/../common/TribitsConstants.cmake") -include(TribitsAddAdvancedTestHelpers) -include(TribitsConstants) +set(tribitsAddAdvancedTestModuleDir "${CMAKE_CURRENT_LIST_DIR}") -include(TribitsPrintList) -include(AppendStringVar) -include(PrintVar) +include("${CMAKE_CURRENT_LIST_DIR}/TribitsAddAdvancedTestHelpers.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/../utils/TribitsPrintList.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/../utils/AppendStringVar.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/../utils/PrintVar.cmake") # @FUNCTION: tribits_add_advanced_test() @@ -373,7 +375,7 @@ include(PrintVar) # instead. **WARNING:** If you want to run such tests using valgrind, you # have to use the raw executable as the ```` argument and *not* # the script. For example, if you have a python script -# ``my_python_test.py`` with ``/usr/bin/env pyhton`` at the top, you can't +# ``my_python_test.py`` with ``/usr/bin/env python`` at the top, you can't # just use:: # # CMND /my_python_test.py ARGS "" "" ... @@ -853,12 +855,11 @@ include(PrintVar) # # The function ``tribits_add_advanced_test()`` can be used to add tests in # non-TriBITS projects. To do so, one just needs to set the variables -# ``PROJECT_NAME``, ``PACKAGE_NAME`` (which could be the same as -# ``PROJECT_NAME``), ``${PACKAGE_NAME}_ENABLE_TESTS=TRUE``, and -# ``${PROJECT_NAME}_TRIBITS_DIR`` (pointing to the TriBITS location). For example, -# a valid project can be a simple as:: +# ``${PROJECT_NAME}_ENABLE_TESTS=TRUE`` and ``${PROJECT_NAME}_TRIBITS_DIR`` +# (pointing to the TriBITS location). For example, a valid project can be a +# simple as:: # -# cmake_minimum_required(VERSION 3.22.0) +# cmake_minimum_required(VERSION 3.23.0) # set(PROJECT_NAME TAATDriver) # project(${PROJECT_NAME} NONE) # set(${PROJECT_NAME}_TRACE_ADD_TEST TRUE) @@ -866,36 +867,40 @@ include(PrintVar) # "Location of TriBITS to use." ) # set(PACKAGE_NAME ${PROJECT_NAME}) # set(${PACKAGE_NAME}_ENABLE_TESTS TRUE) -# set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} -# ${TRIBITS_DIR}/core/utils -# ${TRIBITS_DIR}/core/package_arch ) -# include(TribitsAddAdvancedTest) +# include("${${PROJECT_NAME}_TRIBITS_DIR}/core/test_support/TribitsAddAdvancedTest.cmake") # include(CTest) # enable_testing() # -# tribits_add_advanced_test( -# TAAT_COPY_FILES_TO_TEST_DIR_bad_file_name +# tribits_add_advanced_test( HelloWorld # OVERALL_WORKING_DIRECTORY TEST_NAME # TEST_0 CMND echo ARGS "Hello World!" # PASS_REGULAR_EXPRESIOIN "Hello World" # ) # +# Above, one can replace:: +# +# include("${${PROJECT_NAME}_TRIBITS_DIR}/core/test_support/TribitsAddAdvancedTest.cmake") +# +# with:: +# +# list(PREPEND CMAKE_MODULE_PATH "${${PROJECT_NAME}_TRIBITS_DIR}/core/test_support") +# include(TribitsAddAdvancedTest) +# +# and it will have the same effect. +# function(tribits_add_advanced_test TEST_NAME_IN) if (${PROJECT_NAME}_VERBOSE_CONFIGURE) message("\nPACKAGE_ADD_ADVANCED_TEST: ${TEST_NAME_IN}\n") endif() + tribits_set_tribits_package_name() + global_set(TRIBITS_SET_TEST_PROPERTIES_INPUT) global_set(MESSAGE_WRAPPER_INPUT) # Set the full TEST_NAME - if (PACKAGE_NAME) - set(TEST_NAME ${PACKAGE_NAME}_${TEST_NAME_IN}) - else() - set(TEST_NAME ${TEST_NAME_IN}) - endif() - + set(TEST_NAME ${PACKAGE_NAME}_${TEST_NAME_IN}) # # A) Parse the overall arguments and figure out how many tests @@ -1518,6 +1523,8 @@ function(tribits_add_advanced_test TEST_NAME_IN) # F.2) Write the cmake -P script # + set(coreUtilsDir "${tribitsAddAdvancedTestModuleDir}/../utils") + cmake_path(NORMAL_PATH coreUtilsDir) string(APPEND TEST_SCRIPT_STR "\n" "set(PROJECT_NAME ${PROJECT_NAME})\n" @@ -1548,9 +1555,7 @@ function(tribits_add_advanced_test TEST_NAME_IN) "# Test invocation\n" "#\n" "\n" - "set(CMAKE_MODULE_PATH ${${PROJECT_NAME}_TRIBITS_DIR}/${TRIBITS_CMAKE_UTILS_DIR})\n" - "\n" - "include(DriveAdvancedTest)\n" + "include(\"${coreUtilsDir}/DriveAdvancedTest.cmake\")\n" "\n" "drive_advanced_test()\n" ) diff --git a/cmake/tribits/core/package_arch/TribitsAddAdvancedTestHelpers.cmake b/cmake/tribits/core/test_support/TribitsAddAdvancedTestHelpers.cmake similarity index 98% rename from cmake/tribits/core/package_arch/TribitsAddAdvancedTestHelpers.cmake rename to cmake/tribits/core/test_support/TribitsAddAdvancedTestHelpers.cmake index 8c2e11df36..c7fb556b4d 100644 --- a/cmake/tribits/core/package_arch/TribitsAddAdvancedTestHelpers.cmake +++ b/cmake/tribits/core/test_support/TribitsAddAdvancedTestHelpers.cmake @@ -38,7 +38,7 @@ # @HEADER -include(TribitsAddTestHelpers) +include("${CMAKE_CURRENT_LIST_DIR}/TribitsAddTestHelpers.cmake") # Set default ax number of TEST_ blocks in tribits_add_advanced_test() diff --git a/cmake/tribits/core/package_arch/TribitsAddExecutableTestHelpers.cmake b/cmake/tribits/core/test_support/TribitsAddExecutableTestHelpers.cmake similarity index 92% rename from cmake/tribits/core/package_arch/TribitsAddExecutableTestHelpers.cmake rename to cmake/tribits/core/test_support/TribitsAddExecutableTestHelpers.cmake index 78f98f0bac..c2bc95d0dd 100644 --- a/cmake/tribits/core/package_arch/TribitsAddExecutableTestHelpers.cmake +++ b/cmake/tribits/core/test_support/TribitsAddExecutableTestHelpers.cmake @@ -37,22 +37,23 @@ # ************************************************************************ # @HEADER -include(TribitsCMakePolicies NO_POLICY_SCOPE) +include_guard() -include(AdvancedSet) -include(MessageWrapper) +include("${CMAKE_CURRENT_LIST_DIR}/../common/TribitsCMakePolicies.cmake" NO_POLICY_SCOPE) + +include("${CMAKE_CURRENT_LIST_DIR}/../utils/AdvancedSet.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/../utils/MessageWrapper.cmake") advanced_set( ${PROJECT_NAME}_CMAKE_EXECUTABLE_SUFFIX ".exe" CACHE STRING "Default exec suffix on all platforms (can be overridden by each executable added)." ) -# + # Process the COMM arguments # # NOTE: The COMM array arguments is passed as ${ARGN} # - -function( tribits_process_comm_args ADD_SERIAL_FEATURE_OUT ADD_MPI_FEATURE_OUT ) +function(tribits_process_comm_args ADD_SERIAL_FEATURE_OUT ADD_MPI_FEATURE_OUT ) set(COMM_ARRAY ${ARGN}) diff --git a/cmake/tribits/core/package_arch/TribitsAddTest.cmake b/cmake/tribits/core/test_support/TribitsAddTest.cmake similarity index 99% rename from cmake/tribits/core/package_arch/TribitsAddTest.cmake rename to cmake/tribits/core/test_support/TribitsAddTest.cmake index 6f388fdaca..9e23d71c3c 100644 --- a/cmake/tribits/core/package_arch/TribitsAddTest.cmake +++ b/cmake/tribits/core/test_support/TribitsAddTest.cmake @@ -37,8 +37,9 @@ # ************************************************************************ # @HEADER -include(TribitsCMakePolicies NO_POLICY_SCOPE) -include(TribitsAddTestHelpers) + +include("${CMAKE_CURRENT_LIST_DIR}/../common/TribitsCMakePolicies.cmake" NO_POLICY_SCOPE) +include("${CMAKE_CURRENT_LIST_DIR}/TribitsAddTestHelpers.cmake") # @FUNCTION: tribits_add_test() @@ -817,6 +818,8 @@ function(tribits_add_test EXE_NAME) message("TRIBITS_ADD_TEST: ${EXE_NAME} ${ARGN}") endif() + tribits_set_tribits_package_name() + global_set(TRIBITS_ADD_TEST_ADD_TEST_INPUT) global_set(TRIBITS_SET_TEST_PROPERTIES_INPUT) global_set(MESSAGE_WRAPPER_INPUT) @@ -935,8 +938,6 @@ function(tribits_add_test EXE_NAME) tribits_add_test_adjust_directory( ${EXE_BINARY_NAME} "${PARSE_DIRECTORY}" EXECUTABLE_PATH) - #message("TRIBITS_ADD_TEST: ${EXE_NAME}: EXECUTABLE_PATH = ${EXECUTABLE_PATH}") - # # D) Determine if we will add the serial or MPI tests based on input COMM # and TPL_ENABLE_MPI diff --git a/cmake/tribits/core/package_arch/TribitsAddTestHelpers.cmake b/cmake/tribits/core/test_support/TribitsAddTestHelpers.cmake similarity index 96% rename from cmake/tribits/core/package_arch/TribitsAddTestHelpers.cmake rename to cmake/tribits/core/test_support/TribitsAddTestHelpers.cmake index 715bca20f9..98190718a4 100644 --- a/cmake/tribits/core/package_arch/TribitsAddTestHelpers.cmake +++ b/cmake/tribits/core/test_support/TribitsAddTestHelpers.cmake @@ -37,19 +37,25 @@ # ************************************************************************ # @HEADER +include_guard() -include(TribitsAddExecutableTestHelpers) -include(TribitsGeneralMacros) -include(TribitsTestCategories) - -include(CMakeParseArguments) -include(GlobalSet) -include(AppendGlobalSet) -include(AppendStringVarWithSep) -include(PrintVar) -include(AdvancedSet) -include(MessageWrapper) -include(TribitsGetCategoriesString) +include("${CMAKE_CURRENT_LIST_DIR}/TribitsAddExecutableTestHelpers.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/TribitsSetTribitsPackageName.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/TribitsTestCategories.cmake") + +include("${CMAKE_CURRENT_LIST_DIR}/../utils/GlobalSet.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/../utils/AppendGlobalSet.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/../utils/AppendStringVarWithSep.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/../utils/PrintVar.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/../utils/AdvancedSet.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/../utils/MessageWrapper.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/../utils/TribitsGetCategoriesString.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/../utils/TribitsSetCacheVarAndDefault.cmake") + + +tribits_advanced_set_cache_var_and_default(${PROJECT_NAME}_TRACE_ADD_TEST BOOL + "${${PROJECT_NAME}_VERBOSE_CONFIGURE}" + "Show a configure-time trace of every test added or not added any why (one line).") # Do initialization for test helpers diff --git a/cmake/tribits/core/test_support/TribitsSetTribitsPackageName.cmake b/cmake/tribits/core/test_support/TribitsSetTribitsPackageName.cmake new file mode 100644 index 0000000000..2a08b4bebf --- /dev/null +++ b/cmake/tribits/core/test_support/TribitsSetTribitsPackageName.cmake @@ -0,0 +1,55 @@ +# @HEADER +# ************************************************************************ +# +# TriBITS: Tribal Build, Integrate, and Test System +# Copyright 2013 Sandia Corporation +# +# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +# the U.S. Government retains certain rights in this software. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. Neither the name of the Corporation nor the names of the +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# ************************************************************************ +# @HEADER + + +include("${CMAKE_CURRENT_LIST_DIR}/../utils/MessageWrapper.cmake") + + +# Set the TriBITS package name var if it has not already been set +# +macro(tribits_set_tribits_package_name) + if ("${PACKAGE_NAME}" STREQUAL "") + if (NOT "${PROJECT_NAME}" STREQUAL "") + set(PACKAGE_NAME ${PROJECT_NAME}) + else() + message_wrapper(FATAL_ERROR "Error! Can't set default PACKAGE_NAME because" + " PROJECT_NAME is not set!") + endif() + endif() +endmacro() diff --git a/cmake/tribits/core/package_arch/TribitsTestCategories.cmake b/cmake/tribits/core/test_support/TribitsTestCategories.cmake similarity index 94% rename from cmake/tribits/core/package_arch/TribitsTestCategories.cmake rename to cmake/tribits/core/test_support/TribitsTestCategories.cmake index acd55cee15..a6f053d639 100644 --- a/cmake/tribits/core/package_arch/TribitsTestCategories.cmake +++ b/cmake/tribits/core/test_support/TribitsTestCategories.cmake @@ -37,10 +37,10 @@ # ************************************************************************ # @HEADER -include(FindListElement) -include(MessageWrapper) -include(Join) -include(TribitsDeprecatedHelpers) +include("${CMAKE_CURRENT_LIST_DIR}/../utils/FindListElement.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/../utils/MessageWrapper.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/../utils/Join.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/../utils/TribitsDeprecatedHelpers.cmake") # Define the valid categories that will be recognized in the CATEGORIES keyword diff --git a/cmake/tribits/core/utils/AppendGlobalSet.cmake b/cmake/tribits/core/utils/AppendGlobalSet.cmake index 51251dc326..04d95f2b54 100644 --- a/cmake/tribits/core/utils/AppendGlobalSet.cmake +++ b/cmake/tribits/core/utils/AppendGlobalSet.cmake @@ -37,8 +37,8 @@ # ************************************************************************ # @HEADER -include(GlobalSet) -include(AssertDefined) +include("${CMAKE_CURRENT_LIST_DIR}/GlobalSet.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/AssertDefined.cmake") # @FUNCTION: append_global_set() diff --git a/cmake/tribits/core/utils/AppendStringVar.cmake b/cmake/tribits/core/utils/AppendStringVar.cmake index dbd0c1fb5d..bac3a6bac8 100644 --- a/cmake/tribits/core/utils/AppendStringVar.cmake +++ b/cmake/tribits/core/utils/AppendStringVar.cmake @@ -37,9 +37,11 @@ # ************************************************************************ # @HEADER -include(ConcatStrings) -include(PrintVar) -include(TribitsDeprecatedHelpers) +include_guard() + +include("${CMAKE_CURRENT_LIST_DIR}/ConcatStrings.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/PrintVar.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/TribitsDeprecatedHelpers.cmake") # @FUNCTION: append_string_var() diff --git a/cmake/tribits/core/utils/AppendStringVarWithSep.cmake b/cmake/tribits/core/utils/AppendStringVarWithSep.cmake index c671ff582e..6e8ccf9fb6 100644 --- a/cmake/tribits/core/utils/AppendStringVarWithSep.cmake +++ b/cmake/tribits/core/utils/AppendStringVarWithSep.cmake @@ -37,7 +37,7 @@ # ************************************************************************ # @HEADER -include(ConcatStrings) +include("${CMAKE_CURRENT_LIST_DIR}/ConcatStrings.cmake") # @FUNCTION: append_string_var_with_sep() diff --git a/cmake/tribits/core/utils/ConcatStrings.cmake b/cmake/tribits/core/utils/ConcatStrings.cmake index a2fdc3c41a..cf5fd64e6e 100644 --- a/cmake/tribits/core/utils/ConcatStrings.cmake +++ b/cmake/tribits/core/utils/ConcatStrings.cmake @@ -37,7 +37,7 @@ # ************************************************************************ # @HEADER -include(PrintVar) +include("${CMAKE_CURRENT_LIST_DIR}/PrintVar.cmake") # @FUNCTION: concat_strings() diff --git a/cmake/tribits/core/utils/DriveAdvancedTest.cmake b/cmake/tribits/core/utils/DriveAdvancedTest.cmake index 87a4a82308..6ccb55fd7a 100644 --- a/cmake/tribits/core/utils/DriveAdvancedTest.cmake +++ b/cmake/tribits/core/utils/DriveAdvancedTest.cmake @@ -37,11 +37,13 @@ # ************************************************************************ # @HEADER -include(PrintVar) -include(AppendStringVar) -include(Join) -include(TimingUtils) -include(TribitsGetCategoriesString) +include_guard() + +include("${CMAKE_CURRENT_LIST_DIR}/PrintVar.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/AppendStringVar.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/Join.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/TimingUtils.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/TribitsGetCategoriesString.cmake") function(print_current_date_time PREFIX_STR) diff --git a/cmake/tribits/core/utils/MessageWrapper.cmake b/cmake/tribits/core/utils/MessageWrapper.cmake index bdcd9e5e29..220f9c8ff6 100644 --- a/cmake/tribits/core/utils/MessageWrapper.cmake +++ b/cmake/tribits/core/utils/MessageWrapper.cmake @@ -39,7 +39,7 @@ include_guard() -include(GlobalSet) +include("${CMAKE_CURRENT_LIST_DIR}/GlobalSet.cmake") # @FUNCTION: message_wrapper() # diff --git a/cmake/tribits/core/utils/TimingUtils.cmake b/cmake/tribits/core/utils/TimingUtils.cmake index a83445663f..ac6351ab9d 100644 --- a/cmake/tribits/core/utils/TimingUtils.cmake +++ b/cmake/tribits/core/utils/TimingUtils.cmake @@ -44,7 +44,7 @@ # platforms so call with care. # -include(Split) +include("${CMAKE_CURRENT_LIST_DIR}/Split.cmake") # @FUNCTION: timer_get_raw_seconds() diff --git a/cmake/tribits/core/utils/TribitsDeprecatedHelpers.cmake b/cmake/tribits/core/utils/TribitsDeprecatedHelpers.cmake index 0ae57138e0..ee6c7fae22 100644 --- a/cmake/tribits/core/utils/TribitsDeprecatedHelpers.cmake +++ b/cmake/tribits/core/utils/TribitsDeprecatedHelpers.cmake @@ -37,8 +37,10 @@ # ************************************************************************ # @HEADER -include(MessageWrapper) -include(TribitsParseArgumentsHelpers) +include_guard() + +include("${CMAKE_CURRENT_LIST_DIR}/MessageWrapper.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/TribitsParseArgumentsHelpers.cmake") set(TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE_VALUES_THAT_CALL_MESSAGE diff --git a/cmake/tribits/core/package_arch/TribitsGitRepoVersionInfo.cmake b/cmake/tribits/core/utils/TribitsGitRepoVersionInfo.cmake similarity index 60% rename from cmake/tribits/core/package_arch/TribitsGitRepoVersionInfo.cmake rename to cmake/tribits/core/utils/TribitsGitRepoVersionInfo.cmake index 1b345ec0a2..f7b20ff5bd 100644 --- a/cmake/tribits/core/package_arch/TribitsGitRepoVersionInfo.cmake +++ b/cmake/tribits/core/utils/TribitsGitRepoVersionInfo.cmake @@ -85,7 +85,8 @@ function(tribits_git_repo_sha1 gitRepoDir gitRepoSha1Out) execute_process( COMMAND ${GIT_EXECUTABLE} log -1 "--pretty=format:%H" WORKING_DIRECTORY ${gitRepoDir} - RESULT_VARIABLE gitCmndRtn OUTPUT_VARIABLE gitCmndOutput + RESULT_VARIABLE gitCmndRtn OUTPUT_VARIABLE gitCmndOutput + OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE ) if (NOT gitCmndRtn STREQUAL 0) @@ -105,26 +106,118 @@ function(tribits_git_repo_sha1 gitRepoDir gitRepoSha1Out) endfunction() -# Run the git log command to get the version info for a git repo +# @FUNCTION: tribits_generate_single_repo_version_string() +# +# Get the formatted string containing the current git repo version. +# +# Usage: +# +# tribits_generate_single_repo_version_string( +# [INCLUDE_PARENT_COMMITS ON|OFF]) +# +# If the optional argument ``INCLUDE_PARENT_COMMITS `` is passed, +# then the head commit's parent(s) info will be be included in +# the repo version output string formatted. # function(tribits_generate_single_repo_version_string gitRepoDir repoVersionStringOut ) + cmake_parse_arguments( PARSE_ARGV 2 + PARSE "" # prefix, optional + "INCLUDE_COMMIT_PARENTS" "" # one_value_keywords, multi_value_keyword + ) + tribits_check_for_unparsed_arguments() + tribits_assert_parse_arg_zero_or_one_value(PARSE INCLUDE_COMMIT_PARENTS) + tribits_assert_git_executable() - # A) Get the basic version info. + # A) Get HEAD commit's info + + tribits_generate_commit_info_string(${gitRepoDir} HEAD commitInfoString) + + set(outStringBuilder ${commitInfoString}) + + # B) Get all of HEAD commit's parents into a list execute_process( - COMMAND ${GIT_EXECUTABLE} log -1 "--pretty=format:%h [%ad] <%ae>" + COMMAND ${GIT_EXECUTABLE} log -1 "--pretty=format:%p" HEAD WORKING_DIRECTORY ${gitRepoDir} - RESULT_VARIABLE gitCmndRtn - OUTPUT_VARIABLE gitCmndOutput + RESULT_VARIABLE gitCmndRtn OUTPUT_VARIABLE gitCmndOutput + OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE + ) + + if (NOT gitCmndRtn STREQUAL 0) + message(FATAL_ERROR "ERROR, ${GIT_EXECUTABLE} command returned ${gitCmndRtn}!=0" + " with output '${gitCmndOutput}' for sha1 ${gitHeadSha1} of repo ${gitRepoDir}!") + set(headParentList "Error, could not get commit's parents!") + else() + string(REGEX REPLACE " +" ";" headParentList "${gitCmndOutput}") + endif() + + list(LENGTH headParentList headNumParents) + + # C) Get each parent's commit info and format the output + + if (PARSE_INCLUDE_COMMIT_PARENTS) + + set(parentIdx 1) # Parent commit indexes are 1-based by git + + foreach(parentSha1 IN LISTS headParentList) + + # C.1) Get parent commit info string + + tribits_generate_commit_info_string( + ${gitRepoDir} ${parentSha1} + commitInfoString) + + # C.2) Format parent string to be pretty in config output + + string(APPEND outStringBuilder + "\n *** Parent ${parentIdx}:") + string(REPLACE "\n" "\n " + commitInfoString "${commitInfoString}") + string(APPEND outStringBuilder "\n ${commitInfoString}" ) + + math(EXPR parentIdx "${parentIdx}+1") + + endforeach() + + endif() + + set(${repoVersionStringOut} "${outStringBuilder}" PARENT_SCOPE) + +endfunction() + + +# @FUNCTION: tribits_generate_commit_info_string() +# +# Get the formatted commit info containing commit's SHA1, +# author, date, email, and 80 character summary. +# +# Usage: +# tribits_generate_commit_info_string( +# commitInfoStringOut) +# +# NOTE: Below, it is fine if ${maxSummaryLen} > len(${gitCmndOutput}) as +# string(SUBSTRING ...) will just shorten this to the length of the string. +# +function(tribits_generate_commit_info_string gitRepoDir gitCommitSha1 + commitInfoStringOut + ) + + # A) Get commit hash, author, date, and email + + execute_process( + COMMAND ${GIT_EXECUTABLE} log -1 "--pretty=format:%h [%ad] <%ae>" ${gitCommitSha1} + WORKING_DIRECTORY ${gitRepoDir} + RESULT_VARIABLE gitCmndRtn OUTPUT_VARIABLE gitCmndOutput + OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE ) if (NOT gitCmndRtn STREQUAL 0) message(FATAL_ERROR "ERROR, ${GIT_EXECUTABLE} command returned ${gitCmndRtn}!=0" - " for repo ${gitRepoDir}!") + " with output '${gitCmndOutput}' for sha1 ${gitCommitSha1} of repo ${gitRepoDir}!") set(gitVersionLine "Error, could not get version info!") else() set(gitVersionLine "${gitCmndOutput}") @@ -133,27 +226,25 @@ function(tribits_generate_single_repo_version_string gitRepoDir # B) Get the first 80 chars of the summary message for more info execute_process( - COMMAND ${GIT_EXECUTABLE} log -1 --pretty=format:%s + COMMAND ${GIT_EXECUTABLE} log -1 "--pretty=format:%s" ${gitCommitSha1} WORKING_DIRECTORY ${gitRepoDir} - RESULT_VARIABLE gitCmndRtn - OUTPUT_VARIABLE gitCmndOutput + RESULT_VARIABLE gitCmndRtn OUTPUT_VARIABLE gitCmndOutput + OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE ) if (NOT gitCmndRtn STREQUAL 0) message(FATAL_ERROR "ERROR, ${GIT_EXECUTABLE} command returned ${gitCmndRtn}!=0" - " for extra repo ${gitRepoDir}!") + " with output '${gitCmndOutput}' for sha1 ${gitCommitSha1} of repo ${gitRepoDir}!") set(gitSummaryStr "Error, could not get version summary!") else() set(maxSummaryLen 80) string(SUBSTRING "${gitCmndOutput}" 0 ${maxSummaryLen} gitSummaryStr) endif() - set(${repoVersionStringOut} + set(${commitInfoStringOut} "${gitVersionLine}\n${gitSummaryStr}" PARENT_SCOPE) endfunction() -# NOTE: Above, it is fine if ${maxSummaryLen} > len(${gitCmndOutput}) as -# string(SUBSTRING ...) will just shorten this to the length of the string. function(tribits_assert_git_executable) diff --git a/cmake/tribits/core/utils/TribitsParseArgumentsHelpers.cmake b/cmake/tribits/core/utils/TribitsParseArgumentsHelpers.cmake index 75327668f6..9058db674d 100644 --- a/cmake/tribits/core/utils/TribitsParseArgumentsHelpers.cmake +++ b/cmake/tribits/core/utils/TribitsParseArgumentsHelpers.cmake @@ -46,7 +46,7 @@ ################################################################################ -include(MessageWrapper) +include("${CMAKE_CURRENT_LIST_DIR}/MessageWrapper.cmake") # @FUNCTION: tribits_check_for_unparsed_arguments() diff --git a/cmake/tribits/core/utils/TribitsSetCacheVarAndDefault.cmake b/cmake/tribits/core/utils/TribitsSetCacheVarAndDefault.cmake new file mode 100644 index 0000000000..a90c45aad4 --- /dev/null +++ b/cmake/tribits/core/utils/TribitsSetCacheVarAndDefault.cmake @@ -0,0 +1,89 @@ +# @HEADER +# ************************************************************************ +# +# TriBITS: Tribal Build, Integrate, and Test System +# Copyright 2013 Sandia Corporation +# +# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +# the U.S. Government retains certain rights in this software. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. Neither the name of the Corporation nor the names of the +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# ************************************************************************ +# @HEADER + +include_guard() + + +# @MACRO: tribits_advanced_set_cache_var_and_default() +# +# Set an advanced cache variable with a default value (passing in a default +# default value). +# +# Usage:: +# +# tribits_advanced_set_cache_var_and_default( +# ) +# +# If the variable ``_DEFAULT`` already exists with a value, that +# is used as the default cache variable. Otherwise, +# ``_DEFAULT`` is set set to ```` first. +# +macro(tribits_advanced_set_cache_var_and_default cacheVarName cacheVarType + defaultDefaultVal docString + ) + tribits_set_cache_var_and_default("${cacheVarName}" "${cacheVarType}" + "${defaultDefaultVal}" "${docString}") + mark_as_advanced(${cacheVarName}) +endmacro() + + +# @MACRO: tribits_set_cache_var_and_default() +# +# Set a cache variable with a default value (passing in a default default +# value). +# +# Usage:: +# +# tribits_set_cache_var_and_default( +# ) +# +# If the variable ``_DEFAULT`` already exists with a value, that +# is used as the default cache variable. Otherwise, +# ``_DEFAULT`` is set set to ```` first. +# +macro(tribits_set_cache_var_and_default cacheVarName cacheVarType + defaultDefaultVal docString + ) + if ("${${cacheVarName}_DEFAULT}" STREQUAL "") + set(${cacheVarName}_DEFAULT "${defaultDefaultVal}") + endif() + set(${cacheVarName} "${${cacheVarName}_DEFAULT}" + CACHE ${cacheVarType} + "${docString}" ) +endmacro() diff --git a/cmake/tribits/core/package_arch/TribitsSortListAccordingToMasterList.cmake b/cmake/tribits/core/utils/TribitsSortListAccordingToMasterList.cmake similarity index 62% rename from cmake/tribits/core/package_arch/TribitsSortListAccordingToMasterList.cmake rename to cmake/tribits/core/utils/TribitsSortListAccordingToMasterList.cmake index 5d079a4174..4b01327027 100644 --- a/cmake/tribits/core/package_arch/TribitsSortListAccordingToMasterList.cmake +++ b/cmake/tribits/core/utils/TribitsSortListAccordingToMasterList.cmake @@ -37,40 +37,28 @@ # ************************************************************************ # @HEADER -include(PrintVar) -include(AppendSet) +include("${CMAKE_CURRENT_LIST_DIR}/../utils/PrintVar.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/../utils/AppendSet.cmake") + +# Do an in-place sort of a list of items according to the ordering in a master +# list. # -# Function that does an in-place sort of a list of items according to the -# ordering in a master list -# -# NOTE: This function has wost-case N^2 complexity as the number of packages N -# or TPLs increases. It actually has N * n complexity where N is the total -# number of packages/TPLs and n is the number of passed-in packages/TPLs. -# However, since N is not likely to ever be more than a few hundred, this is -# likely not going to be a big performance problem. If this does become a -# performance problem, list(SORT ...) could be used but would require some -# work to build up the datastructures to make this very efficient. +# NOTE: This function has worst-case complexity N*n where N is the number of +# elements in the ```` and n is the number of elements in the +# ```` list. # +function(tribits_sort_list_according_to_master_list masterList listVarInOut) -function(tribits_sort_list_according_to_master_list MASTER_LIST LIST_VAR_INOUT) - - #message("TRIBITS_SORT_LIST_ACCORDING_TO_MASTER_LIST:") - #print_var(MASTER_LIST) - #print_var(LIST_VAR_INOUT) - #print_var(${LIST_VAR_INOUT}) + set(sortedList) - set(SORTED_LIST) - - foreach(ITEM ${MASTER_LIST}) - list(FIND ${LIST_VAR_INOUT} ${ITEM} ITEM_IDX) - if (NOT ITEM_IDX EQUAL -1) - list(APPEND SORTED_LIST ${ITEM}) + foreach(item ${masterList}) + list(FIND ${listVarInOut} ${item} itemIdx) + if (NOT itemIdx EQUAL -1) + list(APPEND sortedList ${item}) endif() endforeach() - #print_var(SORTED_LIST) - - set(${LIST_VAR_INOUT} ${SORTED_LIST} PARENT_SCOPE) + set(${listVarInOut} ${sortedList} PARENT_SCOPE) endfunction() diff --git a/cmake/tribits/ctest_driver/TribitsAddDashboardTarget.cmake b/cmake/tribits/ctest_driver/TribitsAddDashboardTarget.cmake index 52851ce3cc..6b60d39123 100644 --- a/cmake/tribits/ctest_driver/TribitsAddDashboardTarget.cmake +++ b/cmake/tribits/ctest_driver/TribitsAddDashboardTarget.cmake @@ -45,7 +45,7 @@ # ################################################################################ -include(TribitsGitRepoVersionInfo) +include("${CMAKE_CURRENT_LIST_DIR}/../core/utils/TribitsGitRepoVersionInfo.cmake") # # Macro that drives a experimental 'dashboard' target diff --git a/cmake/tribits/ctest_driver/TribitsCTestDriverCore.cmake b/cmake/tribits/ctest_driver/TribitsCTestDriverCore.cmake index 6b2b536bac..8e6ecfde5e 100644 --- a/cmake/tribits/ctest_driver/TribitsCTestDriverCore.cmake +++ b/cmake/tribits/ctest_driver/TribitsCTestDriverCore.cmake @@ -50,7 +50,7 @@ message("*******************************") message("") -cmake_minimum_required(VERSION 3.22.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.23.0 FATAL_ERROR) set(THIS_CMAKE_CURRENT_LIST_DIR "${CMAKE_CURRENT_LIST_DIR}") @@ -137,6 +137,10 @@ if ("${CTEST_BINARY_DIRECTORY}" STREQUAL "") set(CTEST_BINARY_DIRECTORY $ENV{PWD}/BUILD) endif() +include("${CMAKE_CURRENT_LIST_DIR}/../core/common/TribitsConstants.cmake") +tribits_asesrt_minimum_cmake_version() +include("${CMAKE_CURRENT_LIST_DIR}/../core/common/TribitsCMakePolicies.cmake" NO_POLICY_SCOPE) + # # Set CMAKE_MODULE_PATH # @@ -144,15 +148,13 @@ set( CMAKE_MODULE_PATH "${TRIBITS_PROJECT_ROOT}" "${TRIBITS_PROJECT_ROOT}/cmake" "${${PROJECT_NAME}_TRIBITS_DIR}/core/utils" + "${${PROJECT_NAME}_TRIBITS_DIR}/core/common" + "${${PROJECT_NAME}_TRIBITS_DIR}/core/test_support" "${${PROJECT_NAME}_TRIBITS_DIR}/core/package_arch" "${${PROJECT_NAME}_TRIBITS_DIR}/ci_support" "${${PROJECT_NAME}_TRIBITS_DIR}/ctest_driver" ) -include(TribitsConstants) -tribits_asesrt_minimum_cmake_version() -include(TribitsCMakePolicies NO_POLICY_SCOPE) - include(Split) include(PrintVar) include(MultilineSet) @@ -667,11 +669,11 @@ include(TribitsCTestDriverCoreHelpers) # **Setting variables in the inner CMake configure:** # # It is important to understand that none of the CMake vars that get set in -# the other CTest -S program that calls ``tribits_ctest_driver()`` +# the outer CTest -S program that calls ``tribits_ctest_driver()`` # automatically get passed into the inner configure of the TriBITS CMake # project using the ``ctest_configure()`` command by CMake. From the # perspective of raw CTest and CMake, these are completely separate programs. -# However, the ``tribits_ctest_driver()`` function will forward subset of +# However, the ``tribits_ctest_driver()`` function will forward subset a of # variables documented below into the inner CMake configure. The following # variables that are set in the outer CTest -S program will be passed into the # inner CMake configure by default (but their values they can be overridden by @@ -682,7 +684,7 @@ include(TribitsCTestDriverCoreHelpers) # # Missing extra repos are always ignored in the inner CMake configure. # This is because any problems reading an extra repo will be caught in the -# outer CTest -S drivers script. +# outer CTest -S driver script. # # ``-D${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=ON`` # @@ -697,7 +699,7 @@ include(TribitsCTestDriverCoreHelpers) # may be disabled. (This set may be removed in the future for the # all-at-once mode.) # -# The following variables set in the CTest -S driver script will be passed +# The following variables set in the outer CTest -S driver script will be passed # down into the inner CMake configure through the ``OPTIONS`` variable to the # ``ctest_configure()`` command: # @@ -756,7 +758,7 @@ include(TribitsCTestDriverCoreHelpers) # These configure options are passed into the ``ctest_configure()`` command in # the order:: # -# ${EXTRA_SYSTEM_CONFIGURE_OPTIONS}} \ +# ${EXTRA_SYSTEM_CONFIGURE_OPTIONS}} \ # ${EXTRA_CONFIGURE_OPTIONS} ${${PROJECT_NAME}_EXTRA_CONFIGURE_OPTIONS} # # **WARNING:** The options listed in ``EXTRA_SYSTEM_CONFIGURE_OPTIONS``, diff --git a/cmake/tribits/ctest_driver/TribitsGetCTestTestXmlDir.cmake b/cmake/tribits/ctest_driver/TribitsGetCTestTestXmlDir.cmake index 38c47bf820..1aa1aaf339 100644 --- a/cmake/tribits/ctest_driver/TribitsGetCTestTestXmlDir.cmake +++ b/cmake/tribits/ctest_driver/TribitsGetCTestTestXmlDir.cmake @@ -14,7 +14,7 @@ # then prints the directory /Testing/ to STDOUT. # -cmake_minimum_required(VERSION 3.22.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.23.0 FATAL_ERROR) if ("${PROJECT_NAME}" STREQUAL "") message(FATAL_ERROR "Error, PROJECT_NAME must be set!") diff --git a/cmake/tribits/ctest_driver/tribits_ctest_update_commands.cmake b/cmake/tribits/ctest_driver/tribits_ctest_update_commands.cmake index 283e32e229..4caf72774e 100644 --- a/cmake/tribits/ctest_driver/tribits_ctest_update_commands.cmake +++ b/cmake/tribits/ctest_driver/tribits_ctest_update_commands.cmake @@ -18,7 +18,7 @@ # 3.12) crash in that case. # -cmake_minimum_required(VERSION 3.22.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.23.0 FATAL_ERROR) message("\ncmake -P tribits_ctest_update_commands.cmake:") message("-- GIT_EXE=${GIT_EXE}") diff --git a/cmake/tribits/ctest_driver/tribits_ctest_update_commands_wrapper.cmake b/cmake/tribits/ctest_driver/tribits_ctest_update_commands_wrapper.cmake index 8040574e56..2c3fcf206c 100644 --- a/cmake/tribits/ctest_driver/tribits_ctest_update_commands_wrapper.cmake +++ b/cmake/tribits/ctest_driver/tribits_ctest_update_commands_wrapper.cmake @@ -7,7 +7,7 @@ # the output (and does not send it to CDash). # -cmake_minimum_required(VERSION 3.22.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.23.0 FATAL_ERROR) message("\ncmake -P tribits_ctest_update_commands_wrapper.cmake:") message("-- OUTPUT_FILE=${OUTPUT_FILE}\n") diff --git a/cmake/tribits/doc/build_ref/TribitsBuildReferenceBody.rst b/cmake/tribits/doc/build_ref/TribitsBuildReferenceBody.rst index b0acf3131b..3ab4ce13f1 100644 --- a/cmake/tribits/doc/build_ref/TribitsBuildReferenceBody.rst +++ b/cmake/tribits/doc/build_ref/TribitsBuildReferenceBody.rst @@ -376,6 +376,7 @@ See the following use cases: * `Enable all packages (and optionally all tests)`_ * `Disable a package and all its dependencies`_ * `Remove all package enables in the cache`_ +* `Speed up debugging dependency handling`_ Determine the list of packages that can be enabled @@ -656,6 +657,22 @@ For example, one would want to do this to avoid more expensive compiler and TPL checks. +Speed up debugging dependency handling ++++++++++++++++++++++++++++++++++++++++ + +To speed up debugging the package enable/disable dependency handling, set the +cache variable:: + + -D _TRACE_DEPENDENCY_HANDLING_ONLY=ON + +This will result in only performing the package enable/disable dependency +handling logic and tracing what would be done to configure the compilers and +configure the various enabled packages but not actually do that work. This +can greatly speed up the time to complete the ``cmake`` configure command when +debugging the dependency handling (or when creating tests that check that +behavior). + + Selecting compiler and linker options ------------------------------------- @@ -1333,7 +1350,7 @@ c) **Setting up to run MPI programs:** MPI test and example executables are passed to CTest ``add_test()`` as:: - add_test( + add_test(NAME COMMAND ${MPI_EXEC} ${MPI_EXEC_PRE_NUMPROCS_FLAGS} ${MPI_EXEC_NUMPROCS_FLAG} ${MPI_EXEC_POST_NUMPROCS_FLAGS} @@ -1994,9 +2011,10 @@ external packages has several consequences: (Otherwise, a configure error will result from the mismatch.) * The definition of any TriBITS external packages/TPLs that are enabled - upstream dependencies from any of these internally defined packages being - treated as external packages will be defined by the calls to - ``find_package()`` and will **not** be found again. + upstream dependencies from any of these external packages should be defined + automatically and will **not** be found again. (But there can be exceptions + for minimally TriBITS-compliant external packages; see the section + "TriBITS-Compliant External Packages" in the "TriBITS Users Guide".) The logic for treating internally defined packages as external packages will be printed in the CMake configure output in the section ``Adjust the set of @@ -2016,22 +2034,35 @@ the terminal TriBITS-compliant external packages. This is shown in the CMake output in the section ``Getting information for all enabled TriBITS-compliant or upstream external packages/TPLs`` and looks like:: - Getting information for all enabled TriBITS-compliant or upstream external packages/TPLs ... + Getting information for all enabled TriBITS-compliant or upstream external packages/TPLs in reverse order ... - Processing enabled external package/TPL: (...) - -- The external package/TPL will be read in by a downstream TriBITS-compliant external package - Processing enabled external package/TPL: (...) - -- The external package/TPL will be read in by a downstream TriBITS-compliant external package - Processing enabled external package/TPL: (...) - -- The external package/TPL will be read in by a downstream TriBITS-compliant external package Processing enabled external package/TPL: (...) -- Calling find_package( for TriBITS-compliant external package + Processing enabled external package/TPL: (...) + -- The external package/TPL was defined by a downstream TriBITS-compliant external package already processed + Processing enabled external package/TPL: (...) + -- The external package/TPL was defined by a downstream TriBITS-compliant external package already processed + Processing enabled external package/TPL: (...) + -- The external package/TPL was defined by a downstream TriBITS-compliant external package already processed In the above example ````, ```` and ```` are all direct or indirect dependencies of ```` and therefore calling just ``find_package()`` fully defines those TriBITS-compliant external packages as well. +All remaining TPLs that are not defined in that first reverse loop are defined +in a second forward loop over regular TPLs:: + + Getting information for all remaining enabled external packages/TPLs ... + +NOTE: The case is also supported where a TriBITS-compliant external package +like ```` does not define all of it upstream dependencies (i.e. does not +define the ``::all_libs`` target) and these external packages/TPLs will +be found again. This allows the possibility of finding different/inconsistent +upstream dependencies but this is allowed to accommodate some packages with +non-TriBITS CMake build systems that don't create fully TriBITS-compliant +external packages. + xSDK Configuration Options -------------------------- @@ -2920,6 +2951,20 @@ NOTE: If the base ``.git/`` directory is missing, then no printed to cmake STDOUT. +Show parent(s) commit info in the repo version output +---------------------------------------------------- + +.. __SHOW_GIT_COMMIT_PARENTS: + +When working with local git repos for the project sources, one can include +the repo's head commit parent(s) info in the repo version output using:: + + -D _SHOW_GIT_COMMIT_PARENTS=ON + +For each parent commit, this will include their SHA1, author name, date, email +and its 80 character summary message in the repo version output string. + + Generating git version date files --------------------------------- @@ -4168,14 +4213,23 @@ match files to exclude, set:: -D _DUMP_CPACK_SOURCE_IGNORE_FILES=ON +Extra directories or files can be excluded from the reduced source tarball by +adding the configure argument:: + + "-DCPACK_SOURCE_IGNORE_FILES=;;..." + +NOTE: The entries in ``CPACK_SOURCE_IGNORE_FILES`` are regexes and **not** +file globs, so be careful when specifying these or more files and directories +will be excluded from the reduced source tarball that intended/desired. + While a set of default CPack source generator types is defined for this project (see the ``CMakeCache.txt`` file), it can be overridden using, for example:: -D _CPACK_SOURCE_GENERATOR="TGZ;TBZ2" -(see CMake documentation to find out the types of supported CPack source -generators on your system). +(See CMake documentation to find out the types of CPack source generators +supported on your system.) NOTE: When configuring from an untarred source tree that has missing packages, one must configure with:: @@ -4205,7 +4259,7 @@ just using the standard ``ctest -D Experimental`` command are: For more details, see `tribits_ctest_driver()`_. To use the ``dashboard`` target, first, configure as normal but add cache vars -for the the build and test parallel levels with:: +for the build and test parallel levels with:: -DCTEST_BUILD_FLAGS=-j4 -DCTEST_PARALLEL_LEVEL=4 diff --git a/cmake/tribits/doc/guides/.gitignore b/cmake/tribits/doc/guides/.gitignore index 7f018678f2..6c3878b7fb 100644 --- a/cmake/tribits/doc/guides/.gitignore +++ b/cmake/tribits/doc/guides/.gitignore @@ -4,6 +4,9 @@ /TriBITS.README.DIRECTORY_CONTENTS.rst.tmp /TribitsCommonTPLsList.txt /TribitsCommonTPLsList.txt.tmp +/TribitsExampleProject2_Package1_CMakeLists.raw.external.cmake* +/TribitsExampleProject2_Package1_CMakeLists.raw.internal.cmake* +/TribitsExampleProject2_Package1_CMakeLists.raw.tribits_test.cmake* /TribitsGitVersion.txt /TribitsGitVersion.txt.tmp /TribitsHelloWorldDirAndFiles.txt diff --git a/cmake/tribits/doc/guides/Makefile.common_generated_files b/cmake/tribits/doc/guides/Makefile.common_generated_files index c6a352d122..6984ee3c63 100644 --- a/cmake/tribits/doc/guides/Makefile.common_generated_files +++ b/cmake/tribits/doc/guides/Makefile.common_generated_files @@ -27,6 +27,7 @@ COMMON_DEPENDENT_FILES = \ ../get-tribits-packages-from-files-list.txt \ ../install_devtools-help.txt \ ../TriBITS.README.DIRECTORY_CONTENTS.rst \ + $(wildcard ../*.cmake) \ TribitsMacroFunctionDoc.rst \ UtilsMacroFunctionDoc.rst diff --git a/cmake/tribits/doc/guides/TribitsCoreDetailedReference.rst b/cmake/tribits/doc/guides/TribitsCoreDetailedReference.rst index 7fbad8103a..aa443415c3 100644 --- a/cmake/tribits/doc/guides/TribitsCoreDetailedReference.rst +++ b/cmake/tribits/doc/guides/TribitsCoreDetailedReference.rst @@ -88,6 +88,7 @@ a given TriBITS project are: * `${PROJECT_NAME}_MUST_FIND_ALL_TPL_LIBS`_ * `${PROJECT_NAME}_REQUIRES_PYTHON`_ * `${PROJECT_NAME}_SET_INSTALL_RPATH`_ +* `${PROJECT_NAME}_SHOW_GIT_COMMIT_PARENTS`_ * `${PROJECT_NAME}_SHOW_TEST_START_END_DATE_TIME`_ * `${PROJECT_NAME}_SKIP_INSTALL_PROJECT_CMAKE_CONFIG_FILES`_ * `${PROJECT_NAME}_TEST_CATEGORIES`_ @@ -651,6 +652,21 @@ These options are described below. Handling`_). +.. _${PROJECT_NAME}_SHOW_GIT_COMMIT_PARENTS: + +**${PROJECT_NAME}_SHOW_GIT_COMMIT_PARENTS** + + The cache variable ``${PROJECT_NAME}_SHOW_GIT_COMMIT_PARENTS`` results in + the repo version file showing the parent commits for each repo commit. By + default, this variable is set to ``OFF`` but projects can set to to ``ON`` + by default by setting:: + + set(${PROJECT_NAME}_SHOW_GIT_COMMIT_PARENTS_DEFAULT ON) + + in the project's ``ProjectName.cmake`` file. (That way, it will also impact + ``cmake -P`` scripts don't configure the project itself to be built.) + + .. _${PROJECT_NAME}_SHOW_TEST_START_END_DATE_TIME: **${PROJECT_NAME}_SHOW_TEST_START_END_DATE_TIME** diff --git a/cmake/tribits/doc/guides/TribitsGuidesBody.rst b/cmake/tribits/doc/guides/TribitsGuidesBody.rst index b8f77bd5b0..c978a2d103 100644 --- a/cmake/tribits/doc/guides/TribitsGuidesBody.rst +++ b/cmake/tribits/doc/guides/TribitsGuidesBody.rst @@ -1379,7 +1379,7 @@ The variable ``HAVE_SIMPLECXX___INT64`` is set up in the base file ``SimpleCxx/CMakeLists.txt`` (see `/CMakeLists.txt`_ below). For an explanation of ``HAVE_SIMPLECXX_DEBUG``, see `tribits_add_debug_option()`_. For an explanation of ``HAVE_SIMPLECXX_SIMPLETPL``, see `How to add a new -TriBITS external package/TPL dependency`_. For an explanation of +TriBITS Package dependency`_. For an explanation of ``@SIMPLECXX_DEPRECATED_DECLARATIONS@``, see `Setting up support for deprecated code handling`_. @@ -1589,13 +1589,13 @@ are defined before a Package's ``CMakeLists.txt`` file is processed: imply that all of the required subpackages will be enabled, only that the parent package will be processed). - .. _${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE_NAME}: + .. _${PACKAGE_NAME}_ENABLE_${UPSTREAM_PACKAGE_NAME}: - ``${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE_NAME}`` + ``${PACKAGE_NAME}_ENABLE_${UPSTREAM_PACKAGE_NAME}`` Set to ``ON`` if support for the optional `upstream`_ dependent package - ``${OPTIONAL_DEP_PACKAGE_NAME}`` is enabled in package - ``${PACKAGE_NAME}``. Here ``${OPTIONAL_DEP_PACKAGE_NAME}`` corresponds to + ``${UPSTREAM_PACKAGE_NAME}`` is enabled in package + ``${PACKAGE_NAME}``. Here ``${UPSTREAM_PACKAGE_NAME}`` corresponds to each optional upstream package listed in the ``LIB_OPTIONAL_PACKAGES`` and ``TEST_OPTIONAL_PACKAGES`` arguments to the `tribits_package_define_dependencies()`_ macro. @@ -1603,11 +1603,11 @@ are defined before a Package's ``CMakeLists.txt`` file is processed: **NOTE:** It is important that the CMake code in the package's ``CMakeLists.txt`` files key off of this variable and **not** the project-level variable - ``${PROJECT_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE_NAME}`` because the + ``${PROJECT_NAME}_ENABLE_${UPSTREAM_PACKAGE_NAME}`` because the package-level variable - ``${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE_NAME}`` can be explicitly + ``${PACKAGE_NAME}_ENABLE_${UPSTREAM_PACKAGE_NAME}`` can be explicitly turned off by the user even through the packages ``${PACKAGE_NAME}`` and - ``${OPTIONAL_DEP_PACKAGE_NAME}`` are both enabled at the project level! + ``${UPSTREAM_PACKAGE_NAME}`` are both enabled at the project level! See `Support for optional package can be explicitly disabled`_. **NOTE:** This variable will also be set for required dependencies as well @@ -1617,7 +1617,7 @@ are defined before a Package's ``CMakeLists.txt`` file is processed: **NOTE:** The value of this variable also determines the value of the macro define variable name - `HAVE__`_. + `HAVE__`_. .. _${PACKAGE_NAME}_ENABLE_TESTS: @@ -1643,23 +1643,23 @@ The following local **TriBITS Package Optional Dependency Macro Variables** are defined in the top-level project scope before a Package's ``CMakeLists.txt`` file is processed: - .. _HAVE__: + .. _HAVE__: - ``HAVE__`` + ``HAVE__`` Set to ``ON`` if support for optional upstream package - ``${OPTIONAL_DEP_PACKAGE}`` is enabled in downstream package + ``${UPSTREAM_PACKAGE_NAME`` is enabled in downstream package ``${PACKAGE_NAME}`` - (i.e. `${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE_NAME}`_ = ``ON``) and - is set to ``FALSE`` otherwise. Here, ```` and - ```` are the upper-case names for the packages - ``${PACKAGE_NAME}`` and ``${OPTIONAL_DEP_PACKAGE_NAME}``, respectively. + (i.e. `${PACKAGE_NAME}_ENABLE_${UPSTREAM_PACKAGE_NAME}`_ = ``ON``) and is + set to ``FALSE`` otherwise. Here, ```` and + ```` are the upper-case names for the packages + ``${PACKAGE_NAME}`` and ``${UPSTREAM_PACKAGE_NAME}``, respectively. For example, if optional support for upstream package ``Triutils`` is enabled in downstream package ``EpetraExt`` in `ReducedMockTrilinos`_, then ``EpetraExt_ENABLE_TriUtils=ON`` and ``HAVE_EPETRAEXT_TRIUTILS=ON``. This variable is meant to be used in:: - #cmakedefine HAVE__ + #cmakedefine HAVE__ in configured header files (e.g. `/cmake/_config.h.in`_). For example, for @@ -1668,7 +1668,7 @@ are defined in the top-level project scope before a Package's #cmakedefine HAVE_EPETRAEXT_TRIUTILS NOTE: TriBITS automatically sets this variable depending on the value of - `${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE_NAME}`_ during the step + `${PACKAGE_NAME}_ENABLE_${UPSTREAM_PACKAGE_NAME}`_ during the step "Adjust package and TPLs enables and disables" in `Full Processing of TriBITS Project Files`_. And tweaking this variable after that must be done carefully as described in `How to tweak downstream TriBITS "ENABLE" @@ -2615,33 +2615,20 @@ packages** as imposed by downstream TriBITS internal packages are: CMake macros or functions that downstream CMake packages may need to use the upstream package ````. -* All of the upstream dependencies (listed in the ``INTERFACE_LINK_LIBRARIES`` - property recursively) are also `TriBITS-compliant packages`_ +* [Optional] All of the upstream dependencies (listed in the + ``INTERFACE_LINK_LIBRARIES`` property recursively) are also + `TriBITS-compliant packages`_ The TriBITS system will also set the variable: * ``_IS_TRIBITS_COMPLIANT``: Set to ``TRUE`` -for all packages that are determined to be TriBITS-compliant packages. +for all packages that are determined to be TriBITS-compliant packages and +satisfy the above criteria. The above are all that is needed by downstream TriBITS packages to build and link against their upstream dependencies. -If a TriBITS package provides any CTest tests/examples, then it must also -satsify the following requirements: - -* Test names must be prefixed with the package name ``_``. - -* Tests should only be added if the variable ``_ENABLE_TESTS`` is - true. - -* Examples (that run as CTest tests) should only be added if the variable - ``_ENABLE_EXAMPLES`` is true. - -* The test ``PROCESSORS`` and other test properties must be set in a way - consistent with `tribits_add_test()`_ so as to run in parallel with other - tests and not overwhelm the computing resources on the machine. - Additional requirements are placed on TriBITS-compliant packages depending on if they are defined as internal CMake packages (i.e. `TriBITS-compliant internal packages`_) or are pulled in as external pre-built/pre-installed @@ -2672,15 +2659,38 @@ The requirements for **TriBITS-compliant internal packages** are: directory ``/lib/cmake//`` allowing the installed package to be used by downstream CMake packages/projects. -* All of the upstream dependencies (recursively) are also `TriBITS-compliant - packages`_ +* [Optional] All of the upstream dependencies (recursively) are also + `TriBITS-compliant packages`_. + +If a TriBITS package provides any CTest tests/examples, then it must also +satisfy the following requirements: + +* Test names must be prefixed with the package name ``_``. + +* Tests should only be added if the variable ``_ENABLE_TESTS`` is + true. + +* Examples (that run as CTest tests) should only be added if the variable + ``_ENABLE_EXAMPLES`` is true. + +* The ``PROCESSORS`` test property and other test properties must be set in a + way consistent with `tribits_add_test()`_ so as to run in parallel with + other tests and not overwhelm the computing resources on the machine. + +* The test ```` must not be added if the cache variable + ``_DISABLE`` is set to ``TRUE`` or if the cache variable + ``_SET_DISABLED_AND_MSG`` is set to non-empty (and the message + string should be printed to STDOUT). TriBITS internal packages that are defined using the TriBITS framework using -the TriBITS-provided macros and functions such as `tribits_add_library()`_ are -automatically `TriBITS-compliant internal packages`_ and when they are -installed they automatically provide `TriBITS-compliant external packages`_. +the TriBITS-provided macros and functions such as `tribits_add_library()`_ and +have tests defined using the functions `tribits_add_test()`_ and +`tribits_add_advanced_test()`_ are automatically `TriBITS-compliant internal +packages`_. And when these TriBITS-implemented internal packages are +installed, they automatically provide `TriBITS-compliant external packages`_. But it is possible for a CMake package to write its own raw CMake code to -satisfy these basic requirements for both internal and external packages. +satisfy these basic requirements for both internal and (installed) external +packages. .. _TriBITS-Compliant External Package: @@ -2692,8 +2702,9 @@ For packages that are installed on the system and not built in the current CMake project, a streamlined type of `TriBITS External Package/TPL`_ is a *TriBITS-compliant external package*. These special types of external package's don't need to provide a `FindTPL.cmake`_ find module. -Instead, they are fully defined by calling ``find_package()`` to -locate and load their ``Config.cmake`` package config file. +Instead, they are fully defined by calling ``find_package()`` or +``include(/Config.cmake)`` to load their +``Config.cmake`` package config file. The requirements for **TriBITS-compliant external packages** are: @@ -2708,18 +2719,23 @@ The requirements for **TriBITS-compliant external packages** are: ``_TRIBITS_COMPLIANT_PACKAGE_CONFIG_FILE``: Points to the file ``Config.cmake`` (i.e. ``${CMAKE_CURRENT_LIST_FILE}``) - * ``_DIR`` or - ``_TRIBITS_COMPLIANT_PACKAGE_CONFIG_FILE_DIR`` Points to the base - directory for ``Config.cmake`` - (i.e. ``${CMAKE_CURRENT_LIST_DIR}``) - -* All of the upstream dependencies (recursively) are also provided as - `TriBITS-compliant external packages`_ with +* [Optional] All of the upstream dependencies (recursively) are also provided + as `TriBITS-compliant external packages`_ with ``Config.cmake`` files (see above) and all of the targets and variables for a TriBITS-compliant external package are defined when the ``Config.cmake`` file is included (or pulled in with ``find_package()`` or ``find_dependency()``). +NOTE: TriBITS-compliant external packages that provide TriBITS-compliant +external packages for all of their upstream dependencies are said to be *fully +TriBITS-compliant external packages* while those that support the minimal +requirements are said to be *minimally TriBITS-compliant external packages*. +The TriBITS external package/TPL system is robust enough to deal with +minimally TriBITS-compliant external packages. Any TriBITS external +packages/TPLs upstream from a minimally TriBITS-compliant external package +will be found again in the current TriBITS project. (In these cases, it is up +to the user to make sure that the same upstream packages are found.) + Example TriBITS Projects ========================= @@ -2954,6 +2970,28 @@ should be copied from this example project as they represent best practice when using TriBITS for the typical use cases. +TribitsExampleProject2 +---------------------- + +``TribitsExampleProject2`` in an example `TriBITS Project`_ and `TriBITS +Repository`_ contained in the TriBITS source tree under:: + + tribits/examples/TribitsExampleProject2/ + +This example TriBITS project provides some examples for a few other features +and testing scenarios. It contains three internal packages ``Package1``, +``Package2``, and ``Package3`` as shown in its ``PackagesList.cmake`` file: + +.. include:: ../../examples/TribitsExampleProject2/PackagesList.cmake + :literal: + +and supports four external packages/TPLs ``Tpl1``, ``Tpl2``, ``Tpl3``, and +``Tpl4`` as shown in its ``TPLsList.cmake`` file: + +.. include:: ../../examples/TribitsExampleProject2/TPLsList.cmake + :literal: + + MockTrilinos ------------- @@ -5954,14 +5992,14 @@ links. How to add a new TriBITS Package dependency ----------------------------------------------- +------------------------------------------- It is often the case where one will want to add a new dependency for an -existing `downstream`_ package to an existing `upstream`_ `TriBITS Package`_. -This can either be a required dependency or an optional dependency. Here, we -will refer to the downstream package as ```` with base directory -```` and will refer to the upstream package as -````. +existing `downstream`_ package to an existing `upstream`_ (internal or +external) `TriBITS Package`_. This can either be a required dependency or an +optional dependency. Here, we will refer to the downstream package as +```` with base directory ```` and will refer to the +upstream (internal or external) package as ````. The process for adding a new dependency to an existing upstream package is as follows: @@ -5986,9 +6024,9 @@ as follows: typically a C/C++ processor macro will be added to the package's configured `/cmake/_config.h.in`_ file using the line:: - #cmakedefine HAVE__ + #cmakedefine HAVE__ - (see `HAVE__`_.) + (see `HAVE__`_.) .. _Warning, do not add optional defines for tests/examples to configured header files: @@ -6017,21 +6055,29 @@ as follows: #include "_config.h" - #if HAVE__ + #if HAVE__ # include "_" #endif 4) **For an optional dependency, use CMake if() statements based on - ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE_NAME}:** When a package + ${PACKAGE_NAME}_ENABLE_:** When a package ``PACKAGE_NAME`` has an optional dependency on an upstream package - ``OPTIONAL_DEP_PACKAGE_NAME`` and needs to put in optional logic in a - CMakeLists.txt file, then the if() statements should use the variable - `${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE_NAME}`_ and **not** the - variable ``${PROJECT_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE_NAME}``. For - example, to optionally enable a test that depends on the enable of the - optional upstream dep package, one would use:: - - if (${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE_NAME}) + ```` and needs to put in optional logic in a + ``CMakeLists.txt`` file, then the ``if()`` statements should use the + variable ``${PACKAGE_NAME}_ENABLE_`` and **not** the + variable ``${PROJECT_NAME}_ENABLE_`` or + ``TPL_ENABLE_`` (if ```` is an + external package/TPL). For example, to optionally enable a test that + depends on the enable of the optional upstream dependent package + ````, one would use:: + + tribits_add_test( ... + EXCLUDE_IF_NOT_TRUE ${PACKAGE_NAME}_ENABLE_ + ) + + or:: + + if (${PACKAGE_NAME}_ENABLE_) tribits_add_test( ... ) endif() @@ -6045,100 +6091,13 @@ package library and executable links. See documentation in the functions argument to these functions, for more details. -How to add a new TriBITS external package/TPL dependency --------------------------------------------------------- - -It is often the case where one will want to add a new dependency for an -existing `downstream`_ package to an existing `upstream`_ `TriBITS external -package/TPL`_. This can either be a required dependency or an optional -dependency. Here, we will refer to the downstream package as -```` with base directory ```` and will refer to the -upstream TPL as ````. - -The process for adding a new dependency to an existing upstream TPL is as -follows: - -1) **Add the name of the upstream TPL to the downstream package's - Dependencies.cmake file:** Add ```` to the call of - `tribits_package_define_dependencies()`_ in the downstream package's - `/cmake/Dependencies.cmake`_ file. If this is to be a required - library dependency, then ```` is added to the - ``LIB_REQUIRED_TPLs`` argument. Alternatively, if this is to be an - optional library dependency, then ```` is added to the - ``LIB_OPTIONAL_TPL`` argument. (For example, see the file - ``packages/Teuchos/cmake/Dependencies.cmake`` file in the - `ReducedMockTrilinos`_ project.) If only the test and/or example sources, - and not the package's core library sources, will have the required or - optional dependency, then ```` is added to the arguments - ``TEST_REQUIRED_TPLs`` or ``TEST_OPTIONAL_TPLS``, respectively. - -2) **For an optional dependency, add `HAVE_` preprocessor macro to the - package's configured header file:** If this is an optional dependency, - typically a C/C++ processor macro will be added to the package's configured - `/cmake/_config.h.in`_ file using the line:: - - #cmakedefine HAVE__ - - (see `HAVE__`_.) - - **WARNING:** If this is a test-only and/or example-only dependency then - please do **not** add a ``#cmakedefine`` to the package's core - `/cmake/_config.h.in`_ file. See `Warning, do not - add optional defines for tests/examples to configured header files`_. - -3) **Use the features of the upstream TPL in the source files of the - downstream package sources and/or tests/examples:** Usage of the features - of the upstream package ```` in the downstream package - ```` will typically involve adding ``#include - _`` in the package's C/C++ source (or test/example) - files (or the equivalent in Fortran). If it is an optional dependency, - then these includes will typically be protected using preprocessor ifdefs, - for example, as:: - - #include "_config.h" - - #if HAVE__ - # include "_" - #endif - -4) **For an optional dependency, use CMake if() statements based on - ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE_NAME}:** When a package - ``PACKAGE_NAME`` has an optional dependency on TPL - ``OPTIONAL_DEP_PACKAGE_NAME`` and needs to put in optional logic in a - CMakeLists.txt file, then the if() statements should use the variable - `${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE_NAME}`_ and **not** the - variable ``${PROJECT_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE_NAME}``. For - example, to optionally enable a test that depends on the enable of the - optional TPL, one could use:: - - if (${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE_NAME}) - tribits_add_test( ... ) - endif() - - or:: - - tribits_add_test( - EXCLUDE_IF_NOT_TRUE ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE_NAME} - [other args] - ) - - .. ToDo: Find an example to point to in TribitsExampleProject. - -NOTE: TriBITS will automatically add the include directories for the upstream -TPL to the compile lines for the downstream package source builds and will add -the libraries for the upstream TPL to the link lines to the downstream package -library and executable links. See documentation in the functions -`tribits_add_library()`_ and `tribits_add_executable()`_, and the ``DEPLIBS`` -argument to these functions, for more details. - - How to tentatively enable an external package/TPL ------------------------------------------------- A TriBITS package can request the tentative enable of any of its optional -external packagse/TPLs (see `How to add a new TriBITS external package/TPL -dependency`_). This is done by calling `tribits_tpl_tentatively_enable()`_ in -the package's `/cmake/Dependencies.cmake`_ file. For example:: +external packagse/TPLs (see `How to add a new TriBITS Package dependency`_). +This is done by calling `tribits_tpl_tentatively_enable()`_ in the package's +`/cmake/Dependencies.cmake`_ file. For example:: tribits_package_define_dependencies( ... @@ -6303,6 +6262,243 @@ file as well. Then every ``CMakeLists.txt`` file in subdirectories just calls ``include_tribits_build()``. That is it. +How to implement a TriBITS-compliant internal package using raw CMake +--------------------------------------------------------------------- + +As described in `TriBITS-Compliant Internal Packages`_, it is possible to +create a raw CMake build system for a CMake package that can build under a +parent TriBITS CMake project. The raw CMake code for such a package must +provide the ``::all_libs`` target both in the current CMake build +system and also in the generated ``Config.cmake`` file for the build +directory and in the installed ``Config.cmake`` file. Every such +TriBITS-compliant internal package therefore is **also capable of installing a +TriBITS-compliant external package** ``Config.cmake`` file (see `How +to implement a TriBITS-compliant external package using raw CMake`_). + +.. ToDo: Consider listing out the key features of a raw CMake build system + that is needed for a TriBITS-compliant internal package. + +A raw CMake build system for a TriBITS-compliant internal package is +demonstrated in the `TribitsExampleProject2`_ project ``Package1`` package. +The base ``CMakeLists.txt`` file for building ``Package1`` with a raw CMake +build system (called ``package1/CMakeLists.raw.cmake`` in that directory) +looks like: + +.. include:: TribitsExampleProject2_Package1_CMakeLists.raw.internal.cmake + :literal: + +As shown above, this simple CMake package contains the basic features of any +CMake project/package including calling the ``cmake_minimum_required()`` and +``project()`` commands as well as including ``GNUInstallDirs``. In this +example, the project/package being built ``Package1`` has a dependency on an +external upstream package ``Tpl1`` pulled in with ``find_package(Tpl1)``. +Also in this example, the package has native tests it defines with +``include(CTest)`` and ``add_subdirectory()`` (if ``Package1_ENABLE_TESTS`` is +set to ``ON``). + +The file ``package1/src/CMakeLists.raw.cmake`` (which gets included from +``package1/src/CMakeLists.txt``) creates a library and executable for the +package and has the contents: + +.. include:: ../../examples/TribitsExampleProject2/packages/package1/src/CMakeLists.raw.cmake + :literal: + +This creates a single installable library target ``Package1_package1`` which +is aliased as ``Package1::package1`` in the current CMake project and sets up +to create the IMPORTED target ``Package1::package1`` in the generated +``Package1ConfigTarget.cmake`` file, which gets included in the installed +``Package1Config.cmake`` (``Config.cmake``) file (as recommenced in +the book "Professional CMake", see below). In addition, the above code +creates the installable executable ``package1-prg``. + +The ``Package1::all_libs`` (``::all_libs``) target is defined and set +up inside of the included file +``package1/cmake/raw/DefineAllLibsTarget.cmake`` which contains the code: + +.. include:: ../../examples/TribitsExampleProject2/packages/package1/cmake/raw/DefineAllLibsTarget.cmake + :literal: + +The above code contains the ALIAS library target ``Package1::all_libs`` +(``::all_libs``) for the current CMake project as well as sets up for +the IMPORTED target ``Package1::all_libs`` (``::all_libs``) getting +put in the generated ``Package1ConfigTargets.cmake`` file (see below). + +The ``Package1Config.cmake`` (``Config.cmake``) file for the build +directory is generated inside of the included file +``package1/cmake/raw/GeneratePackageConfigFileForBuildDir.cmake`` which has +the contents: + +.. include:: ../../examples/TribitsExampleProject2/packages/package1/cmake/raw/GeneratePackageConfigFileForBuildDir.cmake + :literal: + +The above code uses the ``export(EXPORT ...)`` command to generate the file +``Package1ConfigTargets.cmake`` for the build directory which provides the +IMPORTED targets ``Package1::package1`` and ``Package1::all_libs``. The +command ``configure_file(...)`` generates the ``Package1Config.cmake`` file +that includes it for the build directory +``/cmake_packages/Package1/``. (NOTE: The above code only runs when +the package is being built from inside of a TriBITS project which defines the +command ``tribits_package``. So this code gets skipped when building +``Package1`` as a stand-alone raw CMake project.) + +Finally, the code for generating and installing the ``Package1Config.cmake`` +file for the install directory ``CMAKE_PREFIX_PATH=`` is specified +in the included file +``package1/cmake/raw/GeneratePackageConfigFileForInstallDir.cmake`` with the +contents: + +.. include:: ../../examples/TribitsExampleProject2/packages/package1/cmake/raw/GeneratePackageConfigFileForInstallDir.cmake + :literal: + +The above uses the command ``install(EXPORT ...)`` to have CMake automatically +generate and install the file ``Package1ConfigTargets.cmake`` in the install +directory ``/libs/cmake/Package1/`` which provides the IMPORTED +targets ``Package1::package1`` and ``Package1::all_libs``. The command +``configure_file()`` is used to generate the file +``Package1Config.install.cmake`` in the build directory from the template file +``Package1Config.cmake.in``. Finally, the ``install()`` command is used in +the file ``GeneratePackageConfigFileForInstallDir.cmake`` to set up the +installation of the ``Package1Config.cmake`` file. + +Note, the template file ``package1/cmake/raw/Package1Config.cmake.in`` (which +is unique to ``Package1``) is: + +.. include:: ../../examples/TribitsExampleProject2/packages/package1/cmake/raw/Package1Config.cmake.in + :literal: + +As shown in the all of the above code, there is a lot of boilerplate CMake +code needed to correctly define the targets such that they get put into the +installed ``Package1Config.cmake`` file using the correct namespace +``Package1::`` and care must be taken to ensure that a consistent "export set" +is used for this purpose. (For more details, see the book "Professional +CMake".) + +**NOTE:** One should compare the above raw CMakeLists files to the more +compact TriBITS versions for the base ``package1/CMakeLists.txt`` file (called +``package1/CMakeLists.tribits.cmake`` in the base directory ``pacakge1/``): + +.. include:: ../../examples/TribitsExampleProject2/packages/package1/CMakeLists.tribits.cmake + :literal: + +and the TriBITS ``package1/src/CMakeLists.txt`` file (called +``package1/src/CMakeLists.tribits.cmake``): + +.. include:: ../../examples/TribitsExampleProject2/packages/package1/src/CMakeLists.tribits.cmake + :literal: + +This shows the amount of boilerplate code that TriBITS addresses automatically +(which reduces the overhead of finer-grained packages and avoids common +mistakes with tedious low-level CMake code). + + +How to implement a TriBITS-compliant external package using raw CMake +--------------------------------------------------------------------- + +As described in `TriBITS-Compliant External Packages`_, it is possible to +create a raw CMake build system for a CMake package such that once it is +installed, satisfies the requirements for a TriBITS-compliant external +package. These installed packages provide a ``Config.cmake`` file +that provides the required targets and behaviors as if it was produced by a +TriBITS project. For most existing raw CMake projects that already produce a +"Professional CMake" compliant ``Config.cmake`` file, that usually +just means adding the IMPORTED target called ``::all_libs`` to the +installed ``Config.cmake`` file. + +A raw CMake build system for a TriBITS-compliant external package is +demonstrated in the `TribitsExampleProject2`_ project ``Package1`` package. +The base ``package1/CMakeLists.txt`` file for building ``Package1`` with a raw +CMake build system (called ``package1/CMakeLists.raw.cmake``) for implementing +a TriBITS-compliant internal package looks like: + +.. include:: TribitsExampleProject2_Package1_CMakeLists.raw.external.cmake + :literal: + +Note that the raw build system this example is identical to the build system +for the raw TriBITS-compliant internal package described in `How to implement +a TriBITS-compliant internal package using raw CMake`_. The only differences +are: + +1) The ``Package1Config.cmake`` (``Config.cmake``) file does **not** + need to be generated for the build directory and therefore the code in + ``cmake/raw/GeneratePackageConfigFileForBuildDir.cmake`` does **not** need + to be included. + +2) The ALIAS library target ``Package1::all_libs`` (``::all_libs``) + does **not** need to be generated (but should be to be "Professional CMake" + compliant). + +Other than that, see `How to implement a TriBITS-compliant internal package +using raw CMake`_ for how to implement a TriBITS-compliant external package. + + +How to use TriBITS testing support in non-TriBITS project +--------------------------------------------------------- + +The TriBITS test support functions `tribits_add_test()`_ and +`tribits_add_advanced_test()`_ can be used from any raw (i.e. non-TriBITS) +CMake project. To do so, one just needs to include the TriBITS modules: + +* ``/core/test_support/TribitsAddTest.cmake`` +* ``/core/test_support/TribitsAddAdvancedTest.cmake`` + +and set the variable ``${PROJECT_NAME}_ENABLE_TESTS`` to ``ON``. For an +MPI-enabled CMake project, the CMake variables ``MPI_EXEC``, +``MPI_EXEC_PRE_NUMPROCS_FLAGS``, ``MPI_EXEC_NUMPROCS_FLAG`` and +``MPI_EXEC_POST_NUMPROCS_FLAGS`` must also be set which define the MPI runtime +program launcher command-line used in the TriBITS testing functions:: + + ${MPI_EXEC} ${MPI_EXEC_PRE_NUMPROCS_FLAGS} + ${MPI_EXEC_NUMPROCS_FLAG} + ${MPI_EXEC_POST_NUMPROCS_FLAGS} + + +(NOTE: These variables are defined automatically in a TriBITS project when +``TPL_ENABLE_MPI`` is set to ``ON``.) + +This is demonstrated in the `TribitsExampleProject2`_ project ``Package1`` +package. The base ``pacakge1/CMakeLists.txt`` file for building ``Package1`` +with a raw CMake build system using TriBITS testing functions (called +``package1/CMakeLists.raw.cmake``) looks like: + +.. include:: TribitsExampleProject2_Package1_CMakeLists.raw.tribits_test.cmake + :literal: + +The only difference between this base ``package1/CMakeLists.txt`` file and one +for a raw CMake project is the inclusion of the file +``package1/cmake/raw/EnableTribitsTestSupport.cmake`` which has the contents: + +.. include:: ../../examples/TribitsExampleProject2/packages/package1/cmake/raw/EnableTribitsTestSupport.cmake + :literal: + +The key lines are:: + + include("${Package1_TRIBITS_DIR}/core/test_support/TribitsAddTest.cmake") + include("${Package1_TRIBITS_DIR}/core/test_support/TribitsAddAdvancedTest.cmake") + +This defines the CMake functions `tribits_add_test()`_ and +`tribits_add_advanced_test()`_, respectively. + +The above code demonstrates that ``CMAKE_MODULE_PATH`` does **not** need to be +updated to use these TriBITS ``test_support`` modules. However, one is free +to update ``CMAKE_MODULE_PATH`` and then include the modules by name only +like:: + + list(PREPEND CMAKE_MODULE_PATH "${Package1_TRIBITS_DIR}/core/test_support") + include(TribitsAddTest) + include(TribitsAddAdvancedTest) + +Once these TriBITS modules are included, one can use the TriBITS functions as +demonstrated in the file ``package1/test/CMakeLists.tribits.cmake`` (which is +included from the file ``package1/test/CMakeLists.txt``) and has the contents: + +.. include:: ../../examples/TribitsExampleProject2/packages/package1/test/CMakeLists.tribits.cmake + :literal: + +Note that in this example, the executable ``package1-prg`` was already +created. If new test libraries and executables need to be created, then the +raw CMake commands to create those will need to be added as well. + + How to check for and tweak TriBITS "ENABLE" cache variables ----------------------------------------------------------- diff --git a/cmake/tribits/doc/guides/TribitsSystemMacroFunctionDocTemplate.rst b/cmake/tribits/doc/guides/TribitsSystemMacroFunctionDocTemplate.rst index 6a71292c45..3723c3b7c8 100644 --- a/cmake/tribits/doc/guides/TribitsSystemMacroFunctionDocTemplate.rst +++ b/cmake/tribits/doc/guides/TribitsSystemMacroFunctionDocTemplate.rst @@ -34,6 +34,7 @@ understand the internals of TriBITS. @MACRO: tribits_parse_subpackages_append_packages_add_options() + @MACRO: tribits_prep_to_read_dependencies() + @MACRO: tribits_process_all_repository_deps_setup_files() + +@MACRO: tribits_process_enabled_tpls() + @MACRO: tribits_process_package_dependencies_lists() + @MACRO: tribits_process_packages_and_dirs_lists() + @MACRO: tribits_process_project_dependency_setup_file() + @@ -50,6 +51,6 @@ understand the internals of TriBITS. @MACRO: tribits_save_off_dependency_vars() + @MACRO: tribits_set_dep_packages() + @FUNCTION: tribits_trace_file_processing() + -@FUNCTION: tribits_write_package_client_export_files_install_targets() + +@FUNCTION: tribits_write_package_client_export_files_export_and_install_targets() + @MACRO: tribits_write_xml_dependency_files() + @FUNCTION: tribits_write_xml_dependency_files_if_supported() + diff --git a/cmake/tribits/doc/guides/UtilsMacroFunctionDocTemplate.rst b/cmake/tribits/doc/guides/UtilsMacroFunctionDocTemplate.rst index acc98214c1..79bb6ea0df 100644 --- a/cmake/tribits/doc/guides/UtilsMacroFunctionDocTemplate.rst +++ b/cmake/tribits/doc/guides/UtilsMacroFunctionDocTemplate.rst @@ -39,9 +39,11 @@ @FUNCTION: timer_get_rel_seconds() + @FUNCTION: timer_print_rel_time() + @FUNCTION: tribits_add_enum_cache_var() + +@MACRO: tribits_advanced_set_cache_var_and_default() + @FUNCTION: tribits_deprecated() + @FUNCTION: tribits_deprecated_command() + @MACRO: tribits_create_reverse_list() + +@MACRO: tribits_set_cache_var_and_default() + @FUNCTION: tribits_strip_quotes_from_str() + @FUNCTION: unittest_compare_const() + @FUNCTION: unittest_has_substr_const() + diff --git a/cmake/tribits/doc/guides/generate-guide.sh b/cmake/tribits/doc/guides/generate-guide.sh index ce7a2c6565..da7e128ebe 100755 --- a/cmake/tribits/doc/guides/generate-guide.sh +++ b/cmake/tribits/doc/guides/generate-guide.sh @@ -112,7 +112,7 @@ function tribits_extract_rst_cmake_doc { echo "Extracting TriBITS documentation from *.cmake files ..." echo ../../../python_utils/extract_rst_cmake_doc.py \ - --extract-from=../../../core/package_arch/,../../../ci_support/,../../../core/utils/,../../../ctest_driver/ \ + --extract-from=../../../ctest_driver/,../../../ci_support/,../../../core/package_arch/,../../../core/test_support/,../../../core/utils/ \ --rst-file-pairs=../TribitsMacroFunctionDocTemplate.rst:TribitsMacroFunctionDoc.rst.tmp,../UtilsMacroFunctionDocTemplate.rst:UtilsMacroFunctionDoc.rst.tmp,../TribitsSystemMacroFunctionDocTemplate.rst:TribitsSystemMacroFunctionDoc.rst.tmp \ ${extra_args} \ --file-name-path-base-dir=../../.. \ @@ -152,6 +152,30 @@ function tribits_extract_other_doc { &> TribitsHelloWorldDirAndFiles.txt.tmp update_if_different TribitsHelloWorldDirAndFiles.txt tmp + echo + echo "Generating TribitsExampleProject2/Package1 CMakeList file variants ..." + echo + + cat ../../examples/TribitsExampleProject2/packages/package1/CMakeLists.raw.cmake \ + | grep -v EnableTribitsTestSupport \ + | grep -v GeneratePackageConfigFileForBuildDir \ + &> TribitsExampleProject2_Package1_CMakeLists.raw.external.cmake.tmp + update_if_different TribitsExampleProject2_Package1_CMakeLists.raw.external.cmake tmp + + cat ../../examples/TribitsExampleProject2/packages/package1/CMakeLists.raw.cmake \ + | grep -v EnableTribitsTestSupport \ + &> TribitsExampleProject2_Package1_CMakeLists.raw.internal.cmake.tmp + update_if_different TribitsExampleProject2_Package1_CMakeLists.raw.internal.cmake tmp + + cat ../../examples/TribitsExampleProject2/packages/package1/CMakeLists.raw.cmake \ + | grep -v "that TriBITS does automatically" \ + | grep -v DefineAllLibsTarget \ + | grep -v GeneratePackageConfigFileForBuildDir \ + | grep -v GeneratePackageConfigFileForInstallDir \ + &> TribitsExampleProject2_Package1_CMakeLists.raw.tribits_test.cmake.tmp + update_if_different \ + TribitsExampleProject2_Package1_CMakeLists.raw.tribits_test.cmake tmp + echo echo "Generating output for 'checkin-test.py --help' ..." echo @@ -246,8 +270,8 @@ function make_final_doc_in_subdir { if [[ "${skip_final_generation}" == "0" ]] ; then cd $dir_name echo $PWD - make - cd - + time make + cd - > /dev/null else echo echo "Skipping final generation of '${dir_name}' on request!" diff --git a/cmake/tribits/doc/utils/gen_doc_utils.sh b/cmake/tribits/doc/utils/gen_doc_utils.sh index 639aa68ddf..253418e44b 100644 --- a/cmake/tribits/doc/utils/gen_doc_utils.sh +++ b/cmake/tribits/doc/utils/gen_doc_utils.sh @@ -51,7 +51,8 @@ function generate_git_version_file { echo echo "Generating git version" echo - echo `git describe --match="$_TRIBITS_TAG_PREFIX*"` > TribitsGitVersion.txt + git describe --always --match="$_TRIBITS_TAG_PREFIX*" > TribitsGitVersion.txt || \ + echo "$_TRIBITS_TAG_PREFIX.{Unknown version}" > TribitsGitVersion.txt else echo "$_TRIBITS_TAG_PREFIX.{Unknown version}" > TribitsGitVersion.txt fi diff --git a/cmake/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/cmake/Dependencies.cmake b/cmake/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/cmake/Dependencies.cmake index 3f688dcd49..da10035235 100644 --- a/cmake/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/cmake/Dependencies.cmake +++ b/cmake/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/cmake/Dependencies.cmake @@ -1,3 +1,3 @@ tribits_package_define_dependencies( - LIB_REQUIRED_TPLS LAPACK + LIB_REQUIRED_PACKAGES LAPACK ) diff --git a/cmake/tribits/examples/ReducedMockTrilinos/packages/epetra/cmake/Dependencies.cmake b/cmake/tribits/examples/ReducedMockTrilinos/packages/epetra/cmake/Dependencies.cmake index e3a218cf82..d08c7ab682 100644 --- a/cmake/tribits/examples/ReducedMockTrilinos/packages/epetra/cmake/Dependencies.cmake +++ b/cmake/tribits/examples/ReducedMockTrilinos/packages/epetra/cmake/Dependencies.cmake @@ -1,4 +1,4 @@ tribits_package_define_dependencies( - LIB_REQUIRED_TPLS BLAS LAPACK - LIB_OPTIONAL_TPLS MPI + LIB_REQUIRED_PACKAGES BLAS LAPACK + LIB_OPTIONAL_PACKAGES MPI ) diff --git a/cmake/tribits/examples/ReducedMockTrilinos/packages/epetraext/cmake/Dependencies.cmake b/cmake/tribits/examples/ReducedMockTrilinos/packages/epetraext/cmake/Dependencies.cmake index 1cd83d35ef..d0b518696b 100644 --- a/cmake/tribits/examples/ReducedMockTrilinos/packages/epetraext/cmake/Dependencies.cmake +++ b/cmake/tribits/examples/ReducedMockTrilinos/packages/epetraext/cmake/Dependencies.cmake @@ -1,15 +1,14 @@ if (SHOW_TEST_REQUIRED_PACKAGE_DEP) - set(TEST_REQUIRED_PACKAGES_ARGS TEST_REQUIRED_PACKAGES Triutils) + set(TEST_REQUIRED_PACKAGES Triutils) endif() if (SHOW_TEST_REQUIRED_TPL_DEP) - set(TEST_REQUIRED_TPLS_ARGS TEST_REQUIRED_TPLS AMD) + set(TEST_REQUIRED_PACKAGES ${TEST_REQUIRED_PACKAGES} AMD) endif() tribits_package_define_dependencies( LIB_REQUIRED_PACKAGES Teuchos Epetra LIB_OPTIONAL_PACKAGES Triutils - LIB_OPTIONAL_TPLS UMFPACK AMD PETSC - ${TEST_REQUIRED_PACKAGES_ARGS} - ${TEST_REQUIRED_TPLS_ARGS} + LIB_OPTIONAL_PACKAGES UMFPACK AMD PETSC + TEST_REQUIRED_PACKAGES ${TEST_REQUIRED_PACKAGES} ) diff --git a/cmake/tribits/examples/ReducedMockTrilinos/packages/teuchos/cmake/Dependencies.cmake b/cmake/tribits/examples/ReducedMockTrilinos/packages/teuchos/cmake/Dependencies.cmake index 1d5eb60933..6e5f9d4aa3 100644 --- a/cmake/tribits/examples/ReducedMockTrilinos/packages/teuchos/cmake/Dependencies.cmake +++ b/cmake/tribits/examples/ReducedMockTrilinos/packages/teuchos/cmake/Dependencies.cmake @@ -1,4 +1,4 @@ tribits_package_define_dependencies( - LIB_REQUIRED_TPLS BLAS LAPACK - LIB_OPTIONAL_TPLS Boost MPI + LIB_REQUIRED_PACKAGES BLAS LAPACK + LIB_OPTIONAL_PACKAGES Boost MPI ) diff --git a/cmake/tribits/examples/TribitsExampleApp2/AppHelperFuncs.cmake b/cmake/tribits/examples/TribitsExampleApp2/AppHelperFuncs.cmake index cbed66bcd7..ebb23e1789 100644 --- a/cmake/tribits/examples/TribitsExampleApp2/AppHelperFuncs.cmake +++ b/cmake/tribits/examples/TribitsExampleApp2/AppHelperFuncs.cmake @@ -37,7 +37,7 @@ macro(getTribitsExProj2StuffForAppByPackage) # Find each package and gather up all the ::all_libs targets set(APP_DEPS_LIB_TARGETS "") foreach (packageName IN LISTS ${PROJECT_NAME}_USE_COMPONENTS) - find_package(${packageName} REQUIRED) + find_package(${packageName} CONFIG REQUIRED) message("Found ${packageName}!") list(APPEND APP_DEPS_LIB_TARGETS ${packageName}::all_libs) endforeach() @@ -59,7 +59,8 @@ endmacro() # macro(getTribitsExProj2StuffForAppByProject) - find_package(TribitsExProj2 REQUIRED COMPONENTS ${${PROJECT_NAME}_USE_COMPONENTS}) + find_package(TribitsExProj2 CONFIG REQUIRED + COMPONENTS ${${PROJECT_NAME}_USE_COMPONENTS}) message("\nFound TribitsExProj2! Here are the details: ") message(" TribitsExProj2_DIR = ${TribitsExProj2_DIR}") diff --git a/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/cmake/Dependencies.cmake b/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/cmake/Dependencies.cmake index 13461825af..4ee6c7ee90 100644 --- a/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/cmake/Dependencies.cmake +++ b/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/cmake/Dependencies.cmake @@ -1,5 +1,5 @@ tribits_package_define_dependencies( - LIB_REQUIRED_TPLS HeaderOnlyTpl - LIB_OPTIONAL_TPLS SimpleTpl MPI + LIB_REQUIRED_PACKAGES HeaderOnlyTpl + LIB_OPTIONAL_PACKAGES SimpleTpl MPI REGRESSION_EMAIL_LIST simplecxx-regressions@someurl.none ) diff --git a/cmake/tribits/examples/TribitsExampleProject2/packages/package1/CMakeLists.raw.cmake b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/CMakeLists.raw.cmake new file mode 100644 index 0000000000..ad2a181827 --- /dev/null +++ b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/CMakeLists.raw.cmake @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 3.23.0 FATAL_ERROR) + +if (COMMAND tribits_package) + message("Configuring raw CMake package Package1") +else() + message("Configuring raw CMake project Package1") +endif() + +# Standard project-level stuff +project(Package1 LANGUAGES C CXX) +include(GNUInstallDirs) +find_package(Tpl1 CONFIG REQUIRED) +add_subdirectory(src) +if (Package1_ENABLE_TESTS) + include(CTest) + include("${CMAKE_CURRENT_LIST_DIR}/cmake/raw/EnableTribitsTestSupport.cmake") + add_subdirectory(test) +endif() + +# Stuff that TriBITS does automatically +include("${CMAKE_CURRENT_LIST_DIR}/cmake/raw/DefineAllLibsTarget.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/cmake/raw/GeneratePackageConfigFileForBuildDir.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/cmake/raw/GeneratePackageConfigFileForInstallDir.cmake") diff --git a/cmake/tribits/examples/TribitsExampleProject2/packages/package1/CMakeLists.tribits.cmake b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/CMakeLists.tribits.cmake new file mode 100644 index 0000000000..2c2fc1f8a6 --- /dev/null +++ b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/CMakeLists.tribits.cmake @@ -0,0 +1,5 @@ +message("Configuring package Package1 as full TriBITS package") +tribits_package(Package1) +add_subdirectory(src) +tribits_add_test_directories(test) +tribits_package_postprocess() diff --git a/cmake/tribits/examples/TribitsExampleProject2/packages/package1/CMakeLists.txt b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/CMakeLists.txt index bf2638c61f..c8511aab35 100644 --- a/cmake/tribits/examples/TribitsExampleProject2/packages/package1/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/CMakeLists.txt @@ -1,4 +1,18 @@ -tribits_package(Package1) -add_subdirectory(src) -tribits_add_test_directories(test) -tribits_package_postprocess() +cmake_minimum_required(VERSION 3.23.0 FATAL_ERROR) + +set(Package1_USE_RAW_CMAKE OFF CACHE BOOL + "Use raw CMake for package build, even if TriBITS could be used.") + +# Macro to select the TriBITS or the raw CMake build system +macro(include_cmakelists_file) + if ((NOT COMMAND tribits_project) OR Package1_USE_RAW_CMAKE) + include("${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.raw.cmake" + NO_POLICY_SCOPE) + else() + include("${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.tribits.cmake" + NO_POLICY_SCOPE) + endif() +endmacro() + +# Pull in the base CMakeLists.txt file variant +include_cmakelists_file() diff --git a/cmake/tribits/examples/TribitsExampleProject2/packages/package1/cmake/Dependencies.cmake b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/cmake/Dependencies.cmake index 64ccf196ee..5383950e6a 100644 --- a/cmake/tribits/examples/TribitsExampleProject2/packages/package1/cmake/Dependencies.cmake +++ b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/cmake/Dependencies.cmake @@ -1,3 +1,3 @@ tribits_package_define_dependencies( - LIB_REQUIRED_TPLS Tpl1 + LIB_REQUIRED_PACKAGES Tpl1 ) diff --git a/cmake/tribits/examples/TribitsExampleProject2/packages/package1/cmake/raw/DefineAllLibsTarget.cmake b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/cmake/raw/DefineAllLibsTarget.cmake new file mode 100644 index 0000000000..902b1cdf15 --- /dev/null +++ b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/cmake/raw/DefineAllLibsTarget.cmake @@ -0,0 +1,11 @@ +# Generate the all_libs target(s) +add_library(Package1_all_libs INTERFACE) +set_target_properties(Package1_all_libs + PROPERTIES EXPORT_NAME all_libs) +target_link_libraries(Package1_all_libs + INTERFACE Package1_package1) +install(TARGETS Package1_all_libs + EXPORT ${PROJECT_NAME} + COMPONENT ${PROJECT_NAME} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) +add_library(Package1::all_libs ALIAS Package1_all_libs) diff --git a/cmake/tribits/examples/TribitsExampleProject2/packages/package1/cmake/raw/EnableTribitsTestSupport.cmake b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/cmake/raw/EnableTribitsTestSupport.cmake new file mode 100644 index 0000000000..c4449e5432 --- /dev/null +++ b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/cmake/raw/EnableTribitsTestSupport.cmake @@ -0,0 +1,10 @@ +set(Package1_USE_TRIBITS_TEST_FUNCTIONS OFF CACHE BOOL + "Use TriBITS testing functions") +set(Package1_TRIBITS_DIR "" CACHE PATH + "Path to TriBITS implementation base dir (e.g. TriBITS/tribits)") +if (Package1_USE_TRIBITS_TEST_FUNCTIONS AND Package1_TRIBITS_DIR) + # Pull in and turn on TriBITS testing support + include("${Package1_TRIBITS_DIR}/core/test_support/TribitsAddTest.cmake") + include("${Package1_TRIBITS_DIR}/core/test_support/TribitsAddAdvancedTest.cmake") + set(Package1_ENABLE_TESTS ON) +endif() diff --git a/cmake/tribits/examples/TribitsExampleProject2/packages/package1/cmake/raw/GeneratePackageConfigFileForBuildDir.cmake b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/cmake/raw/GeneratePackageConfigFileForBuildDir.cmake new file mode 100644 index 0000000000..9f937dcda5 --- /dev/null +++ b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/cmake/raw/GeneratePackageConfigFileForBuildDir.cmake @@ -0,0 +1,13 @@ +if (COMMAND tribits_package) + # Generate Package1Config.cmake file for the build tree (for internal + # TriBITS-compliant package) + set(packageBuildDirCMakePackagesDir + "${${CMAKE_PROJECT_NAME}_BINARY_DIR}/cmake_packages/${PROJECT_NAME}") + export(EXPORT ${PROJECT_NAME} + NAMESPACE ${PROJECT_NAME}:: + FILE "${packageBuildDirCMakePackagesDir}/${PROJECT_NAME}ConfigTargets.cmake" ) + configure_file( + "${CMAKE_CURRENT_LIST_DIR}/Package1Config.cmake.in" + "${packageBuildDirCMakePackagesDir}/${PROJECT_NAME}/Package1Config.cmake" + @ONLY ) +endif() diff --git a/cmake/tribits/examples/TribitsExampleProject2/packages/package1/cmake/raw/GeneratePackageConfigFileForInstallDir.cmake b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/cmake/raw/GeneratePackageConfigFileForInstallDir.cmake new file mode 100644 index 0000000000..535685e614 --- /dev/null +++ b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/cmake/raw/GeneratePackageConfigFileForInstallDir.cmake @@ -0,0 +1,15 @@ +# Generate and install the Package1Config.cmake file for the install tree +# (needed for both internal and external TriBITS package) +set(pkgConfigInstallDir "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") +install(EXPORT ${PROJECT_NAME} + DESTINATION "${pkgConfigInstallDir}" + NAMESPACE ${PROJECT_NAME}:: + FILE ${PROJECT_NAME}ConfigTargets.cmake ) +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/raw/Package1Config.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Package1Config.install.cmake" + @ONLY ) +install( + FILES "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Package1Config.install.cmake" + RENAME "Package1Config.cmake" + DESTINATION "${pkgConfigInstallDir}" ) diff --git a/cmake/tribits/examples/TribitsExampleProject2/packages/package1/cmake/raw/Package1Config.cmake.in b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/cmake/raw/Package1Config.cmake.in new file mode 100644 index 0000000000..63cffb7867 --- /dev/null +++ b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/cmake/raw/Package1Config.cmake.in @@ -0,0 +1,3 @@ +set(Tpl1_DIR "@Tpl1_DIR@") +find_package(Tpl1 CONFIG REQUIRED) +include("${CMAKE_CURRENT_LIST_DIR}/Package1ConfigTargets.cmake") diff --git a/cmake/tribits/examples/TribitsExampleProject2/packages/package1/src/CMakeLists.raw.cmake b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/src/CMakeLists.raw.cmake new file mode 100644 index 0000000000..f15cdc5898 --- /dev/null +++ b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/src/CMakeLists.raw.cmake @@ -0,0 +1,23 @@ +# Create and install library 'package1' +add_library(Package1_package1 Package1.hpp Package1.cpp) +target_include_directories(Package1_package1 + PUBLIC $) +target_link_libraries(Package1_package1 + PRIVATE tpl1::tpl1 ) +set_target_properties(Package1_package1 PROPERTIES + EXPORT_NAME package1) +add_library(Package1::package1 ALIAS Package1_package1) +install(TARGETS Package1_package1 + EXPORT ${PROJECT_NAME} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) +install( + FILES Package1.hpp + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) + +# Create and install executable 'package1-prg' +add_executable(package1-prg Package1_Prg.cpp) +target_link_libraries(package1-prg PRIVATE Package1::package1) +install( + TARGETS package1-prg + EXPORT ${PROJECT_NAME} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) diff --git a/cmake/tribits/examples/TribitsExampleProject2/packages/package1/src/CMakeLists.tribits.cmake b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/src/CMakeLists.tribits.cmake new file mode 100644 index 0000000000..8e69c53a57 --- /dev/null +++ b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/src/CMakeLists.tribits.cmake @@ -0,0 +1,4 @@ +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_add_library(package1 HEADERS Package1.hpp SOURCES Package1.cpp) +tribits_add_executable(package1-prg NOEXEPREFIX NOEXESUFFIX + SOURCES Package1_Prg.cpp INSTALLABLE ) diff --git a/cmake/tribits/examples/TribitsExampleProject2/packages/package1/src/CMakeLists.txt b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/src/CMakeLists.txt index b74162bb25..870958046e 100644 --- a/cmake/tribits/examples/TribitsExampleProject2/packages/package1/src/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/src/CMakeLists.txt @@ -1,22 +1 @@ -set(HEADERS "") -set(SOURCES "") - -tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) - -append_set(HEADERS - Package1.hpp - ) -append_set(SOURCES - Package1.cpp - ) - -tribits_add_library( - package1 - HEADERS ${HEADERS} - SOURCES ${SOURCES} - ) - -tribits_add_executable(package1-prg NOEXEPREFIX NOEXESUFFIX - SOURCES Package1_Prg.cpp - INSTALLABLE - ) +include_cmakelists_file() diff --git a/cmake/tribits/examples/TribitsExampleProject2/packages/package1/src/Package1_Prg.cpp b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/src/Package1_Prg.cpp index 2ce91f102a..33d4dc0cef 100644 --- a/cmake/tribits/examples/TribitsExampleProject2/packages/package1/src/Package1_Prg.cpp +++ b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/src/Package1_Prg.cpp @@ -1,9 +1,13 @@ #include +#include #include "Package1.hpp" -int main() +int main(int argc, char* argv[]) { std::cout << "Package1 Deps: " << Package1::deps() << "\n"; + for (int arg_i = 0; arg_i < argc; ++arg_i) { + std::cout << argv[arg_i+1] << "\n"; + } return 0; } diff --git a/cmake/tribits/examples/TribitsExampleProject2/packages/package1/test/CMakeLists.raw.cmake b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/test/CMakeLists.raw.cmake new file mode 100644 index 0000000000..bb039664f9 --- /dev/null +++ b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/test/CMakeLists.raw.cmake @@ -0,0 +1,19 @@ +add_test(NAME Package1_Prg COMMAND package1-prg) +set_tests_properties(Package1_Prg + PROPERTIES PASS_REGULAR_EXPRESSION "Package1 Deps: tpl1") + +add_test(NAME Package1_Prg-advanced COMMAND package1-prg something_extra) +set_tests_properties(Package1_Prg-advanced + PROPERTIES PASS_REGULAR_EXPRESSION "something_extra") + +# NOTE: With raw CMake/CTest, it is not possible to require the matches of +# multiple regexes (i.e. require the match of *both* "Package1 Deps: +# tpl1" and "something_extra"). Also, it is not possible to require a +# non-zero return code in addition to requiring a regex match the output. +# These more advanced features of tribits_add_advanced_test() would need to be +# provided by writing a wrapper script (e.g. using a Python script, a cmake -P +# script, etc.). Also, these tests don't support other features like: b) +# allow tests to be disabled for a variety of reasons like number of MPI +# processes required, incompatible system, disable cache variables -D +# _DISABLE=ON, etc.; b) printing which tests got added or did +# not get added and why when _TRACE_ADD_TEST=ON, etc. diff --git a/cmake/tribits/examples/TribitsExampleProject2/packages/package1/test/CMakeLists.tribits.cmake b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/test/CMakeLists.tribits.cmake new file mode 100644 index 0000000000..48d1f6e192 --- /dev/null +++ b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/test/CMakeLists.tribits.cmake @@ -0,0 +1,14 @@ +tribits_add_test(package1-prg NOEXEPREFIX NOEXESUFFIX + NAME Prg DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../src" NUM_MPI_PROCS 1 + PASS_REGULAR_EXPRESSION "Package1 Deps: tpl1" ) + +tribits_add_advanced_test(Prg-advanced + TEST_0 + EXEC package1-prg DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../src" + NOEXEPREFIX NOEXESUFFIX + ARGS "something_extra" + PASS_REGULAR_EXPRESSION_ALL + "Package1 Deps: tpl1" + "something_extra" + ALWAYS_FAIL_ON_NONZERO_RETURN + ) diff --git a/cmake/tribits/examples/TribitsExampleProject2/packages/package1/test/CMakeLists.txt b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/test/CMakeLists.txt index afef4e708a..11b72aec01 100644 --- a/cmake/tribits/examples/TribitsExampleProject2/packages/package1/test/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/test/CMakeLists.txt @@ -1,6 +1,11 @@ -tribits_add_test(package1-prg NOEXEPREFIX NOEXESUFFIX - NAME Prg - DIRECTORY ${PACKAGE_BINARY_DIR}/src - NUM_MPI_PROCS 1 - PASS_REGULAR_EXPRESSION "Package1 Deps: tpl1" - ) +if ((NOT COMMAND tribits_project) OR Package1_USE_RAW_CMAKE) + if (Package1_USE_TRIBITS_TEST_FUNCTIONS AND (COMMAND tribits_add_test)) + message("-- Using TriBITS Test Functions in raw CMake Package1 build!") + include("${CMAKE_CURRENT_LIST_DIR}/CMakeLists.tribits.cmake") + else() + message("-- Using Raw CMake add_test() in raw CMake Package1 build!") + include("${CMAKE_CURRENT_LIST_DIR}/CMakeLists.raw.cmake") + endif() +else() + include("${CMAKE_CURRENT_LIST_DIR}/CMakeLists.tribits.cmake") +endif() diff --git a/cmake/tribits/examples/TribitsExampleProject2/packages/package2/cmake/Dependencies.cmake b/cmake/tribits/examples/TribitsExampleProject2/packages/package2/cmake/Dependencies.cmake index 46c260a264..e299aef0d7 100644 --- a/cmake/tribits/examples/TribitsExampleProject2/packages/package2/cmake/Dependencies.cmake +++ b/cmake/tribits/examples/TribitsExampleProject2/packages/package2/cmake/Dependencies.cmake @@ -1,4 +1,4 @@ tribits_package_define_dependencies( LIB_REQUIRED_PACKAGES Package1 - LIB_OPTIONAL_TPLS Tpl3 + LIB_OPTIONAL_PACKAGES Tpl3 ) diff --git a/cmake/tribits/examples/TribitsExampleProject2/packages/package3/cmake/Dependencies.cmake b/cmake/tribits/examples/TribitsExampleProject2/packages/package3/cmake/Dependencies.cmake index 6e9a0e1e47..b2c5eec262 100644 --- a/cmake/tribits/examples/TribitsExampleProject2/packages/package3/cmake/Dependencies.cmake +++ b/cmake/tribits/examples/TribitsExampleProject2/packages/package3/cmake/Dependencies.cmake @@ -1,6 +1,4 @@ tribits_package_define_dependencies( - LIB_REQUIRED_PACKAGES Package1 - LIB_OPTIONAL_PACKAGES Package2 - LIB_REQUIRED_TPLS Tpl2 - LIB_OPTIONAL_TPLS Tpl4 + LIB_REQUIRED_PACKAGES Package1 Tpl2 + LIB_OPTIONAL_PACKAGES Package2 Tpl4 ) diff --git a/cmake/tribits/python_utils/gitdist-setup.sh b/cmake/tribits/python_utils/gitdist-setup.sh index 0df08515dc..928c058838 100644 --- a/cmake/tribits/python_utils/gitdist-setup.sh +++ b/cmake/tribits/python_utils/gitdist-setup.sh @@ -44,7 +44,7 @@ if [[ "${existing_gitdist}" == "" ]] ; then fi function gitdist_repo_versions { - gitdist "$@" --dist-no-color log -1 --pretty=format:"%H [%cd] <%ae>%n%s" | grep -v "^$" + gitdist "$@" --dist-no-color log --color=never -1 --pretty=format:"%H [%cd] <%ae>%n%s" | grep -v "^$" } export -f gitdist_repo_versions @@ -60,7 +60,7 @@ function gitdist_show_full_repo_state { echo echo "Repo remotes:" echo - gitdist --dist-no-color "$@" remote -v | grep "\(Git Repo\|push\)" + gitdist --dist-no-color "$@" remote -v | grep --color=never "\(Git Repo\|push\)" } export -f gitdist_show_full_repo_state @@ -73,7 +73,7 @@ alias gitdist-show-full-repo-state=gitdist_show_full_repo_state # Setup for completions for git command and gitdist options commands complete -o default -o nospace -F _git \ - -W "dist-repo-status --dist-help --dist-use-git --dist-repos --dist-not-repos --dist-version-file --dist-version-file2 --dist-no-color --dist-debug --dist-no-opt --dist-mod-only --dist-legend" \ + -W "dist-repo-status --dist-help --dist-use-git --dist-repos --dist-not-repos --dist-version-file --dist-version-file2 --dist-no-color --dist-debug --dist-no-opt --dist-mod-only" \ gitdist gitdist-mod complete -o default -o nospace \ -W "--dist-use-git --dist-repos --dist-not-repos --dist-mod-only" \ @@ -82,5 +82,5 @@ complete -o default -o nospace \ -W "--dist-use-git --dist-repos --dist-not-repos --dist-mod-only" \ gitdist_show_full_repo_state gitdist-show-full-repo-state complete -o default -o nospace \ - -W "--dist-repos --dist-not-repos --dist-mod-only" \ + -W "--dist-repos --dist-not-repos --dist-mod-only --dist-legend" \ gitdist-status diff --git a/cmake/tribits/python_utils/gitdist.py b/cmake/tribits/python_utils/gitdist.py index db20c7ddfa..6800e2e20c 100755 --- a/cmake/tribits/python_utils/gitdist.py +++ b/cmake/tribits/python_utils/gitdist.py @@ -36,7 +36,7 @@ def s(x): distRepoStatusLegend = r"""Legend: * ID: Repository ID, zero based (order git commands are run) * Repo Dir: Relative to base repo (base repo shown first with '(Base)') -* Branch: Current branch (or detached HEAD) +* Branch: Current branch, or (if detached HEAD) tag name or SHA1 * Tracking Branch: Tracking branch (or empty if no tracking branch exists) * C: Number local commits w.r.t. tracking branch (empty if zero or no TB) * M: Number of tracked modified (uncommitted) files (empty if zero) @@ -333,7 +333,7 @@ def getHelpTopicsStr(): |----|-----------------------|--------|-----------------|---|----|---| | 0 | BaseRepo (Base) | dummy | | | | | | 1 | ExtraRepo1 | master | origin/master | 1 | 2 | | - | 2 | ExtraRepo1/ExtraRepo2 | HEAD | | | 25 | 4 | + | 2 | ExtraRepo1/ExtraRepo2 | abc123 | | | 25 | 4 | | 3 | ExtraRepo3 | master | origin/master | | | | ---------------------------------------------------------------------- @@ -341,6 +341,13 @@ def getHelpTopicsStr(): """+distRepoStatusLegend+\ r""" + +In the case of a detached head state, as shown above with the repo +'ExtraRepo3', the SHA1 (e.g. 'abc123') was printed instead of 'HEAD'. +However, if the repo is in the detached head state but a tag happens to point +to the current commit (e.g. 'git tag --points-at' returns non-empy), then the +tag name (e.g. 'v1.2.3') is printed instead of the SHA1 of the commit. + One can also show the status of only changed repos with the command: $ gitdist dist-repo-status --dist-mod-only # alias 'gitdist-mod-status' @@ -351,7 +358,7 @@ def getHelpTopicsStr(): | ID | Repo Dir | Branch | Tracking Branch | C | M | ? | |----|-----------------------|--------|-----------------|---|----|---| | 1 | ExtraRepo1 | master | origin/master | 1 | 2 | | - | 2 | ExtraRepo1/ExtraRepo2 | HEAD | | | 25 | 4 | + | 2 | ExtraRepo1/ExtraRepo2 | abc123 | | | 25 | 4 | ---------------------------------------------------------------------- (see the alias 'gitdist-mod-status' in --dist-help=aliases). @@ -396,13 +403,13 @@ def getHelpTopicsStr(): with this script listing three lines per repo (e.g. as shown above) using (for example): - $ gitdist --dist-no-color log -1 --pretty=format:"%h [%ad] <%ae>%n%s" \ + $ gitdist --dist-no-color log --color=never -1 --pretty=format:"%h [%ad] <%ae>%n%s" \ | grep -v "^$" &> RepoVersion.txt (which is defined as the alias 'gitdist-repo-versions' in the file 'gitdist-setup.sh') or two lines per repo using (for example): - $ gitdist --dist-no-color log -1 --pretty=format:"%h [%ad] <%ae>" \ + $ gitdist --dist-no-color log --color=never -1 --pretty=format:"%h [%ad] <%ae>" \ | grep -v "^$" &> RepoVersion.txt This allows checking out consistent versions of the set git repos, diffing two @@ -495,7 +502,7 @@ def getHelpTopicsStr(): $ alias gitdist-status="gitdist dist-repo-status" $ alias gitdist-mod="gitdist --dist-mod-only" $ alias gitdist-mod-status="gitdist dist-repo-status --dist-mod-only" - $ alias gitdist-repo-versions="gitdist --dist-no-color log -1 \ + $ alias gitdist-repo-versions="gitdist --dist-no-color log --color=never -1 \ --pretty=format:\"%h [%ad] <%ae>%n%s\" | grep -v \"^$\"" These are added by sourcing the provided file 'gitdist-setup.sh' (which should @@ -844,7 +851,8 @@ def createTable(tableData, utf8=False): if mockSttySize: sttySize = mockSttySize else: - sttySize = os.popen("stty size", "r").read() + with os.popen("stty size", "r") as subprocess: + sttySize = subprocess.read() rows, columns = sttySize.split() except: shrink = False @@ -1071,7 +1079,7 @@ def getCmndOutput(cmnd, rtnCode=False): child = subprocess.Popen(cmnd, shell=True, stdout=subprocess.PIPE, stderr = subprocess.STDOUT) output = child.stdout.read() - child.wait() + child.communicate() if rtnCode: return (s(output), child.returncode) return s(output) @@ -1304,7 +1312,10 @@ def getCommandlineOps(): clp.add_option( noColorArgName, dest="useColor", action="store_false", - help="If set, don't use color in the output for gitdist (better for output to a file).", + help="If set, don't use color in the output for gitdist and set" + +" '-c color.status=never' before the git command (like 'status')." + +" NOTE: user should also pass in --color=never for git commands " + +" accept that argument. (Better for output to a file).", default=True ) clp.add_option( @@ -1544,7 +1555,12 @@ def runRepoCmnd(options, cmndLineArgsArray, repoDirName, baseDir, \ repoDirName, repoVersionDict, repoVersionDict2) cmndLineArgsArrayDefaultBranch = replaceDefaultBranchInCmndLineArgs( \ cmndLineArgsArrayRepo, repoDirName, defaultBranchDict) - egCmndArray = [ options.useGit ] + cmndLineArgsArrayDefaultBranch + egCmndArray = [ options.useGit ] + if options.useColor: + egCmndArray.extend(['-c', 'color.status=always']) + else: + egCmndArray.extend(['-c', 'color.status=never']) + egCmndArray.extend(cmndLineArgsArrayDefaultBranch) runCmnd(options, egCmndArray) @@ -1566,6 +1582,20 @@ def repoExistsAndNotExcluded(options, extraRepo, notReposList): return True +# Get the identifier for the current commit in the repo +def getRepoVersionIdentifier(options, getCmndOutputFunc, showMoreHeadDetails): + branch = getLocalBranch(options, getCmndOutputFunc) + if showMoreHeadDetails != "SHOW_MORE_HEAD_DETAILS": + return branch + if branch != "HEAD": + return branch + tagName = getCmndOutputFunc(options.useGit + " tag --points-at").strip() + if tagName != "": + return tagName + sha1 = getCmndOutputFunc(options.useGit + " log --pretty=%h -1").strip() + return sha1 + + # Get the tracking branch for a repo def getLocalBranch(options, getCmndOutputFunc): (resp, rtnCode) = getCmndOutputFunc( @@ -1655,7 +1685,9 @@ def getNumModifiedAndUntracked(options, getCmndOutputFunc): class RepoStatsStruct: - def __init__(self, branch, trackingBranch, numCommits, numModified, numUntracked): + def __init__(self, branch, trackingBranch, numCommits, numModified, + numUntracked \ + ): self.branch = branch self.trackingBranch = trackingBranch self.numCommits = numCommits @@ -1689,21 +1721,16 @@ def hasLocalChanges(self): return False -def getRepoStats(options, getCmndOutputFunc=None): +def getRepoStats(options, getCmndOutputFunc=None, showMoreHeadDetails=""): if not getCmndOutputFunc: getCmndOutputFunc = getCmndOutput - branch = getLocalBranch(options, getCmndOutputFunc) + branch = getRepoVersionIdentifier(options, getCmndOutputFunc, showMoreHeadDetails) trackingBranch = getTrackingBranch(options, getCmndOutputFunc) - numCommits = getNumCommitsWrtTrackingBranch(options, - trackingBranch, - getCmndOutputFunc) + numCommits = getNumCommitsWrtTrackingBranch(options, trackingBranch, getCmndOutputFunc) (numModified, numUntracked) = getNumModifiedAndUntracked(options, - getCmndOutputFunc) - return RepoStatsStruct(branch, - trackingBranch, - numCommits, - numModified, - numUntracked) + getCmndOutputFunc) + return RepoStatsStruct(branch, trackingBranch, numCommits, + numModified, numUntracked) class RepoVersionStruct: @@ -1894,7 +1921,7 @@ def getRepoName(repoDir, baseRepoName): # Get repo stats repoStats = None if options.modifiedOnly or distRepoStatus: - repoStats = getRepoStats(options) + repoStats = getRepoStats(options, showMoreHeadDetails="SHOW_MORE_HEAD_DETAILS") repoVersions = None if distRepoVersionTable: repoVersions = getRepoVersions(options) From d1de4f235c14ba1d6de1fbe90ea7912ecf39b459 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Wed, 27 Mar 2024 13:01:14 -0600 Subject: [PATCH 06/59] CI: Change required cmake back to 3.22.0 --- cmake/tribits/ci_support/TribitsDumpDepsXmlScript.cmake | 2 +- cmake/tribits/core/common/TribitsConstants.cmake | 2 +- cmake/tribits/core/package_arch/tribits_get_version_date.cmake | 2 +- cmake/tribits/ctest_driver/TribitsCTestDriverCore.cmake | 2 +- cmake/tribits/ctest_driver/TribitsGetCTestTestXmlDir.cmake | 2 +- cmake/tribits/ctest_driver/tribits_ctest_update_commands.cmake | 2 +- .../ctest_driver/tribits_ctest_update_commands_wrapper.cmake | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmake/tribits/ci_support/TribitsDumpDepsXmlScript.cmake b/cmake/tribits/ci_support/TribitsDumpDepsXmlScript.cmake index 2d13260c0b..8bef9158b0 100644 --- a/cmake/tribits/ci_support/TribitsDumpDepsXmlScript.cmake +++ b/cmake/tribits/ci_support/TribitsDumpDepsXmlScript.cmake @@ -50,7 +50,7 @@ # -P /ci_support/TribitsDumpDepsXmlScript.cmake # -cmake_minimum_required(VERSION 3.23.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.22.0 FATAL_ERROR) # A) Echo input options (must be specified with -D arguments to CMake command) diff --git a/cmake/tribits/core/common/TribitsConstants.cmake b/cmake/tribits/core/common/TribitsConstants.cmake index b26d497c55..be4881abc1 100644 --- a/cmake/tribits/core/common/TribitsConstants.cmake +++ b/cmake/tribits/core/common/TribitsConstants.cmake @@ -39,7 +39,7 @@ # Define the TriBITS minimum required CMake version -set(TRIBITS_CMAKE_MINIMUM_REQUIRED 3.23.0) +set(TRIBITS_CMAKE_MINIMUM_REQUIRED 3.22.0) macro(tribits_asesrt_minimum_cmake_version) diff --git a/cmake/tribits/core/package_arch/tribits_get_version_date.cmake b/cmake/tribits/core/package_arch/tribits_get_version_date.cmake index 3b941efc4d..c2bcbd1e83 100644 --- a/cmake/tribits/core/package_arch/tribits_get_version_date.cmake +++ b/cmake/tribits/core/package_arch/tribits_get_version_date.cmake @@ -11,7 +11,7 @@ # -P tribits_get_version_date.cmake # -cmake_minimum_required(VERSION 3.23.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.22.0 FATAL_ERROR) # A) Validate input diff --git a/cmake/tribits/ctest_driver/TribitsCTestDriverCore.cmake b/cmake/tribits/ctest_driver/TribitsCTestDriverCore.cmake index 8e6ecfde5e..be7b5b95e6 100644 --- a/cmake/tribits/ctest_driver/TribitsCTestDriverCore.cmake +++ b/cmake/tribits/ctest_driver/TribitsCTestDriverCore.cmake @@ -50,7 +50,7 @@ message("*******************************") message("") -cmake_minimum_required(VERSION 3.23.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.22.0 FATAL_ERROR) set(THIS_CMAKE_CURRENT_LIST_DIR "${CMAKE_CURRENT_LIST_DIR}") diff --git a/cmake/tribits/ctest_driver/TribitsGetCTestTestXmlDir.cmake b/cmake/tribits/ctest_driver/TribitsGetCTestTestXmlDir.cmake index 1aa1aaf339..38c47bf820 100644 --- a/cmake/tribits/ctest_driver/TribitsGetCTestTestXmlDir.cmake +++ b/cmake/tribits/ctest_driver/TribitsGetCTestTestXmlDir.cmake @@ -14,7 +14,7 @@ # then prints the directory /Testing/ to STDOUT. # -cmake_minimum_required(VERSION 3.23.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.22.0 FATAL_ERROR) if ("${PROJECT_NAME}" STREQUAL "") message(FATAL_ERROR "Error, PROJECT_NAME must be set!") diff --git a/cmake/tribits/ctest_driver/tribits_ctest_update_commands.cmake b/cmake/tribits/ctest_driver/tribits_ctest_update_commands.cmake index 4caf72774e..283e32e229 100644 --- a/cmake/tribits/ctest_driver/tribits_ctest_update_commands.cmake +++ b/cmake/tribits/ctest_driver/tribits_ctest_update_commands.cmake @@ -18,7 +18,7 @@ # 3.12) crash in that case. # -cmake_minimum_required(VERSION 3.23.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.22.0 FATAL_ERROR) message("\ncmake -P tribits_ctest_update_commands.cmake:") message("-- GIT_EXE=${GIT_EXE}") diff --git a/cmake/tribits/ctest_driver/tribits_ctest_update_commands_wrapper.cmake b/cmake/tribits/ctest_driver/tribits_ctest_update_commands_wrapper.cmake index 2c3fcf206c..8040574e56 100644 --- a/cmake/tribits/ctest_driver/tribits_ctest_update_commands_wrapper.cmake +++ b/cmake/tribits/ctest_driver/tribits_ctest_update_commands_wrapper.cmake @@ -7,7 +7,7 @@ # the output (and does not send it to CDash). # -cmake_minimum_required(VERSION 3.23.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.22.0 FATAL_ERROR) message("\ncmake -P tribits_ctest_update_commands_wrapper.cmake:") message("-- OUTPUT_FILE=${OUTPUT_FILE}\n") From c8ddde9facfff79592b26acd3b34ff4171ece45d Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Wed, 27 Mar 2024 15:14:53 -0600 Subject: [PATCH 07/59] CI: Missed a cmake version change --- cmake/tribits/core/config_tests/fmangle/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/tribits/core/config_tests/fmangle/CMakeLists.txt b/cmake/tribits/core/config_tests/fmangle/CMakeLists.txt index 2112fa58a4..f9e75b94e0 100644 --- a/cmake/tribits/core/config_tests/fmangle/CMakeLists.txt +++ b/cmake/tribits/core/config_tests/fmangle/CMakeLists.txt @@ -37,7 +37,7 @@ # ************************************************************************ # @HEADER -cmake_minimum_required(VERSION 3.23) +cmake_minimum_required(VERSION 3.22) project(fmangle C Fortran) add_definitions(${COMMON_DEFS}) set(CMAKE_VERBOSE_MAKEFILE ON) From 01440139f39558c293e46747da91008d518d292a Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Wed, 27 Mar 2024 15:46:54 -0600 Subject: [PATCH 08/59] CI: Try to fix intel build --- .github/workflows/intel-build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/intel-build.yml b/.github/workflows/intel-build.yml index 838b79ddd1..f68c434343 100644 --- a/.github/workflows/intel-build.yml +++ b/.github/workflows/intel-build.yml @@ -150,6 +150,8 @@ jobs: cd build source /opt/intel/oneapi/setvars.sh echo "------------" + ls /opt/intel/oneapi/ + echo "------------" ls /opt/intel/oneapi/2024.0/ echo "------------" ls /opt/intel/oneapi/2024.0/bin/ From e332ba1bb70137e521fccfbc9d1aac99fadac415 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Wed, 27 Mar 2024 16:12:25 -0600 Subject: [PATCH 09/59] CI: New version of intel-oneapi --- .github/workflows/intel-build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/intel-build.yml b/.github/workflows/intel-build.yml index f68c434343..6a7083fd4d 100644 --- a/.github/workflows/intel-build.yml +++ b/.github/workflows/intel-build.yml @@ -152,12 +152,12 @@ jobs: echo "------------" ls /opt/intel/oneapi/ echo "------------" - ls /opt/intel/oneapi/2024.0/ + ls /opt/intel/oneapi/2024.1/ echo "------------" - ls /opt/intel/oneapi/2024.0/bin/ + ls /opt/intel/oneapi/2024.1/bin/ echo "------------" - export PATH=/opt/intel/oneapi/2024.0/bin/:$PATH - export LD_LIBRARY_PATH=/opt/intel/oneapi/2024.0/lib/:$LD_LIBRARY_PATH + export PATH=/opt/intel/oneapi/2024.1/bin/:$PATH + export LD_LIBRARY_PATH=/opt/intel/oneapi/2024.1/lib/:$LD_LIBRARY_PATH printenv >> $GITHUB_ENV NUMPROCS=2 COMPILER=${{ matrix.compiler }} INSTALL_PATH=${HOME}/environments/${{ matrix.compiler }}-${{ matrix.hdf5 }}-${{ matrix.netcdf }}-${{ matrix.cgns }} bash ../cmake-config From 69f3f42bb101e57c1916879b98eff8773a608839 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Wed, 27 Mar 2024 16:35:33 -0600 Subject: [PATCH 10/59] CI: Remove debug output [ci skip] --- .github/workflows/intel-build.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/intel-build.yml b/.github/workflows/intel-build.yml index 6a7083fd4d..e2758104f5 100644 --- a/.github/workflows/intel-build.yml +++ b/.github/workflows/intel-build.yml @@ -149,13 +149,13 @@ jobs: mkdir build cd build source /opt/intel/oneapi/setvars.sh - echo "------------" - ls /opt/intel/oneapi/ - echo "------------" - ls /opt/intel/oneapi/2024.1/ - echo "------------" - ls /opt/intel/oneapi/2024.1/bin/ - echo "------------" + # echo "------------" + # ls /opt/intel/oneapi/ + # echo "------------" + # ls /opt/intel/oneapi/2024.1/ + # echo "------------" + # ls /opt/intel/oneapi/2024.1/bin/ + # echo "------------" export PATH=/opt/intel/oneapi/2024.1/bin/:$PATH export LD_LIBRARY_PATH=/opt/intel/oneapi/2024.1/lib/:$LD_LIBRARY_PATH printenv >> $GITHUB_ENV From 86a2efaf86a915d90945874e732b5652358d0401 Mon Sep 17 00:00:00 2001 From: Casey Icenhour Date: Sat, 30 Mar 2024 07:56:51 -0600 Subject: [PATCH 11/59] IOSS: Add guard for ARM/ARM64-specific include on Mac (#447) --- packages/seacas/libraries/ioss/src/Ioss_MemoryUtils.C | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/seacas/libraries/ioss/src/Ioss_MemoryUtils.C b/packages/seacas/libraries/ioss/src/Ioss_MemoryUtils.C index b8aac6060b..21dd95f5d7 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_MemoryUtils.C +++ b/packages/seacas/libraries/ioss/src/Ioss_MemoryUtils.C @@ -14,8 +14,11 @@ #include #include -#if defined(__APPLE__) && defined(__MACH__) +#if defined(__APPLE__) && defined(__MACH__) && (defined(__arm__) || defined(__arm64__)) #include +#endif + +#if defined(__APPLE__) && defined(__MACH__) #include #include #include From 7e25df9bcf37ae1a8b3163759e98e1fedda24eaf Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Mon, 1 Apr 2024 07:38:53 -0600 Subject: [PATCH 12/59] IOSS: Build io_modify only if exodus enabled --- .../seacas/libraries/ioss/src/main/CMakeLists.txt | 4 ++++ packages/seacas/libraries/ioss/src/main/io_modify.C | 12 ++---------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/packages/seacas/libraries/ioss/src/main/CMakeLists.txt b/packages/seacas/libraries/ioss/src/main/CMakeLists.txt index ed0add3e98..d2905ff5f8 100644 --- a/packages/seacas/libraries/ioss/src/main/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/main/CMakeLists.txt @@ -72,6 +72,8 @@ TRIBITS_ADD_EXECUTABLE( SOURCES io_info_main.C INSTALLABLE ) + +IF (${PACKAGE_NAME}_ENABLE_SEACASExodus) TRIBITS_ADD_EXECUTABLE( io_modify NOEXEPREFIX @@ -79,6 +81,8 @@ TRIBITS_ADD_EXECUTABLE( SOURCES io_modify.C modify_interface.C INSTALLABLE ) +endif() + TRIBITS_ADD_EXECUTABLE( sphgen NOEXEPREFIX diff --git a/packages/seacas/libraries/ioss/src/main/io_modify.C b/packages/seacas/libraries/ioss/src/main/io_modify.C index 6f0e61337f..f0273c018a 100644 --- a/packages/seacas/libraries/ioss/src/main/io_modify.C +++ b/packages/seacas/libraries/ioss/src/main/io_modify.C @@ -51,11 +51,10 @@ #include "Ioss_State.h" #include "modify_interface.h" -#if defined(SEACAS_HAVE_EXODUS) +// `io_modify` is only built if Exodus is enabled... #include "exodus/Ioex_Internals.h" #include "exodus/Ioex_Utils.h" #include -#endif #if defined(SEACAS_HAVE_CGNS) #include "cgns/Iocgns_Utils.h" @@ -72,7 +71,7 @@ using real = double; namespace { std::string codename; - std::string version = "2.05 (2024-03-25)"; + std::string version = "2.06 (2024-04-01)"; std::vector attributes_modified; @@ -1653,7 +1652,6 @@ namespace { } #endif -#if defined(SEACAS_HAVE_EXODUS) void update_exodus_assembly_info(Ioss::Region ®ion, const Modify::Interface &interFace) { std::vector ex_assemblies; @@ -1716,18 +1714,13 @@ namespace { Ioex::write_reduction_attributes(exoid, attributes_modified); } } -#endif void update_assembly_info(Ioss::Region ®ion, const Modify::Interface &interFace) { // Determine type of underlying database... const auto type = region.get_database()->get_format(); if (type == "Exodus") { -#if defined(SEACAS_HAVE_EXODUS) update_exodus_assembly_info(region, interFace); -#else - fmt::print(stderr, fg(fmt::color::red), "ERROR: Exodus capability is not enabled.\n"); -#endif } else if (type == "CGNS") { #if defined(SEACAS_HAVE_CGNS) @@ -1912,5 +1905,4 @@ namespace { Ioex::update_last_time_attribute(exoid, max_time); (void)region.get_min_time(); // Triggers reloading region stateTimes vector. } - } // nameSpace From 3d12930b3281b2004e05d32abf55534faa3f88aa Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Mon, 1 Apr 2024 07:39:38 -0600 Subject: [PATCH 13/59] IOSS: Detect if exodus enabled for exodus include --- packages/seacas/libraries/ioss/src/main/io_info.C | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/seacas/libraries/ioss/src/main/io_info.C b/packages/seacas/libraries/ioss/src/main/io_info.C index 706b1db90c..b44c492595 100644 --- a/packages/seacas/libraries/ioss/src/main/io_info.C +++ b/packages/seacas/libraries/ioss/src/main/io_info.C @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2023 National Technology & Engineering Solutions +// Copyright(C) 1999-2024 National Technology & Engineering Solutions // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with // NTESS, the U.S. Government retains certain rights in this software. // @@ -51,7 +51,9 @@ #include "Ioss_SurfaceSplit.h" #include "Ioss_Utils.h" #include "Ioss_VariableType.h" +#if defined(SEACAS_HAVE_EXODUS) #include "exodusII.h" +#endif #include "info_interface.h" #if defined(SEACAS_HAVE_CGNS) #include From f72f2689feb81035720bb9d74e6e23312ce54bb6 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Mon, 1 Apr 2024 12:23:10 -0600 Subject: [PATCH 14/59] CI: Fix intel-build.yml --- .github/workflows/intel-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/intel-build.yml b/.github/workflows/intel-build.yml index e2758104f5..faa93ccc00 100644 --- a/.github/workflows/intel-build.yml +++ b/.github/workflows/intel-build.yml @@ -150,7 +150,7 @@ jobs: cd build source /opt/intel/oneapi/setvars.sh # echo "------------" - # ls /opt/intel/oneapi/ + # ls /opt/intel/oneapi/ # echo "------------" # ls /opt/intel/oneapi/2024.1/ # echo "------------" From cc5a041836720dea5e7dd9067887d7893bf3ff8b Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Mon, 1 Apr 2024 12:24:39 -0600 Subject: [PATCH 15/59] CI: Basic script for me to build seacas portion of Trilinos [ci skip] --- packages/seacas/trlinos-seacas-config | 525 ++++++++++++++++++++++++++ 1 file changed, 525 insertions(+) create mode 100755 packages/seacas/trlinos-seacas-config diff --git a/packages/seacas/trlinos-seacas-config b/packages/seacas/trlinos-seacas-config new file mode 100755 index 0000000000..cdcc324243 --- /dev/null +++ b/packages/seacas/trlinos-seacas-config @@ -0,0 +1,525 @@ +#! /usr/bin/env bash + +# Text color variables +if [[ $TERM != *"xterm"* ]]; then + export TERM=dumb +fi +txtred=$(tput setaf 1) # Red +txtgrn=$(tput setaf 2) # Green +txtylw=$(tput setaf 3) # Yellow +#txtblu=$(tput setaf 4) # Blue +#txtpur=$(tput setaf 5) # Purple +txtcyn=$(tput setaf 6) # Cyan +#txtwht=$(tput setaf 7) # White +txtrst=$(tput sgr0) # Text reset + +if [ "${TRAVIS}" == "true" ] +then + BUILDDIR=${1:-build} + mkdir $BUILDDIR && cd $BUILDDIR +else + EXTRA_ARGS=$@ +fi + +### The following assumes you are building in a subdirectory of ACCESS Root +### If not, then define "ACCESS" to point to the root of the SEACAS source code. +if [ "$ACCESS" == "" ] +then + ACCESS=$(cd ..; pwd) +fi + +### The SEACAS code will install in ${INSTALL_PATH}/bin, ${INSTALL_PATH}/lib, and ${INSTALL_PATH}/include. +INSTALL_PATH=${INSTALL_PATH:-${ACCESS}} + +function check_valid() +{ + if [ "${!1}" == "YES" ] || [ "${!1}" == "ON" ]; then + echo "YES" + return 1 + fi + if [ "${!1}" == "NO" ] || [ "${!1}" == "OFF" ]; then + echo "NO" + return 1 + fi + echo "Invalid value for $1 (${!1}) -- Must be ON, YES, NO, or OFF" + exit 1 +} +### Possible subset of what is built --- +APPLICATIONS=${APPLICATIONS:-YES} +APPLICATIONS=$(check_valid APPLICATIONS) + +LEGACY=${LEGACY:-YES} +LEGACY=$(check_valid LEGACY) + +FORTRAN=${FORTRAN:-YES} +FORTRAN=$(check_valid FORTRAN) + +ZOLTAN=${ZOLTAN:-YES} +ZOLTAN=$(check_valid ZOLTAN) + +### TPLs -- +### Make sure these point to the locations to find the libraries and includes in lib and include +### subdirectories of the specified paths. +### For example, netcdf.h should be in ${NETCDF_PATH}/include +NETCDF_PATH=${NETCDF_PATH:-${LIB_INSTALL_PATH}} +PNETCDF_PATH=${PNETCDF_PATH:-${LIB_INSTALL_PATH}} +MATIO_PATH=${MATIO_PATH:-${LIB_INSTALL_PATH}} +HDF5_PATH=${HDF5_PATH:-${LIB_INSTALL_PATH}} +CGNS_PATH=${CGNS_PATH:-${LIB_INSTALL_PATH}} +FAODEL_PATH=${FAODEL_PATH:-${LIB_INSTALL_PATH}} +ADIOS2_PATH=${ADIOS2_PATH:-${LIB_INSTALL_PATH}} +CATALYST2_PATH=${CATALYST2_PATH:-${LIB_INSTALL_PATH}} +GTEST_PATH=${GTEST_PATH:-${LIB_INSTALL_PATH}} +#CATCH2_PATH=${CATCH2_PATH:-${LIB_INSTALL_PATH}} +KOKKOS_PATH=${KOKKOS_PATH:-${LIB_INSTALL_PATH}} +METIS_PATH=${METIS_PATH:-${LIB_INSTALL_PATH}} +PARMETIS_PATH=${PARMETIS_PATH:-${LIB_INSTALL_PATH}} +#FMT_PATH=${FMT_PATH:-${LIB_INSTALL_PATH}} + +### Set to ON for parallel compile; otherwise OFF for serial (default) +if [ "${MPI}" = "" ] +then + if [[ -f "$NETCDF_PATH/bin/nc-config" ]]; then + netcdf_parallel=$($NETCDF_PATH/bin/nc-config --has-parallel) + if [ "${netcdf_parallel}" == "yes" ] + then + MPI=YES + else + MPI=NO + fi + else + echo "Unable to determine whether netCDF is parallel or serial. Assuming serial" + echo "Set either \"NETCDF_PATH\" or \"MPI\" manually if the assumption is incorrect." + MPI=NO + fi +fi + +MPI=$(check_valid MPI) +echo "${txtgrn}MPI set to ${MPI}${txtrst}" + +if [ "${MPI}" == "NO" ] +then + ### Change this to point to the compilers you want to use + ## Travis build (and others) set this to EXTERNAL to set + ## CXX, CC, and FC externally. + COMPILER=${COMPILER:-gnu} + + if [ "$COMPILER" == "gnu" ] + then + CXX=g++ + CC=gcc + FC=gfortran + CFLAGS="-Wall -Wunused -pedantic -Wshadow -std=c11" + CXXFLAGS="-Wall -Wextra -Wunused -pedantic -Wshadow" + fi + + if [ "$COMPILER" == "gnubrew" ] + then + VER=${VER:-10} + CXX=g++-${VER} + CC=gcc-${VER} + FC=gfortran-${VER} + CFLAGS="-Wall -Wunused -pedantic -Wshadow -std=c11" + CXXFLAGS="-Wall -Wextra -Wunused -pedantic -Wshadow" + fi + + if [ "$COMPILER" == "gnumacport" ] + then + VER=${VER:-10} + CXX=g++-mp-${VER} + CC=gcc-mp-${VER} + FC=gfortran-mp-${VER} + CFLAGS="-Wall -Wunused -pedantic -Wshadow -std=c11" + CXXFLAGS="-Wall -Wextra -Wunused -pedantic -Wshadow" + fi + + if [ "$COMPILER" == "clangmacport" ] + then + VER=${VER:-9} + CXX=clang++-mp-${VER}.0 + CC=clang-mp-${VER}.0 + FC=gfortran + CFLAGS="-Wall -Wunused -pedantic -Wshadow -std=c11" + CXXFLAGS="-Wall -Wextra -Wunused -pedantic -Wshadow" + fi + + if [ "$COMPILER" == "nvidia" ] + then + CXX="nvcc -x c++" + CC=nvcc + FC=gfortran + fi + + if [ "$COMPILER" == "clang" ] + then + CXX=clang++ + CC=clang + FC=${FC:-gfortran} + CFLAGS="-Wall -Wunused -pedantic -Wshadow" + CXXFLAGS="-Wall -Wextra -Wunused -pedantic -Wshadow" + fi + + if [ "$COMPILER" == "intel" ] + then + CXX=icpx + CC=icx + FC=ifx + CFLAGS="-Wall -Wunused" + CXXFLAGS="-Wall -Wextra -Wunused -DFMT_HEADER_ONLY" + fi + + # When building: "scan-build make -j8" + if [ "$COMPILER" == "analyzer" ] + then + CXX=/opt/local/libexec/llvm-9.0/libexec/c++-analyzer + CC=/opt/local/libexec/llvm-9.0/libexec/ccc-analyzer + FC=gfortran + CFLAGS="-Wall -Wunused" + CXXFLAGS="-Wall -Wunused" + FORTRAN="NO" + fi + + if [ "$COMPILER" == "ibm" ] + then + CXX=xlC + CC=xlc + FC=xlf + fi +fi + +MODERN=${MODERN:-NO} +if [ "${MODERN}" == "YES" ] +then +# MODERN_ARG="-D TPL_ENABLE_HDF5:BOOL=ON -D Netcdf_ALLOW_MODERN:BOOL=ON" + MODERN_ARG="-DNetcdf_FORCE_MODERN:BOOL=ON -DCGNS_FORCE_MODERN:BOOL=ON" +else + MODERN_ARG="-D HDF5_NO_SYSTEM_PATHS=YES" +fi + +GENERATOR=${GENERATOR:-"Unix Makefiles"} + +# If using an XLF compiler on an IBM system, may need to add the following: +# -DCMAKE_Fortran_FLAGS="-qfixed=72" \ +# -DCMAKE_EXE_LINKER_FLAGS:STRING="-lxl -lxlopt" + +CRAY="${CRAY:-NO}" +CRAY=$(check_valid CRAY) + +if [ "${CRAY}" == "YES" ] +then + SHARED="${SHARED:-NO}" +else + SHARED="${SHARED:-YES}" +fi +SHARED=$(check_valid SHARED) + +if [ "${CRAY}" == "YES" ] && [ "${SHARED}" == "NO" ] +then + # Assumes we build our own static zlib with CRAY + EXTRA_LIB=-DTrilinos_EXTRA_LINK_FLAGS=${LIB_INSTALL_PATH}/lib/libz.a +fi + +### Switch for Debug or Release build: +### Check that both `DEBUG` and `BUILD_TYPE` are not set +if [ ! -z ${DEBUG+x} ] && [ ! -z ${BUILD_TYPE+x} ] +then + echo "ERROR: Both DEBUG and BUILD_TYPE are set. Only one is allowed." + exit +fi + +BUILD_TYPE="${BUILD_TYPE:-RELEASE}" + +if [ ! -z ${DEBUG+x} ] +then + if [ "${DEBUG}" == "ON" ] || [ "${DEBUG}" == "YES" ] + then + BUILD_TYPE="DEBUG" + elif [ "${DEBUG}" == "OFF" ] || [ "${DEBUG}" == "NO" ] + then + BUILD_TYPE="RELEASE" + else + echo "ERROR: Invalid value for DEBUG ('$DEBUG'). Must be 'ON', 'OFF', 'YES', 'NO'." + exit + fi +fi + + +### If you do not have the X11 developer package on your system +### which provides X11/Xlib.h and the libX11, then change the "YES" +### below to "NO". It will disable blot and fastq +HAVE_X11=${HAVE_X11:-YES} +HAVE_X11=$(check_valid HAVE_X11) + +### Set to ON to enable the building of a thread-safe version of the Exodus and IOSS libraries. +THREADSAFE=${THREADSAFE:-NO} +THREADSAFE=$(check_valid THREADSAFE) + +function check_enable() +{ + local path=$1 + if [ -e "${path}" ] + then + echo "YES" + else + echo "NO" + fi +} + +HAVE_NETCDF=$(check_enable "${NETCDF_PATH}/include/netcdf.h") +HAVE_MATIO=$(check_enable "${MATIO_PATH}/include/matio.h") +HAVE_CGNS=$(check_enable "${CGNS_PATH}/include/cgnslib.h") +HAVE_FAODEL=$(check_enable "${FAODEL_PATH}/include/faodel/faodelConfig.h") +HAVE_ADIOS2=$(check_enable "${ADIOS2_PATH}/include/adios2.h") +HAVE_CATALYST2=$(check_enable "${CATALYST2_PATH}/include/catalyst-2.0/catalyst.h") +HAVE_GTEST=$(check_enable "${GTEST_PATH}/include/gtest/gtest.h") +#HAVE_CATCH2=$(check_enable "${CATCH2_PATH}/include/catch2/catch_all.hpp") +HAVE_KOKKOS=$(check_enable "${KOKKOS_PATH}/include/Kokkos_Core.hpp") +HAVE_METIS=$(check_enable "${METIS_PATH}/include/metis.h") +HAVE_PARMETIS=$(check_enable "${METIS_PATH}/include/parmetis.h") + +### DataWarp (Burst Buffer) +### I use the following for mutrino (10/16/2018): +### module load datawarp +### -D TPL_ENABLE_DataWarp:BOOL=ON \ +### -D DataWarp_LIBRARY_DIRS:PATH=/opt/cray/datawarp/2.1.16-6.0.5.1_2.61__g238b34d.ari/lib \ +### -D DataWarp_INCLUDE_DIRS:PATH=/opt/cray/datawarp/2.1.16-6.0.5.1_2.61__g238b34d.ari/include \ + +### Define to NO to *enable* exodus deprecated functions +OMIT_DEPRECATED=${OMIT_DEPRECATED:-NO} + +NUMPROCS=${NUMPROCS:-4} + +# BUG needs to work with cray too. +if [ "${MPI}" == "YES" ] && [ "${CRAY}" == "YES" ] +then + MPI_EXEC=$(which srun) + MPI_SYMBOLS="-D MPI_EXEC=${MPI_EXEC} -D MPI_EXEC_NUMPROCS_FLAG=-n -DMPI_EXEC_DEFAULT_NUMPROCS:STRING=${NUMPROCS} -DMPI_EXEC_MAX_NUMPROCS:STRING=${NUMPROCS}" + CXX=CC + CC=cc + FC=ftn + MPI_BIN=$(dirname $(which ${CC})) +elif [ "${MPI}" == "YES" ] +then + if [ "${USE_SRUN}" == "YES" ] + then + MPI_EXEC=$(which srun) + MPI_SYMBOLS="-D MPI_EXEC=${MPI_EXEC} -D MPI_EXEC_NUMPROCS_FLAG=-N -DMPI_EXEC_DEFAULT_NUMPROCS:STRING=${NUMPROCS} -DMPI_EXEC_MAX_NUMPROCS:STRING=${NUMPROCS}" + MPI_BIN=$(dirname "${MPI_EXEC}") + else + MPI_EXEC=$(which mpiexec) + MPI_SYMBOLS="-D MPI_EXEC=${MPI_EXEC} -DMPI_EXEC_DEFAULT_NUMPROCS:STRING=${NUMPROCS} -DMPI_EXEC_MAX_NUMPROCS:STRING=${NUMPROCS}" + MPI_BIN=$(dirname "${MPI_EXEC}") + fi + CXX=mpicxx + CC=mpicc + FC=mpif77 +fi + +OS=$(uname -s) +if [ "$SHARED" == "YES" ] +then + if [ "$OS" == "Darwin" ] ; then + LD_EXT="dylib" + else + LD_EXT="so" + fi +else +# NOTE: Some systems may need `curl` added to Seacas_EXTRA_LINK_FLAGS` +# If you see missing symbols containing `_curl`, try adding `curl` +# EXTRA_LIB="-DTrilinos_EXTRA_LINK_FLAGS=curl;z;dl -DSEACASExodus_ENABLE_SHARED:BOOL=OFF" + EXTRA_LIB="-DTrilinos_EXTRA_LINK_FLAGS=z;dl -DSEACASExodus_ENABLE_SHARED:BOOL=OFF" + LD_EXT="a" +fi + +if [ "${HAVE_KOKKOS}" == "YES" ] +then + KOKKOS_SYMBOLS="-DKOKKOS_SRC_PATH:PATH=${INSTALL_PATH}/TPL/kokkos/kokkos \ + -DTPL_Kokkos_LIBRARY_DIRS:PATH=${KOKKOS_PATH}/lib \ + -DTPL_Kokkos_INCLUDE_DIRS:PATH=${KOKKOS_PATH}/include \ + -DTPL_Kokkos_LIBRARIES=${KOKKOS_PATH}/lib/libkokkoscore.${LD_EXT}" +fi + +if [ "$HAVE_FAODEL" == "YES" ] +then + FAODEL_SYMBOLS=" -D TPL_ENABLE_Faodel:BOOL=${HAVE_FAODEL} \ + -D Faodel_ROOT:PATH=${FAODEL_PATH} \ + -D Faodel_INCLUDE_DIRS:PATH=${FAODEL_PATH}/include/faodel \ + " +fi + +if [ "$OS" == "Darwin" ] ; then + DARWIN_OPT="-D CMAKE_MACOSX_RPATH:BOOL=ON -D TPL_X11_INCLUDE_DIRS:PATH=/opt/X11/include" +else + DARWIN_OPT="" +fi + +# Only run doxygen if me and on master branch... +DOXYGEN=${DOXYGEN:-NO} +DOXYGEN=$(check_valid DOXYGEN) + +if [[ "$DOXYGEN" == "NO" && "$OS" == "Darwin" && "$MPI" == "NO" ]] ; then + branch=$(git branch |grep \* |cut -c3-) + USER=$(id -nu) + if [ "$USER" == "gdsjaar" ] && [ "$branch" == "master" ]; then + DOXYGEN=YES + fi +fi + +FC=${FC:-gfortran} + +EXTRA_WARNINGS=${EXTRA_WARNINGS:-NO} +EXTRA_WARNINGS=$(check_valid EXTRA_WARNINGS) + +SANITIZER=${SANITIZER:-NO} + +if [ "$SANITIZER" != "NO" ] ; then +### To use the clang sanitizers: +#sanitizer=address #: AddressSanitizer, a memory error detector. +#sanitizer=integer #: Enables checks for undefined or suspicious integer behavior. +#sanitizer=thread #: ThreadSanitizer, a data race detector. +#sanitizer=memory #: MemorySanitizer, experimental detector of uninitialized reads. +#sanitizer=undefined #: Fast and compatible undefined behavior checker. +#sanitizer=dataflow #: DataFlowSanitizer, a general data flow analysis. +#sanitizer=cfi #: control flow integrity checks. Requires -flto. +#sanitizer=safe-stack #: safe stack protection against stack-based memory corruption errors. +SANITIZE="-fsanitize=${SANITIZER} -fno-omit-frame-pointer -fPIC" +if [ "$SANITIZER" == "integer" ] ; then + SANITIZE="$SANITIZE -fno-sanitize=unsigned-integer-overflow" +fi +fi + +### You can add these below if you want more verbosity... +#-D CMAKE_VERBOSE_MAKEFILE:BOOL=ON \ +#-D Seacas_VERBOSE_CONFIGURE=ON \ + +### You can add these below to regenerate the flex and bison files for +### aprepro and aprepro_lib May have to touch aprepro.l aprepro.y +### aprepro.ll and aprepro.yy to have them regenerate +#-D GENERATE_FLEX_FILES=ON \ +#-D GENERATE_BISON_FILES=ON \ + +if [ "${EXTRA_WARNINGS}" == "YES" ]; then +### Additional gcc warnings: +if [ "$COMPILER" == "gnu" ] +then + COMMON_WARNING_FLAGS="\ + -Wshadow -Wabsolute-value -Waddress -Waliasing -Wpedantic\ + " + + C_WARNING_FLAGS="${COMMON_WARNING_FLAGS}" + + CXX_WARNING_FLAGS="${COMMON_WARNING_FLAGS} -Wnull-dereference -Wzero-as-null-pointer-constant -Wuseless-cast -Weffc++ -Wsuggest-override" + + # -Wuseless-cast + # -Wold-style-cast + # -Wdouble-promotion +fi +if [ "$COMPILER" == "clang" ] +then + C_WARNING_FLAGS="-Weverything -Wno-missing-prototypes -Wno-sign-conversion -Wno-reserved-id-macro" + + CXX_WARNING_FLAGS="-Weverything -Wno-c++98-compat -Wno-old-style-cast -Wno-sign-conversion -Wno-reserved-id-macro" +fi +fi + +rm -f CMakeCache.txt +###------------------------------------------------------------------------ +cmake -G "${GENERATOR}" \ +-D CMAKE_CXX_COMPILER:FILEPATH=${CXX} \ +-D CMAKE_C_COMPILER:FILEPATH=${CC} \ +-D CMAKE_Fortran_COMPILER:FILEPATH=${FC} \ +-D CMAKE_CXX_FLAGS="${CXXFLAGS} ${CXX_WARNING_FLAGS} ${SANITIZE}" \ +-D CMAKE_C_FLAGS="${CFLAGS} ${C_WARNING_FLAGS} ${SANITIZE}" \ +-D CMAKE_Fortran_FLAGS="${FFLAGS} ${F77_WARNING_FLAGS} ${SANITIZE}" \ +-D Trilinos_ENABLE_STRONG_C_COMPILE_WARNINGS=${EXTRA_WARNINGS} \ +-D Trilinos_ENABLE_STRONG_CXX_COMPILE_WARNINGS=${EXTRA_WARNINGS} \ +-D CMAKE_INSTALL_RPATH:PATH=${INSTALL_PATH}/lib \ +-D BUILD_SHARED_LIBS:BOOL=${SHARED} \ +-D CMAKE_BUILD_TYPE=${BUILD_TYPE} \ +-D Trilinos_ENABLE_SEACASExodus=ON \ +-D Trilinos_ENABLE_SEACAS=ON \ +-D Trilinos_ENABLE_Zoltan:BOOL=${ZOLTAN} \ +-D Trilinos_ENABLE_TESTS=ON \ +-D CMAKE_INSTALL_PREFIX:PATH=${INSTALL_PATH} \ +-D Trilinos_SKIP_FORTRANCINTERFACE_VERIFY_TEST:BOOL=ON \ +-D Trilinos_HIDE_DEPRECATED_CODE:BOOL=${OMIT_DEPRECATED} \ +-D Trilinos_ENABLE_Fortran=${FORTRAN} \ +${EXTRA_LIB} \ +${MODERN_ARG} \ +\ +-D TPL_ENABLE_Netcdf:BOOL=${HAVE_NETCDF} \ +-D TPL_ENABLE_Matio:BOOL=${HAVE_MATIO} \ +-D TPL_ENABLE_CGNS:BOOL=${HAVE_CGNS} \ +-D TPL_ENABLE_ADIOS2:BOOL=${HAVE_ADIOS2} \ +-D TPL_ENABLE_Catalyst2:BOOL=${HAVE_CATALYST2} \ +-D TPL_ENABLE_GTest:BOOL=${HAVE_GTEST} \ +-D TPL_ENABLE_Catch2:BOOL=OFF \ +-D TPL_ENABLE_Kokkos:BOOL=${HAVE_KOKKOS} \ +-D TPL_ENABLE_METIS:BOOL=${HAVE_METIS} \ +-D TPL_ENABLE_ParMETIS:BOOL=${HAVE_PARMETIS} \ +-D TPL_ENABLE_MPI:BOOL=${MPI} \ +-D TPL_ENABLE_Pamgen:BOOL=OFF \ +-D TPL_ENABLE_fmt:BOOL=OFF \ +-D TPL_ENABLE_Pthread:BOOL=${THREADSAFE} \ +${THREAD_SAFE_OPT} \ +-D TPL_ENABLE_X11:BOOL=${HAVE_X11} \ +\ +-D SEACASExodus_ENABLE_THREADSAFE:BOOL=${THREADSAFE} \ +-D SEACASIoss_ENABLE_THREADSAFE:BOOL=${THREADSAFE} \ +\ +${KOKKOS_SYMBOLS} \ +${MPI_SYMBOLS} \ +${DARWIN_OPT} \ +${FAODEL_SYMBOLS} \ +\ +-D MPI_BIN_DIR:PATH=${MPI_BIN} \ +-D NetCDF_ROOT:PATH=${NETCDF_PATH} \ +-D HDF5_ROOT:PATH=${HDF5_PATH} \ +-D HDF5_DIR:PATH=${HDF5_PATH} \ +-D CGNS_ROOT:PATH=${CGNS_PATH} \ +-D CGNS_DIR:PATH=${CGNS_PATH} \ +-D Matio_LIBRARY_DIRS:PATH=${MATIO_PATH}/lib \ +-D Matio_INCLUDE_DIRS:PATH=${MATIO_PATH}/include \ +-D Metis_ROOT:PATH=${METIS_PATH} \ +-D ParMETIS_ROOT:PATH=${PARMETIS_PATH} \ +-D PNetCDF_ROOT:PATH=${PNETCDF_PATH} \ +-D CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON \ +$EXTRA_ARGS \ +.. + +echo "" +echo " OS: ${OS}" +echo " ACCESS: ${ACCESS}" +echo "INSTALL_PATH: ${INSTALL_PATH}" +echo "LIB_INSTALL_PATH: ${LIB_INSTALL_PATH}" +echo " " +echo " CC: ${CC}" +echo " CXX: ${CXX}" +echo " FC: ${FC}" +echo " MPI: ${MPI}" +echo " SHARED: ${SHARED}" +echo " FORTRAN: ${FORTRAN}" +echo " BUILD_TYPE: ${BUILD_TYPE}" +echo " THREADSAFE: ${THREADSAFE}" +echo " CRAY: ${CRAY}" +echo " " +echo " NETCDF: ${HAVE_NETCDF}" +echo " MATIO: ${HAVE_MATIO}" +echo " CGNS: ${HAVE_CGNS}" +echo " KOKKOS: ${HAVE_KOKKOS}" +echo " ZOLTAN: ${ZOLTAN}" +echo " ADIOS2: ${HAVE_ADIOS2}" +echo " CATALYST2: ${HAVE_CATALYST2}" +echo " METIS: ${HAVE_METIS}" +echo " PARMETIS: ${HAVE_PARMETIS}" +echo " FAODEL: ${HAVE_FAODEL}" +echo " GTEST: ${HAVE_GTEST}" +echo " CATCH2: ${HAVE_CATCH2}" +echo " DOXYGEN: ${DOXYGEN}" +echo "" + +if [ "${TRAVIS}" == "true" ] +then + make -j2 + cd ${ACCESS} +fi From dfb32ee6e593fdbcebeae0328fc26c7c8aca557f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 21:10:00 +0000 Subject: [PATCH 16/59] @Naapple has signed the CLA in sandialabs/seacas#448 --- signatures/version1/cla.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/signatures/version1/cla.json b/signatures/version1/cla.json index edff1afcca..b42bc58b74 100644 --- a/signatures/version1/cla.json +++ b/signatures/version1/cla.json @@ -143,6 +143,22 @@ "created_at": "2023-11-12T01:33:41Z", "repoId": 36943822, "pullRequestNo": 421 + }, + { + "name": "Naapple", + "id": 32373852, + "comment_id": 2030546189, + "created_at": "2024-04-01T21:00:18Z", + "repoId": 36943822, + "pullRequestNo": 448 + }, + { + "name": "ajpelle", + "id": 108826411, + "comment_id": 2030554931, + "created_at": "2024-04-01T21:06:07Z", + "repoId": 36943822, + "pullRequestNo": 448 } ] } \ No newline at end of file From 395c1d31b07a48b39339477d606a9160e7ef8f2d Mon Sep 17 00:00:00 2001 From: Alex Pelletier Date: Mon, 1 Apr 2024 16:44:41 -0600 Subject: [PATCH 17/59] Catalyst: Add Tag to Catalyst2 TPL + Cleaning (#448) * Cleaned up Catalyst API 2 per Greg S suggestions in previous merge req * Removed unnecessary cmake option: cmake_export_commands * Updated catalyst2 TPL to point to v2.0.0 tag --------- Co-authored-by: Alex J. Pelletier --- TPL/catalyst2/runcmake.sh | 1 + cmake-config | 1 - install-tpl.sh | 3 ++- .../ioss/src/catalyst/Iocatalyst_CatalystManager.C | 12 ++++++------ 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/TPL/catalyst2/runcmake.sh b/TPL/catalyst2/runcmake.sh index 05c728bc7b..1d4adab51b 100644 --- a/TPL/catalyst2/runcmake.sh +++ b/TPL/catalyst2/runcmake.sh @@ -60,6 +60,7 @@ ${RPATH} \ -D CATALYST_BUILD_STUB_IMPLEMENTATION:BOOL=ON \ -D CATALYST_USE_MPI:BOOL=${MPI} \ -D CATALYST_BUILD_TESTING:BOOL=OFF \ +-D CATALYST_WRAP_PYTHON:BOOL=OFF \ $EXTRA_ARGS \ .. diff --git a/cmake-config b/cmake-config index 6fd926fca0..a23c9d0f05 100755 --- a/cmake-config +++ b/cmake-config @@ -544,7 +544,6 @@ ${FAODEL_SYMBOLS} \ -D ParMETIS_ROOT:PATH=${PARMETIS_PATH} \ -D PNetCDF_ROOT:PATH=${PNETCDF_PATH} \ -D fmt_ROOT:PATH=${FMT_PATH} \ --D CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON \ $EXTRA_ARGS \ ${ACCESS} diff --git a/install-tpl.sh b/install-tpl.sh index d6f88319f0..9e679e86db 100755 --- a/install-tpl.sh +++ b/install-tpl.sh @@ -901,6 +901,7 @@ if [ "$CATALYST2" == "YES" ] then if [ "$FORCE" == "YES" ] || ! [ -e $INSTALL_PATH/lib/libcatalyst.${LD_EXT} ] then + catalyst2_version="v2.0.0" echo "${txtgrn}+++ Catalyst2${txtrst}" cd $ACCESS || exit cd TPL/catalyst2 || exit @@ -915,7 +916,7 @@ then then echo "${txtgrn}+++ Configuring, Building, and Installing...${txtrst}" cd catalyst || exit - git checkout master #todo: a specific version + git checkout ${catalyst2_version} rm -rf build mkdir build cd build || exit diff --git a/packages/seacas/libraries/ioss/src/catalyst/Iocatalyst_CatalystManager.C b/packages/seacas/libraries/ioss/src/catalyst/Iocatalyst_CatalystManager.C index 6615e0484d..18eb533f41 100644 --- a/packages/seacas/libraries/ioss/src/catalyst/Iocatalyst_CatalystManager.C +++ b/packages/seacas/libraries/ioss/src/catalyst/Iocatalyst_CatalystManager.C @@ -262,7 +262,7 @@ namespace Iocatalyst { errmsg << "Catalyst pipeline is not a multi-input pipeline"; IOSS_ERROR(errmsg); } - auto name = p.catalystMultiInputPipelineName; + const auto name = p.catalystMultiInputPipelineName; for (auto cp : catPipes) { if (cp.second.enableCatalystMultiInputPipeline && cp.second.catalystMultiInputPipelineName == name) { @@ -280,7 +280,7 @@ namespace Iocatalyst { errmsg << "Catalyst pipeline is not a multi-input pipeline"; IOSS_ERROR(errmsg); } - auto name = p.catalystMultiInputPipelineName; + const auto name = p.catalystMultiInputPipelineName; for (auto &cp : catPipes) { if (cp.second.enableCatalystMultiInputPipeline && cp.second.catalystMultiInputPipelineName == name) { @@ -295,8 +295,8 @@ namespace Iocatalyst { void CatalystManager::broadCastString(IOSS_MAYBE_UNUSED std::string &s, IOSS_MAYBE_UNUSED const Ioss::ParallelUtils &putils) { - IOSS_PAR_UNUSED(s); - IOSS_PAR_UNUSED(putils); + IOSS_MAYBE_UNUSED(s); + IOSS_MAYBE_UNUSED(putils); #ifdef SEACAS_HAVE_MPI int size = s.size(); putils.broadcast(size); @@ -310,8 +310,8 @@ namespace Iocatalyst { void CatalystManager::broadCastStatusCode(IOSS_MAYBE_UNUSED bool &statusCode, IOSS_MAYBE_UNUSED const Ioss::ParallelUtils &putils) { - IOSS_PAR_UNUSED(statusCode); - IOSS_PAR_UNUSED(putils); + IOSS_MAYBE_UNUSED(statusCode); + IOSS_MAYBE_UNUSED(putils); #ifdef SEACAS_HAVE_MPI int code = statusCode; From dbd83b1e049ff0bf4ebbf8c7c49e8e435a833cff Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Tue, 2 Apr 2024 12:17:44 -0600 Subject: [PATCH 18/59] CI: Fix so fmt works in a Trlinos build not named Trilinos --- .../seacas/libraries/ioss/cmake/Dependencies.cmake | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/seacas/libraries/ioss/cmake/Dependencies.cmake b/packages/seacas/libraries/ioss/cmake/Dependencies.cmake index 872dc5d2b9..a8310183bf 100644 --- a/packages/seacas/libraries/ioss/cmake/Dependencies.cmake +++ b/packages/seacas/libraries/ioss/cmake/Dependencies.cmake @@ -1,14 +1,15 @@ -if(CMAKE_PROJECT_NAME STREQUAL "Trilinos") -TRIBITS_PACKAGE_DEFINE_DEPENDENCIES( - LIB_OPTIONAL_PACKAGES SEACASExodus Pamgen Zoltan Kokkos - LIB_OPTIONAL_TPLS HDF5 CGNS ParMETIS Faodel Cereal DLlib Pthread DataWarp ADIOS2 Catalyst2 ${SEACAS_GTest_TPL_name} Catch2 -) -else() +if(CMAKE_PROJECT_NAME STREQUAL "Seacas" OR CMAKE_PROJECT_NAME STREQUAL "SEACAS" ) TRIBITS_PACKAGE_DEFINE_DEPENDENCIES( LIB_REQUIRED_TPLS fmt LIB_OPTIONAL_PACKAGES SEACASExodus Zoltan LIB_OPTIONAL_TPLS HDF5 Pamgen CGNS ParMETIS Faodel Cereal DLlib Pthread ADIOS2 Catalyst2 ${SEACAS_GTest_TPL_name} Kokkos DataWarp Catch2 ) +else() +# Typically for Trilinos since don't have fmt as TPL, but instead have embedded versions. +TRIBITS_PACKAGE_DEFINE_DEPENDENCIES( + LIB_OPTIONAL_PACKAGES SEACASExodus Pamgen Zoltan Kokkos + LIB_OPTIONAL_TPLS HDF5 CGNS ParMETIS Faodel Cereal DLlib Pthread DataWarp ADIOS2 Catalyst2 ${SEACAS_GTest_TPL_name} Catch2 +) endif() TRIBITS_TPL_TENTATIVELY_ENABLE(DLlib) From cbb689f0a645aaf18cbe8c2ab46533fd2c1ca3eb Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Thu, 28 Mar 2024 16:00:32 -0600 Subject: [PATCH 19/59] Warnings found/fixed in Trilinos PR build --- packages/seacas/applications/epu/epu.C | 6 +++--- packages/seacas/applications/exomatlab/EML_Version.h | 2 +- packages/seacas/applications/exomatlab/exomatlab.C | 1 - packages/seacas/applications/nem_slice/elb_loadbal.C | 2 +- packages/seacas/libraries/aprepro_lib/apr_builtin.cc | 1 + packages/seacas/libraries/exodus/src/ex_open_par.c | 2 +- packages/seacas/libraries/ioss/src/CMakeLists.txt | 4 ++-- packages/seacas/libraries/ioss/src/Ioss_Decomposition.C | 4 ++-- packages/seacas/libraries/ioss/src/Ioss_Decomposition.h | 4 ++-- packages/seacas/libraries/ioss/src/Ioss_GroupingEntity.h | 4 ++-- packages/seacas/libraries/ioss/src/exodus/Ioex_DatabaseIO.C | 2 +- .../seacas/libraries/ioss/src/exonull/Ioexnl_DatabaseIO.C | 1 - packages/seacas/libraries/ioss/src/init/CMakeLists.txt | 2 +- packages/seacas/libraries/ioss/src/main/shell_to_hex.C | 3 --- 14 files changed, 17 insertions(+), 21 deletions(-) diff --git a/packages/seacas/applications/epu/epu.C b/packages/seacas/applications/epu/epu.C index 3a1a96f531..9c2bf8340c 100644 --- a/packages/seacas/applications/epu/epu.C +++ b/packages/seacas/applications/epu/epu.C @@ -74,8 +74,8 @@ public: { #if ENABLE_PARALLEL_EPU MPI_Init(&argc, &argv); - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - MPI_Comm_size(MPI_COMM_WORLD, &epu_proc_count); + MPI_Comm_rank(MPI_COMM_WORLD, &rank); // CHECK: ALLOW MPI_COMM_WORLD + MPI_Comm_size(MPI_COMM_WORLD, &epu_proc_count); // CHECK: ALLOW MPI_COMM_WORLD #else (void)(argc); (void)(argv); @@ -529,7 +529,7 @@ int main(int argc, char *argv[]) ExodusFile::close_all(); #if ENABLE_PARALLEL_EPU - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(MPI_COMM_WORLD); // CHECK: ALLOW MPI_COMM_WORLD #endif } else { diff --git a/packages/seacas/applications/exomatlab/EML_Version.h b/packages/seacas/applications/exomatlab/EML_Version.h index 951a877a66..1d8a0c2968 100644 --- a/packages/seacas/applications/exomatlab/EML_Version.h +++ b/packages/seacas/applications/exomatlab/EML_Version.h @@ -10,5 +10,5 @@ static std::array qainfo{ "exomatlab", "2012/04/17", - "0.9.4", + "1.2.0", }; diff --git a/packages/seacas/applications/exomatlab/exomatlab.C b/packages/seacas/applications/exomatlab/exomatlab.C index f162725655..5afd22d835 100644 --- a/packages/seacas/applications/exomatlab/exomatlab.C +++ b/packages/seacas/applications/exomatlab/exomatlab.C @@ -52,7 +52,6 @@ namespace { namespace { std::string codename; - const std::string version = "1.2"; } // namespace int main(int argc, char *argv[]) diff --git a/packages/seacas/applications/nem_slice/elb_loadbal.C b/packages/seacas/applications/nem_slice/elb_loadbal.C index 0868291ecb..0d65ba204a 100644 --- a/packages/seacas/applications/nem_slice/elb_loadbal.C +++ b/packages/seacas/applications/nem_slice/elb_loadbal.C @@ -2676,7 +2676,7 @@ namespace { fmt::print(stderr, "Error returned from Zoltan_Initialize ({}:{})\n", __FILE__, __LINE__); exit(-1); } - struct Zoltan_Struct *zz = Zoltan_Create(MPI_COMM_WORLD); + struct Zoltan_Struct *zz = Zoltan_Create(MPI_COMM_WORLD); // CHECK: ALLOW MPI_COMM_WORLD /* Register Callback functions */ /* Using global Zoltan_Data; could register it here instead as data field. */ diff --git a/packages/seacas/libraries/aprepro_lib/apr_builtin.cc b/packages/seacas/libraries/aprepro_lib/apr_builtin.cc index b996a99ff6..60dc8ccec6 100644 --- a/packages/seacas/libraries/aprepro_lib/apr_builtin.cc +++ b/packages/seacas/libraries/aprepro_lib/apr_builtin.cc @@ -8,6 +8,7 @@ #include "apr_symrec.h" #include "enumerate.h" +#include #include #include #include diff --git a/packages/seacas/libraries/exodus/src/ex_open_par.c b/packages/seacas/libraries/exodus/src/ex_open_par.c index b219bcc361..724d301eee 100644 --- a/packages/seacas/libraries/exodus/src/ex_open_par.c +++ b/packages/seacas/libraries/exodus/src/ex_open_par.c @@ -98,7 +98,7 @@ exoid = ex_open_par ("test.exo", \co{filename path} &CPU_word_size, \co{CPU word size} &IO_word_size, \co{IO word size} &version, \co{ExodusII library version - MPI_COMM_WORLD, + MPI_COMM_WORLD, // CHECK: ALLOW MPI_COMM_WORLD MPI_INFO_NULL);} ~~~ */ diff --git a/packages/seacas/libraries/ioss/src/CMakeLists.txt b/packages/seacas/libraries/ioss/src/CMakeLists.txt index 147b24952b..ee0779d4fd 100644 --- a/packages/seacas/libraries/ioss/src/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/CMakeLists.txt @@ -2,7 +2,7 @@ IF (${PROJECT_NAME}_ENABLE_Kokkos) SET(SEACAS_HAVE_KOKKOS ON) ENDIF() -IF (TPL_ENABLE_Pamgen) +IF (TPL_ENABLE_Pamgen OR Trilinos_ENABLE_Pamgen ) SET(SEACAS_HAVE_PAMGEN ON) ENDIF() @@ -114,7 +114,7 @@ IF (${PACKAGE_NAME}_ENABLE_SEACASExodus) ADD_SUBDIRECTORY(exonull) ENDIF() -IF (TPL_ENABLE_Pamgen) +IF (TPL_ENABLE_Pamgen OR Trilinos_ENABLE_Pamgen ) ADD_SUBDIRECTORY(pamgen) ENDIF() diff --git a/packages/seacas/libraries/ioss/src/Ioss_Decomposition.C b/packages/seacas/libraries/ioss/src/Ioss_Decomposition.C index d581db06c7..13ff0e6b05 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_Decomposition.C +++ b/packages/seacas/libraries/ioss/src/Ioss_Decomposition.C @@ -360,7 +360,7 @@ namespace Ioss { size_t b = Ioss::Utils::find_index_location((size_t)elem, m_fileBlockIndex); size_t off = std::max(m_fileBlockIndex[b], m_elementOffset); - if (!el_blocks[b].localMap.empty() && elem < el_blocks[b].localMap[0] + off) { + if (!el_blocks[b].localMap.empty() && (size_t)elem < el_blocks[b].localMap[0] + off) { el_blocks[b].localIossOffset++; el_blocks[b].importMap.push_back(imp_index[b]++); } @@ -380,7 +380,7 @@ namespace Ioss { size_t b = Ioss::Utils::find_index_location((size_t)elem, m_fileBlockIndex); size_t off = std::max(m_fileBlockIndex[b], m_elementOffset); - el_blocks[b].exportMap.push_back(elem - off); + el_blocks[b].exportMap.push_back((size_t)elem - off); el_blocks[b].exportCount[proc]++; } diff --git a/packages/seacas/libraries/ioss/src/Ioss_Decomposition.h b/packages/seacas/libraries/ioss/src/Ioss_Decomposition.h index 8438b37ede..a22334a068 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_Decomposition.h +++ b/packages/seacas/libraries/ioss/src/Ioss_Decomposition.h @@ -249,12 +249,12 @@ namespace Ioss { auto I = lower_bound( elemGTL.begin(), elemGTL.end(), global_index, [](const std::pair &lhs, INT val) -> bool { return lhs.first < val; }); - assert(I != elemGTL.end() && I->first == global_index); + assert(I != elemGTL.end() && I->first == (INT)global_index); #else auto I = elemGTL.find(global_index); #endif assert(I != elemGTL.end()); - assert(I->first == global_index); + assert(I->first == (INT)global_index); return I->second; } diff --git a/packages/seacas/libraries/ioss/src/Ioss_GroupingEntity.h b/packages/seacas/libraries/ioss/src/Ioss_GroupingEntity.h index 831869c7f4..d3037bb02b 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_GroupingEntity.h +++ b/packages/seacas/libraries/ioss/src/Ioss_GroupingEntity.h @@ -607,7 +607,7 @@ int64_t Ioss::GroupingEntity::get_field_data(const std::string &field_n typename ViewType::HostMirror host_data = Kokkos::create_mirror_view(data); // Extract a pointer to the underlying allocated memory of the host view. - T *host_data_ptr = Data(host_data); + T *host_data_ptr = host_data.data(); // Extract the data from disk to the underlying memory pointed to by host_data_ptr. auto retval = internal_get_field_data(field, host_data_ptr, data_size); @@ -711,7 +711,7 @@ int64_t Ioss::GroupingEntity::put_field_data(const std::string &field_n Kokkos::deep_copy(host_data, data); // Extract a pointer to the underlying allocated memory of the host view. - T *host_data_ptr = Data(host_data); + T *host_data_ptr = host_data.data(); // Transform the field field.transform(host_data_ptr); diff --git a/packages/seacas/libraries/ioss/src/exodus/Ioex_DatabaseIO.C b/packages/seacas/libraries/ioss/src/exodus/Ioex_DatabaseIO.C index ac8fc1bd61..a9399e8681 100644 --- a/packages/seacas/libraries/ioss/src/exodus/Ioex_DatabaseIO.C +++ b/packages/seacas/libraries/ioss/src/exodus/Ioex_DatabaseIO.C @@ -4370,7 +4370,7 @@ namespace Ioex { } } size_t eb_offset = eb->get_offset(); - int index = -1 * (field.get_index() + comp); + int index = -1 * (static_cast(field.get_index()) + comp); ierr = ex_put_partial_num_map(get_file_pointer(), EX_ELEM_MAP, index, eb_offset + 1, my_element_count, Data(component)); } diff --git a/packages/seacas/libraries/ioss/src/exonull/Ioexnl_DatabaseIO.C b/packages/seacas/libraries/ioss/src/exonull/Ioexnl_DatabaseIO.C index bd4f29850c..801d0891c1 100644 --- a/packages/seacas/libraries/ioss/src/exonull/Ioexnl_DatabaseIO.C +++ b/packages/seacas/libraries/ioss/src/exonull/Ioexnl_DatabaseIO.C @@ -54,7 +54,6 @@ // ======================================================================== namespace { const size_t max_line_length = MAX_LINE_LENGTH; - const std::array complex_suffix{".re", ".im"}; template void compute_internal_border_maps(T *entities, T *internal, size_t count, size_t entity_count) diff --git a/packages/seacas/libraries/ioss/src/init/CMakeLists.txt b/packages/seacas/libraries/ioss/src/init/CMakeLists.txt index 1faba06eca..7611afc5ed 100644 --- a/packages/seacas/libraries/ioss/src/init/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/init/CMakeLists.txt @@ -11,7 +11,7 @@ TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_BINARY_DIR}/../" ) -IF (TPL_ENABLE_Pamgen) +IF (TPL_ENABLE_Pamgen OR Trilinos_ENABLE_Pamgen ) SET(PAMGENLIB Iopg) ENDIF() diff --git a/packages/seacas/libraries/ioss/src/main/shell_to_hex.C b/packages/seacas/libraries/ioss/src/main/shell_to_hex.C index c98cf1499d..be060cae2c 100644 --- a/packages/seacas/libraries/ioss/src/main/shell_to_hex.C +++ b/packages/seacas/libraries/ioss/src/main/shell_to_hex.C @@ -36,9 +36,6 @@ namespace { - // Data space shared by most field input/output routines... - std::vector data; - struct Globals { bool debug{}; From b483c6014b918e39cd03e8cb88f3d6cd56aca43c Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Fri, 29 Mar 2024 07:52:00 -0600 Subject: [PATCH 20/59] APREPRO: Make strings test more robust --- packages/seacas/libraries/aprepro_lib/CMakeLists.txt | 5 ++--- packages/seacas/libraries/aprepro_lib/strings.cc | 10 +++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/seacas/libraries/aprepro_lib/CMakeLists.txt b/packages/seacas/libraries/aprepro_lib/CMakeLists.txt index 5d7a208104..1d4afe8a0b 100644 --- a/packages/seacas/libraries/aprepro_lib/CMakeLists.txt +++ b/packages/seacas/libraries/aprepro_lib/CMakeLists.txt @@ -172,10 +172,9 @@ TRIBITS_ADD_ADVANCED_TEST( OUTPUT_FILE test-strings.output NOEXEPREFIX NOEXESUFFIX PASS_ANY - TEST_1 CMND grep ARGS -v ^Aprepro test-strings.output OUTPUT_FILE grepped-strings.out - TEST_2 CMND diff ARGS -w + TEST_1 CMND diff ARGS -w ${CMAKE_CURRENT_SOURCE_DIR}/test_standard.out - ${CMAKE_CURRENT_BINARY_DIR}/grepped-strings.out + ${CMAKE_CURRENT_BINARY_DIR}/test-strings.output COMM mpi serial OVERALL_NUM_MPI_PROCS 1 FINAL_PASS_REGULAR_EXPRESSION diff --git a/packages/seacas/libraries/aprepro_lib/strings.cc b/packages/seacas/libraries/aprepro_lib/strings.cc index 5beb8f1b81..d79ad9a6c2 100644 --- a/packages/seacas/libraries/aprepro_lib/strings.cc +++ b/packages/seacas/libraries/aprepro_lib/strings.cc @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2020, 2023 National Technology & Engineering Solutions +// Copyright(C) 1999-2020, 2023, 2024 National Technology & Engineering Solutions // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with // NTESS, the U.S. Government retains certain rights in this software. // @@ -15,6 +15,8 @@ int main(int, char **) { SEAMS::Aprepro aprepro; + aprepro.ap_options.warning_msg=false; + std::vector strings = build_strings(); bool result = aprepro.parse_strings(strings, "My list of strings"); if (result) { @@ -105,10 +107,8 @@ std::vector build_strings() strings.emplace_back(R"(This line should not be echoed (8))"); strings.emplace_back(R"( {Endif})"); strings.emplace_back(R"($ Lines a, b, c, d, 1, 4, 6, 7 should be echoed)"); - strings.emplace_back(R"($ Check line counting -- should be on line 78: {Parse Error})"); - strings.emplace_back(R"({ifdef(ifyes)} {This should be an error})"); - strings.emplace_back(R"({endif})"); - strings.emplace_back(R"()"); + strings.emplace_back(R"($ Check line counting -- should be on line 78: )"); + strings.emplace_back(R"( )"); strings.emplace_back(R"($ ========================================================================)"); strings.emplace_back(R"($ Test string if lines)"); strings.emplace_back(R"({if("Greg")})"); From 47f6a20a63401f40cf18800fbf7d4ae7b35de233 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Wed, 3 Apr 2024 07:50:33 -0600 Subject: [PATCH 21/59] CI: For sierra [ci skip] --- packages/seacas/Jamfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/seacas/Jamfile b/packages/seacas/Jamfile index 01377a737f..93a6f2ccbe 100644 --- a/packages/seacas/Jamfile +++ b/packages/seacas/Jamfile @@ -1866,7 +1866,7 @@ exe Utst_database_io [ glob $(seacas-root)/libraries/ioss/src/utest/Utst_IofxDatabaseIO.C ] ioinit /tpl/netcdf-c//netcdf - /tpl/gtest//gtest + /tpl/googletest//gtest : @utility-exec-tag ; @@ -1876,7 +1876,7 @@ exe Utst_textmesh ioinit iotm /tpl/netcdf-c//netcdf - /tpl/gtest//gtest + /tpl/googletest//gtest /mpi//mpi : @sierra-exec-tag ; From 9c99f6bf55b67866c4888c213a6e5871c3e80a68 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Wed, 3 Apr 2024 07:50:56 -0600 Subject: [PATCH 22/59] IOSS: NVidia seems to need this --- packages/seacas/libraries/ioss/src/hopscotch_hash.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/seacas/libraries/ioss/src/hopscotch_hash.h b/packages/seacas/libraries/ioss/src/hopscotch_hash.h index d1318fca77..4fd92f1ab7 100644 --- a/packages/seacas/libraries/ioss/src/hopscotch_hash.h +++ b/packages/seacas/libraries/ioss/src/hopscotch_hash.h @@ -1789,12 +1789,6 @@ namespace tsl { private: static const std::size_t MAX_PROBES_FOR_EMPTY_BUCKET = 12 * NeighborhoodSize; static constexpr float MIN_LOAD_FACTOR_FOR_REHASH = 0.1f; - template struct is_type_same - { - static_assert(std::is_unsigned::value, "T must be an unsigned type"); - static_assert(std::is_unsigned::value, "U must be an unsigned type"); - static const bool value = sizeof(T) == sizeof(U); - }; /** * We can only use the hash on rehash if the size of the hash type is the same @@ -1804,7 +1798,7 @@ namespace tsl { */ template < class T = size_type, - typename std::enable_if::value>::type * = nullptr> + typename std::enable_if::value>::type * = nullptr> static bool USE_STORED_HASH_ON_REHASH(size_type /*bucket_count*/) { return StoreHash; @@ -1812,7 +1806,7 @@ namespace tsl { template < class T = size_type, - typename std::enable_if::value>::type * = nullptr> + typename std::enable_if::value>::type * = nullptr> static bool USE_STORED_HASH_ON_REHASH(size_type bucket_count) { (void)bucket_count; From a9c28eea6b0411afc4f4af4a4da2161bcc3b5bcf Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Wed, 3 Apr 2024 14:42:21 -0600 Subject: [PATCH 23/59] CI: Use pNetCDF 1.13.0 --- install-tpl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install-tpl.sh b/install-tpl.sh index 9e679e86db..311f25c33e 100755 --- a/install-tpl.sh +++ b/install-tpl.sh @@ -497,7 +497,7 @@ then if [ "$FORCE" == "YES" ] || ! [ -e $INSTALL_PATH/lib/libpnetcdf.a ] then echo "${txtgrn}+++ PnetCDF${txtrst}" - pnet_version="1.12.3" + pnet_version="1.13.0" pnet_base="pnetcdf" cd $ACCESS || exit cd TPL/pnetcdf || exit From 16dfcd6dd7cc2294047f0097d3ef763707b983c6 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Wed, 3 Apr 2024 16:23:24 -0600 Subject: [PATCH 24/59] SLICE: Refactor; reduce duplicate code --- install-tpl.sh | 2 +- .../seacas/applications/slice/SL_Decompose.C | 53 +++++++++---------- .../seacas/applications/slice/SL_Version.h | 6 +-- 3 files changed, 29 insertions(+), 32 deletions(-) diff --git a/install-tpl.sh b/install-tpl.sh index 311f25c33e..937add25e5 100755 --- a/install-tpl.sh +++ b/install-tpl.sh @@ -774,7 +774,7 @@ then echo "${txtgrn}+++ FMT${txtrst}" cd $ACCESS || exit cd TPL/fmt || exit - fmt_version="10.2.0" + fmt_version="10.2.1" if [ "$DOWNLOAD" == "YES" ] then diff --git a/packages/seacas/applications/slice/SL_Decompose.C b/packages/seacas/applications/slice/SL_Decompose.C index 70386f208a..f7c872a5bd 100644 --- a/packages/seacas/applications/slice/SL_Decompose.C +++ b/packages/seacas/applications/slice/SL_Decompose.C @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2023 National Technology & Engineering Solutions +// Copyright(C) 1999-2024 National Technology & Engineering Solutions // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with // NTESS, the U.S. Government retains certain rights in this software. // @@ -807,6 +807,20 @@ std::vector decompose_elements(const Ioss::Region ®ion, SystemInterface return elem_to_proc; } +template +std::map> string_chains(const Ioss::chain_t &element_chains) +{ + std::map> chains; + + for (size_t i = 0; i < element_chains.size(); i++) { + auto &chain_entry = element_chains[i]; + if (chain_entry.link >= 0) { + chains[chain_entry.element].push_back(i + 1); + } + } + return chains; +} + template std::vector line_decomp_weights(const Ioss::chain_t &element_chains, size_t element_count); template std::vector line_decomp_weights(const Ioss::chain_t &element_chains, @@ -815,28 +829,23 @@ template std::vector line_decomp_weights(const Ioss::chain_t &elem template std::vector line_decomp_weights(const Ioss::chain_t &element_chains, size_t element_count) { - std::map> chains; + auto chains = string_chains(element_chains); - for (size_t i = 0; i < element_chains.size(); i++) { - auto &chain_entry = element_chains[i]; - if (chain_entry.link >= 0) { - chains[chain_entry.element].push_back(i + 1); + if ((debug_level & 16) != 0) { + for (const auto &[chain_root, chain_elements] : chains) { + fmt::print("Chain Root: {} contains: {}\n", chain_root, fmt::join(chain_elements, ", ")); } } std::vector weights(element_count, 1); // Now, for each chain... - for (auto &chain : chains) { - if ((debug_level & 16) != 0) { - fmt::print("Chain Root: {} contains: {}\n", chain.first, fmt::join(chain.second, ", ")); - } + for (const auto &[chain_root, chain_elements] : chains) { // * Set the weights of all elements in the chain... // * non-root = 0, root = length of chain. - const auto &chain_elements = chain.second; for (const auto &element : chain_elements) { weights[element - 1] = 0; } - weights[chain.first - 1] = static_cast(chain_elements.size()); + weights[chain_root - 1] = static_cast(chain_elements.size()); } return weights; } @@ -851,30 +860,18 @@ void line_decomp_modify(const Ioss::chain_t &element_chains, std::vector> chains; - - for (size_t i = 0; i < element_chains.size(); i++) { - auto &chain_entry = element_chains[i]; - if (chain_entry.link >= 0) { - chains[chain_entry.element].push_back(i + 1); - if ((debug_level & 16) != 0) { - fmt::print("[{}]: element {}, link {}, processor {}\n", i + 1, chain_entry.element, - chain_entry.link, elem_to_proc[i]); - } - } - } + auto chains = string_chains(element_chains); // Delta: elements added/removed from each processor... std::vector delta(proc_count); // Now, for each chain... - for (auto &chain : chains) { + for (const auto &[chain_root, chain_elements] : chains) { if ((debug_level & 16) != 0) { - fmt::print("Chain Root: {} contains: {}\n", chain.first, fmt::join(chain.second, ", ")); + fmt::print("Chain Root: {} contains: {}\n", chain_root, fmt::join(chain_elements, ", ")); } std::vector chain_proc_count(proc_count); - const auto &chain_elements = chain.second; // * get processors used by elements in the chain... for (const auto &element : chain_elements) { @@ -889,7 +886,7 @@ void line_decomp_modify(const Ioss::chain_t &element_chains, std::vector qainfo{ "slice", - "2024/03/27", - "2.2.00", + "2024/04/03", + "2.2.01", }; From 8924b9016d9e8732b79562a6049221efde9ac8cb Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Wed, 3 Apr 2024 16:53:20 -0600 Subject: [PATCH 25/59] IOSS: Add time scale and offset to io_shell --- packages/seacas/libraries/ioss/src/Ioss_CopyDatabase.C | 4 +++- packages/seacas/libraries/ioss/src/Ioss_MeshCopyOptions.h | 2 ++ packages/seacas/libraries/ioss/src/main/io_shell.C | 4 +++- packages/seacas/libraries/ioss/src/main/shell_interface.C | 8 ++++++++ packages/seacas/libraries/ioss/src/main/shell_interface.h | 2 ++ 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/packages/seacas/libraries/ioss/src/Ioss_CopyDatabase.C b/packages/seacas/libraries/ioss/src/Ioss_CopyDatabase.C index cd4640cf4d..31016664ed 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_CopyDatabase.C +++ b/packages/seacas/libraries/ioss/src/Ioss_CopyDatabase.C @@ -736,7 +736,9 @@ namespace { int istep, const Ioss::MeshCopyOptions &options, int rank) { double time = region.get_state_time(istep); - int ostep = output_region.add_state(time); + double otime = time * options.time_scale + options.time_offset; + int ostep = output_region.add_state(otime); + show_step(istep, time, options, rank); output_region.begin_state(ostep); diff --git a/packages/seacas/libraries/ioss/src/Ioss_MeshCopyOptions.h b/packages/seacas/libraries/ioss/src/Ioss_MeshCopyOptions.h index 2c4e553197..585730006f 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_MeshCopyOptions.h +++ b/packages/seacas/libraries/ioss/src/Ioss_MeshCopyOptions.h @@ -17,6 +17,8 @@ namespace Ioss { double minimum_time{0.0}; double maximum_time{0.0}; double delay{0.0}; + double time_scale{1.0}; + double time_offset{0.0}; double rel_tolerance{}; double abs_tolerance{}; diff --git a/packages/seacas/libraries/ioss/src/main/io_shell.C b/packages/seacas/libraries/ioss/src/main/io_shell.C index ae7bf8a3c3..48fc2cbfa6 100644 --- a/packages/seacas/libraries/ioss/src/main/io_shell.C +++ b/packages/seacas/libraries/ioss/src/main/io_shell.C @@ -42,7 +42,7 @@ namespace { std::string codename; - std::string version = "6.5 (2024/03/14)"; + std::string version = "6.5 (2024/04/03)"; bool mem_stats = false; @@ -65,6 +65,8 @@ namespace { options.delete_timesteps = interFace.delete_timesteps; options.minimum_time = interFace.minimum_time; options.maximum_time = interFace.maximum_time; + options.time_scale = interFace.time_scale; + options.time_offset = interFace.time_offset; options.data_storage_type = interFace.data_storage_type; options.delay = interFace.timestep_delay; options.reverse = interFace.reverse; diff --git a/packages/seacas/libraries/ioss/src/main/shell_interface.C b/packages/seacas/libraries/ioss/src/main/shell_interface.C index d8c8abc50c..93f68d817e 100644 --- a/packages/seacas/libraries/ioss/src/main/shell_interface.C +++ b/packages/seacas/libraries/ioss/src/main/shell_interface.C @@ -244,6 +244,12 @@ void IOShell::Interface::enroll_options() options_.enroll("Minimum_Time", Ioss::GetLongOption::MandatoryValue, "Minimum time on input database to transfer to output database", nullptr); + options_.enroll("time_scale", Ioss::GetLongOption::MandatoryValue, + "The output time = input_time * time_scale + time_offset", nullptr); + + options_.enroll("time_offset", Ioss::GetLongOption::MandatoryValue, + "The output time = input_time * time_scale + time_offset", nullptr); + options_.enroll("select_times", Ioss::GetLongOption::MandatoryValue, "comma-separated list of times that should be transferred to output database", nullptr); @@ -657,6 +663,8 @@ bool IOShell::Interface::parse_options(int argc, char **argv, int my_processor) maximum_time = options_.get_option_value("Maximum_Time", maximum_time); minimum_time = options_.get_option_value("Minimum_Time", minimum_time); + time_scale = options_.get_option_value("time_scale", time_scale); + time_offset = options_.get_option_value("time_offset", time_offset); { const char *temp = options_.retrieve("select_times"); diff --git a/packages/seacas/libraries/ioss/src/main/shell_interface.h b/packages/seacas/libraries/ioss/src/main/shell_interface.h index 922b2c4de1..4d422fdd11 100644 --- a/packages/seacas/libraries/ioss/src/main/shell_interface.h +++ b/packages/seacas/libraries/ioss/src/main/shell_interface.h @@ -43,6 +43,8 @@ namespace IOShell { double maximum_time{std::numeric_limits::max()}; double minimum_time{-std::numeric_limits::max()}; double append_time{std::numeric_limits::max()}; + double time_scale{1.0}; + double time_offset{0.0}; double timestep_delay{0.0}; double rel_tolerance{0.0}; double abs_tolerance{0.0}; From 952ccbcd96b66c3d3a0ca3cb91eb1878492b519c Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Wed, 3 Apr 2024 17:00:53 -0600 Subject: [PATCH 26/59] APREPRO: Variables defined via Units are internal --- packages/seacas/libraries/aprepro_lib/apr_aprepro.cc | 6 +++--- packages/seacas/libraries/aprepro_lib/apr_units.cc | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/seacas/libraries/aprepro_lib/apr_aprepro.cc b/packages/seacas/libraries/aprepro_lib/apr_aprepro.cc index a20117a8e5..7d63e4048d 100644 --- a/packages/seacas/libraries/aprepro_lib/apr_aprepro.cc +++ b/packages/seacas/libraries/aprepro_lib/apr_aprepro.cc @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2023 National Technology & Engineering Solutions +// Copyright(C) 1999-2024 National Technology & Engineering Solutions // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with // NTESS, the U.S. Government retains certain rights in this software. // @@ -34,8 +34,8 @@ #endif namespace { - const std::string version_short{"6.25"}; - const std::string version_date{"(2023/10/12)"}; + const std::string version_short{"6.26"}; + const std::string version_date{"(2024/04/03)"}; const std::string version_string = version_short + " " + version_date; void output_copyright(); diff --git a/packages/seacas/libraries/aprepro_lib/apr_units.cc b/packages/seacas/libraries/aprepro_lib/apr_units.cc index bd324d7b0f..c98074d3da 100644 --- a/packages/seacas/libraries/aprepro_lib/apr_units.cc +++ b/packages/seacas/libraries/aprepro_lib/apr_units.cc @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2020, 2023 National Technology & Engineering Solutions +// Copyright(C) 1999-2020, 2023, 2024 National Technology & Engineering Solutions // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with // NTESS, the U.S. Government retains certain rights in this software. // @@ -28,7 +28,7 @@ namespace { void define_var(const char *name, double val, const char *label) { - aprepro->add_variable(name, val, true); + aprepro->add_variable(name, val, true, true); if (echo) { *(aprepro->infoStream) << comment() << " 1 " << std::left << std::setw(10) << name << "\t= " << std::setw(14) << std::setprecision(7) << val << " " @@ -316,11 +316,11 @@ unit_systems systems[] = if (systems[i].name != nullptr) { // Found a match for (int j = 0; systems[i].label[j].vname != nullptr; j++) { - aprepro->add_variable(systems[i].label[j].vname, systems[i].label[j].value, true); + aprepro->add_variable(systems[i].label[j].vname, systems[i].label[j].value, true, true); } for (int j = 0; systems[i].base[j].vname != nullptr; j++) { - aprepro->add_variable(systems[i].base[j].vname, systems[i].base[j].value, true); + aprepro->add_variable(systems[i].base[j].vname, systems[i].base[j].value, true, true); } symrec *var = aprepro->getsym("_UNITS_SYSTEM"); From 5c6165cbec80bfbb43f5db86f21f15d4b513f342 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Thu, 4 Apr 2024 15:55:21 -0600 Subject: [PATCH 27/59] Update with sample CMakeLists.txt for using IOSS library [ci skip] --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 07c8493e2b..4133edae3f 100644 --- a/README.md +++ b/README.md @@ -241,6 +241,7 @@ executable and a Fortran Executable which both are linked to the Exodus library. To configure and build, you would do something like: + ```sh mkdir build; cd build CMAKE_PREFIX_PATH={path_to_root_of_seacas_install} cmake .. @@ -248,6 +249,18 @@ To configure and build, you would do something like: ``` And you would then get `ExodusWriteC` and `ExodusReadFor` compiled and linked against the Exodus library. +A similar CMakeLists.txt file for using the IOSS library would be something like: + +```sh +cmake_minimum_required(VERSION 3.1...3.26) +project(IOSSCMakeExample VERSION 1.0 LANGUAGES CXX) + +#### C++ IOSS CMake Example #### +find_package(SEACASIoss CONFIG) +add_executable(ioss_exe ioss_exe.C) +target_link_libraries(ioss_exe PRIVATE SEACASIoss::all_libs) +``` + ## Required Software The SEACAS system requires that there be some libraries and From 23cc3eb199525b171fd1d65f5c18f9ee57e302b4 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Thu, 4 Apr 2024 15:56:35 -0600 Subject: [PATCH 28/59] IOSS: Add comment to satisfy Trilinos checker [ci skip] --- .../libraries/ioss/src/Ioss_ParallelUtils.h | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/packages/seacas/libraries/ioss/src/Ioss_ParallelUtils.h b/packages/seacas/libraries/ioss/src/Ioss_ParallelUtils.h index cfc46b89dc..58f5926a95 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_ParallelUtils.h +++ b/packages/seacas/libraries/ioss/src/Ioss_ParallelUtils.h @@ -36,7 +36,10 @@ namespace Ioss { enum MinMax { DO_MAX, DO_MIN, DO_SUM }; #if defined(SEACAS_HAVE_MPI) - IOSS_NODISCARD static Ioss_MPI_Comm comm_world() { return (Ioss_MPI_Comm)MPI_COMM_WORLD; } + IOSS_NODISCARD static Ioss_MPI_Comm comm_world() + { + return (Ioss_MPI_Comm)MPI_COMM_WORLD; // CHECK: ALLOW MPI_COMM_WORLD + } IOSS_NODISCARD static Ioss_MPI_Comm comm_self() { return (Ioss_MPI_Comm)MPI_COMM_SELF; } IOSS_NODISCARD static Ioss_MPI_Comm comm_null() { return (Ioss_MPI_Comm)MPI_COMM_NULL; } #else @@ -79,10 +82,11 @@ namespace Ioss { * getenv system call is only done on processor 0. * If '!sync_parallel', then don't push to other processors. */ - IOSS_NODISCARD bool get_environment(const std::string &name, IOSS_MAYBE_UNUSED bool sync_parallel) const; + IOSS_NODISCARD bool get_environment(const std::string &name, + IOSS_MAYBE_UNUSED bool sync_parallel) const; IOSS_NODISCARD std::string decode_filename(const std::string &filename, bool is_parallel) const; - + IOSS_NODISCARD Ioss_MPI_Comm communicator() const { return communicator_; } IOSS_NODISCARD int parallel_size() const; IOSS_NODISCARD int parallel_rank() const; @@ -120,7 +124,8 @@ namespace Ioss { void global_count(const Int64Vector &local_counts, Int64Vector &global_counts) const; template - IOSS_NODISCARD T global_minmax(IOSS_MAYBE_UNUSED T local_minmax, IOSS_MAYBE_UNUSED MinMax which) const; + IOSS_NODISCARD T global_minmax(IOSS_MAYBE_UNUSED T local_minmax, + IOSS_MAYBE_UNUSED MinMax which) const; template void global_array_minmax(IOSS_MAYBE_UNUSED std::vector &local_minmax, @@ -152,8 +157,14 @@ namespace Ioss { IOSS_NODISCARD inline MPI_Datatype mpi_type(long int /*dummy*/) { return MPI_LONG_LONG_INT; } IOSS_NODISCARD inline MPI_Datatype mpi_type(long long int /*dummy*/) { return MPI_LONG_LONG_INT; } IOSS_NODISCARD inline MPI_Datatype mpi_type(unsigned int /*dummy*/) { return MPI_UNSIGNED; } - IOSS_NODISCARD inline MPI_Datatype mpi_type(unsigned long int /*dummy*/) { return MPI_UNSIGNED_LONG; } - IOSS_NODISCARD inline MPI_Datatype mpi_type(unsigned long long int /*dummy*/) { return MPI_UNSIGNED_LONG_LONG; } + IOSS_NODISCARD inline MPI_Datatype mpi_type(unsigned long int /*dummy*/) + { + return MPI_UNSIGNED_LONG; + } + IOSS_NODISCARD inline MPI_Datatype mpi_type(unsigned long long int /*dummy*/) + { + return MPI_UNSIGNED_LONG_LONG; + } IOSS_NODISCARD inline MPI_Datatype mpi_type(char /*dummy*/) { return MPI_CHAR; } template From 9e352f4bca5cde9c3844fa69082ec6f48d51f769 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Thu, 4 Apr 2024 16:10:53 -0600 Subject: [PATCH 29/59] APREPRO: Remove option to build without fmt library --- packages/seacas/Jamfile | 4 +-- .../libraries/aprepro_lib/CMakeLists.txt | 4 --- .../libraries/aprepro_lib/apr_aprepro.cc | 29 ++----------------- .../libraries/aprepro_lib/apr_builtin.cc | 6 ---- .../libraries/aprepro_lib/apr_parser.cc | 13 ++------- .../seacas/libraries/aprepro_lib/aprepro.yy | 8 +---- 6 files changed, 8 insertions(+), 56 deletions(-) diff --git a/packages/seacas/Jamfile b/packages/seacas/Jamfile index 93a6f2ccbe..b9010fe49d 100644 --- a/packages/seacas/Jamfile +++ b/packages/seacas/Jamfile @@ -1,5 +1,5 @@ #--------------------------------------------------------------- -# Copyright(C) 1999-2020 National Technology & Engineering Solutions +# Copyright(C) 1999-2020, 2024 National Technology & Engineering Solutions # of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with # NTESS, the U.S. Government retains certain rights in this software. # @@ -1385,7 +1385,6 @@ lib aprepro_lib /tpl/netcdf-c//netcdf /tpl/fmt//fmt : EXODUS_SUPPORT - FMT_SUPPORT [ ifdevbuild # Any parameters within this 'ifdevbuild' block apply to development # builds only and will not be present for user builds. @@ -1398,7 +1397,6 @@ lib aprepro_lib ] : : EXODUS_SUPPORT - FMT_SUPPORT [ ifdevbuild # Any parameters within this 'ifdevbuild' block apply to development # builds only and will not be present for user builds. diff --git a/packages/seacas/libraries/aprepro_lib/CMakeLists.txt b/packages/seacas/libraries/aprepro_lib/CMakeLists.txt index 1d4afe8a0b..51fb1fc194 100644 --- a/packages/seacas/libraries/aprepro_lib/CMakeLists.txt +++ b/packages/seacas/libraries/aprepro_lib/CMakeLists.txt @@ -15,10 +15,6 @@ IF (${CMAKE_PROJECT_NAME}_ENABLE_SEACASExodus) ADD_DEFINITIONS(-DEXODUS_SUPPORT) ENDIF() -IF (${TPL_ENABLE_fmt}) - ADD_DEFINITIONS(-DFMT_SUPPORT) -ENDIF() - TRIBITS_INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} ) diff --git a/packages/seacas/libraries/aprepro_lib/apr_aprepro.cc b/packages/seacas/libraries/aprepro_lib/apr_aprepro.cc index 7d63e4048d..b0018e46e6 100644 --- a/packages/seacas/libraries/aprepro_lib/apr_aprepro.cc +++ b/packages/seacas/libraries/aprepro_lib/apr_aprepro.cc @@ -9,12 +9,10 @@ #include "aprepro.h" // for Aprepro, symrec, file_rec, etc #include "aprepro_parser.h" // for Parser, Parser::token, etc #include "terminal_color.h" -#if defined(FMT_SUPPORT) -#include -#endif #include -#include // for exit, EXIT_SUCCESS, etc -#include // for strcmp +#include // for exit, EXIT_SUCCESS, etc +#include // for strcmp +#include #include // for operator<<, basic_ostream, etc #include // for operator<<, setw, etc #include // for left, cerr, cout, streampos @@ -635,12 +633,7 @@ namespace SEAMS { << " --info=file: Output INFO messages (e.g. DUMP() output) to file.\n" << " --nowarning or -W: Do not print WARN messages \n" << " --comment=char or -c=char: Change comment character to 'char' \n" -#if defined(FMT_SUPPORT) << " --full_precision -p: Floating point output uses as many digits as needed.\n" -#else - << " --full_precision -p: (Not supported in this build) Floating point output uses as " - "many digits as needed.\n" -#endif << " --copyright or -C: Print copyright message \n" << " --keep_history or -k: Keep a history of aprepro substitutions.\n" << " (not for general interactive use) \n" @@ -813,13 +806,8 @@ namespace SEAMS { for (const auto &ptr : get_sorted_sym_table()) { if (!ptr->isInternal) { if (ptr->type == Parser::token::VAR || ptr->type == Parser::token::IMMVAR) { -#if defined(FMT_SUPPORT) fmt::print((*infoStream), "{}{}\": {}", (first ? "\"" : ",\n\""), ptr->name, ptr->value.var); -#else - (*infoStream) << (first ? "\"" : ",\n\"") << ptr->name << "\": " << std::setprecision(10) - << ptr->value.var; -#endif first = false; } else if (ptr->type == Parser::token::UNDVAR) { @@ -853,23 +841,12 @@ namespace SEAMS { if (spre.empty() || ptr->name.find(spre) != std::string::npos) { if (doInternal == ptr->isInternal) { if (ptr->type == Parser::token::VAR) { -#if defined(FMT_SUPPORT) fmt::print((*infoStream), "{} {{{:<{}}\t= {}}}\n", comment, ptr->name, width, ptr->value.var); -#else - (*infoStream) << comment << " {" << std::left << std::setw(width) << ptr->name - << "\t= " << std::setprecision(10) << ptr->value.var << "}" << '\n'; -#endif } else if (ptr->type == Parser::token::IMMVAR) { -#if defined(FMT_SUPPORT) fmt::print((*infoStream), "{} {{{:<{}}\t= {}}} (immutable)\n", comment, ptr->name, width, ptr->value.var); -#else - (*infoStream) << comment << " {" << std::left << std::setw(width) << ptr->name - << "\t= " << std::setprecision(10) << ptr->value.var << "} (immutable)" - << '\n'; -#endif } else if (ptr->type == Parser::token::SVAR) { if (strchr(ptr->value.svar.c_str(), '\n') != nullptr || diff --git a/packages/seacas/libraries/aprepro_lib/apr_builtin.cc b/packages/seacas/libraries/aprepro_lib/apr_builtin.cc index 60dc8ccec6..6072dde254 100644 --- a/packages/seacas/libraries/aprepro_lib/apr_builtin.cc +++ b/packages/seacas/libraries/aprepro_lib/apr_builtin.cc @@ -24,10 +24,8 @@ #include #include -#if defined FMT_SUPPORT #include #include -#endif #if defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || \ defined(__MINGW32__) || defined(_WIN64) || defined(__MINGW64__) @@ -954,7 +952,6 @@ namespace SEAMS { } lines << "\t"; for (int ic = 0; ic < cols; ic++) { -#if defined FMT_SUPPORT const SEAMS::symrec *format = aprepro->getsym("_FORMAT"); if (format->value.svar.empty()) { fmt::print(lines, "{}", my_array_data->data[idx++]); @@ -963,9 +960,6 @@ namespace SEAMS { auto tmpstr = fmt::sprintf(format->value.svar, my_array_data->data[idx++]); lines << tmpstr; } -#else - lines << my_array_data->data[idx++]; -#endif if (ic < cols - 1) { lines << "\t"; } diff --git a/packages/seacas/libraries/aprepro_lib/apr_parser.cc b/packages/seacas/libraries/aprepro_lib/apr_parser.cc index 2e9defa48e..c8d5c5dc57 100644 --- a/packages/seacas/libraries/aprepro_lib/apr_parser.cc +++ b/packages/seacas/libraries/aprepro_lib/apr_parser.cc @@ -2,7 +2,7 @@ // Skeleton implementation for Bison LALR(1) parsers in C++ -// Copyright (C) 2002-2015, 2018-2021, 2023 Free Software Foundation, Inc. +// Copyright (C) 2002-2015, 2018-2021, 2023, 2024 Free Software Foundation, Inc. // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -44,16 +44,14 @@ #include "apr_util.h" #include "aprepro.h" -#if defined FMT_SUPPORT -#include -#include -#endif #include #include #include #include #include #include +#include +#include #include namespace { @@ -534,13 +532,8 @@ namespace SEAMS { if (echo) { SEAMS::symrec *format = aprepro.getsym("_FORMAT"); if (format->value.svar.empty()) { -#if defined FMT_SUPPORT auto tmpstr = fmt::format("{}", (yystack_[1].value.val)); aprepro.lexer->LexerOutput(tmpstr.c_str(), tmpstr.size()); -#else - yyerror(aprepro, "Empty _FORMAT string -- no output will be printed. Optional " - "Lib::FMT dependency is not enabled."); -#endif } else { auto tmpstr = fmt::sprintf(format->value.svar, (yystack_[1].value.val)); diff --git a/packages/seacas/libraries/aprepro_lib/aprepro.yy b/packages/seacas/libraries/aprepro_lib/aprepro.yy index 8bbbbef2eb..7e48f20e59 100644 --- a/packages/seacas/libraries/aprepro_lib/aprepro.yy +++ b/packages/seacas/libraries/aprepro_lib/aprepro.yy @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2023 National Technology & Engineering Solutions +// Copyright(C) 1999-2024 National Technology & Engineering Solutions // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with // NTESS, the U.S. Government retains certain rights in this software. // @@ -8,9 +8,7 @@ #include "apr_util.h" #include "apr_array.h" -#if defined FMT_SUPPORT #include -#endif #include #include #include @@ -133,12 +131,8 @@ line: '\n' { if (echo) aprepro.lexer->LexerOutput("\n", 1); | LBRACE exp RBRACE { if (echo) { SEAMS::symrec *format = aprepro.getsym("_FORMAT"); if (format->value.svar.empty()) { -#if defined FMT_SUPPORT auto tmpstr = fmt::format("{}", $2); aprepro.lexer->LexerOutput(tmpstr.c_str(), tmpstr.size()); -#else - yyerror(aprepro, "Empty _FORMAT string -- no output will be printed. Optional Lib::FMT dependency is not enabled."); -#endif } else { static char tmpstr[512]; From 5559f92a691da9bdec99f8073071c06c2d5b4d79 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Fri, 5 Apr 2024 09:25:09 -0600 Subject: [PATCH 30/59] Redo the CMake examples; add Ioss example --- README.md | 39 +++++++++-------- cmake-use-example/{ => exodus}/CMakeLists.txt | 2 +- cmake-use-example/{ => exodus}/ExodusRead.f | 0 cmake-use-example/{ => exodus}/ExodusWrite.c | 0 cmake-use-example/ioss/CMakeLists.txt | 7 +++ cmake-use-example/ioss/IossExample.C | 43 +++++++++++++++++++ 6 files changed, 71 insertions(+), 20 deletions(-) rename cmake-use-example/{ => exodus}/CMakeLists.txt (94%) rename cmake-use-example/{ => exodus}/ExodusRead.f (100%) rename cmake-use-example/{ => exodus}/ExodusWrite.c (100%) create mode 100644 cmake-use-example/ioss/CMakeLists.txt create mode 100644 cmake-use-example/ioss/IossExample.C diff --git a/README.md b/README.md index 4133edae3f..25954ab95f 100644 --- a/README.md +++ b/README.md @@ -230,15 +230,25 @@ add_executable(ExodusReadFor ExodusRead.f) target_link_libraries(ExodusReadFor PRIVATE SEACASExodus_for::all_libs) ``` -The `cmake-use-example` directory contains this sample -`CMakeLists.txt` file and a couple C and Fortran files which provide -an example of how to build and link a C or Fortran program with the -Exodus library installed as part of a build of this package. +A similar CMakeLists.txt file for using the IOSS library would be something like: + +```sh +cmake_minimum_required(VERSION 3.1...3.26) +project(IossCMakeExample VERSION 1.0 LANGUAGES CXX) + +#### C++ IOSS #### +find_package(SEACASIoss CONFIG) +add_executable(IossExample IossExample.C) +target_link_libraries(IossExample PRIVATE SEACASIoss::all_libs) +``` + +The `cmake-use-example` directory contains Exodus example files in the +`exodus` subdirectory and Ioss example files in the `ioss` subdirectory. +These provide short examples of how to build and link a program with the +Exodus and/or Ioss libraries. To use this, copy the contents of the directory to your own filespace -and modify the contents as needed. The example provides a C -executable and a Fortran Executable which both are linked to the -Exodus library. +and modify the contents as needed. To configure and build, you would do something like: @@ -247,19 +257,10 @@ To configure and build, you would do something like: CMAKE_PREFIX_PATH={path_to_root_of_seacas_install} cmake .. make ``` -And you would then get `ExodusWriteC` and `ExodusReadFor` compiled and linked against the Exodus library. -A similar CMakeLists.txt file for using the IOSS library would be something like: - -```sh -cmake_minimum_required(VERSION 3.1...3.26) -project(IOSSCMakeExample VERSION 1.0 LANGUAGES CXX) - -#### C++ IOSS CMake Example #### -find_package(SEACASIoss CONFIG) -add_executable(ioss_exe ioss_exe.C) -target_link_libraries(ioss_exe PRIVATE SEACASIoss::all_libs) -``` +And you would then get an executable (`ExodusWriteC` and +`ExodusReadFor` for Exodus, `IossExample` for Ioss) compiled and linked +against the Exodus and/or Ioss libraries. ## Required Software diff --git a/cmake-use-example/CMakeLists.txt b/cmake-use-example/exodus/CMakeLists.txt similarity index 94% rename from cmake-use-example/CMakeLists.txt rename to cmake-use-example/exodus/CMakeLists.txt index f2856a4b6b..c5ed8d885a 100644 --- a/cmake-use-example/CMakeLists.txt +++ b/cmake-use-example/exodus/CMakeLists.txt @@ -16,7 +16,7 @@ add_executable(ExodusWriteC ExodusWrite.c) target_link_libraries(ExodusWriteC PRIVATE SEACASExodus::all_libs) -#### FORTRAN ##### +#### FORTRAN ##### (Remove all below if only using Exodus C API) IF ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fcray-pointer -fdefault-real-8 -fdefault-integer-8 -fno-range-check") ELSEIF ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "XL") diff --git a/cmake-use-example/ExodusRead.f b/cmake-use-example/exodus/ExodusRead.f similarity index 100% rename from cmake-use-example/ExodusRead.f rename to cmake-use-example/exodus/ExodusRead.f diff --git a/cmake-use-example/ExodusWrite.c b/cmake-use-example/exodus/ExodusWrite.c similarity index 100% rename from cmake-use-example/ExodusWrite.c rename to cmake-use-example/exodus/ExodusWrite.c diff --git a/cmake-use-example/ioss/CMakeLists.txt b/cmake-use-example/ioss/CMakeLists.txt new file mode 100644 index 0000000000..86c7f4581f --- /dev/null +++ b/cmake-use-example/ioss/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1...3.26) +project(IossCMakeExample VERSION 1.0 LANGUAGES CXX) + +#### C++ IOSS #### +find_package(SEACASIoss CONFIG) +add_executable(IossExample IossExample.C) +target_link_libraries(IossExample PRIVATE SEACASIoss::all_libs) diff --git a/cmake-use-example/ioss/IossExample.C b/cmake-use-example/ioss/IossExample.C new file mode 100644 index 0000000000..2a5bb057d4 --- /dev/null +++ b/cmake-use-example/ioss/IossExample.C @@ -0,0 +1,43 @@ +#include +#include +#include +#include +#include + +#include +#include +#include + +int main(int argc, char *argv[]) { +#ifdef SEACAS_HAVE_MPI + MPI_Init(&argc, &argv); + ON_BLOCK_EXIT(MPI_Finalize); +#endif + + if (argc == 1) { + std::cerr << "SYNTAX: " << argv[0] + << " '--show-config' or 'filename'\n" + " Will either show the Ioss build configuration\n" + " Or will show a summary of the data in `filename`\n"; + std::exit(EXIT_SUCCESS); + } + + Ioss::Init::Initializer io; + std::string filename = argv[1]; + if (filename == "--show-config") { + std::cerr << Ioss::IOFactory::show_configuration() << "\n"; + } else { + auto dbtype = Ioss::Utils::get_type_from_file(filename); + auto *dbi = Ioss::IOFactory::create(dbtype, filename, Ioss::READ_RESTART, + Ioss::ParallelUtils::comm_world()); + + if (dbi == NULL || !dbi->ok(true)) { + std::exit(EXIT_FAILURE); + } + + // NOTE: 'region' owns 'dbi' pointer at this time and will close + // and call dbi destructor. + Ioss::Region region(dbi, "example_region"); + region.output_summary(std::cerr); + } +} From b3a411ac70c3e99eca6b3639358f547472ac20a2 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Fri, 5 Apr 2024 09:25:36 -0600 Subject: [PATCH 31/59] CI: Fix detection of installed Catch2 --- install-tpl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install-tpl.sh b/install-tpl.sh index 937add25e5..497d2f054c 100755 --- a/install-tpl.sh +++ b/install-tpl.sh @@ -984,7 +984,7 @@ fi # =================== INSTALL catch2 =============== if [ "$CATCH2" == "YES" ] then - if [ "$FORCE" == "YES" ] || ! [ -e $INSTALL_PATH/lib/libcatch.a ] + if [ "$FORCE" == "YES" ] || ! [ -e $INSTALL_PATH/lib/libCatch2.a ] then echo "${txtgrn}+++ Catch2${txtrst}" cd $ACCESS || exit From 3a4c2c5c4741a3c8e7ef2fc3edc05360565b18f2 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Fri, 5 Apr 2024 09:26:41 -0600 Subject: [PATCH 32/59] CI: Apply our cgns version kluge patch --- ...-Allow-more-liberal-version-matching.patch | 64 +++++++++++++++++++ install-tpl.sh | 1 + 2 files changed, 65 insertions(+) create mode 100644 TPL/cgns/CGNS-Allow-more-liberal-version-matching.patch diff --git a/TPL/cgns/CGNS-Allow-more-liberal-version-matching.patch b/TPL/cgns/CGNS-Allow-more-liberal-version-matching.patch new file mode 100644 index 0000000000..ba7090b343 --- /dev/null +++ b/TPL/cgns/CGNS-Allow-more-liberal-version-matching.patch @@ -0,0 +1,64 @@ +From 3c1871b84b24f14c3b5c6b99ead40c5aa2a0907e Mon Sep 17 00:00:00 2001 +From: Greg Sjaardema +Date: Fri, 5 Apr 2024 09:09:46 -0600 +Subject: [PATCH] CGNS: Allow more liberal version matching + +The main difference between CGNS-3.X and CGNS-4.X is the handling +of polyhedral elements. If the cgns file does not contain those +elements, then the library should be able to read the file correctly. + +We have modified the library version from the original 4.4.X to +be 3.99 so that files written by this version of the CGNS library +(assuming they don't use polyhedral elements) will be readable by +applications that are still using CGNS-3.X + +This is a kluge and not officially supported by the CGNS developers. +--- + src/cgnslib.c | 11 ++++++----- + src/cgnslib.h | 5 +++++ + 2 files changed, 11 insertions(+), 5 deletions(-) + +diff --git a/src/cgnslib.c b/src/cgnslib.c +index d60daf6..78bd25a 100644 +--- a/src/cgnslib.c ++++ b/src/cgnslib.c +@@ -434,12 +434,13 @@ int cg_open(const char *filename, int mode, int *file_number) + /* This code allows reading version newer than the lib, + as long as the 1st digit of the versions are equal */ + if ((cg->version / 1000) > (CGNSLibVersion / 1000)) { +- cgi_error("A more recent version of the CGNS library created the file. Therefore, the CGNS library needs updating before reading the file '%s'.",filename); +- return CG_ERROR; +- } ++ cgi_warning("A more recent version of the CGNS library created the file. Assuming it is OK to read, but may have problems (%d vs %d).", ++ cg->version, CGNSLibVersion); ++ } + /* warn only if different in second digit */ +- if ((cg->version / 100) > (CGNSLibVersion / 100)) { +- cgi_warning("The file being read is more recent that the CGNS library used"); ++ else if ((cg->version / 100) > (CGNSLibVersion / 100)) { ++ cgi_warning("The file being read is more recent than the CGNS library used (%d vs %d).", ++ cg->version, CGNSLibVersion); + } + } + #if CG_SIZEOF_SIZE == 32 +diff --git a/src/cgnslib.h b/src/cgnslib.h +index 476c768..a4b66df 100644 +--- a/src/cgnslib.h ++++ b/src/cgnslib.h +@@ -43,8 +43,13 @@ + #ifndef CGNSLIB_H + #define CGNSLIB_H + ++#if 0 + #define CGNS_VERSION 4400 + #define CGNS_DOTVERS 4.40 ++#else ++#define CGNS_VERSION 3990 ++#define CGNS_DOTVERS 3.99 ++#endif + + #define CGNS_COMPATVERSION 2540 + #define CGNS_COMPATDOTVERS 2.54 +-- +2.39.3 (Apple Git-146) + diff --git a/install-tpl.sh b/install-tpl.sh index 497d2f054c..40f7a4d42d 100755 --- a/install-tpl.sh +++ b/install-tpl.sh @@ -613,6 +613,7 @@ then echo "${txtgrn}+++ Configuring, Building, and Installing...${txtrst}" cd CGNS || exit git checkout v4.4.0 + git am ../CGNS-Allow-more-liberal-version-matching.patch rm -rf build mkdir build cd build || exit From 93d445b481beb9f61ae31ceec2fd3eb8836ce623 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Fri, 5 Apr 2024 12:57:47 -0600 Subject: [PATCH 33/59] APREPRO: Use fmt instead of trmclr --- README.md | 1 - .../libraries/aprepro_lib/apr_aprepro.cc | 114 +++++------- .../libraries/aprepro_lib/terminal_color.h | 169 ------------------ 3 files changed, 46 insertions(+), 238 deletions(-) delete mode 100644 packages/seacas/libraries/aprepro_lib/terminal_color.h diff --git a/README.md b/README.md index 25954ab95f..a48336af12 100644 --- a/README.md +++ b/README.md @@ -337,7 +337,6 @@ a separate license: | [adler hash](https://en.wikipedia.org/wiki/Adler-32) | `packages/seacas/libraries/suplib_c/adler.c` | [zlib](https://opensource.org/licenses/zlib) | | [MurmurHash](https://github.com/aappleby/smhasher) | `packages/seacas/libraries/ioss/src/Ioss_FaceGenerator.C` | public domain | | [json include file](http://jsoncpp.sourceforge.net) | `packages/seacas/libraries/ioss/src/visualization/` | [MIT](https://opensource.org/licenses/MIT) | -| [terminal_color](https://github.com/matovitch/trmclr) | `packages/seacas/libraries/aprepro_lib` | [zlib](https://opensource.org/licenses/zlib) | | [Tessil Hash](https://github.com/Tessil/) | `packages/seacas/libraries/ioss/src/hash` | [MIT](https://opensource.org/licenses/MIT) | | [pdqsort](https://github.com/orlp/pdqsort) | `packages/seacas/libraries/ioss/src` | [Zlib License](https://github.com/orlp/pdqsort/blob/master/license.txt) | ## Contact information diff --git a/packages/seacas/libraries/aprepro_lib/apr_aprepro.cc b/packages/seacas/libraries/aprepro_lib/apr_aprepro.cc index b0018e46e6..13b178911e 100644 --- a/packages/seacas/libraries/aprepro_lib/apr_aprepro.cc +++ b/packages/seacas/libraries/aprepro_lib/apr_aprepro.cc @@ -8,10 +8,11 @@ #include "apr_util.h" #include "aprepro.h" // for Aprepro, symrec, file_rec, etc #include "aprepro_parser.h" // for Parser, Parser::token, etc -#include "terminal_color.h" #include #include // for exit, EXIT_SUCCESS, etc #include // for strcmp +#include +#include #include #include // for operator<<, basic_ostream, etc #include // for operator<<, setw, etc @@ -32,8 +33,8 @@ #endif namespace { - const std::string version_short{"6.26"}; - const std::string version_date{"(2024/04/03)"}; + const std::string version_short{"6.27"}; + const std::string version_date{"(2024/04/05)"}; const std::string version_string = version_short + " " + version_date; void output_copyright(); @@ -221,27 +222,19 @@ namespace SEAMS { void Aprepro::error(const std::string &msg, bool line_info, bool prefix) const { - bool colorize = (errorStream == &std::cerr) && isatty(fileno(stderr)); - std::stringstream ss; - if (prefix) { - if (colorize) { - (*errorStream) << trmclr::red; - } - (*errorStream) << "Aprepro-" << short_version() << ": ERROR: "; - } + bool colorize = (errorStream == &std::cerr) && isatty(fileno(stderr)); + std::string message = prefix ? fmt::format("Aprepro-{}: ERROR: {}", short_version(), msg) + : fmt::format("{}", msg); + std::string lines = line_info ? fmt::format(" ({}, line {})", ap_file_list.top().name, + ap_file_list.top().lineno) + : ""; - ss << msg; - if (prefix && colorize) { - ss << trmclr::normal; + if (colorize) { + fmt::print(*errorStream, "{}{}\n", fmt::styled(message, fmt::fg(fmt::color::red)), lines); } - - if (line_info) { - ss << " (" << ap_file_list.top().name << ", line " << ap_file_list.top().lineno << ")"; + else { + fmt::print(*errorStream, "{}{}\n", message, lines); } - ss << "\n"; - - // Send it to the user defined stream - (*errorStream) << ss.str(); parseErrorCount++; } @@ -251,28 +244,20 @@ namespace SEAMS { return; } - bool colorize = (warningStream == &std::cerr) && isatty(fileno(stderr)); - std::stringstream ss; - if (prefix) { - if (colorize) { - (*warningStream) << trmclr::yellow; - } - (*warningStream) << "Aprepro: WARNING: "; - } - - ss << msg; + bool colorize = (warningStream == &std::cerr) && isatty(fileno(stderr)); + std::string message = + prefix ? fmt::format("Aprepro: WARNING: {}", msg) : fmt::format("{}", msg); + std::string lines = line_info ? fmt::format(" ({}, line {})", ap_file_list.top().name, + ap_file_list.top().lineno) + : ""; - if (prefix && colorize) { - ss << trmclr::normal; + if (colorize) { + fmt::print(*warningStream, "{}{}\n", fmt::styled(message, fmt::fg(fmt::color::yellow)), + lines); } - - if (line_info) { - ss << " (" << ap_file_list.top().name << ", line " << ap_file_list.top().lineno << ")"; + else { + fmt::print(*warningStream, "{}{}\n", message, lines); } - ss << "\n"; - - // Send it to the user defined stream - (*warningStream) << ss.str(); parseWarningCount++; } @@ -282,27 +267,18 @@ namespace SEAMS { return; } - bool colorize = (infoStream == &std::cout) && isatty(fileno(stdout)); - std::stringstream ss; - if (prefix) { - if (colorize) { - (*infoStream) << trmclr::blue; - } - (*infoStream) << "Aprepro: INFO: "; - } - ss << msg; + bool colorize = (infoStream == &std::cout) && isatty(fileno(stdout)); + std::string message = prefix ? fmt::format("Aprepro: INFO: {}", msg) : fmt::format("{}", msg); + std::string lines = line_info ? fmt::format(" ({}, line {})", ap_file_list.top().name, + ap_file_list.top().lineno) + : ""; - if (prefix && colorize) { - ss << trmclr::normal; + if (colorize) { + fmt::print(*infoStream, "{}{}\n", fmt::styled(message, fmt::fg(fmt::color::blue)), lines); } - - if (line_info) { - ss << " (" << ap_file_list.top().name << ", line " << ap_file_list.top().lineno << ")"; + else { + fmt::print(*infoStream, "{}{}\n", message, lines); } - ss << "\n"; - - // Send it to the user defined stream - (*infoStream) << ss.str(); } void Aprepro::set_error_streams(std::ostream *c_error, std::ostream *c_warning, @@ -883,33 +859,35 @@ namespace SEAMS { else if (type == Parser::token::FNCT || type == Parser::token::SFNCT || type == Parser::token::AFNCT) { int fwidth = 20; // controls spacing/padding for the function names - (*infoStream) << trmclr::blue << "\nFunctions returning double:" << trmclr::normal << '\n'; + fmt::print(*infoStream, "{}", + fmt::styled("\nFunctions returning double:\n", fmt::fg(fmt::color::cyan))); for (const auto &ptr : get_sorted_sym_table()) { if (spre.empty() || ptr->name.find(spre) != std::string::npos) { if (ptr->type == Parser::token::FNCT) { - (*infoStream) << std::left << trmclr::green << std::setw(fwidth) << ptr->syntax - << trmclr::normal << ": " << ptr->info << '\n'; + fmt::print(*infoStream, "{:<{}}: {}\n", + fmt::styled(ptr->syntax, fmt::fg(fmt::color::lime)), fwidth, ptr->info); } } } - (*infoStream) << trmclr::blue << trmclr::blue - << "\nFunctions returning string:" << trmclr::normal << '\n'; + fmt::print(*infoStream, "{}", + fmt::styled("\nFunctions returning string:\n", fmt::fg(fmt::color::cyan))); for (const auto &ptr : get_sorted_sym_table()) { if (spre.empty() || ptr->name.find(spre) != std::string::npos) { if (ptr->type == Parser::token::SFNCT) { - (*infoStream) << std::left << trmclr::green << std::setw(fwidth) << ptr->syntax - << trmclr::normal << ": " << ptr->info << '\n'; + fmt::print(*infoStream, "{:<{}}: {}\n", + fmt::styled(ptr->syntax, fmt::fg(fmt::color::lime)), fwidth, ptr->info); } } } - (*infoStream) << trmclr::blue << "\nFunctions returning array:" << trmclr::normal << '\n'; + fmt::print(*infoStream, "{}", + fmt::styled("\nFunctions returning array:\n", fmt::fg(fmt::color::cyan))); for (const auto &ptr : get_sorted_sym_table()) { if (spre.empty() || ptr->name.find(spre) != std::string::npos) { if (ptr->type == Parser::token::AFNCT) { - (*infoStream) << std::left << trmclr::green << std::setw(fwidth) << ptr->syntax - << trmclr::normal << ": " << ptr->info << '\n'; + fmt::print(*infoStream, "{:<{}}: {}\n", + fmt::styled(ptr->syntax, fmt::fg(fmt::color::lime)), fwidth, ptr->info); } } } diff --git a/packages/seacas/libraries/aprepro_lib/terminal_color.h b/packages/seacas/libraries/aprepro_lib/terminal_color.h deleted file mode 100644 index 5515bb6507..0000000000 --- a/packages/seacas/libraries/aprepro_lib/terminal_color.h +++ /dev/null @@ -1,169 +0,0 @@ -#ifndef __TRMCLR_H__ -#define __TRMCLR_H__ - -// Copyright (c) 2016 Camille Brugel -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgement in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -#include -#include -#include -#include -#include - -// ## Example - -// ```c++ -// #include "trmclr.hpp" -// #include - -// int main() -// { -// trmclr::Style fancyStyle(trmclr::Background::LIGHT_BLUE | -// trmclr::Foreground::WHITE | -// trmclr::Attribute::UNDERLINED | -// trmclr::Attribute::BOLD); - -// trmclr::Style basicStyle(trmclr::Attribute::DEFAULT); - -// std::cout << fancyStyle << "Hello " -// << basicStyle << "World!\n"; - -// return 0; -// } - -// /* -// Note you can also do things like: -// auto bold = [](trmclr::Style style) { return trmclr::Style(style | trmclr::Attribute::BOLD); }; -// */ -// ` - -namespace trmclr { - - struct Style - { - Style(uint32_t value) : _value(value) {} - - operator uint32_t() const { return _value; } - - uint32_t _value; - }; - - enum StyleTypes { FOREGROUND, ATTRIBUTE, BACKGROUND, N_STYLE_TYPES }; - - static const uint32_t STYLE_SHIFT = std::numeric_limits::digits / N_STYLE_TYPES; - - struct Attribute - { - static const uint32_t SHIFT = STYLE_SHIFT * ATTRIBUTE; - - enum { - DEFAULT = 0x01 << SHIFT, - BOLD = 0x02 << SHIFT, - DIM = 0x04 << SHIFT, - UNDERLINED = 0x08 << SHIFT, - BLINK = 0x10 << SHIFT, - REVERSE = 0x20 << SHIFT, - HIDDEN = 0x40 << SHIFT - }; - }; - - struct Foreground - { - static const uint32_t SHIFT = STYLE_SHIFT * FOREGROUND; - - enum { - BLACK = 30 << SHIFT, - RED = 31 << SHIFT, - GREEN = 32 << SHIFT, - YELLOW = 33 << SHIFT, - BLUE = 34 << SHIFT, - MAGENTA = 35 << SHIFT, - CYAN = 36 << SHIFT, - LIGHT_GRAY = 37 << SHIFT, - DEFAULT = 39 << SHIFT, - DARK_GRAY = 90 << SHIFT, - LIGHT_RED = 91 << SHIFT, - LIGHT_GREEN = 92 << SHIFT, - LIGHT_YELLOW = 93 << SHIFT, - LIGHT_BLUE = 94 << SHIFT, - LIGHT_MAGENTA = 95 << SHIFT, - LIGHT_CYAN = 96 << SHIFT, - WHITE = 97 << SHIFT - }; - }; - - struct Background - { - static const uint32_t SHIFT = STYLE_SHIFT * BACKGROUND; - - enum { - BLACK = 40 << SHIFT, - RED = 41 << SHIFT, - GREEN = 42 << SHIFT, - YELLOW = 43 << SHIFT, - BLUE = 44 << SHIFT, - MAGENTA = 45 << SHIFT, - CYAN = 46 << SHIFT, - LIGHT_GRAY = 47 << SHIFT, - DEFAULT = 49 << SHIFT, - DARK_GRAY = 100 << SHIFT, - LIGHT_RED = 101 << SHIFT, - LIGHT_GREEN = 102 << SHIFT, - LIGHT_YELLOW = 103 << SHIFT, - LIGHT_BLUE = 104 << SHIFT, - LIGHT_MAGENTA = 105 << SHIFT, - LIGHT_CYAN = 106 << SHIFT, - WHITE = 107 << SHIFT - }; - }; - - static Style black(trmclr::Foreground::BLACK); - static Style red(trmclr::Foreground::RED); - static Style green(trmclr::Foreground::GREEN); - static Style yellow(trmclr::Foreground::YELLOW); - static Style blue(trmclr::Foreground::BLUE); - static Style magenta(trmclr::Foreground::MAGENTA); - static Style cyan(trmclr::Foreground::CYAN); - static Style normal(trmclr::Attribute::DEFAULT); - - inline std::ostream &operator<<(std::ostream &os, const Style &style) - { - const uint32_t base = 1 << STYLE_SHIFT; - uint32_t encoded = style / base; - uint32_t decoded = style % base; - - os << "\x1B[" << (decoded ? decoded : Foreground::DEFAULT >> Foreground::SHIFT); - - decoded = encoded % base; - - for (uint32_t i = 0; decoded != 0; decoded >>= 1, i++) { - if (decoded & 1) { - os << ";" << i; - } - } - - encoded = encoded / base; - decoded = encoded % base; - - os << ";" << (decoded ? decoded : Background::DEFAULT >> Background::SHIFT) << "m"; - - return os; - } - -} // namespace trmclr -#endif // end __TRMCLR_H__ From ef20de18aae1d12293825bfa5d0e434bfdfae981 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Fri, 5 Apr 2024 13:32:24 -0600 Subject: [PATCH 34/59] CI: See if can get a current version of libfmt using homebrew --- .github/workflows/build_external_lib.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_external_lib.yml b/.github/workflows/build_external_lib.yml index 15e19b160b..88923fd38c 100644 --- a/.github/workflows/build_external_lib.yml +++ b/.github/workflows/build_external_lib.yml @@ -28,8 +28,14 @@ jobs: - name: Install System dependencies shell: bash -l {0} - run: sudo apt update && sudo apt install -y libaec-dev zlib1g-dev automake autoconf libcurl4-openssl-dev libjpeg-dev wget curl bzip2 m4 flex bison cmake libzip-dev openmpi-bin libopenmpi-dev libnetcdf-dev libhdf5-dev libcgns-dev libmatio-dev libfmt-dev catch2 + run: sudo apt update && sudo apt install -y libaec-dev zlib1g-dev automake autoconf libcurl4-openssl-dev libjpeg-dev wget curl bzip2 m4 flex bison cmake libzip-dev openmpi-bin libopenmpi-dev libnetcdf-dev libhdf5-dev libcgns-dev libmatio-dev catch2 + - name: Install Using linuxbrew + shell: bash -l {0} + run: | + eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + brew install fmt + - name: Run cmake shell: bash -l {0} run: | From 8bd0a44fe5fb2ebd19203adba99470b89746606f Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Fri, 5 Apr 2024 13:32:42 -0600 Subject: [PATCH 35/59] Update docs --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a48336af12..9e8fb3d2b5 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,7 @@ manually as detailed in | KOKKOS | YES, NO | NO | Should Kokkos TPL be built. | | GNU_PARALLEL | YES, NO | YES | Should GNU parallel script be built. | | FMT | YES, NO | YES | Should Lib::FMT TPL be built. | +| CATCH2 | YES, NO | YES | Should Catch2 be built (used for testing). | | H5VERSION | V114, V110, V18 | V114 | Use HDF5-1.14.X, HDF5-1.10.X or HDF5-1.8.X | | H5CPP | YES, NO | NO | Should the HDF5 C++ library be built/installed | | BB | YES, NO | NO | Enable Burst Buffer support in PnetCDF | From dd8239c72be9212351e15b10ca98ee71e0531481 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Fri, 5 Apr 2024 13:34:24 -0600 Subject: [PATCH 36/59] CI: Fix syntax in yaml --- .github/workflows/build_external_lib.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_external_lib.yml b/.github/workflows/build_external_lib.yml index 88923fd38c..9374220686 100644 --- a/.github/workflows/build_external_lib.yml +++ b/.github/workflows/build_external_lib.yml @@ -33,9 +33,9 @@ jobs: - name: Install Using linuxbrew shell: bash -l {0} run: | - eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" - brew install fmt - + eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + brew install fmt + - name: Run cmake shell: bash -l {0} run: | From 54d14a265277254b40ae9a49ac5b8570ae94c30b Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Fri, 5 Apr 2024 13:39:29 -0600 Subject: [PATCH 37/59] CI: Try adding a spack build of seacas --- .github/workflows/spack.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/workflows/spack.yml diff --git a/.github/workflows/spack.yml b/.github/workflows/spack.yml new file mode 100644 index 0000000000..77d4631c2e --- /dev/null +++ b/.github/workflows/spack.yml @@ -0,0 +1,12 @@ +jobs: + build: + runs-on: ubuntu-22.04 + steps: + - name: Set up Spack + uses: spack/setup-spack@v2 + with: + ref: develop # Spack version (examples: develop, releases/v0.21) + buildcache: true # Configure oci://ghcr.io/spack/github-actions-buildcache + color: true # Force color output (SPACK_COLOR=always) + path: spack # Where to clone Spack + - run: spack install seacas~mpi \ No newline at end of file From 42f5cd4ece746f5caf4835abb3ec13fa36ac5013 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Fri, 5 Apr 2024 13:41:38 -0600 Subject: [PATCH 38/59] CI: add triggers to workflow --- .github/workflows/spack.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/spack.yml b/.github/workflows/spack.yml index 77d4631c2e..f21b8b9a56 100644 --- a/.github/workflows/spack.yml +++ b/.github/workflows/spack.yml @@ -1,3 +1,19 @@ +# This is a basic workflow to help you get started with Actions +name: SEACAS Spack build + +# Controls when the action will run. Triggers the workflow on push +on: + push: + branches: + - master + pull_request: + branches: + - master + +concurrency: + group: ${{ github.workflow}}-${{ github.head_ref }} + cancel-in-progress: true + jobs: build: runs-on: ubuntu-22.04 From a1a85c5d739b5815d884ee91e5d33f448ed07e04 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Fri, 5 Apr 2024 13:52:39 -0600 Subject: [PATCH 39/59] CI: Another try at using linuxbrew --- .github/workflows/build_external_lib.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_external_lib.yml b/.github/workflows/build_external_lib.yml index 9374220686..7b372989ff 100644 --- a/.github/workflows/build_external_lib.yml +++ b/.github/workflows/build_external_lib.yml @@ -41,6 +41,7 @@ jobs: run: | echo $HOME find /usr/include -name cgnslib.h + eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" mkdir build cd build NETCDF_PATH=/usr MODERN=YES NUMPROCS=2 COMPILER=${{ matrix.compiler }} INSTALL_PATH=${HOME} bash ../cmake-config From 3629534d83c1eee9bcaafbbf52375775e28809b5 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Fri, 5 Apr 2024 14:04:04 -0600 Subject: [PATCH 40/59] CI: See if can fix spack hang on cmake bootstrap --- .github/workflows/spack.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spack.yml b/.github/workflows/spack.yml index f21b8b9a56..142106803c 100644 --- a/.github/workflows/spack.yml +++ b/.github/workflows/spack.yml @@ -25,4 +25,4 @@ jobs: buildcache: true # Configure oci://ghcr.io/spack/github-actions-buildcache color: true # Force color output (SPACK_COLOR=always) path: spack # Where to clone Spack - - run: spack install seacas~mpi \ No newline at end of file + - run: sudo spack install seacas~mpi \ No newline at end of file From 6632396aa7c1367b6687f9166622355e3d2036ab Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Fri, 5 Apr 2024 14:04:24 -0600 Subject: [PATCH 41/59] CI: Install catch2 via homebrew also --- .github/workflows/build_external_lib.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_external_lib.yml b/.github/workflows/build_external_lib.yml index 7b372989ff..2aaaec9985 100644 --- a/.github/workflows/build_external_lib.yml +++ b/.github/workflows/build_external_lib.yml @@ -28,13 +28,13 @@ jobs: - name: Install System dependencies shell: bash -l {0} - run: sudo apt update && sudo apt install -y libaec-dev zlib1g-dev automake autoconf libcurl4-openssl-dev libjpeg-dev wget curl bzip2 m4 flex bison cmake libzip-dev openmpi-bin libopenmpi-dev libnetcdf-dev libhdf5-dev libcgns-dev libmatio-dev catch2 + run: sudo apt update && sudo apt install -y libaec-dev zlib1g-dev automake autoconf libcurl4-openssl-dev libjpeg-dev wget curl bzip2 m4 flex bison cmake libzip-dev openmpi-bin libopenmpi-dev libnetcdf-dev libhdf5-dev libcgns-dev libmatio-dev - name: Install Using linuxbrew shell: bash -l {0} run: | eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" - brew install fmt + brew install fmt catch2 - name: Run cmake shell: bash -l {0} From fec7aa928931ead64dcf1c1039f6579c106e49fe Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Fri, 5 Apr 2024 14:14:53 -0600 Subject: [PATCH 42/59] CI: One more try at spack --- .github/workflows/spack.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spack.yml b/.github/workflows/spack.yml index 142106803c..f21b8b9a56 100644 --- a/.github/workflows/spack.yml +++ b/.github/workflows/spack.yml @@ -25,4 +25,4 @@ jobs: buildcache: true # Configure oci://ghcr.io/spack/github-actions-buildcache color: true # Force color output (SPACK_COLOR=always) path: spack # Where to clone Spack - - run: sudo spack install seacas~mpi \ No newline at end of file + - run: spack install seacas~mpi \ No newline at end of file From e1b9241eef4a724edcb4fb8bed4e3c1c123ce517 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Fri, 5 Apr 2024 14:16:01 -0600 Subject: [PATCH 43/59] CI: One more try at spack --- .github/workflows/spack.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/spack.yml b/.github/workflows/spack.yml index f21b8b9a56..92493e7ebb 100644 --- a/.github/workflows/spack.yml +++ b/.github/workflows/spack.yml @@ -25,4 +25,7 @@ jobs: buildcache: true # Configure oci://ghcr.io/spack/github-actions-buildcache color: true # Force color output (SPACK_COLOR=always) path: spack # Where to clone Spack - - run: spack install seacas~mpi \ No newline at end of file + - run: | + spack external find + spack compiler fine + spack install seacas~mpi \ No newline at end of file From 77d59d94a1fe24b13849d0ddd67ce9adb79e80b6 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Fri, 5 Apr 2024 14:17:56 -0600 Subject: [PATCH 44/59] CI: Fix fine->find spelling --- .github/workflows/spack.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spack.yml b/.github/workflows/spack.yml index 92493e7ebb..ce5436e1dd 100644 --- a/.github/workflows/spack.yml +++ b/.github/workflows/spack.yml @@ -27,5 +27,5 @@ jobs: path: spack # Where to clone Spack - run: | spack external find - spack compiler fine + spack compiler find spack install seacas~mpi \ No newline at end of file From 056d0fc52f8a5e690ef7f07328b95e1597658366 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Fri, 5 Apr 2024 14:45:48 -0600 Subject: [PATCH 45/59] CI: refactor spack build --- .github/workflows/spack.yml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/spack.yml b/.github/workflows/spack.yml index ce5436e1dd..20c4fefd28 100644 --- a/.github/workflows/spack.yml +++ b/.github/workflows/spack.yml @@ -25,7 +25,22 @@ jobs: buildcache: true # Configure oci://ghcr.io/spack/github-actions-buildcache color: true # Force color output (SPACK_COLOR=always) path: spack # Where to clone Spack - - run: | - spack external find - spack compiler find - spack install seacas~mpi \ No newline at end of file + + - name: Configure Spack externals + shell: bash -l {0} + run: | + spack external find + spack compiler find + + - name: Build non-mpi SEACAS + shell: bash -l {0} + run: | + spack spec seacas~mpi + spack install seacas~mpi + + - name: Build parallel SEACAS + shell: bash -l {0} + run: | + spack spec seacas + spack install seacas + From 81334b94e7f99a7fd009d5c30ced6c596f4102f2 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Fri, 5 Apr 2024 15:01:20 -0600 Subject: [PATCH 46/59] CI: Fix spack syntax --- .github/workflows/spack.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/spack.yml b/.github/workflows/spack.yml index 20c4fefd28..f1af13ffcb 100644 --- a/.github/workflows/spack.yml +++ b/.github/workflows/spack.yml @@ -25,9 +25,6 @@ jobs: buildcache: true # Configure oci://ghcr.io/spack/github-actions-buildcache color: true # Force color output (SPACK_COLOR=always) path: spack # Where to clone Spack - - - name: Configure Spack externals - shell: bash -l {0} run: | spack external find spack compiler find From 7cfe0ea6b849276d613a6317caa67ca8395fad20 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Fri, 5 Apr 2024 15:02:14 -0600 Subject: [PATCH 47/59] CI: See if this fixes spack --- .github/workflows/spack.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/spack.yml b/.github/workflows/spack.yml index f1af13ffcb..77c6be2b8c 100644 --- a/.github/workflows/spack.yml +++ b/.github/workflows/spack.yml @@ -30,13 +30,11 @@ jobs: spack compiler find - name: Build non-mpi SEACAS - shell: bash -l {0} run: | spack spec seacas~mpi spack install seacas~mpi - name: Build parallel SEACAS - shell: bash -l {0} run: | spack spec seacas spack install seacas From ca12da77468f8b23e62b2435267a04078c3d65c4 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Fri, 5 Apr 2024 15:04:17 -0600 Subject: [PATCH 48/59] CI: See if this fixes spack --- .github/workflows/spack.yml | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/.github/workflows/spack.yml b/.github/workflows/spack.yml index 77c6be2b8c..40ce79a613 100644 --- a/.github/workflows/spack.yml +++ b/.github/workflows/spack.yml @@ -25,17 +25,10 @@ jobs: buildcache: true # Configure oci://ghcr.io/spack/github-actions-buildcache color: true # Force color output (SPACK_COLOR=always) path: spack # Where to clone Spack - run: | - spack external find - spack compiler find - - - name: Build non-mpi SEACAS - run: | - spack spec seacas~mpi - spack install seacas~mpi - - - name: Build parallel SEACAS - run: | - spack spec seacas - spack install seacas - + - run: | + spack external find + spack compiler find + spack spec seacas~mpi + spack install seacas~mpi + spack spec seacas+mpi + spack install seacas+mpi From 096492e45bda64a8ba42696faf7e982b43e82a04 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Fri, 5 Apr 2024 15:42:18 -0600 Subject: [PATCH 49/59] CI: Turn off spack parallel seacas for now (works; speeding up build) --- .github/workflows/spack.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/spack.yml b/.github/workflows/spack.yml index 40ce79a613..8979e8742c 100644 --- a/.github/workflows/spack.yml +++ b/.github/workflows/spack.yml @@ -30,5 +30,6 @@ jobs: spack compiler find spack spec seacas~mpi spack install seacas~mpi - spack spec seacas+mpi - spack install seacas+mpi + spack find + # spack spec seacas+mpi + # spack install seacas+mpi From eb15beb6d8965f614cbd2f804b488802bc136092 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Tue, 9 Apr 2024 13:35:36 -0600 Subject: [PATCH 50/59] PYTHON: Do not need development, only interpreter --- packages/seacas/scripts/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/seacas/scripts/CMakeLists.txt b/packages/seacas/scripts/CMakeLists.txt index 0b0c4497b0..294d0ae9c7 100644 --- a/packages/seacas/scripts/CMakeLists.txt +++ b/packages/seacas/scripts/CMakeLists.txt @@ -88,7 +88,7 @@ ENDIF() ASSERT_DEFINED(${PROJECT_NAME}_ENABLE_SEACASExodus) ASSERT_DEFINED(BUILD_SHARED_LIBS) IF (${PROJECT_NAME}_ENABLE_SEACASExodus) - find_package(Python COMPONENTS Interpreter Development) + find_package(Python COMPONENTS Interpreter) IF (${Python_FOUND}) message(STATUS "Found python version ${Python_VERSION}") IF (${Python_VERSION} VERSION_LESS "3.0") From b9d6d9096117bb154c37f692673a9e25ff54fd34 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Tue, 9 Apr 2024 16:18:55 -0600 Subject: [PATCH 51/59] GREPOS: Intel overoptimizes unless inimap separate file --- .../seacas/applications/grepos/gp_inimap.f | 7 +++++++ .../seacas/applications/grepos/gp_mapvar.f | 20 ++++++++++++++++--- .../seacas/applications/grepos/gp_qainfo.blk | 4 ++-- packages/seacas/applications/grepos/grepos.f | 6 ------ 4 files changed, 26 insertions(+), 11 deletions(-) create mode 100644 packages/seacas/applications/grepos/gp_inimap.f diff --git a/packages/seacas/applications/grepos/gp_inimap.f b/packages/seacas/applications/grepos/gp_inimap.f new file mode 100644 index 0000000000..8fbbd1eaa1 --- /dev/null +++ b/packages/seacas/applications/grepos/gp_inimap.f @@ -0,0 +1,7 @@ + SUBROUTINE INIMAP(LEN, MAP) + INTEGER MAP(*) + DO I=1, LEN + MAP(I) = I + end do + end + diff --git a/packages/seacas/applications/grepos/gp_mapvar.f b/packages/seacas/applications/grepos/gp_mapvar.f index 4f35ceda77..9d164e89a9 100644 --- a/packages/seacas/applications/grepos/gp_mapvar.f +++ b/packages/seacas/applications/grepos/gp_mapvar.f @@ -26,16 +26,30 @@ subroutine mapvar(nold, nnew, nvar, map, vars, scr) real vars(*) c real vars(nold, nvar) real scr(*) + logical isseq C ... VARS should really be a doubly-dimensioned array (NOLD, NVAR), C The dimensions need to be in this order so we can read them -C in using exgev and exgnv. But, this order doesn't work very +C in using exgnv. But, this order doesn't work very C well when trying to reduce the size of NOLD -C ... TODO: Need to use the truth table to make sure variables -C exist for each element. + isseq = .false. + if (nold .eq. nnew) then + isseq = .true. + do i=1, nnew + if (map(i) .ne. i) then + isseq = .false. + end if + end do + end if + + if (isseq .eq. .true.) then + return + end if + do 30 ivar = 1, nvar do 10 i = 1, nnew + write (*,*) i, map(i) scr(i) = vars(map(i) + nold * (ivar-1) ) 10 continue diff --git a/packages/seacas/applications/grepos/gp_qainfo.blk b/packages/seacas/applications/grepos/gp_qainfo.blk index 6e56467ebc..ba9dae1036 100644 --- a/packages/seacas/applications/grepos/gp_qainfo.blk +++ b/packages/seacas/applications/grepos/gp_qainfo.blk @@ -6,5 +6,5 @@ C See packages/seacas/LICENSE for details C -*- Mode: fortran -*- QAINFO(1) = 'Grepos ' - QAINFO(2) = '2024/03/19 ' - QAINFO(3) = ' 1.94 ' + QAINFO(2) = '2024/04/09 ' + QAINFO(3) = ' 1.95 ' diff --git a/packages/seacas/applications/grepos/grepos.f b/packages/seacas/applications/grepos/grepos.f index 76befa0932..d3b4a3f330 100644 --- a/packages/seacas/applications/grepos/grepos.f +++ b/packages/seacas/applications/grepos/grepos.f @@ -1292,12 +1292,6 @@ PROGRAM GREPOS $ /,9x,'if you need this capability.') END - SUBROUTINE INIMAP(LEN, MAP) - INTEGER MAP(*) - DO 10 I=1, LEN - MAP(I) = I - 10 CONTINUE - END subroutine exgqaw(ndb, qarec, ierr) include 'gp_params.blk' character*(mxstln) qarec(4, *) From 677c2907bf6996a6465d6154c1254cd7dfe84d70 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Tue, 9 Apr 2024 16:29:00 -0600 Subject: [PATCH 52/59] GREPOS: Removde debug print --- packages/seacas/applications/grepos/gp_mapvar.f | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/seacas/applications/grepos/gp_mapvar.f b/packages/seacas/applications/grepos/gp_mapvar.f index 9d164e89a9..91b5835ee1 100644 --- a/packages/seacas/applications/grepos/gp_mapvar.f +++ b/packages/seacas/applications/grepos/gp_mapvar.f @@ -49,7 +49,6 @@ subroutine mapvar(nold, nnew, nvar, map, vars, scr) do 30 ivar = 1, nvar do 10 i = 1, nnew - write (*,*) i, map(i) scr(i) = vars(map(i) + nold * (ivar-1) ) 10 continue From 1def015c9c5628616b4c92d0995d60e5e9ce2115 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Tue, 9 Apr 2024 16:37:41 -0600 Subject: [PATCH 53/59] GREPOS: Fix syntax of logical compare --- packages/seacas/applications/grepos/gp_mapvar.f | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/seacas/applications/grepos/gp_mapvar.f b/packages/seacas/applications/grepos/gp_mapvar.f index 91b5835ee1..d55dd4d391 100644 --- a/packages/seacas/applications/grepos/gp_mapvar.f +++ b/packages/seacas/applications/grepos/gp_mapvar.f @@ -1,4 +1,4 @@ -C Copyright(C) 1999-2020 National Technology & Engineering Solutions +C Copyright(C) 1999-2020, 2024 National Technology & Engineering Solutions C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with C NTESS, the U.S. Government retains certain rights in this software. C @@ -43,7 +43,7 @@ subroutine mapvar(nold, nnew, nvar, map, vars, scr) end do end if - if (isseq .eq. .true.) then + if (isseq) then return end if From 0ce824e590c70460875a99e5d7c063d8769ed35c Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Wed, 10 Apr 2024 08:40:36 -0600 Subject: [PATCH 54/59] Clang format run over all files --- .../libraries/chaco/assign/assign_out.c | 10 +- packages/seacas/libraries/chaco/assign/y2x.c | 4 +- .../libraries/chaco/bpmatch/genvals2d.c | 2 +- .../libraries/chaco/bpmatch/genvals3d.c | 2 +- .../seacas/libraries/chaco/bpmatch/inits2d.c | 14 +-- .../seacas/libraries/chaco/bpmatch/sorts2d.c | 2 +- .../seacas/libraries/chaco/bpmatch/sorts3d.c | 2 +- .../libraries/chaco/coarsen/countcedges.c | 10 +- .../libraries/chaco/coarsen/interpolate.c | 10 +- .../libraries/chaco/coarsen/makeccoords.c | 8 +- .../libraries/chaco/connect/add_edges.c | 12 +-- .../seacas/libraries/chaco/connect/heap.c | 14 +-- .../seacas/libraries/chaco/graph/graph_out.c | 4 +- .../seacas/libraries/chaco/graph/mm_out.c | 4 +- .../seacas/libraries/chaco/graph/reformat.c | 24 ++--- .../seacas/libraries/chaco/graph/subgraph.c | 22 ++--- .../libraries/chaco/inertial/make_subgeom.c | 2 +- .../libraries/chaco/input/read_params.c | 97 +++++++++---------- .../libraries/chaco/internal/check_internal.c | 10 +- .../chaco/internal/improve_internal.c | 16 +-- .../libraries/chaco/klspiff/bilistops.c | 6 +- .../libraries/chaco/klspiff/compress_ewgts.c | 8 +- .../libraries/chaco/klspiff/count_weights.c | 4 +- .../libraries/chaco/klspiff/make_bndy_list.c | 12 +-- .../libraries/chaco/klvspiff/clear_dvals.c | 6 +- .../chaco/klvspiff/countup_vtx_sep.c | 2 +- .../libraries/chaco/klvspiff/find_bndy.c | 8 +- .../libraries/chaco/klvspiff/klv_init.c | 8 +- .../libraries/chaco/klvspiff/make_bpgraph.c | 16 +-- .../seacas/libraries/chaco/main/user_params.c | 4 +- packages/seacas/libraries/chaco/misc/count.c | 2 +- .../libraries/chaco/misc/countup_cube.c | 6 +- .../libraries/chaco/misc/countup_mesh.c | 12 +-- .../libraries/chaco/misc/define_submeshes.c | 8 +- .../seacas/libraries/chaco/misc/find_maxdeg.c | 2 +- .../seacas/libraries/chaco/misc/merge_goals.c | 6 +- packages/seacas/libraries/chaco/misc/timing.c | 2 +- .../chaco/refine_map/compute_cube_vdata.c | 4 +- .../chaco/refine_map/compute_mesh_vdata.c | 4 +- .../chaco/refine_map/find_edge_mesh.c | 4 +- .../chaco/refine_part/make_maps_ref.c | 8 +- .../chaco/refine_part/make_terms_ref.c | 4 +- .../libraries/chaco/util/array_alloc_2D.c | 4 +- .../libraries/chaco/util/machine_params.c | 2 +- .../seacas/libraries/chaco/util/smalloc.c | 18 ++-- .../libraries/exodus_for/src/exo_jack.c | 58 ++++++----- .../libraries/ioss/src/Ioss_CodeTypes.h | 2 +- .../libraries/ioss/src/Ioss_DatabaseIO.h | 57 ++++++----- .../libraries/ioss/src/Ioss_GroupingEntity.h | 40 ++++---- .../libraries/ioss/src/Ioss_IOFactory.h | 16 +-- .../seacas/libraries/ioss/src/Ioss_Property.h | 14 +-- .../seacas/libraries/ioss/src/Ioss_Utils.h | 32 +++--- .../libraries/ioss/src/adios/Ioad_Helper.h | 8 +- .../libraries/ioss/src/cgns/Iocgns_Utils.h | 30 +++--- .../ioss/src/exodus/Ioex_DatabaseIO.h | 7 +- .../ioss/src/exodus/Ioex_DecompositionData.C | 6 +- .../libraries/ioss/src/exodus/Ioex_Utils.h | 8 +- .../ioss/src/exonull/Ioexnl_DatabaseIO.C | 2 +- .../libraries/ioss/src/hopscotch_hash.h | 4 +- .../ioss/src/utest/Utst_IofxDatabaseIO.C | 2 +- .../libraries/ioss/src/utest/Utst_heartbeat.C | 2 +- .../seacas/libraries/supes/ext_lib/exread.c | 2 +- packages/seacas/libraries/svdi/cgi/mdcgi.c | 14 +-- .../seacas/libraries/svdi/cgi/met_metxlate.c | 84 ++++++++-------- .../seacas/libraries/svdi/cgi/pst_pstxlate.c | 84 ++++++++-------- packages/seacas/libraries/svdi/cgi/sdcgi.c | 84 ++++++++-------- .../seacas/libraries/svdi/cgi/x11_vdix11.c | 4 +- .../seacas/libraries/svdi/cgi/x11_x11xlate.c | 82 ++++++++-------- 68 files changed, 545 insertions(+), 526 deletions(-) diff --git a/packages/seacas/libraries/chaco/assign/assign_out.c b/packages/seacas/libraries/chaco/assign/assign_out.c index 81a8f8d264..d29554136c 100644 --- a/packages/seacas/libraries/chaco/assign/assign_out.c +++ b/packages/seacas/libraries/chaco/assign/assign_out.c @@ -10,7 +10,7 @@ #include static void assign_out_normal(int nvtxs, /* number of vertices to output */ - int * sets, /* values to be printed */ + int *sets, /* values to be printed */ char *outname /* name of output file */ ) { @@ -36,14 +36,14 @@ static void assign_out_normal(int nvtxs, /* number of vertices to output */ } static void assign_out_inv(int nvtxs, /* number of vertices to output */ - int * sets, /* values to be printed */ + int *sets, /* values to be printed */ int nsets, /* number of sets */ char *outname /* name of output file */ ) { FILE *fout; /* output file */ - int * size; /* # vtxs in sets / index into inorder */ - int * inorder; /* list of vtxs in each set */ + int *size; /* # vtxs in sets / index into inorder */ + int *inorder; /* list of vtxs in each set */ int i, j; /* loop counter */ /* Print assignment in inverted format. */ @@ -105,7 +105,7 @@ static void assign_out_inv(int nvtxs, /* number of vertices to output */ } void assign_out(int nvtxs, /* number of vertices to output */ - int * sets, /* values to be printed */ + int *sets, /* values to be printed */ int nsets, /* number of sets */ char *outname /* name of output file */ ) diff --git a/packages/seacas/libraries/chaco/assign/y2x.c b/packages/seacas/libraries/chaco/assign/y2x.c index 39096861a1..90ee1b8c5b 100644 --- a/packages/seacas/libraries/chaco/assign/y2x.c +++ b/packages/seacas/libraries/chaco/assign/y2x.c @@ -11,7 +11,7 @@ void y2x(double **xvecs, /* pointer to list of x-vectors */ int ndims, /* number of divisions to make (# xvecs) */ int nmyvtxs, /* number of vertices I own (length xvecs) */ - double * wsqrt /* sqrt of vertex weights */ + double *wsqrt /* sqrt of vertex weights */ ) /* Convert from y to x by dividing by wsqrt. */ @@ -36,7 +36,7 @@ void y2x(double **xvecs, /* pointer to list of x-vectors */ void x2y(double **yvecs, /* pointer to list of y-vectors */ int ndims, /* number of divisions to make (# yvecs) */ int nmyvtxs, /* number of vertices I own (length yvecs) */ - double * wsqrt /* sqrt of vertex weights */ + double *wsqrt /* sqrt of vertex weights */ ) /* Convert from x to y by multiplying by wsqrt. */ diff --git a/packages/seacas/libraries/chaco/bpmatch/genvals2d.c b/packages/seacas/libraries/chaco/bpmatch/genvals2d.c index 9305dd1ff7..722fd3dca9 100644 --- a/packages/seacas/libraries/chaco/bpmatch/genvals2d.c +++ b/packages/seacas/libraries/chaco/bpmatch/genvals2d.c @@ -12,7 +12,7 @@ void genvals2d( /* Create lists of sets of values to be sorted. */ double **xvecs, /* vectors to partition */ - double * vals[4][MAXSETS], /* ptrs to lists of values */ + double *vals[4][MAXSETS], /* ptrs to lists of values */ int nvtxs /* number of values */ ) { diff --git a/packages/seacas/libraries/chaco/bpmatch/genvals3d.c b/packages/seacas/libraries/chaco/bpmatch/genvals3d.c index aedc450b2f..b7a5cecbaa 100644 --- a/packages/seacas/libraries/chaco/bpmatch/genvals3d.c +++ b/packages/seacas/libraries/chaco/bpmatch/genvals3d.c @@ -12,7 +12,7 @@ void genvals3d( /* Create lists of sets of values to be sorted. */ double **xvecs, /* vectors to partition */ - double * vals[8][MAXSETS], /* ptrs to lists of values */ + double *vals[8][MAXSETS], /* ptrs to lists of values */ int nvtxs /* number of values */ ) { diff --git a/packages/seacas/libraries/chaco/bpmatch/inits2d.c b/packages/seacas/libraries/chaco/bpmatch/inits2d.c index 6611fc441a..bedf35bf6b 100644 --- a/packages/seacas/libraries/chaco/bpmatch/inits2d.c +++ b/packages/seacas/libraries/chaco/bpmatch/inits2d.c @@ -9,7 +9,7 @@ #include "params.h" // for MAXSETS #include "structs.h" // for vtx_data -int findindex(int * indices, /* indices sorting values */ +int findindex(int *indices, /* indices sorting values */ double *vals, /* values sorted by indices */ double target, /* target value */ int nvals /* number of values */ @@ -62,14 +62,14 @@ int findindex(int * indices, /* indices sorting values */ } void inits2d(struct vtx_data **graph, /* graph data structure for vertex weights */ - double ** xvecs, /* values to partition with */ - double * vals[4][MAXSETS], /* values in sorted lists */ - int * indices[4][MAXSETS], /* indices sorting lists */ + double **xvecs, /* values to partition with */ + double *vals[4][MAXSETS], /* values in sorted lists */ + int *indices[4][MAXSETS], /* indices sorting lists */ int nvtxs, /* number of vertices */ - double * dist, /* trial separation point */ + double *dist, /* trial separation point */ int startvtx[4][MAXSETS], /* indices defining separation */ - double * size, /* size of each set being modified */ - int * sets /* set each vertex gets assigned to */ + double *size, /* size of each set being modified */ + int *sets /* set each vertex gets assigned to */ ) { double xmid, ymid; /* median x and y values */ diff --git a/packages/seacas/libraries/chaco/bpmatch/sorts2d.c b/packages/seacas/libraries/chaco/bpmatch/sorts2d.c index 3f2b24cef7..77f39a802d 100644 --- a/packages/seacas/libraries/chaco/bpmatch/sorts2d.c +++ b/packages/seacas/libraries/chaco/bpmatch/sorts2d.c @@ -12,7 +12,7 @@ void sorts2d( /* Sort the lists needed to find the splitter. */ double *vals[4][MAXSETS], /* lists of values to sort */ - int * indices[4][MAXSETS], /* indices of sorted lists */ + int *indices[4][MAXSETS], /* indices of sorted lists */ int nvtxs /* number of vertices */ ) { diff --git a/packages/seacas/libraries/chaco/bpmatch/sorts3d.c b/packages/seacas/libraries/chaco/bpmatch/sorts3d.c index 6a098cea61..fa6baa147c 100644 --- a/packages/seacas/libraries/chaco/bpmatch/sorts3d.c +++ b/packages/seacas/libraries/chaco/bpmatch/sorts3d.c @@ -12,7 +12,7 @@ void sorts3d( /* Sort the lists needed to find the splitter. */ double *vals[8][MAXSETS], /* lists of values to sort */ - int * indices[8][MAXSETS], /* indices of sorted lists */ + int *indices[8][MAXSETS], /* indices of sorted lists */ int nvtxs /* number of vertices */ ) { diff --git a/packages/seacas/libraries/chaco/coarsen/countcedges.c b/packages/seacas/libraries/chaco/coarsen/countcedges.c index 232aa0a6e6..374cd9eb4b 100644 --- a/packages/seacas/libraries/chaco/coarsen/countcedges.c +++ b/packages/seacas/libraries/chaco/coarsen/countcedges.c @@ -12,11 +12,11 @@ void countcedges( /* Count edges in coarsened graph and construct start array. */ struct vtx_data **graph, /* array of vtx data for graph */ int nvtxs, /* number of vertices in graph */ - int * start, /* start of edgevals list for each vertex */ - int * seenflag, /* flags indicating vtxs already counted */ - int * mflag, /* flag indicating vtx matched or not */ - int * v2cv, /* mapping from fine to coarse vertices */ - int * pcnedges /* number of edges in coarsened graph */ + int *start, /* start of edgevals list for each vertex */ + int *seenflag, /* flags indicating vtxs already counted */ + int *mflag, /* flag indicating vtx matched or not */ + int *v2cv, /* mapping from fine to coarse vertices */ + int *pcnedges /* number of edges in coarsened graph */ ) { int *jptr; /* loops through edge list */ diff --git a/packages/seacas/libraries/chaco/coarsen/interpolate.c b/packages/seacas/libraries/chaco/coarsen/interpolate.c index 23f2900243..104bfcaa5a 100644 --- a/packages/seacas/libraries/chaco/coarsen/interpolate.c +++ b/packages/seacas/libraries/chaco/coarsen/interpolate.c @@ -15,18 +15,18 @@ which they were collapsed. */ -void ch_interpolate(double ** vecs, /* approximate eigenvectors for graph */ - double ** cvecs, /* exact eigenvectors for coarse graph */ +void ch_interpolate(double **vecs, /* approximate eigenvectors for graph */ + double **cvecs, /* exact eigenvectors for coarse graph */ int ndims, /* number of vectors to interpolate */ struct vtx_data **graph, /* array of vtx data for graph */ int nvtxs, /* number of vertices in graph */ - int * v2cv, /* mapping from vtxs to cvtxs */ + int *v2cv, /* mapping from vtxs to cvtxs */ int using_ewgts /* are edge weights being used in fine graph? */ ) { double *vec, *cvec; /* pointers into vecs and vecs */ - int * eptr; /* loops through edge lists */ - float * ewptr; /* loops through edge weights */ + int *eptr; /* loops through edge lists */ + float *ewptr; /* loops through edge weights */ float ewgt; /* value for edge weight */ double ewsum; /* sum of incident edge weights */ double sum; /* sum of values of neighbors */ diff --git a/packages/seacas/libraries/chaco/coarsen/makeccoords.c b/packages/seacas/libraries/chaco/coarsen/makeccoords.c index ace71e657c..d3a147bc54 100644 --- a/packages/seacas/libraries/chaco/coarsen/makeccoords.c +++ b/packages/seacas/libraries/chaco/coarsen/makeccoords.c @@ -14,11 +14,11 @@ void makeccoords(struct vtx_data **graph, /* array of vtx data for graph */ int cnvtxs, /* number of vertices in coarse graph */ - int * cv2v_ptrs, /* vtxs corresponding to each cvtx */ - int * cv2v_vals, /* indices into cv2v_vals */ + int *cv2v_ptrs, /* vtxs corresponding to each cvtx */ + int *cv2v_vals, /* indices into cv2v_vals */ int igeom, /* dimensions of geometric data */ - float ** coords, /* coordinates for vertices */ - float ** ccoords /* coordinates for coarsened vertices */ + float **coords, /* coordinates for vertices */ + float **ccoords /* coordinates for coarsened vertices */ ) { double mass; /* total mass of merged vertices */ diff --git a/packages/seacas/libraries/chaco/connect/add_edges.c b/packages/seacas/libraries/chaco/connect/add_edges.c index 2bcf91ed17..c7c932b2dd 100644 --- a/packages/seacas/libraries/chaco/connect/add_edges.c +++ b/packages/seacas/libraries/chaco/connect/add_edges.c @@ -12,16 +12,16 @@ void add_edges(struct vtx_data **graph, /* graph data structure */ struct edgeslist *new_edges, /* list of edges connecting graph */ - struct ilists ** old_edges, /* edges data overwritten for connecting */ - struct flists ** old_ewgts, /* weights of edges overwritten */ + struct ilists **old_edges, /* edges data overwritten for connecting */ + struct flists **old_ewgts, /* weights of edges overwritten */ int using_ewgts /* are edge weights being used? */ ) { - struct ilists * save_list; /* space to save old edge list */ - struct flists * save_ewgts; /* space to save old edge weights */ + struct ilists *save_list; /* space to save old edge list */ + struct flists *save_ewgts; /* space to save old edge weights */ struct edgeslist *edges; /* loops through new edges */ - float * new_ewgts; /* new edge weights */ - int * new_list; /* new edge list */ + float *new_ewgts; /* new edge weights */ + int *new_list; /* new edge list */ int nedges; /* number of edges a vertex has */ int vtx, vtx2; /* two vertices in edge to be added */ int i, j; /* loop counter */ diff --git a/packages/seacas/libraries/chaco/connect/heap.c b/packages/seacas/libraries/chaco/connect/heap.c index ad530cbc9b..6a71b646b6 100644 --- a/packages/seacas/libraries/chaco/connect/heap.c +++ b/packages/seacas/libraries/chaco/connect/heap.c @@ -9,8 +9,8 @@ #include #include -#define left(i) (2 * (i)) -#define right(i) (2 * (i) + 1) +#define left(i) (2 * (i)) +#define right(i) (2 * (i) + 1) #define parent(i) ((int)((i) / 2)) /* NOTE: heap assumes indices are 1-based. */ @@ -22,7 +22,7 @@ void heapify(struct heap *heap, /* array of vals/tag to make into heap */ int index, /* root of subtree to heapify */ int nvals, /* number of values in array */ - int * map /* maps from tag values to heap indices */ + int *map /* maps from tag values to heap indices */ ) { double swap_val; /* temporary storage for swapping values */ @@ -66,7 +66,7 @@ void heapify(struct heap *heap, /* array of vals/tag to make into heap */ /* Construct a heap from an unordered set of values. */ void heap_build(struct heap *heap, /* array of vals/tag to make into heap */ int nvals, /* number of values in array */ - int * map /* maps from tag values to heap indices */ + int *map /* maps from tag values to heap indices */ ) { int i; /* loop counter */ @@ -84,8 +84,8 @@ void heap_build(struct heap *heap, /* array of vals/tag to make into heap */ double heap_extract_max(struct heap *heap, /* array of vals/tag in a heap */ int nvals, /* number of values in array */ - int * ptag, /* tag associated with return value */ - int * map /* maps from tag values to heap indices */ + int *ptag, /* tag associated with return value */ + int *map /* maps from tag values to heap indices */ ) { double maxval; /* return value */ @@ -117,7 +117,7 @@ double heap_extract_max(struct heap *heap, /* array of vals/tag in a heap */ void heap_update_val(struct heap *heap, /* array of vals/tag in a heap */ int index, /* index of value to update */ double newval, /* new value to insert */ - int * map /* maps from tag values to heap indices */ + int *map /* maps from tag values to heap indices */ ) { int tag; /* tag value associated with updated val */ diff --git a/packages/seacas/libraries/chaco/graph/graph_out.c b/packages/seacas/libraries/chaco/graph/graph_out.c index 0059bf2f7f..da2fc554d2 100644 --- a/packages/seacas/libraries/chaco/graph/graph_out.c +++ b/packages/seacas/libraries/chaco/graph/graph_out.c @@ -14,8 +14,8 @@ void graph_out(struct vtx_data **graph, /* graph data structure */ int nvtxs, /* number of vtxs in graph */ int using_ewgts, /* Are edges weighted? */ - char * tag, /* message to include */ - char * file_name /* output file name if not null */ + char *tag, /* message to include */ + char *file_name /* output file name if not null */ ) { FILE *file; /* output file */ diff --git a/packages/seacas/libraries/chaco/graph/mm_out.c b/packages/seacas/libraries/chaco/graph/mm_out.c index bc27a4c1bd..8d1f87d50b 100644 --- a/packages/seacas/libraries/chaco/graph/mm_out.c +++ b/packages/seacas/libraries/chaco/graph/mm_out.c @@ -14,8 +14,8 @@ void mm_out(struct vtx_data **graph, /* graph data structure */ int nvtxs, /* number of vtxs in graph */ int using_ewgts, /* Are edges weighted? */ - char * tag, /* message to include */ - char * file_name /* output file name if not null */ + char *tag, /* message to include */ + char *file_name /* output file name if not null */ ) { FILE *file; /* output file */ diff --git a/packages/seacas/libraries/chaco/graph/reformat.c b/packages/seacas/libraries/chaco/graph/reformat.c index 399d1bf23d..332fafec67 100644 --- a/packages/seacas/libraries/chaco/graph/reformat.c +++ b/packages/seacas/libraries/chaco/graph/reformat.c @@ -12,23 +12,23 @@ /* Change from a FORTRAN graph style to our graph data structure. */ -int reformat(int * start, /* start of edge list for each vertex */ - int * adjacency, /* edge list data */ +int reformat(int *start, /* start of edge list for each vertex */ + int *adjacency, /* edge list data */ int nvtxs, /* number of vertices in graph */ - int * pnedges, /* ptr to number of edges in graph */ - int * vwgts, /* weights for all vertices */ - float * ewgts, /* weights for all edges */ + int *pnedges, /* ptr to number of edges in graph */ + int *vwgts, /* weights for all vertices */ + float *ewgts, /* weights for all edges */ struct vtx_data ***pgraph /* ptr to array of vtx data for graph */ ) { - extern FILE * Output_File; /* output file or null */ + extern FILE *Output_File; /* output file or null */ struct vtx_data **graph = NULL; /* array of vtx data for graph */ - struct vtx_data * links = NULL; /* space for data for all vtxs */ - int * edges = NULL; /* space for all adjacency lists */ - float * eweights = NULL; /* space for all edge weights */ - int * eptr = NULL; /* steps through adjacency list */ - int * eptr_save = NULL; /* saved index into adjacency list */ - float * wptr = NULL; /* steps through edge weights list */ + struct vtx_data *links = NULL; /* space for data for all vtxs */ + int *edges = NULL; /* space for all adjacency lists */ + float *eweights = NULL; /* space for all edge weights */ + int *eptr = NULL; /* steps through adjacency list */ + int *eptr_save = NULL; /* saved index into adjacency list */ + float *wptr = NULL; /* steps through edge weights list */ int self_edge; /* number of self loops detected */ int size; /* length of all edge lists */ double sum; /* sum of edge weights for a vtx */ diff --git a/packages/seacas/libraries/chaco/graph/subgraph.c b/packages/seacas/libraries/chaco/graph/subgraph.c index ba49b1325b..4acf54f5c1 100644 --- a/packages/seacas/libraries/chaco/graph/subgraph.c +++ b/packages/seacas/libraries/chaco/graph/subgraph.c @@ -15,18 +15,18 @@ void make_subgraph(struct vtx_data **graph, /* graph data structure */ struct vtx_data **subgraph, /* subgraph data structure */ int subnvtxs, /* number of vtxs in subgraph */ - int * psubnedges, /* ptr to number of edges in subgraph */ - int * assignment, /* values designating subgraph inclusion */ + int *psubnedges, /* ptr to number of edges in subgraph */ + int *assignment, /* values designating subgraph inclusion */ int set, /* assignment value indicating inclusion */ - int * glob2loc, /* mapping from graph to subgraph numbering */ - int * loc2glob, /* mapping from subgraph to graph numbering */ - int * degree, /* degrees of vertices in graph */ + int *glob2loc, /* mapping from graph to subgraph numbering */ + int *loc2glob, /* mapping from subgraph to graph numbering */ + int *degree, /* degrees of vertices in graph */ int using_ewgts /* are edge weights being used? */ ) { struct vtx_data *subgptr = NULL; /* loops through subgraph */ - float * fptr = NULL; /* loops through edge weights */ - int * iptr = NULL; /* loops through edge list */ + float *fptr = NULL; /* loops through edge weights */ + int *iptr = NULL; /* loops through edge list */ float tempwgt; /* weight of vertex being swapped */ double ewgtsum; /* sum of weights of subgraph edges */ int subnedges; /* number of edges in subgraph */ @@ -83,14 +83,14 @@ void make_subgraph(struct vtx_data **graph, /* graph data structure */ /* Undo the construction of the subgraph. */ void remake_graph(struct vtx_data **subgraph, /* subgraph data structure */ int subnvtxs, /* number of vtxs in subgraph */ - int * loc2glob, /* mapping from subgraph to graph numbering */ - int * degree, /* degrees of vertices in graph */ + int *loc2glob, /* mapping from subgraph to graph numbering */ + int *degree, /* degrees of vertices in graph */ int using_ewgts /* are edge weights being used? */ ) { struct vtx_data *subgptr; /* loops through subgraph */ - float * fptr; /* loops through edge weights */ - int * iptr; /* loops through adjacency list */ + float *fptr; /* loops through edge weights */ + int *iptr; /* loops through adjacency list */ double ewgtsum; /* sum of weights of subgraph edges */ int nedges; /* vertex degree in subgraph */ int i, j; /* loop counter */ diff --git a/packages/seacas/libraries/chaco/inertial/make_subgeom.c b/packages/seacas/libraries/chaco/inertial/make_subgeom.c index dc4c8673be..cee7fe5f77 100644 --- a/packages/seacas/libraries/chaco/inertial/make_subgeom.c +++ b/packages/seacas/libraries/chaco/inertial/make_subgeom.c @@ -10,7 +10,7 @@ void make_subgeom(int igeom, /* 1, 2 or 3 dimensional geometry? */ float **coords, /* x, y and z coordinates of vertices */ float **subcoords, /* x, y and z coordinates in subgraph */ int subnvtxs, /* number of vertices in subgraph */ - int * loc2glob /* maps from subgraph to graph numbering */ + int *loc2glob /* maps from subgraph to graph numbering */ ) { int i; /* loop counter */ diff --git a/packages/seacas/libraries/chaco/input/read_params.c b/packages/seacas/libraries/chaco/input/read_params.c index a4b4150efc..d11322bfbe 100644 --- a/packages/seacas/libraries/chaco/input/read_params.c +++ b/packages/seacas/libraries/chaco/input/read_params.c @@ -191,58 +191,57 @@ void read_params(FILE *pfile /* file with new user parameters */ &LANCZOS_TIME, &TIME_KERNELS, &HEAVY_MATCH, &EXPERT, &OUT_ASSIGN_INV, &IN_ASSIGN_INV, &VERTEX_SEPARATOR, &VERTEX_COVER, &FLATTEN, &CONNECTED_DOMAINS}; - static char *ipnames[] = { /* names of integer parameters */ - "ECHO", - "NSQRTS", - "ARCHITECTURE", - "LANCZOS_SO_INTERVAL", - "LANCZOS_MAXITNS", - "MAPPING_TYPE", - "COARSE_NLEVEL_RQI", - "KL_METRIC", - "KL_NTRIES_BAD", - "KL_BAD_MOVES", - "COARSE_NLEVEL_KL", - "NPERTURB", - "OPT3D_NTRIES", - "DEBUG_CONNECTED", - "DEBUG_PERTURB", - "DEBUG_ASSIGN", - "DEBUG_INERTIAL", - "DEBUG_OPTIMIZE", - "DEBUG_BPMATCH", - "DEBUG_COARSEN", - "DEBUG_EVECS", - "DEBUG_KL", - "DEBUG_MEMORY", - "DEBUG_INPUT", - "DEBUG_PARAMS", - "DEBUG_TRACE", - "WARNING_EVECS", - "OUTPUT_TIME", - "OUTPUT_METRICS", - "SIMULATION_ITNS", - "DEBUG_SIMULATOR", - "LANCZOS_CONVERGENCE_MODE", - "RQI_CONVERGENCE_MODE", - "REFINE_PARTITION", - "INTERNAL_VERTICES", - "LANCZOS_TYPE", - "MATCH_TYPE", - "DEBUG_INTERNAL", - "DEBUG_REFINE_PART", - "DEBUG_REFINE_MAP", - "DEBUG_MACH_PARAMS", - "DEBUG_COVER", - "LANCZOS_SO_PRECISION", - "COARSE_KLV", - "COARSE_BPM", - "KL_MAX_PASS", + static char *ipnames[] = {/* names of integer parameters */ + "ECHO", + "NSQRTS", + "ARCHITECTURE", + "LANCZOS_SO_INTERVAL", + "LANCZOS_MAXITNS", + "MAPPING_TYPE", + "COARSE_NLEVEL_RQI", + "KL_METRIC", + "KL_NTRIES_BAD", + "KL_BAD_MOVES", + "COARSE_NLEVEL_KL", + "NPERTURB", + "OPT3D_NTRIES", + "DEBUG_CONNECTED", + "DEBUG_PERTURB", + "DEBUG_ASSIGN", + "DEBUG_INERTIAL", + "DEBUG_OPTIMIZE", + "DEBUG_BPMATCH", + "DEBUG_COARSEN", + "DEBUG_EVECS", + "DEBUG_KL", + "DEBUG_MEMORY", + "DEBUG_INPUT", + "DEBUG_PARAMS", + "DEBUG_TRACE", + "WARNING_EVECS", + "OUTPUT_TIME", + "OUTPUT_METRICS", + "SIMULATION_ITNS", + "DEBUG_SIMULATOR", + "LANCZOS_CONVERGENCE_MODE", + "RQI_CONVERGENCE_MODE", + "REFINE_PARTITION", + "INTERNAL_VERTICES", + "LANCZOS_TYPE", + "MATCH_TYPE", + "DEBUG_INTERNAL", + "DEBUG_REFINE_PART", + "DEBUG_REFINE_MAP", + "DEBUG_MACH_PARAMS", + "DEBUG_COVER", + "LANCZOS_SO_PRECISION", + "COARSE_KLV", + "COARSE_BPM", + "KL_MAX_PASS", #if 0 , "PROJECTION_AXIS", #endif - NULL - }; + NULL}; static int *iparams[] = {/* pointers to integer parameters */ &ECHO, diff --git a/packages/seacas/libraries/chaco/internal/check_internal.c b/packages/seacas/libraries/chaco/internal/check_internal.c index d71ee9cd33..edf9d6feae 100644 --- a/packages/seacas/libraries/chaco/internal/check_internal.c +++ b/packages/seacas/libraries/chaco/internal/check_internal.c @@ -13,11 +13,11 @@ void check_internal(struct vtx_data **graph, /* graph data structure */ int nvtxs, /* number of vertices in graph */ - struct bidint * int_list, /* sorted list of internal weights per set */ - struct bidint * set_list, /* head of vtx_elems lists */ - struct bidint * vtx_elems, /* start of vertex data */ - int * total_vwgt, /* total weight in each set */ - int * assign, /* current assignment */ + struct bidint *int_list, /* sorted list of internal weights per set */ + struct bidint *set_list, /* head of vtx_elems lists */ + struct bidint *vtx_elems, /* start of vertex data */ + int *total_vwgt, /* total weight in each set */ + int *assign, /* current assignment */ int nsets_tot /* total number of sets */ ) { diff --git a/packages/seacas/libraries/chaco/internal/improve_internal.c b/packages/seacas/libraries/chaco/internal/improve_internal.c index 5c9f724a9d..21d51b7784 100644 --- a/packages/seacas/libraries/chaco/internal/improve_internal.c +++ b/packages/seacas/libraries/chaco/internal/improve_internal.c @@ -13,17 +13,17 @@ int improve_internal(struct vtx_data **graph, /* graph data structure */ int nvtxs, /* number of vertices in graph */ - int * assign, /* current assignment */ - double * goal, /* desired set sizes */ - struct bidint * int_list, /* sorted list of internal vtx values */ - struct bidint * set_list, /* headers of vtx_elems lists */ - struct bidint * vtx_elems, /* lists of vtxs in each set */ + int *assign, /* current assignment */ + double *goal, /* desired set sizes */ + struct bidint *int_list, /* sorted list of internal vtx values */ + struct bidint *set_list, /* headers of vtx_elems lists */ + struct bidint *vtx_elems, /* lists of vtxs in each set */ int set1, /* set to try to improve */ - int * locked, /* indicates vertices not allowed to move */ - int * nlocked, /* number of vertices that can't move */ + int *locked, /* indicates vertices not allowed to move */ + int *nlocked, /* number of vertices that can't move */ int using_ewgts, /* are edge weights being used? */ int vwgt_max, /* largest vertex weight */ - int * total_vwgt /* total vertex weight in each set */ + int *total_vwgt /* total vertex weight in each set */ ) { struct bidint *move_list; /* list of vertices changing sets */ diff --git a/packages/seacas/libraries/chaco/klspiff/bilistops.c b/packages/seacas/libraries/chaco/klspiff/bilistops.c index 74a498aa33..1118260c5f 100644 --- a/packages/seacas/libraries/chaco/klspiff/bilistops.c +++ b/packages/seacas/libraries/chaco/klspiff/bilistops.c @@ -12,7 +12,7 @@ /* Note: bi-directional lists aren't assumed to be sorted. */ void add2bilist( /* add val to unsorted list */ - struct bilist * lptr, /* element to add */ + struct bilist *lptr, /* element to add */ struct bilist **list /* list added to */ ) { @@ -24,7 +24,7 @@ void add2bilist( /* add val to unsorted list */ *list = lptr; } -void removebilist(struct bilist * lptr, /* ptr to element to remove */ +void removebilist(struct bilist *lptr, /* ptr to element to remove */ struct bilist **list /* head of list to remove it from */ ) @@ -41,7 +41,7 @@ void removebilist(struct bilist * lptr, /* ptr to element to remove */ } } -void movebilist(struct bilist * lptr, /* ptr to element to move */ +void movebilist(struct bilist *lptr, /* ptr to element to move */ struct bilist **oldlist, /* head of list to remove it from */ struct bilist **newlist /* head of list to add it to */ ) diff --git a/packages/seacas/libraries/chaco/klspiff/compress_ewgts.c b/packages/seacas/libraries/chaco/klspiff/compress_ewgts.c index 6867c41782..64e286728b 100644 --- a/packages/seacas/libraries/chaco/klspiff/compress_ewgts.c +++ b/packages/seacas/libraries/chaco/klspiff/compress_ewgts.c @@ -20,10 +20,10 @@ void compress_ewgts(struct vtx_data **graph, /* list of graph info for each ) { extern double EWGT_RATIO_MAX; /* max allowed ewgt/nvtxs */ - float * old_ewptr; /* loops through old edge weights */ - float * new_ewptr; /* loops through old edge weights */ - float * self_ptr; /* points to self edge in new_ewgts */ - float * new_ewgts; /* space for new edge weights */ + float *old_ewptr; /* loops through old edge weights */ + float *new_ewptr; /* loops through old edge weights */ + float *self_ptr; /* points to self edge in new_ewgts */ + float *new_ewgts; /* space for new edge weights */ int ewgt; /* new edge weight value */ double sum; /* sum of all the new edge weights */ double ratio; /* amount to reduce edge weights */ diff --git a/packages/seacas/libraries/chaco/klspiff/count_weights.c b/packages/seacas/libraries/chaco/klspiff/count_weights.c index 1ee5052e2c..166680951e 100644 --- a/packages/seacas/libraries/chaco/klspiff/count_weights.c +++ b/packages/seacas/libraries/chaco/klspiff/count_weights.c @@ -10,9 +10,9 @@ void count_weights(struct vtx_data **graph, /* data structure for graph */ int nvtxs, /* number of vtxs in graph */ - int * sets, /* set each vertex is assigned to */ + int *sets, /* set each vertex is assigned to */ int nsets, /* number of sets in this division */ - double * weights, /* vertex weights in each set */ + double *weights, /* vertex weights in each set */ int using_vwgts /* are vertex weights being used? */ ) diff --git a/packages/seacas/libraries/chaco/klspiff/make_bndy_list.c b/packages/seacas/libraries/chaco/klspiff/make_bndy_list.c index a45e7d8ec5..4bdbfe024e 100644 --- a/packages/seacas/libraries/chaco/klspiff/make_bndy_list.c +++ b/packages/seacas/libraries/chaco/klspiff/make_bndy_list.c @@ -11,14 +11,14 @@ #include // for NULL void make_bndy_list(struct vtx_data **graph, /* data structure for graph */ - struct bilist * movelist, /* list of vtxs to be moved */ + struct bilist *movelist, /* list of vtxs to be moved */ struct bilist ****buckets, /* array of lists for bucket sort */ - struct bilist ** listspace, /* list data structure for each vertex */ - int * sets, /* processor each vertex is assigned to */ + struct bilist **listspace, /* list data structure for each vertex */ + int *sets, /* processor each vertex is assigned to */ int nsets, /* number of sets divided into */ - int * bspace, /* list of active vertices for bucketsort */ - int ** tops, /* top of each set of buckets */ - int ** bndy_list /* list of boundary vertices returned */ + int *bspace, /* list of active vertices for bucketsort */ + int **tops, /* top of each set of buckets */ + int **bndy_list /* list of boundary vertices returned */ ) { struct bilist *bptr; /* loops through bspace */ diff --git a/packages/seacas/libraries/chaco/klvspiff/clear_dvals.c b/packages/seacas/libraries/chaco/klvspiff/clear_dvals.c index e7e53727f0..4d37260c04 100644 --- a/packages/seacas/libraries/chaco/klvspiff/clear_dvals.c +++ b/packages/seacas/libraries/chaco/klvspiff/clear_dvals.c @@ -10,9 +10,9 @@ void clear_dvals(struct vtx_data **graph, /* data structure for graph */ int nvtxs, /* number of vtxs in graph */ - int * ldvals, /* d-values for each transition */ - int * rdvals, /* d-values for each transition */ - int * bspace, /* list of activated vertices */ + int *ldvals, /* d-values for each transition */ + int *rdvals, /* d-values for each transition */ + int *bspace, /* list of activated vertices */ int list_length /* number of activated vertices */ ) { diff --git a/packages/seacas/libraries/chaco/klvspiff/countup_vtx_sep.c b/packages/seacas/libraries/chaco/klvspiff/countup_vtx_sep.c index 8683509bb8..b2b011c992 100644 --- a/packages/seacas/libraries/chaco/klvspiff/countup_vtx_sep.c +++ b/packages/seacas/libraries/chaco/klvspiff/countup_vtx_sep.c @@ -11,7 +11,7 @@ void countup_vtx_sep(struct vtx_data **graph, /* list of graph info for each vertex */ int nvtxs, /* number of vertices in graph */ - int * sets /* local partitioning of vtxs */ + int *sets /* local partitioning of vtxs */ ) { int vtx, set; /* vertex and set in graph */ diff --git a/packages/seacas/libraries/chaco/klvspiff/find_bndy.c b/packages/seacas/libraries/chaco/klvspiff/find_bndy.c index 97744b3f39..205b21018b 100644 --- a/packages/seacas/libraries/chaco/klvspiff/find_bndy.c +++ b/packages/seacas/libraries/chaco/klvspiff/find_bndy.c @@ -14,9 +14,9 @@ int find_bndy(struct vtx_data **graph, /* array of vtx data for graph */ int nvtxs, /* number of vertices in graph */ - int * assignment, /* processor each vertex gets assigned to */ + int *assignment, /* processor each vertex gets assigned to */ int new_val, /* assignment value for boundary vtxs */ - int ** pbndy_list /* returned list, end with zero */ + int **pbndy_list /* returned list, end with zero */ ) { int *bndy_list; /* returned list, end with zero */ @@ -55,10 +55,10 @@ int find_bndy(struct vtx_data **graph, /* array of vtx data for graph */ int find_side_bndy(struct vtx_data **graph, /* array of vtx data for graph */ int nvtxs, /* number of vertices in graph */ - int * assignment, /* processor each vertex gets assigned to */ + int *assignment, /* processor each vertex gets assigned to */ int side, /* side to take vertices from */ int new_val, /* assignment value for boundary vtxs */ - int ** pbndy_list /* returned list, end with zero */ + int **pbndy_list /* returned list, end with zero */ ) { diff --git a/packages/seacas/libraries/chaco/klvspiff/klv_init.c b/packages/seacas/libraries/chaco/klvspiff/klv_init.c index 9eff7e29f3..e1daf03f1e 100644 --- a/packages/seacas/libraries/chaco/klvspiff/klv_init.c +++ b/packages/seacas/libraries/chaco/klvspiff/klv_init.c @@ -12,10 +12,10 @@ int klv_init(struct bilist ***lbucket_ptr, /* space for left bucket sorts */ struct bilist ***rbucket_ptr, /* space for right bucket sorts */ - struct bilist ** llistspace, /* space for elements of linked lists */ - struct bilist ** rlistspace, /* space for elements of linked lists */ - int ** ldvals, /* change in separator for left moves */ - int ** rdvals, /* change in separator for right moves */ + struct bilist **llistspace, /* space for elements of linked lists */ + struct bilist **rlistspace, /* space for elements of linked lists */ + int **ldvals, /* change in separator for left moves */ + int **rdvals, /* change in separator for right moves */ int nvtxs, /* number of vertices in the graph */ int maxchange /* maximum change by moving a vertex */ ) diff --git a/packages/seacas/libraries/chaco/klvspiff/make_bpgraph.c b/packages/seacas/libraries/chaco/klvspiff/make_bpgraph.c index 5cb15791c8..8ed67e1970 100644 --- a/packages/seacas/libraries/chaco/klvspiff/make_bpgraph.c +++ b/packages/seacas/libraries/chaco/klvspiff/make_bpgraph.c @@ -13,16 +13,16 @@ /* Make a bipartite graph from vertex separator and neighbors. */ void make_bpgraph(struct vtx_data **graph, /* list of graph info for each vertex */ - int * sets, /* local partitioning of vtxs */ - int * bndy_list, /* list of vertices on boundary (0 ends) */ + int *sets, /* local partitioning of vtxs */ + int *bndy_list, /* list of vertices on boundary (0 ends) */ int sep_size, /* length of bndy_list */ int set_match, /* side to match against */ - int ** ppointers, /* start/stop of adjacency lists */ - int ** pindices, /* adjacency list for each vertex */ - int ** pvweight, /* weight of each vertex */ - int ** ploc2glob, /* maps bp number to full graph */ - int * pnleft, /* number of nodes in left half */ - int * pnright, /* number of nodes in right half */ + int **ppointers, /* start/stop of adjacency lists */ + int **pindices, /* adjacency list for each vertex */ + int **pvweight, /* weight of each vertex */ + int **ploc2glob, /* maps bp number to full graph */ + int *pnleft, /* number of nodes in left half */ + int *pnright, /* number of nodes in right half */ int using_vwgts /* are vertices weighted? */ ) { diff --git a/packages/seacas/libraries/chaco/main/user_params.c b/packages/seacas/libraries/chaco/main/user_params.c index c46f222937..977b23345e 100644 --- a/packages/seacas/libraries/chaco/main/user_params.c +++ b/packages/seacas/libraries/chaco/main/user_params.c @@ -8,7 +8,7 @@ #include "params.h" // for NAME_LENGTH -#define TRUE 1 +#define TRUE 1 #define FALSE 0 /* Input and output control parameters */ @@ -96,7 +96,7 @@ long RANDOM_SEED = 7654321L; /* Seed for random number gen int NSQRTS = 1000; /* # square roots to precompute if coarsening */ int MAKE_VWGTS = FALSE; /* Make vtx weights degrees+1? (TRUE/FALSE) */ int FREE_GRAPH = TRUE; /* Free input graph data? (TRUE/FALSE) */ -char * PARAMS_FILENAME = "User_Params"; /* File of parameter changes */ +char *PARAMS_FILENAME = "User_Params"; /* File of parameter changes */ /* Parameters that control debugging output */ diff --git a/packages/seacas/libraries/chaco/misc/count.c b/packages/seacas/libraries/chaco/misc/count.c index 686e96593e..2d1fbdee9d 100644 --- a/packages/seacas/libraries/chaco/misc/count.c +++ b/packages/seacas/libraries/chaco/misc/count.c @@ -13,7 +13,7 @@ void count(struct vtx_data **graph, /* graph data structure */ int nvtxs, /* number of vtxs in graph */ - int * sets, /* processor each vertex is assigned to */ + int *sets, /* processor each vertex is assigned to */ int nsets, /* number of sets partitioned into */ int (*hops)[MAXSETS], /* hops metric between sets */ int dump, /* flag for extended output */ diff --git a/packages/seacas/libraries/chaco/misc/countup_cube.c b/packages/seacas/libraries/chaco/misc/countup_cube.c index cfc4f6ae67..8e51be149e 100644 --- a/packages/seacas/libraries/chaco/misc/countup_cube.c +++ b/packages/seacas/libraries/chaco/misc/countup_cube.c @@ -15,11 +15,11 @@ void countup_cube(struct vtx_data **graph, /* graph data structure */ int nvtxs, /* number of vtxs in graph */ - int * assignment, /* set number of each vtx (length nvtxs+1) */ + int *assignment, /* set number of each vtx (length nvtxs+1) */ int ndims, /* number of cuts at each level */ int ndims_tot, /* total number of divisions of graph */ int print_lev, /* level of output */ - FILE * outfile, /* output file if not NULL */ + FILE *outfile, /* output file if not NULL */ int using_ewgts /* are edge weights being used? */ ) { @@ -28,7 +28,7 @@ void countup_cube(struct vtx_data **graph, /* graph data structure */ int nsets = (1 << ndims_tot); double *cutsize = smalloc(nsets * sizeof(double)); double *hopsize = smalloc(nsets * sizeof(double)); - int * setsize = smalloc(nsets * sizeof(int)); + int *setsize = smalloc(nsets * sizeof(int)); int *setseen = smalloc(nsets * sizeof(int)); int *startptr = smalloc((nsets + 1) * sizeof(int)); diff --git a/packages/seacas/libraries/chaco/misc/countup_mesh.c b/packages/seacas/libraries/chaco/misc/countup_mesh.c index 065273fe26..5bd1fe1128 100644 --- a/packages/seacas/libraries/chaco/misc/countup_mesh.c +++ b/packages/seacas/libraries/chaco/misc/countup_mesh.c @@ -15,19 +15,19 @@ void countup_mesh(struct vtx_data **graph, /* graph data structure */ int nvtxs, /* number of vtxs in graph */ - int * assignment, /* set number of each vtx (length nvtxs+1) */ + int *assignment, /* set number of each vtx (length nvtxs+1) */ int mesh_dims[3], /* extent of mesh in each dimension */ int print_lev, /* level of output */ - FILE * outfile, /* output file if not NULL */ + FILE *outfile, /* output file if not NULL */ int using_ewgts /* are edge weights being used? */ ) { double *hopsize; /* number of hops for each set */ double *cutsize; /* number of cuts for each set */ - int * setsize; /* number or weight of vtxs in each set */ - int * setseen; /* flags for sets adjacent to a particular set */ - int * inorder; /* list of vtxs in each set */ - int * startptr; /* indices into inorder array */ + int *setsize; /* number or weight of vtxs in each set */ + int *setseen; /* flags for sets adjacent to a particular set */ + int *inorder; /* list of vtxs in each set */ + int *startptr; /* indices into inorder array */ double ncuts; /* total number of edges connecting sets */ double nhops; /* total cuts weighted by mesh hops */ double ewgt; /* edge weight */ diff --git a/packages/seacas/libraries/chaco/misc/define_submeshes.c b/packages/seacas/libraries/chaco/misc/define_submeshes.c index 4d532fb0b8..8643091db7 100644 --- a/packages/seacas/libraries/chaco/misc/define_submeshes.c +++ b/packages/seacas/libraries/chaco/misc/define_submeshes.c @@ -14,13 +14,13 @@ /* Figure out how to divide mesh into pieces. Return true if nonstandard. */ int define_submeshes(int nsets, /* number of subsets in this partition */ int cube_or_mesh, /* 0=> hypercube, d=> d-dimensional mesh */ - int * mesh_dims, /* shape of mesh */ + int *mesh_dims, /* shape of mesh */ struct set_info *set, /* set data for set I'm partitioning */ struct set_info *set_info, /* set data for all sets */ - int * subsets, /* subsets being created by partition */ + int *subsets, /* subsets being created by partition */ int inert, /* using inertial method? */ - int * striping, /* should I partition with parallel cuts? */ - int * dir, /* directions of each cut */ + int *striping, /* should I partition with parallel cuts? */ + int *dir, /* directions of each cut */ int hop_mtx_special[MAXSETS][MAXSETS] /* hops values if unusual */ ) { diff --git a/packages/seacas/libraries/chaco/misc/find_maxdeg.c b/packages/seacas/libraries/chaco/misc/find_maxdeg.c index 328fc693f8..06558891c0 100644 --- a/packages/seacas/libraries/chaco/misc/find_maxdeg.c +++ b/packages/seacas/libraries/chaco/misc/find_maxdeg.c @@ -13,7 +13,7 @@ double find_maxdeg(struct vtx_data **graph, /* graph data structure */ int nvtxs, /* number of vertices */ int using_ewgts, /* are edge weights being used? */ - float * pmax_ewgt /* returns largest edge weight if not NULL */ + float *pmax_ewgt /* returns largest edge weight if not NULL */ ) { double maxdeg; /* maximum degree of a vertex */ diff --git a/packages/seacas/libraries/chaco/misc/merge_goals.c b/packages/seacas/libraries/chaco/misc/merge_goals.c index b4cc80414e..34510d8c80 100644 --- a/packages/seacas/libraries/chaco/misc/merge_goals.c +++ b/packages/seacas/libraries/chaco/misc/merge_goals.c @@ -9,10 +9,10 @@ #include "structs.h" /* Combine goals of collections of processors for next division. */ -void merge_goals(double * goal, /* desired set sizes */ - double * merged_goal, /* sizes of sets at this partition level */ +void merge_goals(double *goal, /* desired set sizes */ + double *merged_goal, /* sizes of sets at this partition level */ struct set_info *set_info, /* information about all sets */ - int * subsets, /* set numbers of processors to merge */ + int *subsets, /* set numbers of processors to merge */ int nsets, /* number of sets created by this division */ int ndims_tot, /* total number of dimensions in the hypercube */ int cube_or_mesh, /* 0=> hypercube, d=> d-dimensional mesh */ diff --git a/packages/seacas/libraries/chaco/misc/timing.c b/packages/seacas/libraries/chaco/misc/timing.c index 5e881967c6..a4b063da11 100644 --- a/packages/seacas/libraries/chaco/misc/timing.c +++ b/packages/seacas/libraries/chaco/misc/timing.c @@ -55,7 +55,7 @@ double sim_time = 0; void time_out(FILE *outfile /* file to print output to */ ) { - FILE * tempfile; /* file name for two passes */ + FILE *tempfile; /* file name for two passes */ extern int ECHO; /* parameter for different output styles */ extern int OUTPUT_TIME; /* how much timing output should I print? */ double time_tol; /* tolerance for ignoring time */ diff --git a/packages/seacas/libraries/chaco/refine_map/compute_cube_vdata.c b/packages/seacas/libraries/chaco/refine_map/compute_cube_vdata.c index acc2c0366d..d38ae94e40 100644 --- a/packages/seacas/libraries/chaco/refine_map/compute_cube_vdata.c +++ b/packages/seacas/libraries/chaco/refine_map/compute_cube_vdata.c @@ -10,10 +10,10 @@ #include "structs.h" // for vtx_data void compute_cube_vdata(struct refine_vdata *vdata, /* preference data for a vertex */ - struct vtx_data ** comm_graph, /* communication graph data structure */ + struct vtx_data **comm_graph, /* communication graph data structure */ int vtx, /* current vertex */ int mask, /* bit set in current hypercube dimension */ - int * vtx2node /* maps graph vtxs to mesh nodes */ + int *vtx2node /* maps graph vtxs to mesh nodes */ ) { float same; /* my preference to stay where I am */ diff --git a/packages/seacas/libraries/chaco/refine_map/compute_mesh_vdata.c b/packages/seacas/libraries/chaco/refine_map/compute_mesh_vdata.c index ba89c92d1c..20d54f1d83 100644 --- a/packages/seacas/libraries/chaco/refine_map/compute_mesh_vdata.c +++ b/packages/seacas/libraries/chaco/refine_map/compute_mesh_vdata.c @@ -10,9 +10,9 @@ #include "structs.h" // for vtx_data void compute_mesh_vdata(struct refine_vdata *vdata, /* preference data for a vertex */ - struct vtx_data ** comm_graph, /* communication graph data structure */ + struct vtx_data **comm_graph, /* communication graph data structure */ int vtx, /* current vertex */ - int * vtx2node, /* maps graph vtxs to mesh nodes */ + int *vtx2node, /* maps graph vtxs to mesh nodes */ int mesh_dims[3], /* size of mesh */ int dim /* dimension we are currently working in */ ) diff --git a/packages/seacas/libraries/chaco/refine_map/find_edge_mesh.c b/packages/seacas/libraries/chaco/refine_map/find_edge_mesh.c index ef9d70e2d3..f1d71c77c4 100644 --- a/packages/seacas/libraries/chaco/refine_map/find_edge_mesh.c +++ b/packages/seacas/libraries/chaco/refine_map/find_edge_mesh.c @@ -13,8 +13,8 @@ struct refine_edata * find_edge_mesh(int vertex, /* vertex in comm_graph */ int dim, /* direction of edge from node */ struct refine_edata *edata, /* data structure for edge preferences */ - int * mesh_dims, /* dimensions of mesh */ - int * vtx2node /* maps comm_graph vtxs to processors */ + int *mesh_dims, /* dimensions of mesh */ + int *vtx2node /* maps comm_graph vtxs to processors */ ) { struct refine_edata *eguy; /* returned pointer to edge info */ diff --git a/packages/seacas/libraries/chaco/refine_part/make_maps_ref.c b/packages/seacas/libraries/chaco/refine_part/make_maps_ref.c index f4c06dad40..6084c11ed6 100644 --- a/packages/seacas/libraries/chaco/refine_part/make_maps_ref.c +++ b/packages/seacas/libraries/chaco/refine_part/make_maps_ref.c @@ -11,10 +11,10 @@ /* Set up data structures for refine_part. */ void make_maps_ref(struct vtx_data **graph, /* graph data structure */ - struct bilist * set_list, /* lists of vertices in each set */ - struct bilist * vtx_elems, /* start of storage for vertices */ - int * assignment, /* set assignments for graph */ - int * sub_assign, /* assignment file for subgraph */ + struct bilist *set_list, /* lists of vertices in each set */ + struct bilist *vtx_elems, /* start of storage for vertices */ + int *assignment, /* set assignments for graph */ + int *sub_assign, /* assignment file for subgraph */ int set1, int set2, /* set value denoting subgraph */ int *glob2loc, /* graph -> subgraph numbering map */ int *loc2glob, /* subgraph -> graph numbering map */ diff --git a/packages/seacas/libraries/chaco/refine_part/make_terms_ref.c b/packages/seacas/libraries/chaco/refine_part/make_terms_ref.c index 2f1c8cc49f..9b26a54cf0 100644 --- a/packages/seacas/libraries/chaco/refine_part/make_terms_ref.c +++ b/packages/seacas/libraries/chaco/refine_part/make_terms_ref.c @@ -13,9 +13,9 @@ void make_terms_ref(struct vtx_data **graph, /* data structure for graph */ int using_ewgts, /* are edge weights being used? */ int subnvtxs, /* number of vtxs in subgraph */ - int * loc2glob, /* mapping from subgraph to graph */ + int *loc2glob, /* mapping from subgraph to graph */ int set0, int set1, /* two processors I'm choosing between */ - int * assignment, /* set for each vertex */ + int *assignment, /* set for each vertex */ int architecture, /* 0 => hypercube, 1 => mesh */ int mesh_dims[3], /* if mesh, size of mesh */ float *term_wgts[] /* terminal weights for each vertex */ diff --git a/packages/seacas/libraries/chaco/util/array_alloc_2D.c b/packages/seacas/libraries/chaco/util/array_alloc_2D.c index 38243e62ff..c3052ab26b 100644 --- a/packages/seacas/libraries/chaco/util/array_alloc_2D.c +++ b/packages/seacas/libraries/chaco/util/array_alloc_2D.c @@ -21,9 +21,9 @@ void *array_alloc_2D_ret(size_t dim1, size_t dim2, size_t size) size_t total; /* Total size of the array */ size_t aligned_dim; /* dim1 or dim1+1 to ensure data alignment */ size_t offset; /* offset of array elements */ - char * field; /* The multi-dimensional array */ + char *field; /* The multi-dimensional array */ char **ptr; /* Pointer offset */ - char * data; /* Data offset */ + char *data; /* Data offset */ size_t j; /* loop counter */ aligned_dim = (dim1 % 2) ? dim1 + 1 : dim1; diff --git a/packages/seacas/libraries/chaco/util/machine_params.c b/packages/seacas/libraries/chaco/util/machine_params.c index 1b1cb4eb6d..feb1da2538 100644 --- a/packages/seacas/libraries/chaco/util/machine_params.c +++ b/packages/seacas/libraries/chaco/util/machine_params.c @@ -74,6 +74,6 @@ void machine_params(double *double_epsilon, double *double_max) */ *double_max = max; #else - *double_max = DBL_MAX; + *double_max = DBL_MAX; #endif } diff --git a/packages/seacas/libraries/chaco/util/smalloc.c b/packages/seacas/libraries/chaco/util/smalloc.c index 1fa112c2a0..9a4cca9274 100644 --- a/packages/seacas/libraries/chaco/util/smalloc.c +++ b/packages/seacas/libraries/chaco/util/smalloc.c @@ -19,7 +19,7 @@ static struct smalloc_debug_data { int order; /* which smalloc call is it? */ size_t size; /* size of malloc invocation */ - double * ptr; /* memory location returned */ + double *ptr; /* memory location returned */ struct smalloc_debug_data *next; /* pointer to next element */ } *top = NULL; @@ -38,7 +38,7 @@ void *smalloc(size_t n) { extern FILE *Output_File; /* output file or null */ extern int DEBUG_MEMORY; /* use debug memory allocator? */ - void * ptr; /* return value */ + void *ptr; /* return value */ struct smalloc_debug_data *new; /* data structure for malloc data */ void bail(char *msg, int status); @@ -87,7 +87,7 @@ void *smalloc_ret(size_t n) { extern FILE *Output_File; /* output file or null */ extern int DEBUG_MEMORY; /* use debug memory allocator? */ - void * ptr; /* return value */ + void *ptr; /* return value */ struct smalloc_debug_data *new; /* data structure for malloc data */ void bail(char *msg, int status); @@ -138,8 +138,8 @@ void *smalloc_ret(size_t n) /* Safe version of realloc */ void *srealloc(void *ptr, size_t n) { - extern FILE * Output_File; /* output file or null */ - void * p; /* returned pointer */ + extern FILE *Output_File; /* output file or null */ + void *p; /* returned pointer */ extern int DEBUG_MEMORY; /* use debug memory allocator? */ struct smalloc_debug_data *dbptr; /* loops through debug list */ void bail(char *msg, int status); @@ -187,8 +187,8 @@ void *srealloc(void *ptr, size_t n) /* Returns instead of dying if it fails. */ void *srealloc_ret(void *ptr, size_t n) { - extern FILE * Output_File; /* output file or null */ - void * p; /* returned pointer */ + extern FILE *Output_File; /* output file or null */ + void *p; /* returned pointer */ extern int DEBUG_MEMORY; /* use debug memory allocator? */ struct smalloc_debug_data *dbptr; /* loops through debug list */ @@ -234,9 +234,9 @@ void *srealloc_ret(void *ptr, size_t n) /* Safe version of free. */ void sfree(void *ptr) { - extern FILE * Output_File; /* output file or null */ + extern FILE *Output_File; /* output file or null */ extern int DEBUG_MEMORY; /* use debug memory allocator? */ - struct smalloc_debug_data * dbptr; /* loops through debug list */ + struct smalloc_debug_data *dbptr; /* loops through debug list */ struct smalloc_debug_data **prev; /* holds previous pointer */ if (DEBUG_MEMORY > 1) { diff --git a/packages/seacas/libraries/exodus_for/src/exo_jack.c b/packages/seacas/libraries/exodus_for/src/exo_jack.c index ce4c2ce4a2..af02b4700e 100644 --- a/packages/seacas/libraries/exodus_for/src/exo_jack.c +++ b/packages/seacas/libraries/exodus_for/src/exo_jack.c @@ -76,7 +76,7 @@ #endif /* 64 vs 32 bit build */ #if defined(Build64) -static int *i8i4(int64_t size, const int64_t *i8) +static int *i8i4(int64_t size, const int64_t *i8) { int *i4 = malloc(size * sizeof(int)); for (int64_t i = 0; i < size; i++) { @@ -85,7 +85,7 @@ static int *i8i4(int64_t size, const int64_t *i8) return i4; } -static void i4i8(int64_t size, const int *i4, int64_t *i8) +static void i4i8(int64_t size, const int *i4, int64_t *i8) { for (int64_t i = 0; i < size; i++) { i8[i] = i4[i]; @@ -522,8 +522,8 @@ void F2C(exginf, EXGINF)(int *idexo, char *info, int *ierr, int infolen) for (i = 0; i < num_info; i++) { /* Put pointers to the info records in ptr * array */ *(aptr + i) = sptr + i * (slen + 1); - } /* put ptr in string ptr - * array */ + } /* put ptr in string ptr + * array */ *(aptr + i) = NULL; /* null out last pointer */ /* Do exodus call to get info records */ @@ -859,7 +859,7 @@ void F2C(expecpp, EXPECPP)(int *idexo, int *obj_type, entity_id *elem_blk_id, in int *ierr) { ex_block block; - block.id = *elem_blk_id; + block.id = *elem_blk_id; block.type = *obj_type; if (ex_get_block_param(*idexo, &block) == EX_FATAL) { *ierr = EX_FATAL; @@ -888,14 +888,14 @@ void F2C(exgecpp, EXGECPP)(int *idexo, int *obj_type, entity_id *elem_blk_id, in int *ierr) { ex_block block; - block.id = *elem_blk_id; + block.id = *elem_blk_id; block.type = *obj_type; if (ex_get_block_param(*idexo, &block) == EX_FATAL) { *ierr = EX_FATAL; return; } int64_t num_elem_this_blk = block.num_entry; - int *counts4 = malloc(num_elem_this_blk * sizeof(int)); + int *counts4 = malloc(num_elem_this_blk * sizeof(int)); *ierr = ex_get_entity_count_per_polyhedra(*idexo, (ex_entity_type)*obj_type, *elem_blk_id, counts4); i4i8(num_elem_this_blk, counts4, counts); @@ -1329,8 +1329,8 @@ void F2C(exgpn, EXGPN)(int *idexo, int *obj_type, char *prop_names, int *ierr, i int i; for (i = 0; i < num_props; i++) { *(aptr + i) = sptr + i * (slen + 1); - } /* put ptrs to staging space - * into ptr array */ + } /* put ptrs to staging space + * into ptr array */ *(aptr + i) = NULL; /* set last pointer to null */ /* do Exodus C call to get property name records */ @@ -2037,16 +2037,14 @@ void F2C(exgvan, EXGVAN)(int *idexo, char *var_type, int *num_vars, char *var_na * \sa ex_put_truth_table() */ #if Build64 -void F2C(expvtt, EXPVTT)(int *idexo, int *num_entity, int *num_var, int64_t *var_tab, - int *ierr) +void F2C(expvtt, EXPVTT)(int *idexo, int *num_entity, int *num_var, int64_t *var_tab, int *ierr) { int *var_tab4 = i8i4(*num_entity * *num_var, var_tab); - *ierr = ex_put_truth_table(*idexo, EX_ELEM_BLOCK, *num_entity, *num_var, var_tab4); + *ierr = ex_put_truth_table(*idexo, EX_ELEM_BLOCK, *num_entity, *num_var, var_tab4); free(var_tab4); } #else -void F2C(expvtt, EXPVTT)(int *idexo, int *num_entity, int *num_var, int *var_tab, - int *ierr) +void F2C(expvtt, EXPVTT)(int *idexo, int *num_entity, int *num_var, int *var_tab, int *ierr) { *ierr = ex_put_truth_table(*idexo, EX_ELEM_BLOCK, *num_entity, *num_var, var_tab); } @@ -2060,7 +2058,7 @@ void F2C(expvtt, EXPVTT)(int *idexo, int *num_entity, int *num_var, int *var_tab void F2C(expnstt, EXPNSTT)(int *idexo, int *num_entity, int *num_var, int64_t *var_tab, int *ierr) { int *var_tab4 = i8i4(*num_entity * *num_var, var_tab); - *ierr = ex_put_truth_table(*idexo, EX_NODE_SET, *num_entity, *num_var, var_tab4); + *ierr = ex_put_truth_table(*idexo, EX_NODE_SET, *num_entity, *num_var, var_tab4); free(var_tab4); } #else @@ -2078,7 +2076,7 @@ void F2C(expnstt, EXPNSTT)(int *idexo, int *num_entity, int *num_var, int *var_t void F2C(expsstt, EXPSSTT)(int *idexo, int *num_entity, int *num_var, int64_t *var_tab, int *ierr) { int *var_tab4 = i8i4(*num_entity * *num_var, var_tab); - *ierr = ex_put_truth_table(*idexo, EX_SIDE_SET, *num_entity, *num_var, var_tab4); + *ierr = ex_put_truth_table(*idexo, EX_SIDE_SET, *num_entity, *num_var, var_tab4); free(var_tab4); } #else @@ -2093,16 +2091,14 @@ void F2C(expsstt, EXPSSTT)(int *idexo, int *num_entity, int *num_var, int *var_t * \sa ex_get_truth_table() */ #if Build64 -void F2C(exgvtt, EXGVTT)(int *idexo, int *num_entity, int *num_var, int64_t *var_tab, - int *ierr) +void F2C(exgvtt, EXGVTT)(int *idexo, int *num_entity, int *num_var, int64_t *var_tab, int *ierr) { int *var_tab4 = malloc(*num_entity * *num_var * sizeof(int)); - *ierr = ex_get_truth_table(*idexo, EX_ELEM_BLOCK, *num_entity, *num_var, var_tab4); + *ierr = ex_get_truth_table(*idexo, EX_ELEM_BLOCK, *num_entity, *num_var, var_tab4); i4i8(*num_entity * *num_var, var_tab4, var_tab); free(var_tab4); #else -void F2C(exgvtt, EXGVTT)(int *idexo, int *num_entity, int *num_var, int *var_tab, - int *ierr) +void F2C(exgvtt, EXGVTT)(int *idexo, int *num_entity, int *num_var, int *var_tab, int *ierr) { *ierr = ex_get_truth_table(*idexo, EX_ELEM_BLOCK, *num_entity, *num_var, var_tab); #endif @@ -2116,17 +2112,17 @@ void F2C(exgvtt, EXGVTT)(int *idexo, int *num_entity, int *num_var, int *var_tab void F2C(exgnstt, EXGNSTT)(int *idexo, int *num_entity, int *num_var, int64_t *var_tab, int *ierr) { int *var_tab4 = malloc(*num_entity * *num_var * sizeof(int)); - *ierr = ex_get_truth_table(*idexo, EX_NODE_SET, *num_entity, *num_var, var_tab4); + *ierr = ex_get_truth_table(*idexo, EX_NODE_SET, *num_entity, *num_var, var_tab4); i4i8(*num_entity * *num_var, var_tab4, var_tab); free(var_tab4); } #else - void F2C(exgnstt, EXGNSTT)(int *idexo, int *num_entity, int *num_var, int *var_tab, int *ierr) +void F2C(exgnstt, EXGNSTT)(int *idexo, int *num_entity, int *num_var, int *var_tab, int *ierr) { *ierr = ex_get_truth_table(*idexo, EX_NODE_SET, *num_entity, *num_var, var_tab); } #endif - + /*! * read sideset variable truth table * \sa ex_get_truth_table() @@ -2135,17 +2131,17 @@ void F2C(exgnstt, EXGNSTT)(int *idexo, int *num_entity, int *num_var, int64_t *v void F2C(exgsstt, EXGSSTT)(int *idexo, int *num_entity, int *num_var, int64_t *var_tab, int *ierr) { int *var_tab4 = malloc(*num_entity * *num_var * sizeof(int)); - *ierr = ex_get_truth_table(*idexo, EX_SIDE_SET, *num_entity, *num_var, var_tab4); + *ierr = ex_get_truth_table(*idexo, EX_SIDE_SET, *num_entity, *num_var, var_tab4); i4i8(*num_entity * *num_var, var_tab4, var_tab); free(var_tab4); } #else - void F2C(exgsstt, EXGSSTT)(int *idexo, int *num_entity, int *num_var, int *var_tab, int *ierr) +void F2C(exgsstt, EXGSSTT)(int *idexo, int *num_entity, int *num_var, int *var_tab, int *ierr) { *ierr = ex_get_truth_table(*idexo, EX_SIDE_SET, *num_entity, *num_var, var_tab); } #endif - + /*! * write global variable values at time step * \sa ex_put_var() @@ -2440,10 +2436,11 @@ void F2C(exgssn, EXGSSN)(int *idexo, entity_id *side_set_id, void_int *side_set_ * \sa ex_get_side_set_node_count() */ #if Build64 -void F2C(exgssc, EXGSSC)(int *idexo, entity_id *side_set_id, int64_t *side_set_node_cnt_list, int *ierr) +void F2C(exgssc, EXGSSC)(int *idexo, entity_id *side_set_id, int64_t *side_set_node_cnt_list, + int *ierr) { int64_t num_sides_in_set = 0; - int64_t num_df_in_set = 0; + int64_t num_df_in_set = 0; ex_get_set_param(*idexo, EX_SIDE_SET, *side_set_id, &num_sides_in_set, &num_df_in_set); int *cnt_list = malloc(num_sides_in_set * sizeof(int)); @@ -2466,7 +2463,7 @@ void F2C(exgssc, EXGSSC)(int *idexo, entity_id *side_set_id, int *side_set_node_ #if Build64 void F2C(exgcssc, EXGCSSC)(int *idexo, int64_t *side_set_node_cnt_list, int *ierr) { - int count = ex_inquire_int(*idexo, EX_INQ_SS_ELEM_LEN); + int count = ex_inquire_int(*idexo, EX_INQ_SS_ELEM_LEN); int *cnt_list = malloc(count * sizeof(int)); *ierr = ex_get_concat_side_set_node_count(*idexo, cnt_list); @@ -4031,4 +4028,3 @@ void F2C(exppcc, EXPPCC)(int *exoid, void_int *start_node_num, void_int *num_nod ex_err_fn(*exoid, __func__, errmsg, EX_MSG); } } - diff --git a/packages/seacas/libraries/ioss/src/Ioss_CodeTypes.h b/packages/seacas/libraries/ioss/src/Ioss_CodeTypes.h index ea7e67385f..f799bad41f 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_CodeTypes.h +++ b/packages/seacas/libraries/ioss/src/Ioss_CodeTypes.h @@ -48,7 +48,7 @@ inline std::string IOSS_SYM_TENSOR() { return {"sym_tensor_33"}; } #if (__cplusplus >= 201703L) #define IOSS_MAYBE_UNUSED [[maybe_unused]] -#define IOSS_NODISCARD [[nodiscard]] +#define IOSS_NODISCARD [[nodiscard]] #else #define IOSS_MAYBE_UNUSED #define IOSS_NODISCARD diff --git a/packages/seacas/libraries/ioss/src/Ioss_DatabaseIO.h b/packages/seacas/libraries/ioss/src/Ioss_DatabaseIO.h index 1b97760a41..90a83ffe2b 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_DatabaseIO.h +++ b/packages/seacas/libraries/ioss/src/Ioss_DatabaseIO.h @@ -82,7 +82,7 @@ namespace Ioss { * \returns True if database state is OK. False if not. */ IOSS_NODISCARD bool ok(bool write_message = false, std::string *error_message = nullptr, - int *bad_count = nullptr) const + int *bad_count = nullptr) const { IOSS_FUNC_ENTER(m_); return ok_nl(write_message, error_message, bad_count); @@ -172,7 +172,7 @@ namespace Ioss { * \returns The database file name. */ IOSS_NODISCARD std::string get_filename() const { return DBFilename; } - + /** For the database types that support it, return an integer `handle` * through which a client can directly access the underlying file. * Please use sparingly and with discretion. Basically, a kluge @@ -344,9 +344,12 @@ namespace Ioss { * * \returns The informative strings. */ - IOSS_NODISCARD const std::vector &get_information_records() const { return informationRecords; } - void add_information_records(const std::vector &info); - void add_information_record(const std::string &info); + IOSS_NODISCARD const std::vector &get_information_records() const + { + return informationRecords; + } + void add_information_records(const std::vector &info); + void add_information_record(const std::string &info); // QA Records: @@ -370,9 +373,9 @@ namespace Ioss { const std::string &time); IOSS_NODISCARD bool get_logging() const { return doLogging && !singleProcOnly; } - void set_logging(bool on_off) { doLogging = on_off; } + void set_logging(bool on_off) { doLogging = on_off; } IOSS_NODISCARD bool get_nan_detection() const { return doNanDetection; } - void set_nan_detection(bool on_off) { doNanDetection = on_off; } + void set_nan_detection(bool on_off) { doNanDetection = on_off; } // The get_field and put_field functions are just a wrapper around the // pure virtual get_field_internal and put_field_internal functions, @@ -428,35 +431,41 @@ namespace Ioss { * */ IOSS_NODISCARD bool is_parallel_consistent() const { return isParallelConsistent; } - void set_parallel_consistency(bool on_off) { isParallelConsistent = on_off; } + void set_parallel_consistency(bool on_off) { isParallelConsistent = on_off; } IOSS_NODISCARD bool get_use_generic_canonical_name() const { return useGenericCanonicalName; } void set_use_generic_canonical_name(bool yes_no) { useGenericCanonicalName = yes_no; } IOSS_NODISCARD bool ignore_database_names() const { return ignoreDatabaseNames; } - void ignore_database_names(bool yes_no) { ignoreDatabaseNames = yes_no; } + void ignore_database_names(bool yes_no) { ignoreDatabaseNames = yes_no; } IOSS_NODISCARD bool get_ignore_realn_fields() const { return m_ignoreRealnFields; } - void set_ignore_realn_fields(bool yes_no) { m_ignoreRealnFields = yes_no; } + void set_ignore_realn_fields(bool yes_no) { m_ignoreRealnFields = yes_no; } /** \brief Get the length of the longest name in the database file. * * \returns The length, or 0 for unlimited. */ - IOSS_NODISCARD virtual int maximum_symbol_length() const { return 0; } // Default is unlimited... + IOSS_NODISCARD virtual int maximum_symbol_length() const + { + return 0; + } // Default is unlimited... virtual void set_maximum_symbol_length(int /* requested_symbol_size */) { } // Default does nothing... - IOSS_NODISCARD std::string get_component_name(const Ioss::Field &field, Ioss::Field::InOut in_out, - int component) const; + IOSS_NODISCARD std::string get_component_name(const Ioss::Field &field, + Ioss::Field::InOut in_out, int component) const; IOSS_NODISCARD char get_field_separator() const { return fieldSeparator; } IOSS_NODISCARD bool get_field_recognition() const { return enableFieldRecognition; } IOSS_NODISCARD bool get_field_strip_trailing_() const { return fieldStripTrailing_; } - void set_field_separator(char separator); - void set_field_recognition(bool yes_no) { enableFieldRecognition = yes_no; } - void set_field_strip_trailing_(bool yes_no) { fieldStripTrailing_ = yes_no; } + void set_field_separator(char separator); + void set_field_recognition(bool yes_no) { enableFieldRecognition = yes_no; } + void set_field_strip_trailing_(bool yes_no) { fieldStripTrailing_ = yes_no; } - IOSS_NODISCARD DuplicateFieldBehavior get_duplicate_field_behavior() const { return duplicateFieldBehavior; } + IOSS_NODISCARD DuplicateFieldBehavior get_duplicate_field_behavior() const + { + return duplicateFieldBehavior; + } void set_lower_case_variable_names(bool true_false) const { @@ -492,9 +501,9 @@ namespace Ioss { IOSS_NODISCARD AxisAlignedBoundingBox get_bounding_box(const Ioss::ElementBlock *eb) const; IOSS_NODISCARD AxisAlignedBoundingBox get_bounding_box(const Ioss::StructuredBlock *sb) const; - IOSS_NODISCARD virtual int int_byte_size_db() const = 0; //! Returns 4 or 8 - IOSS_NODISCARD int int_byte_size_api() const; //! Returns 4 or 8 - virtual void set_int_byte_size_api(Ioss::DataSize size) const; + IOSS_NODISCARD virtual int int_byte_size_db() const = 0; //! Returns 4 or 8 + IOSS_NODISCARD int int_byte_size_api() const; //! Returns 4 or 8 + virtual void set_int_byte_size_api(Ioss::DataSize size) const; /*! * The owning region of this database. @@ -544,16 +553,16 @@ namespace Ioss { * If you only want the last step available on the database, * use set_cycle_count(1) */ - void set_cycle_count(int count) const { cycleCount = count; } + void set_cycle_count(int count) const { cycleCount = count; } IOSS_NODISCARD int get_cycle_count() const { return cycleCount; } - void set_overlay_count(int count) const { overlayCount = count; } + void set_overlay_count(int count) const { overlayCount = count; } IOSS_NODISCARD int get_overlay_count() const { return overlayCount; } - void set_file_per_state(bool yes_no) const { filePerState = yes_no; } + void set_file_per_state(bool yes_no) const { filePerState = yes_no; } IOSS_NODISCARD bool get_file_per_state() const { return filePerState; } void set_time_scale_factor(double factor) { timeScaleFactor = factor; } - IOSS_NODISCARD const Ioss::ParallelUtils &util() const { return util_; } + IOSS_NODISCARD const Ioss::ParallelUtils &util() const { return util_; } IOSS_NODISCARD const Ioss::PropertyManager &get_property_manager() const { return properties; } /** \brief Get the processor that this mesh database is on. * diff --git a/packages/seacas/libraries/ioss/src/Ioss_GroupingEntity.h b/packages/seacas/libraries/ioss/src/Ioss_GroupingEntity.h index d3037bb02b..6c7faec5b1 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_GroupingEntity.h +++ b/packages/seacas/libraries/ioss/src/Ioss_GroupingEntity.h @@ -77,10 +77,10 @@ namespace Ioss { IOSS_NODISCARD State get_state() const; - IOSS_NODISCARD DatabaseIO *get_database() const; - void set_database(DatabaseIO *io_database); - void reset_database(DatabaseIO *io_database); - virtual void delete_database(); + IOSS_NODISCARD DatabaseIO *get_database() const; + void set_database(DatabaseIO *io_database); + void reset_database(DatabaseIO *io_database); + virtual void delete_database(); /** Return the GroupingEntity pointer of the "object" that this * entity is contained in. For example, a SideBlock would @@ -161,18 +161,20 @@ namespace Ioss { // ======================================================================== // Property-related information.... // Just forward it through to the property manager... - inline void property_add(const Property &new_prop); - inline void property_erase(const std::string &property_name); + inline void property_add(const Property &new_prop); + inline void property_erase(const std::string &property_name); IOSS_NODISCARD inline bool property_exists(const std::string &property_name) const; IOSS_NODISCARD inline Property get_property(const std::string &property_name) const; - IOSS_NODISCARD inline int64_t get_optional_property(const std::string &property, int64_t optional_value) const; - IOSS_NODISCARD inline std::string get_optional_property(const std::string &property_name, - const std::string &optional_value) const; - IOSS_NODISCARD inline NameList property_describe() const; - inline int property_describe(NameList *names) const; - IOSS_NODISCARD inline NameList property_describe(Ioss::Property::Origin origin) const; - inline int property_describe(Ioss::Property::Origin origin, NameList *names) const; - IOSS_NODISCARD inline size_t property_count() const; + IOSS_NODISCARD inline int64_t get_optional_property(const std::string &property, + int64_t optional_value) const; + IOSS_NODISCARD inline std::string + get_optional_property(const std::string &property_name, + const std::string &optional_value) const; + IOSS_NODISCARD inline NameList property_describe() const; + inline int property_describe(NameList *names) const; + IOSS_NODISCARD inline NameList property_describe(Ioss::Property::Origin origin) const; + inline int property_describe(Ioss::Property::Origin origin, NameList *names) const; + IOSS_NODISCARD inline size_t property_count() const; /** Add a property, or change its value if it already exists with a different value */ void property_update(const std::string &property, int64_t value) const; @@ -182,15 +184,15 @@ namespace Ioss { // FIELDS // ======================================================================== // Just forward these through to the field manager... - void field_add(Field new_field); - inline void field_erase(const std::string &field_name); - inline void field_erase(Field::RoleType role); + void field_add(Field new_field); + inline void field_erase(const std::string &field_name); + inline void field_erase(Field::RoleType role); IOSS_NODISCARD inline bool field_exists(const std::string &field_name) const; IOSS_NODISCARD inline Field get_field(const std::string &field_name) const; IOSS_NODISCARD inline const Field &get_fieldref(const std::string &field_name) const; - inline int field_describe(NameList *names) const; + inline int field_describe(NameList *names) const; IOSS_NODISCARD inline NameList field_describe() const; - inline int field_describe(Field::RoleType role, NameList *names) const; + inline int field_describe(Field::RoleType role, NameList *names) const; IOSS_NODISCARD inline NameList field_describe(Field::RoleType role) const; IOSS_NODISCARD inline size_t field_count() const; IOSS_NODISCARD size_t field_count(Field::RoleType role) const; diff --git a/packages/seacas/libraries/ioss/src/Ioss_IOFactory.h b/packages/seacas/libraries/ioss/src/Ioss_IOFactory.h index af8c783b1c..2467a21b7b 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_IOFactory.h +++ b/packages/seacas/libraries/ioss/src/Ioss_IOFactory.h @@ -35,22 +35,22 @@ namespace Ioss { { public: virtual ~IOFactory() = default; - IOSS_NODISCARD static DatabaseIO *create(const std::string &type, const std::string &filename, - DatabaseUsage db_usage, - Ioss_MPI_Comm communicator = Ioss::ParallelUtils::comm_world(), - const Ioss::PropertyManager &properties = Ioss::PropertyManager()); + IOSS_NODISCARD static DatabaseIO * + create(const std::string &type, const std::string &filename, DatabaseUsage db_usage, + Ioss_MPI_Comm communicator = Ioss::ParallelUtils::comm_world(), + const Ioss::PropertyManager &properties = Ioss::PropertyManager()); - static int describe(NameList *names); + static int describe(NameList *names); IOSS_NODISCARD static NameList describe(); - static void clean(); + static void clean(); IOSS_NODISCARD static std::string show_configuration(); protected: explicit IOFactory(const std::string &type); IOSS_NODISCARD virtual DatabaseIO *make_IO(const std::string &filename, DatabaseUsage db_usage, - Ioss_MPI_Comm communicator, - const Ioss::PropertyManager &properties) const = 0; + Ioss_MPI_Comm communicator, + const Ioss::PropertyManager &properties) const = 0; IOSS_NODISCARD virtual std::string show_config() const { return {""}; } diff --git a/packages/seacas/libraries/ioss/src/Ioss_Property.h b/packages/seacas/libraries/ioss/src/Ioss_Property.h index ac269a28c9..290405405c 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_Property.h +++ b/packages/seacas/libraries/ioss/src/Ioss_Property.h @@ -6,8 +6,8 @@ #pragma once -#include "ioss_export.h" #include "Ioss_CodeTypes.h" +#include "ioss_export.h" #include // for int64_t #include // for string @@ -47,14 +47,14 @@ namespace Ioss { // To set implicit property Property(const GroupingEntity *ge, std::string name, BasicType type); - IOSS_NODISCARD std::string get_string() const; - IOSS_NODISCARD int64_t get_int() const; - IOSS_NODISCARD double get_real() const; - IOSS_NODISCARD void *get_pointer() const; + IOSS_NODISCARD std::string get_string() const; + IOSS_NODISCARD int64_t get_int() const; + IOSS_NODISCARD double get_real() const; + IOSS_NODISCARD void *get_pointer() const; IOSS_NODISCARD std::vector get_vec_double() const; - IOSS_NODISCARD std::vector get_vec_int() const; + IOSS_NODISCARD std::vector get_vec_int() const; - void set_origin(Origin origin) { origin_ = origin; } + void set_origin(Origin origin) { origin_ = origin; } IOSS_NODISCARD Origin get_origin() const { return origin_; } /** \brief Tells whether the property is calculated, rather than stored. diff --git a/packages/seacas/libraries/ioss/src/Ioss_Utils.h b/packages/seacas/libraries/ioss/src/Ioss_Utils.h index c714127f91..670eed3af7 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_Utils.h +++ b/packages/seacas/libraries/ioss/src/Ioss_Utils.h @@ -188,7 +188,8 @@ namespace Ioss { index.back() = sum; } - template IOSS_NODISCARD static T find_index_location(T node, const std::vector &index) + template + IOSS_NODISCARD static T find_index_location(T node, const std::vector &index) { // 0-based node numbering // index[p] = first node (0-based) on processor p @@ -312,7 +313,7 @@ namespace Ioss { IOSS_NODISCARD static int log_power_2(uint64_t value); IOSS_NODISCARD static char **get_name_array(size_t count, int size); - static void delete_name_array(char **names, int count); + static void delete_name_array(char **names, int count); /** \brief Get formatted time and date strings. * @@ -327,10 +328,11 @@ namespace Ioss { static void time_and_date(char *time_string, char *date_string, size_t length); IOSS_NODISCARD static std::string decode_filename(const std::string &filename, int processor, - int num_processors); + int num_processors); IOSS_NODISCARD static int get_number(const std::string &suffix); IOSS_NODISCARD static int extract_id(const std::string &name_id); - IOSS_NODISCARD static std::string encode_entity_name(const std::string &entity_type, int64_t id); + IOSS_NODISCARD static std::string encode_entity_name(const std::string &entity_type, + int64_t id); /** Return the trailing digits (if any) from `name` * `hex20` would return the string `20` @@ -347,8 +349,8 @@ namespace Ioss { * string `1..3, 5..8` */ IOSS_NODISCARD static std::string format_id_list(const std::vector &ids, - const std::string &rng_sep = " to ", - const std::string &seq_sep = ", "); + const std::string &rng_sep = " to ", + const std::string &seq_sep = ", "); /** \brief Convert a string to lower case, and convert spaces to `_`. * @@ -403,7 +405,8 @@ namespace Ioss { * \param[in] spatial The spatial dimension of the element. * \returns The Ioss-formatted element name. */ - IOSS_NODISCARD static std::string fixup_type(const std::string &base, int nodes_per_element, int spatial); + IOSS_NODISCARD static std::string fixup_type(const std::string &base, int nodes_per_element, + int spatial); /** \brief Uppercase the first letter of the string * @@ -472,8 +475,9 @@ namespace Ioss { * \param[in] working_directory the path to which the relative_filename path is appended. * \returns The full path (working_directory + relative_filename) */ - IOSS_NODISCARD static std::string local_filename(const std::string &relative_filename, const std::string &type, - const std::string &working_directory); + IOSS_NODISCARD static std::string local_filename(const std::string &relative_filename, + const std::string &type, + const std::string &working_directory); static void get_fields(int64_t entity_count, char **names, int num_names, Ioss::Field::RoleType fld_role, const DatabaseIO *db, int *local_truth, @@ -521,7 +525,10 @@ namespace Ioss { static void input_file(const std::string &file_name, std::vector *lines, size_t max_line_length = 0); - template IOSS_NODISCARD static std::string to_string(const T &t) { return std::to_string(t); } + template IOSS_NODISCARD static std::string to_string(const T &t) + { + return std::to_string(t); + } //! \brief Tries to shorten long variable names to an acceptable //! length, and converts to lowercase and spaces to `_` @@ -541,8 +548,9 @@ namespace Ioss { //! characters and append a 2 character hash+separator. //! //! It also converts name to lowercase and converts spaces to `_` - IOSS_NODISCARD static std::string variable_name_kluge(const std::string &name, size_t component_count, - size_t copies, size_t max_var_len); + IOSS_NODISCARD static std::string variable_name_kluge(const std::string &name, + size_t component_count, size_t copies, + size_t max_var_len); IOSS_NODISCARD static std::string shape_to_string(const Ioss::ElementShape &shape); diff --git a/packages/seacas/libraries/ioss/src/adios/Ioad_Helper.h b/packages/seacas/libraries/ioss/src/adios/Ioad_Helper.h index c18be10120..f689aab681 100644 --- a/packages/seacas/libraries/ioss/src/adios/Ioad_Helper.h +++ b/packages/seacas/libraries/ioss/src/adios/Ioad_Helper.h @@ -37,16 +37,16 @@ namespace Ioad { // parameters. template auto NewEntity(Ioss::DatabaseIO *io_database, const std::string &my_name, - const std::string & /*entity_type*/, size_t entity_count) - -> IossHas3ParametersConstructor * + const std::string & /*entity_type*/, + size_t entity_count) -> IossHas3ParametersConstructor * { return new T(io_database, my_name, entity_count); } template auto NewEntity(Ioss::DatabaseIO *io_database, const std::string &my_name, - const std::string &entity_type, size_t entity_count) - -> IossHas4ParametersConstructor * + const std::string &entity_type, + size_t entity_count) -> IossHas4ParametersConstructor * { return new T(io_database, my_name, entity_type, entity_count); } diff --git a/packages/seacas/libraries/ioss/src/cgns/Iocgns_Utils.h b/packages/seacas/libraries/ioss/src/cgns/Iocgns_Utils.h index 40d4e77837..15c6f727e7 100644 --- a/packages/seacas/libraries/ioss/src/cgns/Iocgns_Utils.h +++ b/packages/seacas/libraries/ioss/src/cgns/Iocgns_Utils.h @@ -77,7 +77,10 @@ namespace Ioss { IOSS_NODISCARD inline auto format_as(CGNS_ENUMT(BCType_t) t) { return BCTypeName[t]; } IOSS_NODISCARD inline auto format_as(CGNS_ENUMT(DataType_t) t) { return DataTypeName[t]; } IOSS_NODISCARD inline auto format_as(CGNS_ENUMT(ElementType_t) t) { return ElementTypeName[t]; } -IOSS_NODISCARD inline auto format_as(CGNS_ENUMT(GridConnectivityType_t) t) { return GridConnectivityTypeName[t]; } +IOSS_NODISCARD inline auto format_as(CGNS_ENUMT(GridConnectivityType_t) t) +{ + return GridConnectivityTypeName[t]; +} IOSS_NODISCARD inline auto format_as(CGNS_ENUMT(GridLocation_t) t) { return GridLocationName[t]; } IOSS_NODISCARD inline auto format_as(CGNS_ENUMT(PointSetType_t) t) { return PointSetTypeName[t]; } IOSS_NODISCARD inline auto format_as(CGNS_ENUMT(ZoneType_t) t) { return ZoneTypeName[t]; } @@ -100,7 +103,8 @@ namespace Iocgns { class IOCGNS_EXPORT Utils { public: - IOSS_NODISCARD static std::pair decompose_name(const std::string &name, bool is_parallel); + IOSS_NODISCARD static std::pair decompose_name(const std::string &name, + bool is_parallel); IOSS_NODISCARD static std::string decompose_sb_name(const std::string &name); IOSS_NODISCARD static size_t index(const Ioss::Field &field); @@ -108,11 +112,11 @@ namespace Iocgns { static void cgns_error(int cgnsid, const char *file, const char *function, int lineno, int processor); - static void update_db_zone_property(int cgns_file_ptr, const Ioss::Region *region, - int myProcessor, bool is_parallel, bool is_parallel_io); - IOSS_NODISCARD static int get_db_zone(const Ioss::GroupingEntity *entity); - static void set_field_index(const Ioss::Field &field, size_t index, - CGNS_ENUMT(GridLocation_t) location); + static void update_db_zone_property(int cgns_file_ptr, const Ioss::Region *region, + int myProcessor, bool is_parallel, bool is_parallel_io); + IOSS_NODISCARD static int get_db_zone(const Ioss::GroupingEntity *entity); + static void set_field_index(const Ioss::Field &field, size_t index, + CGNS_ENUMT(GridLocation_t) location); IOSS_NODISCARD static bool is_cell_field(const Ioss::Field &field); template @@ -274,8 +278,8 @@ namespace Iocgns { } } - IOSS_NODISCARD static std::vector parse_zonebc_sideblocks(int cgns_file_ptr, int base, int zone, - int myProcessor); + IOSS_NODISCARD static std::vector parse_zonebc_sideblocks(int cgns_file_ptr, int base, + int zone, int myProcessor); static void generate_boundary_faces(Ioss::Region *region, @@ -286,8 +290,8 @@ namespace Iocgns { int state, const int *vertex_solution_index, const int *cell_center_solution_index, bool is_parallel_io); - IOSS_NODISCARD static int find_solution_index(int cgns_file_ptr, int base, int zone, int step, - CGNS_ENUMT(GridLocation_t) location); + IOSS_NODISCARD static int find_solution_index(int cgns_file_ptr, int base, int zone, int step, + CGNS_ENUMT(GridLocation_t) location); IOSS_NODISCARD static Ioss::MeshType check_mesh_type(int cgns_file_ptr); static void output_assembly(int file_ptr, const Ioss::Assembly *assembly, bool is_parallel_io, @@ -304,8 +308,8 @@ namespace Iocgns { IOSS_NODISCARD static CGNS_ENUMT(ElementType_t) map_topology_to_cgns(const std::string &name); IOSS_NODISCARD static std::string map_cgns_to_topology_type(CGNS_ENUMT(ElementType_t) type); - static void add_sidesets(int cgns_file_ptr, Ioss::DatabaseIO *db); - static void add_assemblies(int cgns_file_ptr, Ioss::DatabaseIO *db); + static void add_sidesets(int cgns_file_ptr, Ioss::DatabaseIO *db); + static void add_assemblies(int cgns_file_ptr, Ioss::DatabaseIO *db); static void add_to_assembly(int cgns_file_ptr, Ioss::Region *region, Ioss::EntityBlock *block, int base, int zone); diff --git a/packages/seacas/libraries/ioss/src/exodus/Ioex_DatabaseIO.h b/packages/seacas/libraries/ioss/src/exodus/Ioex_DatabaseIO.h index f7689e5a2f..66c87690ad 100644 --- a/packages/seacas/libraries/ioss/src/exodus/Ioex_DatabaseIO.h +++ b/packages/seacas/libraries/ioss/src/exodus/Ioex_DatabaseIO.h @@ -74,8 +74,8 @@ namespace Ioex { bool abort_if_error) const override; bool handle_output_file(bool write_message, std::string *error_msg, int *bad_count, bool overwrite, bool abort_if_error) const override; - IOSS_NODISCARD bool check_valid_file_ptr(bool write_message, std::string *error_msg, int *bad_count, - bool abort_if_error) const; + IOSS_NODISCARD bool check_valid_file_ptr(bool write_message, std::string *error_msg, + int *bad_count, bool abort_if_error) const; int64_t get_field_internal(const Ioss::Region *reg, const Ioss::Field &field, void *data, size_t data_size) const override; @@ -207,7 +207,8 @@ namespace Ioex { // ID Mapping functions. IOSS_NODISCARD const Ioss::Map &get_map(ex_entity_type type) const; IOSS_NODISCARD const Ioss::Map &get_map(Ioss::Map &entity_map, int64_t entity_count, - ex_entity_type entity_type, ex_inquiry inquiry_type) const; + ex_entity_type entity_type, + ex_inquiry inquiry_type) const; // Internal data handling int64_t handle_node_ids(void *ids, int64_t num_to_get) const; diff --git a/packages/seacas/libraries/ioss/src/exodus/Ioex_DecompositionData.C b/packages/seacas/libraries/ioss/src/exodus/Ioex_DecompositionData.C index 9c4c15d45f..b3edaccb2e 100644 --- a/packages/seacas/libraries/ioss/src/exodus/Ioex_DecompositionData.C +++ b/packages/seacas/libraries/ioss/src/exodus/Ioex_DecompositionData.C @@ -2182,9 +2182,9 @@ namespace Ioex { load_field_data(filePtr, Data(fileData), blockSubsetIndex, step, blockFieldData, blockComponentCount, fileConnOffset); - (void)decompData->m_decomposition.communicate_entity_data(Data(fileData), data, - decompData->el_blocks, blockSubsetIndex, - fileConnOffset, blockComponentCount); + (void)decompData->m_decomposition.communicate_entity_data( + Data(fileData), data, decompData->el_blocks, blockSubsetIndex, fileConnOffset, + blockComponentCount); } } diff --git a/packages/seacas/libraries/ioss/src/exodus/Ioex_Utils.h b/packages/seacas/libraries/ioss/src/exodus/Ioex_Utils.h index 768ad244a3..a08f9d80f1 100644 --- a/packages/seacas/libraries/ioss/src/exodus/Ioex_Utils.h +++ b/packages/seacas/libraries/ioss/src/exodus/Ioex_Utils.h @@ -82,8 +82,8 @@ namespace Ioex { #endif IOSS_NODISCARD IOEX_EXPORT const char *Version(); - IOEX_EXPORT bool check_processor_info(const std::string &filename, int exodusFilePtr, - int processor_count, int processor_id); + IOEX_EXPORT bool check_processor_info(const std::string &filename, int exodusFilePtr, + int processor_count, int processor_id); IOSS_NODISCARD IOEX_EXPORT Ioss::EntityType map_exodus_type(ex_entity_type type); IOSS_NODISCARD IOEX_EXPORT ex_entity_type map_exodus_type(Ioss::EntityType type); @@ -114,8 +114,8 @@ namespace Ioex { std::string *disp_name); IOSS_NODISCARD IOEX_EXPORT std::string get_entity_name(int exoid, ex_entity_type type, int64_t id, - const std::string &basename, int length, - bool &db_has_name); + const std::string &basename, int length, + bool &db_has_name); IOEX_EXPORT bool filter_node_list(Ioss::Int64Vector &nodes, const std::vector &node_connectivity_status); diff --git a/packages/seacas/libraries/ioss/src/exonull/Ioexnl_DatabaseIO.C b/packages/seacas/libraries/ioss/src/exonull/Ioexnl_DatabaseIO.C index 801d0891c1..236a36b0a1 100644 --- a/packages/seacas/libraries/ioss/src/exonull/Ioexnl_DatabaseIO.C +++ b/packages/seacas/libraries/ioss/src/exonull/Ioexnl_DatabaseIO.C @@ -53,7 +53,7 @@ // Static internal helper functions // ======================================================================== namespace { - const size_t max_line_length = MAX_LINE_LENGTH; + const size_t max_line_length = MAX_LINE_LENGTH; template void compute_internal_border_maps(T *entities, T *internal, size_t count, size_t entity_count) diff --git a/packages/seacas/libraries/ioss/src/hopscotch_hash.h b/packages/seacas/libraries/ioss/src/hopscotch_hash.h index 4fd92f1ab7..00f421125d 100644 --- a/packages/seacas/libraries/ioss/src/hopscotch_hash.h +++ b/packages/seacas/libraries/ioss/src/hopscotch_hash.h @@ -1798,7 +1798,7 @@ namespace tsl { */ template < class T = size_type, - typename std::enable_if::value>::type * = nullptr> + typename std::enable_if::value>::type * = nullptr> static bool USE_STORED_HASH_ON_REHASH(size_type /*bucket_count*/) { return StoreHash; @@ -1806,7 +1806,7 @@ namespace tsl { template < class T = size_type, - typename std::enable_if::value>::type * = nullptr> + typename std::enable_if::value>::type * = nullptr> static bool USE_STORED_HASH_ON_REHASH(size_type bucket_count) { (void)bucket_count; diff --git a/packages/seacas/libraries/ioss/src/utest/Utst_IofxDatabaseIO.C b/packages/seacas/libraries/ioss/src/utest/Utst_IofxDatabaseIO.C index c1c148097f..b9aa175f1b 100644 --- a/packages/seacas/libraries/ioss/src/utest/Utst_IofxDatabaseIO.C +++ b/packages/seacas/libraries/ioss/src/utest/Utst_IofxDatabaseIO.C @@ -18,8 +18,8 @@ #include "Ioss_SideSet.h" #include "exodus/Ioex_DatabaseIO.h" -#include #include +#include #include #include #include diff --git a/packages/seacas/libraries/ioss/src/utest/Utst_heartbeat.C b/packages/seacas/libraries/ioss/src/utest/Utst_heartbeat.C index 1045fb9b6c..cb16ca34ff 100644 --- a/packages/seacas/libraries/ioss/src/utest/Utst_heartbeat.C +++ b/packages/seacas/libraries/ioss/src/utest/Utst_heartbeat.C @@ -1,6 +1,6 @@ #include "Ionit_Initializer.h" -#include #include +#include #include #include #include diff --git a/packages/seacas/libraries/supes/ext_lib/exread.c b/packages/seacas/libraries/supes/ext_lib/exread.c index 91a3190081..99c47f603b 100644 --- a/packages/seacas/libraries/supes/ext_lib/exread.c +++ b/packages/seacas/libraries/supes/ext_lib/exread.c @@ -64,7 +64,7 @@ C IOSTAT INTEGER I/O Status ( -1 = EOF, 0 = normal ) } else { static char internal_prompt[128]; - char * p = NULL; + char *p = NULL; /* Fill line with blanks... */ int dlen = InputLength; diff --git a/packages/seacas/libraries/svdi/cgi/mdcgi.c b/packages/seacas/libraries/svdi/cgi/mdcgi.c index c365c09e7b..85542ba671 100644 --- a/packages/seacas/libraries/svdi/cgi/mdcgi.c +++ b/packages/seacas/libraries/svdi/cgi/mdcgi.c @@ -62,8 +62,8 @@ void xcoon(anything **surface_id) /* which surface to turn output on for*/ surf_found = surf; break; } /* end if found on list */ - } /* end for */ - } /* end for all devices */ + } /* end for */ + } /* end for all devices */ /* does surface_id point to a valid surface? */ if (dev_found < 0) { @@ -81,7 +81,7 @@ void xcoon(anything **surface_id) /* which surface to turn output on for*/ devices[dev_found].statelist[devices[dev_found].num_on_surfaces - 1]; devices[dev_found].statelist[devices[dev_found].num_on_surfaces - 1] = temp; } /* end if there is an off surface */ - } /* end if surface was off */ + } /* end if surface was off */ } /* end xcoon */ /******************************************************************************/ @@ -102,7 +102,7 @@ void xcact(void (*device_fn)(anything **, int, anything **), anything **p_surfac which_device = i; break; } /* end if */ - } /* end for */ + } /* end for */ if (which_device < 0) { /* if device not initialized */ if (num_devices >= MAX_DEVICES) { /* if no room */ @@ -110,7 +110,7 @@ void xcact(void (*device_fn)(anything **, int, anything **), anything **p_surfac *p_surface_id = NULL; return; } /* end if no room for device */ - } /* end if device not initialized */ + } /* end if device not initialized */ /* call the device driver with ACTIVATE, so it can allocate a state list */ short arg1 = ACTIVATE_FN; @@ -190,8 +190,8 @@ void xcsol(anything **surface_id) dev_found = dev; break; } /* end if found on list */ - } /* end for */ - } /* end for all devices */ + } /* end for */ + } /* end for all devices */ /* does surface_id point to a valid surface? */ if (dev_found < 0) { diff --git a/packages/seacas/libraries/svdi/cgi/met_metxlate.c b/packages/seacas/libraries/svdi/cgi/met_metxlate.c index 3f69a3d952..425435e65d 100644 --- a/packages/seacas/libraries/svdi/cgi/met_metxlate.c +++ b/packages/seacas/libraries/svdi/cgi/met_metxlate.c @@ -629,7 +629,7 @@ static void xci(anything **params, int num_surfaces, anything **surf_list) set_dev_descrip(); dev_descrip.set_flag = TRUE; } /* end if set_flag */ - } /* end if surface not initialized */ + } /* end if surface not initialized */ else { /* this surface has been initialized once already */ @@ -1129,7 +1129,7 @@ static void xcesc(anything **params, int num_surfaces, anything **surf_list) break; } /* end switch */ - } /* end for i */ + } /* end for i */ } /* end xcesc */ /* INQUIRE DEVICE IDENTIFICATION */ @@ -1521,7 +1521,7 @@ static void xcpl(anything **params, int num_surfaces, anything **surf_list) vdlina(&cur_x, &cur_y); } } /* end for j */ - } /* end no clipping on */ + } /* end no clipping on */ else { /* clipping is on */ @@ -1709,8 +1709,8 @@ static void xcpl(anything **params, int num_surfaces, anything **surf_list) default: done = TRUE; break; } /* end switch */ - } /* end while !done */ - } /* end while j*/ + } /* end while !done */ + } /* end while j*/ } /* end else clipping is on */ @@ -1765,7 +1765,7 @@ static void xcdjpl(anything **params, int num_surfaces, anything **surf_list) vdlina(&x2, &y2); } /* end for j */ - } /* end if clipping is off */ + } /* end if clipping is off */ else { /* clipping is on */ @@ -1926,9 +1926,9 @@ static void xcdjpl(anything **params, int num_surfaces, anything **surf_list) default: done = TRUE; break; } /* end switch */ - } /* end while !done */ - } /* end for j */ - } /* end else clipping is on */ + } /* end while !done */ + } /* end for j */ + } /* end else clipping is on */ /* flag that the page has been marked */ cur_state->pic_dirty = CDIRTY; @@ -2093,8 +2093,8 @@ static void xctx(anything **params, int num_surfaces, anything **surf_list) np = (int)((cur_state->clipmax.x - x) / char_width); } } /* end if ok in x */ - } /* end if ok in y */ - } /* end if clip_on */ + } /* end if ok in y */ + } /* end if clip_on */ ok = ok && np > 0; /* make sure there is still some text left */ @@ -2208,7 +2208,7 @@ static void xcpg(anything **params, int num_surfaces, anything **surf_list) vdi_ls = (int)temp_array[4]; vdstls(&vdi_ls); } - } /* end if hollow OR no poly support */ + } /* end if hollow OR no poly support */ else { /* solid polygon */ vdpoly(xnew, ynew, &npnew); } @@ -2364,7 +2364,7 @@ static void xcca(anything **params, int num_surfaces, anything **surf_list) } /* end clip at top edge */ } /* end if ok */ - } /* end if clip is on */ + } /* end if clip is on */ /* make sure there is still something left */ ok = ok && (nx1 > 0 && ny1 > 0); @@ -2433,9 +2433,9 @@ static void xcca(anything **params, int num_surfaces, anything **surf_list) vdpixi(&ix, &iy, &cells[index], &nx1); index = index + nx; /* compute next index */ iy = iy + yinc; /* compute next raster line */ - } /* end for k */ - } /* end else no special case */ - } /* end x increasing */ + } /* end for k */ + } /* end else no special case */ + } /* end x increasing */ else { /* x decreasing */ @@ -2474,8 +2474,8 @@ static void xcca(anything **params, int num_surfaces, anything **surf_list) index = index + index_inc; } /* end for k */ - } /* end x decreasing */ - } /* end if indexed color */ + } /* end x decreasing */ + } /* end if indexed color */ else { /* direct color */ @@ -2523,7 +2523,7 @@ static void xcca(anything **params, int num_surfaces, anything **surf_list) index = index + index_inc; } /* end for k */ - } /* end if x increasing */ + } /* end if x increasing */ else { /* x decreasing */ @@ -2560,14 +2560,14 @@ static void xcca(anything **params, int num_surfaces, anything **surf_list) index = index + index_inc; } /* end for k */ - } /* end else x decreasing */ - } /* end else direct color */ + } /* end else x decreasing */ + } /* end else direct color */ /* flag that the page has been marked */ cur_state->pic_dirty = CDIRTY; } /* end if ok */ - } /* end for each surface */ + } /* end for each surface */ } /* end xcca */ /* PIXEL ARRAY */ @@ -2746,7 +2746,7 @@ static void xcpxa(anything **params, int num_surfaces, anything **surf_list) } /* end clip top edge */ } /* end if ok */ - } /* end if clip_on */ + } /* end if clip_on */ /* make sure there is still something to draw */ ok = ok && (nx1 > 0 && ny1 > 0); @@ -2816,9 +2816,9 @@ static void xcpxa(anything **params, int num_surfaces, anything **surf_list) vdpixi(&ix, &iy, &pxclrs[index], &nx1); index = index + nx; /* compute next index */ iy = iy + yinc; /* compute next raster line */ - } /* end for k */ - } /* end else no special case */ - } /* end x increasing */ + } /* end for k */ + } /* end else no special case */ + } /* end x increasing */ else { /* x decreasing */ @@ -2857,8 +2857,8 @@ static void xcpxa(anything **params, int num_surfaces, anything **surf_list) index = index + index_inc; } /* end for k */ - } /* end x decreasing */ - } /* end if indexed color */ + } /* end x decreasing */ + } /* end if indexed color */ else { /* direct color */ @@ -2905,7 +2905,7 @@ static void xcpxa(anything **params, int num_surfaces, anything **surf_list) index = index + index_inc; } /* end for k */ - } /* end if x increasing */ + } /* end if x increasing */ else { /* x decreasing */ @@ -2942,14 +2942,14 @@ static void xcpxa(anything **params, int num_surfaces, anything **surf_list) index = index + index_inc; } /* end for k */ - } /* end else x decreasing */ - } /* end else direct color */ + } /* end else x decreasing */ + } /* end else direct color */ /* flag that the page has been marked */ cur_state->pic_dirty = CDIRTY; } /* end if ok */ - } /* end for each surface */ + } /* end for each surface */ } /* end xcpxa */ /* LINE TYPE */ @@ -3333,8 +3333,8 @@ static void xccsm(anything **params, int num_surfaces, anything **surf_list) functions with affected parameters ignored until reset */ report_error(cur_state, 3, 305, *(short *)params[0]); cur_state->csm = -1; /* flag error condition */ - } /* end else must be an error */ - } /* end else */ + } /* end else must be an error */ + } /* end else */ } /* end for each surface */ } /* end xccsm */ @@ -4893,7 +4893,7 @@ static void set_foreground_color(surf_statelist *surf_state, int *colors) cur_state->vdi_attrib.fg_rgb[1] = -1.0; cur_state->vdi_attrib.fg_rgb[2] = -1.0; } /* end does foreground... */ - } /* end indexed color */ + } /* end indexed color */ else /* direct color */ @@ -4974,7 +4974,7 @@ static void set_background_color(surf_statelist *surf_state, int *colors) index = i; } } /* end for i */ - } /* end vector SVDI */ + } /* end vector SVDI */ /* is it close enough? */ if (dmin <= epsilon) { @@ -4986,7 +4986,7 @@ static void set_background_color(surf_statelist *surf_state, int *colors) vdstco(&one, &dev_descrip.index_array[cur_state->bg_index], &cur_state->vdi_attrib.bg_rgb, &dev_descrip.col_mode); cur_state->color_set = TRUE; /* flag that CT has been set */ - } /* end else not close enough */ + } /* end else not close enough */ } /* end has never been set */ @@ -5054,7 +5054,7 @@ static void report_error(surf_statelist *surf_state, int e_class, int e_num, int surf_state->err_queue[err_slot - 1].err_num = 0; surf_state->err_queue[err_slot - 1].func_id = 2; } /* end else create */ - } /* end not enuff room in the queue */ + } /* end not enuff room in the queue */ } /* end if error reporting is on */ } /* end report_error */ @@ -5093,7 +5093,7 @@ static void gettoken(int *index_p, int *numrecs_p, char *data_p, int max_chars, /* c is not whitespace, is start of token */ workstate = 1; } /* end if c is whitespace */ - } /* end while skipping whitespace */ + } /* end while skipping whitespace */ while (workstate == 1) { /* while in token */ c = data_p[*index_p]; @@ -5110,7 +5110,7 @@ static void gettoken(int *index_p, int *numrecs_p, char *data_p, int max_chars, if (*index_p >= *numrecs_p * 80) { workstate = 2; } /* end if off end of data */ - } /* end if c is whitespace */ + } /* end if c is whitespace */ } /* end while putting chars into outtoken */ @@ -5201,7 +5201,7 @@ static int poly_clip(point *cmin, point *cmax, float *vx, float *vy, int vlen, f xtemp[*lenout] = t.x; ytemp[(*lenout)++] = t.y; } /* end intersect */ - } /* end else p outside, s inside */ + } /* end else p outside, s inside */ s.x = p.x; s.y = p.y; @@ -5472,6 +5472,6 @@ void nmtbuf(int *numwds, unsigned outary[]) cur_state->buff_ptr = 0; } /* end if > BUFFER_SIZE */ - } /* end for i=... */ + } /* end for i=... */ } } /* end nmtbuf */ diff --git a/packages/seacas/libraries/svdi/cgi/pst_pstxlate.c b/packages/seacas/libraries/svdi/cgi/pst_pstxlate.c index b4356383c8..de2ea964d8 100644 --- a/packages/seacas/libraries/svdi/cgi/pst_pstxlate.c +++ b/packages/seacas/libraries/svdi/cgi/pst_pstxlate.c @@ -635,7 +635,7 @@ static void xci(anything **params, int num_surfaces, anything **surf_list) set_dev_descrip(); dev_descrip.set_flag = TRUE; } /* end if set_flag */ - } /* end if surface not initialized */ + } /* end if surface not initialized */ else { /* this surface has been initialized once already */ @@ -1135,7 +1135,7 @@ static void xcesc(anything **params, int num_surfaces, anything **surf_list) break; } /* end switch */ - } /* end for i */ + } /* end for i */ } /* end xcesc */ /* INQUIRE DEVICE IDENTIFICATION */ @@ -1527,7 +1527,7 @@ static void xcpl(anything **params, int num_surfaces, anything **surf_list) vdlina(&cur_x, &cur_y); } } /* end for j */ - } /* end no clipping on */ + } /* end no clipping on */ else { /* clipping is on */ @@ -1715,8 +1715,8 @@ static void xcpl(anything **params, int num_surfaces, anything **surf_list) default: done = TRUE; break; } /* end switch */ - } /* end while !done */ - } /* end while j*/ + } /* end while !done */ + } /* end while j*/ } /* end else clipping is on */ @@ -1771,7 +1771,7 @@ static void xcdjpl(anything **params, int num_surfaces, anything **surf_list) vdlina(&x2, &y2); } /* end for j */ - } /* end if clipping is off */ + } /* end if clipping is off */ else { /* clipping is on */ @@ -1932,9 +1932,9 @@ static void xcdjpl(anything **params, int num_surfaces, anything **surf_list) default: done = TRUE; break; } /* end switch */ - } /* end while !done */ - } /* end for j */ - } /* end else clipping is on */ + } /* end while !done */ + } /* end for j */ + } /* end else clipping is on */ /* flag that the page has been marked */ cur_state->pic_dirty = CDIRTY; @@ -2099,8 +2099,8 @@ static void xctx(anything **params, int num_surfaces, anything **surf_list) np = (int)((cur_state->clipmax.x - x) / char_width); } } /* end if ok in x */ - } /* end if ok in y */ - } /* end if clip_on */ + } /* end if ok in y */ + } /* end if clip_on */ ok = ok && np > 0; /* make sure there is still some text left */ @@ -2214,7 +2214,7 @@ static void xcpg(anything **params, int num_surfaces, anything **surf_list) vdi_ls = (int)temp_array[4]; vdstls(&vdi_ls); } - } /* end if hollow OR no poly support */ + } /* end if hollow OR no poly support */ else { /* solid polygon */ vdpoly(xnew, ynew, &npnew); } @@ -2370,7 +2370,7 @@ static void xcca(anything **params, int num_surfaces, anything **surf_list) } /* end clip at top edge */ } /* end if ok */ - } /* end if clip is on */ + } /* end if clip is on */ /* make sure there is still something left */ ok = ok && (nx1 > 0 && ny1 > 0); @@ -2439,9 +2439,9 @@ static void xcca(anything **params, int num_surfaces, anything **surf_list) vdpixi(&ix, &iy, &cells[index], &nx1); index = index + nx; /* compute next index */ iy = iy + yinc; /* compute next raster line */ - } /* end for k */ - } /* end else no special case */ - } /* end x increasing */ + } /* end for k */ + } /* end else no special case */ + } /* end x increasing */ else { /* x decreasing */ @@ -2480,8 +2480,8 @@ static void xcca(anything **params, int num_surfaces, anything **surf_list) index = index + index_inc; } /* end for k */ - } /* end x decreasing */ - } /* end if indexed color */ + } /* end x decreasing */ + } /* end if indexed color */ else { /* direct color */ @@ -2529,7 +2529,7 @@ static void xcca(anything **params, int num_surfaces, anything **surf_list) index = index + index_inc; } /* end for k */ - } /* end if x increasing */ + } /* end if x increasing */ else { /* x decreasing */ @@ -2566,14 +2566,14 @@ static void xcca(anything **params, int num_surfaces, anything **surf_list) index = index + index_inc; } /* end for k */ - } /* end else x decreasing */ - } /* end else direct color */ + } /* end else x decreasing */ + } /* end else direct color */ /* flag that the page has been marked */ cur_state->pic_dirty = CDIRTY; } /* end if ok */ - } /* end for each surface */ + } /* end for each surface */ } /* end xcca */ /* PIXEL ARRAY */ @@ -2752,7 +2752,7 @@ static void xcpxa(anything **params, int num_surfaces, anything **surf_list) } /* end clip top edge */ } /* end if ok */ - } /* end if clip_on */ + } /* end if clip_on */ /* make sure there is still something to draw */ ok = ok && (nx1 > 0 && ny1 > 0); @@ -2822,9 +2822,9 @@ static void xcpxa(anything **params, int num_surfaces, anything **surf_list) vdpixi(&ix, &iy, &pxclrs[index], &nx1); index = index + nx; /* compute next index */ iy = iy + yinc; /* compute next raster line */ - } /* end for k */ - } /* end else no special case */ - } /* end x increasing */ + } /* end for k */ + } /* end else no special case */ + } /* end x increasing */ else { /* x decreasing */ @@ -2863,8 +2863,8 @@ static void xcpxa(anything **params, int num_surfaces, anything **surf_list) index = index + index_inc; } /* end for k */ - } /* end x decreasing */ - } /* end if indexed color */ + } /* end x decreasing */ + } /* end if indexed color */ else { /* direct color */ @@ -2911,7 +2911,7 @@ static void xcpxa(anything **params, int num_surfaces, anything **surf_list) index = index + index_inc; } /* end for k */ - } /* end if x increasing */ + } /* end if x increasing */ else { /* x decreasing */ @@ -2948,14 +2948,14 @@ static void xcpxa(anything **params, int num_surfaces, anything **surf_list) index = index + index_inc; } /* end for k */ - } /* end else x decreasing */ - } /* end else direct color */ + } /* end else x decreasing */ + } /* end else direct color */ /* flag that the page has been marked */ cur_state->pic_dirty = CDIRTY; } /* end if ok */ - } /* end for each surface */ + } /* end for each surface */ } /* end xcpxa */ /* LINE TYPE */ @@ -3339,8 +3339,8 @@ static void xccsm(anything **params, int num_surfaces, anything **surf_list) functions with affected parameters ignored until reset */ report_error(cur_state, 3, 305, *(short *)params[0]); cur_state->csm = -1; /* flag error condition */ - } /* end else must be an error */ - } /* end else */ + } /* end else must be an error */ + } /* end else */ } /* end for each surface */ } /* end xccsm */ @@ -4902,7 +4902,7 @@ static void set_foreground_color(surf_statelist *surf_state, int *colors) cur_state->vdi_attrib.fg_rgb[1] = -1.0; cur_state->vdi_attrib.fg_rgb[2] = -1.0; } /* end does foreground... */ - } /* end indexed color */ + } /* end indexed color */ else /* direct color */ @@ -4983,7 +4983,7 @@ static void set_background_color(surf_statelist *surf_state, int *colors) index = i; } } /* end for i */ - } /* end vector SVDI */ + } /* end vector SVDI */ /* is it close enough? */ if (dmin <= epsilon) { @@ -4995,7 +4995,7 @@ static void set_background_color(surf_statelist *surf_state, int *colors) vdstco(&one, &dev_descrip.index_array[cur_state->bg_index], &cur_state->vdi_attrib.bg_rgb, &dev_descrip.col_mode); cur_state->color_set = TRUE; /* flag that CT has been set */ - } /* end else not close enough */ + } /* end else not close enough */ } /* end has never been set */ @@ -5063,7 +5063,7 @@ static void report_error(surf_statelist *surf_state, int e_class, int e_num, int surf_state->err_queue[err_slot - 1].err_num = 0; surf_state->err_queue[err_slot - 1].func_id = 2; } /* end else create */ - } /* end not enuff room in the queue */ + } /* end not enuff room in the queue */ } /* end if error reporting is on */ } /* end report_error */ @@ -5102,7 +5102,7 @@ static void gettoken(int *index_p, int *numrecs_p, char *data_p, int max_chars, /* c is not whitespace, is start of token */ workstate = 1; } /* end if c is whitespace */ - } /* end while skipping whitespace */ + } /* end while skipping whitespace */ while (workstate == 1) { /* while in token */ c = data_p[*index_p]; @@ -5119,7 +5119,7 @@ static void gettoken(int *index_p, int *numrecs_p, char *data_p, int max_chars, if (*index_p >= *numrecs_p * 80) { workstate = 2; } /* end if off end of data */ - } /* end if c is whitespace */ + } /* end if c is whitespace */ } /* end while putting chars into outtoken */ @@ -5210,7 +5210,7 @@ static int poly_clip(point *cmin, point *cmax, float *vx, float *vy, int vlen, f xtemp[*lenout] = t.x; ytemp[(*lenout)++] = t.y; } /* end intersect */ - } /* end else p outside, s inside */ + } /* end else p outside, s inside */ s.x = p.x; s.y = p.y; @@ -5459,6 +5459,6 @@ void pstbuf(int *numwds, char *outary) cur_state->buff_ptr = 0; } /* end if > BUFFER_SIZE */ - } /* end for i=... */ + } /* end for i=... */ } } /* end pstbuf */ diff --git a/packages/seacas/libraries/svdi/cgi/sdcgi.c b/packages/seacas/libraries/svdi/cgi/sdcgi.c index ace531b598..1a38e2c815 100644 --- a/packages/seacas/libraries/svdi/cgi/sdcgi.c +++ b/packages/seacas/libraries/svdi/cgi/sdcgi.c @@ -435,8 +435,8 @@ void cdqerr_(f_integer *nreq, f_integer *vstat, f_integer *nrem, f_integer *nret surf_found = surf; break; } /* end if found on list */ - } /* end for */ - } /* end for all devices */ + } /* end for */ + } /* end for all devices */ if (dev_found != -1) { anything *temp_surface[] = {devices[dev_found].statelist[surf_found]}; @@ -538,8 +538,8 @@ void cqid_(f_integer *maxchr, f_integer *vstat, f_integer *dclass, char *devid) surf_found = surf; break; } /* end if found on list */ - } /* end for */ - } /* end for all devices */ + } /* end for */ + } /* end for all devices */ if (dev_found != -1) { anything *temp_surface[] = {devices[dev_found].statelist[surf_found]}; @@ -585,8 +585,8 @@ void cqd_(f_integer *vstat, f_integer *hscopy, f_integer *disp, f_integer *bcolo surf_found = surf; break; } /* end if found on list */ - } /* end for */ - } /* end for all devices */ + } /* end for */ + } /* end for all devices */ if (dev_found != -1) { anything *temp_surface[] = {devices[dev_found].statelist[surf_found]}; @@ -622,8 +622,8 @@ void clf_(f_integer *n, f_integer *funccl, f_integer *funcid, f_integer *vstat, surf_found = surf; break; } /* end if found on list */ - } /* end for */ - } /* end for all devices */ + } /* end for */ + } /* end for all devices */ if (dev_found != -1) { anything *temp_surface[] = {devices[dev_found].statelist[surf_found]}; @@ -659,8 +659,8 @@ void clpr_(f_integer *n, char *profid, f_integer *profid_size, f_integer *vstat, surf_found = surf; break; } /* end if found on list */ - } /* end for */ - } /* end for all devices */ + } /* end for */ + } /* end for all devices */ if (dev_found != -1) { anything *temp_surface[] = {devices[dev_found].statelist[surf_found]}; @@ -713,8 +713,8 @@ void cqsp_(f_integer *vstat, f_integer *nvip, f_integer *vip, f_integer *nvrp, f surf_found = surf; break; } /* end if found on list */ - } /* end for */ - } /* end for all devices */ + } /* end for */ + } /* end for all devices */ if (dev_found != -1) { anything *temp_surface[] = {devices[dev_found].statelist[surf_found]}; @@ -749,8 +749,8 @@ void clesc_(f_integer *n, f_integer *escid, f_integer *vstat, f_integer *supprt) surf_found = surf; break; } /* end if found on list */ - } /* end for */ - } /* end for all devices */ + } /* end for */ + } /* end for all devices */ if (dev_found != -1) { anything *temp_surface[] = {devices[dev_found].statelist[surf_found]}; @@ -796,8 +796,8 @@ void cqp_(f_integer *vstat, f_integer *vip, f_integer *vrfmt, f_integer *vrexp, surf_found = surf; break; } /* end if found on list */ - } /* end for */ - } /* end for all devices */ + } /* end for */ + } /* end for all devices */ if (dev_found != -1) { anything *temp_surface[] = {devices[dev_found].statelist[surf_found]}; @@ -834,8 +834,8 @@ void cqcl_(f_integer *vstat, f_integer *clip1, f_integer *clipr, f_integer *scli surf_found = surf; break; } /* end if found on list */ - } /* end for */ - } /* end for all devices */ + } /* end for */ + } /* end for all devices */ if (dev_found != -1) { anything *temp_surface[] = {devices[dev_found].statelist[surf_found]}; @@ -1259,8 +1259,8 @@ void cgtxx1_(f_real *x, f_real *y, char *string, f_integer *vstat, f_integer *vc surf_found = surf; break; } /* end if found on list */ - } /* end for */ - } /* end for all devices */ + } /* end for */ + } /* end for all devices */ if (dev_found != -1) { anything *temp_surface[] = {devices[dev_found].statelist[surf_found]}; @@ -1307,8 +1307,8 @@ void cqprl_(f_integer *vstat, f_integer *maxpl, f_integer *maxdpl, f_integer *ma surf_found = surf; break; } /* end if found on list */ - } /* end for */ - } /* end for all devices */ + } /* end for */ + } /* end for all devices */ if (dev_found != -1) { anything *temp_surface[] = {devices[dev_found].statelist[surf_found]}; @@ -1348,8 +1348,8 @@ void cqln_(f_integer *vstat, f_integer *npdefb, f_integer *nsetb, f_integer *max surf_found = surf; break; } /* end if found on list */ - } /* end for */ - } /* end for all devices */ + } /* end for */ + } /* end for all devices */ if (dev_found != -1) { anything *temp_surface[] = {devices[dev_found].statelist[surf_found]}; @@ -1387,8 +1387,8 @@ void cqlnt_(f_integer *nreq, f_integer *first, f_integer *vstat, f_integer *ntot surf_found = surf; break; } /* end if found on list */ - } /* end for */ - } /* end for all devices */ + } /* end for */ + } /* end for all devices */ if (dev_found != -1) { anything *temp_surface[] = {devices[dev_found].statelist[surf_found]}; @@ -1432,8 +1432,8 @@ void cqchh1_(char *font, f_integer *txp, f_integer *nreq, f_integer *first, f_in surf_found = surf; break; } /* end if found on list */ - } /* end for */ - } /* end for all devices */ + } /* end for */ + } /* end for all devices */ if (dev_found != -1) { anything *temp_surface[] = {devices[dev_found].statelist[surf_found]}; @@ -1481,8 +1481,8 @@ void cqfl_(f_integer *vstat, f_integer *npdefb, f_integer *nsetb, f_integer *max surf_found = surf; break; } /* end if found on list */ - } /* end for */ - } /* end for all devices */ + } /* end for */ + } /* end for all devices */ if (dev_found != -1) { anything *temp_surface[] = {devices[dev_found].statelist[surf_found]}; @@ -1522,8 +1522,8 @@ void cqc_(f_integer *vstat, f_integer *nsimul, f_integer *navail, f_integer *nin surf_found = surf; break; } /* end if found on list */ - } /* end for */ - } /* end for all devices */ + } /* end for */ + } /* end for all devices */ if (dev_found != -1) { anything *temp_surface[] = {devices[dev_found].statelist[surf_found]}; @@ -1563,8 +1563,8 @@ void cqlna_(f_integer *vstat, f_integer *lnbi, f_integer *lntyp, f_integer *lwmo surf_found = surf; break; } /* end if found on list */ - } /* end for */ - } /* end for all devices */ + } /* end for */ + } /* end for all devices */ if (dev_found != -1) { anything *temp_surface[] = {devices[dev_found].statelist[surf_found]}; @@ -1615,8 +1615,8 @@ void cqtxa_(f_integer *vstat, f_integer *txbi, f_integer *fonti, f_integer *font surf_found = surf; break; } /* end if found on list */ - } /* end for */ - } /* end for all devices */ + } /* end for */ + } /* end for all devices */ if (dev_found != -1) { anything *temp_surface[] = {devices[dev_found].statelist[surf_found]}; @@ -1654,8 +1654,8 @@ void cqcte_(f_integer *nreq, f_integer *first, f_integer *vstat, f_integer *ntot surf_found = surf; break; } /* end if found on list */ - } /* end for */ - } /* end for all devices */ + } /* end for */ + } /* end for all devices */ if (dev_found != -1) { anything *temp_surface[] = {devices[dev_found].statelist[surf_found]}; @@ -1688,8 +1688,8 @@ void cili_(f_integer *iclass, f_integer *idev) surf_found = surf; break; } /* end if found on list */ - } /* end for */ - } /* end for all devices */ + } /* end for */ + } /* end for all devices */ if (dev_found != -1) { anything *temp_surface[] = {devices[dev_found].statelist[surf_found]}; @@ -1729,8 +1729,8 @@ void crqlc_(f_integer *idev, f_real *timeout, f_integer *vstat, f_integer *rstat surf_found = surf; break; } /* end if found on list */ - } /* end for */ - } /* end for all devices */ + } /* end for */ + } /* end for all devices */ if (dev_found != -1) { anything *temp_surface[] = {devices[dev_found].statelist[surf_found]}; diff --git a/packages/seacas/libraries/svdi/cgi/x11_vdix11.c b/packages/seacas/libraries/svdi/cgi/x11_vdix11.c index 0c2398590d..d76acb023f 100644 --- a/packages/seacas/libraries/svdi/cgi/x11_vdix11.c +++ b/packages/seacas/libraries/svdi/cgi/x11_vdix11.c @@ -554,13 +554,13 @@ static int font_height, font_width; /* char size in device coord. */ #define map_y(yin) ((int)(x_height - (ypad + scale * (yin)))) /* macros which map X Windows coords. into ndc */ -#define ndc_map_x(xin) ((float)(((xin)-xpad) / scale)) +#define ndc_map_x(xin) ((float)(((xin) - xpad) / scale)) #define ndc_map_y(yin) ((float)(((x_height - (yin)) - ypad) / scale)) /* macro to convert measure in X window units into ndc units */ #define ndc_units(in) ((float)((in) / scale)) /* macro to convert measure in ndc into X window measure */ -#define x_units(in) ((int)((in)*scale)) +#define x_units(in) ((int)((in) * scale)) /* macro to convert ascii(integer) to char (note: machine dependent) */ #define a_to_c(ain) ((char)(ain)) /* for ascii machine */ diff --git a/packages/seacas/libraries/svdi/cgi/x11_x11xlate.c b/packages/seacas/libraries/svdi/cgi/x11_x11xlate.c index 6e7233fd07..7552f4b468 100644 --- a/packages/seacas/libraries/svdi/cgi/x11_x11xlate.c +++ b/packages/seacas/libraries/svdi/cgi/x11_x11xlate.c @@ -631,7 +631,7 @@ static void xci(anything **params, int num_surfaces, anything **surf_list) set_dev_descrip(); dev_descrip.set_flag = TRUE; } /* end if set_flag */ - } /* end if surface not initialized */ + } /* end if surface not initialized */ else { /* this surface has been initialized once already */ @@ -1131,7 +1131,7 @@ static void xcesc(anything **params, int num_surfaces, anything **surf_list) break; } /* end switch */ - } /* end for i */ + } /* end for i */ } /* end xcesc */ /* INQUIRE DEVICE IDENTIFICATION */ @@ -1524,7 +1524,7 @@ static void xcpl(anything **params, int num_surfaces, anything **surf_list) vdlina(&cur_x, &cur_y); } } /* end for j */ - } /* end no clipping on */ + } /* end no clipping on */ else { /* clipping is on */ @@ -1712,8 +1712,8 @@ static void xcpl(anything **params, int num_surfaces, anything **surf_list) default: done = TRUE; break; } /* end switch */ - } /* end while !done */ - } /* end while j*/ + } /* end while !done */ + } /* end while j*/ } /* end else clipping is on */ @@ -1768,7 +1768,7 @@ static void xcdjpl(anything **params, int num_surfaces, anything **surf_list) vdlina(&x2, &y2); } /* end for j */ - } /* end if clipping is off */ + } /* end if clipping is off */ else { /* clipping is on */ @@ -1929,9 +1929,9 @@ static void xcdjpl(anything **params, int num_surfaces, anything **surf_list) default: done = TRUE; break; } /* end switch */ - } /* end while !done */ - } /* end for j */ - } /* end else clipping is on */ + } /* end while !done */ + } /* end for j */ + } /* end else clipping is on */ /* flag that the page has been marked */ cur_state->pic_dirty = CDIRTY; @@ -2096,8 +2096,8 @@ static void xctx(anything **params, int num_surfaces, anything **surf_list) np = (int)((cur_state->clipmax.x - x) / char_width); } } /* end if ok in x */ - } /* end if ok in y */ - } /* end if clip_on */ + } /* end if ok in y */ + } /* end if clip_on */ ok = ok && np > 0; /* make sure there is still some text left */ @@ -2211,7 +2211,7 @@ static void xcpg(anything **params, int num_surfaces, anything **surf_list) vdi_ls = (int)temp_array[4]; vdstls(&vdi_ls); } - } /* end if hollow OR no poly support */ + } /* end if hollow OR no poly support */ else { /* solid polygon */ vdpoly(xnew, ynew, &npnew); } @@ -2367,7 +2367,7 @@ static void xcca(anything **params, int num_surfaces, anything **surf_list) } /* end clip at top edge */ } /* end if ok */ - } /* end if clip is on */ + } /* end if clip is on */ /* make sure there is still something left */ ok = ok && (nx1 > 0 && ny1 > 0); @@ -2436,9 +2436,9 @@ static void xcca(anything **params, int num_surfaces, anything **surf_list) vdpixi(&ix, &iy, &cells[index], &nx1); index = index + nx; /* compute next index */ iy = iy + yinc; /* compute next raster line */ - } /* end for k */ - } /* end else no special case */ - } /* end x increasing */ + } /* end for k */ + } /* end else no special case */ + } /* end x increasing */ else { /* x decreasing */ @@ -2477,8 +2477,8 @@ static void xcca(anything **params, int num_surfaces, anything **surf_list) index = index + index_inc; } /* end for k */ - } /* end x decreasing */ - } /* end if indexed color */ + } /* end x decreasing */ + } /* end if indexed color */ else { /* direct color */ @@ -2526,7 +2526,7 @@ static void xcca(anything **params, int num_surfaces, anything **surf_list) index = index + index_inc; } /* end for k */ - } /* end if x increasing */ + } /* end if x increasing */ else { /* x decreasing */ @@ -2563,14 +2563,14 @@ static void xcca(anything **params, int num_surfaces, anything **surf_list) index = index + index_inc; } /* end for k */ - } /* end else x decreasing */ - } /* end else direct color */ + } /* end else x decreasing */ + } /* end else direct color */ /* flag that the page has been marked */ cur_state->pic_dirty = CDIRTY; } /* end if ok */ - } /* end for each surface */ + } /* end for each surface */ } /* end xcca */ /* PIXEL ARRAY */ @@ -2749,7 +2749,7 @@ static void xcpxa(anything **params, int num_surfaces, anything **surf_list) } /* end clip top edge */ } /* end if ok */ - } /* end if clip_on */ + } /* end if clip_on */ /* make sure there is still something to draw */ ok = ok && (nx1 > 0 && ny1 > 0); @@ -2819,9 +2819,9 @@ static void xcpxa(anything **params, int num_surfaces, anything **surf_list) vdpixi(&ix, &iy, &pxclrs[index], &nx1); index = index + nx; /* compute next index */ iy = iy + yinc; /* compute next raster line */ - } /* end for k */ - } /* end else no special case */ - } /* end x increasing */ + } /* end for k */ + } /* end else no special case */ + } /* end x increasing */ else { /* x decreasing */ @@ -2860,8 +2860,8 @@ static void xcpxa(anything **params, int num_surfaces, anything **surf_list) index = index + index_inc; } /* end for k */ - } /* end x decreasing */ - } /* end if indexed color */ + } /* end x decreasing */ + } /* end if indexed color */ else { /* direct color */ @@ -2908,7 +2908,7 @@ static void xcpxa(anything **params, int num_surfaces, anything **surf_list) index = index + index_inc; } /* end for k */ - } /* end if x increasing */ + } /* end if x increasing */ else { /* x decreasing */ @@ -2945,14 +2945,14 @@ static void xcpxa(anything **params, int num_surfaces, anything **surf_list) index = index + index_inc; } /* end for k */ - } /* end else x decreasing */ - } /* end else direct color */ + } /* end else x decreasing */ + } /* end else direct color */ /* flag that the page has been marked */ cur_state->pic_dirty = CDIRTY; } /* end if ok */ - } /* end for each surface */ + } /* end for each surface */ } /* end xcpxa */ /* LINE TYPE */ @@ -3336,8 +3336,8 @@ static void xccsm(anything **params, int num_surfaces, anything **surf_list) functions with affected parameters ignored until reset */ report_error(cur_state, 3, 305, *(short *)params[0]); cur_state->csm = -1; /* flag error condition */ - } /* end else must be an error */ - } /* end else */ + } /* end else must be an error */ + } /* end else */ } /* end for each surface */ } /* end xccsm */ @@ -4895,7 +4895,7 @@ static void set_foreground_color(surf_statelist *surf_state, int *colors) cur_state->vdi_attrib.fg_rgb[1] = -1.0; cur_state->vdi_attrib.fg_rgb[2] = -1.0; } /* end does foreground... */ - } /* end indexed color */ + } /* end indexed color */ else /* direct color */ @@ -4976,7 +4976,7 @@ static void set_background_color(surf_statelist *surf_state, int *colors) index = i; } } /* end for i */ - } /* end vector SVDI */ + } /* end vector SVDI */ /* is it close enough? */ if (dmin <= epsilon) { @@ -4989,7 +4989,7 @@ static void set_background_color(surf_statelist *surf_state, int *colors) vdstco(&one, &dev_descrip.index_array[cur_state->bg_index], &cur_state->vdi_attrib.bg_rgb, &dev_descrip.col_mode); cur_state->color_set = TRUE; /* flag that CT has been set */ - } /* end else not close enough */ + } /* end else not close enough */ } /* end has never been set */ @@ -5057,7 +5057,7 @@ static void report_error(surf_statelist *surf_state, int e_class, int e_num, int surf_state->err_queue[err_slot - 1].err_num = 0; surf_state->err_queue[err_slot - 1].func_id = 2; } /* end else create */ - } /* end not enuff room in the queue */ + } /* end not enuff room in the queue */ } /* end if error reporting is on */ } /* end report_error */ @@ -5096,7 +5096,7 @@ static void gettoken(int *index_p, int *numrecs_p, char *data_p, int max_chars, /* c is not whitespace, is start of token */ workstate = 1; } /* end if c is whitespace */ - } /* end while skipping whitespace */ + } /* end while skipping whitespace */ while (workstate == 1) { /* while in token */ c = data_p[*index_p]; @@ -5113,7 +5113,7 @@ static void gettoken(int *index_p, int *numrecs_p, char *data_p, int max_chars, if (*index_p >= *numrecs_p * 80) { workstate = 2; } /* end if off end of data */ - } /* end if c is whitespace */ + } /* end if c is whitespace */ } /* end while putting chars into outtoken */ @@ -5204,7 +5204,7 @@ static int poly_clip(point *cmin, point *cmax, float *vx, float *vy, int vlen, f xtemp[*lenout] = t.x; ytemp[(*lenout)++] = t.y; } /* end intersect */ - } /* end else p outside, s inside */ + } /* end else p outside, s inside */ s.x = p.x; s.y = p.y; From e96214e96251a3108f8f9bfec492870c17c29d8a Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Wed, 10 Apr 2024 11:24:18 -0600 Subject: [PATCH 55/59] IOSS: Elements - clean up unneeded copy constructor deletion --- packages/seacas/libraries/ioss/src/elements/Ioss_Beam2.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Beam3.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Beam4.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Edge2.h | 3 --- .../seacas/libraries/ioss/src/elements/Ioss_Edge2D2.h | 3 --- .../seacas/libraries/ioss/src/elements/Ioss_Edge2D3.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Edge3.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Edge4.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Hex16.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Hex20.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Hex27.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Hex32.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Hex64.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Hex8.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Hex9.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Node.h | 3 --- .../seacas/libraries/ioss/src/elements/Ioss_Pyramid13.h | 3 --- .../seacas/libraries/ioss/src/elements/Ioss_Pyramid14.h | 3 --- .../seacas/libraries/ioss/src/elements/Ioss_Pyramid18.h | 3 --- .../seacas/libraries/ioss/src/elements/Ioss_Pyramid19.h | 3 --- .../seacas/libraries/ioss/src/elements/Ioss_Pyramid5.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Quad12.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Quad16.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Quad4.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Quad6.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Quad8.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Quad9.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Shell4.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Shell8.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Shell9.h | 3 --- .../libraries/ioss/src/elements/Ioss_ShellLine2D2.h | 3 --- .../libraries/ioss/src/elements/Ioss_ShellLine2D3.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Sphere.C | 8 +------- packages/seacas/libraries/ioss/src/elements/Ioss_Sphere.h | 5 ----- .../seacas/libraries/ioss/src/elements/Ioss_Spring2.h | 3 --- .../seacas/libraries/ioss/src/elements/Ioss_Spring3.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Super.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Tet10.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Tet11.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Tet14.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Tet15.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Tet16.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Tet4.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Tet40.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Tet7.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Tet8.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Tri13.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Tri3.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Tri4.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Tri4a.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Tri6.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Tri7.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Tri9.h | 3 --- .../seacas/libraries/ioss/src/elements/Ioss_TriShell3.h | 3 --- .../seacas/libraries/ioss/src/elements/Ioss_TriShell4.h | 3 --- .../seacas/libraries/ioss/src/elements/Ioss_TriShell6.h | 3 --- .../seacas/libraries/ioss/src/elements/Ioss_TriShell7.h | 3 --- .../seacas/libraries/ioss/src/elements/Ioss_Unknown.h | 3 --- .../seacas/libraries/ioss/src/elements/Ioss_Wedge12.h | 3 --- .../seacas/libraries/ioss/src/elements/Ioss_Wedge15.h | 3 --- .../seacas/libraries/ioss/src/elements/Ioss_Wedge16.h | 3 --- .../seacas/libraries/ioss/src/elements/Ioss_Wedge18.h | 3 --- .../seacas/libraries/ioss/src/elements/Ioss_Wedge20.h | 3 --- .../seacas/libraries/ioss/src/elements/Ioss_Wedge21.h | 3 --- .../seacas/libraries/ioss/src/elements/Ioss_Wedge24.h | 3 --- .../seacas/libraries/ioss/src/elements/Ioss_Wedge52.h | 3 --- packages/seacas/libraries/ioss/src/elements/Ioss_Wedge6.h | 3 --- 67 files changed, 1 insertion(+), 207 deletions(-) diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Beam2.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Beam2.h index c73d9f9a18..0ccc45845e 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Beam2.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Beam2.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Beam2 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Beam2(const Beam2 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::LINE; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Beam3.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Beam3.h index 6127ff9aaa..7d65830eed 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Beam3.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Beam3.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Beam3 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Beam3(const Beam3 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::LINE; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Beam4.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Beam4.h index 01d2a93457..aaa35fae00 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Beam4.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Beam4.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Beam4 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Beam4(const Beam4 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::LINE; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Edge2.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Edge2.h index f3d18aea7b..23f18d12b4 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Edge2.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Edge2.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Edge2 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Edge2(const Edge2 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::LINE; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Edge2D2.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Edge2D2.h index ddfee9384b..f01476551c 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Edge2D2.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Edge2D2.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Edge2D2 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Edge2D2(const Edge2D2 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::LINE; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Edge2D3.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Edge2D3.h index 54ecfa0433..8fc4ae6ec5 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Edge2D3.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Edge2D3.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Edge2D3 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Edge2D3(const Edge2D3 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::LINE; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Edge3.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Edge3.h index bc33c99145..7bf9864631 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Edge3.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Edge3.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Edge3 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Edge3(const Edge3 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::LINE; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Edge4.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Edge4.h index 8caa766a89..013d4432c8 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Edge4.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Edge4.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Edge4 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Edge4(const Edge4 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::LINE; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Hex16.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Hex16.h index 3ae2a9d9a4..e606cc0894 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Hex16.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Hex16.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Hex16 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Hex16(const Hex16 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::HEX; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Hex20.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Hex20.h index 0674a13668..fc1299f847 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Hex20.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Hex20.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Hex20 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Hex20(const Hex20 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::HEX; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Hex27.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Hex27.h index 6d62cf3754..fd47e699b3 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Hex27.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Hex27.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Hex27 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Hex27(const Hex27 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::HEX; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Hex32.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Hex32.h index 6504038288..7871d1cfdf 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Hex32.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Hex32.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Hex32 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Hex32(const Hex32 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::HEX; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Hex64.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Hex64.h index e98e0de3f4..69e87e0c64 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Hex64.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Hex64.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Hex64 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Hex64(const Hex64 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::HEX; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Hex8.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Hex8.h index ae1dd55579..8eb953d318 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Hex8.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Hex8.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Hex8 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Hex8(const Hex8 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::HEX; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Hex9.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Hex9.h index f1bb7b0ddb..7396877620 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Hex9.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Hex9.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Hex9 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Hex9(const Hex9 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::HEX; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Node.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Node.h index af20d1b037..4cd9bfdb99 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Node.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Node.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Node : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Node(const Node &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::POINT; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Pyramid13.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Pyramid13.h index b419998e10..30a763ba89 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Pyramid13.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Pyramid13.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Pyramid13 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Pyramid13(const Pyramid13 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::PYRAMID; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Pyramid14.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Pyramid14.h index ebf0ba204f..46525ac233 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Pyramid14.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Pyramid14.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Pyramid14 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Pyramid14(const Pyramid14 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::PYRAMID; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Pyramid18.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Pyramid18.h index d2f8ae6441..b0b1e005ba 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Pyramid18.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Pyramid18.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Pyramid18 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Pyramid18(const Pyramid18 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::PYRAMID; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Pyramid19.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Pyramid19.h index c511ff8f01..e04e3f096c 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Pyramid19.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Pyramid19.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Pyramid19 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Pyramid19(const Pyramid19 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::PYRAMID; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Pyramid5.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Pyramid5.h index 189a625a06..4c4f658afb 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Pyramid5.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Pyramid5.h @@ -12,8 +12,6 @@ #include "ioss_export.h" -// STL Includes - namespace Ioss { class IOSS_EXPORT Pyramid5 : public Ioss::ElementTopology { @@ -22,7 +20,6 @@ namespace Ioss { static const char *name; static void factory(); - Pyramid5(const Pyramid5 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::PYRAMID; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Quad12.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Quad12.h index 98e25f8f70..e10b72b0f6 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Quad12.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Quad12.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Quad12 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Quad12(const Quad12 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::QUAD; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Quad16.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Quad16.h index e06462d5c9..2cc9f19fe4 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Quad16.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Quad16.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Quad16 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Quad16(const Quad16 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::QUAD; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Quad4.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Quad4.h index 67c4af13b0..5c25bee1d0 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Quad4.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Quad4.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Quad4 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Quad4(const Quad4 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::QUAD; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Quad6.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Quad6.h index e4b1e35a8a..634ebf2b51 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Quad6.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Quad6.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Quad6 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Quad6(const Quad6 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::QUAD; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Quad8.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Quad8.h index 5de29ff588..d2ab670b91 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Quad8.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Quad8.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Quad8 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Quad8(const Quad8 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::QUAD; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Quad9.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Quad9.h index 4f51d8068e..09f8e34afc 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Quad9.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Quad9.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Quad9 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Quad9(const Quad9 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::QUAD; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Shell4.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Shell4.h index d02163b514..dd191b9dea 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Shell4.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Shell4.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Shell4 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Shell4(const Shell4 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::QUAD; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Shell8.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Shell8.h index b194974a77..d1bb8380dd 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Shell8.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Shell8.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Shell8 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Shell8(const Shell8 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::QUAD; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Shell9.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Shell9.h index cd290e9ce7..5810331e3e 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Shell9.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Shell9.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Shell9 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Shell9(const Shell9 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::QUAD; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_ShellLine2D2.h b/packages/seacas/libraries/ioss/src/elements/Ioss_ShellLine2D2.h index d12bd531fc..2b7da77440 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_ShellLine2D2.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_ShellLine2D2.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT ShellLine2D2 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - ShellLine2D2(const ShellLine2D2 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::LINE; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_ShellLine2D3.h b/packages/seacas/libraries/ioss/src/elements/Ioss_ShellLine2D3.h index b2568d9eb7..666c07b9a9 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_ShellLine2D3.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_ShellLine2D3.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT ShellLine2D3 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - ShellLine2D3(const ShellLine2D3 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::LINE; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Sphere.C b/packages/seacas/libraries/ioss/src/elements/Ioss_Sphere.C index 91551431cd..2cdfc5a4cb 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Sphere.C +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Sphere.C @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2021 National Technology & Engineering Solutions +// Copyright(C) 1999-2021, 2024 National Technology & Engineering Solutions // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with // NTESS, the U.S. Government retains certain rights in this software. // @@ -58,12 +58,6 @@ Ioss::Sphere::Sphere() : Ioss::ElementTopology(Ioss::Sphere::name, "Particle") Ioss::ElementTopology::alias(Ioss::Sphere::name, "point1"); } -const std::string &Ioss::Sphere::base_topology_permutation_name() const -{ - static std::string permutationName(Ioss::SpherePermutation::name); - return permutationName; -} - int Ioss::Sphere::parametric_dimension() const { return 0; } int Ioss::Sphere::spatial_dimension() const { return 3; } int Ioss::Sphere::order() const { return 1; } diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Sphere.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Sphere.h index 38ac65b8c9..ad3c8f2e78 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Sphere.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Sphere.h @@ -12,8 +12,6 @@ #include "ioss_export.h" -// STL Includes - namespace Ioss { class IOSS_EXPORT Sphere : public Ioss::ElementTopology { @@ -22,7 +20,6 @@ namespace Ioss { static const char *name; static void factory(); - Sphere(const Sphere &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::SPHERE; } IOSS_NODISCARD int spatial_dimension() const override; @@ -47,8 +44,6 @@ namespace Ioss { IOSS_NODISCARD Ioss::ElementTopology *face_type(int face_number = 0) const override; IOSS_NODISCARD Ioss::ElementTopology *edge_type(int edge_number = 0) const override; - IOSS_NODISCARD const std::string &base_topology_permutation_name() const override; - protected: Sphere(); }; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Spring2.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Spring2.h index 4c2e6d1414..2fd9c3706c 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Spring2.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Spring2.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Spring2 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Spring2(const Spring2 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::SPRING; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Spring3.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Spring3.h index b31a8bae5a..84ac4e7075 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Spring3.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Spring3.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Spring3 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Spring3(const Spring3 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::SPRING; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Super.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Super.h index d72a58a2c5..7024ec03fc 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Super.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Super.h @@ -18,8 +18,6 @@ namespace Ioss { class ElementVariableType; } // namespace Ioss -// STL Includes - namespace Ioss { class IOSS_EXPORT Super : public Ioss::ElementTopology @@ -30,7 +28,6 @@ namespace Ioss { static void factory(); Super(const std::string &my_name, int node_count); - Super(const Super &) = delete; virtual ~Super() override; static void make_super(const std::string &type); diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Tet10.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Tet10.h index 7aeada49c2..3dd57e5978 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Tet10.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Tet10.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Tet10 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Tet10(const Tet10 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::TET; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Tet11.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Tet11.h index f11a776e49..a40535ae9c 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Tet11.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Tet11.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Tet11 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Tet11(const Tet11 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::TET; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Tet14.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Tet14.h index b80253ab66..d49d8df091 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Tet14.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Tet14.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Tet14 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Tet14(const Tet14 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::TET; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Tet15.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Tet15.h index bd8d1b520c..9206d610e4 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Tet15.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Tet15.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Tet15 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Tet15(const Tet15 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::TET; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Tet16.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Tet16.h index f9492adc2d..3aeeb9a80f 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Tet16.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Tet16.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Tet16 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Tet16(const Tet16 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::TET; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Tet4.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Tet4.h index a88ed685b4..0c438907a6 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Tet4.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Tet4.h @@ -12,8 +12,6 @@ #include "ioss_export.h" -// STL Includes - namespace Ioss { class IOSS_EXPORT Tet4 : public Ioss::ElementTopology { @@ -22,7 +20,6 @@ namespace Ioss { static const char *name; static void factory(); - Tet4(const Tet4 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::TET; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Tet40.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Tet40.h index 5179fafdb3..f6bb8643b9 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Tet40.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Tet40.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Tet40 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Tet40(const Tet40 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::TET; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Tet7.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Tet7.h index 7b6f0a2e36..e938cd7e9b 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Tet7.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Tet7.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Tet7 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Tet7(const Tet7 &) = delete; ElementShape shape() const override { return ElementShape::TET; } int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Tet8.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Tet8.h index ade3eef399..3ee5955fb8 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Tet8.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Tet8.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Tet8 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Tet8(const Tet8 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::TET; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Tri13.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Tri13.h index ba2b2ed49a..fa81cc346e 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Tri13.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Tri13.h @@ -12,8 +12,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Tri13 : public Ioss::ElementTopology { @@ -22,7 +20,6 @@ namespace Ioss { static const char *name; static void factory(); - Tri13(const Tri13 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::TRI; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Tri3.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Tri3.h index b92d656710..b0c874abb2 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Tri3.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Tri3.h @@ -11,8 +11,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Tri3 : public Ioss::ElementTopology { @@ -21,7 +19,6 @@ namespace Ioss { static const char *name; static void factory(); - Tri3(const Tri3 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::TRI; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Tri4.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Tri4.h index 0b812bb6d6..e27d75631d 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Tri4.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Tri4.h @@ -12,8 +12,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Tri4 : public Ioss::ElementTopology { @@ -22,7 +20,6 @@ namespace Ioss { static const char *name; static void factory(); - Tri4(const Tri4 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::TRI; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Tri4a.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Tri4a.h index 367731209c..284b6bf767 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Tri4a.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Tri4a.h @@ -12,8 +12,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Tri4a : public Ioss::ElementTopology { @@ -22,7 +20,6 @@ namespace Ioss { static const char *name; static void factory(); - Tri4a(const Tri4a &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::TRI; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Tri6.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Tri6.h index ebbbc8c044..7ec6111931 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Tri6.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Tri6.h @@ -12,8 +12,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Tri6 : public Ioss::ElementTopology { @@ -22,7 +20,6 @@ namespace Ioss { static const char *name; static void factory(); - Tri6(const Tri6 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::TRI; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Tri7.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Tri7.h index d4874fca2e..22a38c3484 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Tri7.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Tri7.h @@ -12,8 +12,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Tri7 : public Ioss::ElementTopology { @@ -22,7 +20,6 @@ namespace Ioss { static const char *name; static void factory(); - Tri7(const Tri7 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::TRI; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Tri9.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Tri9.h index 120cf0be46..748e2cf4ee 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Tri9.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Tri9.h @@ -12,8 +12,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Tri9 : public Ioss::ElementTopology { @@ -22,7 +20,6 @@ namespace Ioss { static const char *name; static void factory(); - Tri9(const Tri9 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::TRI; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_TriShell3.h b/packages/seacas/libraries/ioss/src/elements/Ioss_TriShell3.h index 5c15a14642..eb9623ccbf 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_TriShell3.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_TriShell3.h @@ -12,8 +12,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT TriShell3 : public Ioss::ElementTopology { @@ -22,7 +20,6 @@ namespace Ioss { static const char *name; static void factory(); - TriShell3(const TriShell3 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::TRI; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_TriShell4.h b/packages/seacas/libraries/ioss/src/elements/Ioss_TriShell4.h index b426294999..0c2261fdd8 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_TriShell4.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_TriShell4.h @@ -12,8 +12,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT TriShell4 : public Ioss::ElementTopology { @@ -22,7 +20,6 @@ namespace Ioss { static const char *name; static void factory(); - TriShell4(const TriShell4 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::TRI; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_TriShell6.h b/packages/seacas/libraries/ioss/src/elements/Ioss_TriShell6.h index ed0af52b73..cbdffbcacf 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_TriShell6.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_TriShell6.h @@ -12,8 +12,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT TriShell6 : public Ioss::ElementTopology { @@ -22,7 +20,6 @@ namespace Ioss { static const char *name; static void factory(); - TriShell6(const TriShell6 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::TRI; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_TriShell7.h b/packages/seacas/libraries/ioss/src/elements/Ioss_TriShell7.h index 5e80b82f1b..63c87f12a6 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_TriShell7.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_TriShell7.h @@ -12,8 +12,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT TriShell7 : public Ioss::ElementTopology { @@ -22,7 +20,6 @@ namespace Ioss { static const char *name; static void factory(); - TriShell7(const TriShell7 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::TRI; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Unknown.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Unknown.h index e0b878fb10..e1e41713bd 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Unknown.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Unknown.h @@ -12,8 +12,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Unknown : public Ioss::ElementTopology { @@ -22,7 +20,6 @@ namespace Ioss { static const char *name; static void factory(); - Unknown(const Unknown &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::UNKNOWN; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge12.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge12.h index 9dcb227006..ff00f0323e 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge12.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge12.h @@ -12,8 +12,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Wedge12 : public Ioss::ElementTopology { @@ -22,7 +20,6 @@ namespace Ioss { static const char *name; static void factory(); - Wedge12(const Wedge12 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::WEDGE; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge15.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge15.h index 3089a4fd5b..cbe669742b 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge15.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge15.h @@ -12,8 +12,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Wedge15 : public Ioss::ElementTopology { @@ -22,7 +20,6 @@ namespace Ioss { static const char *name; static void factory(); - Wedge15(const Wedge15 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::WEDGE; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge16.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge16.h index f7510ddbf6..ce648f922e 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge16.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge16.h @@ -12,8 +12,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Wedge16 : public Ioss::ElementTopology { @@ -22,7 +20,6 @@ namespace Ioss { static const char *name; static void factory(); - Wedge16(const Wedge16 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::WEDGE; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge18.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge18.h index 0870c88515..22404ed6dc 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge18.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge18.h @@ -12,8 +12,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Wedge18 : public Ioss::ElementTopology { @@ -22,7 +20,6 @@ namespace Ioss { static const char *name; static void factory(); - Wedge18(const Wedge18 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::WEDGE; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge20.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge20.h index 93c7ce5174..605c0d283a 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge20.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge20.h @@ -12,8 +12,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Wedge20 : public Ioss::ElementTopology { @@ -22,7 +20,6 @@ namespace Ioss { static const char *name; static void factory(); - Wedge20(const Wedge20 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::WEDGE; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge21.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge21.h index 8792eafe60..8b0bdd589d 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge21.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge21.h @@ -12,8 +12,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Wedge21 : public Ioss::ElementTopology { @@ -22,7 +20,6 @@ namespace Ioss { static const char *name; static void factory(); - Wedge21(const Wedge21 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::WEDGE; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge24.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge24.h index 0e2a94b3d5..691399c1e3 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge24.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge24.h @@ -12,8 +12,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Wedge24 : public Ioss::ElementTopology { @@ -22,7 +20,6 @@ namespace Ioss { static const char *name; static void factory(); - Wedge24(const Wedge24 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::WEDGE; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge52.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge52.h index 7931ae1c72..a3c7dc3705 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge52.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge52.h @@ -12,8 +12,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Wedge52 : public Ioss::ElementTopology { @@ -22,7 +20,6 @@ namespace Ioss { static const char *name; static void factory(); - Wedge52(const Wedge52 &) = delete; IOSS_NODISCARD ElementShape shape() const override { return ElementShape::WEDGE; } IOSS_NODISCARD int spatial_dimension() const override; diff --git a/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge6.h b/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge6.h index dd01fef1be..95c8bda600 100644 --- a/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge6.h +++ b/packages/seacas/libraries/ioss/src/elements/Ioss_Wedge6.h @@ -12,8 +12,6 @@ #include "Ioss_CodeTypes.h" // for IntVector #include "Ioss_ElementTopology.h" // for ElementTopology -// STL Includes - namespace Ioss { class IOSS_EXPORT Wedge6 : public Ioss::ElementTopology { @@ -22,7 +20,6 @@ namespace Ioss { static const char *name; static void factory(); - Wedge6(const Wedge6 &) = delete; IOSS_NODISCARD int spatial_dimension() const override; IOSS_NODISCARD int parametric_dimension() const override; From 9d6030e42723f93dccd5e960b3b25cde00c784d4 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Wed, 10 Apr 2024 11:24:54 -0600 Subject: [PATCH 56/59] IOSS: Clean up constructors --- packages/seacas/libraries/ioss/src/main/vector3d.C | 12 +----------- packages/seacas/libraries/ioss/src/main/vector3d.h | 7 ++----- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/packages/seacas/libraries/ioss/src/main/vector3d.C b/packages/seacas/libraries/ioss/src/main/vector3d.C index c054cc98ae..dabf77cfca 100644 --- a/packages/seacas/libraries/ioss/src/main/vector3d.C +++ b/packages/seacas/libraries/ioss/src/main/vector3d.C @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2020, 2023 National Technology & Engineering Solutions +// Copyright(C) 1999-2020, 2023, 2024 National Technology & Engineering Solutions // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with // NTESS, the U.S. Government retains certain rights in this software. // @@ -8,18 +8,10 @@ #include "vector3d.h" -//---------------------------------------------------------------------------- -vector3d::vector3d() = default; - //---------------------------------------------------------------------------- vector3d::vector3d(double X, double Y, double Z) : x(X), y(Y), z(Z) {} //---------------------------------------------------------------------------- -vector3d::vector3d(double location[3]) : x(location[0]), y(location[1]), z(location[2]) {} - -//---------------------------------------------------------------------------- -vector3d::vector3d(const vector3d &from) = default; - void vector3d::set(double X, double Y, double Z) { x = X; @@ -34,8 +26,6 @@ void vector3d::set(const double location[3]) z = location[2]; } -vector3d &vector3d::operator=(const vector3d &from) = default; - vector3d &vector3d::reverse() { x = -x; diff --git a/packages/seacas/libraries/ioss/src/main/vector3d.h b/packages/seacas/libraries/ioss/src/main/vector3d.h index 68beaba3e1..d0f2925905 100644 --- a/packages/seacas/libraries/ioss/src/main/vector3d.h +++ b/packages/seacas/libraries/ioss/src/main/vector3d.h @@ -1,5 +1,5 @@ /* - * Copyright(C) 1999-2020, 2022, 2023 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022, 2023, 2024 National Technology & Engineering Solutions * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with * NTESS, the U.S. Government retains certain rights in this software. * @@ -11,14 +11,11 @@ class vector3d { public: // construction - vector3d(); + vector3d() = default; vector3d(double X, double Y, double Z); - explicit vector3d(double location[3]); - vector3d(const vector3d &from); double x{}, y{}, z{}; - vector3d &operator=(const vector3d &from); bool operator==(const vector3d &from) const; bool operator!=(const vector3d &from) const; void set(double X, double Y, double Z); From 14680f2c6bae40820ef50e4de2a9f0aa5a97c4da Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Wed, 10 Apr 2024 11:25:46 -0600 Subject: [PATCH 57/59] IOSS: Clean up unused name --- .../ioss/src/Ioss_ElementPermutation.C | 49 +++++-------------- .../ioss/src/Ioss_ElementPermutation.h | 38 -------------- 2 files changed, 12 insertions(+), 75 deletions(-) diff --git a/packages/seacas/libraries/ioss/src/Ioss_ElementPermutation.C b/packages/seacas/libraries/ioss/src/Ioss_ElementPermutation.C index cc06d4806c..f5ee114d62 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_ElementPermutation.C +++ b/packages/seacas/libraries/ioss/src/Ioss_ElementPermutation.C @@ -49,7 +49,7 @@ namespace Ioss { auto iter = registry().find(ltype); if (iter == registry().end()) { - std::string base1 = Ioss::SuperPermutation::basename; + std::string base1{"super"}; if (ltype.compare(0, base1.length(), base1) == 0) { // A ring permutation can have a varying number of nodes. Create // a permutation type for this ring permutation. The node count @@ -227,61 +227,46 @@ namespace Ioss { bool ElementPermutation::equal(const ElementPermutation &rhs) const { return equal_(rhs, false); } //==================================================================================================== - const char *NullPermutation::name = "none"; - void NullPermutation::factory() { static NullPermutation registerThis; } - NullPermutation::NullPermutation() : ElementPermutation(NullPermutation::name) - { - set_permutation(0, 0, 0, {}); - } + NullPermutation::NullPermutation() : ElementPermutation("none") { set_permutation(0, 0, 0, {}); } //==================================================================================================== - const char *SpherePermutation::name = "sphere"; - void SpherePermutation::factory() { static SpherePermutation registerThis; } - SpherePermutation::SpherePermutation() : ElementPermutation(SpherePermutation::name) + SpherePermutation::SpherePermutation() : ElementPermutation("sphere") { set_permutation(1, 1, 1, {{0}}); } //==================================================================================================== - const char *LinePermutation::name = "line"; - void LinePermutation::factory() { static LinePermutation registerThis; } - LinePermutation::LinePermutation() : ElementPermutation(LinePermutation::name) + LinePermutation::LinePermutation() : ElementPermutation("line") { set_permutation(2, 2, 1, {{0, 1}, {1, 0}}); } //==================================================================================================== - const char *SpringPermutation::name = "spring"; - void SpringPermutation::factory() { static SpringPermutation registerThis; } - SpringPermutation::SpringPermutation() : ElementPermutation(SpringPermutation::name) + SpringPermutation::SpringPermutation() : ElementPermutation("spring") { set_permutation(2, 2, 2, {{0, 1}, {1, 0}}); } //==================================================================================================== - const char *TriPermutation::name = "tri"; - void TriPermutation::factory() { static TriPermutation registerThis; } - TriPermutation::TriPermutation() : ElementPermutation(TriPermutation::name) + TriPermutation::TriPermutation() : ElementPermutation("tri") { set_permutation(3, 6, 3, {{0, 1, 2}, {2, 0, 1}, {1, 2, 0}, {0, 2, 1}, {2, 1, 0}, {1, 0, 2}}); } //==================================================================================================== - const char *QuadPermutation::name = "quad"; - void QuadPermutation::factory() { static QuadPermutation registerThis; } - QuadPermutation::QuadPermutation() : ElementPermutation(QuadPermutation::name) + QuadPermutation::QuadPermutation() : ElementPermutation("quad") { set_permutation(4, 8, 4, {{0, 1, 2, 3}, @@ -295,11 +280,9 @@ namespace Ioss { } //==================================================================================================== - const char *TetPermutation::name = "tet"; - void TetPermutation::factory() { static TetPermutation registerThis; } - TetPermutation::TetPermutation() : ElementPermutation(TetPermutation::name) + TetPermutation::TetPermutation() : ElementPermutation("tet") { set_permutation(4, 12, 12, {{0, 1, 2, 3}, @@ -317,21 +300,17 @@ namespace Ioss { } //==================================================================================================== - const char *PyramidPermutation::name = "pyramid"; - void PyramidPermutation::factory() { static PyramidPermutation registerThis; } - PyramidPermutation::PyramidPermutation() : ElementPermutation(PyramidPermutation::name) + PyramidPermutation::PyramidPermutation() : ElementPermutation("pyramid") { set_permutation(5, 4, 4, {{0, 1, 2, 3, 4}, {1, 2, 3, 0, 4}, {2, 3, 0, 1, 4}, {3, 0, 1, 2, 4}}); } //==================================================================================================== - const char *WedgePermutation::name = "wedge"; - void WedgePermutation::factory() { static WedgePermutation registerThis; } - WedgePermutation::WedgePermutation() : ElementPermutation(WedgePermutation::name) + WedgePermutation::WedgePermutation() : ElementPermutation("wedge") { set_permutation(6, 6, 6, {{0, 1, 2, 3, 4, 5}, @@ -343,11 +322,9 @@ namespace Ioss { } //==================================================================================================== - const char *HexPermutation::name = "hex"; - void HexPermutation::factory() { static HexPermutation registerThis; } - HexPermutation::HexPermutation() : ElementPermutation(HexPermutation::name) + HexPermutation::HexPermutation() : ElementPermutation("hex") { set_permutation(8, 24, 24, {{0, 1, 2, 3, 4, 5, 6, 7}, {0, 1, 5, 4, 3, 2, 6, 7}, {0, 4, 7, 3, 1, 5, 6, 2}, @@ -366,9 +343,7 @@ namespace Ioss { // {0, 1, 2, 3}, {1, 2, 3, 0}, {2, 3, 0, 1}, {3, 0, 1, 2} // and the following negative permutations // {0, 3, 2, 1}, {3, 2, 1, 0}, {2, 1, 0, 3}, {1, 0, 3, 2} - const char *SuperPermutation::basename = "super"; - - std::string SuperPermutation::get_name(unsigned n) { return basename + std::to_string(n); } + std::string SuperPermutation::get_name(unsigned n) { return "super" + std::to_string(n); } void SuperPermutation::make_super(const std::string &type) { diff --git a/packages/seacas/libraries/ioss/src/Ioss_ElementPermutation.h b/packages/seacas/libraries/ioss/src/Ioss_ElementPermutation.h index 6004627f1d..5cc1bafa97 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_ElementPermutation.h +++ b/packages/seacas/libraries/ioss/src/Ioss_ElementPermutation.h @@ -59,11 +59,6 @@ namespace Ioss { class IOSS_EXPORT ElementPermutation { public: - ElementPermutation(const ElementPermutation &) = delete; - ElementPermutation &operator=(const ElementPermutation &) = delete; - - virtual ~ElementPermutation() = default; - IOSS_NODISCARD unsigned num_permutations() const; // The number of positive permutations must be less than or equal to the total number of @@ -139,10 +134,7 @@ namespace Ioss { class IOSS_EXPORT NullPermutation : public ElementPermutation { public: - static const char *name; - static void factory(); - NullPermutation(const NullPermutation &) = delete; protected: NullPermutation(); @@ -151,10 +143,7 @@ namespace Ioss { class IOSS_EXPORT SpherePermutation : public ElementPermutation { public: - static const char *name; - static void factory(); - SpherePermutation(const SpherePermutation &) = delete; protected: SpherePermutation(); @@ -163,10 +152,7 @@ namespace Ioss { class IOSS_EXPORT LinePermutation : public ElementPermutation { public: - static const char *name; - static void factory(); - LinePermutation(const LinePermutation &) = delete; protected: LinePermutation(); @@ -175,10 +161,7 @@ namespace Ioss { class IOSS_EXPORT SpringPermutation : public ElementPermutation { public: - static const char *name; - static void factory(); - SpringPermutation(const SpringPermutation &) = delete; protected: SpringPermutation(); @@ -187,10 +170,7 @@ namespace Ioss { class IOSS_EXPORT TriPermutation : public ElementPermutation { public: - static const char *name; - static void factory(); - TriPermutation(const TriPermutation &) = delete; protected: TriPermutation(); @@ -199,10 +179,7 @@ namespace Ioss { class IOSS_EXPORT QuadPermutation : public ElementPermutation { public: - static const char *name; - static void factory(); - QuadPermutation(const QuadPermutation &) = delete; protected: QuadPermutation(); @@ -211,10 +188,7 @@ namespace Ioss { class IOSS_EXPORT TetPermutation : public ElementPermutation { public: - static const char *name; - static void factory(); - TetPermutation(const TetPermutation &) = delete; protected: TetPermutation(); @@ -223,10 +197,7 @@ namespace Ioss { class IOSS_EXPORT PyramidPermutation : public ElementPermutation { public: - static const char *name; - static void factory(); - PyramidPermutation(const PyramidPermutation &) = delete; protected: PyramidPermutation(); @@ -235,10 +206,7 @@ namespace Ioss { class IOSS_EXPORT WedgePermutation : public ElementPermutation { public: - static const char *name; - static void factory(); - WedgePermutation(const WedgePermutation &) = delete; protected: WedgePermutation(); @@ -247,10 +215,7 @@ namespace Ioss { class IOSS_EXPORT HexPermutation : public ElementPermutation { public: - static const char *name; - static void factory(); - HexPermutation(const HexPermutation &) = delete; protected: HexPermutation(); @@ -259,12 +224,9 @@ namespace Ioss { class IOSS_EXPORT SuperPermutation : public ElementPermutation { public: - static const char *basename; - static void make_super(const std::string &type); static void factory(); static void factory(unsigned n); - SuperPermutation(const SuperPermutation &) = delete; static std::string get_name(unsigned n); From a741dd6ddb10cc3acfe8ec5916ea01f52b2cdda0 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Wed, 10 Apr 2024 11:26:33 -0600 Subject: [PATCH 58/59] IOSS: Clang-tidy suggestions --- .../libraries/ioss/src/Ioss_CoordinateFrame.h | 2 +- .../libraries/ioss/src/Ioss_ElementTopology.h | 9 +++--- .../libraries/ioss/src/Ioss_FaceBlock.h | 2 -- .../libraries/ioss/src/Ioss_FieldManager.h | 2 +- .../libraries/ioss/src/Ioss_GetLongOpt.C | 12 +++----- .../libraries/ioss/src/Ioss_GetLongOpt.h | 6 ++-- .../libraries/ioss/src/Ioss_NullEntity.C | 1 + .../seacas/libraries/ioss/src/Ioss_Property.h | 2 +- .../libraries/ioss/src/Ioss_PropertyManager.C | 1 - .../seacas/libraries/ioss/src/Ioss_Utils.h | 29 +++++++++---------- .../libraries/ioss/src/Ioss_VariableType.h | 8 +++-- .../ioss/src/cgns/Iocgns_StructuredZoneData.C | 4 +-- 12 files changed, 35 insertions(+), 43 deletions(-) diff --git a/packages/seacas/libraries/ioss/src/Ioss_CoordinateFrame.h b/packages/seacas/libraries/ioss/src/Ioss_CoordinateFrame.h index 46795e00b9..ba434eccd9 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_CoordinateFrame.h +++ b/packages/seacas/libraries/ioss/src/Ioss_CoordinateFrame.h @@ -32,7 +32,7 @@ namespace Ioss { IOSS_NODISCARD bool equal(const Ioss::CoordinateFrame &rhs) const; private: - bool equal_(const Ioss::CoordinateFrame &rhs, bool quiet) const; + IOSS_NODISCARD bool equal_(const Ioss::CoordinateFrame &rhs, bool quiet) const; std::vector pointList_{}; int64_t id_{}; char tag_; diff --git a/packages/seacas/libraries/ioss/src/Ioss_ElementTopology.h b/packages/seacas/libraries/ioss/src/Ioss_ElementTopology.h index d36f62b54f..7271122eb3 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_ElementTopology.h +++ b/packages/seacas/libraries/ioss/src/Ioss_ElementTopology.h @@ -52,7 +52,6 @@ namespace Ioss { } ~ETRegistry(); - std::map customFieldTypes; private: Ioss::ElementTopologyMap m_registry; @@ -147,12 +146,12 @@ namespace Ioss { protected: ElementTopology(std::string type, std::string master_elem_name, bool delete_me = false); - virtual bool validate_permutation_nodes() const { return true; } + IOSS_NODISCARD virtual bool validate_permutation_nodes() const { return true; } private: - bool equal_(const Ioss::ElementTopology &rhs, bool quiet) const; - const std::string name_; - const std::string masterElementName_; + IOSS_NODISCARD bool equal_(const Ioss::ElementTopology &rhs, bool quiet) const; + const std::string name_; + const std::string masterElementName_; static const std::string &topology_shape_to_permutation_name(Ioss::ElementShape topoShape); diff --git a/packages/seacas/libraries/ioss/src/Ioss_FaceBlock.h b/packages/seacas/libraries/ioss/src/Ioss_FaceBlock.h index f74656e8b6..f000f6af7a 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_FaceBlock.h +++ b/packages/seacas/libraries/ioss/src/Ioss_FaceBlock.h @@ -31,8 +31,6 @@ namespace Ioss { FaceBlock(DatabaseIO *io_database, const std::string &my_name, const std::string &face_type, int64_t number_faces); - FaceBlock(const FaceBlock &) = default; - IOSS_NODISCARD std::string type_string() const override { return "FaceBlock"; } IOSS_NODISCARD std::string short_type_string() const override { return "faceblock"; } IOSS_NODISCARD std::string contains_string() const override { return "Face"; } diff --git a/packages/seacas/libraries/ioss/src/Ioss_FieldManager.h b/packages/seacas/libraries/ioss/src/Ioss_FieldManager.h index 450d5531fa..e0497a5cf5 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_FieldManager.h +++ b/packages/seacas/libraries/ioss/src/Ioss_FieldManager.h @@ -52,7 +52,7 @@ namespace Ioss { void erase(const std::string &field_name); // Checks if a field with 'field_name' exists in the database. - bool exists(const std::string &field_name) const; + IOSS_NODISCARD bool exists(const std::string &field_name) const; IOSS_NODISCARD Field get(const std::string &field_name) const; IOSS_NODISCARD const Field &getref(const std::string &field_name) const; diff --git a/packages/seacas/libraries/ioss/src/Ioss_GetLongOpt.C b/packages/seacas/libraries/ioss/src/Ioss_GetLongOpt.C index 74e98ed1df..011d483fef 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_GetLongOpt.C +++ b/packages/seacas/libraries/ioss/src/Ioss_GetLongOpt.C @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2021, 2023 National Technology & Engineering Solutions +// Copyright(C) 1999-2021, 2023, 2024 National Technology & Engineering Solutions // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with // NTESS, the U.S. Government retains certain rights in this software. // @@ -6,22 +6,19 @@ /* S Manoharan. Advanced Computer Research Institute. Lyon. France */ #include "Ioss_GetLongOpt.h" +#include #include #include #include #include #include -#include namespace Ioss { /** \brief Create an empty options database. * * \param optmark The command line symbol designating options. */ - GetLongOption::GetLongOption(const char optmark) : optmarker(optmark) - { - ustring = "[valid options and arguments]"; - } + GetLongOption::GetLongOption(const char optmark) : optmarker(optmark) {} /** \brief Frees dynamically allocated memory. * @@ -108,8 +105,7 @@ namespace Ioss { */ const char *GetLongOption::retrieve(const char *const opt) const { - Cell *t; - for (t = table; t != nullptr; t = t->next) { + for (Cell *t = table; t != nullptr; t = t->next) { if (strcmp(opt, t->option) == 0) { return t->value; } diff --git a/packages/seacas/libraries/ioss/src/Ioss_GetLongOpt.h b/packages/seacas/libraries/ioss/src/Ioss_GetLongOpt.h index b43a539ce7..d76d8723c5 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_GetLongOpt.h +++ b/packages/seacas/libraries/ioss/src/Ioss_GetLongOpt.h @@ -1,5 +1,5 @@ /* - * Copyright(C) 1999-2023 National Technology & Engineering Solutions + * Copyright(C) 1999-2024 National Technology & Engineering Solutions * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with * NTESS, the U.S. Government retains certain rights in this software. * @@ -41,8 +41,8 @@ namespace Ioss { Cell() = default; }; - Cell *table{nullptr}; // option table - const char *ustring{nullptr}; // usage message + Cell *table{nullptr}; // option table + const char *ustring{"[valid options and arguments]"}; char *pname{nullptr}; // program basename Cell *last{nullptr}; // last entry in option table char optmarker; // option marker diff --git a/packages/seacas/libraries/ioss/src/Ioss_NullEntity.C b/packages/seacas/libraries/ioss/src/Ioss_NullEntity.C index f05c1d35f6..0a0d64b5e6 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_NullEntity.C +++ b/packages/seacas/libraries/ioss/src/Ioss_NullEntity.C @@ -4,6 +4,7 @@ // // See packages/seacas/LICENSE for details +#include "Ioss_GroupingEntity.h" #include "Ioss_NullEntity.h" namespace Ioss { diff --git a/packages/seacas/libraries/ioss/src/Ioss_Property.h b/packages/seacas/libraries/ioss/src/Ioss_Property.h index 290405405c..2ef5656778 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_Property.h +++ b/packages/seacas/libraries/ioss/src/Ioss_Property.h @@ -97,7 +97,7 @@ namespace Ioss { IOSS_NODISCARD bool operator!=(const Ioss::Property &rhs) const; IOSS_NODISCARD bool operator==(const Ioss::Property &rhs) const; - friend void swap(Ioss::Property &first, Ioss::Property &second) // nothrow + friend void swap(Ioss::Property &first, Ioss::Property &second) noexcept { using std::swap; swap(first.name_, second.name_); diff --git a/packages/seacas/libraries/ioss/src/Ioss_PropertyManager.C b/packages/seacas/libraries/ioss/src/Ioss_PropertyManager.C index 239d75a61b..31add46758 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_PropertyManager.C +++ b/packages/seacas/libraries/ioss/src/Ioss_PropertyManager.C @@ -9,7 +9,6 @@ #include "Ioss_Utils.h" #include #include -#include #include #include "Ioss_CodeTypes.h" diff --git a/packages/seacas/libraries/ioss/src/Ioss_Utils.h b/packages/seacas/libraries/ioss/src/Ioss_Utils.h index 670eed3af7..e0479488ec 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_Utils.h +++ b/packages/seacas/libraries/ioss/src/Ioss_Utils.h @@ -58,9 +58,7 @@ template IOSS_NODISCARD constexpr T *Data(std::vector &vec) if (vec.empty()) { return nullptr; } - else { - return vec.data(); - } + return vec.data(); } template IOSS_NODISCARD constexpr const T *Data(const std::vector &vec) @@ -68,9 +66,7 @@ template IOSS_NODISCARD constexpr const T *Data(const std::vector IOSS_NODISCARD constexpr T *Data(std::array &arr) @@ -88,18 +84,17 @@ namespace Ioss { */ class IOSS_EXPORT Utils { - public: - /** - * \defgroup IossStreams Streams used for IOSS output - *@{ - */ static std::ostream *m_outputStream; ///< general informational output (very rare). Default std::cerr static std::ostream *m_debugStream; ///< debug output when requested. Default std::cerr static std::ostream *m_warningStream; ///< IOSS warning output. Default std::cerr static std::string m_preWarningText; ///< is a string that prepends all warning message output. ///< Default is "\nIOSS WARNING: " - + public: + /** + * \defgroup IossStreams Streams used for IOSS output + *@{ + */ /** \brief set the stream for all streams (output, debug, and warning) to the specified * `out_stream` */ @@ -117,6 +112,8 @@ namespace Ioss { */ IOSS_NODISCARD static std::ostream &get_output_stream(); + IOSS_NODISCARD static std::string &get_warning_text() { return m_preWarningText; } + /** \brief set the output stream to the specified `output_stream` */ static void set_output_stream(std::ostream &output_stream); @@ -608,16 +605,16 @@ namespace Ioss { } }; - inline std::ostream &OUTPUT() { return *Utils::m_outputStream; } + inline std::ostream &OUTPUT() { return Utils::get_output_stream(); } - inline std::ostream &DebugOut() { return *Utils::m_debugStream; } + inline std::ostream &DebugOut() { return Utils::get_debug_stream(); } inline std::ostream &WarnOut(bool output_prewarning = true) { if (output_prewarning) { - *Utils::m_warningStream << Utils::m_preWarningText; + Utils::get_warning_stream() << Utils::get_warning_text(); } - return *Utils::m_warningStream; + return Utils::get_warning_stream(); } } // namespace Ioss diff --git a/packages/seacas/libraries/ioss/src/Ioss_VariableType.h b/packages/seacas/libraries/ioss/src/Ioss_VariableType.h index e88430dae4..4d7efaf43e 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_VariableType.h +++ b/packages/seacas/libraries/ioss/src/Ioss_VariableType.h @@ -26,6 +26,8 @@ namespace Ioss { class IOSS_EXPORT Registry { + friend class VariableType; + public: void insert(const Ioss::VTM_ValuePair &value, bool delete_me); IOSS_NODISCARD VariableTypeMap::iterator begin() { return m_registry.begin(); } @@ -36,11 +38,11 @@ namespace Ioss { } ~Registry(); - std::map customFieldTypes; private: - Ioss::VariableTypeMap m_registry; - std::vector m_deleteThese; + std::map customFieldTypes; + Ioss::VariableTypeMap m_registry; + std::vector m_deleteThese; }; struct IOSS_EXPORT Suffix diff --git a/packages/seacas/libraries/ioss/src/cgns/Iocgns_StructuredZoneData.C b/packages/seacas/libraries/ioss/src/cgns/Iocgns_StructuredZoneData.C index 98def353b2..da349a3b61 100644 --- a/packages/seacas/libraries/ioss/src/cgns/Iocgns_StructuredZoneData.C +++ b/packages/seacas/libraries/ioss/src/cgns/Iocgns_StructuredZoneData.C @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2023 National Technology & Engineering Solutions +// Copyright(C) 1999-2024 National Technology & Engineering Solutions // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with // NTESS, the U.S. Government retains certain rights in this software. // @@ -8,9 +8,9 @@ #include "Ioss_SmartAssert.h" #include "cgns/Iocgns_StructuredZoneData.h" #include +#include #include #include -#include #if !defined __NVCC__ #include #endif From a48c3c5064b2b4a64072b36d5a9d76c3f3730bd8 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Wed, 10 Apr 2024 14:35:30 -0600 Subject: [PATCH 59/59] clang-tidy suggestions --- .../seacas/applications/ejoin/EJ_index_sort.C | 2 +- packages/seacas/applications/nem_slice/elb.h | 62 +++++------- .../seacas/applications/nem_slice/elb_elem.h | 38 ++++---- .../seacas/applications/nem_slice/elb_time.C | 3 +- .../seacas/applications/nem_slice/elb_util.C | 52 ++++------ .../seacas/applications/nem_spread/el_elm.h | 94 +++++++++---------- .../nem_spread/md_timer_getrusage.C | 3 +- .../applications/nem_spread/pe_load_lb_info.C | 1 + .../seacas/applications/nem_spread/rf_util.C | 5 +- .../applications/zellij/ZE_SystemInterface.C | 4 +- .../libraries/ioss/src/Ioss_GetLongOpt.h | 6 +- .../ioss/src/adios/Ioad_DatabaseIO.C | 2 +- .../ioss/src/adios/Ioad_DatabaseIO.h | 9 +- .../seacas/libraries/suplib_cpp/vector_data.h | 8 +- 14 files changed, 125 insertions(+), 164 deletions(-) diff --git a/packages/seacas/applications/ejoin/EJ_index_sort.C b/packages/seacas/applications/ejoin/EJ_index_sort.C index 8128e68983..e953f8778b 100644 --- a/packages/seacas/applications/ejoin/EJ_index_sort.C +++ b/packages/seacas/applications/ejoin/EJ_index_sort.C @@ -89,7 +89,7 @@ namespace { size_t ndx = 0; - using TT = typename std::remove_cv::type; + using TT = typename std::remove_cv_t; TT small = v[iv[0]]; for (size_t i = 1; i < N; i++) { if (v[iv[i]] < small) { diff --git a/packages/seacas/applications/nem_slice/elb.h b/packages/seacas/applications/nem_slice/elb.h index ae740693c2..df37f03f08 100644 --- a/packages/seacas/applications/nem_slice/elb.h +++ b/packages/seacas/applications/nem_slice/elb.h @@ -215,46 +215,40 @@ template struct Graph_Description }; /* Various constants */ -#define NODAL 0 -#define ELEMENTAL 1 +enum DecompType { NODAL, ELEMENTAL }; #define UTIL_NAME "nem_slice" /* Load balance types */ -#define MULTIKL 0 -#define SPECTRAL 1 -#define INERTIAL 2 -#define LINEAR 3 -#define RANDOM 4 -#define SCATTERED 5 -#define INFILE 6 -#define KL_REFINE 7 -#define NO_REFINE 8 -#define NUM_SECTS 9 -#define CNCT_DOM 10 -#define OUTFILE 11 -#define ZPINCH 12 -#define BRICK 13 -#define ZOLTAN_RCB 14 -#define ZOLTAN_RIB 15 -#define ZOLTAN_HSFC 16 -#define IGNORE_Z 17 +enum Balance { + MULTIKL, + SPECTRAL, + INERTIAL, + LINEAR, + RANDOM, + SCATTERED, + INFILE, + KL_REFINE, + NO_REFINE, + NUM_SECTS, + CNCT_DOM, + OUTFILE, + ZPINCH, + BRICK, + ZOLTAN_RCB, + ZOLTAN_RIB, + ZOLTAN_HSFC, + IGNORE_Z +}; /* Machine types */ -#define MESH 0 -#define HCUBE 1 -#define HYPERCUBE 2 -#define CLUSTER 3 +enum MachineType { MESH, HCUBE, HYPERCUBE, CLUSTER }; /* Solver options */ -#define TOLER 0 -#define USE_RQI 1 -#define VMAX 2 +enum SolverOptions { TOLER, USE_RQI, VMAX }; /* ISSUES options */ - -#define LOCAL_ISSUES 0 -#define GLOBAL_ISSUES 1 +enum Issues { LOCAL_ISSUES, GLOBAL_ISSUES }; /* Weighting options */ /* @@ -265,10 +259,4 @@ template struct Graph_Description * currently used in the type, but are needed since they appear * on the command line. */ -#define NO_WEIGHT 0 -#define READ_EXO 1 -#define EL_BLK 2 -#define VAR_INDX 3 -#define EDGE_WGT 4 -#define TIME_INDX 5 -#define VAR_NAME 6 +enum WeightingOptions { NO_WEIGHT, READ_EXO, EL_BLK, VAR_INDX, EDGE_WGT, TIME_INDX, VAR_NAME }; diff --git a/packages/seacas/applications/nem_slice/elb_elem.h b/packages/seacas/applications/nem_slice/elb_elem.h index e0d10a0c48..5c7a5c5045 100644 --- a/packages/seacas/applications/nem_slice/elb_elem.h +++ b/packages/seacas/applications/nem_slice/elb_elem.h @@ -1,5 +1,5 @@ /* - * Copyright(C) 1999-2020, 2022, 2023 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022, 2023, 2024 National Technology & Engineering Solutions * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with * NTESS, the U.S. Government retains certain rights in this software. * @@ -55,37 +55,37 @@ enum E_Type { extern const char *elem_name_from_enum(E_Type elem_type); extern E_Type get_elem_type(const char *elem_name, /* ExodusII element name */ - const int num_nodes, /* Number of nodes in the element */ - const int num_dim /* Number of dimensions of the mesh */ + int num_nodes, /* Number of nodes in the element */ + int num_dim /* Number of dimensions of the mesh */ ); -extern int get_elem_info(const int info, /* The requested information */ - const E_Type elem_type /* The element type */ +extern int get_elem_info(int info, /* The requested information */ + E_Type elem_type /* The element type */ ); template -int get_side_id(const E_Type etype, const INT *connect, const int nsnodes, INT side_nodes[], - const int skip_check, const int partial_adj); +int get_side_id(E_Type etype, const INT *connect, int nsnodes, INT side_nodes[], int skip_check, + int partial_adj); template -int get_side_id_hex_tet(const E_Type etype, /* The element type */ - const INT *conn, /* The element connectivity */ - const int nsnodes, /* The number of side nodes */ - const INT side_nodes[] /* The list of side node IDs */ +int get_side_id_hex_tet(E_Type etype, /* The element type */ + const INT *conn, /* The element connectivity */ + int nsnodes, /* The number of side nodes */ + const INT side_nodes[] /* The list of side node IDs */ ); template -int ss_to_node_list(const E_Type etype, /* The element type */ - const INT *connect, /* The element connectivity */ - int side_num, /* The element side number */ - INT ss_node_list[] /* The list of side node IDs */ +int ss_to_node_list(E_Type etype, /* The element type */ + const INT *connect, /* The element connectivity */ + int side_num, /* The element side number */ + INT ss_node_list[] /* The list of side node IDs */ ); template -int get_ss_mirror(const E_Type etype, /* The element type */ - const INT *ss_node_list, /* The list of side node IDs */ - int side_num, /* The element side number */ - INT mirror_node_list[] /* The list of the mirror side node IDs */ +int get_ss_mirror(E_Type etype, /* The element type */ + const INT *ss_node_list, /* The list of side node IDs */ + int side_num, /* The element side number */ + INT mirror_node_list[] /* The list of the mirror side node IDs */ ); /* Define element info requests */ diff --git a/packages/seacas/applications/nem_slice/elb_time.C b/packages/seacas/applications/nem_slice/elb_time.C index 0da5d4d055..426b0f0fe9 100644 --- a/packages/seacas/applications/nem_slice/elb_time.C +++ b/packages/seacas/applications/nem_slice/elb_time.C @@ -1,5 +1,5 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2024 National Technology & Engineering Solutions * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with * NTESS, the U.S. Government retains certain rights in this software. * @@ -7,7 +7,6 @@ */ #include // for duration, etc -#include // for ratio double get_time() { static auto start = std::chrono::steady_clock::now(); diff --git a/packages/seacas/applications/nem_slice/elb_util.C b/packages/seacas/applications/nem_slice/elb_util.C index fe26cb3828..81676e2714 100644 --- a/packages/seacas/applications/nem_slice/elb_util.C +++ b/packages/seacas/applications/nem_slice/elb_util.C @@ -1,5 +1,5 @@ /* - * Copyright(C) 1999-2023 National Technology & Engineering Solutions + * Copyright(C) 1999-2024 National Technology & Engineering Solutions * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with * NTESS, the U.S. Government retains certain rights in this software. * @@ -73,18 +73,12 @@ int token_compare(char *token, const char *key) /*****************************************************************************/ void strip_string(char inp_str[], const char *tokens) { - int i; - int j; - int itok; - int ntokes; - int bval; - - i = 0; - ntokes = strlen(tokens); + int i = 0; + int ntokes = strlen(tokens); while (inp_str[i] != '\0') { - bval = 0; - for (itok = 0; itok < ntokes; itok++) { + int bval = 0; + for (int itok = 0; itok < ntokes; itok++) { if (inp_str[i] == tokens[itok]) { i++; bval = 1; @@ -97,7 +91,7 @@ void strip_string(char inp_str[], const char *tokens) } /* Move real part of string to the front */ - j = 0; + int j = 0; while (inp_str[j + i] != '\0') { inp_str[j] = inp_str[j + i]; j++; @@ -107,8 +101,8 @@ void strip_string(char inp_str[], const char *tokens) /* Remove trailing tokens */ while (j != -1) { - bval = 0; - for (itok = 0; itok < ntokes; itok++) { + int bval = 0; + for (int itok = 0; itok < ntokes; itok++) { if (inp_str[j] == tokens[itok]) { bval = 1; j--; @@ -128,11 +122,8 @@ void strip_string(char inp_str[], const char *tokens) /*****************************************************************************/ void string_to_lower(char in_string[], char cval) { - int len; - int cnt; - - len = strlen(in_string); - for (cnt = 0; cnt < len; cnt++) { + int len = strlen(in_string); + for (int cnt = 0; cnt < len; cnt++) { if (in_string[cnt] == cval) { return; } @@ -148,26 +139,19 @@ void string_to_lower(char in_string[], char cval) /*****************************************************************************/ void clean_string(char inp_str[], const char *tokens) { - int i; - int j; - int itok; - int ntokes; - int bval; - int inplen; - - ntokes = strlen(tokens); - inplen = strlen(inp_str); - - i = 0; - bval = 0; + int ntokes = strlen(tokens); + int inplen = strlen(inp_str); + + int i = 0; + int bval = 0; while (inp_str[i] != '\0') { - for (itok = 0; itok < ntokes; itok++) { + for (int itok = 0; itok < ntokes; itok++) { if (i < 0) { i = 0; } if (inp_str[i] == tokens[itok]) { /* Find out if the next character is also a token */ - for (j = 0; j < ntokes; j++) { + for (int j = 0; j < ntokes; j++) { if (inp_str[i + 1] == tokens[j]) { bval = 1; break; @@ -175,7 +159,7 @@ void clean_string(char inp_str[], const char *tokens) } if (bval == 1) { - for (j = i + 1; j < inplen; j++) { + for (int j = i + 1; j < inplen; j++) { inp_str[j] = inp_str[j + 1]; } diff --git a/packages/seacas/applications/nem_spread/el_elm.h b/packages/seacas/applications/nem_spread/el_elm.h index 9d31124e1e..d6795f4bfc 100644 --- a/packages/seacas/applications/nem_spread/el_elm.h +++ b/packages/seacas/applications/nem_spread/el_elm.h @@ -1,5 +1,5 @@ /* - * Copyright(C) 1999-2020, 2022 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022, 2024 National Technology & Engineering Solutions * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with * NTESS, the U.S. Government retains certain rights in this software. * @@ -12,57 +12,55 @@ */ /* 1-d elements */ -#define BAR2 0 -#define BAR3 1 -#define SHELL2 2 -#define SHELL3 3 +enum Elements { + BAR2, + BAR3, + SHELL2, + SHELL3, -/* 2-d elements */ -#define QUAD4 14 -#define QUAD8 18 -#define QUAD9 19 -#define TRI3 23 -#define TRI4 24 -#define TRI6 26 -#define TRI7 27 - -/* 3-d elements */ -#define HEX8 108 -#define HEX16 116 -#define HEX20 120 -#define HEX27 127 -#define TET4 204 -#define TET10 210 -#define TET8 208 -#define TET14 214 -#define TET15 215 -#define SHELL4 304 -#define SHELL8 308 -#define SHELL9 309 -#define SPHERE 401 -#define WEDGE6 506 -#define WEDGE12 512 -#define WEDGE15 515 -#define WEDGE16 516 -#define WEDGE20 520 -#define WEDGE21 521 -#define HEXSHELL 608 -#define TSHELL3 703 -#define TSHELL4 704 -#define TSHELL6 706 -#define TSHELL7 707 -#define PYRAMID5 805 -#define PYRAMID13 813 -#define PYRAMID14 814 -#define PYRAMID18 818 -#define PYRAMID19 819 + /* 2-d elements */ + QUAD4, + QUAD8, + QUAD9, + TRI3, + TRI4, + TRI6, + TRI7, + /* 3-d elements */ + HEX8, + HEX16, + HEX20, + HEX27, + TET4, + TET10, + TET8, + TET14, + TET15, + SHELL4, + SHELL8, + SHELL9, + SPHERE, + WEDGE6, + WEDGE12, + WEDGE15, + WEDGE16, + WEDGE20, + WEDGE21, + HEXSHELL, + TSHELL3, + TSHELL4, + TSHELL6, + TSHELL7, + PYRAMID5, + PYRAMID13, + PYRAMID14, + PYRAMID18, + PYRAMID19 +}; /* define element data "request for information" types */ -#define NNODES 1 -#define NDIM 3 -#define NINTERP 5 -#define NN_SIDE 6 +enum ElementRequest { NNODES = 1, NDIM = 3, NINTERP = 5, NN_SIDE = 6 }; /******************************* PROTOTYPES FOR el_elm_info.c ****************/ diff --git a/packages/seacas/applications/nem_spread/md_timer_getrusage.C b/packages/seacas/applications/nem_spread/md_timer_getrusage.C index 134b4ca40a..a49628c86e 100644 --- a/packages/seacas/applications/nem_spread/md_timer_getrusage.C +++ b/packages/seacas/applications/nem_spread/md_timer_getrusage.C @@ -1,5 +1,5 @@ /* - * Copyright(C) 1999-2020, 2023 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2023, 2024 National Technology & Engineering Solutions * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with * NTESS, the U.S. Government retains certain rights in this software. * @@ -7,7 +7,6 @@ */ #include // for duration, etc -#include // for ratio double second() { static auto start = std::chrono::steady_clock::now(); diff --git a/packages/seacas/applications/nem_spread/pe_load_lb_info.C b/packages/seacas/applications/nem_spread/pe_load_lb_info.C index 8ba4aec8d2..4cff9d78cb 100644 --- a/packages/seacas/applications/nem_spread/pe_load_lb_info.C +++ b/packages/seacas/applications/nem_spread/pe_load_lb_info.C @@ -16,6 +16,7 @@ #include "rf_util.h" // for print_line #include "sort_utils.h" // for gds_qsort #include "vector_data.h" +#include #include #include // for size_t #include // for stderr, etc diff --git a/packages/seacas/applications/nem_spread/rf_util.C b/packages/seacas/applications/nem_spread/rf_util.C index 5a0709b624..c9d83ddbad 100644 --- a/packages/seacas/applications/nem_spread/rf_util.C +++ b/packages/seacas/applications/nem_spread/rf_util.C @@ -1,5 +1,5 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2024 National Technology & Engineering Solutions * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with * NTESS, the U.S. Government retains certain rights in this software. * @@ -30,8 +30,7 @@ void check_exodus_error(int error, const char *function_name) void print_line(const char *charstr, int ntimes) { - int i; - for (i = 0; i < ntimes; i++) { + for (int i = 0; i < ntimes; i++) { fmt::print("{}", *charstr); } fmt::print("\n"); diff --git a/packages/seacas/applications/zellij/ZE_SystemInterface.C b/packages/seacas/applications/zellij/ZE_SystemInterface.C index 4201d77e78..1ef40f7341 100644 --- a/packages/seacas/applications/zellij/ZE_SystemInterface.C +++ b/packages/seacas/applications/zellij/ZE_SystemInterface.C @@ -7,13 +7,13 @@ #include "ZE_SystemInterface.h" #include "ZE_Version.h" // for qainfo +#include #include +#include #include -#include // for size_t #include // for exit, strtod, strtoul, abs, etc #include #include -#include // for ostream #include //! \file diff --git a/packages/seacas/libraries/ioss/src/Ioss_GetLongOpt.h b/packages/seacas/libraries/ioss/src/Ioss_GetLongOpt.h index d76d8723c5..28554ee11c 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_GetLongOpt.h +++ b/packages/seacas/libraries/ioss/src/Ioss_GetLongOpt.h @@ -75,8 +75,7 @@ namespace Ioss { */ void usage(const char *str) { ustring = str; } - template ::value, INT>::type * = nullptr> + template , INT> * = nullptr> INT get_option_value(const char *option_txt, INT default_value) { INT value = default_value; @@ -87,8 +86,7 @@ namespace Ioss { return value; } - template ::value, DBL>::type * = nullptr> + template , DBL> * = nullptr> DBL get_option_value(const char *option_txt, DBL default_value) { DBL value = default_value; diff --git a/packages/seacas/libraries/ioss/src/adios/Ioad_DatabaseIO.C b/packages/seacas/libraries/ioss/src/adios/Ioad_DatabaseIO.C index 58c191ae2f..a478681b4d 100644 --- a/packages/seacas/libraries/ioss/src/adios/Ioad_DatabaseIO.C +++ b/packages/seacas/libraries/ioss/src/adios/Ioad_DatabaseIO.C @@ -410,7 +410,7 @@ namespace Ioad { template void DatabaseIO::define_entity_internal(const T &entity_blocks, Ioss::Field::RoleType *role) { - using cv_removed_value_type = typename std::remove_pointer::type; + using cv_removed_value_type = typename std::remove_pointer_t; for (auto &entity_block : entity_blocks) { std::string entity_type = entity_block->type_string(); std::string entity_name = entity_block->name(); diff --git a/packages/seacas/libraries/ioss/src/adios/Ioad_DatabaseIO.h b/packages/seacas/libraries/ioss/src/adios/Ioad_DatabaseIO.h index bff19e728a..d47a5bfbef 100644 --- a/packages/seacas/libraries/ioss/src/adios/Ioad_DatabaseIO.h +++ b/packages/seacas/libraries/ioss/src/adios/Ioad_DatabaseIO.h @@ -144,8 +144,8 @@ namespace Ioad { template T get_attribute(const std::string &attribute_name); template void put_data(void *data, const std::string &encoded_name) const; - template ::value, T>::type> + template ::value, T>> void put_var_type(const Ioss::Field &field, const std::string &encoded_name, bool transformed_field) const; template @@ -200,11 +200,10 @@ namespace Ioad { const std::string &var_name) const; template - using IsIossEntityBlock = - typename std::enable_if::value>::type; + using IsIossEntityBlock = typename std::enable_if_t>; template using IsNotIossEntityBlock = - typename std::enable_if::value>::type; + typename std::enable_if_t>; template > void define_entity_meta_variables(const std::string &encoded_name); diff --git a/packages/seacas/libraries/suplib_cpp/vector_data.h b/packages/seacas/libraries/suplib_cpp/vector_data.h index f2dca14421..edf5c44752 100644 --- a/packages/seacas/libraries/suplib_cpp/vector_data.h +++ b/packages/seacas/libraries/suplib_cpp/vector_data.h @@ -22,9 +22,7 @@ template constexpr T *Data(std::vector &vec) if (vec.empty()) { return nullptr; } - else { - return vec.data(); - } + return vec.data(); } template constexpr const T *Data(const std::vector &vec) @@ -32,9 +30,7 @@ template constexpr const T *Data(const std::vector &vec) if (vec.empty()) { return nullptr; } - else { - return vec.data(); - } + return vec.data(); } template constexpr T *Data(std::array &arr)