From 6858da24dc8b741ea2651a58df7297ee2ce1254b Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Wed, 11 Jan 2023 09:56:53 -0700 Subject: [PATCH 01/14] Revert "Revert "TriBITS Snapshot 2022-12-12 working toward TriBITSPub/TriBITS#63"" This reverts commit ae19a59061e4d9111c7cc9ae96bcefa315199326. This brings back the version of TriBITS snapshotted in Trilinos PR trilinos/Trilinos#11380. --- CMakeLists.txt | 6 +- cmake/tribits/CHANGELOG.md | 77 +- .../ci_support/TribitsDumpDepsXmlScript.cmake | 4 +- .../TribitsWriteXmlDependenciesFiles.cmake | 283 ++- cmake/tribits/common_tpls/FindTPLHDF5.cmake | 2 +- .../FindTPLLAPACKDependencies.cmake | 2 + cmake/tribits/common_tpls/FindTPLNetcdf.cmake | 4 +- .../TribitsPackageConfigTemplate.cmake.in | 23 +- .../TribitsProjectConfigTemplate.cmake.in | 14 - .../package_arch/TribitsAddAdvancedTest.cmake | 11 +- .../package_arch/TribitsAddExecutable.cmake | 7 +- .../TribitsAddExecutableAndTest.cmake | 21 +- .../core/package_arch/TribitsAddLibrary.cmake | 11 +- .../core/package_arch/TribitsAddTest.cmake | 9 +- .../package_arch/TribitsAddTestHelpers.cmake | 4 +- .../TribitsAdjustPackageEnables.cmake | 2251 ++++++----------- ...ribitsExternalPackageWriteConfigFile.cmake | 46 +- .../package_arch/TribitsGeneralMacros.cmake | 200 +- .../TribitsGetEnabledSublists.cmake | 163 ++ .../TribitsGetPackageEnableStatus.cmake | 134 + .../package_arch/TribitsGlobalMacros.cmake | 91 +- .../TribitsIncludeDirectories.cmake | 50 +- .../package_arch/TribitsListHelpers.cmake | 11 +- .../TribitsPackageDependencies.cmake | 17 +- .../package_arch/TribitsPackageMacros.cmake | 5 +- .../TribitsPkgExportCacheVars.cmake | 2 +- .../TribitsPrintDependencyInfo.cmake | 102 +- .../TribitsPrintEnabledPackagesLists.cmake | 33 +- .../TribitsProcessEnabledTpl.cmake | 8 +- .../TribitsProcessPackagesAndDirsLists.cmake | 63 +- .../TribitsProcessTplsLists.cmake | 10 +- .../package_arch/TribitsProjectImpl.cmake | 2 +- ...adAllProjectDepsFilesCreateDepsGraph.cmake | 9 - .../TribitsReadDepsFilesCreateDepsGraph.cmake | 545 ++-- .../TribitsReportInvalidTribitsUsage.cmake | 25 +- .../package_arch/TribitsSetAndIncDirs.cmake | 66 + .../TribitsSetUpEnabledOnlyDependencies.cmake | 237 ++ ...itsSystemDataStructuresMacrosFunctions.rst | 109 +- .../package_arch/TribitsTestCategories.cmake | 3 +- .../TribitsTplDeclareLibraries.cmake | 7 +- .../TribitsWriteClientExportFiles.cmake | 143 +- .../tribits/core/utils/AppendStringVar.cmake | 3 + cmake/tribits/core/utils/CMakeOverrides.cmake | 117 - .../core/utils/ParseVariableArguments.cmake | 10 +- .../core/utils/TribitsAddEnumCacheVar.cmake | 89 + ...s.cmake => TribitsCreateReverseList.cmake} | 18 +- .../core/utils/TribitsDeprecatedHelpers.cmake | 121 + .../TribitsCTestDriverCoreHelpers.cmake | 4 +- .../build_ref/TribitsBuildReferenceBody.rst | 324 ++- .../EnableAllPackages.txt | 9 +- .../EnableThyraEpetra_EnableTests.txt | 7 +- .../EnableThyra_EnableTests.txt | 7 +- ...EnableThyra_EnableTests_EnableBoost_ST.txt | 45 +- ...nableTests_EnableBoost_ST_RequiredOnly.txt | 42 +- .../ExpectedDependencies.txt | 105 +- .../guides/TribitsCoreDetailedReference.rst | 45 +- .../tribits/doc/guides/TribitsGuidesBody.rst | 97 +- .../TribitsMacroFunctionDocTemplate.rst | 1 + .../TribitsSystemMacroFunctionDocTemplate.rst | 10 +- .../guides/UtilsMacroFunctionDocTemplate.rst | 5 +- .../guides/users_guide/TribitsUsersGuide.rst | 2 + .../examples/InsertedPkg/CMakeLists.txt | 2 +- .../shared_only/CMakeLists.txt | 2 +- .../static_only/CMakeLists.txt | 2 +- .../examples/MockTrilinos/TPLsList.cmake | 1 + .../TPLs/FindTPLLAPACKDependencies.cmake | 2 + .../TPLs/FindTPLParMETISDependencies.cmake | 2 + .../TPLs/FindTPLSuperLUDependencies.cmake | 2 + .../TPLs/FindTPLSuperLUDistDependencies.cmake | 2 + .../packages/zoltan/cmake/Dependencies.cmake | 8 +- .../ReducedMockTrilinos/TPLsList.cmake | 8 +- .../DependsOnLAPACK/PackagesList.cmake | 3 + .../extraRepos/DependsOnLAPACK/TPLsList.cmake | 1 + .../DependsOnLAPACK/cmake/Dependencies.cmake | 3 + .../examples/TargetDefinesPkg/CMakeLists.txt | 2 +- .../TribitsExampleApp/AppHelperFuncs.cmake | 3 +- .../TribitsExampleProject/CMakeLists.txt | 2 + .../packages/mixed_lang/src/CMakeLists.txt | 4 +- .../packages/simple_cxx/src/CMakeLists.txt | 4 +- .../packages/simple_cxx/test/CMakeLists.txt | 3 + .../test/SimpleCxx_HelloWorld_Tests.cpp | 7 +- .../test/inc/SimpleCxx_HelloWorld_Tests.hpp | 10 + .../with_subpackages/a/CMakeLists.txt | 4 +- .../with_subpackages/b/src/CMakeLists.txt | 6 +- .../b/tests/testlib/CMakeLists.txt | 2 +- .../with_subpackages/c/CMakeLists.txt | 2 +- .../packages/wrap_external/CMakeLists.txt | 2 +- .../TribitsExampleProject2/CMakeLists.txt | 1 + .../packages/package1/src/CMakeLists.txt | 2 +- .../packages/package2/src/CMakeLists.txt | 4 +- .../packages/package3/src/CMakeLists.txt | 4 +- .../packages/addon1/src/CMakeLists.txt | 2 +- .../TribitsOldSimpleExampleApp/CMakeLists.txt | 5 +- .../TribitsSimpleExampleApp/CMakeLists.txt | 2 +- commonTools/gtest/CMakeLists.txt | 2 +- packages/adelus/example/CMakeLists.txt | 2 +- packages/adelus/src/CMakeLists.txt | 4 +- packages/amesos/src/CMakeLists.txt | 4 +- packages/amesos2/src/CMakeLists.txt | 22 +- .../amesos2/src/KLU2/Source/CMakeLists.txt | 16 +- .../anasazi/epetra/src-rbgen/CMakeLists.txt | 4 +- packages/anasazi/epetra/src/CMakeLists.txt | 4 +- .../epetra/util/ModeLaplace/CMakeLists.txt | 4 +- packages/anasazi/src-rbgen/CMakeLists.txt | 2 +- packages/anasazi/src/CMakeLists.txt | 8 +- packages/anasazi/test/CMakeLists.txt | 2 +- .../anasazi/test/OrthoManager/CMakeLists.txt | 2 +- packages/anasazi/thyra/src/CMakeLists.txt | 4 +- packages/anasazi/tpetra/src/CMakeLists.txt | 4 +- packages/aztecoo/src/CMakeLists.txt | 4 +- .../belos/doc/parameterList/CMakeLists.txt | 2 +- packages/belos/epetra/src/CMakeLists.txt | 4 +- packages/belos/kokkos/example/CMakeLists.txt | 2 +- packages/belos/kokkos/src/CMakeLists.txt | 4 +- packages/belos/kokkos/test/CMakeLists.txt | 2 +- packages/belos/src/CMakeLists.txt | 4 +- packages/belos/test/GCRODR/CMakeLists.txt | 4 +- packages/belos/tpetra/src/CMakeLists.txt | 4 +- packages/belos/xpetra/src/CMakeLists.txt | 4 +- .../SuiteSparse/src/CMakeLists.txt | 16 +- .../examples/CMakeLists.tribits.cmake | 2 +- .../compadre/src/CMakeLists.tribits.cmake | 4 +- .../domi/doc/parameterList/CMakeLists.txt | 2 +- packages/domi/src/CMakeLists.txt | 4 +- packages/domi/test/MDArray/CMakeLists.txt | 2 +- packages/domi/test/MDComm/CMakeLists.txt | 2 +- packages/domi/test/MDMap/CMakeLists.txt | 2 +- packages/domi/test/MDVector/CMakeLists.txt | 2 +- packages/epetra/CMakeLists.txt | 2 +- packages/epetra/src/CMakeLists.txt | 6 +- packages/epetraext/src/CMakeLists.txt | 26 +- packages/epetraext/test/CMakeLists.txt | 2 +- packages/fei/base/CMakeLists.txt | 6 +- packages/fei/support-Trilinos/CMakeLists.txt | 6 +- packages/fei/unit_tests/CMakeLists.txt | 8 +- packages/galeri/src-epetra/CMakeLists.txt | 12 +- packages/galeri/src-xpetra/CMakeLists.txt | 10 +- packages/ifpack/src/CMakeLists.txt | 12 +- packages/ifpack/test/AztecOO/CMakeLists.txt | 4 +- .../ifpack/test/AztecOO_LL/CMakeLists.txt | 4 +- packages/ifpack2/adapters/CMakeLists.txt | 4 +- packages/ifpack2/example/CMakeLists.txt | 2 +- packages/ifpack2/src/CMakeLists.txt | 6 +- .../belos/AdditiveSchwarzRILUK/CMakeLists.txt | 2 +- packages/ifpack2/test/belos/CMakeLists.txt | 2 +- packages/ifpack2/test/vanka/CMakeLists.txt | 4 +- packages/intrepid/src/CMakeLists.txt | 16 +- packages/intrepid2/perf-test/CMakeLists.txt | 2 +- .../perf-test/ComputeBasis/CMakeLists.txt | 2 +- .../ComputeBasis/Cuda/CMakeLists.txt | 4 +- .../ComputeBasis/OpenMP/CMakeLists.txt | 4 +- .../ComputeBasis/Serial/CMakeLists.txt | 4 +- .../perf-test/DynRankView/CMakeLists.txt | 2 +- .../perf-test/DynRankView/Cuda/CMakeLists.txt | 4 +- .../DynRankView/OpenMP/CMakeLists.txt | 4 +- .../DynRankView/Serial/CMakeLists.txt | 4 +- packages/intrepid2/src/CMakeLists.txt | 6 +- .../intrepid2/unit-test/Cell/CMakeLists.txt | 2 +- .../Basis/DeRHAM_HEX_FEM/CMakeLists.txt | 2 +- .../Basis/DeRHAM_QUAD_FEM/CMakeLists.txt | 2 +- .../Basis/DeRHAM_TET_FEM/CMakeLists.txt | 2 +- .../Basis/DeRHAM_TRI_FEM/CMakeLists.txt | 2 +- .../Basis/HCURL_HEX_I1_FEM/CMakeLists.txt | 2 +- .../Basis/HCURL_HEX_In_FEM/CMakeLists.txt | 2 +- .../Basis/HCURL_QUAD_I1_FEM/CMakeLists.txt | 2 +- .../Basis/HCURL_QUAD_In_FEM/CMakeLists.txt | 2 +- .../Basis/HCURL_TET_I1_FEM/CMakeLists.txt | 2 +- .../Basis/HCURL_TET_In_FEM/CMakeLists.txt | 2 +- .../Basis/HCURL_TRI_I1_FEM/CMakeLists.txt | 2 +- .../Basis/HCURL_TRI_In_FEM/CMakeLists.txt | 2 +- .../Basis/HCURL_WEDGE_I1_FEM/CMakeLists.txt | 2 +- .../Basis/HDIV_HEX_I1_FEM/CMakeLists.txt | 2 +- .../Basis/HDIV_HEX_In_FEM/CMakeLists.txt | 2 +- .../Basis/HDIV_QUAD_I1_FEM/CMakeLists.txt | 2 +- .../Basis/HDIV_QUAD_In_FEM/CMakeLists.txt | 2 +- .../Basis/HDIV_TET_I1_FEM/CMakeLists.txt | 2 +- .../Basis/HDIV_TET_In_FEM/CMakeLists.txt | 2 +- .../Basis/HDIV_TRI_I1_FEM/CMakeLists.txt | 2 +- .../Basis/HDIV_TRI_In_FEM/CMakeLists.txt | 2 +- .../Basis/HDIV_WEDGE_I1_FEM/CMakeLists.txt | 2 +- .../Basis/HGRAD_HEX_C1_FEM/CMakeLists.txt | 2 +- .../Basis/HGRAD_HEX_C2_FEM/CMakeLists.txt | 2 +- .../Basis/HGRAD_HEX_Cn_FEM/CMakeLists.txt | 2 +- .../Basis/HGRAD_LINE_C1_FEM/CMakeLists.txt | 2 +- .../Basis/HGRAD_LINE_Cn_FEM/CMakeLists.txt | 2 +- .../HGRAD_LINE_Cn_FEM_JACOBI/CMakeLists.txt | 2 +- .../Basis/HGRAD_PYR_C1_FEM/CMakeLists.txt | 2 +- .../Basis/HGRAD_QUAD_C1_FEM/CMakeLists.txt | 2 +- .../Basis/HGRAD_QUAD_C2_FEM/CMakeLists.txt | 2 +- .../Basis/HGRAD_QUAD_Cn_FEM/CMakeLists.txt | 2 +- .../Basis/HGRAD_TET_C1_FEM/CMakeLists.txt | 2 +- .../Basis/HGRAD_TET_C2_FEM/CMakeLists.txt | 2 +- .../Basis/HGRAD_TET_COMP12_FEM/CMakeLists.txt | 2 +- .../Basis/HGRAD_TET_Cn_FEM/CMakeLists.txt | 2 +- .../HGRAD_TET_Cn_FEM_ORTH/CMakeLists.txt | 2 +- .../Basis/HGRAD_TRI_C1_FEM/CMakeLists.txt | 2 +- .../Basis/HGRAD_TRI_C2_FEM/CMakeLists.txt | 2 +- .../Basis/HGRAD_TRI_Cn_FEM/CMakeLists.txt | 2 +- .../HGRAD_TRI_Cn_FEM_ORTH/CMakeLists.txt | 2 +- .../Basis/HGRAD_WEDGE_C1_FEM/CMakeLists.txt | 2 +- .../Basis/HGRAD_WEDGE_C2_FEM/CMakeLists.txt | 2 +- .../Basis/HVOL_C0_FEM/CMakeLists.txt | 2 +- .../Basis/HVOL_HEX_Cn_FEM/CMakeLists.txt | 2 +- .../Basis/HVOL_LINE_Cn_FEM/CMakeLists.txt | 2 +- .../Basis/HVOL_QUAD_Cn_FEM/CMakeLists.txt | 2 +- .../Basis/HVOL_TET_Cn_FEM/CMakeLists.txt | 2 +- .../Basis/HVOL_TRI_Cn_FEM/CMakeLists.txt | 2 +- .../FunctionSpaceTools/CMakeLists.txt | 2 +- .../Discretization/Integration/CMakeLists.txt | 2 +- .../MonolithicExecutable/CMakeLists.txt | 2 +- .../unit-test/Orientation/CMakeLists.txt | 2 +- .../unit-test/Projection/CMakeLists.txt | 2 +- .../Shared/ArrayTools/CMakeLists.txt | 2 +- .../Shared/PointTools/CMakeLists.txt | 2 +- .../unit-test/Shared/Polylib/CMakeLists.txt | 2 +- .../Shared/RealSpaceTools/CMakeLists.txt | 2 +- .../StructuredIntegration/CMakeLists.txt | 2 +- packages/isorropia/src/CMakeLists.txt | 10 +- .../kokkos-kernels/perf_test/CMakeLists.txt | 2 +- packages/komplex/src/CMakeLists.txt | 4 +- .../delete_small_elements/CMakeLists.txt | 6 +- .../krino/adaptivity_interface/CMakeLists.txt | 6 +- packages/krino/krino/krino_lib/CMakeLists.txt | 6 +- .../krino/krino/master_element/CMakeLists.txt | 6 +- packages/krino/krino/parser/CMakeLists.txt | 6 +- .../krino/rebalance_utils/CMakeLists.txt | 6 +- packages/krino/krino/region/CMakeLists.txt | 6 +- .../krino/krino/unit_tests/CMakeLists.txt | 6 +- packages/minitensor/src/CMakeLists.txt | 4 +- packages/minitensor/test/CMakeLists.txt | 2 +- packages/ml/matlab/CMakeLists.txt | 8 +- packages/ml/src/CMakeLists.txt | 28 +- packages/moertel/CMakeLists.txt | 2 +- packages/moertel/example/Hex3D/CMakeLists.txt | 2 +- .../moertel/example/TwoSquares/CMakeLists.txt | 2 +- packages/moertel/morkon/src/CMakeLists.txt | 56 +- .../moertel/morkon/unit_tests/CMakeLists.txt | 54 +- packages/moertel/src/mortar/CMakeLists.txt | 4 +- packages/muelu/adapters/CMakeLists.txt | 20 +- .../muelu/doc/Tutorial/src/CMakeLists.txt | 2 +- .../muelu/doc/Tutorial/tex/CMakeLists.txt | 2 +- .../example/ParameterList/CMakeLists.txt | 2 +- .../example/advanced/blockcrs/CMakeLists.txt | 4 +- .../example/advanced/clone/CMakeLists.txt | 2 +- .../example/advanced/levelwrap/CMakeLists.txt | 4 +- .../example/advanced/memory/CMakeLists.txt | 2 +- .../advanced/multiplesolve/CMakeLists.txt | 4 +- .../advanced/separatesetups/CMakeLists.txt | 4 +- packages/muelu/example/basic/CMakeLists.txt | 6 +- packages/muelu/matlab/bin/CMakeLists.txt | 8 +- packages/muelu/matlab/src/CMakeLists.txt | 8 +- .../muelu/research/caglusa/CMakeLists.txt | 4 +- .../luc/region_algorithms/CMakeLists.txt | 4 +- .../research/max/AdditiveMG/CMakeLists.txt | 2 +- .../max/XpetraSplitting/CMakeLists.txt | 2 +- packages/muelu/research/q2q1/CMakeLists.txt | 2 +- .../research/regionMG/example/CMakeLists.txt | 6 +- .../research/regionMG/src/CMakeLists.txt | 2 +- .../regionMG/test/structured/CMakeLists.txt | 6 +- .../research/semicoarsening/CMakeLists.txt | 4 +- .../research/tawiesn/aria/CMakeLists.txt | 2 +- .../research/tawiesn/crada/CMakeLists.txt | 4 +- packages/muelu/src/CMakeLists.txt | 92 +- packages/muelu/src/Interface/CMakeLists.txt | 56 +- packages/muelu/test/CMakeLists.txt | 2 +- .../muelu/test/blockedtransfer/CMakeLists.txt | 14 +- .../muelu/test/convergence/CMakeLists.txt | 12 +- packages/muelu/test/factories/CMakeLists.txt | 14 +- packages/muelu/test/helmholtz/CMakeLists.txt | 14 +- packages/muelu/test/interface/CMakeLists.txt | 12 +- packages/muelu/test/longlong/CMakeLists.txt | 14 +- packages/muelu/test/maxwell/CMakeLists.txt | 14 +- packages/muelu/test/meshtying/CMakeLists.txt | 4 +- packages/muelu/test/mhdvanka/CMakeLists.txt | 14 +- .../muelu/test/navierstokes/CMakeLists.txt | 6 +- packages/muelu/test/paramlist/CMakeLists.txt | 12 +- .../test/perf_tests_kokkos/CMakeLists.txt | 6 +- .../muelu/test/permutation/CMakeLists.txt | 4 +- packages/muelu/test/profiling/CMakeLists.txt | 14 +- packages/muelu/test/scaling/CMakeLists.txt | 14 +- packages/muelu/test/simple1D/CMakeLists.txt | 14 +- packages/muelu/test/structured/CMakeLists.txt | 14 +- .../muelu/test/toggletransfer/CMakeLists.txt | 14 +- packages/muelu/test/unit_tests/CMakeLists.txt | 26 +- .../test/unit_tests_kokkos/CMakeLists.txt | 24 +- .../muelu/test/vardofpernode/CMakeLists.txt | 14 +- packages/muelu/test/viz/CMakeLists.txt | 14 +- .../LOCA_Brusselator_xyzt/CMakeLists.txt | 2 +- .../LOCA_ContinuationManager/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../epetra/LOCA_Tcubed/CMakeLists.txt | 2 +- .../epetra/NOX_1DFEMNonlinear/CMakeLists.txt | 2 +- .../lapack/LOCA_1DFDPitchfork/CMakeLists.txt | 2 +- .../lapack/LOCA_Brusselator/CMakeLists.txt | 2 +- .../examples/lapack/LOCA_Chan/CMakeLists.txt | 2 +- .../lapack/NOX_SimpleExamples/CMakeLists.txt | 2 +- .../petsc/1DFiniteDifference/CMakeLists.txt | 2 +- .../nox/examples/petsc/DS6.5.1/CMakeLists.txt | 2 +- packages/nox/src-epetra/CMakeLists.txt | 2 +- packages/nox/src-lapack/CMakeLists.txt | 2 +- .../nox/src-loca/src-epetra/CMakeLists.txt | 4 +- .../nox/src-loca/src-lapack/CMakeLists.txt | 2 +- packages/nox/src-loca/src-mf/CMakeLists.txt | 2 +- .../nox/src-loca/src-thyra/CMakeLists.txt | 2 +- .../nox/src-loca/src-tpetra/CMakeLists.txt | 4 +- packages/nox/src-loca/src/CMakeLists.txt | 2 +- packages/nox/src-petsc/CMakeLists.txt | 2 +- packages/nox/src/CMakeLists.txt | 8 +- packages/nox/test/basic/CMakeLists.txt | 2 +- packages/nox/test/epetra/1Dfem/CMakeLists.txt | 2 +- .../test/epetra/Brusselator/CMakeLists.txt | 2 +- .../nox/test/epetra/DS6.5.1/CMakeLists.txt | 2 +- .../FiniteDifferenceColoring/CMakeLists.txt | 2 +- .../epetra/LOCA_TestProblems/CMakeLists.txt | 2 +- packages/nox/test/epetra/Thyra/CMakeLists.txt | 4 +- .../lapack/LOCA_TestProblems/CMakeLists.txt | 2 +- packages/nox/test/tpetra/CMakeLists.txt | 2 +- packages/nox/test/utils/CMakeLists.txt | 2 +- packages/pamgen/src/CMakeLists.txt | 10 +- packages/pamgen/test/rtc_test/CMakeLists.txt | 2 +- .../panzer/adapters-ioss/src/CMakeLists.txt | 12 +- .../test/ioss_connmngr/CMakeLists.txt | 2 +- .../CurlLaplacianExample/CMakeLists.txt | 2 +- .../MixedCurlLaplacianExample/CMakeLists.txt | 2 +- .../MixedPoissonExample/CMakeLists.txt | 2 +- .../example/ModelEvaluator/CMakeLists.txt | 8 +- .../example/PoissonExample/CMakeLists.txt | 2 +- .../PoissonInterfaceExample/CMakeLists.txt | 2 +- .../PoissonInterfaceTpetra/CMakeLists.txt | 2 +- .../example/assembly_engine/CMakeLists.txt | 8 +- .../example/main_driver/CMakeLists.txt | 8 +- .../example/square_mesh/CMakeLists.txt | 2 +- .../panzer/adapters-stk/src/CMakeLists.txt | 12 +- .../test/assembly_engine/CMakeLists.txt | 8 +- .../test/bcstrategy/CMakeLists.txt | 6 +- .../test/evaluator_tests/CMakeLists.txt | 4 +- .../test/face_to_elem/CMakeLists.txt | 2 +- .../test/face_to_element/CMakeLists.txt | 2 +- .../test/field_manager_builder/CMakeLists.txt | 8 +- .../gather_scatter_evaluators/CMakeLists.txt | 8 +- .../initial_condition_builder/CMakeLists.txt | 8 +- .../test/ip_coordinates/CMakeLists.txt | 10 +- .../test/local_mesh/CMakeLists.txt | 2 +- .../test/model_evaluator/CMakeLists.txt | 8 +- .../test/node_normals/CMakeLists.txt | 2 +- .../panzer_workset_builder/CMakeLists.txt | 4 +- .../test/periodic_bcs/CMakeLists.txt | 2 +- .../test/projection/CMakeLists.txt | 4 +- .../test/response_library/CMakeLists.txt | 10 +- .../test/sideset_overlap/CMakeLists.txt | 2 +- .../adapters-stk/test/solver/CMakeLists.txt | 8 +- .../test/stk_connmngr/CMakeLists.txt | 2 +- .../test/stk_interface_test/CMakeLists.txt | 2 +- .../test/transform_bc_names/CMakeLists.txt | 2 +- .../tutorial/siamCse17/CMakeLists.txt | 2 +- .../tutorial/step01/CMakeLists.txt | 2 +- .../tutorial/step02/CMakeLists.txt | 2 +- packages/panzer/core/src/CMakeLists.txt | 4 +- packages/panzer/disc-fe/src/CMakeLists.txt | 14 +- .../disc-fe/test/closure_model/CMakeLists.txt | 2 +- .../closure_model_composite/CMakeLists.txt | 2 +- .../disc-fe/test/core_tests/CMakeLists.txt | 2 +- .../test/epetra_gatherscatter/CMakeLists.txt | 2 +- .../disc-fe/test/equation_set/CMakeLists.txt | 2 +- .../test/evaluator_tests/CMakeLists.txt | 2 +- .../disc-fe/test/la_factory/CMakeLists.txt | 4 +- .../disc-fe/test/local_mesh/CMakeLists.txt | 2 +- .../disc-fe/test/physics_block/CMakeLists.txt | 6 +- .../disc-fe/test/workset_tests/CMakeLists.txt | 2 +- .../example/CartesianScaling/CMakeLists.txt | 4 +- packages/panzer/dof-mgr/src/CMakeLists.txt | 6 +- .../test/cartesian_topology/CMakeLists.txt | 2 +- .../dof-mgr/test/dofmngr_test/CMakeLists.txt | 2 +- .../dof-mgr/test/fe_assembly/CMakeLists.txt | 2 +- .../dof-mgr/test/field_pattern/CMakeLists.txt | 2 +- packages/panzer/expr-eval/src/CMakeLists.txt | 2 +- .../mini-em/example/BlockPrec/CMakeLists.txt | 2 +- packages/panzer/mini-em/src/CMakeLists.txt | 14 +- packages/percept/CMakeLists.txt | 6 +- packages/percept/src/adapt/CMakeLists.txt | 12 +- .../percept/src/adapt/main/CMakeLists.txt | 8 +- .../src/adapt/sierra_element/CMakeLists.txt | 2 +- packages/percept/src/percept/CMakeLists.txt | 32 +- .../src/percept/eigen_verify/CMakeLists.txt | 2 +- .../src/percept/fixtures/CMakeLists.txt | 2 +- .../src/percept/function/CMakeLists.txt | 2 +- .../percept/function/internal/CMakeLists.txt | 2 +- .../percept/src/percept/math/CMakeLists.txt | 2 +- .../src/percept/mesh/gen/CMakeLists.txt | 2 +- .../percept/mesh/mod/smoother/CMakeLists.txt | 2 +- .../src/percept/mesh_transfer/CMakeLists.txt | 2 +- .../percept/src/percept/norm/CMakeLists.txt | 2 +- .../src/percept/stk_rebalance/CMakeLists.txt | 8 +- .../stk_rebalance_utils/CMakeLists.txt | 6 +- .../percept/src/percept/util/CMakeLists.txt | 2 +- .../percept/src/percept/xfer/CMakeLists.txt | 2 +- .../FiniteElementAssembly/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- packages/phalanx/src/CMakeLists.txt | 4 +- packages/phalanx/test/Kokkos/CMakeLists.txt | 4 +- .../Performance/FieldAccessors/CMakeLists.txt | 4 +- .../phalanx/test/Utilities/CMakeLists.txt | 2 +- .../phalanx/test/ViewOfViews/CMakeLists.txt | 4 +- packages/pike/blackbox/src/CMakeLists.txt | 4 +- .../pike/blackbox/test/core/CMakeLists.txt | 4 +- .../pike/blackbox/test/models/CMakeLists.txt | 4 +- packages/pike/implicit/src/CMakeLists.txt | 4 +- packages/piro/src/CMakeLists.txt | 8 +- packages/piro/test/CMakeLists.txt | 2 +- packages/pliris/src/CMakeLists.txt | 4 +- .../rol/adapters/arrayfire/CMakeLists.txt | 2 +- .../rol/adapters/arrayfire/src/CMakeLists.txt | 8 +- packages/rol/adapters/belos/CMakeLists.txt | 4 +- .../rol/adapters/belos/src/CMakeLists.txt | 12 +- .../adapters/belos/test/vector/CMakeLists.txt | 2 +- packages/rol/adapters/eigen/CMakeLists.txt | 2 +- .../rol/adapters/eigen/src/CMakeLists.txt | 8 +- packages/rol/adapters/epetra/CMakeLists.txt | 4 +- .../rol/adapters/epetra/src/CMakeLists.txt | 12 +- .../rol/adapters/minitensor/CMakeLists.txt | 6 +- .../adapters/minitensor/src/CMakeLists.txt | 18 +- packages/rol/adapters/mpi/CMakeLists.txt | 4 +- packages/rol/adapters/mpi/src/CMakeLists.txt | 8 +- packages/rol/adapters/pebbl/CMakeLists.txt | 6 +- .../rol/adapters/pebbl/src/CMakeLists.txt | 10 +- packages/rol/adapters/sacado/CMakeLists.txt | 2 +- .../rol/adapters/sacado/src/CMakeLists.txt | 8 +- .../rol/adapters/sacado/test/CMakeLists.txt | 2 +- packages/rol/adapters/teuchos/CMakeLists.txt | 6 +- .../rol/adapters/teuchos/src/CMakeLists.txt | 20 +- packages/rol/adapters/thyra/CMakeLists.txt | 4 +- .../rol/adapters/thyra/src/CMakeLists.txt | 12 +- packages/rol/adapters/tpetra/CMakeLists.txt | 10 +- .../rol/adapters/tpetra/src/CMakeLists.txt | 24 +- .../adapters/tpetra/test/sol/CMakeLists.txt | 2 +- .../tpetra/test/vector/CMakeLists.txt | 4 +- packages/rol/adapters/trikota/CMakeLists.txt | 4 +- .../rol/adapters/trikota/src/CMakeLists.txt | 12 +- .../adapters/trikota/test/sol/CMakeLists.txt | 2 +- packages/rol/cmake/BuildOptions.cmake | 248 +- .../PDE-OPT/0ld/adv-diff-react/CMakeLists.txt | 2 +- .../PDE-OPT/0ld/elasticity/CMakeLists.txt | 2 +- .../CMakeLists.txt | 6 +- .../PDE-OPT/0ld/poisson/CMakeLists.txt | 2 +- .../0ld/stefan-boltzmann/CMakeLists.txt | 6 +- .../PDE-OPT/0ld/stoch-adv-diff/CMakeLists.txt | 6 +- .../multipleFrequency/CMakeLists.txt | 6 +- .../helmholtz/singleFrequency/CMakeLists.txt | 6 +- .../example/poisson/singleObs/CMakeLists.txt | 6 +- .../PDE-OPT/adv-diff-react/CMakeLists.txt | 6 +- .../example/PDE-OPT/allen-cahn/CMakeLists.txt | 6 +- .../binary/adv-diff-SUR/CMakeLists.txt | 16 +- .../binary/adv-diff-TEST/CMakeLists.txt | 18 +- .../PDE-OPT/binary/adv-diff/CMakeLists.txt | 16 +- .../PDE-OPT/binary/elasticity/CMakeLists.txt | 14 +- .../binary/stefan-boltzmann/CMakeLists.txt | 18 +- .../PDE-OPT/dynamic/adv_diff/CMakeLists.txt | 2 +- .../dynamic/navier-stokes/CMakeLists.txt | 12 +- .../PDE-OPT/dynamic/semilinear/CMakeLists.txt | 8 +- .../dynamic/thermal-fluids/CMakeLists.txt | 6 +- .../flow-opt/3dim/models/darcy/CMakeLists.txt | 6 +- .../models/brinkman/CMakeLists.txt | 6 +- .../axisymmetric/models/darcy/CMakeLists.txt | 6 +- .../models/filteredDarcy/CMakeLists.txt | 6 +- .../PDE-OPT/fractional/poisson/CMakeLists.txt | 2 +- .../PDE-OPT/ginzburg-landau/CMakeLists.txt | 4 +- .../example/PDE-OPT/helmholtz/CMakeLists.txt | 4 +- .../PDE-OPT/navier-stokes/CMakeLists.txt | 6 +- .../PDE-OPT/nonlinear-elliptic/CMakeLists.txt | 6 +- .../example/PDE-OPT/obstacle/CMakeLists.txt | 2 +- .../PDE-OPT/poisson-boltzmann/CMakeLists.txt | 6 +- .../example/PDE-OPT/poisson/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../IMAvolumes_KouriRidzal2017/CMakeLists.txt | 10 +- .../MPA_KouriSurowiec2019/CMakeLists.txt | 6 +- .../CMakeLists.txt | 6 +- .../TRSPG_Kouri2021/dualksvm/CMakeLists.txt | 6 +- .../TRSPG_Kouri2021/dualsvm/CMakeLists.txt | 6 +- .../TRSPG_Kouri2021/elasticity/CMakeLists.txt | 6 +- .../TRSPG_Kouri2021/lasso/CMakeLists.txt | 6 +- .../navier-stokes/CMakeLists.txt | 6 +- .../TRSPG_Kouri2021/simpreg/CMakeLists.txt | 6 +- .../PDE-OPT/stefan-boltzmann/CMakeLists.txt | 6 +- .../rol/example/PDE-OPT/stokes/CMakeLists.txt | 4 +- .../PDE-OPT/thermal-fluids/CMakeLists.txt | 6 +- .../topo-opt/elasticity/CMakeLists.txt | 6 +- .../PDE-OPT/topo-opt/multimat/CMakeLists.txt | 6 +- .../topo-opt/navier-stokes/CMakeLists.txt | 6 +- .../PDE-OPT/topo-opt/poisson/CMakeLists.txt | 2 +- .../rol/example/PinT/nonlinear/CMakeLists.txt | 4 +- .../PinT/parabolic-control/CMakeLists.txt | 4 +- .../rol/example/PinT/tanks/CMakeLists.txt | 4 +- packages/rol/example/arrayfire/CMakeLists.txt | 2 +- .../example/burgers-control/CMakeLists.txt | 2 +- packages/rol/example/json/CMakeLists.txt | 2 +- .../rol/example/l1-penalty/CMakeLists.txt | 4 +- .../example/poisson-control/CMakeLists.txt | 4 +- packages/rol/example/sacado/CMakeLists.txt | 4 +- packages/rol/example/tempus/CMakeLists.txt | 2 +- .../rol/example/tensor-opt/CMakeLists.txt | 2 +- packages/rol/src/CMakeLists.txt | 60 +- packages/rol/src/compatibility/CMakeLists.txt | 4 +- packages/rol/test/elementwise/CMakeLists.txt | 2 +- .../test/step/interiorpoint/CMakeLists.txt | 4 +- packages/rtop/src/CMakeLists.txt | 12 +- .../rythmos/adapters/gaasp/src/CMakeLists.txt | 6 +- .../adapters/gaasp/tpl_src/CMakeLists.txt | 4 +- packages/rythmos/test/Charon/CMakeLists.txt | 2 +- .../rythmos/test/ThetaStepper/CMakeLists.txt | 2 +- packages/sacado/src/CMakeLists.txt | 12 +- .../sacado/test/GTestSuite/CMakeLists.txt | 4 +- .../test/performance/advection/CMakeLists.txt | 4 +- .../advection_const_basis/CMakeLists.txt | 4 +- .../performance/fenl_assembly/CMakeLists.txt | 4 +- .../fenl_assembly_view/CMakeLists.txt | 4 +- .../test/performance/mat_vec/CMakeLists.txt | 4 +- packages/sacado/test/utils/CMakeLists.txt | 4 +- .../applications/algebra/CMakeLists.txt | 2 +- .../applications/aprepro/CMakeLists.txt | 2 +- .../seacas/applications/blot/CMakeLists.txt | 2 +- .../applications/conjoin/CMakeLists.txt | 2 +- .../seacas/applications/cpup/CMakeLists.txt | 2 +- .../seacas/applications/ejoin/CMakeLists.txt | 2 +- .../seacas/applications/epu/CMakeLists.txt | 2 +- .../applications/ex1ex2v2/CMakeLists.txt | 2 +- .../applications/ex2ex1v2/CMakeLists.txt | 2 +- .../applications/exo2mat/CMakeLists.txt | 2 +- .../applications/exo_format/CMakeLists.txt | 2 +- .../applications/exodiff/CMakeLists.txt | 2 +- .../applications/exomatlab/CMakeLists.txt | 2 +- .../applications/exotec2/CMakeLists.txt | 2 +- .../seacas/applications/exotxt/CMakeLists.txt | 2 +- .../applications/explore/CMakeLists.txt | 2 +- .../seacas/applications/fastq/CMakeLists.txt | 2 +- .../seacas/applications/gen3d/CMakeLists.txt | 2 +- .../applications/genshell/CMakeLists.txt | 2 +- .../seacas/applications/gjoin/CMakeLists.txt | 2 +- .../seacas/applications/grepos/CMakeLists.txt | 2 +- .../applications/mapvar-kd/CMakeLists.txt | 2 +- .../seacas/applications/mapvar/CMakeLists.txt | 2 +- .../applications/mat2exo/CMakeLists.txt | 2 +- .../applications/nas2exo/CMakeLists.txt | 2 +- .../applications/nem_slice/CMakeLists.txt | 4 +- .../applications/nem_spread/CMakeLists.txt | 2 +- .../applications/numbers/CMakeLists.txt | 2 +- .../seacas/applications/slice/CMakeLists.txt | 2 +- .../seacas/applications/txtexo/CMakeLists.txt | 2 +- .../seacas/applications/zellij/CMakeLists.txt | 4 +- .../libraries/aprepro_lib/CMakeLists.txt | 2 +- .../seacas/libraries/chaco/CMakeLists.txt | 2 +- .../libraries/exoIIv2for32/CMakeLists.txt | 4 +- .../seacas/libraries/exodus/CMakeLists.txt | 4 +- .../libraries/exodus_for/CMakeLists.txt | 4 +- .../seacas/libraries/ioss/src/CMakeLists.txt | 6 +- .../libraries/ioss/src/adios/CMakeLists.txt | 4 +- .../ioss/src/adios/utest/CMakeLists.txt | 2 +- .../ioss/src/catalyst/CMakeLists.txt | 4 +- .../libraries/ioss/src/cgns/CMakeLists.txt | 4 +- .../libraries/ioss/src/exodus/CMakeLists.txt | 4 +- .../libraries/ioss/src/faodel/CMakeLists.txt | 4 +- .../ioss/src/gen_struc/CMakeLists.txt | 4 +- .../ioss/src/generated/CMakeLists.txt | 4 +- .../ioss/src/heartbeat/CMakeLists.txt | 4 +- .../libraries/ioss/src/init/CMakeLists.txt | 4 +- .../libraries/ioss/src/main/CMakeLists.txt | 4 +- .../libraries/ioss/src/pamgen/CMakeLists.txt | 4 +- .../ioss/src/text_mesh/CMakeLists.txt | 4 +- .../ioss/src/transform/CMakeLists.txt | 4 +- .../ioss/src/unit_tests/CMakeLists.txt | 2 +- .../libraries/ioss/src/utest/CMakeLists.txt | 2 +- .../ioss/src/visualization/CMakeLists.txt | 4 +- .../src/visualization/catalyst/CMakeLists.txt | 6 +- .../catalyst/parser/CMakeLists.txt | 4 +- .../seacas/libraries/mapvarlib/CMakeLists.txt | 2 +- .../seacas/libraries/nemesis/CMakeLists.txt | 2 +- packages/seacas/libraries/plt/CMakeLists.txt | 2 +- .../seacas/libraries/supes/CMakeLists.txt | 2 +- .../seacas/libraries/suplib/CMakeLists.txt | 2 +- .../seacas/libraries/suplib_c/CMakeLists.txt | 2 +- .../libraries/suplib_cpp/CMakeLists.txt | 2 +- packages/seacas/libraries/svdi/CMakeLists.txt | 2 +- packages/seacas/scripts/CMakeLists.txt | 2 +- packages/shards/src/CMakeLists.txt | 4 +- .../shylu/shylu_dd/common/src/CMakeLists.txt | 8 +- .../shylu/shylu_dd/core/src/CMakeLists.txt | 12 +- .../shylu/shylu_dd/core/test/CMakeLists.txt | 2 +- .../shylu/shylu_dd/frosch/src/CMakeLists.txt | 32 +- .../shylu_node/basker/src/CMakeLists.txt | 4 +- .../shylu_node/fastilu/src/CMakeLists.txt | 4 +- .../shylu/shylu_node/hts/src/CMakeLists.txt | 4 +- .../shylu_node/tacho/example/CMakeLists.txt | 4 +- .../shylu/shylu_node/tacho/src/CMakeLists.txt | 6 +- .../shylu_node/tacho/unit-test/CMakeLists.txt | 8 +- packages/stk/CMakeLists.txt | 2 +- .../stk_balance/stk_balance/CMakeLists.txt | 2 +- packages/stk/stk_coupling/CMakeLists.txt | 2 +- .../stk_coupling/stk_coupling/CMakeLists.txt | 2 +- .../stk_doc_tests/stk_balance/CMakeLists.txt | 4 +- .../stk/stk_doc_tests/stk_io/CMakeLists.txt | 16 +- .../stk/stk_doc_tests/stk_mesh/CMakeLists.txt | 6 +- .../stk/stk_doc_tests/stk_simd/CMakeLists.txt | 4 +- .../stk_doc_tests/stk_topology/CMakeLists.txt | 2 +- .../stk_doc_tests/stk_transfer/CMakeLists.txt | 6 +- .../stk/stk_doc_tests/stk_util/CMakeLists.txt | 2 +- .../stk_emend/independent_set/CMakeLists.txt | 2 +- .../independent_set/unit_tests/CMakeLists.txt | 8 +- .../stk_expreval/stk_expreval/CMakeLists.txt | 6 +- .../stk_expreval/unit_tests/CMakeLists.txt | 8 +- .../stk_balance/CMakeLists.txt | 6 +- .../stk_mesh/CMakeLists.txt | 12 +- .../stk_search/CMakeLists.txt | 2 +- .../stk_transfer/CMakeLists.txt | 12 +- packages/stk/stk_io/stk_io/CMakeLists.txt | 18 +- .../stk/stk_io/stk_io/util/CMakeLists.txt | 8 +- packages/stk/stk_math/stk_math/CMakeLists.txt | 2 +- .../stk/stk_mesh/stk_mesh/base/CMakeLists.txt | 2 +- .../stk_ngp_test/stk_ngp_test/CMakeLists.txt | 8 +- .../stk_mesh/CMakeLists.txt | 14 +- .../stk/stk_search/stk_search/CMakeLists.txt | 2 +- .../stk_search_util/CMakeLists.txt | 2 +- .../stk_search_util/unit_tests/CMakeLists.txt | 8 +- packages/stk/stk_simd/stk_math/CMakeLists.txt | 6 +- packages/stk/stk_simd/stk_simd/CMakeLists.txt | 6 +- .../stk_simd/kokkos_simd/CMakeLists.txt | 6 +- .../stk/stk_simd/stk_simd_view/CMakeLists.txt | 6 +- .../stk/stk_tools/stk_tools/CMakeLists.txt | 2 +- .../stk_topology/stk_topology/CMakeLists.txt | 2 +- packages/stk/stk_transfer/CMakeLists.txt | 2 +- .../stk_unit_test_utils/CMakeLists.txt | 10 +- .../stk_mesh_fixtures/CMakeLists.txt | 4 +- .../stk_unit_tests/stk_balance/CMakeLists.txt | 4 +- .../stk_coupling/CMakeLists.txt | 2 +- .../stk/stk_unit_tests/stk_io/CMakeLists.txt | 6 +- .../stk_unit_tests/stk_math/CMakeLists.txt | 8 +- .../stk_unit_tests/stk_mesh/CMakeLists.txt | 2 +- .../stk_ngp_test/CMakeLists.txt | 4 +- .../stk_unit_tests/stk_search/CMakeLists.txt | 2 +- .../stk_unit_tests/stk_simd/CMakeLists.txt | 8 +- .../stk_simd_old/CMakeLists.txt | 8 +- .../stk_unit_tests/stk_tools/CMakeLists.txt | 4 +- .../stk_topology/CMakeLists.txt | 6 +- .../stk_transfer/CMakeLists.txt | 8 +- .../stk_unit_tests/stk_util/CMakeLists.txt | 2 +- packages/stk/stk_util/stk_util/CMakeLists.txt | 2 +- .../stk_util/command_line/CMakeLists.txt | 2 +- .../stk/stk_util/stk_util/diag/CMakeLists.txt | 2 +- .../stk_util/environment/CMakeLists.txt | 2 +- .../stk/stk_util/stk_util/ngp/CMakeLists.txt | 2 +- .../stk_util/stk_util/parallel/CMakeLists.txt | 2 +- .../stk_util/stk_util/registry/CMakeLists.txt | 2 +- .../stk/stk_util/stk_util/util/CMakeLists.txt | 2 +- packages/stokhos/src/CMakeLists.txt | 70 +- .../test/Performance/CuspAMG/CMakeLists.txt | 4 +- .../test/Performance/CuspSpMM/CMakeLists.txt | 4 +- .../Performance/FadMPAssembly/CMakeLists.txt | 4 +- .../KokkosArraySPMVKernels/CMakeLists.txt | 4 +- .../Performance/KokkosSpMM/CMakeLists.txt | 4 +- .../Performance/MPAssembly/CMakeLists.txt | 4 +- .../MPVectorKernels/CMakeLists.txt | 4 +- .../PCEMeanMultiply/CMakeLists.txt | 4 +- .../adapters/amesos/src/CMakeLists.txt | 2 +- .../adapters/amesos2/src/CMakeLists.txt | 4 +- .../adapters/aztecoo/src/CMakeLists.txt | 2 +- .../adapters/belos/src/CMakeLists.txt | 6 +- .../adapters/ifpack/src/CMakeLists.txt | 2 +- .../adapters/ml/src/CMakeLists.txt | 2 +- .../doc/parameterList/CMakeLists.txt | 2 +- packages/stratimikos/src/CMakeLists.txt | 4 +- .../examples/AddMultiplyPrecs/CMakeLists.txt | 2 +- .../examples/BasicExamples/CMakeLists.txt | 2 +- .../BuildPreconditioner/CMakeLists.txt | 2 +- .../BuildPreconditioner/step1/CMakeLists.txt | 2 +- .../examples/ML-Teko-Coupling/CMakeLists.txt | 2 +- .../teko/examples/StridedSolve/CMakeLists.txt | 2 +- packages/teko/src/CMakeLists.txt | 12 +- .../examples/00_Basic_Problem/CMakeLists.txt | 2 +- .../examples/01_Utilize_Thyra/CMakeLists.txt | 2 +- .../02_Use_ModelEvaluator/CMakeLists.txt | 2 +- packages/tempus/src/CMakeLists.txt | 4 +- packages/tempus/src/deprecated/CMakeLists.txt | 4 +- packages/tempus/test/BDF2/CMakeLists.txt | 2 +- .../tempus/test/BackwardEuler/CMakeLists.txt | 2 +- packages/tempus/test/DIRK/CMakeLists.txt | 2 +- .../tempus/test/ExplicitRK/CMakeLists.txt | 2 +- .../tempus/test/ForwardEuler/CMakeLists.txt | 2 +- packages/tempus/test/HHTAlpha/CMakeLists.txt | 2 +- packages/tempus/test/IMEX_RK/CMakeLists.txt | 2 +- .../test/IMEX_RK_Partitioned/CMakeLists.txt | 2 +- packages/tempus/test/Leapfrog/CMakeLists.txt | 2 +- packages/tempus/test/Newmark/CMakeLists.txt | 2 +- .../tempus/test/OperatorSplit/CMakeLists.txt | 2 +- .../tempus/test/PhysicsState/CMakeLists.txt | 2 +- .../tempus/test/Subcycling/CMakeLists.txt | 2 +- .../tempus/test/TestModels/CMakeLists.txt | 6 +- packages/tempus/test/TestUtils/CMakeLists.txt | 2 +- .../tempus/test/Trapezoidal/CMakeLists.txt | 2 +- packages/tempus/unit_test/CMakeLists.txt | 2 +- packages/teuchos/comm/src/CMakeLists.txt | 4 +- packages/teuchos/core/src/CMakeLists.txt | 10 +- .../core/test/CWrapperSupport/CMakeLists.txt | 2 +- .../teuchos/kokkoscomm/src/CMakeLists.txt | 4 +- .../teuchos/kokkoscompat/src/CMakeLists.txt | 4 +- .../teuchos/kokkoscompat/test/CMakeLists.txt | 6 +- packages/teuchos/numerics/src/CMakeLists.txt | 4 +- .../teuchos/parameterlist/src/CMakeLists.txt | 4 +- .../test/Validators/CMakeLists.txt | 2 +- packages/teuchos/parser/src/CMakeLists.txt | 4 +- packages/teuchos/remainder/src/CMakeLists.txt | 6 +- .../thyra/adapters/epetra/src/CMakeLists.txt | 2 +- .../example/model_evaluator/CMakeLists.txt | 2 +- .../adapters/epetraext/src/CMakeLists.txt | 4 +- .../thyra/adapters/tpetra/src/CMakeLists.txt | 2 +- packages/thyra/core/src/CMakeLists.txt | 28 +- packages/tpetra/core/compat/CMakeLists.txt | 6 +- packages/tpetra/core/ext/CMakeLists.txt | 4 +- packages/tpetra/core/inout/CMakeLists.txt | 4 +- packages/tpetra/core/src/CMakeLists.txt | 6 +- .../test/PerformanceCGSolve/CMakeLists.txt | 2 +- packages/tpetra/tsqr/src/CMakeLists.txt | 4 +- .../examples/fenl/CMakeLists.txt | 4 +- packages/trilinoscouplings/src/CMakeLists.txt | 14 +- packages/triutils/src/CMakeLists.txt | 4 +- packages/xpetra/example/CMakeLists.txt | 4 +- packages/xpetra/example/Simple/CMakeLists.txt | 2 +- packages/xpetra/research/max/CMakeLists.txt | 2 +- packages/xpetra/src/CMakeLists.txt | 44 +- packages/xpetra/sup/CMakeLists.txt | 8 +- .../zoltan/siMPI/pyMPI/siMPI/CMakeLists.txt | 2 +- packages/zoltan/src/CMakeLists.txt | 50 +- packages/zoltan/src/fdriver/CMakeLists.txt | 2 +- packages/zoltan2/core/src/CMakeLists.txt | 36 +- packages/zoltan2/sphynx/src/CMakeLists.txt | 6 +- 733 files changed, 4906 insertions(+), 4782 deletions(-) create mode 100644 cmake/tribits/common_tpls/FindTPLLAPACKDependencies.cmake create mode 100644 cmake/tribits/core/package_arch/TribitsGetEnabledSublists.cmake create mode 100644 cmake/tribits/core/package_arch/TribitsGetPackageEnableStatus.cmake create mode 100644 cmake/tribits/core/package_arch/TribitsSetAndIncDirs.cmake create mode 100644 cmake/tribits/core/package_arch/TribitsSetUpEnabledOnlyDependencies.cmake delete mode 100644 cmake/tribits/core/utils/CMakeOverrides.cmake create mode 100644 cmake/tribits/core/utils/TribitsAddEnumCacheVar.cmake rename cmake/tribits/core/utils/{SetAndIncDirs.cmake => TribitsCreateReverseList.cmake} (80%) create mode 100644 cmake/tribits/core/utils/TribitsDeprecatedHelpers.cmake create mode 100644 cmake/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLLAPACKDependencies.cmake create mode 100644 cmake/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLParMETISDependencies.cmake create mode 100644 cmake/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLSuperLUDependencies.cmake create mode 100644 cmake/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLSuperLUDistDependencies.cmake create mode 100644 cmake/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/PackagesList.cmake create mode 100644 cmake/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/TPLsList.cmake create mode 100644 cmake/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/cmake/Dependencies.cmake create mode 100644 cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/test/inc/SimpleCxx_HelloWorld_Tests.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index f6aef3721c6a..01f7a476c14a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,6 +69,7 @@ INCLUDE(${CMAKE_CURRENT_LIST_DIR}/ProjectName.cmake) # not in an include file :-( PROJECT(${PROJECT_NAME} NONE) +# Set up to use ccache if($ENV{CCACHE_NODISABLE}) # ccache must be requested explicitly by setting env-var CCACHE_NODISABLE find_program(CCACHE_PROGRAM ccache) @@ -100,9 +101,12 @@ else() endif() endif() -## set an env so we know we are in configure +# Set an env so we know we are in configure set(ENV{CMAKE_IS_IN_CONFIGURE_MODE} 1) +# Don't define TriBITS override of include_directories() +set(TRIBITS_HIDE_DEPRECATED_INCLUDE_DIRECTORIES_OVERRIDE TRUE) + # # B) Pull in the TriBITS system and execute # diff --git a/cmake/tribits/CHANGELOG.md b/cmake/tribits/CHANGELOG.md index 144bb070dce2..c0ad93274308 100644 --- a/cmake/tribits/CHANGELOG.md +++ b/cmake/tribits/CHANGELOG.md @@ -2,6 +2,82 @@ ChangeLog for TriBITS ---------------------------------------- +## 2022-12-20: + +* **Deprecated:** The macro `set_and_inc_dirs()` is deprecated and replaced by + `tribits_set_and_inc_dirs()`. Use the script + `TriBITS/refactoring/replace_set_and_inc_dirs_r.sh` to update + `CMakeLists.txt` files. + +## 2022-11-03: + +* **Deprecated:** The long-deprecated TriBITS function override + `include_directories()` now emits a deprecated warning. To replace all + usages of `include_directories()` that should be + `tribits_include_directories()`, use the script + `TriBITS/refactoring/replace_include_directories_r.sh` (see documentation in + that script). + +* **Deprecated:** Many previously deprecated TriBITS features now will trigger + a CMake DEPRECATION warning message by default (by calling + `message(DEPRECATION ...)`). The message printed to the CMake output will + typically describe how to remove the usage of the deprecated feature. To + remove deprecation warnings, change to use the non-deprecated features + mentioned in the deprecation warning message. To temporarily disable + deprecation warnings, configure with `-D + TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE=IGNORE` (see build reference entry + for `TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE` for more details). + +## 2022-10-20: + +* **Changed:** Disabling an external package/TPL will now disable any + downstream external packages/TPLs that list a dependency on that external + package/TPL through its + [`FindTPLDependencies.cmake`](https://tribitspub.github.io/TriBITS/users_guide/index.html#findtpl-tplname-dependencies-cmake) + file. Prior to this, disabling an external package/TPL would not disable + dependent downstream external packages/TPLs (it would only disable + downstream dependent required internal packages). To avoid this, simply + leave the enable status of the upstream external package/TPL empty "" and no + downstream propagation of disables will take place. + +## 2022-10-16: + +* **Removed:** Removed the variables `_LIBRARY_DIRS`, + `_TPL_LIST` and `_TPL_LIBRARIES` from the installed + `Config.cmake` file. These are not needed after the change to + modern CMake targets `::all_libs` (see `::all_libs` + below). To determine if a TPL is enabled, check `if (TARGET + ::all_libs)`. To get the libraries and include dirs for a TPL, + link against the IMPORTED target `::all_libs` (see the updated + TriBITS example APP projects for details). + +* **Removed:** Removed the variables `_PACKAGE_LIST`, + `_TPL_LIST`, `_INCLUDE_DIR`, `_LIBRARY_DIRS`, + `_TPL_INCLUDE_DIRS`, `_TPL_LIBRARIES` and + `_TPL_LIBRARY_DIRS` from the generated `Config.cmake` + files. These are not needed with the move to modern CMake targets (see + `::all_libs` below). + +* **Changed:** Changed `_LIBRARIES` in generated + `Config.cmake` files from the full list of the package's library + targets to just `::all_libs`. (There is no need to list the + individual libraries after the move to modern CMake targets.) + +## 2022-10-11: + +* **Changed:** Added option `_ASSERT_DEFINED_DEPENDENCIES` to + determine if listed external package/TPL and internal package dependencies + are defined within the project or not. The initial default is `FATAL_ERROR` + for development mode and `IGNORE` for release mode. (Previously, undefined + external package/TPL dependencies where ignore.) To set a different + default, set `_ASSERT_DEFINED_DEPENDENCIES_DEFAULT` to `WARNING`, + for example, in the project's `ProjectName.cmake` file. + +* **Removed:** `_ASSERT_MISSING_PACKAGES` has been removed and setting + it will result in a `FATAL_ERROR`. Instead, use + `_ASSERT_DEFINED_DEPENDENCIES` (and make sure all of your project's + listed TPL dependencies are all defined within the project). + ## 2022-10-02: * **Changed:** The TriBITS FindTPLCUDA.cmake module changed @@ -11,7 +87,6 @@ ChangeLog for TriBITS `find_package(CUDAToolkit)` (see [Trilinos #10954](https://github.com/trilinos/Trilinos/issues/10954)). - ## 2022-09-16: * **Changed:** Changed nomenclature for packages and TPLs (see updated diff --git a/cmake/tribits/ci_support/TribitsDumpDepsXmlScript.cmake b/cmake/tribits/ci_support/TribitsDumpDepsXmlScript.cmake index 771c2e6dcd31..5c926e9023f6 100644 --- a/cmake/tribits/ci_support/TribitsDumpDepsXmlScript.cmake +++ b/cmake/tribits/ci_support/TribitsDumpDepsXmlScript.cmake @@ -116,8 +116,8 @@ include(TribitsWriteXmlDependenciesFiles) # Generate the dependencies file -set(${PROJECT_NAME}_ASSERT_MISSING_PACKAGES FALSE) -set(${PROJECT_NAME}_OUTPUT_DEPENDENCY_FILES FALSE) +set(${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES OFF) +set(${PROJECT_NAME}_OUTPUT_DEPENDENCY_FILES FALSE) if (NOT ${PROJECT_NAME}_PRE_REPOSITORIES) # Make sure is defined! set(${PROJECT_NAME}_PRE_REPOSITORIES "") endif() diff --git a/cmake/tribits/ci_support/TribitsWriteXmlDependenciesFiles.cmake b/cmake/tribits/ci_support/TribitsWriteXmlDependenciesFiles.cmake index 4050ba3e5060..1091008e3c01 100644 --- a/cmake/tribits/ci_support/TribitsWriteXmlDependenciesFiles.cmake +++ b/cmake/tribits/ci_support/TribitsWriteXmlDependenciesFiles.cmake @@ -38,172 +38,215 @@ # @HEADER -# -# This file gets included in the main TriBITS framework. It is put here to -# reduce the size of the tribits/core/ directory. -# - - -function(tribits_write_deps_to_xml_string PACKAGE_NAME LIST_TYPE - XML_VAR - ) - - set(LOC_XML "${${XML_VAR}}") - - set(DEPS_VAR ${PACKAGE_NAME}_${LIST_TYPE}) - assert_defined(DEPS_VAR) - set(DEPS ${${DEPS_VAR}}) - - #print_var(PACKAGE_NAME) - #print_var(DEPS) +################################################################################ +# NOTE: This file gets included in the main TriBITS core framework. It is put +# here to reduce the size of the tribits/core/ directory as this is optional +# behavior. +################################################################################ - if (NOT DEPS) - list(APPEND LOC_XML - " <${LIST_TYPE}/>\n" ) - - else() - - set(VALUE_STR "") - - foreach(DEP ${DEPS}) - - if(VALUE_STR) - set(VALUE_STR "${VALUE_STR},") - endif() +# @MACRO: tribits_write_xml_dependency_files() +# +# Usage:: +# +# tribits_write_xml_dependency_files() +# +# Macro that outputs XML dependency files if asked based in the global project +# package dependency graph previously constructed. +# +macro(tribits_write_xml_dependency_files) - set(VALUE_STR "${VALUE_STR}${DEP}") + tribits_config_code_start_timer(WRITE_DEPENDENCY_FILES_TIME_START_SECONDS) - endforeach() + if (${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE) + if (NOT IS_ABSOLUTE ${${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE}) + set(${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE + ${CMAKE_CURRENT_BINARY_DIR}/${${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE}) + endif() + message("" ) + message("Dumping the XML dependencies file" + " ${${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE} ..." ) + tribits_dump_deps_xml_file() + endif() - list(APPEND LOC_XML - " <${LIST_TYPE} value=\"${VALUE_STR}\"/>\n" ) + if (${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE AND ${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE) + if (NOT IS_ABSOLUTE ${${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE}) + set(${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE + ${CMAKE_CURRENT_BINARY_DIR}/${${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE}) + endif() + message("" ) + message("Dumping the HTML dependencies webpage file" + " ${${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE} ..." ) + set(tribitsCiSupportDir "${${PROJECT_NAME}_TRIBITS_DIR}/${TRIBITS_CI_SUPPORT_DIR}") + execute_process( + COMMAND ${PYTHON_EXECUTABLE} + ${tribitsCiSupportDir}/dump-package-dep-table.py + --input-xml-deps-file=${${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE} + --output-html-deps-file=${${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE} ) + endif() + if (${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE AND ${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE) + if (NOT IS_ABSOLUTE ${${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE}) + set(${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE + ${CMAKE_CURRENT_BINARY_DIR}/${${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE}) + endif() + message("" ) + message("Dumping the CDash XML dependencies file" + " ${${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE} ..." ) + set(tribitsCtestDriverDir + "${${PROJECT_NAME}_TRIBITS_DIR}/${TRIBITS_CTEST_DRIVER_DIR}") + if (EXISTS "${tribitsCtestDriverDir}") + execute_process( + COMMAND ${PYTHON_EXECUTABLE} + ${tribitsCtestDriverDir}/dump-cdash-deps-xml-file.py + --input-xml-deps-file=${${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE} + --output-cdash-deps-xml-file=${${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE}) + else() + message(FATAL_ERROR "\nERROR: Can't write" + " ${${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE}" + " because '${tribitsCtestDriverDir}' does not exist!") + endif() endif() - if (LOC_XML) - set(${XML_VAR} "${LOC_XML}" PARENT_SCOPE) + if (${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE + OR ${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE + OR ${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE + ) + tribits_config_code_stop_timer(WRITE_DEPENDENCY_FILES_TIME_START_SECONDS + "\nTotal time to write dependency files") endif() -endfunction() +endmacro() +# Function that writes the dependency information for the TriBITS project +# ${PROJECT_NAME} into an XML file for other tools to use. # -# Function that writes the dependency information for ${PROJECT_NAME} into -# an XML file for other tools to use. -# - function(tribits_dump_deps_xml_file) - set(DEPS_XM) + set(depsXml "") get_filename_component(PROJECT_BASE_DIR_NAME "${${PROJECT_NAME}_SOURCE_DIR}" NAME) - list(APPEND DEPS_XML + list(APPEND depsXml "\n" ) - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES}) + foreach(tribitsPackage ${${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES}) - #message("") - #print_var(TRIBITS_PACKAGE) + list(APPEND depsXml + " \n") - list(APPEND DEPS_XML - " \n") + tribits_write_deps_to_xml_string(${tribitsPackage} LIB REQUIRED PACKAGES depsXml) + tribits_write_deps_to_xml_string(${tribitsPackage} LIB OPTIONAL PACKAGES depsXml) + tribits_write_deps_to_xml_string(${tribitsPackage} TEST REQUIRED PACKAGES depsXml) + tribits_write_deps_to_xml_string(${tribitsPackage} TEST OPTIONAL PACKAGES depsXml) + tribits_write_deps_to_xml_string(${tribitsPackage} LIB REQUIRED TPLS depsXml) + tribits_write_deps_to_xml_string(${tribitsPackage} LIB OPTIONAL TPLS depsXml) + tribits_write_deps_to_xml_string(${tribitsPackage} TEST REQUIRED TPLS depsXml) + tribits_write_deps_to_xml_string(${tribitsPackage} TEST OPTIONAL TPLS depsXml) - tribits_write_deps_to_xml_string(${TRIBITS_PACKAGE} LIB_REQUIRED_DEP_PACKAGES DEPS_XML) - tribits_write_deps_to_xml_string(${TRIBITS_PACKAGE} LIB_OPTIONAL_DEP_PACKAGES DEPS_XML) - tribits_write_deps_to_xml_string(${TRIBITS_PACKAGE} TEST_REQUIRED_DEP_PACKAGES DEPS_XML) - tribits_write_deps_to_xml_string(${TRIBITS_PACKAGE} TEST_OPTIONAL_DEP_PACKAGES DEPS_XML) - tribits_write_deps_to_xml_string(${TRIBITS_PACKAGE} LIB_REQUIRED_DEP_TPLS DEPS_XML) - tribits_write_deps_to_xml_string(${TRIBITS_PACKAGE} LIB_OPTIONAL_DEP_TPLS DEPS_XML) - tribits_write_deps_to_xml_string(${TRIBITS_PACKAGE} TEST_REQUIRED_DEP_TPLS DEPS_XML) - tribits_write_deps_to_xml_string(${TRIBITS_PACKAGE} TEST_OPTIONAL_DEP_TPLS DEPS_XML) - - list(APPEND DEPS_XML + list(APPEND depsXml " \n" - " \n" + " \n" " \n" ) - list(APPEND DEPS_XML - " \n" + list(APPEND depsXml + " \n" ) - list(APPEND DEPS_XML + list(APPEND depsXml " \n" ) endforeach() - list(APPEND DEPS_XML + list(APPEND depsXml "\n" ) - #print_var(DEPS_XML) - string(REPLACE "\n;" "\n" DEPS_XML "${DEPS_XML}") - file(WRITE ${${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE} "${DEPS_XML}" ) + string(REPLACE "\n;" "\n" depsXml "${depsXml}") + file(WRITE ${${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE} "${depsXml}" ) endfunction() -# @MACRO: tribits_write_xml_dependency_files() -# -# Usage:: -# -# tribits_write_xml_dependency_files() -# -# Macro that output XML dependency files if asked based in the global project -# package dependency graph previously constructed.. -# -macro(tribits_write_xml_dependency_files) +function(tribits_write_deps_to_xml_string packageName libOrTest requiredOrOptional + packagesOrTpls xmlVarInOut + ) - tribits_config_code_start_timer(WRITE_DEPENDENCY_FILES_TIME_START_SECONDS) + set(localXml "${${xmlVarInOut}}") - #print_var(${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE) - if (${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE) - if (NOT IS_ABSOLUTE ${${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE}) - set(${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE - ${CMAKE_CURRENT_BINARY_DIR}/${${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE}) - endif() - message("" ) - message("Dumping the XML dependencies file ${${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE} ..." ) - tribits_dump_deps_xml_file() + set(listType ${libOrTest}_${requiredOrOptional}_DEP_${packagesOrTpls}) + message("") + print_var(listType) + + tribits_get_legacy_package_deps_sublist(${packageName} ${libOrTest} + ${requiredOrOptional} ${packagesOrTpls} legacyPackageDepsList) + + if (NOT legacyPackageDepsList) + list(APPEND localXml + " <${listType}/>\n" ) + else() + set(depsListStr "") + foreach(depPkg IN LISTS legacyPackageDepsList) + tribits_append_dep_to_xml_string(${depPkg} depsListStr) + endforeach() + list(APPEND localXml + " <${listType} value=\"${depsListStr}\"/>\n" ) endif() - #print_var(${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE) - if (${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE AND ${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE) - if (NOT IS_ABSOLUTE ${${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE}) - set(${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE - ${CMAKE_CURRENT_BINARY_DIR}/${${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE}) - endif() - message("" ) - message("Dumping the HTML dependencies webpage file ${${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE} ..." ) - execute_process( - COMMAND ${PYTHON_EXECUTABLE} - ${${PROJECT_NAME}_TRIBITS_DIR}/${TRIBITS_CI_SUPPORT_DIR}/dump-package-dep-table.py - --input-xml-deps-file=${${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE} - --output-html-deps-file=${${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE} ) + if (localXml) + set(${xmlVarInOut} "${localXml}" PARENT_SCOPE) endif() - #print_var(${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE) - if (${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE AND ${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE) - if (NOT IS_ABSOLUTE ${${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE}) - set(${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE}) +endfunction() + + +function(tribits_get_legacy_package_deps_sublist packageName libOrTest + requiredOrOptional packagesOrTpls legacyPackageDepsListOut + ) + + set(legacyPackageDepsList "") + + foreach(depPkg IN LISTS ${packageName}_${libOrTest}_DEFINED_DEPENDENCIES) + + set(matchesRequriedOrOptional FALSE) + if (((requiredOrOptional STREQUAL "REQUIRED") + AND ${packageName}_${libOrTest}_DEP_REQUIRED_${depPkg}) + OR + ((requiredOrOptional STREQUAL "OPTIONAL") + AND (NOT ${packageName}_${libOrTest}_DEP_REQUIRED_${depPkg})) + ) + set(matchesRequriedOrOptional TRUE) endif() - message("" ) - message("Dumping the CDash XML dependencies file ${${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE} ..." ) - execute_process( - COMMAND ${PYTHON_EXECUTABLE} - ${${PROJECT_NAME}_TRIBITS_DIR}/${TRIBITS_CTEST_DRIVER_DIR}/dump-cdash-deps-xml-file.py - --input-xml-deps-file=${${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE} - --output-cdash-deps-xml-file=${${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE} ) - endif() - if (${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE - OR ${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE - OR ${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE - ) - tribits_config_code_stop_timer(WRITE_DEPENDENCY_FILES_TIME_START_SECONDS - "\nTotal time to write dependency files") - endif() + set(matchesPackagesOrTpls FALSE) + if (((packagesOrTpls STREQUAL "PACKAGES") + AND (${depPkg}_PACKAGE_BUILD_STATUS STREQUAL "INTERNAL")) + OR + ((packagesOrTpls STREQUAL "TPLS") + AND (${depPkg}_PACKAGE_BUILD_STATUS STREQUAL "EXTERNAL")) + ) + set(matchesPackagesOrTpls TRUE) + endif() -endmacro() + if (matchesRequriedOrOptional AND matchesPackagesOrTpls) + list(APPEND legacyPackageDepsList ${depPkg}) + endif() + + endforeach() + + set(${legacyPackageDepsListOut} "${legacyPackageDepsList}" PARENT_SCOPE) + +endfunction() + + + +function(tribits_append_dep_to_xml_string depPkg depsListStrInOut) + set(depsListStr "${${depsListStrInOut}}") + if (depsListStr) + string(APPEND depsListStr ",") + endif() + string(APPEND depsListStr "${depPkg}") + set(${depsListStrInOut} "${depsListStr}" PARENT_SCOPE) +endfunction() diff --git a/cmake/tribits/common_tpls/FindTPLHDF5.cmake b/cmake/tribits/common_tpls/FindTPLHDF5.cmake index 57bb3c3eff01..d89e4cd98415 100644 --- a/cmake/tribits/common_tpls/FindTPLHDF5.cmake +++ b/cmake/tribits/common_tpls/FindTPLHDF5.cmake @@ -6,7 +6,7 @@ set(HDF5_INTERNAL_IS_MODERN FALSE) if (Netcdf_ALLOW_MODERN) - set(minimum_modern_HDF5_version 1.13.2) + set(minimum_modern_HDF5_version 1.10.9) print_var(Netcdf_ALLOW_MODERN) message("-- Using find_package(HDF5 ${minimum_modern_HDF5_version} CONFIG) ...") find_package(HDF5 ${minimum_modern_HDF5_version} CONFIG) diff --git a/cmake/tribits/common_tpls/FindTPLLAPACKDependencies.cmake b/cmake/tribits/common_tpls/FindTPLLAPACKDependencies.cmake new file mode 100644 index 000000000000..0256dbbfd4dd --- /dev/null +++ b/cmake/tribits/common_tpls/FindTPLLAPACKDependencies.cmake @@ -0,0 +1,2 @@ +tribits_extpkg_define_dependencies( LAPACK + DEPENDENCIES BLAS) diff --git a/cmake/tribits/common_tpls/FindTPLNetcdf.cmake b/cmake/tribits/common_tpls/FindTPLNetcdf.cmake index f81e3b9259d5..d025130f7d82 100644 --- a/cmake/tribits/common_tpls/FindTPLNetcdf.cmake +++ b/cmake/tribits/common_tpls/FindTPLNetcdf.cmake @@ -37,9 +37,7 @@ # ************************************************************************ # @HEADER -if (${CMAKE_VERSION} GREATER "3.13") - cmake_policy(SET CMP0074 NEW) -endif() +cmake_policy(SET CMP0074 NEW) set(Netcdf_ALLOW_MODERN FALSE CACHE BOOL "Allow finding Netcdf as a modern CMake config file with exported targets (and only this way)") diff --git a/cmake/tribits/core/installation/TribitsPackageConfigTemplate.cmake.in b/cmake/tribits/core/installation/TribitsPackageConfigTemplate.cmake.in index 465648d63ac3..499d5352e45f 100644 --- a/cmake/tribits/core/installation/TribitsPackageConfigTemplate.cmake.in +++ b/cmake/tribits/core/installation/TribitsPackageConfigTemplate.cmake.in @@ -101,23 +101,8 @@ set(${EXPORT_FILE_VAR_PREFIX}_AR ${CMAKE_AR}) ## Base install location (if not in the build tree) set(${EXPORT_FILE_VAR_PREFIX}_INSTALL_DIR "@CMAKE_INSTALL_PREFIX@") -## List of package include dirs -set(${EXPORT_FILE_VAR_PREFIX}_INCLUDE_DIRS "") - -## List of package library paths -set(${EXPORT_FILE_VAR_PREFIX}_LIBRARY_DIRS "") - ## List of package libraries -set(${EXPORT_FILE_VAR_PREFIX}_LIBRARIES "${FULL_LIBRARY_SET}") - -## Specification of directories for TPL headers -set(${EXPORT_FILE_VAR_PREFIX}_TPL_INCLUDE_DIRS "") - -## Specification of directories for TPL libraries -set(${EXPORT_FILE_VAR_PREFIX}_TPL_LIBRARY_DIRS "") - -## List of required TPLs -set(${EXPORT_FILE_VAR_PREFIX}_TPL_LIBRARIES "${${PACKAGE_NAME}_TPL_LIBRARIES}") +set(${EXPORT_FILE_VAR_PREFIX}_LIBRARIES ${PACKAGE_NAME}::all_libs) ## --------------------------------------------------------------------------- ## MPI specific variables @@ -136,12 +121,6 @@ set(${EXPORT_FILE_VAR_PREFIX}_MPI_EXEC_NUMPROCS_FLAG "${MPI_EXEC_NUMPROCS_FLAG}" ## Set useful general variables ## --------------------------------------------------------------------------- -## The packages enabled for this project -set(${EXPORT_FILE_VAR_PREFIX}_PACKAGE_LIST "${FULL_PACKAGE_SET}") - -## The TPLs enabled for this project -set(${EXPORT_FILE_VAR_PREFIX}_TPL_LIST "${ORDERED_FULL_TPL_SET}") - ${PACKAGE_CONFIG_CODE} ## ---------------------------------------------------------------------------- diff --git a/cmake/tribits/core/installation/TribitsProjectConfigTemplate.cmake.in b/cmake/tribits/core/installation/TribitsProjectConfigTemplate.cmake.in index 67eb685ed483..09c413821945 100644 --- a/cmake/tribits/core/installation/TribitsProjectConfigTemplate.cmake.in +++ b/cmake/tribits/core/installation/TribitsProjectConfigTemplate.cmake.in @@ -123,7 +123,6 @@ foreach (comp IN ITEMS ${PDOLLAR}{COMPONENTS_LIST}) include(${PDOLLAR}{compPkgConfigFile}) # Add variables to lists. list(APPEND ${PROJECT_NAME}_LIBRARIES ${PDOLLAR}{${PDOLLAR}{comp}_LIBRARIES}) - list(APPEND ${PROJECT_NAME}_TPL_LIBRARIES ${PDOLLAR}{${PDOLLAR}{comp}_TPL_LIBRARIES}) list(APPEND selectedComponentsFound ${PDOLLAR}{comp}) else() set(${PROJECT_NAME}_${PDOLLAR}{comp}_FOUND FALSE) @@ -138,18 +137,8 @@ endforeach() # Deprecated (see #299)! set(${PROJECT_NAME}_INCLUDE_DIRS "${TRIBITS_PROJECT_INSTALL_INCLUDE_DIR}") -# Deprecated (see #299)! -set(${PROJECT_NAME}_LIBRARY_DIRS "") - # Remove duplicates in ${PROJECT_NAME}_LIBRARIES -list(REVERSE ${PROJECT_NAME}_LIBRARIES) list(REMOVE_DUPLICATES ${PROJECT_NAME}_LIBRARIES) -list(REVERSE ${PROJECT_NAME}_LIBRARIES) - -# Remove duplicates in ${PROJECT_NAME}_TPL_LIBRARIES -list(REVERSE ${PROJECT_NAME}_TPL_LIBRARIES) -list(REMOVE_DUPLICATES ${PROJECT_NAME}_TPL_LIBRARIES) -list(REVERSE ${PROJECT_NAME}_TPL_LIBRARIES) ## --------------------------------------------------------------------------- ## MPI specific variables @@ -186,9 +175,6 @@ set(${PROJECT_NAME}_PACKAGE_LIST "${FULL_PACKAGE_SET}") ## The selected packages for this project set(${PROJECT_NAME}_SELECTED_PACKAGE_LIST "${PDOLLAR}{selectedComponentsFound}") -## The TPLs enabled for this project -set(${PROJECT_NAME}_TPL_LIST "${FULL_TPL_SET}") - ## --------------------------------------------------------------------------- ## Modern CMake (IMPORTED) targets ## --------------------------------------------------------------------------- diff --git a/cmake/tribits/core/package_arch/TribitsAddAdvancedTest.cmake b/cmake/tribits/core/package_arch/TribitsAddAdvancedTest.cmake index b7627d603882..0faae73d3a13 100644 --- a/cmake/tribits/core/package_arch/TribitsAddAdvancedTest.cmake +++ b/cmake/tribits/core/package_arch/TribitsAddAdvancedTest.cmake @@ -157,13 +157,10 @@ include(PrintVar) # for the overall test to pass. # # Finally, the test is only added if tests are enabled for the package -# (i.e. `${PACKAGE_NAME}_ENABLE_TESTS`_ ``= ON``) or the parent package (if -# this is a subpackage) (i.e. ``${PARENT_PACKAGE_NAME}_ENABLE_TESTS=ON``) or -# if other criteria are met (see some of the arguments in `Overall Arguments -# (tribits_add_advanced_test())`_ that can trigger a test to not be added). -# (NOTE: A more efficient way to optionally enable tests is to put them in a -# ``test/`` subdir and then include that subdir with -# `tribits_add_test_directories()`_.) +# (i.e. `${PACKAGE_NAME}_ENABLE_TESTS`_ ``= ON``) and if other criteria are +# met (see `Overall Arguments (tribits_add_advanced_test())`_). (NOTE: A more +# efficient way to optionally enable tests is to put them in a ``test/`` +# subdir and then include that subdir with `tribits_add_test_directories()`_.) # # *Sections:* # diff --git a/cmake/tribits/core/package_arch/TribitsAddExecutable.cmake b/cmake/tribits/core/package_arch/TribitsAddExecutable.cmake index f08e7b78bca0..ec989628f82f 100644 --- a/cmake/tribits/core/package_arch/TribitsAddExecutable.cmake +++ b/cmake/tribits/core/package_arch/TribitsAddExecutable.cmake @@ -44,6 +44,7 @@ include(TribitsAddTestHelpers) include(TribitsGeneralMacros) include(TribitsLibIsTestOnly) include(TribitsReportInvalidTribitsUsage) +include(TribitsDeprecatedHelpers) include(PrintVar) include(AppendSet) @@ -374,7 +375,7 @@ function(tribits_add_executable EXE_NAME) endif() if (PARSE_DEFINES) - message(WARNING "WARNING: Passing extra defines through 'DEFINES' ${PARSE_DEFINES}" + tribits_deprecated("Passing extra defines through 'DEFINES' ${PARSE_DEFINES}" " is deprecated. Instead, pass them through 'TARGET_DEFINES'. The 'DEFINES'" " argument was incorrectly implemented by calling add_definitions() which has" " directory scope and not function scope as was documented. This resulted in" @@ -657,12 +658,12 @@ macro(tribits_add_executable_convert_from_deplibs) set(prefixedDepLib "${${PROJECT_NAME}_LIBRARY_NAME_PREFIX}${depLib}") tribits_lib_is_testonly(${prefixedDepLib} depLibIsTestOnlyLib) if (depLibIsTestOnlyLib) - message(WARNING "WARNING: Passing TESTONLY lib '${depLib}' through DEPLIBS" + tribits_deprecated("Passing TESTONLY lib '${depLib}' through DEPLIBS" " is deprecated! Instead, please pass through TESTONLYLIBS instead!" " DEPLIBS is deprecated!") list(APPEND PARSE_TESTONLYLIBS ${depLib}) elseif (TARGET ${prefixedDepLib}) - message(WARNING "WARNING: Passing non-TESTONLY lib '${depLib}' through DEPLIBS" + tribits_deprecated("Passing non-TESTONLY lib '${depLib}' through DEPLIBS" " is deprecated! The library '${depLib}' appears to be a" " library defined in this CMake project." " TriBITS takes care of linking against libraries in dependent upstream" diff --git a/cmake/tribits/core/package_arch/TribitsAddExecutableAndTest.cmake b/cmake/tribits/core/package_arch/TribitsAddExecutableAndTest.cmake index 298f64ac75c7..73148b8a8a76 100644 --- a/cmake/tribits/core/package_arch/TribitsAddExecutableAndTest.cmake +++ b/cmake/tribits/core/package_arch/TribitsAddExecutableAndTest.cmake @@ -40,6 +40,7 @@ include(TribitsAddExecutable) include(TribitsAddTest) +include(TribitsDeprecatedHelpers) # @@ -105,6 +106,7 @@ endmacro() # [COMM [serial] [mpi]] # [ARGS " ..." " ..." ...] # [NUM_MPI_PROCS ] +# [RUN_SERIAL] # [LINKER_LANGUAGE (C|CXX|Fortran)] # [STANDARD_PASS_OUTPUT # | PASS_REGULAR_EXPRESSION ";;..."] @@ -146,6 +148,16 @@ endmacro() # through ``ARGS``. For more flexibility, just use # ``tribits_add_executable()`` followed by ``tribits_add_test()``. # +# Finally, the tests are only added if tests are enabled for the package +# (i.e. `${PACKAGE_NAME}_ENABLE_TESTS`_ ``= ON``) and other criteria are met. +# But the test executable will always be added if this function is called, +# regardless of the value of ``${PACKAGE_NAME}_ENABLE_TESTS``. To avoid +# adding the test (or example) executable when +# ``${PACKAGE_NAME}_ENABLE_TESTS=OFF``, put this command in a subdir under +# ``test/`` or ``example/`` and that subdir with +# `tribits_add_test_directories()`_ or `tribits_add_example_directories()`_, +# respectively. +# function(tribits_add_executable_and_test EXE_NAME) # @@ -156,7 +168,7 @@ function(tribits_add_executable_and_test EXE_NAME) #prefix PARSE #options - "STANDARD_PASS_OUTPUT;WILL_FAIL;ADD_DIR_TO_NAME;INSTALLABLE;NOEXEPREFIX;NOEXESUFFIX" + "RUN_SERIAL;STANDARD_PASS_OUTPUT;WILL_FAIL;ADD_DIR_TO_NAME;INSTALLABLE;NOEXEPREFIX;NOEXESUFFIX" #one_value_keywords "DISABLED" #mulit_value_keywords @@ -197,6 +209,10 @@ function(tribits_add_executable_and_test EXE_NAME) # C) tribits_add_executable(...) # + if (PARSE_DEPLIBS) + tribits_deprecated("DEPLIBS argument of tribits_add_executable_and_test() is deprecated.") + endif() + set(CALL_ARGS "") tribits_fwd_parse_arg(CALL_ARGS SOURCES) tribits_fwd_parse_arg(CALL_ARGS DEPLIBS) # Deprecated @@ -234,6 +250,7 @@ function(tribits_add_executable_and_test EXE_NAME) tribits_fwd_parse_arg(CALL_ARGS FAIL_REGULAR_EXPRESSION) tribits_fwd_parse_arg(CALL_ARGS ENVIRONMENT) tribits_fwd_parse_arg(CALL_ARGS DISABLED) + tribits_fwd_parse_opt(CALL_ARGS RUN_SERIAL) tribits_fwd_parse_opt(CALL_ARGS STANDARD_PASS_OUTPUT) tribits_fwd_parse_opt(CALL_ARGS WILL_FAIL) tribits_fwd_parse_arg(CALL_ARGS TIMEOUT) @@ -257,3 +274,5 @@ function(tribits_add_executable_and_test EXE_NAME) endif() endfunction() + +# LocalWords: executables diff --git a/cmake/tribits/core/package_arch/TribitsAddLibrary.cmake b/cmake/tribits/core/package_arch/TribitsAddLibrary.cmake index 4bac9f943c0b..30036149dbdc 100644 --- a/cmake/tribits/core/package_arch/TribitsAddLibrary.cmake +++ b/cmake/tribits/core/package_arch/TribitsAddLibrary.cmake @@ -48,7 +48,8 @@ include(PrependGlobalSet) include(RemoveGlobalDuplicates) include(TribitsGeneralMacros) include(TribitsReportInvalidTribitsUsage) -include(SetAndIncDirs) +include(TribitsDeprecatedHelpers) +include(TribitsSetAndIncDirs) # @FUNCTION: tribits_add_library() @@ -670,7 +671,7 @@ function(tribits_add_library_assert_deplibs) # dependency on the upstream package that owns this upstream TESTONLY # library if it comes from an upstream package. elseif (NOT PARSE_TESTONLY AND depLibIsTestOnlyLib) # any depLibAlreadyInPkgLibs - message(WARNING "WARNING: '${depLib}' in DEPLIBS is a TESTONLY lib" + tribits_deprecated("'${depLib}' in DEPLIBS is a TESTONLY lib" " and it is illegal to link to this non-TESTONLY library '${LIBRARY_NAME}'." " Such usage is deprecated (and this warning will soon become an error)!" " If this is a regular library in this package or in an dependent upstream" @@ -680,7 +681,7 @@ function(tribits_add_library_assert_deplibs) " ${${PACKAGE_NAME}_SOURCE_DIR}/cmake/Dependencies.cmake") # ToDo: Turn the above to FATAL_ERROR after dropping deprecated code elseif (NOT depLibAlreadyInPkgLibs AND TARGET ${prefixedDepLib}) # any PARSE_TESTONLY - message(WARNING "WARNING: '${depLib}' in DEPLIBS is not" + tribits_deprecated("'${depLib}' in DEPLIBS is not" " a lib in this package but is a library defined in the current" " cmake project! Such usage is deprecated (and" " will result in a configure error soon). If this is a library in" @@ -691,7 +692,7 @@ function(tribits_add_library_assert_deplibs) " this package's dependencies file" " ${${PACKAGE_NAME}_SOURCE_DIR}/cmake/Dependencies.cmake.") elseif (NOT depLibAlreadyInPkgLibs AND NOT TARGET ${prefixedDepLib} ) - message(WARNING "WARNING: '${depLib}' in DEPLIBS is not" + tribits_deprecated("'${depLib}' in DEPLIBS is not" " a lib defined in the current cmake project! Such usage is deprecated (and" " will result in a configure error soon). If this is an external" " lib you are trying to link in, it should likely be handled as a TriBITS" @@ -725,7 +726,7 @@ function(tribits_add_library_assert_importedlibs) FOUND_IMPORTEDLIB_IN_LIBRARIES_IDX) tribits_lib_is_testonly(${prefixedImportedLib} importedLibIsTestOnlyLib) if (importedLibIsTestOnlyLib) - message(WARNING "WARNING: '${importedLib}' in IMPORTEDLIBS is a TESTONLY lib" + tribits_deprecated("'${importedLib}' in IMPORTEDLIBS is a TESTONLY lib" " and it is illegal to pass in through IMPORTEDLIBS!" " Such usage is deprecated (and this warning will soon become an error)!" " Should '${importedLib}' instead be passed through DEPLIBS?") diff --git a/cmake/tribits/core/package_arch/TribitsAddTest.cmake b/cmake/tribits/core/package_arch/TribitsAddTest.cmake index d9dfa911133a..842bf3b2b94c 100644 --- a/cmake/tribits/core/package_arch/TribitsAddTest.cmake +++ b/cmake/tribits/core/package_arch/TribitsAddTest.cmake @@ -78,10 +78,11 @@ include(TribitsAddTestHelpers) # ) # # The tests are only added if tests are enabled for the package -# (i.e. `${PACKAGE_NAME}_ENABLE_TESTS`_) or the parent package (if this is a -# subpackage) (i.e. ``${PARENT_PACKAGE_NAME}_ENABLE_TESTS``). (NOTE: A more -# efficient way to optionally enable tests is to put them in a ``test/`` -# subdir and then include that subdir with `tribits_add_test_directories()`_.) +# (i.e. `${PACKAGE_NAME}_ENABLE_TESTS`_ ``= ON``). (NOTE: A more efficient +# way to optionally enable tests or examples is to put them in a ``test/`` or +# ``example/`` subdir and then include that subdir with +# `tribits_add_test_directories()`_ or `tribits_add_example_directories()`_, +# respectively.) # # *Sections:* # diff --git a/cmake/tribits/core/package_arch/TribitsAddTestHelpers.cmake b/cmake/tribits/core/package_arch/TribitsAddTestHelpers.cmake index 453de5432672..ba8a6412b67b 100644 --- a/cmake/tribits/core/package_arch/TribitsAddTestHelpers.cmake +++ b/cmake/tribits/core/package_arch/TribitsAddTestHelpers.cmake @@ -211,8 +211,8 @@ function(tribits_add_test_process_enable_tests ADD_THE_TEST_OUT) set(ADD_THE_TEST TRUE) else() message_wrapper( - "-- ${TEST_NAME}: NOT added test because ${PACKAGE_NAME}_ENABLE_TESTS='${${PACKAGE_NAME}_ENABLE_TESTS}'." - ) + "-- ${TEST_NAME}: NOT added test because" + " ${PACKAGE_NAME}_ENABLE_TESTS='${${PACKAGE_NAME}_ENABLE_TESTS}'.") set(ADD_THE_TEST FALSE) endif() set(${ADD_THE_TEST_OUT} ${ADD_THE_TEST} PARENT_SCOPE) diff --git a/cmake/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake b/cmake/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake index 55c83d96af77..53bbb1f2b5d5 100644 --- a/cmake/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake +++ b/cmake/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake @@ -42,7 +42,9 @@ include(TribitsProcessPackagesAndDirsLists) include(TribitsAddOptionAndDefine) include(TribitsGeneralMacros) include(TribitsPrintEnabledPackagesLists) +include(TribitsPrintDependencyInfo) include(TribitsPackageDependencies) +include(TribitsGetPackageEnableStatus) include(AdvancedOption) include(AdvancedSet) @@ -59,258 +61,385 @@ include(SetDefault) include(MessageWrapper) include(DualScopeSet) include(CMakeParseArguments) +include(TribitsCreateReverseList) +# NOTE: A nice way to view and navigate the contents of this file is to use +# the emacs 'occur' string: # -# Private helper macros +# "\(^##########\|^# .*-level\|^function\|^macro\)" + + +# @MACRO: tribits_adjust_package_enables() +# +# Usage: +# +# tribits_adjust_package_enables() +# +# Macro that adjusts all of the package enables from what the user input to +# the final set that will be used to enable packages. # +macro(tribits_adjust_package_enables) + tribits_unenable_enabled_packages() + tribits_sweep_forward_apply_disables() + tribits_sweep_forward_apply_enables() + tribits_disable_and_enable_tests_and_examples() + tribits_sweep_backward_enable_upstream_packages() + tribits_set_cache_vars_for_current_enabled_packages() + tribits_do_final_parent_packages_enables_for_subpackage_enables() + tribits_setup_enabled_lists_and_pkg_idxs() + tribits_setup_direct_packages_dependencies_lists_and_lib_required_enable_vars() + tribits_print_direct_packages_dependencies_lists() +endmacro() -function(tribits_private_print_disable - ENABLE_BEING_DISABLED_VAR_NAME PACKAGE_WITH_SOMETHING_BEING_DISABLED - DEP_TYPE_STR THING_DISALBED_TYPE THING_DISABLED_NAME - ) - #print_var(${ENABLE_BEING_DISABLED_VAR_NAME}) - if (${ENABLE_BEING_DISABLED_VAR_NAME}) - if (${PROJECT_NAME}_DISABLE_ENABLED_FORWARD_DEP_PACKAGES) - message( - " ***\n" - " *** NOTE: Setting ${ENABLE_BEING_DISABLED_VAR_NAME}=OFF" - " which was '${${ENABLE_BEING_DISABLED_VAR_NAME}}' because" - " ${PACKAGE_WITH_SOMETHING_BEING_DISABLED} has" - " a required ${DEP_TYPE_STR} dependence on disabled" - " ${THING_DISALBED_TYPE} ${THING_DISABLED_NAME}" - " but ${PROJECT_NAME}_DISABLE_ENABLED_FORWARD_DEP_PACKAGES=ON!\n" - " ***\n" - ) - else() - message(FATAL_ERROR - " ***\n" - " *** ERROR: Setting ${ENABLE_BEING_DISABLED_VAR_NAME}=OFF" - " which was '${${ENABLE_BEING_DISABLED_VAR_NAME}}' because" - " ${PACKAGE_WITH_SOMETHING_BEING_DISABLED} has" - " a required ${DEP_TYPE_STR} dependence on disabled" - " ${THING_DISALBED_TYPE} ${THING_DISABLED_NAME}!\n" - " ***\n" - ) - endif() - else() - message("-- " - "Setting ${ENABLE_BEING_DISABLED_VAR_NAME}=OFF" - " because ${PACKAGE_WITH_SOMETHING_BEING_DISABLED} has a required ${DEP_TYPE_STR}" - " dependence on disabled ${THING_DISALBED_TYPE} ${THING_DISABLED_NAME}") - endif() -endfunction() + +################################################################################ +# +# First-level macros called directly from ``tribits_adjust_package_enables()`` +# +# NOTE: In the below macros, local variables are prefixed by 'tap1_' in all of +# the macros() which will not clash because they are at the same level in the +# call stack (and are initialized in each macro). +# +################################################################################ -macro(tribits_private_disable_tpl_required_package_enable - TPL_NAME PACKAGE_NAME LIBRARY_DEP - ) +# @MACRO: tribits_unenable_enabled_packages() +# +# Macro to enable all unenabled packages if asked. +# +# See implementation for details. +# +macro(tribits_unenable_enabled_packages) + if (${PROJECT_NAME}_UNENABLE_ENABLED_PACKAGES) + message("\nSetting to empty '' all enabled packages because" + " ${PROJECT_NAME}_UNENABLE_ENABLED_PACKAGES=" + "'${${PROJECT_NAME}_UNENABLE_ENABLED_PACKAGES}'\n") + foreach(tap1_tribitsPkg IN LISTS ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES) + if (${PROJECT_NAME}_ENABLE_${tap1_tribitsPkg}) + message("-- " "Setting ${PROJECT_NAME}_ENABLE_${tap1_tribitsPkg}=''") + set_cache_on_off_empty(${PROJECT_NAME}_ENABLE_${tap1_tribitsPkg} "" + "Forced to empty '' by ${PROJECT_NAME}_UNENABLE_ENABLED_PACKAGES=ON" FORCE) + endif() + # NOTE: Above, we don't want to set to empty those packages that have hard + # disables because this will mess up the logic in later invocations. + endforeach() + advanced_set(${PROJECT_NAME}_UNENABLE_ENABLED_PACKAGES OFF CACHE BOOL + "Forced to FALSE after use" FORCE) + endif() +endmacro() - #message("TRIBITS_PRIVATE_DISABLE_TPL_REQUIRED_PACKAGE_ENABLE" - # " ${TPL_NAME} ${PACKAGE_NAME} ${LIBRARY_DEP}") - # Only turn off PACKAGE_NAME libraries and test/examples if it - # is currently enabled or could be enabled. +# @MACRO: tribits_sweep_forward_apply_disables() +# +# Sweep forward and apply all disables in order first. +# +# See implementation for details. +# +macro(tribits_sweep_forward_apply_disables) - assert_defined(${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - if (${PROJECT_NAME}_ENABLE_${PACKAGE_NAME} - OR ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME} STREQUAL "" - ) + message("\nDisabling all packages that have a required dependency" + " on disabled TPLs and optional package TPL support based on TPL_ENABLE_=OFF ...\n") - if ("${LIBRARY_DEP}" STREQUAL "TRUE") + message("\nDisabling subpackages for hard disables of parent packages" + " due to ${PROJECT_NAME}_ENABLE_=OFF ...\n") + foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES) + tribits_disable_parents_subpackages(${tad1_tribitsPkg}) + endforeach() - tribits_private_print_disable( - ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME} ${PACKAGE_NAME} "library" - "TPL" ${TPL_NAME} - ) + message("\nDisabling forward required packages and optional intra-package" + " support that have a dependency on disabled packages" + " ${PROJECT_NAME}_ENABLE_=OFF (or" + " TPL_ENABLE_=OFF) ...\n") + foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_DEFINED_PACKAGES) + tribits_disable_forward_required_dep_packages(${tad1_tribitsPkg}) + endforeach() - set(${PROJECT_NAME}_ENABLE_${PACKAGE_NAME} OFF) +endmacro() - else() - set(DEP_TYPE_STR "test/example") +# @MACRO: tribits_sweep_forward_apply_enables() +# +# Updates the following variables in the local scope: +# +# * ``${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES`` +# * `${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES`_ +# +# See implementation for details. +# +macro(tribits_sweep_forward_apply_enables) - if (${PACKAGE_NAME}_ENABLE_TESTS - OR "${${PACKAGE_NAME}_ENABLE_TESTS}" STREQUAL "" - ) - tribits_private_print_disable( - ${PACKAGE_NAME}_ENABLE_TESTS ${PACKAGE_NAME} "${DEP_TYPE_STR}" - "TPL" ${TPL_NAME} - ) - set(${PACKAGE_NAME}_ENABLE_TESTS OFF) - endif() + tribits_get_sublist_nondisabled( ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES + ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES "") + tribits_create_reverse_list(${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES + ${PROJECT_NAME}_REVERSE_NOTDISABLED_INTERNAL_PACKAGES) - if (${PACKAGE_NAME}_ENABLE_EXAMPLES - OR "${${PACKAGE_NAME}_ENABLE_EXAMPLES}" STREQUAL "" - ) - tribits_private_print_disable( - ${PACKAGE_NAME}_ENABLE_EXAMPLES ${PACKAGE_NAME} "${DEP_TYPE_STR}" - "TPL" ${TPL_NAME} - ) - set(${PACKAGE_NAME}_ENABLE_EXAMPLES OFF) - endif() + message("\nEnabling subpackages for hard enables of parent packages" + " due to ${PROJECT_NAME}_ENABLE_=ON ...\n") + foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES) + tribits_enable_parents_subpackages(${tad1_tribitsPkg}) + endforeach() - # NOTE: We can't assert that ${PACKAGE_NAME}_ENABLE_TESTS or - # ${PACKAGE_NAME}_ENABLE_EXAMPLES exists yet because - # tribits_set_up_optional_package_enables_and_cache_vars() which defines - # them is not called until after the final package enables are set. + if (${PROJECT_NAME}_ENABLE_ALL_PACKAGES) + message("\nEnabling all packages that are not currently disabled because of" + " ${PROJECT_NAME}_ENABLE_ALL_PACKAGES=ON" + " (${PROJECT_NAME}_ENABLE_SECONDARY_TESTED_CODE=" + "${${PROJECT_NAME}_ENABLE_SECONDARY_TESTED_CODE}) ...\n") + foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES) + tribits_apply_all_package_enables(${tad1_tribitsPkg}) + endforeach() + endif() - endif() + if (${PROJECT_NAME}_ENABLE_ALL_FORWARD_DEP_PACKAGES) + message("\nSweep forward enabling all forward library dependent packages because" + " ${PROJECT_NAME}_ENABLE_ALL_FORWARD_DEP_PACKAGES=ON ...\n") + foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES) + tribits_enable_forward_lib_package_enables(${tad1_tribitsPkg}) + endforeach() + tribits_get_sublist_enabled( ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES + ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES "") + tribits_create_reverse_list(${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES + ${PROJECT_NAME}_REVERSE_ENABLED_INTERNAL_PACKAGES) + + message("\nSweep backward enabling all forward test dependent packages because" + " ${PROJECT_NAME}_ENABLE_ALL_FORWARD_DEP_PACKAGES=ON ...\n") + foreach(tad1_tribitsPkg IN LISTS + ${PROJECT_NAME}_REVERSE_ENABLED_INTERNAL_PACKAGES + ) + tribits_enable_forward_test_package_enables(${tad1_tribitsPkg}) + endforeach() + # NOTE: Above, we want to sweep backward to enable test-dependent packages + # because we don't want to enable package Z just because package Y was enabled + # because it had a test-only dependency on package X. Sweeping backwards through + # the packages makes sure this does not happen. + set(${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES ON) endif() + tribits_get_sublist_enabled( ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES + ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES "") + endmacro() +# NOTE: Above, we are sweeping over *all* of the not-disabled packages listed +# in ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES, including those package that +# might have _PACKAGE_BUILD_STATUS=EXTERNAL. That makes sense +# because these are TriBITS (or TriBITS compatible) packages so we should +# assume that all of their downstream packages, whether internal or external, +# should be enabled as well. If we find this is not the desirable behavior, +# then we can change this later. -function(tribits_private_print_disable_required_package_enable - PACKAGE_NAME PACKAGE_ENABLE_SOMETHING_VAR_NAME FORWARD_DEP_PACKAGE_NAME - DEP_TYPE_STR - ) - tribits_private_print_disable( - ${PACKAGE_ENABLE_SOMETHING_VAR_NAME} ${FORWARD_DEP_PACKAGE_NAME} - "${DEP_TYPE_STR}" "package" ${PACKAGE_NAME} ) -endfunction() +# @MACRO: tribits_disable_and_enable_tests_and_examples() +# +# Adjust test and example enables based on different criteria. +# +# See implementation for details. +# +macro(tribits_disable_and_enable_tests_and_examples) + message("\nDisabling subpackage tests/examples based on parent package" + " tests/examples disables ...\n") + foreach(tad1_tribitsPkg IN LISTS + ${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES + ) + tribits_apply_package_examples_disable(${tad1_tribitsPkg} TESTS) + tribits_apply_subpackage_tests_or_examples_disables(${tad1_tribitsPkg} TESTS) + tribits_apply_subpackage_tests_or_examples_disables(${tad1_tribitsPkg} EXAMPLES) + endforeach() -macro(tribits_private_disable_required_package_enables - FORWARD_DEP_PACKAGE_NAME PACKAGE_NAME LIBRARY_DEP - ) + if (${PROJECT_NAME}_ENABLE_TESTS OR ${PROJECT_NAME}_ENABLE_EXAMPLES) + message("\nEnabling all tests and/or examples that have not been" + " explicitly disabled because ${PROJECT_NAME}_ENABLE_[TESTS,EXAMPLES]=ON ...\n") + foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES) + tribits_apply_test_example_enables(${tad1_tribitsPkg}) + endforeach() + endif() + # NOTE: Above, we enable tests and examples here, before the remaining required + # packages so that we don't enable tests that don't need to be enabled based + # on the use of the option ${PROJECT_NAME}_ENABLE_ALL_FORWARD_DEP_PACKAGES. - #message("TRIBITS_PRIVATE_DISABLE_REQUIRED_PACKAGE_ENABLES" - # " ${FORWARD_DEP_PACKAGE_NAME} ${LIBRARY_DEP}") + message("\nEnabling subpackage tests/examples based on parent package tests/examples enables ...\n") + foreach(tad1_tribitsPkg IN LISTS + ${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES + ) + tribits_apply_subpackage_tests_examples_enables(${tad1_tribitsPkg}) + endforeach() + # NOTE: We want to apply this logic here instead of later after the backward + # sweep of package enables because we don't want to enable the + # tests/examples for a subpackage if it is not needed based on set of + # requested subpackages and packages to be enabled and the optional forward + # sweep of downstream packages. - # Only turn off FORWARD_DEP_PACKAGE libraries and test/examples if it - # is currently enabled or could be enabled +endmacro() - assert_defined(${PROJECT_NAME}_ENABLE_${FORWARD_DEP_PACKAGE_NAME}) - if (${PROJECT_NAME}_ENABLE_${FORWARD_DEP_PACKAGE_NAME} - OR ${PROJECT_NAME}_ENABLE_${FORWARD_DEP_PACKAGE_NAME} STREQUAL "" - ) - if ("${LIBRARY_DEP}" STREQUAL "TRUE") +# @MACRO: tribits_sweep_backward_enable_upstream_packages() +# +# Sweep backwards and enable required and (optionally) optional upstream +# packages. +# +# This sets the final value for: +# +# * `${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES`_ +# +# See implementation for details. +# +macro(tribits_sweep_backward_enable_upstream_packages) - tribits_private_print_disable_required_package_enable( - ${PACKAGE_NAME} ${PROJECT_NAME}_ENABLE_${FORWARD_DEP_PACKAGE_NAME} - ${FORWARD_DEP_PACKAGE_NAME} "library" ) + set(tap1_extraMsgStr "") + if (${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES) + set(tap1_extraMsgStr + " (and optional since ${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES=ON)") + endif() - set(${PROJECT_NAME}_ENABLE_${FORWARD_DEP_PACKAGE_NAME} OFF) + tribits_get_sublist_nondisabled( ${PROJECT_NAME}_DEFINED_PACKAGES + ${PROJECT_NAME}_NOTDISABLED_PACKAGES "") + tribits_create_reverse_list(${PROJECT_NAME}_NOTDISABLED_PACKAGES + ${PROJECT_NAME}_REVERSE_NOTDISABLED_PACKAGES) + + message("\nEnabling all required${tap1_extraMsgStr} upstream packages for current" + " set of enabled packages (${PROJECT_NAME}_ENABLE_SECONDARY_TESTED_CODE=" + "${${PROJECT_NAME}_ENABLE_SECONDARY_TESTED_CODE}) ...\n") + foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_REVERSE_NOTDISABLED_PACKAGES) + tribits_enable_upstream_packages(${tad1_tribitsPkg}) + endforeach() + # NOTE: Above, we have to loop through the packages backward to enable all + # the packages that this package depends on. This has to include *all* + # upstream package enables including required packages, and optional + # packages (when ${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES). - else() + tribits_get_sublist_enabled( ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES + ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES "") - set(DEP_TYPE_STR "test/example") + message("\nEnabling all optional intra-package enables" + " _ENABLE_ that are not currently disabled" + " if both sets of packages are enabled ...\n") + foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES) + tribits_postprocess_optional_package_enables(${tad1_tribitsPkg}) + endforeach() - if (${FORWARD_DEP_PACKAGE_NAME}_ENABLE_TESTS - OR "${${FORWARD_DEP_PACKAGE_NAME}_ENABLE_TESTS}" STREQUAL "" - ) - tribits_private_print_disable_required_package_enable( - ${PACKAGE_NAME} ${FORWARD_DEP_PACKAGE_NAME}_ENABLE_TESTS - ${FORWARD_DEP_PACKAGE_NAME} "${DEP_TYPE_STR}" ) - set(${FORWARD_DEP_PACKAGE_NAME}_ENABLE_TESTS OFF) - endif() +endmacro() - if (${FORWARD_DEP_PACKAGE_NAME}_ENABLE_EXAMPLES - OR "${${FORWARD_DEP_PACKAGE_NAME}_ENABLE_EXAMPLES}" STREQUAL "" - ) - tribits_private_print_disable_required_package_enable( - ${PACKAGE_NAME} ${FORWARD_DEP_PACKAGE_NAME}_ENABLE_EXAMPLES - ${FORWARD_DEP_PACKAGE_NAME} "${DEP_TYPE_STR}" ) - set(${FORWARD_DEP_PACKAGE_NAME}_ENABLE_EXAMPLES OFF) - endif() - endif() +# @MACRO: tribits_set_cache_vars_for_current_enabled_packages() +# +macro(tribits_set_cache_vars_for_current_enabled_packages) + message("\nSet cache entries for optional packages/TPLs and tests/examples for packages actually enabled ...\n") + foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES) + tribits_setup_optional_package_enables_and_cache_vars(${tad1_tribitsPkg}) + endforeach() +endmacro() - endif() -endmacro() +# @MACRO: tribits_do_final_parent_packages_enables_for_subpackage_enables() +# +macro(tribits_do_final_parent_packages_enables_for_subpackage_enables) + message("\nEnabling the shell of non-enabled parent packages (mostly for show)" + " that have at least one subpackage enabled ...\n") + foreach(tad1_tribitsPkg IN LISTS + ${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES + ) + tribits_enable_parent_package_for_subpackage_enables(${tad1_tribitsPkg}) + endforeach() + # NOTE: The above ensures that loops involving the parent package will + # process the parent package. But this has to be done after all of the + # other enable/disable logic to ensure no downstream dependencies will be + # enabled based on this. -macro(tribits_private_disable_optional_package_enables - FORWARD_DEP_PACKAGE_NAME PACKAGE_NAME - ) +endmacro() - #message("TRIBITS_PRIVATE_DISABLE_OPTIONAL_PACKAGE_ENABLES" - # " ${FORWARD_DEP_PACKAGE_NAME} ${PACKAGE_NAME}") - #message("-- " "${FORWARD_DEP_PACKAGE_NAME}_ENABLE_${PACKAGE_NAME} = ${${FORWARD_DEP_PACKAGE_NAME}_ENABLE_${PACKAGE_NAME}}") - #assert_defined(${FORWARD_DEP_PACKAGE_NAME}_ENABLE_${PACKAGE_NAME}) - if (${FORWARD_DEP_PACKAGE_NAME}_ENABLE_${PACKAGE_NAME} OR "${${FORWARD_DEP_PACKAGE_NAME}_ENABLE_${PACKAGE_NAME}}" STREQUAL "") - # Always disable the conditional enable but only print the message if the package is enabled. - #message("-- Disable ${PROJECT_NAME}_ENABLE_${FORWARD_DEP_PACKAGE_NAME} ...") - if (${PROJECT_NAME}_ENABLE_${FORWARD_DEP_PACKAGE_NAME}) - if (${FORWARD_DEP_PACKAGE_NAME}_ENABLE_${PACKAGE_NAME}) # is explicitly try already! - message("-- " - "NOTE: Setting ${FORWARD_DEP_PACKAGE_NAME}_ENABLE_${PACKAGE_NAME}=OFF" - " which was ${${FORWARD_DEP_PACKAGE_NAME}_ENABLE_${PACKAGE_NAME}}" - " because ${FORWARD_DEP_PACKAGE_NAME} has an optional library dependence" - " on disabled package ${PACKAGE_NAME}") - else() # Not explicitly set - message("-- " - "Setting ${FORWARD_DEP_PACKAGE_NAME}_ENABLE_${PACKAGE_NAME}=OFF" - " because ${FORWARD_DEP_PACKAGE_NAME} has an optional library dependence" - " on disabled package ${PACKAGE_NAME}") - endif() - endif() - set(${FORWARD_DEP_PACKAGE_NAME}_ENABLE_${PACKAGE_NAME} OFF) - endif() +# Macro that sets up the basic lists of enabled packages and packages. +# +macro(tribits_setup_enabled_lists_and_pkg_idxs) + + # ${PROJECT_NAME}_ENABLED_PACKAGES + tribits_get_sublist_enabled( + ${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES + ${PROJECT_NAME}_ENABLED_INTERNAL_TOPLEVEL_PACKAGES + ${PROJECT_NAME}_NUM_ENABLED_INTERNAL_TOPLEVEL_PACKAGES) + + # ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES + tribits_get_sublist_enabled( ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES + ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES + ${PROJECT_NAME}_NUM_ENABLED_INTERNAL_PACKAGES) + + # ${PROJECT_NAME}_REVERSE_ENABLED_INTERNAL_PACKAGES + unset(${PROJECT_NAME}_REVERSE_ENABLED_INTERNAL_PACKAGES) # Wipe out temp value + + # Set ${tribitsPackage}_PKG_IDX for each enabled package + set(pkgIdx 0) + foreach(tribitsPackage ${${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES}) + set(${tribitsPackage}_PKG_IDX ${pkgIdx}) + math(EXPR pkgIdx "${pkgIdx} + 1") + endforeach() endmacro() -# Macro that disabled a packages if its required upstream TPL is disabled.. +# @MACRO: tribits_setup_direct_packages_dependencies_lists_and_lib_required_enable_vars() +# +# Set up flat list of direct external and inner package dependencies (even for +# non-enabled packages) and enabled package dependencies for enabled packages. # -macro(tribits_disable_package_if_tpl_disabled TRIBITS_PACKAGE) +macro(tribits_setup_direct_packages_dependencies_lists_and_lib_required_enable_vars) - foreach(TPL_NAME ${${TRIBITS_PACKAGE}_LIB_REQUIRED_DEP_TPLS}) - if ( (NOT TPL_ENABLE_${TPL_NAME}) AND - (NOT "${TPL_ENABLE_${TPL_NAME}}" STREQUAL "") - ) - tribits_private_disable_tpl_required_package_enable( - ${TPL_NAME} ${TRIBITS_PACKAGE} TRUE ) - endif() + foreach(tad1_externalPkgName IN LISTS ${PROJECT_NAME}_DEFINED_TPLS) + tribits_extpkg_setup_enabled_dependencies(${tad1_externalPkgName}) + # ToDo: Assert that all of the listed dependencies in + # ${tad1_externalPkgName}_LIB_ENABLED_DEPENDENCIES exist and are + # upstream from ${tad1_externalPkgName} endforeach() - foreach(TPL_NAME ${${TRIBITS_PACKAGE}_TEST_REQUIRED_DEP_TPLS}) - if ( (NOT TPL_ENABLE_${TPL_NAME}) AND - (NOT "${TPL_ENABLE_${TPL_NAME}}" STREQUAL "") - ) - tribits_private_disable_tpl_required_package_enable( - ${TPL_NAME} ${TRIBITS_PACKAGE} FALSE ) - endif() + foreach(tad1_internalPkgName IN LISTS ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES) + tribits_setup_enabled_dependencies_lists_and_enable_vars(${tad1_internalPkgName}) endforeach() endmacro() -# Macro that disables all of the subpackages of a parent package. +# @MACRO: tribits_print_direct_packages_dependencies_lists() +# +macro(tribits_print_direct_packages_dependencies_lists) + if (${PROJECT_NAME}_DUMP_PACKAGE_DEPENDENCIES) + message("\nDumping direct enabled dependencies for each package ...") + foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_DEFINED_PACKAGES) + tribits_print_direct_package_dependencies_lists(${tad1_tribitsPkg}) + endforeach() + endif() +endmacro() + + + +################################################################################ # -macro(tribits_disable_parents_subpackages PARENT_PACKAGE_NAME) +# Second-level macros called indirectly from ``tribits_adjust_package_enables()`` +# +################################################################################ - #message("TRIBITS_DISABLE_PARENTS_SUBPACKAGES: ${PARENT_PACKAGE_NAME}") - #print_var(${PROJECT_NAME}_ENABLE_${PARENT_PACKAGE_NAME}) +# Macro that disables all of the subpackages of a parent package. +# +macro(tribits_disable_parents_subpackages parentPackageName) - if(NOT ${PROJECT_NAME}_ENABLE_${PARENT_PACKAGE_NAME} - AND NOT ${PROJECT_NAME}_ENABLE_${PARENT_PACKAGE_NAME} STREQUAL "" + if(NOT ${PROJECT_NAME}_ENABLE_${parentPackageName} + AND (NOT ${PROJECT_NAME}_ENABLE_${parentPackageName} STREQUAL "") ) - set(SUBPACKAGE_IDX 0) - foreach(TRIBITS_SUBPACKAGE ${${PARENT_PACKAGE_NAME}_SUBPACKAGES}) + foreach(tap2_subPkgName IN LISTS ${parentPackageName}_SUBPACKAGES) - set(SUBPACKAGE_NAME ${TRIBITS_SUBPACKAGE}) - set(SUBPACKAGE_FULLNAME ${PARENT_PACKAGE_NAME}${TRIBITS_SUBPACKAGE}) + set(subpkgFullName ${parentPackageName}${tap2_subPkgName}) - #print_var(${PROJECT_NAME}_ENABLE_${SUBPACKAGE_FULLNAME}) - if (NOT ${PROJECT_NAME}_ENABLE_${SUBPACKAGE_FULLNAME} STREQUAL "OFF") - set(ENABLE_BEING_DISABLED_VAR_NAME ${PROJECT_NAME}_ENABLE_${SUBPACKAGE_FULLNAME}) + if (NOT ${PROJECT_NAME}_ENABLE_${subpkgFullName} STREQUAL "OFF") + set(packageBeingDisabledVarName ${PROJECT_NAME}_ENABLE_${subpkgFullName}) message("-- " - "Setting subpackage enable ${ENABLE_BEING_DISABLED_VAR_NAME}=OFF" - " because parent package ${PROJECT_NAME}_ENABLE_${PARENT_PACKAGE_NAME}=OFF") - set(${ENABLE_BEING_DISABLED_VAR_NAME} OFF) + "Setting subpackage enable ${packageBeingDisabledVarName}=OFF" + " because parent package ${PROJECT_NAME}_ENABLE_${parentPackageName}=OFF") + set(${packageBeingDisabledVarName} OFF) endif() - math(EXPR SUBPACKAGE_IDX "${SUBPACKAGE_IDX}+1") - endforeach() endif() @@ -318,44 +447,62 @@ macro(tribits_disable_parents_subpackages PARENT_PACKAGE_NAME) endmacro() -# Macro that enables all of the subpackages of a parent package. +# Macro that disables forward package that depends on the passed-in package # -macro(tribits_enable_parents_subpackages PARENT_PACKAGE_NAME) - - #message("TRIBITS_ENABLE_PARENTS_SUBPACKAGES: ${PARENT_PACKAGE_NAME}") +macro(tribits_disable_forward_required_dep_packages packageName) + tribits_get_package_enable_status(${packageName} packageEnable "") + if ((NOT packageEnable) AND (NOT "${packageEnable}" STREQUAL "")) + foreach(fwdDepPkg IN LISTS ${packageName}_FORWARD_LIB_DEFINED_DEPENDENCIES) + if (${fwdDepPkg}_LIB_DEP_REQUIRED_${packageName}) + tribits_private_disable_required_package_enables(${fwdDepPkg} + ${packageName} TRUE) + else() + tribits_private_disable_optional_package_enables(${fwdDepPkg} + ${packageName} TRUE) + endif() + endforeach() + foreach(fwdDepPkg IN LISTS ${packageName}_FORWARD_TEST_DEFINED_DEPENDENCIES) + if (${fwdDepPkg}_TEST_DEP_REQUIRED_${packageName}) + tribits_private_disable_required_package_enables(${fwdDepPkg} + ${packageName} FALSE) + endif() + endforeach() + endif() +endmacro() - #print_var(${PROJECT_NAME}_ENABLE_${PARENT_PACKAGE_NAME}) - if(${PROJECT_NAME}_ENABLE_${PARENT_PACKAGE_NAME}) +# Macro that enables all of the subpackages of a parent package. +# +macro(tribits_enable_parents_subpackages parentPackageName) - set(SUBPACKAGE_IDX 0) - foreach(TRIBITS_SUBPACKAGE ${${PARENT_PACKAGE_NAME}_SUBPACKAGES}) + if(${PROJECT_NAME}_ENABLE_${parentPackageName}) - set(SUBPACKAGE_NAME ${TRIBITS_SUBPACKAGE}) - set(SUBPACKAGE_FULLNAME ${PARENT_PACKAGE_NAME}${TRIBITS_SUBPACKAGE}) + set(subpkgIdx 0) + foreach(tap2_subPkgName IN LISTS ${parentPackageName}_SUBPACKAGES) - #print_var(${PROJECT_NAME}_ENABLE_${SUBPACKAGE_FULLNAME}) + set(subpkgFullName ${parentPackageName}${tap2_subPkgName}) - if (NOT ${PROJECT_NAME}_ENABLE_${SUBPACKAGE_FULLNAME} AND - NOT "${${PROJECT_NAME}_ENABLE_${SUBPACKAGE_FULLNAME}}" STREQUAL "" + if (NOT ${PROJECT_NAME}_ENABLE_${subpkgFullName} AND + NOT "${${PROJECT_NAME}_ENABLE_${subpkgFullName}}" STREQUAL "" ) # The subpackage is already disabled and is not just empty! - elseif (${PROJECT_NAME}_ENABLE_${SUBPACKAGE_FULLNAME}) + elseif (${PROJECT_NAME}_ENABLE_${subpkgFullName}) # The subpackage is already enabled so there is no reason to enable it! else() # The subpackage is not hard off or on so turn it on by default - tribits_implicit_package_enable_is_allowed( "" ${SUBPACKAGE_FULLNAME} - SUBPACKAGE_ALLOW_IMPLICIT_ENABLE) - if (SUBPACKAGE_ALLOW_IMPLICIT_ENABLE) - set(ENABLE_BEING_ENABLED_VAR_NAME ${PROJECT_NAME}_ENABLE_${SUBPACKAGE_FULLNAME}) + tribits_implicit_package_enable_is_allowed( "" ${subpkgFullName} + subpkgAllowImplicitEnable) + if (subpkgAllowImplicitEnable) + set(enableVarName ${PROJECT_NAME}_ENABLE_${subpkgFullName}) message("-- " - "Setting subpackage enable ${ENABLE_BEING_ENABLED_VAR_NAME}=ON" - " because parent package ${PROJECT_NAME}_ENABLE_${PARENT_PACKAGE_NAME}=ON") - set(${ENABLE_BEING_ENABLED_VAR_NAME} ON) + "Setting subpackage enable ${enableVarName}=ON" + " because parent package ${PROJECT_NAME}_ENABLE_${parentPackageName}=" + "${${PROJECT_NAME}_ENABLE_${parentPackageName}}") + set(${enableVarName} ON) endif() endif() - math(EXPR SUBPACKAGE_IDX "${SUBPACKAGE_IDX}+1") + math(EXPR subpkgIdx "${subpkgIdx}+1") endforeach() @@ -364,129 +511,201 @@ macro(tribits_enable_parents_subpackages PARENT_PACKAGE_NAME) endmacro() -# Macro that disables all forward packages that depend on the given packages +# Macro used to set ${PROJECT_NAME}_ENABLE_ based on +# ${PROJECT_NAME}_ENABLE_ALL_PACKAGES # -macro(tribits_disable_forward_required_dep_packages PACKAGE_NAME) - - #message("TRIBITS_DISABLE_FORWARD_REQUIRED_DEP_PACKAGES: ${PACKAGE_NAME}") - - if ( - (NOT ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - AND - (NOT "${${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}}" STREQUAL "") - ) - - foreach(FWD_DEP_PKG ${${PACKAGE_NAME}_FORWARD_LIB_REQUIRED_DEP_PACKAGES}) - tribits_private_disable_required_package_enables(${FWD_DEP_PKG} ${PACKAGE_NAME} TRUE) - endforeach() +macro(tribits_apply_all_package_enables packageName) + tribits_is_primary_meta_project_package(${packageName} packageIsPmpp) + tribits_implicit_package_enable_is_allowed( "" ${packageName} + processThisPackageEnable ) + if (packageIsPmpp AND processThisPackageEnable) + tribits_set_package_enable_based_on_project_enable( + ${PROJECT_NAME}_ENABLE_ALL_PACKAGES ${PROJECT_NAME}_ENABLE_${packageName} ) + endif() +endmacro() - foreach(FWD_DEP_PKG ${${PACKAGE_NAME}_FORWARD_LIB_OPTIONAL_DEP_PACKAGES}) - tribits_private_disable_optional_package_enables(${FWD_DEP_PKG} ${PACKAGE_NAME}) - endforeach() - foreach(FWD_DEP_PKG ${${PACKAGE_NAME}_FORWARD_TEST_REQUIRED_DEP_PACKAGES}) - tribits_private_disable_required_package_enables(${FWD_DEP_PKG} ${PACKAGE_NAME} FALSE) +# Macro used to set ${PROJECT_NAME}_ENABLE_${FWD_PACKAGE_NAME}=ON for all +# forward required or optional LIB dependency on ${packageName} +# +macro(tribits_enable_forward_lib_package_enables packageName) + if (${PROJECT_NAME}_ENABLE_${packageName}) + foreach(fwdDepPkgName IN LISTS ${packageName}_FORWARD_LIB_DEFINED_DEPENDENCIES) + tribits_private_enable_forward_package(${fwdDepPkgName} ${packageName}) endforeach() - endif() - endmacro() -# Macro that prints out dependencies for a package +# Macro used to set ${PROJECT_NAME}_ENABLE_${FWD_PACKAGE_NAME}=ON for all +# forward required or optional TEST dependency on ${packageName} # -# Does not modify the global state. -# -macro(tribits_print_package_dependencies PACKAGE_NAME) - - set(PRINTED_VAR "") +macro(tribits_enable_forward_test_package_enables packageName) + foreach(fwdDepPkgName IN LISTS ${packageName}_FORWARD_TEST_DEFINED_DEPENDENCIES) + tribits_private_enable_forward_package(${fwdDepPkgName} ${packageName}) + endforeach() +endmacro() +# NOTE: The above macro does not need to check if ${packageName} is enabled +# because it will only be called for packages that are enabled already. This +# not only improves performance but it also aids in testing. - print_nonempty_var_with_spaces(${PACKAGE_NAME}_LIB_REQUIRED_DEP_PACKAGES PRINTED_VAR) - print_nonempty_var_with_spaces(${PACKAGE_NAME}_LIB_OPTIONAL_DEP_PACKAGES PRINTED_VAR) - print_nonempty_var_with_spaces(${PACKAGE_NAME}_TEST_REQUIRED_DEP_PACKAGES PRINTED_VAR) - print_nonempty_var_with_spaces(${PACKAGE_NAME}_TEST_OPTIONAL_DEP_PACKAGES PRINTED_VAR) - if (${PROJECT_NAME}_DUMP_FORWARD_PACKAGE_DEPENDENCIES) - print_nonempty_var_with_spaces(${PACKAGE_NAME}_FORWARD_LIB_REQUIRED_DEP_PACKAGES - PRINTED_VAR) - print_nonempty_var_with_spaces(${PACKAGE_NAME}_FORWARD_LIB_OPTIONAL_DEP_PACKAGES - PRINTED_VAR) - print_nonempty_var_with_spaces(${PACKAGE_NAME}_FORWARD_TEST_REQUIRED_DEP_PACKAGES - PRINTED_VAR) - print_nonempty_var_with_spaces(${PACKAGE_NAME}_FORWARD_TEST_OPTIONAL_DEP_PACKAGES - PRINTED_VAR) +# Macro to disable ${parentPackageName)_ENABLE_ENABLES by default if +# ${parentPackageName)_ENABLE_TESTS is explicitly disabled. +# +macro(tribits_apply_package_examples_disable parentPackageName) + if ( (NOT ${parentPackageName}_ENABLE_TESTS) + AND (NOT "${${parentPackageName}_ENABLE_TESTS}" STREQUAL "") + AND ("${${parentPackageName}_ENABLE_EXAMPLES}" STREQUAL "") + ) + message("-- " "Setting" + " ${parentPackageName}_ENABLE_EXAMPLES" + "=${${parentPackageName}_ENABLE_TESTS}" + " because" + " ${parentPackageName}_ENABLE_TESTS" + "=${${parentPackageName}_ENABLE_TESTS}" ) + set(${parentPackageName}_ENABLE_EXAMPLES ${${parentPackageName}_ENABLE_TESTS}) endif() +endmacro() +# NOTE: Above, the top-level package ${parentPackageName} may not even be +# enabled yet when this gets called but its subpackages might and we need to +# process this default disable in case their are any enabled subpackages. - print_nonempty_var_with_spaces(${PACKAGE_NAME}_LIB_REQUIRED_DEP_TPLS PRINTED_VAR) - print_nonempty_var_with_spaces(${PACKAGE_NAME}_LIB_OPTIONAL_DEP_TPLS PRINTED_VAR) - print_nonempty_var_with_spaces(${PACKAGE_NAME}_TEST_REQUIRED_DEP_TPLS PRINTED_VAR) - print_nonempty_var_with_spaces(${PACKAGE_NAME}_TEST_OPTIONAL_DEP_TPLS PRINTED_VAR) - if (NOT PRINTED_VAR) - message("-- ${PACKAGE_NAME}: No dependencies!") +# Macro to disable _ENABLE_TESTS and +# _ENABLE_EXAMPLES based on +# _ENABLE_TESTS or _ENABLE_EXAMPLES +# +macro(tribits_apply_subpackage_tests_or_examples_disables parentPackageName + testsOrExamples + ) + set(parentPkgEnableVar ${parentPackageName}_ENABLE_${testsOrExamples}) + if ((NOT ${parentPkgEnableVar}) AND (NOT "${${parentPkgEnableVar}}" STREQUAL "")) + foreach(subpkgName IN LISTS ${parentPackageName}_SUBPACKAGES) + set(fullSpkgName ${parentPackageName}${subpkgName}) + if (${PROJECT_NAME}_ENABLE_${fullSpkgName}) + if ("${${fullSpkgName}_ENABLE_${testsOrExamples}}" STREQUAL "") + message("-- " "Setting" + " ${fullSpkgName}_ENABLE_${testsOrExamples}=${${parentPkgEnableVar}}" + " because parent package" + " ${parentPkgEnableVar}=${${parentPkgEnableVar}}") + set(${fullSpkgName}_ENABLE_${testsOrExamples} ${${parentPkgEnableVar}}) + endif() + endif() + endforeach() endif() - endmacro() +# Macro used to set _ENABLE_TESTS and +# _ENABLE_EXAMPLES based on ${PROJECT_NAME}_ENABLE_TESTS and +# ${PROJECT_NAME}_ENABLE_EXAMPLES # -# Private helper macros -# - +macro(tribits_apply_test_example_enables packageName) + if (${PROJECT_NAME}_ENABLE_${packageName}) + tribits_is_primary_meta_project_package(${packageName} packageIsPmmp) + if (packageIsPmmp) + tribits_set_package_enable_based_on_project_enable_on( + ${PROJECT_NAME}_ENABLE_TESTS ${packageName}_ENABLE_TESTS ) + tribits_set_package_enable_based_on_project_enable_on( + ${PROJECT_NAME}_ENABLE_EXAMPLES ${packageName}_ENABLE_EXAMPLES ) + endif() + endif() +endmacro() -macro(tribits_private_add_optional_package_enable PACKAGE_NAME OPTIONAL_DEP_PACKAGE - TYPE SET_AS_CACHE_IN - ) - #message("\nPACKAGE_ARCH_PRIVATE_ADD_OPTIONAL_PACKAGE_ENABLE: ${PACKAGE_NAME} ${OPTIONAL_DEP_PACKAGE}") +# Macro to enable subpackage tests and examples based on parent package tests +# and examples enables +# +macro(tribits_apply_subpackage_tests_examples_enables parentPackageName) + # Set default for ${parentPackageName}_ENABLE_EXAMPLES=OFF if tests disabled + if ( ("${${parentPackageName}_ENABLE_EXAMPLES}" STREQUAL "") + AND ${parentPackageName}_ENABLE_TESTS + ) + message("-- " "Setting" + " ${parentPackageName}_ENABLE_EXAMPLES=${${parentPackageName}_ENABLE_TESTS}" + " because" + " ${parentPackageName}_ENABLE_TESTS=${${parentPackageName}_ENABLE_TESTS}") + set(${parentPackageName}_ENABLE_EXAMPLES ${${parentPackageName}_ENABLE_TESTS}) + endif() + # Set defaults for _ENABLE_[TESTS|EXAMPLES] + set(parentEnableExamples ${${parentPackageName}_ENABLE_EXAMPLES}) + set(parentEnableTests ${${parentPackageName}_ENABLE_TESTS}) + foreach(subpkgName IN LISTS ${parentPackageName}_SUBPACKAGES) + set(fullSpkgName ${parentPackageName}${subpkgName}) + if (${PROJECT_NAME}_ENABLE_${fullSpkgName}) + if (parentEnableTests AND ("${${fullSpkgName}_ENABLE_TESTS}" STREQUAL "")) + message("-- " "Setting" + " ${fullSpkgName}_ENABLE_TESTS=${parentEnableTests}" + " because parent package" + " ${parentPackageName}_ENABLE_TESTS=${parentEnableTests}") + set(${fullSpkgName}_ENABLE_TESTS ${parentEnableTests}) + endif() + if (parentEnableExamples AND ("${${fullSpkgName}_ENABLE_EXAMPLES}" STREQUAL "")) + message("-- " "Setting" + " ${fullSpkgName}_ENABLE_EXAMPLES=${parentEnableExamples}" + " because parent package" + " ${parentPackageName}_ENABLE_EXAMPLES=${parentEnableExamples}") + set(${fullSpkgName}_ENABLE_EXAMPLES ${parentEnableExamples}) + endif() + endif() + endforeach() +endmacro() +# NOTE: Above, the parent package may not actually be enabled yet +# (i.e. ${PROJECT_NAME}_ENABLE_${parentPackageName} my not be TRUE) if only +# subpackages needed to be enabled in the forward sweep but we want the tests +# and examples for a subpackage to be enabled if the tests and examples for +# the parent package, respectfully, are enabled. - if (SET_AS_CACHE_IN) - multiline_set(DOCSTR - "Enable optional ${TYPE} support in the package ${PACKAGE_NAME}" - " for the package ${OPTIONAL_DEP_PACKAGE}." - " Set to 'ON', 'OFF', or leave empty" - " to allow for other logic to decide." - ) +# Macro that enables upstream (required and optional) packages for a given +# package +# +macro(tribits_enable_upstream_packages packageName) - set_cache_on_off_empty( ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE} "" - ${DOCSTR} ) + if (${PROJECT_NAME}_ENABLE_${packageName}) - else() + foreach(depPkg IN LISTS ${packageName}_LIB_DEFINED_DEPENDENCIES) + tribits_private_enable_dep_package(${packageName} ${depPkg} LIB) + endforeach() - if (NOT DEFINED ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}) - set( ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE} "" ) - endif() + foreach(depPkg IN LISTS ${packageName}_TEST_DEFINED_DEPENDENCIES) + tribits_private_enable_dep_package(${packageName} ${depPkg} TEST) + endforeach() endif() endmacro() +# NOTE: The above macro has a defect. It is enabling upstream test dependent +# packages even if tests nor examples are not enabled (see +# TriBITSPub/TriBITS#56). But fixing this will break backward compatibility +# and therefore require upgrading the packages that currently only work +# correctly because of this defect. -macro(tribits_private_add_optional_tpl_enable PACKAGE_NAME OPTIONAL_DEP_TPL - TYPE SET_AS_CACHE_IN ) - - if (SET_AS_CACHE_IN) - - multiline_set(DOCSTR - "Enable optional ${TYPE} support in the package ${PACKAGE_NAME}" - " for the TPL ${OPTIONAL_DEP_TPL}." - " Set to 'ON', 'OFF', or leave empty" - " to allow for other logic to decide." - ) +# Macro that post-processes optional dependencies after all other +# dependencies have been worked out +# +macro(tribits_postprocess_optional_package_enables packageName) - set_cache_on_off_empty( ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL} "" - ${DOCSTR} ) + if (${PROJECT_NAME}_ENABLE_${packageName}) - else() + foreach(depPkg ${${packageName}_LIB_DEFINED_DEPENDENCIES}) + tribits_private_postprocess_optional_package_enable( + ${packageName} ${depPkg} ) + endforeach() - if (NOT DEFINED ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL}) - set( ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL} "" ) - endif() + foreach(depPkg ${${packageName}_TEST_DEFINED_DEPENDENCIES}) + tribits_private_postprocess_optional_package_enable( + ${packageName} ${depPkg} ) + endforeach() endif() endmacro() +# NOTE: Above, it is harmless to process required dependencies as well so we +# leave of the if () statement based on +# ${packageName}_[LIB|TEST]_DEP_REQUIRED_${depPkg}. # Macro that sets cache vars for optional package interdependencies @@ -494,70 +713,89 @@ endmacro() # This also will set ${PACKAGE_NAME}_ENABLE_TESTS and # ${PACKAGE_NAME}_ENABLE_EXAMPLES to empty non-cache vars # -macro(tribits_set_up_optional_package_enables_and_cache_vars PACKAGE_NAME) - - #message("\nPACKAGE_ARCH_ADD_OPTIONAL_PACKAGE_ENABLES: ${PACKAGE_NAME}") +macro(tribits_setup_optional_package_enables_and_cache_vars packageName) - assert_defined(${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - set(SET_AS_CACHE ${${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}}) + assert_defined(${PROJECT_NAME}_ENABLE_${packageName}) + set(setAsCacheVar ${${PROJECT_NAME}_ENABLE_${packageName}}) - if (SET_AS_CACHE) + if (setAsCacheVar) - multiline_set(DOCSTR - "Build tests for the package ${PACKAGE_NAME}. Set to 'ON', 'OFF', or leave empty ''" + multiline_set(docStr + "Build tests for the package ${packageName}. Set to 'ON', 'OFF', or leave empty ''" " to allow for other logic to decide." ) - set_cache_on_off_empty( ${PACKAGE_NAME}_ENABLE_TESTS "" ${DOCSTR} ) + set_cache_on_off_empty( ${packageName}_ENABLE_TESTS "" ${docStr} ) - multiline_set(DOCSTR - "Build examples for the package ${PACKAGE_NAME}. Set to 'ON', 'OFF', or leave empty ''" + multiline_set(docStr + "Build examples for the package ${packageName}. Set to 'ON', 'OFF', or leave empty ''" " to allow for other logic to decide." ) - set_cache_on_off_empty( ${PACKAGE_NAME}_ENABLE_EXAMPLES "" ${DOCSTR} ) + set_cache_on_off_empty( ${packageName}_ENABLE_EXAMPLES "" ${docStr} ) - multiline_set(DOCSTR - "Build examples for the package ${PACKAGE_NAME}. Set to 'ON', 'OFF', or leave empty ''" + multiline_set(docStr + "Build examples for the package ${packageName}. Set to 'ON', 'OFF', or leave empty ''" " to allow for other logic to decide." ) - set( ${PACKAGE_NAME}_SKIP_CTEST_ADD_TEST - "${${PROJECT_NAME}_SKIP_CTEST_ADD_TEST}" CACHE BOOL ${DOCSTR} ) + set( ${packageName}_SKIP_CTEST_ADD_TEST + "${${PROJECT_NAME}_SKIP_CTEST_ADD_TEST}" CACHE BOOL ${docStr} ) else() - if (NOT DEFINED ${PACKAGE_NAME}_ENABLE_TESTS) - set( ${PACKAGE_NAME}_ENABLE_TESTS "" ) + if (NOT DEFINED ${packageName}_ENABLE_TESTS) + set( ${packageName}_ENABLE_TESTS "" ) endif() - if (NOT DEFINED ${PACKAGE_NAME}_ENABLE_EXAMPLES) - set( ${PACKAGE_NAME}_ENABLE_EXAMPLES "" ) + if (NOT DEFINED ${packageName}_ENABLE_EXAMPLES) + set( ${packageName}_ENABLE_EXAMPLES "" ) endif() endif() - foreach(OPTIONAL_DEP_PACKAGE ${${PACKAGE_NAME}_LIB_OPTIONAL_DEP_PACKAGES}) + foreach(optDepPkg ${${packageName}_LIB_DEFINED_DEPENDENCIES}) tribits_private_add_optional_package_enable( - ${PACKAGE_NAME} ${OPTIONAL_DEP_PACKAGE} "library" "${SET_AS_CACHE}" ) + ${packageName} ${optDepPkg} "library" "${setAsCacheVar}" ) endforeach() - foreach(OPTIONAL_DEP_PACKAGE ${${PACKAGE_NAME}_TEST_OPTIONAL_DEP_PACKAGES}) + foreach(optDepPkg ${${packageName}_TEST_DEFINED_DEPENDENCIES}) tribits_private_add_optional_package_enable( - ${PACKAGE_NAME} ${OPTIONAL_DEP_PACKAGE} "test" "${SET_AS_CACHE}" ) - endforeach() - - foreach(OPTIONAL_DEP_TPL ${${PACKAGE_NAME}_LIB_OPTIONAL_DEP_TPLS}) - tribits_private_add_optional_tpl_enable( - ${PACKAGE_NAME} ${OPTIONAL_DEP_TPL} "library" "${SET_AS_CACHE}" ) - endforeach() - - foreach(OPTIONAL_DEP_TPL ${${PACKAGE_NAME}_TEST_OPTIONAL_DEP_TPLS}) - tribits_private_add_optional_tpl_enable( - ${PACKAGE_NAME} ${OPTIONAL_DEP_TPL} "test" "${SET_AS_CACHE}" ) + ${packageName} ${optDepPkg} "test" "${setAsCacheVar}" ) endforeach() endmacro() -# Macro that sets up the flat list of direct package dependencies and enabled -# package dependencies and sets ${packageName}_ENABLE_${depPkg} for LIB +# Macro that enables a the top-level parent package enable if any of its +# subpackages are enabled. +# +macro(tribits_enable_parent_package_for_subpackage_enables toplevelPackageName) + foreach(tap2_subPkgName IN LISTS ${toplevelPackageName}_SUBPACKAGES) + set(subpkgFullName ${toplevelPackageName}${tap2_subPkgName}) + if (${PROJECT_NAME}_ENABLE_${subpkgFullName} + AND (NOT ${PROJECT_NAME}_ENABLE_${toplevelPackageName}) + ) + message("-- " + "Setting ${PROJECT_NAME}_ENABLE_${toplevelPackageName}=ON" + " because ${PROJECT_NAME}_ENABLE_${subpkgFullName}=ON") + set(${PROJECT_NAME}_ENABLE_${toplevelPackageName} ON) + tribits_set_parent_package_subpackage_enable_for_enabled_subpackages( + ${toplevelPackageName}) + tribits_set_parent_package_test_example_enable_for_enabled_subpackages( + ${toplevelPackageName} TESTS) + tribits_set_parent_package_test_example_enable_for_enabled_subpackages( + ${toplevelPackageName} EXAMPLES) + # NOTE: Above, we need to enable the parent package even if it was + # disabled by some means before this. (There are use cases where the + # parent package my be disabled but that may not trigger the disable of + # subpackages of that package.) Other logic should ensure that the + # parent package is never explicitly disabled and a subpackage is + # allowed to be enabled. + break() # We only need trigger above code for single enabled subpackage! + endif() + endforeach() +endmacro() + + +# Macro that sets up the flat list of direct package dependencies and enabled +# package dependencies and sets ${packageName}_ENABLE_${depPkg} for LIB # dependencies # # This makes it easy to just loop over all of the direct upstream dependencies @@ -565,17 +803,11 @@ endmacro() # # NOTES: # -# * ${packageName}_LIB_DEFINED_DEPENDENCIES will be set regardless if -# ${packageName} is enabled or not. -# # * ${packageName}_LIB_ENABLED_DEPENDENCIES is only set if ${packageName} is # enabled and will only contain the names of direct library upstream # internal and external packages ${depPkg} that are required or are # optional and ${packageName}_ENABLE_${depPkg} is set to ON. # -# * ${packageName}_TEST_DEFINED_DEPENDENCIES will be set regardless if -# ${packageName} is enabled or not. -# # * ${packageName}_TEST_ENABLED_DEPENDENCIES is only set if ${packageName} is # enabled and will only contain the names of direct test/example upstream # internal and external packages ${depPkg} that are required or are @@ -589,1196 +821,387 @@ endmacro() # packages where only the shell of the parent package is enabled and not # all of its required subpackages are enabled. # -macro(tribits_setup_direct_package_dependencies_lists_and_lib_required_enable_vars - packageName - ) +macro(tribits_setup_enabled_dependencies_lists_and_enable_vars packageName) - # LIB dependencies + tribits_get_package_enable_status(${packageName} packageEnable packageEnableVar) - set(${packageName}_LIB_DEFINED_DEPENDENCIES "") set(${packageName}_LIB_ENABLED_DEPENDENCIES "") - - foreach(depPkg ${${packageName}_LIB_REQUIRED_DEP_PACKAGES}) - list(APPEND ${packageName}_LIB_DEFINED_DEPENDENCIES ${depPkg}) - if (${PROJECT_NAME}_ENABLE_${packageName} AND ${PROJECT_NAME}_ENABLE_${depPkg}) - set(${packageName}_ENABLE_${depPkg} ON) - list(APPEND ${packageName}_LIB_ENABLED_DEPENDENCIES ${depPkg}) - endif() - endforeach() - # See below NOTE about required subpackage dependencies not being enabled in - # some cases! - - foreach(depPkg ${${packageName}_LIB_OPTIONAL_DEP_PACKAGES}) - list(APPEND ${packageName}_LIB_DEFINED_DEPENDENCIES ${depPkg}) - if (${PROJECT_NAME}_ENABLE_${packageName} AND ${packageName}_ENABLE_${depPkg}) - list(APPEND ${packageName}_LIB_ENABLED_DEPENDENCIES ${depPkg}) - endif() - endforeach() - - foreach(depPkg ${${packageName}_LIB_REQUIRED_DEP_TPLS}) - list(APPEND ${packageName}_LIB_DEFINED_DEPENDENCIES ${depPkg}) - if (${PROJECT_NAME}_ENABLE_${packageName}) - set(${packageName}_ENABLE_${depPkg} ON) - list(APPEND ${packageName}_LIB_ENABLED_DEPENDENCIES ${depPkg}) - endif() - endforeach() - - foreach(depPkg ${${packageName}_LIB_OPTIONAL_DEP_TPLS}) - list(APPEND ${packageName}_LIB_DEFINED_DEPENDENCIES ${depPkg}) - if (${PROJECT_NAME}_ENABLE_${packageName} AND ${packageName}_ENABLE_${depPkg}) - list(APPEND ${packageName}_LIB_ENABLED_DEPENDENCIES ${depPkg}) + foreach(depPkg IN LISTS ${packageName}_LIB_DEFINED_DEPENDENCIES) + tribits_get_package_enable_status(${depPkg} depPkgEnable depPkgEnableVar) + if (${packageName}_LIB_DEP_REQUIRED_${depPkg}) + if (packageEnable AND depPkgEnable) + set(${packageName}_ENABLE_${depPkg} ON) + # See below NOTE about required subpackage dependencies not being + # enabled in some cases + list(APPEND ${packageName}_LIB_ENABLED_DEPENDENCIES ${depPkg}) + endif() + else() + if (packageEnable AND ${packageName}_ENABLE_${depPkg}) + list(APPEND ${packageName}_LIB_ENABLED_DEPENDENCIES ${depPkg}) + endif() endif() endforeach() - # TEST dependencies - - set(${packageName}_TEST_DEFINED_DEPENDENCIES "") set(${packageName}_TEST_ENABLED_DEPENDENCIES "") - - if (${PROJECT_NAME}_ENABLE_${packageName} - AND - (${packageName}_ENABLE_TESTS OR ${packageName}_ENABLE_EXAMPLES) - ) - set(enablePkgAndTestsOrExamples ON) - else() - set(enablePkgAndTestsOrExamples OFF) + if (packageEnable AND (${packageName}_ENABLE_TESTS OR ${packageName}_ENABLE_EXAMPLES)) + foreach(depPkg IN LISTS ${packageName}_TEST_DEFINED_DEPENDENCIES) + if (${packageName}_TEST_DEP_REQUIRED_${depPkg}) + list(APPEND ${packageName}_TEST_ENABLED_DEPENDENCIES ${depPkg}) + else() + if (${packageName}_ENABLE_${depPkg}) + list(APPEND ${packageName}_TEST_ENABLED_DEPENDENCIES ${depPkg}) + endif() + endif() + endforeach() endif() - foreach(depPkg ${${packageName}_TEST_REQUIRED_DEP_PACKAGES}) - list(APPEND ${packageName}_TEST_DEFINED_DEPENDENCIES ${depPkg}) - if (enablePkgAndTestsOrExamples) - list(APPEND ${packageName}_TEST_ENABLED_DEPENDENCIES ${depPkg}) - endif() - endforeach() - - foreach(depPkg ${${packageName}_TEST_OPTIONAL_DEP_PACKAGES}) - list(APPEND ${packageName}_TEST_DEFINED_DEPENDENCIES ${depPkg}) - if (enablePkgAndTestsOrExamples AND ${packageName}_ENABLE_${depPkg}) - list(APPEND ${packageName}_TEST_ENABLED_DEPENDENCIES ${depPkg}) - endif() - endforeach() - - foreach(depPkg ${${packageName}_TEST_REQUIRED_DEP_TPLS}) - list(APPEND ${packageName}_TEST_DEFINED_DEPENDENCIES ${depPkg}) - if (enablePkgAndTestsOrExamples) - list(APPEND ${packageName}_TEST_ENABLED_DEPENDENCIES ${depPkg}) - endif() - endforeach() - - foreach(depPkg ${${packageName}_TEST_OPTIONAL_DEP_TPLS}) - list(APPEND ${packageName}_TEST_DEFINED_DEPENDENCIES ${depPkg}) - if (enablePkgAndTestsOrExamples AND ${packageName}_ENABLE_${depPkg}) - list(APPEND ${packageName}_TEST_ENABLED_DEPENDENCIES ${depPkg}) - endif() - endforeach() - endmacro() # NOTE: Above, a required dependency of an enabled package may not actually be -# enabled if it is a required subpackage of a parent package and the parent -# package was not actually enabled due to a dependency but the shell of the -# parent package was only enabled at the very end. This is one of the more -# confusing aspects of the TriBITS dependency system. +# enabled if the upstream depPkg is a required subpackage of a parent package +# and the parent package was not actually enabled due to a dependency, but +# instead, only the shell of the parent package was enabled at the very end +# (in tribits_do_final_parent_packages_enables_for_subpackage_enables()). +# This is one of the more confusing aspects of the TriBITS dependency system. # Function to print the direct package dependency lists # function(tribits_print_direct_package_dependencies_lists packageName) - set(PRINTED_VAR "") message("") - print_nonempty_var_with_spaces(${packageName}_LIB_ENABLED_DEPENDENCIES PRINTED_VAR) - print_var_with_spaces(${packageName}_LIB_DEFINED_DEPENDENCIES PRINTED_VAR) - print_nonempty_var_with_spaces(${packageName}_TEST_ENABLED_DEPENDENCIES PRINTED_VAR) - print_nonempty_var_with_spaces(${packageName}_TEST_DEFINED_DEPENDENCIES PRINTED_VAR) + set(printedVar "") + tribits_print_nonempty_package_deps_list(${packageName} LIB ENABLED printedVar) + tribits_print_nonempty_package_deps_list(${packageName} TEST ENABLED printedVar) + if (NOT printedVar) + message("-- ${packageName}: No enabled dependencies!") + endif() endfunction() + +################################################################################ # -# Private helper macros +# Third and lower-level macros called indirectly from +# ``tribits_adjust_package_enables()`` # +################################################################################ -# Enable optional intra-package support for enabled target package -# ${PACKAGE_NAME} (i.e. ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME} is assumed to -# be TRUE before calling this macro. +# Only turn off ${fwdDepPkgName} libraries or test/examples if it is currently +# enabled or could be enabled # -macro(tribits_private_postprocess_optional_package_enable PACKAGE_NAME OPTIONAL_DEP_PACKAGE) - - #message("TRIBITS_PRIVATE_POSTPROCESS_OPTIONAL_PACKAGE_ENABLE: ${PACKAGE_NAME} ${OPTIONAL_DEP_PACKAGE}") - #print_var(${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}) - #print_var(${PROJECT_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}) - - if (${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE} AND ${PROJECT_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}) - message("-- " "NOTE:" - " ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}=${${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}}" - " is already set!") - elseif ("${${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}}" STREQUAL "") - if (${PROJECT_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}) - message("-- " "Setting ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}=ON" - " since ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}=ON AND" - " ${PROJECT_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}=ON") - set(${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE} ON) +macro(tribits_private_disable_required_package_enables + fwdDepPkgName packageName libraryDep + ) + tribits_get_package_enable_status(${fwdDepPkgName} "" fwdDepPkgEnableVarName) + if (${fwdDepPkgEnableVarName} OR "${${fwdDepPkgEnableVarName}}" STREQUAL "") + if ("${libraryDep}" STREQUAL "TRUE") + tribits_private_print_disable_required_package_enable( + ${packageName} ${fwdDepPkgEnableVarName} + ${fwdDepPkgName} "library" ) + set(${fwdDepPkgEnableVarName} OFF) else() - message("-- " "NOT setting ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}=ON" - " since ${OPTIONAL_DEP_PACKAGE} is NOT enabled at this point!") - endif() - elseif (NOT "${${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}}" STREQUAL "" - AND NOT ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE} - AND ${PROJECT_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE} - ) - message("-- " "NOTE: ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}=${${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}}" - " is already set so not enabling even though ${PROJECT_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}=${${PROJECT_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}} is set!") - endif() - - string(TOUPPER ${PACKAGE_NAME} PACKAGE_NAME_UPPER) - string(TOUPPER ${OPTIONAL_DEP_PACKAGE} OPTIONAL_DEP_PACKAGE_UPPER) - set(MACRO_DEFINE_NAME HAVE_${PACKAGE_NAME_UPPER}_${OPTIONAL_DEP_PACKAGE_UPPER}) + set(depTypeStr "test/example") + if (${fwdDepPkgName}_ENABLE_TESTS + OR "${${fwdDepPkgName}_ENABLE_TESTS}" STREQUAL "" + ) + tribits_private_print_disable_required_package_enable( + ${packageName} ${fwdDepPkgName}_ENABLE_TESTS + ${fwdDepPkgName} "${depTypeStr}" ) + set(${fwdDepPkgName}_ENABLE_TESTS OFF) + endif() - if(${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}) - set(${MACRO_DEFINE_NAME} ON) - else() - set(${MACRO_DEFINE_NAME} OFF) + if (${fwdDepPkgName}_ENABLE_EXAMPLES + OR "${${fwdDepPkgName}_ENABLE_EXAMPLES}" STREQUAL "" + ) + tribits_private_print_disable_required_package_enable( + ${packageName} ${fwdDepPkgName}_ENABLE_EXAMPLES + ${fwdDepPkgName} "${depTypeStr}" ) + set(${fwdDepPkgName}_ENABLE_EXAMPLES OFF) + endif() + endif() endif() - endmacro() +function(tribits_private_print_disable_required_package_enable + packageName packageEnableSomethingVarName fwdDepPkgName + depTypeStr + ) + tribits_private_print_disable( + ${packageEnableSomethingVarName} ${fwdDepPkgName} + "${depTypeStr}" "package" ${packageName} ) +endfunction() -# Enable optional intra-package support for enabled target package -# ${PACKAGE_NAME} (i.e. ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME} is assumed to -# be TRUE before calling this macro. -# -macro(tribits_private_postprocess_optional_tpl_enable PACKAGE_NAME OPTIONAL_DEP_TPL) - - #message("TRIBITS_PRIVATE_POSTPROCESS_OPTIONAL_TPL_ENABLE: ${PACKAGE_NAME} ${OPTIONAL_DEP_TPL}") - - if (${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL} AND TPL_ENABLE_${OPTIONAL_DEP_TPL}) - message("-- " "NOTE:" - " ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL}=${${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL}}" - " is already set!") - elseif ( - (NOT TPL_ENABLE_${OPTIONAL_DEP_TPL}) - AND - (NOT "${TPL_ENABLE_${OPTIONAL_DEP_TPL}}" STREQUAL "") - AND - ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL} - ) - message( - "\n***" - "\n*** NOTE: Setting ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL}=OFF" - " which was ON since TPL_ENABLE_${OPTIONAL_DEP_TPL}=OFF" - "\n***\n" - ) - set(${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL} OFF) - elseif ("${${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL}}" STREQUAL "" - AND TPL_ENABLE_${OPTIONAL_DEP_TPL} - ) - message("-- " "Setting ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL}=ON" - " since TPL_ENABLE_${OPTIONAL_DEP_TPL}=ON") - set(${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL} ON) - elseif (NOT "${${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL}}" STREQUAL "" - AND NOT ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL} - AND TPL_ENABLE_${OPTIONAL_DEP_TPL} - ) - message("-- " "NOTE: ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL}=${${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL}}" - " is already set so not enabling even though TPL_ENABLE_${OPTIONAL_DEP_TPL}=${TPL_ENABLE_${OPTIONAL_DEP_TPL}} is set!") - endif() - - string(TOUPPER ${PACKAGE_NAME} PACKAGE_NAME_UPPER) - string(TOUPPER ${OPTIONAL_DEP_TPL} OPTIONAL_DEP_TPL_UPPER) - set(MACRO_DEFINE_NAME HAVE_${PACKAGE_NAME_UPPER}_${OPTIONAL_DEP_TPL_UPPER}) - if (${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL}) - set(${MACRO_DEFINE_NAME} ON) +function(tribits_private_print_disable + packageBeingDisabledVarName packageWithSomethingBeingDisabledName + depTypeStr thingBeingDisabledType thingBeingDisabledName + ) + if (${packageBeingDisabledVarName}) + if (${PROJECT_NAME}_DISABLE_ENABLED_FORWARD_DEP_PACKAGES) + message( + " ***\n" + " *** NOTE: Setting ${packageBeingDisabledVarName}=OFF" + " which was '${${packageBeingDisabledVarName}}' because" + " ${packageWithSomethingBeingDisabledName} has" + " a required ${depTypeStr} dependence on disabled" + " ${thingBeingDisabledType} ${thingBeingDisabledName}" + " but ${PROJECT_NAME}_DISABLE_ENABLED_FORWARD_DEP_PACKAGES=ON!\n" + " ***\n" + ) + else() + message(FATAL_ERROR + " ***\n" + " *** ERROR: Setting ${packageBeingDisabledVarName}=OFF" + " which was '${${packageBeingDisabledVarName}}' because" + " ${packageWithSomethingBeingDisabledName} has" + " a required ${depTypeStr} dependence on disabled" + " ${thingBeingDisabledType} ${thingBeingDisabledName}!\n" + " ***\n" + ) + endif() else() - set(${MACRO_DEFINE_NAME} OFF) - endif() - -endmacro() - - -# Macro that post-processes optional dependencies after all other -# dependencies have been worked out -# -macro(tribits_postprocess_optional_package_enables PACKAGE_NAME) - - #message("\nPACKAGE_ARCH_POSTPROCESS_OPTIONAL_PACKAGE_ENABLES: ${PACKAGE_NAME}") - - assert_defined(${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - if (${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - - foreach(OPTIONAL_DEP_PACKAGE ${${PACKAGE_NAME}_LIB_OPTIONAL_DEP_PACKAGES}) - tribits_private_postprocess_optional_package_enable( - ${PACKAGE_NAME} ${OPTIONAL_DEP_PACKAGE} ) - endforeach() - - foreach(OPTIONAL_DEP_PACKAGE ${${PACKAGE_NAME}_TEST_OPTIONAL_DEP_PACKAGES}) - tribits_private_postprocess_optional_package_enable( - ${PACKAGE_NAME} ${OPTIONAL_DEP_PACKAGE} ) - endforeach() - + message("-- " + "Setting ${packageBeingDisabledVarName}=OFF" + " because ${packageWithSomethingBeingDisabledName} has a required ${depTypeStr}" + " dependence on disabled ${thingBeingDisabledType} ${thingBeingDisabledName}") endif() +endfunction() -endmacro() - - -# Macro that post-processes final package enables for packages with subpackage -# enables. -# -macro(tribits_postprocess_package_with_subpackages_enables PACKAGE_NAME) - #message("TRIBITS_POSTPROCESS_PACKAGE_WITH_SUBPACKAGES_ENABLES '${PACKAGE_NAME}'") - foreach(TRIBITS_SUBPACKAGE ${${PACKAGE_NAME}_SUBPACKAGES}) - set(SUBPACKAGE_FULLNAME ${PACKAGE_NAME}${TRIBITS_SUBPACKAGE}) - #print_var(${PROJECT_NAME}_ENABLE_${SUBPACKAGE_FULLNAME}) - #print_var(${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - #print_var(${SUBPACKAGE_FULLNAME}_ENABLE_TESTS) - #print_var(${PACKAGE_NAME}_ENABLE_TESTS) - #print_var(${SUBPACKAGE_FULLNAME}_ENABLE_EXAMPLES) - #print_var(${PACKAGE_NAME}_ENABLE_EXAMPLES) - if (${PROJECT_NAME}_ENABLE_${SUBPACKAGE_FULLNAME} - AND NOT ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME} - ) - message("-- " - "Setting ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}=ON" - " because ${PROJECT_NAME}_ENABLE_${SUBPACKAGE_FULLNAME}=ON") - set(${PROJECT_NAME}_ENABLE_${PACKAGE_NAME} ON) - tribits_postprocess_package_with_subpackages_optional_subpackage_enables( - ${PACKAGE_NAME}) - tribits_postprocess_package_with_subpackages_test_example_enables( - ${PACKAGE_NAME} TESTS) - tribits_postprocess_package_with_subpackages_test_example_enables( - ${PACKAGE_NAME} EXAMPLES) - # NOTE: We need to enable the parent package even if it was disabled by - # some means before this because a subpackage is enabled. But other - # logic should ensure that the parent package is never disabled and a - # subpackage is allowed to be enabled. - endif() - endforeach() -endmacro() +macro(tribits_private_disable_optional_package_enables fwdDepPkgName packageName) -# Set _ENABLE_=ON if not already enabled for all -# subpackages of a parent package. -# -macro(tribits_postprocess_package_with_subpackages_optional_subpackage_enables - PACKAGE_NAME - ) - #message("TRIBITS_POSTPROCESS_PACKAGE_WITH_SUBPACKAGES_TEST_EXAMPLE_ENABLES '${PACKAGE_NAME}'") - foreach(TRIBITS_SUBPACKAGE ${${PACKAGE_NAME}_SUBPACKAGES}) - set(SUBPACKAGE_FULLNAME ${PACKAGE_NAME}${TRIBITS_SUBPACKAGE}) - if (${PROJECT_NAME}_ENABLE_${SUBPACKAGE_FULLNAME} - AND "${${PACKAGE_NAME}_ENABLE_${SUBPACKAGE_FULLNAME}}" STREQUAL "" - ) - message("-- " - "Setting ${PACKAGE_NAME}_ENABLE_${SUBPACKAGE_FULLNAME}=ON" - " because ${PROJECT_NAME}_ENABLE_${SUBPACKAGE_FULLNAME}=ON") - set(${PACKAGE_NAME}_ENABLE_${SUBPACKAGE_FULLNAME} ON) + if (${fwdDepPkgName}_ENABLE_${packageName} + OR "${${fwdDepPkgName}_ENABLE_${packageName}}" STREQUAL "" + ) + # Always disable the conditional enable but only print the message if the + # package is enabled or if a disable overrides an enable + if (${PROJECT_NAME}_ENABLE_${fwdDepPkgName}) + if (${fwdDepPkgName}_ENABLE_${packageName}) # is explicitly enabled already! + message("-- " + "NOTE: Setting ${fwdDepPkgName}_ENABLE_${packageName}=OFF" + " which was ${${fwdDepPkgName}_ENABLE_${packageName}}" + " because ${fwdDepPkgName} has an optional library dependence" + " on disabled package ${packageName}") + else() # Not explicitly set + message("-- " + "Setting ${fwdDepPkgName}_ENABLE_${packageName}=OFF" + " because ${fwdDepPkgName} has an optional library dependence" + " on disabled package ${packageName}") + endif() endif() - endforeach() -endmacro() - - -# Set the parent package tests/examples enables if one subpackage is enabled -# and has its tests/examples -# -macro(tribits_postprocess_package_with_subpackages_test_example_enables - PACKAGE_NAME TESTS_OR_EXAMPLES - ) - #message("TRIBITS_POSTPROCESS_PACKAGE_WITH_SUBPACKAGES_TEST_EXAMPLE_ENABLES '${PACKAGE_NAME}'") - foreach(TRIBITS_SUBPACKAGE ${${PACKAGE_NAME}_SUBPACKAGES}) - set(SUBPACKAGE_FULLNAME ${PACKAGE_NAME}${TRIBITS_SUBPACKAGE}) - #print_var(${PROJECT_NAME}_ENABLE_${SUBPACKAGE_FULLNAME}) - #print_var(${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - #print_var(${SUBPACKAGE_FULLNAME}_ENABLE_${TESTS_OR_EXAMPLES}) - #print_var(${PACKAGE_NAME}_ENABLE_${TESTS_OR_EXAMPLES}) - #print_var(${SUBPACKAGE_FULLNAME}_ENABLE_EXAMPLES) - #print_var(${PACKAGE_NAME}_ENABLE_EXAMPLES) - if (${SUBPACKAGE_FULLNAME}_ENABLE_${TESTS_OR_EXAMPLES} - AND "${${PACKAGE_NAME}_ENABLE_${TESTS_OR_EXAMPLES}}" STREQUAL "" + if (${fwdDepPkgName}_ENABLE_${packageName} + AND (NOT ${PROJECT_NAME}_ENABLE_${packageName}) + AND (NOT "${${PROJECT_NAME}_ENABLE_${packageName}}" STREQUAL "") ) - message("-- " - "Setting ${PACKAGE_NAME}_ENABLE_${TESTS_OR_EXAMPLES}=ON" - " because ${SUBPACKAGE_FULLNAME}_ENABLE_${TESTS_OR_EXAMPLES}=ON") - set(${PACKAGE_NAME}_ENABLE_${TESTS_OR_EXAMPLES} ON) + message("-- " "NOTE: ${fwdDepPkgName}_ENABLE_${packageName}=" + "${${fwdDepPkgName}_ENABLE_${packageName}} but" + " ${PROJECT_NAME}_ENABLE_${packageName}=" + "${${PROJECT_NAME}_ENABLE_${packageName}} is set. Setting" + " ${fwdDepPkgName}_ENABLE_${packageName}=OFF!") endif() - endforeach() -endmacro() - - -# Post-processes optional package TPL based on if the TPL -# has been enabled or not -# -macro(tribits_postprocess_optional_tpl_enables PACKAGE_NAME) - - #message("\nPACKAGE_ARCH_ADD_OPTIONAL_TPL_ENABLES: ${PACKAGE_NAME}") - - if (${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - - foreach(OPTIONAL_DEP_TPL ${${PACKAGE_NAME}_LIB_OPTIONAL_DEP_TPLS}) - tribits_private_postprocess_optional_tpl_enable( - ${PACKAGE_NAME} ${OPTIONAL_DEP_TPL} ) - endforeach() - - foreach(OPTIONAL_DEP_TPL ${${PACKAGE_NAME}_TEST_OPTIONAL_DEP_TPLS}) - tribits_private_postprocess_optional_tpl_enable( - ${PACKAGE_NAME} ${OPTIONAL_DEP_TPL} ) - endforeach() - + set(${fwdDepPkgName}_ENABLE_${packageName} OFF) endif() endmacro() -# Set an individual package variable enable variable (to on or off) based on a +# Set an individual package variable enable variable (to ON or OFF) based on a # global enable value # -macro(tribits_set_package_enable_based_on_global_enable projectEnableVar +macro(tribits_set_package_enable_based_on_project_enable projectEnableVar packageEnableVar ) - if (${PROJECT_NAME}_VERBOSE_CONFIGURE) - message("") - message("TRIBITS_SET_PACKAGE_ENABLE_BASED_ON_GLOBAL_ENABLE:") - message("-- " "${projectEnableVar} = ${${projectEnableVar}}") - message("-- " "${packageEnableVar} = ${${packageEnableVar}}") - endif() - if ("${${packageEnableVar}}" STREQUAL "") if (${projectEnableVar}) message("-- " "Setting ${packageEnableVar}=ON") set(${packageEnableVar} ON) - elseif ( - (NOT ${projectEnableVar}) - AND - (NOT "${projectEnableVar}" STREQUAL "") + elseif ( (NOT ${projectEnableVar}) + AND (NOT "${projectEnableVar}" STREQUAL "") ) message("-- " "Setting ${packageEnableVar}=OFF") set(${packageEnableVar} OFF) else() - if (${PROJECT_NAME}_VERBOSE_CONFIGURE) - message("-- " "ELSE") - # Otherwise, we will leave it up the the individual package - # to decide? - endif() + # Otherwise, we will leave it up the the individual package + # to decide? endif() else() - if (${PROJECT_NAME}_VERBOSE_CONFIGURE) - message("-- " "${packageEnableVar} NOT DEFAULT") - endif() - endif() - - if (${PROJECT_NAME}_VERBOSE_CONFIGURE) - message("-- " "${packageEnableVar} = ${${packageEnableVar}}") + # "${packageEnableVar} not at the default empty '' endif() endmacro() -# Set an individual package test or examples enable to on only if global enable var is on +# Set an individual package test or examples enable to on only if global +# enable var is on # -macro(tribits_set_package_enable_based_on_global_enable_on projectEnableVar +macro(tribits_set_package_enable_based_on_project_enable_on projectEnableVar packageEnableVar ) - if ("${${packageEnableVar}}" STREQUAL "") - if (${projectEnableVar}) - message("-- " "Setting ${packageEnableVar}=ON") - set(${packageEnableVar} ON) - endif() + if (("${${packageEnableVar}}" STREQUAL "") AND ${projectEnableVar}) + message("-- " "Setting ${packageEnableVar}=ON") + set(${packageEnableVar} ON) endif() endmacro() -# Macro used to set ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME} based on -# ${PROJECT_NAME}_ENABLE_ALL_PACKAGES -# -macro(tribits_apply_all_package_enables PACKAGE_NAME) - tribits_is_primary_meta_project_package(${PACKAGE_NAME} PACKAGE_IS_PMPP) - tribits_implicit_package_enable_is_allowed( "" ${PACKAGE_NAME} - PROCESS_PACKAGE_ENABLE ) - if (PACKAGE_IS_PMPP AND PROCESS_PACKAGE_ENABLE) - tribits_set_package_enable_based_on_global_enable( - ${PROJECT_NAME}_ENABLE_ALL_PACKAGES ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME} ) +macro(tribits_private_enable_dep_package packageName depPkgName libOrTest) + tribits_get_package_enable_status(${depPkgName} depPkgEnable depPkgEnableVar) + if (depPkgEnable) + #message("The package is already enabled so there is nothing to enable!") + elseif (${depPkgEnableVar} STREQUAL "") + set(tpedp_enableDepPkg "") + if (${packageName}_${libOrTest}_DEP_REQUIRED_${depPkgName}) + message("-- " "Setting ${depPkgEnableVar}=ON" + " because ${packageName} has a required dependence on ${depPkgName}") + set(tpedp_enableDepPkg ON) + elseif (${packageName}_ENABLE_${depPkgName}) + # Enable the upstream package if the user directly specified the + # optional package enable regardless if it is PT or ST or even EX. + message("-- " "Setting ${depPkgEnableVar}=ON" + " because ${packageName}_ENABLE_${depPkgName}=ON") + set(tpedp_enableDepPkg ON) + elseif (${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES) + # Enable the package if there is an optional dependence and we are asked + # to enabled optional dependencies. + tribits_implicit_package_enable_is_allowed(${packageName} ${depPkgName} + allowImplicitEnable) + if (allowImplicitEnable) + message("-- " "Setting ${depPkgEnableVar}=ON" + " because ${packageName} has an optional dependence on ${depPkgName}") + set(tpedp_enableDepPkg ON) + endif() + endif() + # Enable the upstream package + if (tpedp_enableDepPkg) + set(${depPkgEnableVar} ON) + set(${depPkgName}_ENABLING_PKG ${packageName}) + endif() endif() endmacro() -# Macro used to set ${TRIBITS_PACKAGE)_ENABLE_TESTS and ${TRIBITS_PACKAGE)_ENABLE_EXAMPLES -# based on ${PROJECT_NAME}_ENABLE_TESTS and ${PROJECT_NAME}_ENABLE_EXAMPLES +# Enable optional intra-package support for enabled target package +# ${packageName} (i.e. ${PROJECT_NAME}_ENABLE_${packageName} is assumed to +# be TRUE before calling this macro. # -macro(tribits_apply_test_example_enables PACKAGE_NAME) - if (${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - tribits_is_primary_meta_project_package(${PACKAGE_NAME} PACKAGE_IS_PMPP) - if (PACKAGE_IS_PMPP) - tribits_set_package_enable_based_on_global_enable_on( - ${PROJECT_NAME}_ENABLE_TESTS ${PACKAGE_NAME}_ENABLE_TESTS ) - tribits_set_package_enable_based_on_global_enable_on( - ${PROJECT_NAME}_ENABLE_EXAMPLES ${PACKAGE_NAME}_ENABLE_EXAMPLES ) - endif() - endif() -endmacro() +macro(tribits_private_postprocess_optional_package_enable packageName optDepPkg) + tribits_get_package_enable_status(${optDepPkg} optDepPkgEnable optDepPkgEnableVar) + tribits_get_package_enable_status(${packageName} packageEnable packageEnableVar) -# Macro to disable ${PARENT_PACKAGE_NAME)_ENABLE_ENABLES by default if -# ${PARENT_PACKAGE_NAME)_ENABLE_TESTS is explicitly disabled. -# -macro(tribits_apply_package_examples_disable PARENT_PACKAGE_NAME) - if (NOT "${${PARENT_PACKAGE_NAME}_ENABLE_TESTS}" STREQUAL "" - AND NOT ${PARENT_PACKAGE_NAME}_ENABLE_TESTS - AND "${${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES}" STREQUAL "" + if (${packageName}_ENABLE_${optDepPkg} AND optDepPkgEnable) + message("-- " "NOTE:" + " ${packageName}_ENABLE_${optDepPkg}=${${packageName}_ENABLE_${optDepPkg}}" + " is already set!") + elseif ("${${packageName}_ENABLE_${optDepPkg}}" STREQUAL "") + if (optDepPkgEnable) + message("-- " "Setting ${packageName}_ENABLE_${optDepPkg}=ON" + " since ${packageEnableVar}=ON AND" + " ${optDepPkgEnableVar}=ON") + set(${packageName}_ENABLE_${optDepPkg} ON) + else() + message("-- " "NOT setting ${packageName}_ENABLE_${optDepPkg}=ON" + " since ${optDepPkg} is NOT enabled at this point!") + endif() + elseif ((NOT "${${packageName}_ENABLE_${optDepPkg}}" STREQUAL "") + AND (NOT ${packageName}_ENABLE_${optDepPkg}) + AND optDepPkgEnable ) - message("-- " "Setting" - " ${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES" - "=${${PARENT_PACKAGE_NAME}_ENABLE_TESTS}" - " because" - " ${PARENT_PACKAGE_NAME}_ENABLE_TESTS" - "=${${PARENT_PACKAGE_NAME}_ENABLE_TESTS}" ) - set(${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES ${${PARENT_PACKAGE_NAME}_ENABLE_TESTS}) + message("-- " "NOTE: ${packageName}_ENABLE_${optDepPkg}=" + "${${packageName}_ENABLE_${optDepPkg}} is already set so not enabling even" + " though ${optDepPkgEnableVar}=" + "${optDepPkgEnable} is set!") endif() -endmacro() -# NOTE: Above, the top-level package ${PARENT_PACKAGE_NAME} may not even be -# enabled yet when this gets called but its subpackages might and we need to -# process this default disable in case their are any enabled subpackages. + string(TOUPPER ${packageName} packageName_UPPER) + string(TOUPPER ${optDepPkg} optDepPkg_UPPER) + set(macroDefineName HAVE_${packageName_UPPER}_${optDepPkg_UPPER}) -# Macro to disable ${TRIBITS_SUBPACKAGE)_ENABLE_TESTS and -# ${TRIBITS_SUBPACKAGE)_ENABLE_EXAMPLES based on -# ${TRIBITS_PARENTPACKAGE)_ENABLE_TESTS or -# ${TRIBITS_PARENTPACKAGE)_ENABLE_EXAMPLES -# -macro(tribits_apply_subpackage_tests_or_examples_disables PARENT_PACKAGE_NAME - TESTS_OR_EXAMPLES - ) - set(parentPkgEnableVar ${PARENT_PACKAGE_NAME}_ENABLE_${TESTS_OR_EXAMPLES}) - if (NOT "${${parentPkgEnableVar}}" STREQUAL "" AND NOT ${parentPkgEnableVar}) - foreach(spkg IN LISTS ${PARENT_PACKAGE_NAME}_SUBPACKAGES) - set(fullSpkgName ${PARENT_PACKAGE_NAME}${spkg}) - if (${PROJECT_NAME}_ENABLE_${fullSpkgName} AND NOT ${parentPkgEnableVar}) - if ("${${fullSpkgName}_ENABLE_${TESTS_OR_EXAMPLES}}" STREQUAL "") - message("-- " "Setting" - " ${fullSpkgName}_ENABLE_${TESTS_OR_EXAMPLES}=${${parentPkgEnableVar}}" - " because parent package" - " ${parentPkgEnableVar}=${${parentPkgEnableVar}}") - set(${fullSpkgName}_ENABLE_${TESTS_OR_EXAMPLES} ${${parentPkgEnableVar}}) - endif() - endif() - endforeach() + if(${packageName}_ENABLE_${optDepPkg}) + set(${macroDefineName} ON) + else() + set(${macroDefineName} OFF) endif() + endmacro() -# Macro to enable ${TRIBITS_SUBPACKAGE)_ENABLE_TESTS and -# ${TRIBITS_SUBPACKAGE)_ENABLE_EXAMPLES based on -# ${TRIBITS_PARENTPACKAGE)_ENABLE_TESTS or -# ${TRIBITS_PARENTPACKAGE)_ENABLE_EXAMPLES -# -macro(tribits_apply_subpackage_tests_examples_enables PARENT_PACKAGE_NAME) - if ("${${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES}" STREQUAL "" - AND ${PARENT_PACKAGE_NAME}_ENABLE_TESTS - ) - message("-- " "Setting" - " ${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES=${${PARENT_PACKAGE_NAME}_ENABLE_TESTS}" - " because" - " ${PARENT_PACKAGE_NAME}_ENABLE_TESTS=${${PARENT_PACKAGE_NAME}_ENABLE_TESTS}") - set(${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES ${${PARENT_PACKAGE_NAME}_ENABLE_TESTS}) +macro(tribits_private_enable_forward_package fwdDepPkgName packageName) + tribits_implicit_package_enable_is_allowed( "" ${fwdDepPkgName} allowFwdDepPkgEnable) + if ("${${PROJECT_NAME}_ENABLE_${fwdDepPkgName}}" STREQUAL "" AND allowFwdDepPkgEnable) + message("-- " "Setting ${PROJECT_NAME}_ENABLE_${fwdDepPkgName}=ON" + " because ${PROJECT_NAME}_ENABLE_${packageName}=ON") + set(${PROJECT_NAME}_ENABLE_${fwdDepPkgName} ON) endif() - foreach(spkg IN LISTS ${PARENT_PACKAGE_NAME}_SUBPACKAGES) - set(fullSpkgName ${PARENT_PACKAGE_NAME}${spkg}) - if (${PROJECT_NAME}_ENABLE_${fullSpkgName}) - if (${PARENT_PACKAGE_NAME}_ENABLE_TESTS) - if ("${${fullSpkgName}_ENABLE_TESTS}" STREQUAL "") - message("-- " "Setting" - " ${fullSpkgName}_ENABLE_TESTS=${${PARENT_PACKAGE_NAME}_ENABLE_TESTS}" - " because parent package" - " ${PARENT_PACKAGE_NAME}_ENABLE_TESTS" - "=${${PARENT_PACKAGE_NAME}_ENABLE_TESTS}") - set(${fullSpkgName}_ENABLE_TESTS ${${PARENT_PACKAGE_NAME}_ENABLE_TESTS}) - endif() - endif() - if (${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES) - if ("${${fullSpkgName}_ENABLE_EXAMPLES}" STREQUAL "") - message("-- " "Setting" - " ${fullSpkgName}_ENABLE_EXAMPLES=${${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES}" - " because parent package" - " ${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES" - "=${${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES}") - set(${fullSpkgName}_ENABLE_EXAMPLES ${${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES}) - endif() - endif() - endif() - endforeach() endmacro() -# NOTE: Above, the parent package may not actually be enabled yet -# (i.e. ${PROJECT_NAME}_ENABLE_${PARENT_PACKAGE_NAME} my not be TRUE) if only -# subpackages needed to be enabled in the forward sweep but we want the tests -# and examples for subpackage to be enabled if -# ${PARENT_PACKAGE_NAME}_ENABLE_TESTS=ON or just examples i -# f${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES=ON -macro(tribits_private_enable_forward_package FORWARD_DEP_PACKAGE_NAME PACKAGE_NAME) - tribits_implicit_package_enable_is_allowed( "" ${FORWARD_DEP_PACKAGE_NAME} - ALLOW_PACKAGE_ENABLE ) - assert_defined(${PROJECT_NAME}_ENABLE_${FORWARD_DEP_PACKAGE_NAME}) - if("${${PROJECT_NAME}_ENABLE_${FORWARD_DEP_PACKAGE_NAME}}" STREQUAL "" - AND ALLOW_PACKAGE_ENABLE - ) - message("-- " "Setting ${PROJECT_NAME}_ENABLE_${FORWARD_DEP_PACKAGE_NAME}=ON" - " because ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}=ON") - assert_defined(${PROJECT_NAME}_ENABLE_${FORWARD_DEP_PACKAGE_NAME}) - set(${PROJECT_NAME}_ENABLE_${FORWARD_DEP_PACKAGE_NAME} ON) - endif() -endmacro() +macro(tribits_private_add_optional_package_enable packageName optionalDepPkgName + libraryOrTest setAsCacheVar + ) + if (setAsCacheVar) -# Macro used to set ${PROJECT_NAME}_ENABLE_${FWD_PACKAGE_NAME)=ON for all -# -macro(tribits_enable_forward_lib_package_enables PACKAGE_NAME) + multiline_set(docStr + "Enable optional ${libraryOrTest} support in the package ${packageName}" + " for the package ${optionalDepPkgName}." + " Set to 'ON', 'OFF', or leave empty" + " to allow for other logic to decide." + ) - assert_defined(${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - if (${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) + set_cache_on_off_empty( ${packageName}_ENABLE_${optionalDepPkgName} "" + ${docStr} ) - foreach(FWD_DEP_PKG ${${PACKAGE_NAME}_FORWARD_LIB_REQUIRED_DEP_PACKAGES}) - tribits_private_enable_forward_package(${FWD_DEP_PKG} ${PACKAGE_NAME}) - endforeach() + else() - foreach(FWD_DEP_PKG ${${PACKAGE_NAME}_FORWARD_LIB_OPTIONAL_DEP_PACKAGES}) - tribits_private_enable_forward_package(${FWD_DEP_PKG} ${PACKAGE_NAME}) - endforeach() + if (NOT DEFINED ${packageName}_ENABLE_${optionalDepPkgName}) + set(${packageName}_ENABLE_${optionalDepPkgName} "" ) + endif() endif() endmacro() -# Macro used to set ${PROJECT_NAME}_ENABLE_${FWD_PACKAGE_NAME)=ON for all -# optional and required forward test dependencies of the package -# ${PACKAGE_NAME} +# Macro that sets ``_ENABLE_=ON`` if not already +# enabled for all enabled subpackages of a parent package. # -macro(tribits_enable_forward_test_package_enables PACKAGE_NAME) - - assert_defined(${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - if (${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - - foreach(FWD_DEP_PKG ${${PACKAGE_NAME}_FORWARD_TEST_REQUIRED_DEP_PACKAGES}) - tribits_private_enable_forward_package(${FWD_DEP_PKG} ${PACKAGE_NAME}) - endforeach() - - foreach(FWD_DEP_PKG ${${PACKAGE_NAME}_FORWARD_TEST_OPTIONAL_DEP_PACKAGES}) - tribits_private_enable_forward_package(${FWD_DEP_PKG} ${PACKAGE_NAME}) - endforeach() - - endif() - +macro(tribits_set_parent_package_subpackage_enable_for_enabled_subpackages + toplevelPackageName + ) + foreach(tap3_subPkg IN LISTS ${toplevelPackageName}_SUBPACKAGES) + set(subpkgFullName ${toplevelPackageName}${tap3_subPkg}) + if (${PROJECT_NAME}_ENABLE_${subpkgFullName} + AND "${${toplevelPackageName}_ENABLE_${subpkgFullName}}" STREQUAL "" + ) + message("-- " + "Setting ${toplevelPackageName}_ENABLE_${subpkgFullName}=ON" + " because ${PROJECT_NAME}_ENABLE_${subpkgFullName}=ON") + set(${toplevelPackageName}_ENABLE_${subpkgFullName} ON) + endif() + endforeach() endmacro() +# Macro that sets ``_ENABLE_[TESTS|EXAMPLES]=ON`` if subpackage +# is enabled and has its tests/examples are enabled. # -# Private helper macros -# - - -macro(tribits_private_enable_dep_package PACKAGE_NAME DEP_PACKAGE_NAME - OPTREQ_IN +macro(tribits_set_parent_package_test_example_enable_for_enabled_subpackages + toplevelPackageName testOrExamples ) + foreach(tap3_subPkg IN LISTS ${toplevelPackageName}_SUBPACKAGES) + set(subpkgFullName ${toplevelPackageName}${tap3_subPkg}) + if (${subpkgFullName}_ENABLE_${testOrExamples} + AND "${${toplevelPackageName}_ENABLE_${testOrExamples}}" STREQUAL "" + ) + message("-- " + "Setting ${toplevelPackageName}_ENABLE_${testOrExamples}=ON" + " because ${subpkgFullName}_ENABLE_${testOrExamples}=ON") + set(${toplevelPackageName}_ENABLE_${testOrExamples} ON) + endif() + endforeach() +endmacro() - #message("TRIBITS_PRIVATE_ENABLE_DEP_PACKAGE: '${PACKAGE_NAME}' '${DEP_PACKAGE_NAME}' '${OPTREQ_IN}'") - - assert_defined(${PROJECT_NAME}_ENABLE_${DEP_PACKAGE_NAME}) - #print_var(${PACKAGE_NAME}_ENABLE_${DEP_PACKAGE_NAME}) - - if (${PROJECT_NAME}_ENABLE_${DEP_PACKAGE_NAME}) - #message("The package is already enabled so there is nothing to enable!") - - elseif (${PROJECT_NAME}_ENABLE_${DEP_PACKAGE_NAME} STREQUAL "") - - set(TRIBITS_PRIVATE_ENABLE_DEP_PACKAGES_ENABLE_PACKAGE "") - - if ("${OPTREQ_IN}" STREQUAL "REQUIRED") - - #message("Always enable the upstream dependency if it is required") - - message("-- " "Setting ${PROJECT_NAME}_ENABLE_${DEP_PACKAGE_NAME}=ON" - " because ${PACKAGE_NAME} has a required dependence on ${DEP_PACKAGE_NAME}") - - set(TRIBITS_PRIVATE_ENABLE_DEP_PACKAGES_ENABLE_PACKAGE ON) - - elseif (${PACKAGE_NAME}_ENABLE_${DEP_PACKAGE_NAME}) - - # Enable the upstream package if the user directly specified the - # optional package enable regardless if it is PT or ST or even EX. - - message("-- " "Setting ${PROJECT_NAME}_ENABLE_${DEP_PACKAGE_NAME}=ON" - " because ${PACKAGE_NAME}_ENABLE_${DEP_PACKAGE_NAME}=ON") - - set(TRIBITS_PRIVATE_ENABLE_DEP_PACKAGES_ENABLE_PACKAGE ON) - - elseif (${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES) - - # Enable the package if there is an optional dependence and we are asked - # to enabled optional dependencies. - - tribits_implicit_package_enable_is_allowed(${PACKAGE_NAME} ${DEP_PACKAGE_NAME} - ALLOW_IMPLICIT_ENABLE) - if (ALLOW_IMPLICIT_ENABLE) - message("-- " "Setting ${PROJECT_NAME}_ENABLE_${DEP_PACKAGE_NAME}=ON" - " because ${PACKAGE_NAME} has an optional dependence on ${DEP_PACKAGE_NAME}") - set(TRIBITS_PRIVATE_ENABLE_DEP_PACKAGES_ENABLE_PACKAGE ON) - endif() - - endif() - - # Enable the upstream package - if (TRIBITS_PRIVATE_ENABLE_DEP_PACKAGES_ENABLE_PACKAGE) - assert_defined(${PROJECT_NAME}_ENABLE_${DEP_PACKAGE_NAME}) - set(${PROJECT_NAME}_ENABLE_${DEP_PACKAGE_NAME} ON) - endif() - - endif() - -endmacro() - - -macro(tribits_private_enable_dep_tpl PACKAGE_NAME DEP_TPL_NAME) - assert_defined(TPL_ENABLE_${DEP_TPL_NAME}) - if(TPL_ENABLE_${DEP_TPL_NAME} STREQUAL "") - message("-- " "Setting TPL_ENABLE_${DEP_TPL_NAME}=ON because" - " it is required by the enabled package ${PACKAGE_NAME}") - assert_defined(TPL_ENABLE_${DEP_TPL_NAME}) - set(TPL_ENABLE_${DEP_TPL_NAME} ON) - set(TPL_${DEP_TPL_NAME}_ENABLING_PKG ${PACKAGE_NAME}) - endif() -endmacro() - - -macro(tribits_private_enable_optional_dep_tpl PACKAGE_NAME DEP_TPL_NAME) - #assert_defined(${PACKAGE_NAME}_ENABLE_${DEP_TPL_NAME}) - if (${PROJECT_NAME}_ENABLE_${PACKAGE_NAME} - AND ${PACKAGE_NAME}_ENABLE_${DEP_TPL_NAME} - AND TPL_ENABLE_${DEP_TPL_NAME} STREQUAL "" - ) - message("-- " "Setting TPL_ENABLE_${DEP_TPL_NAME}=ON because" - " ${PACKAGE_NAME}_ENABLE_${DEP_TPL_NAME}=ON") - assert_defined(TPL_ENABLE_${DEP_TPL_NAME}) - set(TPL_ENABLE_${DEP_TPL_NAME} ON) - endif() -endmacro() - - -# Macro that enables the optional TPLs for given package -# -macro(tribits_enable_optional_tpls PACKAGE_NAME) - - #message("TRIBITS_ENABLE_OPTIONAL_TPLS: ${PACKAGE_NAME}") - #message("-- " "${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}=${${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}}") - - assert_defined(${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - - if (${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - - foreach(DEP_TPL ${${PACKAGE_NAME}_LIB_OPTIONAL_DEP_TPLS}) - tribits_private_enable_optional_dep_tpl(${PACKAGE_NAME} ${DEP_TPL}) - endforeach() - - foreach(DEP_TPL ${${PACKAGE_NAME}_TEST_OPTIONAL_DEP_TPLS}) - tribits_private_enable_optional_dep_tpl(${PACKAGE_NAME} ${DEP_TPL}) - endforeach() - - endif() - -endmacro() - - -# Macro that enables upstream (required and optional) packages given package -# -# Here I have to enable the required packages too or the logic just does no -# work as expected. -# -macro(tribits_enable_upstream_packages PACKAGE_NAME) - - #message("TRIBITS_ENABLE_UPSTREAM_PACKAGES: ${PACKAGE_NAME}") - #message("-- " "${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}=${${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}}") - - assert_defined(${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - - if (${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - - foreach(DEP_PKG ${${PACKAGE_NAME}_LIB_REQUIRED_DEP_PACKAGES}) - tribits_private_enable_dep_package(${PACKAGE_NAME} ${DEP_PKG} REQUIRED) - endforeach() - - foreach(DEP_PKG ${${PACKAGE_NAME}_LIB_OPTIONAL_DEP_PACKAGES}) - tribits_private_enable_dep_package(${PACKAGE_NAME} ${DEP_PKG} OPTIONAL) - endforeach() - - foreach(DEP_PKG ${${PACKAGE_NAME}_TEST_REQUIRED_DEP_PACKAGES}) - tribits_private_enable_dep_package(${PACKAGE_NAME} ${DEP_PKG} REQUIRED) - endforeach() - - foreach(DEP_PKG ${${PACKAGE_NAME}_TEST_OPTIONAL_DEP_PACKAGES}) - tribits_private_enable_dep_package(${PACKAGE_NAME} ${DEP_PKG} OPTIONAL) - endforeach() - - endif() - -endmacro() - - -# Macro that sets the required TPLs for given package -# -macro(tribits_enable_required_tpls PACKAGE_NAME) - - #message("PACKAGE_ARCH_ENABLE_REQUIRED_TPL_ENABLES: ${PACKAGE_NAME}") - #message("-- " "${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}=${${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}}") - - assert_defined(${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - - if (${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - - foreach(DEP_TPL ${${PACKAGE_NAME}_LIB_REQUIRED_DEP_TPLS}) - tribits_private_enable_dep_tpl(${PACKAGE_NAME} ${DEP_TPL}) - endforeach() - - foreach(DEP_TPL ${${PACKAGE_NAME}_TEST_REQUIRED_DEP_TPLS}) - tribits_private_enable_dep_tpl(${PACKAGE_NAME} ${DEP_TPL}) - endforeach() - - endif() - -endmacro() - - -# @MACRO: tribits_adjust_package_enables() -# -# Usage: -# -# tribits_adjust_package_enables() -# -# Macro that adjusts all of the package enables from what the user input to -# the final set that will be used to enable packages. -# -macro(tribits_adjust_package_enables) - - if (${PROJECT_NAME}_UNENABLE_ENABLED_PACKAGES) - message("") - message("Setting to empty '' all enabled packages on request ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES}) - if (${PROJECT_NAME}_ENABLE_${TRIBITS_PACKAGE}) - set_cache_on_off_empty(${PROJECT_NAME}_ENABLE_${TRIBITS_PACKAGE} "" - "Forced to empty '' by ${PROJECT_NAME}_UNENABLE_ENABLED_PACKAGES=ON" FORCE) - set(${PROJECT_NAME}_ENABLE_${TRIBITS_PACKAGE} "") - endif() - #print_var(${PROJECT_NAME}_ENABLE_${TRIBITS_PACKAGE}) - # NOTE: Above, we don't want to set to empty those packages that have hard - # disables because this will mess up the logic in later invocations. - endforeach() - advanced_set(${PROJECT_NAME}_UNENABLE_ENABLED_PACKAGES OFF CACHE BOOL - "Forced to FALSE after use" FORCE) - endif() - - # - # A) Sweep forward through and apply all disables first! - # - - tribits_get_nondisabled_list( ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES ${PROJECT_NAME} - ${PROJECT_NAME}_NOTDISABLED_PACKAGES "") - - message("") - message("Disabling all packages that have a required dependency" - " on disabled TPLs and optional package TPL support based on TPL_ENABLE_=OFF ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_NOTDISABLED_PACKAGES}) - tribits_disable_package_if_tpl_disabled(${TRIBITS_PACKAGE}) - endforeach() - - message("") - message("Disabling subpackages for hard disables of parent packages" - " due to ${PROJECT_NAME}_ENABLE_=OFF ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES}) - tribits_disable_parents_subpackages(${TRIBITS_PACKAGE}) - endforeach() - - message("") - message("Disabling forward required packages and optional intra-package" - " support that have a dependency on disabled packages" - " ${PROJECT_NAME}_ENABLE_=OFF ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES}) - tribits_disable_forward_required_dep_packages(${TRIBITS_PACKAGE}) - endforeach() - - tribits_get_nondisabled_list( ${PROJECT_NAME}_NOTDISABLED_PACKAGES ${PROJECT_NAME} - ${PROJECT_NAME}_NOTDISABLED_PACKAGES "") - - set(${PROJECT_NAME}_REVERSE_NOTDISABLED_PACKAGES - "${${PROJECT_NAME}_NOTDISABLED_PACKAGES}") - list(REVERSE ${PROJECT_NAME}_REVERSE_NOTDISABLED_PACKAGES) - - # - # B) Apply all forward enables - # - - message("") - message("Enabling subpackages for hard enables of parent packages" - " due to ${PROJECT_NAME}_ENABLE_=ON ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_NOTDISABLED_PACKAGES}) - tribits_enable_parents_subpackages(${TRIBITS_PACKAGE}) - endforeach() - - if (${PROJECT_NAME}_ENABLE_ALL_PACKAGES) - message("") - message("Enabling all packages that are not currently disabled because of" - " ${PROJECT_NAME}_ENABLE_ALL_PACKAGES=ON" - " (${PROJECT_NAME}_ENABLE_SECONDARY_TESTED_CODE=${${PROJECT_NAME}_ENABLE_SECONDARY_TESTED_CODE})" - " ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_NOTDISABLED_PACKAGES}) - tribits_apply_all_package_enables(${TRIBITS_PACKAGE}) - endforeach() - endif() - - if (${PROJECT_NAME}_ENABLE_ALL_FORWARD_DEP_PACKAGES) - message("") - message("Sweep forward enabling all forward library dependent packages because" - " ${PROJECT_NAME}_ENABLE_ALL_FORWARD_DEP_PACKAGES=ON ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_NOTDISABLED_PACKAGES}) - tribits_enable_forward_lib_package_enables(${TRIBITS_PACKAGE}) - endforeach() - message("") - message("Sweep backward enabling all forward test dependent packages because" - " ${PROJECT_NAME}_ENABLE_ALL_FORWARD_DEP_PACKAGES=ON ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_REVERSE_NOTDISABLED_PACKAGES}) - tribits_enable_forward_test_package_enables(${TRIBITS_PACKAGE}) - endforeach() - # NOTE: Above, we want to sweep backward to enable test-dependent packages - # because we don't want to enable package Z just because package Y was enabled - # because it had a test-only dependency on package X. Sweeping backwards through - # the packages makes sure this does not happen. - set(${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES ON) - endif() - - tribits_get_enabled_list( ${PROJECT_NAME}_NOTDISABLED_PACKAGES ${PROJECT_NAME} - ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES "") - - # - # C) Disable and enable tests for currently enabled packages - # - - message("") - message("Disabling subpackage tests/examples based on parent package tests/examples disables ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES}) - tribits_apply_package_examples_disable(${TRIBITS_PACKAGE} TESTS) - tribits_apply_subpackage_tests_or_examples_disables(${TRIBITS_PACKAGE} TESTS) - tribits_apply_subpackage_tests_or_examples_disables(${TRIBITS_PACKAGE} EXAMPLES) - endforeach() - - if (${PROJECT_NAME}_ENABLE_TESTS OR ${PROJECT_NAME}_ENABLE_EXAMPLES) - message("") - message("Enabling all tests and/or examples that have not been" - " explicitly disabled because ${PROJECT_NAME}_ENABLE_[TESTS,EXAMPLES]=ON ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES}) - tribits_apply_test_example_enables(${TRIBITS_PACKAGE}) - endforeach() - endif() - # NOTE: Above, we enable tests and examples here, before the remaining required - # packages so that we don't enable tests that don't need to be enabled based - # on the use of the option ${PROJECT_NAME}_ENABLE_ALL_FORWARD_DEP_PACKAGES. - - message("") - message("Enabling subpackage tests/examples based on parent package tests/examples enables ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES}) - tribits_apply_subpackage_tests_examples_enables(${TRIBITS_PACKAGE}) - endforeach() - # NOTE: We want to apply this logic here instead of later after the backward - # sweep of package enables because we don't want to enable the - # tests/examples for a subpackage if it is not needed based on set of - # requested subpackages and packages to be enabled and the optional forward - # sweep of downstream packages. - - # - # D) Sweep backwards and enable upstream required and optional packages - # - - if (${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES) - set(EXTRA_MSG_STR " (and optional since ${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES=ON)") - else() - set(EXTRA_MSG_STR "") - endif() - - message("") - message("Enabling all required${EXTRA_MSG_STR} upstream packages for current set of" - " enabled packages" - " (${PROJECT_NAME}_ENABLE_SECONDARY_TESTED_CODE=${${PROJECT_NAME}_ENABLE_SECONDARY_TESTED_CODE})" - " ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_REVERSE_NOTDISABLED_PACKAGES}) - tribits_enable_upstream_packages(${TRIBITS_PACKAGE}) - endforeach() - # NOTE: Above, we have to loop through the packages backward to enable all - # the packages that feed into these packages. This has to include *all* - # upstream package enables including required packages, optional packages - # (when ${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES), and packages - - tribits_get_enabled_list( ${PROJECT_NAME}_NOTDISABLED_PACKAGES ${PROJECT_NAME} - ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES "") - - message("") - message("Enabling all optional intra-package enables _ENABLE_" - " that are not currently disabled if both sets of packages are enabled ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES}) - tribits_postprocess_optional_package_enables(${TRIBITS_PACKAGE}) - endforeach() - - # - # E) Enable TPLs - # - - message("") - message("Enabling all remaining required TPLs for current set of" - " enabled packages ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES}) - tribits_enable_required_tpls(${TRIBITS_PACKAGE}) - endforeach() - - message("") - message("Enabling all optional package TPL support" - " _ENABLE_ not currently disabled for" - " enabled TPLs ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES}) - tribits_postprocess_optional_tpl_enables(${TRIBITS_PACKAGE}) - endforeach() - - message("") - message("Enabling TPLs based on _ENABLE_=ON if TPL is not explicitly disabled ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES}) - tribits_enable_optional_tpls(${TRIBITS_PACKAGE}) - endforeach() - # NOTE: We need to do this after the above optional package TPL support - # logic so that the TPL will be turned on for this package only as requested - # in bug 4298. - - # - # F) Set user cache variables for current set of enabled packages - # - - message("") - message("Set cache entries for optional packages/TPLs and tests/examples for packages actually enabled ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES}) - tribits_set_up_optional_package_enables_and_cache_vars(${TRIBITS_PACKAGE}) - endforeach() - - # - # G) Turn on parent packages where at least one subpackage has been enabled - # - - message("") - message("Enabling the shell of non-enabled parent packages (mostly for show) that have at least one subpackage enabled ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES}) - tribits_postprocess_package_with_subpackages_enables(${TRIBITS_PACKAGE}) - endforeach() - # NOTE: The above ensures that loops involving the parent package will - # process the parent package but doing this last ensures that no downstream - # dependencies will be enabled. - - tribits_set_up_enabled_lists_and_pkg_idx() - - # - # H) Set up flat list of direct external and inner package dependencies (even - # for non-enabled packages) and enabled package dependencies for enabled - # packages - # - - foreach(externalPkgName ${${PROJECT_NAME}_DEFINED_TPLS}) - tribits_extpkg_setup_enabled_dependencies(${externalPkgName}) - # ToDo: Assert that all of the listed dependencies in - # ${externalPkgName}_LIB_ENABLED_DEPENDENCIES exist and are upstream from - # ${externalPkgName} - endforeach() - - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES}) - tribits_setup_direct_package_dependencies_lists_and_lib_required_enable_vars( - ${TRIBITS_PACKAGE}) - endforeach() - - if (${PROJECT_NAME}_DUMP_PACKAGE_DEPENDENCIES) - message("\nDumping direct dependencies for each package ...") - foreach(tribitsPkg IN LISTS ${PROJECT_NAME}_DEFINED_TPLS - ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES - ) - tribits_print_direct_package_dependencies_lists(${tribitsPkg}) - endforeach() - endif() - -endmacro() - - -# Function that sets up the full package dependencies for each enabled package -# including all of its indirect upstream package dependencies. -# -# This is needed in several different parts of the TriBITS implementation. -# -# ToDo: #63: Remove this function since we should not need a full list of -# direct and indirect package dependencies! -# -function(tribits_package_set_full_enabled_dep_packages PACKAGE_NAME) - - set(PACKAGE_FULL_DEPS_LIST "") - - foreach(DEP_PKG ${${PACKAGE_NAME}_LIB_REQUIRED_DEP_PACKAGES}) - if (${PROJECT_NAME}_ENABLE_${DEP_PKG}) - list(APPEND PACKAGE_FULL_DEPS_LIST ${DEP_PKG}) - endif() - # NOTE: This if() should not be needed but this is a safeguard - endforeach() - - foreach(DEP_PKG ${${PACKAGE_NAME}_LIB_OPTIONAL_DEP_PACKAGES}) - if (${PACKAGE_NAME}_ENABLE_${DEP_PKG}) - list(APPEND PACKAGE_FULL_DEPS_LIST ${DEP_PKG}) - endif() - endforeach() - - if(PACKAGE_FULL_DEPS_LIST) - list(REMOVE_DUPLICATES PACKAGE_FULL_DEPS_LIST) - - foreach(DEP_PACKAGE ${PACKAGE_FULL_DEPS_LIST}) - list(APPEND PACKAGE_FULL_DEPS_LIST ${${DEP_PACKAGE}_FULL_ENABLED_DEP_PACKAGES}) - endforeach() - - list(REMOVE_DUPLICATES PACKAGE_FULL_DEPS_LIST) - endif() - - set(ORDERED_PACKAGE_FULL_DEPS_LIST "") - - foreach(DEP_PACKAGE ${PACKAGE_FULL_DEPS_LIST}) - - #print_var(${DEP_PACKAGE}_PKG_IDX) - set(DEP_PACKAGE_VALUE ${${DEP_PACKAGE}_PKG_IDX}) - - set(SORTED_INDEX 0) - set(INSERTED_DEP_PACKAGE FALSE) - - foreach(SORTED_PACKAGE ${ORDERED_PACKAGE_FULL_DEPS_LIST}) - - #print_var(${SORTED_PACKAGE}_PKG_IDX) - set(SORTED_PACKAGE_VALUE ${${SORTED_PACKAGE}_PKG_IDX}) - - if (${DEP_PACKAGE_VALUE} GREATER ${SORTED_PACKAGE_VALUE}) - list(INSERT ORDERED_PACKAGE_FULL_DEPS_LIST ${SORTED_INDEX} ${DEP_PACKAGE}) - set(INSERTED_DEP_PACKAGE TRUE) - break() - endif() - - math(EXPR SORTED_INDEX ${SORTED_INDEX}+1) - - endforeach() - - if(NOT INSERTED_DEP_PACKAGE) - list(APPEND ORDERED_PACKAGE_FULL_DEPS_LIST ${DEP_PACKAGE}) - endif() - - endforeach() - - global_set(${PACKAGE_NAME}_FULL_ENABLED_DEP_PACKAGES - ${ORDERED_PACKAGE_FULL_DEPS_LIST}) - - if (${PROJECT_NAME}_VERBOSE_CONFIGURE) - print_var(${PACKAGE_NAME}_FULL_ENABLED_DEP_PACKAGES) - endif() - -endfunction() - - -# Function that creates enable-only dependency data-structures -# -# ToDo: #63: Remove this function since we should not need a full list of -# direct and indirect package dependencies! -# -function(tribits_set_up_enabled_only_dependencies) - - set(GENERATE_EXPORT_DEPENDENCIES ${${PROJECT_NAME}_GENERATE_EXPORT_FILE_DEPENDENCIES}) - set(lastExportTribitsPackage) - - if ("${${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_PACKAGES}" STREQUAL "" - AND NOT - "${${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_SE_PACKAGES}" STREQUAL "" - ) - message(DEPRECATION - "WARNING! The cache var" - " ${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_SE_PACKAGES" - "='${${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_SE_PACKAGES}'" - " is deprecated! Please instead set" - " ${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_PACKAGES" - "='${${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_SE_PACKAGES}'") - set(${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_PACKAGES - ${${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_SE_PACKAGES} ) - endif() - - if (GENERATE_EXPORT_DEPENDENCIES - AND ${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_PACKAGES - ) - # Find the last enabled package for which an export file is requested. - set(LAST_PKG_IDX -1) - set(LAST_PKG) - foreach(tribitsPkg ${${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_PACKAGES}) - #print_var(tribitsPkg) - set(PKG_IDX ${${tribitsPkg}_PKG_IDX}) - #print_var(PKG_IDX) - if (PKG_IDX) - # The listed package is enabled so we will consider it - if (PKG_IDX GREATER ${LAST_PKG_IDX}) - set(LAST_PKG_IDX ${PKG_IDX}) - set(LAST_PKG ${tribitsPkg}) - #print_var(LAST_PKG_IDX) - #print_var(LAST_PKG) - endif() - endif() - endforeach() - if (LAST_PKG) - # At least one listed package was enabled - set(lastExportTribitsPackage ${LAST_PKG}) - else() - # None of the listed packages were enabled so don't bother generating - # any export dependencies - set(GENERATE_EXPORT_DEPENDENCIES FALSE) - endif() - - endif() - - if (GENERATE_EXPORT_DEPENDENCIES) - - if (lastExportTribitsPackage) - message("\nSetting up export dependencies up through ${lastExportTribitsPackage} ...\n") - else() - message("\nSetting up export dependencies for all enabled packages ...\n") - endif() - - foreach(tribitsPackage ${${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES}) - tribits_package_set_full_enabled_dep_packages(${tribitsPackage}) - if (${PROJECT_NAME}_DUMP_PACKAGE_DEPENDENCIES) - set(PRINTED_VAR FALSE) - print_nonempty_var_with_spaces(${tribitsPackage}_FULL_ENABLED_DEP_PACKAGES - PRINTED_VAR) - if (NOT PRINTED_VAR) - message("-- ${tribitsPackage}: No library dependencies!") - endif() - endif() - if ("${lastExportTribitsPackage}" STREQUAL ${tribitsPackage}) - break() - endif() - endforeach() - - endif() - -endfunction() +# LocalWords: tribits TriBITS foreach endmacro endfunction diff --git a/cmake/tribits/core/package_arch/TribitsExternalPackageWriteConfigFile.cmake b/cmake/tribits/core/package_arch/TribitsExternalPackageWriteConfigFile.cmake index 2d041a2ca424..fd4adb86a9f8 100644 --- a/cmake/tribits/core/package_arch/TribitsExternalPackageWriteConfigFile.cmake +++ b/cmake/tribits/core/package_arch/TribitsExternalPackageWriteConfigFile.cmake @@ -166,8 +166,9 @@ endfunction() # @FUNCTION: tribits_extpkg_write_config_file_str() # -# Create the text string for a ``Config.cmake`` file given the list of -# include directories and libraries for an external package/TPL. +# Create the text string for a ``Config.cmake`` file given the list +# of include directories and libraries for an external package/TPL from the +# legacy TriBITS TPL specification. # # Usage:: # @@ -194,9 +195,11 @@ endfunction() # packages listed in ``_LIB_ENABLED_DEPENDENCIES``. # # The arguments in ``TPL__LIBRARIES`` are handled in special ways in -# order to create the namespaced IMPORTED targets ``::`` and -# the ``::all_libs`` target that depends on these. The types of -# arguments that are handled and how the are interpreted: +# order to create the namespaced IMPORTED targets +# ``tribits::::`` and the ``::all_libs`` target +# that depends on these. +# +# The types of arguments that are handled and how the are interpreted: # # ``/[lib].`` # @@ -204,13 +207,13 @@ endfunction() # imported target name ```` is derived from the file name (of the # form ``lib.`` removing beginning ``lib`` and file # extension ``.``). The IMPORTED target -# ``::`` is created and the file path is set using the -# ``IMPORTED_LOCATION`` target property. +# ``tribits::::`` is created and the file path is set +# using the ``IMPORTED_LOCATION`` target property. # # ``-l`` # # Arguments of the form ``-l`` are used to create IMPORTED -# targets with the name ``::`` using the +# targets with the name ``tribits::::`` using the # ``IMPORTED_LIBNAME`` target property. # # ```` @@ -248,6 +251,20 @@ endfunction() # ``_LIB_ENABLED_DEPENDENCIES``, a link dependency is created using # ``target_link_library(::all_libs INTERFACE )``. # +# NOTE: The IMPORTED targets generated for each library argument +# ``::`` are prefixed with ``tribits::`` to give +# ``tribits::::``. This is to avoid clashing with IMPORTED +# targets ``::`` from other package config files +# ``Config.cmake`` or find modules ``Find.cmake`` that may +# clash (see TriBITSPub/TriBITS#548). But the generated INTERFACE IMPORTED +# target ``::all_libs`` is **not** namespaced with ``tribits::`` +# since the ``all_libs`` target is unlikely to clash. The targets +# ``tribits::::`` are not directly used in downstream +# ``target_link_library()`` calls so the names of these targets are really +# just an implementation detail. (The reason we give these a name based of +# the library name they represent ```` is to make it more clear what +# the matching library is and to make the name unique.) +# function(tribits_extpkg_write_config_file_str tplName tplConfigFileStrOut) # A) Set up beginning of config file text @@ -529,14 +546,14 @@ function(tribits_extpkg_process_libraries_list_library_entry tribits_extpkg_get_libname_and_path_from_libentry( "${libentry}" ${libEntryType} libname libpath) # Create IMPORTED library target - set(prefixed_libname "${tplName}::${libname}") + set(prefixed_libname "tribits::${tplName}::${libname}") if (NOT (prefixed_libname IN_LIST libTargets)) tribits_extpkg_append_add_library_str (${libname} ${prefixed_libname} ${libEntryType} "${libpath}" configFileStr) if (lastLibProcessed) string(APPEND configFileStr "target_link_libraries(${prefixed_libname}\n" - " INTERFACE ${tplName}::${lastLibProcessed})\n" + " INTERFACE tribits::${tplName}::${lastLibProcessed})\n" ) else() tribits_extpkg_append_upstream_target_link_libraries_str( ${tplName} @@ -553,10 +570,11 @@ function(tribits_extpkg_process_libraries_list_library_entry set(${lastLibProcessedInOut} ${lastLibProcessed} PARENT_SCOPE) set(${configFileStrInOut} ${configFileStr} PARENT_SCOPE) endfunction() -# NOTE: Above, we only need to link the first library :: -# against the upstream TPL libraries ::all_libs. The other -# imported targets :: for this TPL are linked to this first -# :: which has the needed dependencies. +# NOTE: Above, we only need to link the first library +# tribits:::: against the upstream TPL libraries +# ::all_libs. The other imported targets +# tribits:::: for this TPL are linked to this first +# tribits:::: which has the needed dependencies. function(tribits_extpkg_get_libname_and_path_from_libentry diff --git a/cmake/tribits/core/package_arch/TribitsGeneralMacros.cmake b/cmake/tribits/core/package_arch/TribitsGeneralMacros.cmake index 9fc85539061e..0dc079655a34 100644 --- a/cmake/tribits/core/package_arch/TribitsGeneralMacros.cmake +++ b/cmake/tribits/core/package_arch/TribitsGeneralMacros.cmake @@ -42,6 +42,8 @@ include(AssertDefined) include(MessageWrapper) include(TribitsParseArgumentsHelpers) include(TribitsSortListAccordingToMasterList) +include(TribitsDeprecatedHelpers) +include(TribitsGetPackageEnableStatus) # Optionally start CMake code configure timing @@ -143,165 +145,6 @@ function(tribits_set_base_repo_dir BASE_DIR REPO_DIR BASE_REPO_DIR_OUT) endfunction() -# Get the list of explicitly enabled entries -# -# These is the list of entries in ${LISTVAR} for which: -# -# if (${ENABLED_PREFIX}_ENABLE_{ENTRY}) -# -# evaluates to true. -# -function(tribits_get_enabled_list LISTVAR ENABLED_PREFIX - ENABLED_LIST_OUT_OUT NUM_ENABLED_OUT_OUT - ) - set(ENABLED_LIST_OUT) - foreach(ENTITY ${${LISTVAR}}) - set(ENTITY_NAME ${ENABLED_PREFIX}_ENABLE_${ENTITY}) - assert_defined(${ENTITY_NAME}) - set(INCLUDE_ENTITY FALSE) - if (${ENTITY_NAME}) - list(APPEND ENABLED_LIST_OUT ${ENTITY}) - endif() - endforeach() - list(LENGTH ENABLED_LIST_OUT NUM_ENABLED_OUT) - set(${ENABLED_LIST_OUT_OUT} ${ENABLED_LIST_OUT} PARENT_SCOPE) - if (NUM_ENABLED_OUT_OUT) - set(${NUM_ENABLED_OUT_OUT} ${NUM_ENABLED_OUT} PARENT_SCOPE) - endif() -endfunction() - - -# Get the list non-disabled entries -# -# These is the list of entries in ${LISTVAR} for which: -# -# if ( -# (${ENABLED_PREFIX}_ENABLE_{ENTRY}) -# OR -# (${ENABLED_PREFIX}_ENABLE_{ENTRY} STREQUAL "" ) -# ) -# -# evaluates to true. -# -function(tribits_get_nondisabled_list LISTVAR ENABLED_PREFIX - NONDISABLED_LIST_OUT_OUT NUM_NONDISABLED_OUT_OUT - ) - set(NONDISABLED_LIST_OUT) - foreach(ENTITY ${${LISTVAR}}) - set(ENTITY_NAME ${ENABLED_PREFIX}_ENABLE_${ENTITY}) - assert_defined(${ENTITY_NAME}) - set(INCLUDE_ENTITY FALSE) - if (${ENTITY_NAME} OR ${ENTITY_NAME} STREQUAL "") - list(APPEND NONDISABLED_LIST_OUT ${ENTITY}) - endif() - endforeach() - list(LENGTH NONDISABLED_LIST_OUT NUM_NONDISABLED_OUT) - set(${NONDISABLED_LIST_OUT_OUT} ${NONDISABLED_LIST_OUT} PARENT_SCOPE) - if (NUM_NONDISABLED_OUT_OUT) - set(${NUM_NONDISABLED_OUT_OUT} ${NUM_NONDISABLED_OUT} PARENT_SCOPE) - endif() -endfunction() - - -# Get the list of explicitly disabled entries -# -# These is the list of entries in ${LISTVAR} for which: -# -# if ( -# (NOT ${ENABLED_PREFIX}_ENABLE_{ENTRY}) -# AND -# (NOT ${ENABLED_PREFIX}_ENABLE_{ENTRY} STREQUAL "" ) -# ) -# -# evaluates to true. -# -function(tribits_get_disabled_list LISTVAR ENABLED_PREFIX - DISABLED_LIST_OUT_OUT NUM_DISABLED_OUT_OUT - ) - set(DISABLED_LIST_OUT) - foreach(ENTITY ${${LISTVAR}}) - set(ENTITY_NAME ${ENABLED_PREFIX}_ENABLE_${ENTITY}) - assert_defined(${ENTITY_NAME}) - set(INCLUDE_ENTITY FALSE) - if ( (NOT ${ENTITY_NAME}) AND (NOT ${ENTITY_NAME} STREQUAL "") ) - list(APPEND DISABLED_LIST_OUT ${ENTITY}) - endif() - endforeach() - list(LENGTH DISABLED_LIST_OUT NUM_DISABLED_OUT) - set(${DISABLED_LIST_OUT_OUT} ${DISABLED_LIST_OUT} PARENT_SCOPE) - if (NUM_DISABLED_OUT_OUT) - set(${NUM_DISABLED_OUT_OUT} ${NUM_DISABLED_OUT} PARENT_SCOPE) - endif() -endfunction() - - -# Get the list of non-enabled entries -# -# These is the list of entries in ${LISTVAR} for which: -# -# if (NOT ${ENABLED_PREFIX}_ENABLE_{ENTRY}) -# -# evaluates to true. -# -function(tribits_get_nonenabled_list LISTVAR ENABLED_PREFIX - NONENABLED_LIST_OUT_OUT NUM_NONENABLED_OUT_OUT - ) - set(NONENABLED_LIST_OUT) - foreach(ENTITY ${${LISTVAR}}) - set(ENTITY_NAME ${ENABLED_PREFIX}_ENABLE_${ENTITY}) - assert_defined(${ENTITY_NAME}) - set(INCLUDE_ENTITY FALSE) - if (NOT ${ENTITY_NAME}) # Note that empty "" is also false! - list(APPEND NONENABLED_LIST_OUT ${ENTITY}) - endif() - endforeach() - list(LENGTH NONENABLED_LIST_OUT NUM_NONENABLED_OUT) - set(${NONENABLED_LIST_OUT_OUT} ${NONENABLED_LIST_OUT} PARENT_SCOPE) - if (NUM_NONENABLED_OUT_OUT) - set(${NUM_NONENABLED_OUT_OUT} ${NUM_NONENABLED_OUT} PARENT_SCOPE) - endif() -endfunction() - - -# Macro that sets up the basic lists of enabled packages and packages. -# -macro(tribits_set_up_enabled_lists_and_pkg_idx) - - # ${PROJECT_NAME}_ENABLED_PACKAGES - tribits_get_enabled_list( - ${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES ${PROJECT_NAME} - ${PROJECT_NAME}_ENABLED_INTERNAL_TOPLEVEL_PACKAGES - ${PROJECT_NAME}_NUM_ENABLED_INTERNAL_TOPLEVEL_PACKAGES) - - # ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES - tribits_get_enabled_list( ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES ${PROJECT_NAME} - ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES - ${PROJECT_NAME}_NUM_ENABLED_INTERNAL_PACKAGES) - - # ${PROJECT_NAME}_REVERSE_ENABLED_INTERNAL_PACKAGES - set(${PROJECT_NAME}_REVERSE_ENABLED_INTERNAL_PACKAGES - "${${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES}") - list(REVERSE ${PROJECT_NAME}_REVERSE_ENABLED_INTERNAL_PACKAGES) - - # ${PACKAGE_NAME}_PKG_IDX - set(PKG_IDX 0) - foreach(tribitsPackage ${${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES}) - set(${tribitsPackage}_PKG_IDX ${PKG_IDX}) - math(EXPR PKG_IDX "${PKG_IDX} + 1") - endforeach() - - # ${PROJECT_NAME}_ENABLED_TPLS - tribits_get_enabled_list( ${PROJECT_NAME}_DEFINED_TPLS TPL - ${PROJECT_NAME}_ENABLED_TPLS ${PROJECT_NAME}_NUM_ENABLED_TPLS) - - # ${PROJECT_NAME}_REVERSE_ENABLED_TPLS - set(${PROJECT_NAME}_REVERSE_ENABLED_TPLS - "${${PROJECT_NAME}_ENABLED_TPLS}") - list(REVERSE ${PROJECT_NAME}_REVERSE_ENABLED_TPLS) - -endmacro() - - # @FUNCTION: tribits_set_st_for_dev_mode() # # Function that allows packages to easily make a feature ``ST`` for @@ -337,47 +180,12 @@ endfunction() # For backward compatibility macro(tribits_set_ss_for_dev_mode OUTPUT_VAR) - message(WARNING - "WARNING: tribits_set_ss_for_dev_mode() is deprecated," - " use tribits_set_st_for_dev_mode() instead!") + tribits_deprecated_command(tribits_set_ss_for_dev_mode + MESSAGE "Use tribits_set_st_for_dev_mode() instead.") tribits_set_st_for_dev_mode(${OUTPUT_VAR}) endmacro() -# Function that extracts all of the required and optional -# items for a given class of package lists -# -function( tribits_gather_enabled_items PACKAGE_NAME LISTTYPE_PREFIX - LISTTYPE_POSTFIX GATHERED_ITEMS_LIST_OUT - ) - - #message("TRIBITS_GATHER_ENABLED_ITEMS: '${PACKAGE_NAME}' '${LISTTYPE_PREFIX}'" - # " '${LISTTYPE_POSTFIX}' '${GATHERED_ITEMS_LIST_OUT}'") - - set(GATHERED_ITEMS_LIST_TMP - ${${PACKAGE_NAME}_${LISTTYPE_PREFIX}_REQUIRED_DEP_${LISTTYPE_POSTFIX}} - ) - - #message("TRIBITS_GATHER_ENABLED_ITEMS:" - # " ${PACKAGE_NAME}_${LISTTYPE_PREFIX}_REQUIRED_DEP_${LISTTYPE_POSTFIX} = ${GATHERED_ITEMS_LIST_TMP}") - - foreach(ITEM - ${${PACKAGE_NAME}_${LISTTYPE_PREFIX}_OPTIONAL_DEP_${LISTTYPE_POSTFIX}} - ) - assert_defined(${PACKAGE_NAME}_ENABLE_${ITEM}) - if (${PACKAGE_NAME}_ENABLE_${ITEM}) - append_set(GATHERED_ITEMS_LIST_TMP ${ITEM}) - endif() - endforeach() - - #message("TRIBITS_GATHER_ENABLED_ITEMS:" - # " ${GATHERED_ITEMS_LIST_OUT} = ${GATHERED_ITEMS_LIST_TMP}") - - set(${GATHERED_ITEMS_LIST_OUT} ${GATHERED_ITEMS_LIST_TMP} PARENT_SCOPE) - -endfunction() - - # @FUNCTION: tribits_trace_file_processing() # # Print trace of file processing when diff --git a/cmake/tribits/core/package_arch/TribitsGetEnabledSublists.cmake b/cmake/tribits/core/package_arch/TribitsGetEnabledSublists.cmake new file mode 100644 index 000000000000..0444ba3dde25 --- /dev/null +++ b/cmake/tribits/core/package_arch/TribitsGetEnabledSublists.cmake @@ -0,0 +1,163 @@ +# @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(TribitsGetPackageEnableStatus) + + +# @FUNCTION: tribits_get_sublist_enabled() +# +# Get sub-list of enabled packages +# +# Usage:: +# +# tribits_get_sublist_enabled( +# ) +# +# On output, ```` contains the sublist of entries in +# ```` which evaluate to ``TRUE`` in an ``if ()`` statement. +# +function(tribits_get_sublist_enabled enableListName + enabledSublistNameOut numEnabledVarOut + ) + set(enabledSublist) + foreach(pkgName IN LISTS ${enableListName}) + tribits_get_package_enable_status(${pkgName} enableVal "") + if (enableVal) + list(APPEND enabledSublist ${pkgName}) + endif() + endforeach() + list(LENGTH enabledSublist numEnabled) + set(${enabledSublistNameOut} ${enabledSublist} PARENT_SCOPE) + if (numEnabledVarOut) + set(${numEnabledVarOut} ${numEnabled} PARENT_SCOPE) + endif() +endfunction() + + +# @FUNCTION: tribits_get_sublist_nondisabled() +# +# Get sub-list of non-disabled packages +# +# Usage:: +# +# tribits_get_sublist_nondisabled( +# ) +# +# On output, ```` contains the sublist of entries from +# ```` for which evaluate to ``TRUE`` or empty ``""`` in an +# ``if ()`` statement. +# +function(tribits_get_sublist_nondisabled enableListName + nondisabledListNameOut numNondisabledVarOut + ) + set(nondisabledList "") + foreach(pkgName IN LISTS ${enableListName}) + tribits_get_package_enable_status(${pkgName} enableVal "") + if (enableVal OR "${enableVal}" STREQUAL "") + list(APPEND nondisabledList ${pkgName}) + endif() + endforeach() + list(LENGTH nondisabledList numNondisabled) + set(${nondisabledListNameOut} ${nondisabledList} PARENT_SCOPE) + if (numNondisabledVarOut) + set(${numNondisabledVarOut} ${numNondisabled} PARENT_SCOPE) + endif() +endfunction() + + +# @FUNCTION: tribits_get_sublist_disabled() +# +# Get sub-list of disabled packages +# +# Usage:: +# +# tribits_get_sublist_disabled( +# ) +# +# On output, ```` contains the sublist of entries +# ```` which evaluate to ``FALSE`` and is not empty ``""`` in +# an ``if ()`` statement. +# +function(tribits_get_sublist_disabled enableListName + disabledSublistNameOut numDisabledVarOut + ) + set(disabledSublist "") + foreach(pkgName IN LISTS ${enableListName}) + tribits_get_package_enable_status(${pkgName} enableVal "") + if ((NOT enableVal) AND (NOT "${enableVal}" STREQUAL "")) + list(APPEND disabledSublist ${pkgName}) + endif() + endforeach() + list(LENGTH disabledSublist numDisabled) + set(${disabledSublistNameOut} ${disabledSublist} PARENT_SCOPE) + if (numDisabledVarOut) + set(${numDisabledVarOut} ${numDisabled} PARENT_SCOPE) + endif() +endfunction() + + +# @FUNCTION: tribits_get_sublist_nonenabled() +# +# Get sub-list of non-enabled entries +# +# Usage:: +# +# tribits_get_sublist_nonenabled( +# ) +# +# On output, ```` contains the subset of entries in +# ```` that evaluate to ``FALSE`` (which can also be empty +# ``""``) in an ``if ()`` statement. +# +function(tribits_get_sublist_nonenabled enableListName + nonenabledListNameOut numNonenabledVarOut + ) + set(nonenabledList "") + foreach(pkgName IN LISTS ${enableListName}) + tribits_get_package_enable_status(${pkgName} enableVal "") + if (NOT enableVal) + list(APPEND nonenabledList ${pkgName}) + endif() + endforeach() + list(LENGTH nonenabledList numNonenabled) + set(${nonenabledListNameOut} ${nonenabledList} PARENT_SCOPE) + if (numNonenabledVarOut) + set(${numNonenabledVarOut} ${numNonenabled} PARENT_SCOPE) + endif() +endfunction() diff --git a/cmake/tribits/core/package_arch/TribitsGetPackageEnableStatus.cmake b/cmake/tribits/core/package_arch/TribitsGetPackageEnableStatus.cmake new file mode 100644 index 000000000000..3fac736a78cc --- /dev/null +++ b/cmake/tribits/core/package_arch/TribitsGetPackageEnableStatus.cmake @@ -0,0 +1,134 @@ +# @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 + + +# @FUNCTION: tribits_get_package_enable_status() +# +# Function that determines if a given external or internal package's enable +# status (e.g. 'ON' or 'OFF') +# +# Usage:: +# +# tribits_get_package_enable_status( +# ) +# +# On return, if non-empty, the variable ```` will contain +# the actual value of ``${${PROJECT_NAME}_ENABLE_}`` or +# ``${TPL_ENABLE_}`` or will return empty "". If +# ``${packageName}_PACKAGE_BUILD_STATUS == "INTERNAL", then only the value of +# ``${PROJECT_NAME}_ENABLE_`` will be considered. +# +# On return, if non-empty, the variable ```` will be +# either ``${${PROJECT_NAME}_ENABLE_}`` or +# ``${TPL_ENABLE_}``, depending on which one is used to obtain +# the value ````. +# +# This works for both external packages/TPLs and internal packages. +# +function(tribits_get_package_enable_status packageName packageEnableOut + packageEnableVarNameOut + ) + tribits_get_package_enable_status_assert_args("${packageName}" + "${packageEnableOut}" "${packageEnableVarNameOut}") + tribits_assert_package_enable_status(${packageName}) + # Determine which variable, if any, to extract enable status from + set(packageEnableVarName "") + if (${packageName}_PACKAGE_BUILD_STATUS STREQUAL "INTERNAL") + set(packageEnableVarName ${PROJECT_NAME}_ENABLE_${packageName}) + elseif (${packageName}_PACKAGE_BUILD_STATUS STREQUAL "EXTERNAL") + if (NOT "${TPL_ENABLE_${packageName}}" STREQUAL "") + set(packageEnableVarName TPL_ENABLE_${packageName}) + elseif (NOT "${${PROJECT_NAME}_ENABLE_${packageName}}" STREQUAL "") + set(packageEnableVarName ${PROJECT_NAME}_ENABLE_${packageName}) + else() + # If neither is set, select the default var TPL name + set(packageEnableVarName TPL_ENABLE_${packageName}) + endif() + endif() + if (packageEnableVarName) + set(packageEnable ${${packageEnableVarName}}) + else() + set(packageEnable "") + endif() + # Set output args + if (packageEnableOut) + set(${packageEnableOut} ${packageEnable} PARENT_SCOPE) + endif() + if (packageEnableVarNameOut) + set(${packageEnableVarNameOut} ${packageEnableVarName} PARENT_SCOPE) + endif() +endfunction() + + +# @FUNCTION: tribits_assert_package_enable_status() +# +# Function that asserts that if both ``${PROJECT_NAME}_ENABLE_${packageName}`` +# and ``TPL_ENABLE_${packageName}`` are both set to non-empty, then they must +# be the same value or this is an error. +# +# Usage:: +# +# tribits_assert_package_enable_status() +# +function(tribits_assert_package_enable_status packageName) + if ( (NOT "${${PROJECT_NAME}_ENABLE_${packageName}}" STREQUAL "") + AND (NOT "${TPL_ENABLE_${packageName}}" STREQUAL "") + AND (NOT "${${PROJECT_NAME}_ENABLE_${packageName}}" STREQUAL + "${TPL_ENABLE_${packageName}}") + ) + message(SEND_ERROR "Error, ${PROJECT_NAME}_ENABLE_${packageName}=" + "'${${PROJECT_NAME}_ENABLE_${packageName}}' !=" + " TPL_ENABLE_${packageName} = '${TPL_ENABLE_${packageName}}'") + endif() +endfunction() +# ToDo: Create a cache var for the mode of message() above in case the user +# wants to disable the warning. + + +function(tribits_get_package_enable_status_assert_args packageName packageEnableOut + packageEnableVarNameOut + ) + if ("${packageName}" STREQUAL "") + message(FATAL_ERROR "Error, packageName='' is not allowed!") + endif() + if ("${packageEnableOut}" STREQUAL "" AND "${packageEnableVarNameOut}" STREQUAL "") + message(FATAL_ERROR "Error, both packageEnableOut='' and" + " packageEnableVarNameOut='' is not allowed!") + endif() +endfunction() diff --git a/cmake/tribits/core/package_arch/TribitsGlobalMacros.cmake b/cmake/tribits/core/package_arch/TribitsGlobalMacros.cmake index ac994b29a2e9..7f452f338b7a 100644 --- a/cmake/tribits/core/package_arch/TribitsGlobalMacros.cmake +++ b/cmake/tribits/core/package_arch/TribitsGlobalMacros.cmake @@ -51,9 +51,11 @@ include(TribitsReportInvalidTribitsUsage) include(TribitsReadAllProjectDepsFilesCreateDepsGraph) include(TribitsAdjustPackageEnables) include(TribitsGitRepoVersionInfo) +include(TribitsSetUpEnabledOnlyDependencies) # Standard TriBITS utilities includes include(TribitsAddOptionAndDefine) +include(TribitsAddEnumCacheVar) include(AdvancedOption) include(AdvancedSet) include(AppendStringVar) @@ -69,6 +71,7 @@ include(Split) include(TimingUtils) include(SetDefaultAndFromEnv) # Used by some call-back files include(TribitsFilepathHelpers) +include(TribitsDeprecatedHelpers) # Standard CMake includes include(CheckIncludeFileCXX) @@ -717,22 +720,49 @@ macro(tribits_define_global_options_and_define_extra_repos) "Determines if a variety of development mode checks are turned on by default or not." ) - advanced_set( ${PROJECT_NAME}_ASSERT_MISSING_PACKAGES - ${${PROJECT_NAME}_ENABLE_DEVELOPMENT_MODE} - CACHE BOOL - "Determines if asserts are performed on missing packages or not." ) + if ("${${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_DEFAULT}" STREQUAL "") + if (${PROJECT_NAME}_ENABLE_DEVELOPMENT_MODE) + set(${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_DEFAULT FATAL_ERROR) + else() + set(${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_DEFAULT IGNORE) + endif() + endif() + set(${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_ERROR_VALUES_LIST + "FATAL_ERROR" "SEND_ERROR" ) + set(${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_VALUES_LIST + ${${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_ERROR_VALUES_LIST} + "WARNING" "NOTICE" "IGNORE" "OFF" ) + tribits_add_enum_cache_var( ${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES + DEFAULT_VAL ${${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_DEFAULT} + DOC_STRING + "Assert that all external and internal dependencies are defined in the project" + ALLOWED_STRINGS_LIST + ${${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_VALUES_LIST} + IS_ADVANCED ) + + if (NOT "${${PROJECT_NAME}_ASSERT_MISSING_PACKAGES}" STREQUAL "") + message(FATAL_ERROR "Error, ${PROJECT_NAME}_ASSERT_MISSING_PACKAGES=" + " '${${PROJECT_NAME}_ASSERT_MISSING_PACKAGES}' is set and is no" + " longer supported! Please set" + " ${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES=FATAL_ERROR instead!" ) + endif() if ("${${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE_DEFAULT}" STREQUAL "") if (${PROJECT_NAME}_ENABLE_DEVELOPMENT_MODE) - set(${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE_DEFAULT FATAL_ERROR) + set(${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE_DEFAULT FATAL_ERROR) else() - set(${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE_DEFAULT IGNORE) + set(${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE_DEFAULT IGNORE) endif() endif() - advanced_set( ${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE - "${${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE_DEFAULT}" - CACHE BOOL - "Assert correct usage of TriBITS. Value values include 'FATAL_ERROR', 'SEND_ERROR', 'WARNING', and 'IGNORE'. Default '${${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE_DEFAULT}' " ) + set(${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE_VALUES_LIST + "FATAL_ERROR" "SEND_ERROR" "WARNING" "IGNORE" "OFF") + tribits_add_enum_cache_var( ${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE + DEFAULT_VAL "${${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE_DEFAULT}" + DOC_STRING + "Assert correct usage of TriBITS" + ALLOWED_STRINGS_LIST + ${${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE_VALUES_LIST} + IS_ADVANCED ) advanced_set( ${PROJECT_NAME}_WARN_ABOUT_MISSING_EXTERNAL_PACKAGES FALSE CACHE BOOL @@ -929,6 +959,17 @@ macro(tribits_define_global_options_and_define_extra_repos) CACHE BOOL "Set to 'ON' to see the machine load for advanced tests." ) + if ("${TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE_DEFAULT}" STREQUAL "") + set(TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE_DEFAULT "DEPRECATION") + endif() + + tribits_add_enum_cache_var(TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE + DEFAULT_VAL "${TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE_DEFAULT}" + DOC_STRING "Mode for dealing with usage of TriBITS deprecated functionality" + ALLOWED_STRINGS_LIST ${TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE_ALL_VALID_VALUES} + IS_ADVANCED + ) + mark_as_advanced(BUILD_TESTING) mark_as_advanced(CMAKE_BACKWARDS_COMPATIBILITY) mark_as_advanced(DART_TESTING_TIMEOUT) @@ -2279,14 +2320,12 @@ macro(tribits_setup_packaging_and_distribution) # K.2) Removing any packages or packages not enabled from the tarball if (${PROJECT_NAME}_EXCLUDE_DISABLED_SUBPACKAGES_FROM_DISTRIBUTION) - set(tribitsPackage ${${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES}) + set(tribitsPackageList ${${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES}) else() - set(tribitsPackage ${${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES}) + set(tribitsPackageList ${${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES}) endif() - tribits_get_nonenabled_list( - tribitsPackage ${PROJECT_NAME} - nonEnabledTribitsPackage "") + tribits_get_sublist_nonenabled(tribitsPackageList nonEnabledTribitsPackage "") foreach(TRIBITS_PACKAGE ${nonEnabledTribitsPackage}) @@ -2345,18 +2384,18 @@ macro(tribits_setup_packaging_and_distribution) # K.3) Set up install component dependencies - tribits_get_enabled_list( - ${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES ${PROJECT_NAME} - ENABLED_PACKAGES NUM_ENABLED) - #message("ENABLED PACKAGES: ${ENABLED_PACKAGES} ${NUM_ENABLED}") - - foreach(PKG ${ENABLED_PACKAGES}) - if(NOT "${${PKG}_LIB_REQUIRED_DEP_PACKAGES}" STREQUAL "") - string(TOUPPER ${PKG} UPPER_PKG) - #message("${UPPER_PKG} depends on : ${${PKG}_LIB_REQUIRED_DEP_PACKAGES}") - set(CPACK_COMPONENT_${UPPER_PKG}_DEPENDS ${${PKG}_LIB_REQUIRED_DEP_PACKAGES}) + 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() - #message("${PKG} depends on : ${${PKG}_LIB_REQUIRED_DEP_PACKAGES}") endforeach() # K.4) Resetting the name to avoid overwriting registry keys when installing diff --git a/cmake/tribits/core/package_arch/TribitsIncludeDirectories.cmake b/cmake/tribits/core/package_arch/TribitsIncludeDirectories.cmake index 3f90fc873d69..e288094953e2 100644 --- a/cmake/tribits/core/package_arch/TribitsIncludeDirectories.cmake +++ b/cmake/tribits/core/package_arch/TribitsIncludeDirectories.cmake @@ -38,18 +38,19 @@ # @HEADER include(CMakeParseArguments) +include(TribitsDeprecatedHelpers) # @MACRO: tribits_include_directories() # -# This function is to override the standard behavior of the built-in CMake -# ``include_directories()`` command. +# This function overrides the standard behavior of the built-in CMake +# ``include_directories()`` command for special behavior for installation +# testing. # # Usage:: # # tribits_include_directories( -# [REQUIRED_DURING_INSTALLATION_TESTING] ... -# ) +# [REQUIRED_DURING_INSTALLATION_TESTING] ... ) # # If specified, ``REQUIRED_DURING_INSTALLATION_TESTING`` can appear anywhere # in the argument list. @@ -61,10 +62,10 @@ include(CMakeParseArguments) # Testing`_). Normally we want the include directories to be handled as cmake # usually does. However during TriBITS installation testing we do not want # most of the include directories to be used as the majority of the files -# should come from the installation we are building against. There is an -# exception to this and that is when there are test only headers that are -# needed. For that case ``REQUIRED_DURING_INSTALLATION_TESTING`` must be -# passed in to ensure the include paths are added for installation testing. +# should come from the installation we are building against. The exception is +# when there are test only headers that are needed. For that case +# ``REQUIRED_DURING_INSTALLATION_TESTING`` must be passed in to ensure the +# include paths are added for installation testing. # macro(tribits_include_directories) @@ -80,16 +81,32 @@ macro(tribits_include_directories) ${ARGN} ) - if(NOT ${PROJECT_NAME}_ENABLE_INSTALLATION_TESTING OR PARSE_REQUIRED_DURING_INSTALLATION_TESTING) - _include_directories(${PARSE_UNPARSED_ARGUMENTS}) + if(NOT ${PROJECT_NAME}_ENABLE_INSTALLATION_TESTING + OR PARSE_REQUIRED_DURING_INSTALLATION_TESTING + ) + if (TRIBITS_HIDE_DEPRECATED_INCLUDE_DIRECTORIES_OVERRIDE) + include_directories(${PARSE_UNPARSED_ARGUMENTS}) + else() + _include_directories(${PARSE_UNPARSED_ARGUMENTS}) + endif() endif() endmacro() +if (NOT TRIBITS_HIDE_DEPRECATED_INCLUDE_DIRECTORIES_OVERRIDE) + # Deprecated. Use tribits_include_directories() instead! +# +# To hide this macro from even being defined, set +# ``TRIBITS_HIDE_DEPRECATED_INCLUDE_DIRECTORIES_OVERRIDE=TRUE``. +# macro(include_directories) - cmake_parse_arguments( + tribits_deprecated_command(include_directories + MESSAGE "Use tribits_include_directories() instead." + ) + + cmake_parse_arguments( #prefix PARSE #options @@ -101,12 +118,11 @@ macro(include_directories) ${ARGN} ) -# if (PARSE_REQUIRED_DURING_INSTALLATION_TESTING) -# message(WARNING "Warning: the override include_directories() is deprecated," -# " use tribits_include_directories() instead!") -# endif() - - if(NOT ${PROJECT_NAME}_ENABLE_INSTALLATION_TESTING OR PARSE_REQUIRED_DURING_INSTALLATION_TESTING) + if(NOT ${PROJECT_NAME}_ENABLE_INSTALLATION_TESTING + OR PARSE_REQUIRED_DURING_INSTALLATION_TESTING + ) _include_directories(${PARSE_UNPARSED_ARGUMENTS}) endif() endmacro() + +endif (NOT TRIBITS_HIDE_DEPRECATED_INCLUDE_DIRECTORIES_OVERRIDE) diff --git a/cmake/tribits/core/package_arch/TribitsListHelpers.cmake b/cmake/tribits/core/package_arch/TribitsListHelpers.cmake index 92184a2520e6..69ade415d655 100644 --- a/cmake/tribits/core/package_arch/TribitsListHelpers.cmake +++ b/cmake/tribits/core/package_arch/TribitsListHelpers.cmake @@ -39,6 +39,7 @@ include(TribitsHostType) +include(TribitsDeprecatedHelpers) # @@ -120,8 +121,8 @@ endmacro() macro( package_disable_on_platforms PACKAGE_NAME_IN_ ) - message(WARNING "package_disable_on_platforms() is deprecated!" - " Use tribits_disable_package_on_platforms() instead!") + tribits_deprecated_command(package_disable_on_platforms + MESSAGE "Use tribits_disable_package_on_platforms() instead!") tribits_disable_package_on_platforms(${PACKAGE_NAME_IN_} ${ARGN}) endmacro() @@ -136,19 +137,19 @@ function(tribits_update_ps_pt_ss_st THING_TYPE THING_NAME TESTGROUP_VAR) if (TESTGROUP_IN STREQUAL PS) if (${PROJECT_NAME}_VERBOSE_CONFIGURE) - message("-- " "WARNING: ${THING_TYPE} ${THING_NAME} TESTGROUP 'PS' is deprecated." + tribits_deprecated("${THING_TYPE} ${THING_NAME} TESTGROUP 'PS' is deprecated." " Use 'PT' instead!") endif() set(TESTGROUP_OUT PT) elseif (TESTGROUP_IN STREQUAL SS) if (${PROJECT_NAME}_VERBOSE_CONFIGURE) - message("-- " "WARNING: ${THING_TYPE} ${THING_NAME} TESTGROUP 'SS' is deprecated." + tribits_deprecated("${THING_TYPE} ${THING_NAME} TESTGROUP 'SS' is deprecated." " Use 'ST' instead!") endif() set(TESTGROUP_OUT ST) elseif (TESTGROUP_IN STREQUAL TS) if (${PROJECT_NAME}_VERBOSE_CONFIGURE) - message("-- " "WARNING: ${THING_TYPE} ${THING_NAME} TESTGROUP 'TS' is deprecated." + tribits_deprecated("${THING_TYPE} ${THING_NAME} TESTGROUP 'TS' is deprecated." " Use 'TT' instead!") endif() set(TESTGROUP_OUT TT) diff --git a/cmake/tribits/core/package_arch/TribitsPackageDependencies.cmake b/cmake/tribits/core/package_arch/TribitsPackageDependencies.cmake index 416b03d7fddf..0f4a956dd783 100644 --- a/cmake/tribits/core/package_arch/TribitsPackageDependencies.cmake +++ b/cmake/tribits/core/package_arch/TribitsPackageDependencies.cmake @@ -123,13 +123,14 @@ endmacro() # Takes the list ``_LIB_DEFINED_DEPENDENCIES`` and sets the # default entries of the non-cache var # ``_LIB_ENABLED_DEPENDENCIES``. However, if -# ``${_LIB_DEFINED_DEPENDENCIES}`` is non-empty when this macro -# is called, then it will not be changed. That allows the user to override -# the list of enabled TPL dependencies in the cache. This also sets the -# non-cache vars ``_ENABLE_=ON`` for each -# enabled package listed in ``_LIB_ENABLED_DEPENDENCIES`` and -# to ``OFF`` for each ```` listed in -# ``_LIB_ENABLED_DEPENDENCIES`` but not in +# ``${_LIB_ENABLED_DEPENDENCIES`` is non-empty when this +# macro is called, then it will not be changed. That allows the user to +# override the list of enabled TPL dependencies in the cache. This also sets +# the non-cache vars ``_ENABLE_=ON`` for +# each enabled package listed in +# ``_LIB_ENABLED_DEPENDENCIES`` and to ``OFF`` for each +# ```` listed in +# ``_LIB_DEFINED_DEPENDENCIES`` but not in # ``_LIB_ENABLED_DEPENDENCIES``. # macro(tribits_extpkg_setup_enabled_dependencies externalPkgName) @@ -149,7 +150,7 @@ macro(tribits_extpkg_setup_enabled_dependencies externalPkgName) endif() if ("${${externalPkgName}_LIB_ENABLED_DEPENDENCIES}" STREQUAL "") - # Only set of not already set as a cache var, for example + # Only set of not already set as a cache var, for example, by the user set(${externalPkgName}_LIB_ENABLED_DEPENDENCIES ${libEnabledDependencies}) endif() diff --git a/cmake/tribits/core/package_arch/TribitsPackageMacros.cmake b/cmake/tribits/core/package_arch/TribitsPackageMacros.cmake index 8a0475f6746e..a0c53f5129fe 100644 --- a/cmake/tribits/core/package_arch/TribitsPackageMacros.cmake +++ b/cmake/tribits/core/package_arch/TribitsPackageMacros.cmake @@ -545,10 +545,7 @@ endmacro() # up example directories any way one would like. # # Currently, all it does macro does is to call ``add_subdirectory()`` if -# ``${PACKAGE_NAME}_ENABLE_EXAMPLES`` or -# ``${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES`` are true. However, this macro may -# be extended in the future in order to modify behavior related to adding -# tests and examples in a uniform way. +# `${PACKAGE_NAME}_ENABLE_EXAMPLES`_ ``= TRUE``. # macro(tribits_add_example_directories) diff --git a/cmake/tribits/core/package_arch/TribitsPkgExportCacheVars.cmake b/cmake/tribits/core/package_arch/TribitsPkgExportCacheVars.cmake index 6fb85e0ef8de..9380cebe1dd9 100644 --- a/cmake/tribits/core/package_arch/TribitsPkgExportCacheVars.cmake +++ b/cmake/tribits/core/package_arch/TribitsPkgExportCacheVars.cmake @@ -122,7 +122,7 @@ function(tribits_pkg_append_set_commands_for_exported_vars packageName endforeach() endif() foreach(exportedCacheVar IN LISTS ${packageName}_PKG_VARS_TO_EXPORT) - tribits_assert_cache_and_local_vars_same_value(${exportedCacheVar}) + #tribits_assert_cache_and_local_vars_same_value(${exportedCacheVar}) string(APPEND configFileStr "set(${exportedCacheVar} \"${${exportedCacheVar}}\")\n") endforeach() diff --git a/cmake/tribits/core/package_arch/TribitsPrintDependencyInfo.cmake b/cmake/tribits/core/package_arch/TribitsPrintDependencyInfo.cmake index 143610266c51..2b96e2f74175 100644 --- a/cmake/tribits/core/package_arch/TribitsPrintDependencyInfo.cmake +++ b/cmake/tribits/core/package_arch/TribitsPrintDependencyInfo.cmake @@ -114,7 +114,7 @@ function(tribits_dump_package_dependencies_info) if (${PROJECT_NAME}_DUMP_PACKAGE_DEPENDENCIES) message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES}) + foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_DEFINED_PACKAGES}) tribits_print_package_dependencies(${TRIBITS_PACKAGE}) message("") endforeach() @@ -123,6 +123,9 @@ function(tribits_dump_package_dependencies_info) endfunction() +# Optionally print out a global project list var with spaces and +# unconditionally print out the number of items in that list +# function(tribits_print_project_list_var_and_num listVarSuffix) message("") if (${PROJECT_NAME}_DUMP_PACKAGE_DEPENDENCIES) @@ -132,4 +135,101 @@ function(tribits_print_project_list_var_and_num listVarSuffix) endfunction() +# Print out dependencies for a package +# +function(tribits_print_package_dependencies packageName) + + set(printedVar "") + + # Print deps vars + + if (printedVar) + message("") + endif() + + tribits_print_nonempty_package_deps_list(${packageName} LIB DEFINED printedVar) + tribits_print_nonempty_package_deps_list(${packageName} TEST DEFINED printedVar) + + if (${PROJECT_NAME}_DUMP_FORWARD_PACKAGE_DEPENDENCIES) + tribits_print_nonempty_package_forward_defined_deps_list(${packageName} LIB + printedVar) + tribits_print_nonempty_package_forward_defined_deps_list(${packageName} TEST + printedVar) + endif() + + if (NOT printedVar) + message("-- ${packageName}: No defined dependencies!") + endif() + +endfunction() + + +# Print out a dependency list including if each item is optional or required +# ('R' or 'O') +# +# Usage:: +# +# tribits_print_nonempty_package_deps_list( +# ) +# +# which prints out the list:: +# +# __DEFINED_DEPENDENCIES +# +# if it is non-empty. +# +function(tribits_print_nonempty_package_deps_list packageName + libOrTest definedOrEnabled printedListOut + ) + set(depsListName ${packageName}_${libOrTest}_${definedOrEnabled}_DEPENDENCIES) + if (NOT "${${depsListName}}" STREQUAL "") + set(lineStr "-- ${depsListName}:") + foreach (depPkg IN LISTS ${depsListName}) + string(APPEND lineStr " ${depPkg}") + if (${packageName}_${libOrTest}_DEP_REQUIRED_${depPkg}) + string(APPEND lineStr "[R]") + else() + string(APPEND lineStr "[O]") + endif() + endforeach() + message("${lineStr}") + set(${printedListOut} TRUE PARENT_SCOPE) + endif() +endfunction() + + +# Print out a forward dependency list including if each item is optional or +# required ('R' or 'O') +# +# Usage:: +# +# tribits_print_nonempty_package_forward_defined_deps_list( +# ) +# +# which prints out the list:: +# +# _FORWARD__DEFINED_DEPENDENCIES +# +# if it is non-empty. +# +function(tribits_print_nonempty_package_forward_defined_deps_list packageName + libOrTest printedListOut + ) + set(fwdDepsListName ${packageName}_FORWARD_${libOrTest}_DEFINED_DEPENDENCIES) + if (NOT "${${fwdDepsListName}}" STREQUAL "") + set(lineStr "-- ${fwdDepsListName}:") + foreach (fwdDepPkg IN LISTS ${fwdDepsListName}) + string(APPEND lineStr " ${fwdDepPkg}") + if (${fwdDepPkg}_${libOrTest}_DEP_REQUIRED_${packageName}) + string(APPEND lineStr "[R]") + else() + string(APPEND lineStr "[O]") + endif() + endforeach() + message("${lineStr}") + set(${printedListOut} TRUE PARENT_SCOPE) + endif() +endfunction() + + # LocalWords: TRIBITS diff --git a/cmake/tribits/core/package_arch/TribitsPrintEnabledPackagesLists.cmake b/cmake/tribits/core/package_arch/TribitsPrintEnabledPackagesLists.cmake index 547c9a9f60e9..b49d96372bfc 100644 --- a/cmake/tribits/core/package_arch/TribitsPrintEnabledPackagesLists.cmake +++ b/cmake/tribits/core/package_arch/TribitsPrintEnabledPackagesLists.cmake @@ -37,6 +37,8 @@ # ************************************************************************ # @HEADER +include(TribitsGetEnabledSublists) + # @FUNCTION: tribits_print_enables_before_adjust_package_enables() # @@ -107,20 +109,20 @@ function(tribits_print_internal_package_list_enable_status DOCSTRING ENABLED_FLAG INCLUDE_EMPTY ) if (ENABLED_FLAG AND NOT INCLUDE_EMPTY) - tribits_get_enabled_list( - ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES ${PROJECT_NAME} + tribits_get_sublist_enabled( + ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES internalPackagesEnableStatusList "") elseif (ENABLED_FLAG AND INCLUDE_EMPTY) - tribits_get_nondisabled_list( + tribits_get_sublist_nondisabled( ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES ${PROJECT_NAME} internalPackagesEnableStatusList "") elseif (NOT ENABLED_FLAG AND NOT INCLUDE_EMPTY) - tribits_get_disabled_list( - ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES ${PROJECT_NAME} + tribits_get_sublist_disabled( + ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES internalPackagesEnableStatusList "") else() # NOT ENABLED_FLAG AND INCLUDE_EMPTY - tribits_get_nonenabled_list( - ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES ${PROJECT_NAME} + tribits_get_sublist_nonenabled( + ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES internalPackagesEnableStatusList "") endif() tribits_print_prefix_string_and_list("${DOCSTRING}" @@ -132,16 +134,16 @@ endfunction() # function(tribits_print_tpl_list_enable_status DOCSTRING ENABLED_FLAG INCLUDE_EMPTY) if (ENABLED_FLAG AND NOT INCLUDE_EMPTY) - tribits_get_enabled_list( ${PROJECT_NAME}_DEFINED_TPLS TPL + tribits_get_sublist_enabled( ${PROJECT_NAME}_DEFINED_TPLS tplsEnableStatusList "") elseif (ENABLED_FLAG AND INCLUDE_EMPTY) - tribits_get_nondisabled_list( ${PROJECT_NAME}_DEFINED_TPLS TPL + tribits_get_sublist_nondisabled( ${PROJECT_NAME}_DEFINED_TPLS tplsEnableStatusList "") elseif (NOT ENABLED_FLAG AND NOT INCLUDE_EMPTY) - tribits_get_disabled_list( ${PROJECT_NAME}_DEFINED_TPLS TPL + tribits_get_sublist_disabled( ${PROJECT_NAME}_DEFINED_TPLS tplsEnableStatusList "") else() # NOT ENABLED_FLAG AND INCLUDE_EMPTY - tribits_get_nonenabled_list( ${PROJECT_NAME}_DEFINED_TPLS TPL + tribits_get_sublist_nonenabled( ${PROJECT_NAME}_DEFINED_TPLS tplsEnableStatusList "") endif() tribits_print_prefix_string_and_list("${DOCSTRING}" "${tplsEnableStatusList}") @@ -155,16 +157,15 @@ function(tribits_print_packages_list_enable_status_from_var PACKAGES_LIST_VAR DOCSTRING ENABLED_FLAG INCLUDE_EMPTY ) if (ENABLED_FLAG AND NOT INCLUDE_EMPTY) - tribits_get_enabled_list(${PACKAGES_LIST_VAR} ${PROJECT_NAME} + tribits_get_sublist_enabled(${PACKAGES_LIST_VAR} enableStatusList "") elseif (ENABLED_FLAG AND INCLUDE_EMPTY) - tribits_get_nondisabled_list(${PACKAGES_LIST_VAR} ${PROJECT_NAME} - enableStatusList "") + tribits_get_sublist_nondisabled(${PACKAGES_LIST_VAR} enableStatusList "") elseif (NOT ENABLED_FLAG AND NOT INCLUDE_EMPTY) - tribits_get_disabled_list(${PACKAGES_LIST_VAR} ${PROJECT_NAME} + tribits_get_sublist_disabled(${PACKAGES_LIST_VAR} enableStatusList "") else() # NOT ENABLED_FLAG AND INCLUDE_EMPTY - tribits_get_nonenabled_list(${PACKAGES_LIST_VAR} ${PROJECT_NAME} + tribits_get_sublist_nonenabled(${PACKAGES_LIST_VAR} enableStatusList "") endif() tribits_print_prefix_string_and_list("${DOCSTRING}" "${enableStatusList}") diff --git a/cmake/tribits/core/package_arch/TribitsProcessEnabledTpl.cmake b/cmake/tribits/core/package_arch/TribitsProcessEnabledTpl.cmake index dcdde4ce6349..f6925f2081ff 100644 --- a/cmake/tribits/core/package_arch/TribitsProcessEnabledTpl.cmake +++ b/cmake/tribits/core/package_arch/TribitsProcessEnabledTpl.cmake @@ -57,9 +57,9 @@ function(tribits_process_enabled_tpl TPL_NAME) # Setup the processing string set(PROCESSING_MSG_STRING "Processing enabled external package/TPL: ${TPL_NAME} (") - if (TPL_${TPL_NAME}_ENABLING_PKG) + if (${TPL_NAME}_ENABLING_PKG) string(APPEND PROCESSING_MSG_STRING - "enabled by ${TPL_${TPL_NAME}_ENABLING_PKG}," ) + "enabled by ${${TPL_NAME}_ENABLING_PKG}," ) else() string(APPEND PROCESSING_MSG_STRING "enabled explicitly," ) @@ -121,14 +121,14 @@ function(tribits_process_enabled_tpl TPL_NAME) " which is pointed to in the file:\n" " ${${TPL_NAME}_TPLS_LIST_FILE}\n" ) - if (TPL_${TPL_NAME}_ENABLING_PKG) + if (${TPL_NAME}_ENABLING_PKG) message( "TIP: One way to get past the configure failure for the\n" "TPL '${TPL_NAME}' is to simply disable it with:\n" " -DTPL_ENABLE_${TPL_NAME}=OFF\n" "which will disable it and will recursively disable all of the\n" "downstream packages that have required dependencies on it, including\n" - "the package '${TPL_${TPL_NAME}_ENABLING_PKG}' which triggered its enable.\n" + "the package '${${TPL_NAME}_ENABLING_PKG}' which triggered its enable.\n" "When you reconfigure, just grep the cmake stdout for '${TPL_NAME}'\n" "and then follow the disables that occur as a result to see what impact\n" "this TPL disable has on the configuration of ${PROJECT_NAME}.\n" diff --git a/cmake/tribits/core/package_arch/TribitsProcessPackagesAndDirsLists.cmake b/cmake/tribits/core/package_arch/TribitsProcessPackagesAndDirsLists.cmake index 35a5d46b4864..d045fdedfaaa 100644 --- a/cmake/tribits/core/package_arch/TribitsProcessPackagesAndDirsLists.cmake +++ b/cmake/tribits/core/package_arch/TribitsProcessPackagesAndDirsLists.cmake @@ -334,29 +334,32 @@ function(tribits_is_primary_meta_project_package PACKAGE_NAME_IN endfunction() -# Function that determines if it is okay to allow an implicit package enable -# based on its classification. +# Function that determines if it is okay to allow an implicit enable of an +# upstream package given the disable of a downstream package that depends on +# it. # -function(tribits_implicit_package_enable_is_allowed UPSTREAM_PACKAGE_NAME_IN - PACKAGE_NAME_IN IMPLICIT_PACKAGE_ENABLE_ALLOWED_OUT +function(tribits_implicit_package_enable_is_allowed upstreamPackageName + packageName implictPackageEnableAllowedOut ) - if (${PACKAGE_NAME_IN}_TESTGROUP STREQUAL PT) - set(IMPLICIT_PACKAGE_ENABLE_ALLOWED TRUE) - elseif (${PACKAGE_NAME_IN}_TESTGROUP STREQUAL ST - AND ${PROJECT_NAME}_ENABLE_SECONDARY_TESTED_CODE + if (${packageName}_PACKAGE_BUILD_STATUS STREQUAL "EXTERNAL") + set(implicitPackageEnableAllowed FALSE) + elseif (${packageName}_TESTGROUP STREQUAL "PT") + set(implicitPackageEnableAllowed TRUE) + elseif (${packageName}_TESTGROUP STREQUAL "ST" + AND ${PROJECT_NAME}_ENABLE_SECONDARY_TESTED_CODE ) - set(IMPLICIT_PACKAGE_ENABLE_ALLOWED TRUE) + set(implicitPackageEnableAllowed TRUE) else() - if (UPSTREAM_PACKAGE_NAME_IN) - message("-- " "NOTE: Not Setting ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME_IN}=ON" - " even though ${UPSTREAM_PACKAGE_NAME_IN} has an optional dependence on" - " ${PACKAGE_NAME_IN} because ${PROJECT_NAME}_ENABLE_SECONDARY_TESTED_CODE=OFF" ) + if (upstreamPackageName) + message("-- " "NOTE: Not Setting ${PROJECT_NAME}_ENABLE_${packageName}=ON" + " even though ${upstreamPackageName} has an optional dependence on" + " ${packageName} because ${PROJECT_NAME}_ENABLE_SECONDARY_TESTED_CODE=OFF" ) endif() - set(IMPLICIT_PACKAGE_ENABLE_ALLOWED FALSE) + set(implicitPackageEnableAllowed FALSE) endif() - set(${IMPLICIT_PACKAGE_ENABLE_ALLOWED_OUT} ${IMPLICIT_PACKAGE_ENABLE_ALLOWED} + set(${implictPackageEnableAllowedOut} "${implicitPackageEnableAllowed}" PARENT_SCOPE ) endfunction() @@ -378,7 +381,6 @@ endfunction() # * `${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES`_ # * `${PROJECT_NAME}_NUM_DEFINED_INTERNAL_TOPLEVEL_PACKAGES`_ # * ``${PROJECT_NAME}_LAST_DEFINED_INTERNAL_TOPLEVEL_PACKAGE_IDX`` -# * ``${PROJECT_NAME}_REVERSE_DEFINED_INTERNAL_TOPLEVEL_PACKAGES`` # # For each of the listed top-level (parent) packages ${PACKAGE_NAME}, it also # sets up constant variables defined in `TriBITS Package Top-Level Local @@ -386,12 +388,15 @@ endfunction() # # * `${PACKAGE_NAME}_SOURCE_DIR`_ # * `${PACKAGE_NAME}_REL_SOURCE_DIR`_ +# * `${PACKAGE_NAME}_PARENT_PACKAGE`_ (to empty "") +# * `${PACKAGE_NAME}_PARENT_REPOSITORY`_ (to empty "") # * `${PACKAGE_NAME}_TESTGROUP`_ +# * `${PACKAGE_NAME}_PACKAGE_BUILD_STATUS`_ (to ``INTERNAL``) # # and sets up some standard enable/disable vars with default values as defined -# in `TriBITS Package Cache Variables`_ like:: +# in `TriBITS Package Cache Variables`_ like: # -# ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME} +# * `${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}`_ # # NOTE: Set ``TRIBITS_PROCESS_PACKAGES_AND_DIRS_LISTS_VERBOSE=TRUE`` to see # really verbose debug output from this macro. @@ -541,11 +546,12 @@ macro(tribits_process_packages_and_dirs_lists REPOSITORY_NAME REPOSITORY_DIR) print_var(REPOSITORY_AND_PACKAGE_DIR) print_var(PACKAGE_ABS_DIR) print_var(PACKAGE_EXISTS) - print_var(${PROJECT_NAME}_ASSERT_MISSING_PACKAGES) + print_var(${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES) print_var(${TRIBITS_PACKAGE}_ALLOW_MISSING_EXTERNAL_PACKAGE) endif() - if (${PROJECT_NAME}_ASSERT_MISSING_PACKAGES + if (${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES IN_LIST + ${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_ERROR_VALUES_LIST AND NOT PACKAGE_EXISTS AND NOT ${TRIBITS_PACKAGE}_ALLOW_MISSING_EXTERNAL_PACKAGE ) @@ -558,15 +564,14 @@ macro(tribits_process_packages_and_dirs_lists REPOSITORY_NAME REPOSITORY_DIR) if (PACKAGE_EXISTS OR ${PROJECT_NAME}_IGNORE_PACKAGE_EXISTS_CHECK) list(APPEND ${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES ${TRIBITS_PACKAGE}) - tribits_insert_standard_package_options(${TRIBITS_PACKAGE} - ${PACKAGE_TESTGROUP}) - set(${TRIBITS_PACKAGE}_PACKAGE_BUILD_STATUS INTERNAL) set(${TRIBITS_PACKAGE}_SOURCE_DIR "${PROJECT_SOURCE_DIR}/${REPOSITORY_AND_PACKAGE_DIR}") set(${TRIBITS_PACKAGE}_REL_SOURCE_DIR "${REPOSITORY_AND_PACKAGE_DIR}") set(${TRIBITS_PACKAGE}_PARENT_PACKAGE "") set(${TRIBITS_PACKAGE}_PARENT_REPOSITORY ${REPOSITORY_NAME}) + tribits_insert_standard_package_options(${TRIBITS_PACKAGE} ${PACKAGE_TESTGROUP}) + set(${TRIBITS_PACKAGE}_PACKAGE_BUILD_STATUS INTERNAL) else() if (${PROJECT_NAME}_VERBOSE_CONFIGURE) message( @@ -580,10 +585,14 @@ macro(tribits_process_packages_and_dirs_lists REPOSITORY_NAME REPOSITORY_DIR) # gets set to TRUE for some unit tests. Otherwise, in every legitimate # usage of this macro it is always FALSE. - if (TRIBITS_PROCESS_PACKAGES_AND_DIRS_LISTS_VERBOSE) + if (TRIBITS_PROCESS_PACKAGES_AND_DIRS_LISTS_VERBOSE + OR ${PROJECT_NAME}_VERBOSE_CONFIGURE + ) print_var(${TRIBITS_PACKAGE}_SOURCE_DIR) + print_var(${TRIBITS_PACKAGE}_REL_SOURCE_DIR) print_var(${TRIBITS_PACKAGE}_PARENT_PACKAGE) print_var(${TRIBITS_PACKAGE}_PARENT_REPOSITORY) + print_var(${TRIBITS_PACKAGE}_PACKAGE_BUILD_STATUS) endif() if (TRIBITS_PROCESS_PACKAGES_AND_DIRS_LISTS_VERBOSE) @@ -599,12 +608,6 @@ macro(tribits_process_packages_and_dirs_lists REPOSITORY_NAME REPOSITORY_DIR) math(EXPR ${PROJECT_NAME}_LAST_DEFINED_INTERNAL_TOPLEVEL_PACKAGE_IDX "${${PROJECT_NAME}_NUM_DEFINED_INTERNAL_TOPLEVEL_PACKAGES}-1") - # Create a reverse list for later use - - set(${PROJECT_NAME}_REVERSE_DEFINED_INTERNAL_TOPLEVEL_PACKAGES - ${${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES}) - list(REVERSE ${PROJECT_NAME}_REVERSE_DEFINED_INTERNAL_TOPLEVEL_PACKAGES) - else() set(${REPOSITORY_NAME}_NUM_DEFINED_INTERNAL_TOPLEVEL_PACKAGES 0) diff --git a/cmake/tribits/core/package_arch/TribitsProcessTplsLists.cmake b/cmake/tribits/core/package_arch/TribitsProcessTplsLists.cmake index 0a9c2ea486bd..611dcf3f73b2 100644 --- a/cmake/tribits/core/package_arch/TribitsProcessTplsLists.cmake +++ b/cmake/tribits/core/package_arch/TribitsProcessTplsLists.cmake @@ -138,6 +138,7 @@ endmacro() # * `${TPL_NAME}_TESTGROUP`_ # * `${TPL_NAME}_DEPENDENCIES_FILE`_ # * `${TPL_NAME}_TPLS_LIST_FILE`_ +# * `${TPL_NAME}_PACKAGE_BUILD_STATUS`_ (to ``EXTERNAL``) # # See `Function call tree for constructing package dependency graph`_ # @@ -216,10 +217,6 @@ macro(tribits_process_tpls_lists REPOSITORY_NAME REPOSITORY_DIR) list(APPEND ${PROJECT_NAME}_DEFINED_TPLS ${TPL_NAME}) endif() - # Set ${TPL_NAME}_PACKAGE_BUILD_STATUS - - set(${TPL_NAME}_PACKAGE_BUILD_STATUS EXTERNAL) - # Set ${TPL_NAME}_TESTGROUP if (TPL_TESTGROUP STREQUAL PT @@ -274,6 +271,10 @@ macro(tribits_process_tpls_lists REPOSITORY_NAME REPOSITORY_DIR) assert_defined(${REPOSITORY_NAME}_TPLS_FILE) set(${TPL_NAME}_TPLS_LIST_FILE ${${REPOSITORY_NAME}_TPLS_FILE}) + # Set ${TPL_NAME}_PACKAGE_BUILD_STATUS + + set(${TPL_NAME}_PACKAGE_BUILD_STATUS EXTERNAL) + # Print variables/properties for the TPL if (${PROJECT_NAME}_VERBOSE_CONFIGURE OR TRIBITS_PROCESS_TPLS_LISTS_VERBOSE) @@ -281,6 +282,7 @@ macro(tribits_process_tpls_lists REPOSITORY_NAME REPOSITORY_DIR) print_var(${TPL_NAME}_FINDMOD) print_var(${TPL_NAME}_DEPENDENCIES_FILE) print_var(${TPL_NAME}_TPLS_LIST_FILE) + print_var(${TPL_NAME}_PACKAGE_BUILD_STATUS) endif() # Set cache var TPL_ENABLE_${TPL_NAME} with default "" diff --git a/cmake/tribits/core/package_arch/TribitsProjectImpl.cmake b/cmake/tribits/core/package_arch/TribitsProjectImpl.cmake index fc9e30109206..892cecc6b6a3 100644 --- a/cmake/tribits/core/package_arch/TribitsProjectImpl.cmake +++ b/cmake/tribits/core/package_arch/TribitsProjectImpl.cmake @@ -117,7 +117,7 @@ macro(tribits_project_impl) # Since the version header file is now configured the root build # dir needs to be on the include path - include_directories(${CMAKE_CURRENT_BINARY_DIR}) + tribits_include_directories(${CMAKE_CURRENT_BINARY_DIR}) # # B) Set up user options and global variables that will be used throughout diff --git a/cmake/tribits/core/package_arch/TribitsReadAllProjectDepsFilesCreateDepsGraph.cmake b/cmake/tribits/core/package_arch/TribitsReadAllProjectDepsFilesCreateDepsGraph.cmake index 261d815f3e05..2b71d8288589 100644 --- a/cmake/tribits/core/package_arch/TribitsReadAllProjectDepsFilesCreateDepsGraph.cmake +++ b/cmake/tribits/core/package_arch/TribitsReadAllProjectDepsFilesCreateDepsGraph.cmake @@ -64,7 +64,6 @@ include(TimingUtils) # # * `Lists of external and internal packages`_ # * `Variables defining the package dependencies graph`_ -# (`Legacy list variables defining the package dependencies graph`_) # * `TriBITS Package Top-Level Local Variables`_ # * `TriBITS Subpackage Top-Level Local Variables`_ # * `TriBITS Package Cache Variables`_ @@ -238,14 +237,6 @@ macro(tribits_read_defined_external_and_internal_toplevel_packages_lists) # ${PROJECT_NAME}_NUM_DEFINED_TPLS list(LENGTH ${PROJECT_NAME}_DEFINED_TPLS ${PROJECT_NAME}_NUM_DEFINED_TPLS) - # ${PROJECT_NAME}_REVERSE_DEFINED_TPLS (ToDo: Remove the need for this #63) - if (${PROJECT_NAME}_DEFINED_TPLS) - set(${PROJECT_NAME}_REVERSE_DEFINED_TPLS ${${PROJECT_NAME}_DEFINED_TPLS}) - list(REVERSE ${PROJECT_NAME}_REVERSE_DEFINED_TPLS) - else() - set(${PROJECT_NAME}_REVERSE_DEFINED_TPLS) - endif() - # ${PROJECT_NAME}_DEFINED_TOPLEVEL_PACKAGES set(${PROJECT_NAME}_DEFINED_TOPLEVEL_PACKAGES ${${PROJECT_NAME}_DEFINED_TPLS} diff --git a/cmake/tribits/core/package_arch/TribitsReadDepsFilesCreateDepsGraph.cmake b/cmake/tribits/core/package_arch/TribitsReadDepsFilesCreateDepsGraph.cmake index c55673ee927b..9ec045e0099b 100644 --- a/cmake/tribits/core/package_arch/TribitsReadDepsFilesCreateDepsGraph.cmake +++ b/cmake/tribits/core/package_arch/TribitsReadDepsFilesCreateDepsGraph.cmake @@ -38,6 +38,7 @@ # @HEADER include(TribitsPackageDefineDependencies) +include(TribitsPackageDependencies) include(SetDefault) include(DualScopeSet) @@ -64,12 +65,12 @@ include(DualScopeSet) # # * `${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES`_ # -# as well creates the package dependency variables described in `Legacy list -# variables defining the package dependencies graph`_ that defines the -# directed acyclic dependency (DAG) package dependency graph (with navigation -# up and down the graph). +# as well creates the package dependency variables described in `Variables +# defining the package dependencies graph`_ that defines the directed acyclic +# dependency (DAG) package dependency graph (with navigation up and down the +# graph). # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # macro(tribits_read_deps_files_create_deps_graph) @@ -91,20 +92,15 @@ endmacro() # Process any dependency logic at the repo level by loading # `/cmake/RepositoryDependenciesSetup.cmake`_ files. # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # macro(tribits_process_all_repository_deps_setup_files) - foreach(TIBITS_REPO ${${PROJECT_NAME}_ALL_REPOSITORIES}) + foreach(TIBITS_REPO IN LISTS ${PROJECT_NAME}_ALL_REPOSITORIES) tribits_get_repo_name_dir(${TIBITS_REPO} REPO_NAME REPO_DIR) tribits_set_base_repo_dir(${PROJECT_SOURCE_DIR} ${REPO_DIR} BASE_REPO_DIR) tribits_get_repo_name(${TIBITS_REPO} REPOSITORY_NAME) - #print_var(TIBITS_REPO) - #print_var(REPO_NAME) - #print_var(REPO_DIR) - #print_var(REPOSITORY_NAME) set(REPO_DEPENDENCIES_SETUP_FILE "${BASE_REPO_DIR}/cmake/RepositoryDependenciesSetup.cmake") - #print_var(REPO_DEPENDENCIES_SETUP_FILE) if (EXISTS ${REPO_DEPENDENCIES_SETUP_FILE}) tribits_trace_file_processing(REPOSITORY INCLUDE "${REPO_DEPENDENCIES_SETUP_FILE}") @@ -128,7 +124,7 @@ endmacro() # Process any dependency logic at the project level by loading the # `/cmake/ProjectDependenciesSetup.cmake`_ file # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # macro(tribits_process_project_dependency_setup_file) set(PROJECT_DEPENDENCIES_SETUP_FILE @@ -170,33 +166,26 @@ endmacro() # # * `${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES`_ # -# as well creates the package dependency variables described in `Legacy list -# variables defining the package dependencies graph`_ that defines the -# directed acyclic dependency (DAG) package dependency graph (with navigation -# up and down the graph). +# as well creates the package dependency variables described in `Variables +# defining the package dependencies graph`_ that defines the directed acyclic +# dependency (DAG) package dependency graph (with navigation up and down the +# graph). # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # macro(tribits_read_all_package_deps_files_create_deps_graph) - foreach(tribitsExternalPkg IN LISTS ${PROJECT_NAME}_DEFINED_TPLS) + foreach(tribitsExternalPkg IN LISTS ${PROJECT_NAME}_DEFINED_TPLS) tribits_read_external_package_deps_files_add_to_graph(${tribitsExternalPkg}) endforeach() set(${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES "") # Packages and subpackages - foreach(TRIBITS_PACKAGE IN LISTS ${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES) + 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}) endforeach() - # Create a reverse packages list for later use - set(${PROJECT_NAME}_REVERSE_DEFINED_INTERNAL_PACKAGES - ${${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES}) - if (${PROJECT_NAME}_REVERSE_DEFINED_INTERNAL_PACKAGES) - list(REVERSE ${PROJECT_NAME}_REVERSE_DEFINED_INTERNAL_PACKAGES) - endif() - list(LENGTH ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES ${PROJECT_NAME}_NUM_DEFINED_INTERNAL_PACKAGES) print_var(${PROJECT_NAME}_NUM_DEFINED_INTERNAL_PACKAGES) @@ -218,9 +207,13 @@ endmacro() # # _LIB_DEFINED_DEPENDENCIES # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # macro(tribits_read_external_package_deps_files_add_to_graph tplName) + # Set up empty lists for forward dependencies + set(${tplName}_FORWARD_LIB_DEFINED_DEPENDENCIES "") + set(${tplName}_FORWARD_TEST_DEFINED_DEPENDENCIES "") + # Read in and process the external package/TPL dependency file if (IS_ABSOLUTE "${${tplName}_DEPENDENCIES_FILE}") set(absTplDepsFile "${${tplName}_DEPENDENCIES_FILE}") else() @@ -229,6 +222,10 @@ macro(tribits_read_external_package_deps_files_add_to_graph tplName) if (EXISTS "${absTplDepsFile}") tribits_trace_file_processing(TPL INCLUDE "${absTplDepsFile}") include(${absTplDepsFile}) + foreach(depPkg IN LISTS ${tplName}_LIB_DEFINED_DEPENDENCIES) + global_set(${tplName}_LIB_DEP_REQUIRED_${depPkg} TRUE) + endforeach() + tribits_append_forward_dep_packages(${tplName} LIB) endif() endmacro() @@ -242,21 +239,8 @@ endmacro() # Macro that reads in package dependencies for a top-level package from the # file `/cmake/Dependencies.cmake`_ and appends the forward # dependencies list vars for packages already read in for this package -# ````. -# -# Modifies the global variables:: -# -# ${PACKAGE_NAME}_LIB_REQUIRED_DEP_PACKAGES -# ${PACKAGE_NAME}_LIB_OPTIONAL_DEP_PACKAGES -# ${PACKAGE_NAME}_TEST_REQUIRED_DEP_PACKAGES -# ${PACKAGE_NAME}_TEST_OPTIONAL_DEP_PACKAGES -# _FORWARD_LIB_REQUIRED_DEP_PACKAGES -# _FORWARD_LIB_OPTIONAL_DEP_PACKAGES -# _FORWARD_TEST_REQUIRED_DEP_PACKAGES -# _FORWARD_TEST_OPTIONAL_DEP_PACKAGES -# -# (where ```` are upstream dependencies of this package -# ``${PACKAGE_NAME}``). +# ```` (see `Variables defining the package dependencies +# graph`_). # # It also appends the list variable: # @@ -266,11 +250,12 @@ endmacro() # order and then this top-level package is appended and dependencies are # created for them. # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # macro(tribits_read_toplevel_package_deps_files_add_to_graph PACKAGE_NAME) - # A) Get ready to read in the contents of this this pakages's Dependencies.cmake file + # A) Get ready to read in the contents of this package's Dependencies.cmake + # file tribits_prep_to_read_dependencies(${PACKAGE_NAME}) @@ -309,7 +294,7 @@ macro(tribits_read_toplevel_package_deps_files_add_to_graph PACKAGE_NAME) # Append the subpackages to the dependencies list if this top-level package set(SUBPACKAGE_IDX 0) - foreach(TRIBITS_SUBPACKAGE ${${PACKAGE_NAME}_SUBPACKAGES}) + foreach(TRIBITS_SUBPACKAGE IN LISTS ${PACKAGE_NAME}_SUBPACKAGES) set(SUBPACKAGE_FULLNAME ${PACKAGE_NAME}${TRIBITS_SUBPACKAGE}) list(GET ${PACKAGE_NAME}_SUBPACKAGE_OPTREQ ${SUBPACKAGE_IDX} SUBPACKAGE_OPTREQ) list(APPEND LIB_${SUBPACKAGE_OPTREQ}_DEP_PACKAGES ${SUBPACKAGE_FULLNAME}) @@ -342,49 +327,32 @@ endmacro() # # It also sets to empty the forward dependency list vars: # -# * `${PACKAGE_NAME}_FORWARD_LIB_DEP_PACKAGES`_ -# * `${PACKAGE_NAME}_FORWARD_TEST_DEP_PACKAGES`_ -# -# for each of the forward/downstream in `Variables defining the package -# dependencies graph`_. -# -# See `Function call tree for constructing package dependency graph`_ -# -# **__Legacy variables:__** +# * `${PACKAGE_NAME}_FORWARD_LIB_DEFINED_DEPENDENCIES`_ +# * `${PACKAGE_NAME}_FORWARD_TEST_DEFINED_DEPENDENCIES`_ # -# It also sets to empty the forward dependency list vars: -# -# _FORWARD_ +# for each of the forward/downstream package/dependency in `Variables defining +# the package dependencies graph`_. # -# for each of the forward/downstream in `Legacy list variables defining the -# package dependencies graph`_. +# See `Function call tree for constructing package dependency graph`_. # macro(tribits_prep_to_read_dependencies PACKAGE_NAME_IN) # Initial vars that must be set in the Dependencies.cmake file - tribits_declare_undefined(LIB_REQUIRED_DEP_PACKAGES) tribits_declare_undefined(LIB_OPTIONAL_DEP_PACKAGES) tribits_declare_undefined(TEST_REQUIRED_DEP_PACKAGES) tribits_declare_undefined(TEST_OPTIONAL_DEP_PACKAGES) - tribits_declare_undefined(LIB_REQUIRED_DEP_TPLS "") - tribits_declare_undefined(LIB_OPTIONAL_DEP_TPLS "") - tribits_declare_undefined(TEST_REQUIRED_DEP_TPLS "") - tribits_declare_undefined(TEST_OPTIONAL_DEP_TPLS "") + tribits_declare_undefined(LIB_REQUIRED_DEP_TPLS) + tribits_declare_undefined(LIB_OPTIONAL_DEP_TPLS) + tribits_declare_undefined(TEST_REQUIRED_DEP_TPLS) + tribits_declare_undefined(TEST_OPTIONAL_DEP_TPLS) set(REGRESSION_EMAIL_LIST "") # Allow to be empty # Initialize other vars - - set(${PACKAGE_NAME_IN}_FORWARD_LIB_DEP_PACKAGES "") - set(${PACKAGE_NAME_IN}_FORWARD_TEST_DEP_PACKAGES "") - - # Legacy vars #63 - set(${PACKAGE_NAME_IN}_FORWARD_LIB_REQUIRED_DEP_PACKAGES "") - set(${PACKAGE_NAME_IN}_FORWARD_LIB_OPTIONAL_DEP_PACKAGES "") - set(${PACKAGE_NAME_IN}_FORWARD_TEST_REQUIRED_DEP_PACKAGES "") - set(${PACKAGE_NAME_IN}_FORWARD_TEST_OPTIONAL_DEP_PACKAGES "") + set(${PACKAGE_NAME_IN}_FORWARD_LIB_DEFINED_DEPENDENCIES "") + set(${PACKAGE_NAME_IN}_FORWARD_TEST_DEFINED_DEPENDENCIES "") endmacro() @@ -399,7 +367,7 @@ endmacro() # `tribits_package_define_dependencies()`_ in the file # `/cmake/Dependencies.cmake`_ have been set. # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # macro(tribits_assert_read_dependency_vars PACKAGE_NAME) @@ -424,7 +392,7 @@ endmacro() # # Saves off package dependency variables with variable suffix ``_``. # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # macro(tribits_save_off_dependency_vars POSTFIX) @@ -450,7 +418,7 @@ endmacro() # Read back the local package dependency vars from the saved-off vars with # suffix ``_``. # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # macro(tribits_read_back_dependencies_vars POSTFIX) @@ -473,46 +441,56 @@ endmacro() # # tribits_process_package_dependencies_lists() # -# Sets up the upstream and downstream/forward package dependency list -# variables for ```` described in `Legacy list variables defining -# the package dependencies graph`_. Note that the downstream/forward -# dependencies of upstream packages on this package ```` are -# built up incrementally. +# Sets up the upstream/backward and downstream/forward package dependency list +# variables for ```` described in `Variables defining the package +# dependencies graph`_. Note that the downstream/forward dependencies of +# upstream packages for this package ```` are built up +# incrementally. (The forward dependency list vars are initialized to empty +# in `tribits_prep_to_read_dependencies()`_.) # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # -macro(tribits_process_package_dependencies_lists PACKAGE_NAME) - - tribits_set_dep_packages(${PACKAGE_NAME} LIB REQUIRED) - tribits_set_dep_packages(${PACKAGE_NAME} LIB OPTIONAL) - tribits_set_dep_packages(${PACKAGE_NAME} TEST REQUIRED) - tribits_set_dep_packages(${PACKAGE_NAME} TEST OPTIONAL) - - set(${PACKAGE_NAME}_LIB_REQUIRED_DEP_TPLS ${LIB_REQUIRED_DEP_TPLS}) - set(${PACKAGE_NAME}_LIB_OPTIONAL_DEP_TPLS ${LIB_OPTIONAL_DEP_TPLS}) - set(${PACKAGE_NAME}_TEST_REQUIRED_DEP_TPLS ${TEST_REQUIRED_DEP_TPLS}) - set(${PACKAGE_NAME}_TEST_OPTIONAL_DEP_TPLS ${TEST_OPTIONAL_DEP_TPLS}) - - tribits_append_forward_dep_packages(${PACKAGE_NAME} LIB_REQUIRED_DEP_PACKAGES) - tribits_append_forward_dep_packages(${PACKAGE_NAME} LIB_OPTIONAL_DEP_PACKAGES) - tribits_append_forward_dep_packages(${PACKAGE_NAME} TEST_REQUIRED_DEP_PACKAGES) - tribits_append_forward_dep_packages(${PACKAGE_NAME} TEST_OPTIONAL_DEP_PACKAGES) +macro(tribits_process_package_dependencies_lists packageName) + + # Initialize backward dep vars + set(${packageName}_LIB_DEFINED_DEPENDENCIES "") + set(${packageName}_TEST_DEFINED_DEPENDENCIES "") + + # 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) + tribits_append_forward_dep_packages(${packageName} TEST) endmacro() -# @FUNCTION: tribits_set_dep_packages() +# @MACRO: tribits_set_dep_packages() +# +# Macro set up backward package dependency lists for a given package given the +# vars read in from the macro `tribits_package_define_dependencies()`_. # # Usage:: # -# tribits_set_dep_packages( LIB|TEST REQUIRED|OPTIONAL) +# tribits_set_dep_packages( ) +# +# where: +# +# * ````: ``LIB`` or ``TEST`` +# * ````: ``REQUIRED`` or ``OPTIONAL`` +# * ````: ``PACKAGES`` or ``TPLS`` # -# Function that helps to set up backward package dependency lists for a given -# package given the vars read in from the macro -# `tribits_package_define_dependencies()`_. # # Sets the upstream/backward dependency variables defined in the section -# `Legacy list variables defining the package dependencies graph`_. +# `Variables defining the package dependencies graph`_. # # This also handles the several types of issues: # @@ -523,124 +501,149 @@ endmacro() # `tribits_abort_on_missing_package()`_ or allow to be missing and disable # this package if this is a required dependency). # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # -function(tribits_set_dep_packages PACKAGE_NAME LIB_OR_TEST REQUIRED_OR_OPTIONAL) - - if (TRIBITS_SET_DEP_PACKAGES_DEBUG_DUMP) - message("\nTRIBITS_SET_DEP_PACKAGES: ${PACKAGE_NAME} ${LIB_OR_TEST} ${REQUIRED_OR_OPTIONAL})") - endif() +macro(tribits_set_dep_packages packageName testOrLib requiredOrOptional pkgsOrTpls) - set(LIST_TYPE ${LIB_OR_TEST}_${REQUIRED_OR_OPTIONAL}_DEP_PACKAGES) - set(PACKAGE_DEPS_LIST "") - set(PACKAGE_ENABLE_VAR ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) + set(inputListType ${testOrLib}_${requiredOrOptional}_DEP_${pkgsOrTpls}) + set(packageEnableVar ${PROJECT_NAME}_ENABLE_${packageName}) - foreach(DEP_PKG ${${LIST_TYPE}}) - if (TRIBITS_SET_DEP_PACKAGES_DEBUG_DUMP) - print_var(DEP_PKG) - endif() - if (${DEP_PKG} STREQUAL ${PACKAGE_NAME}) - tribits_abort_on_self_dep("${PACKAGE_NAME}" "${LIST_TYPE}") - endif() - if (${DEP_PKG}_SOURCE_DIR) - set(DEP_PKG_DEFINED_AND_EXISTS TRUE) - else() - set(DEP_PKG_DEFINED_AND_EXISTS FALSE) - endif() - if (TRIBITS_SET_DEP_PACKAGES_DEBUG_DUMP) - print_var(DEP_PKG_DEFINED_AND_EXISTS) + foreach(depPkg IN LISTS ${inputListType}) + if (${depPkg} STREQUAL ${packageName}) + tribits_abort_on_self_dep("${packageName}" "${inputListType}") endif() - if (DEP_PKG_DEFINED_AND_EXISTS) - list(APPEND PACKAGE_DEPS_LIST ${DEP_PKG}) - else() - if (${PROJECT_NAME}_ASSERT_MISSING_PACKAGES - AND NOT ${DEP_PKG}_ALLOW_MISSING_EXTERNAL_PACKAGE - ) - tribits_abort_on_missing_package( - "${DEP_PKG}" "${PACKAGE_NAME}" "${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES") + tribits_is_pkg_defined(${depPkg} ${pkgsOrTpls} depPkgIsDefined) + if (depPkgIsDefined) + list(APPEND ${packageName}_${testOrLib}_DEFINED_DEPENDENCIES ${depPkg}) + if ("${requiredOrOptional}" STREQUAL "REQUIRED") + global_set(${packageName}_${testOrLib}_DEP_REQUIRED_${depPkg} TRUE) + elseif ("${requiredOrOptional}" STREQUAL "OPTIONAL") + global_set(${packageName}_${testOrLib}_DEP_REQUIRED_${depPkg} FALSE) else() - if (${DEP_PKG}_ALLOW_MISSING_EXTERNAL_PACKAGE) - if (${PROJECT_NAME}_WARN_ABOUT_MISSING_EXTERNAL_PACKAGES) - message_wrapper("NOTE: ${DEP_PKG} is being ignored since its directory" - " is missing and ${DEP_PKG}_ALLOW_MISSING_EXTERNAL_PACKAGE =" - " ${${DEP_PKG}_ALLOW_MISSING_EXTERNAL_PACKAGE}!") - endif() - if (REQUIRED_OR_OPTIONAL STREQUAL "REQUIRED") - message_wrapper("NOTE: Setting ${PACKAGE_ENABLE_VAR}=OFF because" - " package ${PACKAGE_NAME} has a required dependency on missing" - " package ${DEP_PKG}!") - dual_scope_set(${PACKAGE_ENABLE_VAR} OFF) - endif() - endif() - if (${PROJECT_NAME}_VERBOSE_CONFIGURE) - message( - "\n***" - "\n*** NOTE: The package ${DEP_PKG} which is a dependent package of" - " ${PACKAGE_NAME} being ignored because ${DEP_PKG} is missing!" - "\n***\n" ) - endif() - # Must set enable vars for missing package to off so that logic in - # existing downstream packages that key off of these vars will still - # work. - dual_scope_set(${PROJECT_NAME}_ENABLE_${DEP_PKG} OFF) - dual_scope_set(${PACKAGE_NAME}_ENABLE_${DEP_PKG} OFF) + message(FATAL_ERROR + "Invalid value for requiredOrOptional='${requiredOrOptional}'!") endif() + else() + tribits_set_dep_packages__handle_undefined_pkg(${packageName} ${depPkg} + ${requiredOrOptional} ${pkgsOrTpls} ${packageEnableVar}) endif() endforeach() - #print_var(PACKAGE_DEPS_LIST) +endmacro() - global_set(${PACKAGE_NAME}_${LIST_TYPE} ${PACKAGE_DEPS_LIST}) +# Determine if a (internal or external) package is defined or not +# +function(tribits_is_pkg_defined depPkg pkgsOrTpls 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}'") + endif() + set(${depPkgIsDefinedOut} ${depPkgIsDefined} PARENT_SCOPE) endfunction() -# @FUNCTION: tribits_append_forward_dep_packages() +# Implementation macro for tribits_set_dep_packages() to deal with a package +# that is not defined by TriBITS. # -# Usage: tribits_append_forward_dep_packages( ) +# ToDo #63: This may need to be modified when dealing with TriBITS-compatible +# packages already installed out on the system. We may need a mode where we +# don't assert packages that are not defined but instead just assume they are +# TriBITS-compatible packages already installed. +# +macro(tribits_set_dep_packages__handle_undefined_pkg packageName depPkg + requiredOrOptional pkgsOrTpls packageEnableVar + ) + # Determine if it is allowed for this depPkg to not be defined + set(errorOutForUndefinedDepPkg TRUE) + if (${depPkg}_ALLOW_MISSING_EXTERNAL_PACKAGE) + set(errorOutForUndefinedDepPkg FALSE) + elseif (NOT ${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES IN_LIST + ${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_ERROR_VALUES_LIST + ) + set(errorOutForUndefinedDepPkg FALSE) + endif() + # Produce error or deal with allowed undefined ${depPkg} + if (errorOutForUndefinedDepPkg) + tribits_abort_on_missing_package("${depPkg}" "${packageName}") + else() + if (${depPkg}_ALLOW_MISSING_EXTERNAL_PACKAGE) + if (${PROJECT_NAME}_WARN_ABOUT_MISSING_EXTERNAL_PACKAGES) + message_wrapper("NOTE: ${depPkg} is being ignored since its directory" + " is missing and ${depPkg}_ALLOW_MISSING_EXTERNAL_PACKAGE =" + " ${${depPkg}_ALLOW_MISSING_EXTERNAL_PACKAGE}!") + endif() + if ("${requiredOrOptional}" STREQUAL "REQUIRED") + message_wrapper("NOTE: Setting ${packageEnableVar}=OFF because" + " package ${packageName} has a required dependency on missing" + " package ${depPkg}!") + set(${packageEnableVar} OFF) + endif() + endif() + # Must set enable vars for missing package to off so that logic in + # existing downstream packages that key off of these vars will still + # work. + set(${PROJECT_NAME}_ENABLE_${depPkg} OFF) + set(${packageName}_ENABLE_${depPkg} OFF) + endif() +endmacro() + + +# @MACRO: tribits_append_forward_dep_packages() # -# Function that helps to set up forward package dependency lists for an -# upstream package given that a downstream package declared a dependency on -# it. In particular, it appends the var:: +# Appends forward/downstream package dependency lists for the upstream +# dependent package list provided. +# +# Usage:: +# +# tribits_append_forward_dep_packages( ) +# +# In particular, it appends the var:: # # _FORWARD_ # -# for one of the vars listed in `Legacy list variables defining the package -# dependencies graph`_. +# for one of the vars listed in `Variables defining the package dependencies +# graph`_. # # This function is called multiple times to build up the forward package # dependencies for a given ```` by the downstream packages that # declare dependencies on it. # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # -function(tribits_append_forward_dep_packages PACKAGE_NAME LIST_TYPE) - - set(DEP_PKG_LIST_NAME "${PACKAGE_NAME}_${LIST_TYPE}") +macro(tribits_append_forward_dep_packages packageName libOrTest) - assert_defined(${PROJECT_NAME}_ASSERT_MISSING_PACKAGES) - foreach(DEP_PKG ${${DEP_PKG_LIST_NAME}}) - set(FWD_DEP_PKG_LIST_NAME "${DEP_PKG}_FORWARD_${LIST_TYPE}") - if (NOT DEFINED ${FWD_DEP_PKG_LIST_NAME}) - if (${PROJECT_NAME}_ASSERT_MISSING_PACKAGES) - tribits_abort_on_missing_package(${DEP_PKG} ${PACKAGE_NAME} ${DEP_PKG_LIST_NAME}) + foreach(depPkg IN LISTS ${packageName}_${libOrTest}_DEFINED_DEPENDENCIES) + set(fwdDepPkgListName ${depPkg}_FORWARD_${libOrTest}_DEFINED_DEPENDENCIES) + if (DEFINED ${fwdDepPkgListName}) + list(APPEND ${fwdDepPkgListName} ${packageName}) + else() + if (${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES IN_LIST + ${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_ERROR_VALUES_LIST + ) + tribits_abort_on_missing_package(${depPkg} ${packageName}) else() if (${PROJECT_NAME}_VERBOSE_CONFIGURE) message( "\n***" - "\n*** NOTE: The package ${DEP_PKG} has forward dependent package" - " ${PACKAGE_NAME}, but that dependency is being ignored because the package" - " ${DEP_PKG} is missing!" + "\n*** NOTE: The package ${depPkg} has forward dependent package" + " ${packageName}, but that dependency is being ignored because the package" + " ${depPkg} is missing!" "\n***\n" ) endif() endif() - else() - set(${FWD_DEP_PKG_LIST_NAME} ${${FWD_DEP_PKG_LIST_NAME}} ${PACKAGE_NAME} - PARENT_SCOPE) endif() endforeach() -endfunction() +endmacro() # @MACRO: tribits_set_package_regression_email_list() @@ -652,9 +655,9 @@ endfunction() # Macro that sets a pacakge's regression email address # ``${PACKAGE_NAME}_REGRESSION_EMAIL_LIST`` as described in ???. # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # -macro(tribits_set_package_regression_email_list PACKAGE_NAME) +macro(tribits_set_package_regression_email_list PACKAGE_NAME) # Lower-case package name To be used with auto email naming based on base email address string(TOLOWER "${PACKAGE_NAME}" LPACKAGE) @@ -663,7 +666,6 @@ macro(tribits_set_package_regression_email_list PACKAGE_NAME) endif() tribits_get_repo_name(${${PACKAGE_NAME}_PARENT_REPOSITORY} REPOSITORY_NAME) - #print_var(REPOSITORY_NAME) if(${REPOSITORY_NAME}_REPOSITORY_OVERRIDE_PACKAGE_EMAIL_LIST) set(${PACKAGE_NAME}_REGRESSION_EMAIL_LIST @@ -697,25 +699,28 @@ endmacro() # # Usage:: # -# tribits_abort_on_missing_package( ) +# tribits_abort_on_missing_package( ) # # Function that creates error message about missing/misspelled package. This # error message also suggests that the package might be defining an upstream # dependency on a downstream dependency (i.e. a circular dependency). # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # -function(tribits_abort_on_missing_package DEP_PKG PACKAGE_NAME DEP_PKG_LIST_NAME) +function(tribits_abort_on_missing_package depPkg packageName) multiline_set(ERRMSG - "Error, the package '${DEP_PKG}' is listed as a dependency of the package" - " '${PACKAGE_NAME}' is in the list '${DEP_PKG_LIST_NAME}' but the package" - " '${DEP_PKG}' is either not defined or is listed later in the package order." + "Error, the package '${depPkg}' is listed as a dependency of the package" + " '${packageName}' but the package '${depPkg}' is either not defined or" + " is listed later in the package order." " This may also be an attempt to create a circular dependency between" - " the packages '${DEP_PKG}' and '${PACKAGE_NAME}' (which is not allowed)." - " Check the spelling of '${DEP_PKG}' or see how it is listed in" + " the packages '${depPkg}' and '${packageName}' (which is not allowed)." + " Check the spelling of '${depPkg}' or see how it is listed in" " a call to tribits_repository_define_packages() in relation to" - " '${PACKAGE_NAME}'.") - message(FATAL_ERROR ${ERRMSG}) + " '${packageName}'." + " To ignore/disable the undefined package '${depPkg}', set the cache" + " variable ${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES=IGNORE." + ) + message(${${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES} "${ERRMSG}") endfunction() @@ -728,7 +733,7 @@ endfunction() # Prints a fatal error message for an attempt for a self dependency # declaration and which list it comes from. # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # function(tribits_abort_on_self_dep PACKAGE_NAME DEP_PKG_LIST_NAME) multiline_set(ERRMSG @@ -747,14 +752,15 @@ endfunction() # # Usage:: # -# tribits_parse_subpackages_append_packages_add_options() +# tribits_parse_subpackages_append_packages_add_options() # # Macro that parses the read-in variable # ``SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS`` set by the macro # `tribits_package_define_dependencies()`_ , adds subpackages to the list of # defined packages, and defines user cache var options for those subpackages. # -# This sets the list variables for the parent package ````:: +# This sets the list variables for the parent package +# ````:: # # _SUBPACKAGES # _SUBPACKAGE_DIRS @@ -767,108 +773,102 @@ endfunction() # _PARENT_PACKAGE # _PARENT_REPOSITORY # -# And it appends for each subpackage to variable: +# And it appends each subpackage to the list variable: # # * `${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES`_ # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # -macro(tribits_parse_subpackages_append_packages_add_options - PACKAGE_NAME - ) +macro(tribits_parse_subpackages_append_packages_add_options parentPackageName) - # Structure of SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS + # Fields in the list var SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS set(SPDC_SP_NAME_OFFSET 0) set(SPDC_SP_DIR_OFFSET 1) set(SPDC_SP_CLASSIFICATION_OFFSET 2) set(SPDC_SP_OPTREQ_OFFSET 3) - set(SPDC_NUM_FIELDS 4) + set(SPDC_NUM_FIELDS 4) # Number of the above files - set(${PACKAGE_NAME}_SUBPACKAGES "") - set(${PACKAGE_NAME}_SUBPACKAGE_DIRS "") - set(${PACKAGE_NAME}_SUBPACKAGE_OPTREQ "") + set(${parentPackageName}_SUBPACKAGES "") + set(${parentPackageName}_SUBPACKAGE_DIRS "") + set(${parentPackageName}_SUBPACKAGE_OPTREQ "") if (SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS) - list(LENGTH SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS SPDC_TOTAL_LENGTH) - math(EXPR NUM_SUBPACKAGES "${SPDC_TOTAL_LENGTH}/${SPDC_NUM_FIELDS}") - math(EXPR SUBPACKAGES_LAST_IDX "${NUM_SUBPACKAGES}-1") - - foreach(SUBPACKAGE_IDX RANGE ${SUBPACKAGES_LAST_IDX}) + list(LENGTH SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS SPDC_TOTAL_LENGTH) + math(EXPR numSubpackages "${SPDC_TOTAL_LENGTH}/${SPDC_NUM_FIELDS}") + math(EXPR subpackagesLastIdx "${numSubpackages}-1") - #message("") - #print_var(SUBPACKAGE_IDX) + foreach(SUBPACKAGE_IDX RANGE ${subpackagesLastIdx}) - # SUBPACKAGE_NAME - math(EXPR SUBPACKAGE_NAME_IDX + # subpkgName + math(EXPR subpkgNameIdx "${SUBPACKAGE_IDX}*${SPDC_NUM_FIELDS}+${SPDC_SP_NAME_OFFSET}") - list(GET SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS ${SUBPACKAGE_NAME_IDX} - SUBPACKAGE_NAME ) + list(GET SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS ${subpkgNameIdx} subpkgName) - set(SUBPACKAGE_FULLNAME ${PACKAGE_NAME}${SUBPACKAGE_NAME}) + # subpkgFullname + set(subpkgFullname ${parentPackageName}${subpkgName}) - # SUBPACKAGE_DIR - math(EXPR SUBPACKAGE_DIR_IDX + # subpkgDir + math(EXPR subpkgDirIdx "${SUBPACKAGE_IDX}*${SPDC_NUM_FIELDS}+${SPDC_SP_DIR_OFFSET}") - list(GET SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS ${SUBPACKAGE_DIR_IDX} - SUBPACKAGE_DIR ) + list(GET SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS ${subpkgDirIdx} subpkgDir) - # SUBPACKAGE_CLASSIFICATION - math(EXPR SUBPACKAGE_CLASSIFICATION_IDX + # subpkgClassification + math(EXPR subpkgClassificationIdx "${SUBPACKAGE_IDX}*${SPDC_NUM_FIELDS}+${SPDC_SP_CLASSIFICATION_OFFSET}") - list(GET SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS ${SUBPACKAGE_CLASSIFICATION_IDX} - SUBPACKAGE_CLASSIFICATION ) + list(GET SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS ${subpkgClassificationIdx} + subpkgClassification ) # ToDo: Parse out TESTGROUP and MATURITYLEVEL (Trilinos #6042) - set(SUBPACKAGE_TESTGROUP ${SUBPACKAGE_CLASSIFICATION}) + set(subpkgTestgroup ${subpkgClassification}) - tribits_update_ps_pt_ss_st(Subpackage ${SUBPACKAGE_FULLNAME} SUBPACKAGE_TESTGROUP) + tribits_update_ps_pt_ss_st(Subpackage ${subpkgFullname} subpkgTestgroup) - # SUBPACKAGE_OPTREQ - math(EXPR SUBPACKAGE_OPTREQ_IDX + # subpkgOptreq + math(EXPR subpkgOptreqIdx "${SUBPACKAGE_IDX}*${SPDC_NUM_FIELDS}+${SPDC_SP_OPTREQ_OFFSET}") - list(GET SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS ${SUBPACKAGE_OPTREQ_IDX} - SUBPACKAGE_OPTREQ ) + list(GET SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS ${subpkgOptreqIdx} + subpkgOptreq ) # Determine if this subpackage exists - set(SUBPACKAGE_FULL_SOURCE_DIR - ${PROJECT_SOURCE_DIR}/${${PACKAGE_NAME}_REL_SOURCE_DIR}/${SUBPACKAGE_DIR}) - if (EXISTS ${SUBPACKAGE_FULL_SOURCE_DIR}) - set(SUBPACKAGE_EXISTS TRUE) + set(subpkgFullSrcDir + "${PROJECT_SOURCE_DIR}/${${parentPackageName}_REL_SOURCE_DIR}/${subpkgDir}") + if (EXISTS "${subpkgFullSrcDir}") + set(subpkgExists TRUE) else() - set(SUBPACKAGE_EXISTS FALSE) + set(subpkgExists FALSE) endif() - if (NOT SUBPACKAGE_EXISTS AND ${PROJECT_NAME}_ASSERT_MISSING_PACKAGES) - message(SEND_ERROR "ERROR: Subpackage dir '${SUBPACKAGE_FULL_SOURCE_DIR}'" - " is missing!") + if (NOT subpkgExists AND ${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES IN_LIST + ${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_ERROR_VALUES_LIST + ) + message(SEND_ERROR "ERROR: Subpackage dir '${subpkgFullSrcDir}' is missing!") endif() # Append to lists and global variables - if (SUBPACKAGE_EXISTS) + if (subpkgExists) - list(APPEND ${PACKAGE_NAME}_SUBPACKAGES ${SUBPACKAGE_NAME}) - list(APPEND ${PACKAGE_NAME}_SUBPACKAGE_DIRS ${SUBPACKAGE_DIR}) - list(APPEND ${PACKAGE_NAME}_SUBPACKAGE_OPTREQ ${SUBPACKAGE_OPTREQ}) - list(APPEND ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES ${SUBPACKAGE_FULLNAME}) - set(${SUBPACKAGE_FULLNAME}_SOURCE_DIR "${SUBPACKAGE_FULL_SOURCE_DIR}") - set(${SUBPACKAGE_FULLNAME}_REL_SOURCE_DIR - "${${PACKAGE_NAME}_REL_SOURCE_DIR}/${SUBPACKAGE_DIR}") - set(${SUBPACKAGE_FULLNAME}_PARENT_PACKAGE ${PACKAGE_NAME}) - set(${SUBPACKAGE_FULLNAME}_PARENT_REPOSITORY - ${${PACKAGE_NAME}_PARENT_REPOSITORY}) + list(APPEND ${parentPackageName}_SUBPACKAGES ${subpkgName}) + list(APPEND ${parentPackageName}_SUBPACKAGE_DIRS ${subpkgDir}) + list(APPEND ${parentPackageName}_SUBPACKAGE_OPTREQ ${subpkgOptreq}) + list(APPEND ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES ${subpkgFullname}) + set(${subpkgFullname}_SOURCE_DIR "${subpkgFullSrcDir}") + set(${subpkgFullname}_REL_SOURCE_DIR + "${${parentPackageName}_REL_SOURCE_DIR}/${subpkgDir}") + set(${subpkgFullname}_PARENT_PACKAGE ${parentPackageName}) + set(${subpkgFullname}_PARENT_REPOSITORY + ${${parentPackageName}_PARENT_REPOSITORY}) if (${PROJECT_NAME}_VERBOSE_CONFIGURE) - print_var(${SUBPACKAGE_FULLNAME}_PARENT_PACKAGE) - print_var(${SUBPACKAGE_FULLNAME}_PARENT_REPOSITORY) + print_var(${subpkgFullname}_PARENT_PACKAGE) + print_var(${subpkgFullname}_PARENT_REPOSITORY) endif() - set(${SUBPACKAGE_FULLNAME}_PACKAGE_BUILD_STATUS INTERNAL) + set(${subpkgFullname}_PACKAGE_BUILD_STATUS INTERNAL) # Set up the input options for this subpackage - tribits_insert_standard_package_options(${SUBPACKAGE_FULLNAME} - ${SUBPACKAGE_TESTGROUP}) + tribits_insert_standard_package_options(${subpkgFullname} ${subpkgTestgroup}) endif() @@ -876,9 +876,6 @@ macro(tribits_parse_subpackages_append_packages_add_options endif() - #print_var(${PACKAGE_NAME}_SUBPACKAGES) - #print_var(${PACKAGE_NAME}_SUBPACKAGE_OPTREQ) - endmacro() @@ -891,16 +888,12 @@ endmacro() # Read in subpackages dependencies files and add to dependencies graph # variables. # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # macro(tribits_read_package_subpackage_deps_files_add_to_graph PACKAGE_NAME) - #message("TRIBITS_READ_PACKAGE_SUBPACKAGE_DEPS_FILES_ADD_TO_GRAPH: ${PACKAGE_NAME}") - - #print_var(${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES) - set(SUBPACKAGE_IDX 0) - foreach(TRIBITS_SUBPACKAGE ${${PACKAGE_NAME}_SUBPACKAGES}) + foreach(TRIBITS_SUBPACKAGE IN LISTS ${PACKAGE_NAME}_SUBPACKAGES) list(GET ${PACKAGE_NAME}_SUBPACKAGE_DIRS ${SUBPACKAGE_IDX} SUBPACKAGE_DIR) tribits_read_subpackage_deps_file_add_to_graph(${TRIBITS_PACKAGE} ${TRIBITS_SUBPACKAGE} ${SUBPACKAGE_DIR}) @@ -921,14 +914,12 @@ endmacro() # `//cmake/Dependencies.cmake`_ and sets up the # dependency structure for it. # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # macro(tribits_read_subpackage_deps_file_add_to_graph PACKAGE_NAME SUBPACKAGE_NAME SUBPACKAGE_DIR ) - #message("TRIBITS_READ_SUBPACKAGE_DEPS_FILE_ADD_TO_GRAPH: ${PACKAGE_NAME} ${SUBPACKAGE_NAME} ${SUBPACKAGE_DIR}") - set(SUBPACKAGE_FULLNAME ${PACKAGE_NAME}${SUBPACKAGE_NAME}) # @@ -958,7 +949,9 @@ macro(tribits_read_subpackage_deps_file_add_to_graph PACKAGE_NAME set(SUBPACKAGE_EXISTS FALSE) endif() - if (SUBPACKAGE_EXISTS OR ${PROJECT_NAME}_ASSERT_MISSING_PACKAGES) + if (SUBPACKAGE_EXISTS OR ${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES IN_LIST + ${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_ERROR_VALUES_LIST + ) tribits_trace_file_processing(PACKAGE INCLUDE "${SUBPAKCAGE_DEPENDENCIES_FILE}") include(${SUBPAKCAGE_DEPENDENCIES_FILE}) diff --git a/cmake/tribits/core/package_arch/TribitsReportInvalidTribitsUsage.cmake b/cmake/tribits/core/package_arch/TribitsReportInvalidTribitsUsage.cmake index 442a4928fbcd..0a40deaa928e 100644 --- a/cmake/tribits/core/package_arch/TribitsReportInvalidTribitsUsage.cmake +++ b/cmake/tribits/core/package_arch/TribitsReportInvalidTribitsUsage.cmake @@ -53,6 +53,7 @@ include(MessageWrapper) # * FATAL_ERROR: Calls message(FATAL_ERROR "") # * SEND_ERROR: Calls message(SEND_ERROR "") # * WARNING: Calls message(WARNING "") +# * NOTICE: Calls message(NOTICE "") # * IGNORE: Does not call message() at all and is silent # # If '${${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE}' is empty on call, then @@ -60,24 +61,14 @@ include(MessageWrapper) # function(tribits_report_invalid_tribits_usage) if ("${${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE}" STREQUAL "") - set(${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE FATAL_ERROR) + set(${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE FATAL_ERROR) endif() - set(PRINT_ERR_MSG) - if (${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE STREQUAL "FATAL_ERROR") - set(PRINT_ERR_MSG FATAL_ERROR) - elseif (${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE STREQUAL "SEND_ERROR") - set(PRINT_ERR_MSG SEND_ERROR) - elseif (${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE STREQUAL "WARNING") - set(PRINT_ERR_MSG WARNING) - elseif (${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE STREQUAL "IGNORE") - set(PRINT_ERR_MSG) - else() - message_wrapper(FATAL_ERROR "Error, invalid value for" - " ${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE =" - " '${${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE}'!" - " Value values include 'FATAL_ERROR', 'SEND_ERROR', 'WARNING', and 'IGNORE'!") + set(printErrMsgMode ${${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE}) + set(ignoreValues "IGNORE" "OFF") + if(${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE IN_LIST ignoreValues) + set(printErrMsgMode "") endif() - if (PRINT_ERR_MSG) - message_wrapper(${PRINT_ERR_MSG} ${ARGN}) + if (printErrMsgMode) + message_wrapper(${printErrMsgMode} ${ARGN}) endif() endfunction() diff --git a/cmake/tribits/core/package_arch/TribitsSetAndIncDirs.cmake b/cmake/tribits/core/package_arch/TribitsSetAndIncDirs.cmake new file mode 100644 index 000000000000..55991e4fdb63 --- /dev/null +++ b/cmake/tribits/core/package_arch/TribitsSetAndIncDirs.cmake @@ -0,0 +1,66 @@ +# @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 + + +# @MACRO: tribits_set_and_inc_dirs() +# +# Set a variable to an include directory and call +# `tribits_include_directories()`_ (removes boiler-plate code). +# +# Usage: +# +# tribits_set_and_inc_dirs( ) +# +# On output, this sets ```` to ```` in the local scope +# and calls ``tribits_include_directories()``. +# +macro(tribits_set_and_inc_dirs dirVarName includeDir) + set(${dirVarName} ${includeDir}) + tribits_include_directories(${${dirVarName}}) +endmacro() + + +# Deprecated! Use tribits_set_and_inc_dirs() instead! +# +macro(set_and_inc_dirs DIR_VAR_NAME INCLUDE_DIR) + tribits_deprecated_command(set_and_inc_dirs + MESSAGE "Use tribits_set_and_inc_dirs() instead." ) + set(${DIR_VAR_NAME} ${INCLUDE_DIR}) + tribits_include_directories(${${DIR_VAR_NAME}}) +endmacro() diff --git a/cmake/tribits/core/package_arch/TribitsSetUpEnabledOnlyDependencies.cmake b/cmake/tribits/core/package_arch/TribitsSetUpEnabledOnlyDependencies.cmake new file mode 100644 index 000000000000..9e5900114bc0 --- /dev/null +++ b/cmake/tribits/core/package_arch/TribitsSetUpEnabledOnlyDependencies.cmake @@ -0,0 +1,237 @@ +# @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(TribitsDeprecatedHelpers) + + +# Function that creates enable-only dependency data-structures +# +# For each enabled package ``, this function sets up the global list +# var:: +# +# _FULL_ENABLED_DEP_PACKAGES +# +# If ``${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_PACKAGES`` is +# set, then ``_FULL_ENABLED_DEP_PACKAGES`` will only be sets for +# those packages. Otherwise, ``_FULL_ENABLED_DEP_PACKAGES`` will be +# set for all packages listed in `${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES`_. +# +# NOTE: The modern TriBITS implementation does not need this full list of +# dependencies for each package. Only the function +# `tribits_find_most_recent_file_timestamp()` needs this. (Therefore, this +# could not be striped out of TriBITS because there are still some projects +# that use this function.) +# +function(tribits_set_up_enabled_only_dependencies) + + set(GENERATE_EXPORT_DEPENDENCIES ${${PROJECT_NAME}_GENERATE_EXPORT_FILE_DEPENDENCIES}) + if ("${${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_PACKAGES}" STREQUAL "" + AND NOT + "${${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_SE_PACKAGES}" STREQUAL "" + ) + tribits_deprecated( + "The cache var" + " ${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_SE_PACKAGES" + "='${${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_SE_PACKAGES}'" + " is deprecated! Please instead set" + " ${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_PACKAGES" + "='${${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_SE_PACKAGES}'") + set(${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_PACKAGES + ${${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_SE_PACKAGES} ) + endif() + + # Determine lastExportTribitsPackage if not to generate any of these full + # dependency lists + set(lastExportTribitsPackage "") + if (GENERATE_EXPORT_DEPENDENCIES + AND ${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_PACKAGES + ) + # Find the last enabled package for which an export file is requested. + set(LAST_PKG_IDX -1) + set(LAST_PKG) + foreach(tribitsPkg IN LISTS + ${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_PACKAGES + ) + set(PKG_IDX ${${tribitsPkg}_PKG_IDX}) + if (NOT "${PKG_IDX}" STREQUAL "") + # The listed package is enabled so we will consider it + if (PKG_IDX GREATER ${LAST_PKG_IDX}) + set(LAST_PKG_IDX ${PKG_IDX}) + set(LAST_PKG ${tribitsPkg}) + endif() + endif() + endforeach() + if (LAST_PKG) + # At least one listed package was enabled + set(lastExportTribitsPackage ${LAST_PKG}) + else() + # None of the listed packages were enabled so don't bother generating + # any export dependencies + set(GENERATE_EXPORT_DEPENDENCIES FALSE) + endif() + + endif() + + if (GENERATE_EXPORT_DEPENDENCIES) + + if (lastExportTribitsPackage) + message("\nSetting up export dependencies up through ${lastExportTribitsPackage} ...\n") + else() + message("\nSetting up export dependencies for all enabled packages ...\n") + endif() + + foreach(tribitsPackage IN LISTS ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES) + tribits_package_set_full_enabled_dep_packages(${tribitsPackage}) + if (${PROJECT_NAME}_DUMP_PACKAGE_DEPENDENCIES) + set(printedVar FALSE) + print_nonempty_var_with_spaces(${tribitsPackage}_FULL_ENABLED_DEP_PACKAGES + printedVar) + if (NOT printedVar) + message("-- ${tribitsPackage}: No library dependencies!") + endif() + endif() + if ("${lastExportTribitsPackage}" STREQUAL "${tribitsPackage}") + break() + endif() + endforeach() + + endif() + +endfunction() + + +# Function that sets up the full package dependencies for the given *internal* +# enabled package ``${packageName}``, including all of its indirect upstream +# *internal* package dependencies. +# +# After running, this function sets the internal cache var: +# +# * ``${packageName}_FULL_ENABLED_DEP_PACKAGES`` +# +# NOTE: This function must be called for all of the upstream internal packages +# before calling it for this package. +# +# NOTE: The complexity of this function is O(^2) due to the +# sorting algorithm. That is why it would be good to get rid of this function +# at some point (or refactor it to have a better complexity). +# +function(tribits_package_set_full_enabled_dep_packages packageName) + + tribits_package_build_unsorted_full_enabled_dep_packages(${packageName} + packageFullDepsList) + + tribits_package_sort_full_enabled_dep_packages(packageFullDepsList + orderedPackageFullDepsList) + + global_set(${packageName}_FULL_ENABLED_DEP_PACKAGES ${orderedPackageFullDepsList}) + +endfunction() + + +# Helper function that builds the full list of internal upstream dep packages +# (with no duplicates) for a given internal package. +# +function(tribits_package_build_unsorted_full_enabled_dep_packages packageName + packageFullDepsListOut + ) + + set(packageFullDepsList "") + foreach(depPkg IN LISTS ${packageName}_LIB_DEFINED_DEPENDENCIES) + if ((${depPkg}_PACKAGE_BUILD_STATUS STREQUAL "INTERNAL") + AND ((${packageName}_LIB_DEP_REQUIRED AND ${PROJECT_NAME}_ENABLE_${depPkg}) + OR ((NOT ${packageName}_LIB_DEP_REQUIRED) AND ${packageName}_ENABLE_${depPkg})) + ) + list(APPEND packageFullDepsList ${depPkg}) + endif() + endforeach() + + if(packageFullDepsList) + list(REMOVE_DUPLICATES packageFullDepsList) + + foreach(DEP_PACKAGE IN LISTS packageFullDepsList) + list(APPEND packageFullDepsList ${${DEP_PACKAGE}_FULL_ENABLED_DEP_PACKAGES}) + endforeach() + + list(REMOVE_DUPLICATES packageFullDepsList) + endif() + + set(${packageFullDepsListOut} ${packageFullDepsList} PARENT_SCOPE) + +endfunction() + + +# Helper function to sort the full set of upstream dep packages for a given +# internal package. +# +function(tribits_package_sort_full_enabled_dep_packages packageFullDepsListName + orderedPackageFullDepsListOut + ) + + set(orderedPackageFullDepsList "") + + foreach(depPkg IN LISTS ${packageFullDepsListName}) + + set(depPkgIdx ${${depPkg}_PKG_IDX}) + + set(sortedIndex 0) + set(insertedDepPkg FALSE) + + foreach(sortedPackage IN LISTS orderedPackageFullDepsList) + + set(sortedPackageIdx ${${sortedPackage}_PKG_IDX}) + + if (${depPkgIdx} GREATER ${sortedPackageIdx}) + list(INSERT orderedPackageFullDepsList ${sortedIndex} ${depPkg}) + set(insertedDepPkg TRUE) + break() + endif() + + math(EXPR sortedIndex ${sortedIndex}+1) + + endforeach() + + if(NOT insertedDepPkg) + list(APPEND orderedPackageFullDepsList ${depPkg}) + endif() + + endforeach() + + set(${orderedPackageFullDepsListOut} ${orderedPackageFullDepsList} PARENT_SCOPE) + +endfunction() diff --git a/cmake/tribits/core/package_arch/TribitsSystemDataStructuresMacrosFunctions.rst b/cmake/tribits/core/package_arch/TribitsSystemDataStructuresMacrosFunctions.rst index 3e5a4e3718b1..f4661403fabd 100644 --- a/cmake/tribits/core/package_arch/TribitsSystemDataStructuresMacrosFunctions.rst +++ b/cmake/tribits/core/package_arch/TribitsSystemDataStructuresMacrosFunctions.rst @@ -295,14 +295,9 @@ the dependencies for each external package/TPL and internal package: The list of all **defined direct** required and optional upstream external package/TPL and internal package dependencies, regardless if they are - enabled or not. (Note, this is currently the concatenation of the lists - `${PACKAGE_NAME}_LIB_REQUIRED_DEP_PACKAGES`_, - `${PACKAGE_NAME}_LIB_OPTIONAL_DEP_PACKAGES`_, - ``${PACKAGE_NAME}_LIB_REQUIRED_DEP_TPLS``, and - ``${PACKAGE_NAME}_LIB_OPTIONAL_DEP_TPLS``. With the completion of #63, - the ``XXX_TPLS`` lists will be removed.) To determine if a given direct - upstream package ```` in this list is enabled or not for this - package ``${PACKAGE_NAME}``, check the value of + enabled or not. To determine if a given direct upstream package + ```` in this list is enabled or not for this package + ``${PACKAGE_NAME}``, check the value of ``${PACKAGE_NAME}_ENABLE_``. NOTE: The variables ``${PACKAGE_NAME}_ENABLE_`` will be set even for required upstream packages to allow for uniform loops involving required and optional @@ -338,13 +333,8 @@ 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. - (Currently, this is a concatenation of the lists - `${PACKAGE_NAME}_TEST_REQUIRED_DEP_PACKAGES`_, - `${PACKAGE_NAME}_TEST_OPTIONAL_DEP_PACKAGES`_, - ``${PACKAGE_NAME}_TEST_REQUIRED_DEP_TPLS``, and - ``${PACKAGE_NAME}_TEST_OPTIONAL_DEP_TPLS``. With the completion of #63, - the ``XXX_TPLS`` lists will be removed.) This list is set regardless if - the package ``${PACKAGE_NAME}`` is enabled or not. + This list is set regardless if the package ``${PACKAGE_NAME}`` is enabled + or not. .. _${PACKAGE_NAME}_TEST_ENABLED_DEPENDENCIES: @@ -390,17 +380,17 @@ Given the above upstream dependency list variables, the following derived list variables are then constructed which provide navigation from a package to its downstream/forward dependent packages: - .. _${PACKAGE_NAME}_FORWARD_LIB_DEP_PACKAGES: + .. _${PACKAGE_NAME}_FORWARD_LIB_DEFINED_DEPENDENCIES: - ``${PACKAGE_NAME}_FORWARD_LIB_DEP_PACKAGES`` + ``${PACKAGE_NAME}_FORWARD_LIB_DEFINED_DEPENDENCIES`` For a given package ``${PACKAGE_NAME}``, lists the names of all of the forward packages ```` that list this package in their ``_LIB_DEFINED_PACKAGES`` variables. - .. _${PACKAGE_NAME}_FORWARD_TEST_DEP_PACKAGES: + .. _${PACKAGE_NAME}_FORWARD_TEST_DEFINED_DEPENDENCIES: - ``${PACKAGE_NAME}_FORWARD_TEST_DEP_PACKAGES`` + ``${PACKAGE_NAME}_FORWARD_TEST_DEFINED_DEPENDENCIES`` For a given package ``${PACKAGE_NAME}``, lists the names of all of the forward packages ```` that list this package in their @@ -452,6 +442,7 @@ or:: -D _ROOT= .. _${PACKAGE_NAME}_PACKAGE_BUILD_STATUS: +.. _${TPL_NAME}_PACKAGE_BUILD_STATUS: The final status of whether a package is treated as an internal package or an external package is provided by the variable:: @@ -522,86 +513,6 @@ information about a given internal package: variable defined for them. -Legacy list variables defining the package dependencies graph -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -The following top-level non-cache variables are defined after reading in each -top-level package and subpackage ``Dependencies.cmake`` files and they are -used to define the basic dependencies that exist between packages in a project -to support the enable and disable logic described in section `Package -Dependencies and Enable/Disable Logic`_. These variables taken together -constitute a bidirectional acyclic graph (DAG) data-structure for package -dependencies. - -The following lists variables define the **direct** dependencies from a -package ``${PACKAGE_NAME}`` to its upstream packages which are directly set in -a package's `/cmake/Dependencies.cmake`_ file. (These lists -should **not** contain any *indirect* dependencies as the dependency system -already handles these automatically.) - - .. _${PACKAGE_NAME}_LIB_REQUIRED_DEP_PACKAGES: - - ``${PACKAGE_NAME}_LIB_REQUIRED_DEP_PACKAGES`` - - List of *direct* package dependencies that are required for the libraries - and non-test executables built by ``${PACKAGE_NAME}``. - - .. _${PACKAGE_NAME}_LIB_OPTIONAL_DEP_PACKAGES: - - ``${PACKAGE_NAME}_LIB_OPTIONAL_DEP_PACKAGES`` - - List of *direct* package dependencies that are only optional for the - libraries and non-test executables built by ``${PACKAGE_NAME}``. - - .. _${PACKAGE_NAME}_TEST_REQUIRED_DEP_PACKAGES: - - ``${PACKAGE_NAME}_TEST_REQUIRED_DEP_PACKAGES`` - - List of *direct* package dependencies that are required for the - tests/examples built by ``${PACKAGE_NAME}``. This list should **not** - contain any of the packages already listed in - ``${PACKAGE_NAME}_LIB_REQUIRED_DEP_PACKAGES``. - - .. _${PACKAGE_NAME}_TEST_OPTIONAL_DEP_PACKAGES: - - ``${PACKAGE_NAME}_TEST_OPTIONAL_DEP_PACKAGES``` - - List of *direct* package dependencies that are optional for the - tests/examples built by ``${PACKAGE_NAME}``. This list should **not** - contain any of the packages listed in - ``${PACKAGE_NAME}_LIB_REQUIRED_DEP_PACKAGES``, - ``${PACKAGE_NAME}_LIB_OPTIONAL_DEP_PACKAGES``, or - ``${PACKAGE_NAME}_TEST_REQUIRED_DEP_PACKAGES``. - -Given the above upstream dependency list variables, the following derived list -variables are then constructed which provide navigation from a package to its -downstream/forward dependent packages: - - ``${PACKAGE_NAME}_FORWARD_LIB_REQUIRED_DEP_PACKAGES`` - - For a given package ``${PACKAGE_NAME}``, lists the names of all of the - forward packages ``${FORWARD_PACKAGE_NAME}`` that list this package in - their ``${FORWARD_PACKAGE_NAME}_LIB_REQUIRED_DEP_PACKAGES`` variables. - - ``${PACKAGE_NAME}_FORWARD_LIB_OPTIONAL_DEP_PACKAGES`` - - For a given package ``${PACKAGE_NAME}``, lists the names of all of the - forward packages ``${FORWARD_PACKAGE_NAME}`` that list this package in - their ``${FORWARD_PACKAGE_NAME}_LIB_OPTIONAL_DEP_PACKAGES`` variables. - - ``${PACKAGE_NAME}_FORWARD_TEST_REQUIRED_DEP_PACKAGES`` - - For a given package ``${PACKAGE_NAME}``, lists the names of all of the - forward packages ``${FORWARD_PACKAGE_NAME}`` that list this package in - their ``${FORWARD_PACKAGE_NAME}_TEST_REQUIRED_DEP_PACKAGES`` variables. - - ``${PACKAGE_NAME}_FORWARD_TEST_OPTIONAL_DEP_PACKAGES`` - - For a given package ``${PACKAGE_NAME}``, lists the names of all of the - forward packages ``${FORWARD_PACKAGE_NAME}`` that list this package in - their ``${FORWARD_PACKAGE_NAME}_TEST_OPTIONAL_DEP_PACKAGES`` variables. - - Function call tree for constructing package dependency graph ------------------------------------------------------------ diff --git a/cmake/tribits/core/package_arch/TribitsTestCategories.cmake b/cmake/tribits/core/package_arch/TribitsTestCategories.cmake index c0058c9c7cd8..acd55cee153d 100644 --- a/cmake/tribits/core/package_arch/TribitsTestCategories.cmake +++ b/cmake/tribits/core/package_arch/TribitsTestCategories.cmake @@ -40,6 +40,7 @@ include(FindListElement) include(MessageWrapper) include(Join) +include(TribitsDeprecatedHelpers) # Define the valid categories that will be recognized in the CATEGORIES keyword @@ -97,7 +98,7 @@ function(tribits_filter_and_assert_categories CATEGORIES_VAR_INOUT) set(CATEGORIES_OUT) foreach(CATEGORY ${${CATEGORIES_VAR_INOUT}}) if (CATEGORY STREQUAL "WEEKLY") - message_wrapper(WARNING "Warning: The test category 'WEEKLY' is deprecated" + tribits_deprecated("The test category 'WEEKLY' is deprecated" " and is replaced with 'HEAVY'. Please change to use 'HEAVY' instead.") list(APPEND CATEGORIES_OUT "HEAVY") else() diff --git a/cmake/tribits/core/package_arch/TribitsTplDeclareLibraries.cmake b/cmake/tribits/core/package_arch/TribitsTplDeclareLibraries.cmake index 16e8bae9e60e..aa808d8e8fc8 100644 --- a/cmake/tribits/core/package_arch/TribitsTplDeclareLibraries.cmake +++ b/cmake/tribits/core/package_arch/TribitsTplDeclareLibraries.cmake @@ -38,11 +38,12 @@ # @HEADER include(TribitsTplFindIncludeDirsAndLibraries) +include(TribitsDeprecatedHelpers) function(tribits_tpl_declare_libraries TPL_NAME) - message(WARNING - "WARNING: tribits_tpl_declare_libraries() is deprecated, instead use" - " tribits_tpl_find_include_dirs_and_libraries()!" + tribits_deprecated_command(tribits_tpl_declare_libraries + MESSAGE + "Use tribits_tpl_find_include_dirs_and_libraries() instead." " Make this change in the file:\n" " ${${TPL_NAME}_FINDMOD}\n" "which is pointed to by the file:\n" diff --git a/cmake/tribits/core/package_arch/TribitsWriteClientExportFiles.cmake b/cmake/tribits/core/package_arch/TribitsWriteClientExportFiles.cmake index 1f31b6ec0c01..7ef8f2666bd4 100644 --- a/cmake/tribits/core/package_arch/TribitsWriteClientExportFiles.cmake +++ b/cmake/tribits/core/package_arch/TribitsWriteClientExportFiles.cmake @@ -178,125 +178,11 @@ function(tribits_write_flexible_package_client_export_files) print_var(EXPORT_FILE_VAR_PREFIX) endif() - # - # B) Get the set of upstream packages for this package that are enabled, - # libraries, library dirs, and include dirs - # - - set(FULL_PACKAGE_SET "") - set(FULL_LIBRARY_SET "") - - - if (TRIBITS_WRITE_FLEXIBLE_PACKAGE_CLIENT_EXPORT_FILES_DEBUG_DUMP) - print_var(${PACKAGE_NAME}_FULL_ENABLED_DEP_PACKAGES) - endif() - - foreach(TRIBITS_PACKAGE ${${PACKAGE_NAME}_FULL_ENABLED_DEP_PACKAGES}) - - if (TRIBITS_WRITE_FLEXIBLE_PACKAGE_CLIENT_EXPORT_FILES_DEBUG_DUMP) - print_var(TRIBITS_PACKAGE) - if (${PROJECT_NAME}_ENABLE_${TRIBITS_PACKAGE}) - print_var(${TRIBITS_PACKAGE}_HAS_NATIVE_LIBRARIES_TO_INSTALL) - endif() - endif() - - set(APPEND_THE_PACKAGE TRUE) - set(APPEND_THE_PACKAGE_LIBS TRUE) - - if (NOT ${TRIBITS_PACKAGE}_HAS_NATIVE_LIBRARIES_TO_INSTALL) - set(APPEND_THE_PACKAGE_LIBS FALSE) - endif() - - if (APPEND_THE_PACKAGE) - list(APPEND FULL_PACKAGE_SET ${TRIBITS_PACKAGE}) - if (APPEND_THE_PACKAGE_LIBS) - append_set(FULL_LIBRARY_SET ${${TRIBITS_PACKAGE}_LIBRARIES}) - else() - if (TRIBITS_WRITE_FLEXIBLE_PACKAGE_CLIENT_EXPORT_FILES_DEBUG_DUMP) - message("-- " "Skipping adding the package libs!") - endif() - endif() - else() - if (TRIBITS_WRITE_FLEXIBLE_PACKAGE_CLIENT_EXPORT_FILES_DEBUG_DUMP) - message("-- " "Skipping adding the package!") - endif() - endif() - - if (TRIBITS_WRITE_FLEXIBLE_PACKAGE_CLIENT_EXPORT_FILES_DEBUG_DUMP) - print_var(FULL_PACKAGE_SET) - print_var(FULL_LIBRARY_SET) - endif() - - endforeach() - - # Must prepend the current package and its libraries itself so that we get - # its TPLs libraries. However, if the current package has no native - # libraries (yet), then there is no point in listing the package or its - # TPLs. Why would a package list TPLs (with actual libraries) if itself - # does not have libraries to export? Note, this does not affect internal - # tests and examples which could have TPLs but no native libraries. - if (${PACKAGE_NAME}_LIBRARIES AND ${PACKAGE_NAME}_HAS_NATIVE_LIBRARIES_TO_INSTALL) - prepend_set(FULL_PACKAGE_SET ${PACKAGE_NAME}) - prepend_set(FULL_LIBRARY_SET ${${PACKAGE_NAME}_LIBRARIES}) - endif() - - if (TRIBITS_WRITE_FLEXIBLE_PACKAGE_CLIENT_EXPORT_FILES_DEBUG_DUMP) - message("-- " "*** Final sets of packages, libs, include dirs, and lib dirs:") - print_var(FULL_PACKAGE_SET) - print_var(FULL_LIBRARY_SET) - endif() - - # - # C) Get the set of TPLs for this package that are enabled - # - - # C.1) Get the set of enabled TPLs - - set(FULL_TPL_SET "") - foreach(TRIBITS_PACKAGE ${FULL_PACKAGE_SET}) - list(APPEND FULL_TPL_SET ${${TRIBITS_PACKAGE}_LIB_REQUIRED_DEP_TPLS}) - set(OPTIONAL_TPLS ${${TRIBITS_PACKAGE}_LIB_OPTIONAL_DEP_TPLS}) - foreach(TPL ${OPTIONAL_TPLS}) - # Only add if support for the optional TPL is enabled in this - # package. Don't just check if the TPL is enabled! - if(${TRIBITS_PACKAGE}_ENABLE_${TPL}) - list(APPEND FULL_TPL_SET ${TPL}) - endif() - endforeach() - endforeach() - if (TRIBITS_WRITE_FLEXIBLE_PACKAGE_CLIENT_EXPORT_FILES_DEBUG_DUMP) - print_var(FULL_TPL_SET) - endif() - - # C.2) Sort the TPLs according to the master TPL list - - #We will use the complete list of supported tpls for the project - #to help us create a properly ordered list of tpls. - if (FULL_TPL_SET) - set(ORDERED_FULL_TPL_SET ${FULL_TPL_SET}) - tribits_sort_list_according_to_master_list("${${PROJECT_NAME}_REVERSE_DEFINED_TPLS}" - ORDERED_FULL_TPL_SET) - endif() - - if (TRIBITS_WRITE_FLEXIBLE_PACKAGE_CLIENT_EXPORT_FILES_DEBUG_DUMP) - print_var(ORDERED_FULL_TPL_SET) - endif() - - # - # D) Get the libraries, library dirs, and the include dirs for the - # upstream enabled TPLs - # - - set(${PACKAGE_NAME}_TPL_LIBRARIES "") - foreach(TPL ${ORDERED_FULL_TPL_SET}) - list(APPEND ${PACKAGE_NAME}_TPL_LIBRARIES ${TPL}::all_libs) - endforeach() - # Generate a note discouraging editing of the Config.cmake file set(DISCOURAGE_EDITING "Do not edit: This file was generated automatically by CMake.") # - # E) Deal with the library rpath issues with shared libs + # B) Deal with the library rpath issues with shared libs # # Write the specification of the rpath if necessary. This is only needed if @@ -309,14 +195,14 @@ function(tribits_write_flexible_package_client_export_files) endif() # - # F) Create the contents of the Config.cmake file for the build tree + # C) Create the contents of the Config.cmake file for the build tree # tribits_generate_package_config_file_for_build_tree(${PACKAGE_NAME} EXPORT_FILE_VAR_PREFIX ${EXPORT_FILE_VAR_PREFIX}) # - # G) Create Config_install.cmake file for the install tree + # D) Create Config_install.cmake file for the install tree # tribits_generate_package_config_file_for_install_tree(${PACKAGE_NAME} @@ -787,28 +673,6 @@ function(tribits_write_project_client_export_files) # Custom code in configuration file. set(PROJECT_CONFIG_CODE "") - # # Export targets from the build tree. - # if(FULL_LIBRARY_SET) - # list(SORT FULL_LIBRARY_SET) - # list(REMOVE_DUPLICATES FULL_LIBRARY_SET) - # set(FULL_LIBRARY_TARGET_SET) - # foreach(LIB_ELE ${FULL_LIBRARY_SET}) - # if (TARGET ${LIB_ELE}) - # list(APPEND FULL_LIBRARY_TARGET_SET ${LIB_ELE}) - # endif() - # endforeach() - # export(TARGETS ${FULL_LIBRARY_TARGET_SET} FILE - # "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake") - # # Import the targets in applications. - # set(PROJECT_CONFIG_CODE "${PROJECT_CONFIG_CODE} - ## Import ${PROJECT_NAME} targets - #if(NOT ${PROJECT_NAME}_TARGETS_IMPORTED) - # set(${PROJECT_NAME}_TARGETS_IMPORTED 1) - # include(\"${PROJECT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake\") - #endif() - #") - # endif() - # Appending the logic to include each package's config file. set(LOAD_CODE "# Load configurations from enabled packages") foreach(TRIBITS_PACKAGE ${FULL_PACKAGE_SET}) @@ -916,7 +780,6 @@ include(\"${${TRIBITS_PACKAGE}_BINARY_DIR}/${TRIBITS_PACKAGE}Config.cmake\")") endfunction() - macro(tribits_set_compiler_var_for_config_file LANG FOR_DIR) if (NOT "${CMAKE_${LANG}_COMPILER_FOR_CONFIG_FILE_${FOR_DIR}}" STREQUAL "") set(CMAKE_${LANG}_COMPILER_FOR_CONFIG_FILE diff --git a/cmake/tribits/core/utils/AppendStringVar.cmake b/cmake/tribits/core/utils/AppendStringVar.cmake index 9b4e553a1494..dbd0c1fb5d1b 100644 --- a/cmake/tribits/core/utils/AppendStringVar.cmake +++ b/cmake/tribits/core/utils/AppendStringVar.cmake @@ -39,6 +39,7 @@ include(ConcatStrings) include(PrintVar) +include(TribitsDeprecatedHelpers) # @FUNCTION: append_string_var() @@ -60,6 +61,8 @@ include(PrintVar) # string(APPEND "" "" ...) # function(append_string_var STRING_VAR_OUT) + tribits_deprecated_command(append_string_var + MESSAGE "Use string(APPEND) instead.") #message("APPEND_STRING_VAR: ${STRING_VAR_OUT} {${ARGN}}") concat_strings( STRING_VAR "${${STRING_VAR_OUT}}" ${ARGN} ) #print_var( STRING_VAR ) diff --git a/cmake/tribits/core/utils/CMakeOverrides.cmake b/cmake/tribits/core/utils/CMakeOverrides.cmake deleted file mode 100644 index 1c95ecfdb703..000000000000 --- a/cmake/tribits/core/utils/CMakeOverrides.cmake +++ /dev/null @@ -1,117 +0,0 @@ -# @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(CMakeParseArguments) - -# -# FUNCTION: tribits_include_directories() -# - -# This function is to override the standard behavior of include_directories -# for a TriBITS package. - -# Usage:: -# -# tribits_include_directories( -# [REQUIRED_DURING_INSTALLATION_TESTING] ... -# ) -# -# If specified, ``REQUIRED_DURING_INSTALLATION_TESTING`` can appear anywhere -# in the argument list. -# -# This function allows overriding the default behavior for installation -# testing, to ensure that include directories will not be inadvertently added -# to the build lines for tests during installation testing. Normally we want -# the include directories to be handled as cmake usually does. However during -# TriBITS installation testing we do not want most of the include directories -# to be used as the majority of the files should come from the installation we -# are building against. There is an exception to this and that is when there -# are test only headers that are needed. For that case we allow people to set -# ``REQUIRED_DURING_INSTALLATION_TESTING`` to tell us that this include -# directory does need to be set for instaltion testing. -# -function(tribits_include_directories) - cmake_parse_arguments( - #prefix - PARSE - #Options - "REQUIRED_DURING_INSTALLATION_TESTING" - #one_value_keywords - "" - #multi_value_keywords - "" - ${ARGN} - ) - - tribits_check_for_unparsed_arguments() - - if(NOT ${PROJECT_NAME}_ENABLE_INSTALLATION_TESTING OR PARSE_REQUIRED_DURING_INSTALLATION_TESTING) - _include_directories(${PARSE_DEFAULT_ARGS}) - endif() -endfunction() - -#This function is to override the standard behavior of include_directories. -# We are overriding the default behavior for installation testing, this allows -#us to ensure that include directories will not be inadvertently added to the -#build lines for tests during installation testing. Normally we want the include -#directories to be handled as cmake usually does.However during installation -#testing we do not want most of the include directories to be used as the majority -#of the files should come from the installation we are building against. There is -#an exception to this and that is when there are test only headers that are needed. -#For that case we allow people to set "REQUIRED_DURING_INSTALLATION_TESTING" to -#tell us that this include directory does need to be set for instaltion testing. -function(include_directories) - cmake_parse_arguments( - #prefix - PARSE - #Options - "REQUIRED_DURING_INSTALLATION_TESTING" - #one_value_keywords - "" - #multi_value_keywords - "" - ${ARGN} - ) - - tribits_check_for_unparsed_arguments() - - if(NOT ${PROJECT_NAME}_ENABLE_INSTALLATION_TESTING OR PARSE_REQUIRED_DURING_INSTALLATION_TESTING) - _include_directories(${PARSE_DEFAULT_ARGS}) - endif() -endfunction() diff --git a/cmake/tribits/core/utils/ParseVariableArguments.cmake b/cmake/tribits/core/utils/ParseVariableArguments.cmake index 92e1b060fd15..da2e58ad2099 100644 --- a/cmake/tribits/core/utils/ParseVariableArguments.cmake +++ b/cmake/tribits/core/utils/ParseVariableArguments.cmake @@ -37,14 +37,12 @@ # ************************************************************************ # @HEADER -# Set up to use cmake_parse_arguments() function! -include(CMakeParseArguments) -# NOTE: For CMake versions 3.5.0 and above, this module is empty so the -# natively implemented function cmake_parse_arguments() will get used! +include(TribitsDeprecatedHelpers) + macro(parse_arguments_deprecated_warning) - message(DEPRECATION "parse_arguments() is deprecated and should not be used." - " Instead use cmake_parse_arguments()") + tribits_deprecated_command(parse_arguments + MESSAGE "Use cmake_parse_arguments() instead.") endmacro() parse_arguments_deprecated_warning() diff --git a/cmake/tribits/core/utils/TribitsAddEnumCacheVar.cmake b/cmake/tribits/core/utils/TribitsAddEnumCacheVar.cmake new file mode 100644 index 000000000000..2ee30b7ed9d4 --- /dev/null +++ b/cmake/tribits/core/utils/TribitsAddEnumCacheVar.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(TribitsParseArgumentsHelpers) + + +# @FUNCTION: tribits_add_enum_cache_var() +# +# Set up a string cache variable that must match a fixed set of values +# (i.e. an enum) and assert that it matches those values. +# +# Usage:: +# +# tribits_add_enum_cache_var( +# DEFAULT_VAL +# DOC_STRING "" +# ALLOWED_STRINGS_LIST "" "" ... +# [IS_ADVANCED] +# ) +# +# On output, ```` will be set to the list of paths +# +function(tribits_add_enum_cache_var cacheVarName defaultVal docString + isAdvanced allowedStringsListName + ) + # Parse input arguments + set(argOneValArgKeywords DEFAULT_VAL DOC_STRING) + set(argMultiValArgKeywords ALLOWED_STRINGS_LIST) + cmake_parse_arguments(PARSE_ARGV 1 PREFIX + "IS_ADVANCED" # options + "" # one_value_keywords + "${argOneValArgKeywords};${argMultiValArgKeywords}" # multi_value_keywords + ) + tribits_check_for_unparsed_arguments(PREFIX) + tribits_assert_parse_arg_one_value(PREFIX ${argOneValArgKeywords}) + tribits_assert_parse_arg_one_or_more_values(PREFIX ${argMultiValArgKeywords}) + # Human readable list of allowed values: '', '', ... + string(REPLACE ";" "', '" validStringValuesListStr "'${PREFIX_ALLOWED_STRINGS_LIST}'") + # Set cache var + set(${cacheVarName} ${PREFIX_DEFAULT_VAL} CACHE STRING + "${PREFIX_DOC_STRING}. Valid values: ${validStringValuesListStr} (default '${PREFIX_DEFAULT_VAL}')") + if (PREFIX_IS_ADVANCED) + mark_as_advanced(${cacheVarName}) + endif() + set_property(CACHE ${cacheVarName} PROPERTY STRINGS + ${PREFIX_ALLOWED_STRINGS_LIST} ) + # Assert in list of allowed strings + if (NOT ${cacheVarName} IN_LIST PREFIX_ALLOWED_STRINGS_LIST) + message(FATAL_ERROR "Error, the cache var ${cacheVarName} with value" + " '${${cacheVarName}}' is not in the list of allowed values:" + " ${validStringValuesListStr} (default '${PREFIX_DEFAULT_VAL}')" ) + endif() +endfunction() diff --git a/cmake/tribits/core/utils/SetAndIncDirs.cmake b/cmake/tribits/core/utils/TribitsCreateReverseList.cmake similarity index 80% rename from cmake/tribits/core/utils/SetAndIncDirs.cmake rename to cmake/tribits/core/utils/TribitsCreateReverseList.cmake index 80d4f688c40b..2f84d8c4781d 100644 --- a/cmake/tribits/core/utils/SetAndIncDirs.cmake +++ b/cmake/tribits/core/utils/TribitsCreateReverseList.cmake @@ -38,19 +38,15 @@ # @HEADER -# @MACRO: set_and_inc_dirs() +# @MACRO: tribits_create_reverse_list() # -# Set a variable to an include directory and call ``include_directories()`` -# (removes boiler-plate code). +# Create a reverse list var in one shot. # -# Usage: +# Usage:: # -# set_and_inc_dirs( ) +# tribits_create_reverse_list( ) # -# On output, this sets ```` to ```` in the local scope -# and calls ``include_directories()``. -# -macro(set_and_inc_dirs DIR_VAR_NAME INCLUDE_DIR) - set(${DIR_VAR_NAME} ${INCLUDE_DIR}) - include_directories(${${DIR_VAR_NAME}}) +macro(tribits_create_reverse_list oldListName newListName) + set(${newListName} ${${oldListName}}) + list(REVERSE ${newListName}) endmacro() diff --git a/cmake/tribits/core/utils/TribitsDeprecatedHelpers.cmake b/cmake/tribits/core/utils/TribitsDeprecatedHelpers.cmake new file mode 100644 index 000000000000..0ae57138e050 --- /dev/null +++ b/cmake/tribits/core/utils/TribitsDeprecatedHelpers.cmake @@ -0,0 +1,121 @@ +# @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(MessageWrapper) +include(TribitsParseArgumentsHelpers) + + +set(TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE_VALUES_THAT_CALL_MESSAGE + DEPRECATION AUTHOR_WARNING SEND_ERROR FATAL_ERROR ) +set(TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE_VALUES_THAT_DONT_CALL_MESSAGE + IGNORE ) +set(TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE_ALL_VALID_VALUES + ${TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE_VALUES_THAT_CALL_MESSAGE} + ${TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE_VALUES_THAT_DONT_CALL_MESSAGE} ) + + +# @FUNCTION: tribits_deprecated() +# +# Notify the user that some TriBITS functionality is deprecated. +# +# Usage:: +# +# tribits_deprecated() +# +# Depending on the value of the cache variable +# `TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE`_, this can do one of several +# things: +# +# - ``DEPRECATION`` or empty string (or variable not defined): Issue a CMake +# ``DEPRECATION`` message and continue. +# - ``AUTHOR_WARNING``: Issue a CMake ``AUTHOR_WARNING`` message and continue. +# - ``SEND_ERROR``: Issue a CMake ``SEND_ERROR`` message and continue. +# - ``FATAL_ERROR``: Issue a CMake ``FATAL_ERROR`` message and exit. +# - ``IGNORE``: Issue no message and continue. +# +function(tribits_deprecated) + cmake_parse_arguments(PARSE_ARGV 0 FWD "" "" "") + + if ("${TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE}" STREQUAL "") + set(TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE DEPRECATION) + endif() + + if ("${TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE}" IN_LIST TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE_VALUES_THAT_CALL_MESSAGE) + message_wrapper("${TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE}" + ${FWD_UNPARSED_ARGUMENTS} + "\n\nNOTE: To Make these warnings go away, set -D" + " TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE=IGNORE (see the build reference guide).") + elseif (NOT "${TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE}" IN_LIST + TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE_ALL_VALID_VALUES + ) + message_wrapper(FATAL_ERROR "Invalid value for" + " TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE=" + "'${TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE}'") + endif() +endfunction() + + +# @FUNCTION: tribits_deprecated_command() +# +# Notify the user that a TriBITS function or macro is deprecated. This should +# be the first command called at the top of any deprecated function or macro. +# +# Usage:: +# +# tribits_deprecated_command( +# [MESSAGE ] +# ) +# +function(tribits_deprecated_command name) + # Parse input arguments + set(argMultiValArgKeywords MESSAGE) + cmake_parse_arguments(PARSE_ARGV 1 PREFIX + "" # options + "" # one_value_keywords + "${argMultiValArgKeywords}" # multi_value_keywords + ) + tribits_check_for_unparsed_arguments(PREFIX) + + set(deprecationMessage "TriBITS command '${name}' is deprecated.") + if (NOT "${PREFIX_MESSAGE}" STREQUAL "") + string(APPEND deprecationMessage "\n\n${PREFIX_MESSAGE}") + endif() + + tribits_deprecated("${deprecationMessage}") +endfunction() diff --git a/cmake/tribits/ctest_driver/TribitsCTestDriverCoreHelpers.cmake b/cmake/tribits/ctest_driver/TribitsCTestDriverCoreHelpers.cmake index c6135cb88c70..837ddf05e5f8 100644 --- a/cmake/tribits/ctest_driver/TribitsCTestDriverCoreHelpers.cmake +++ b/cmake/tribits/ctest_driver/TribitsCTestDriverCoreHelpers.cmake @@ -249,8 +249,8 @@ macro(tribits_setup_packages) # Second, the extra repos do not even exist in the "driver" source # tree. - set(${PROJECT_NAME}_ASSERT_MISSING_PACKAGES FALSE) - set(${PROJECT_NAME}_OUTPUT_DEPENDENCY_FILES FALSE) + set(${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES OFF) + set(${PROJECT_NAME}_OUTPUT_DEPENDENCY_FILES FALSE) if (CTEST_GENERATE_OUTER_DEPS_XML_OUTPUT_FILE) set(${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE "${PROJECT_BINARY_DIR}/${${PROJECT_NAME}_PACKAGE_DEPS_XML_FILE_NAME}") diff --git a/cmake/tribits/doc/build_ref/TribitsBuildReferenceBody.rst b/cmake/tribits/doc/build_ref/TribitsBuildReferenceBody.rst index 9abf82ed5cd2..07f0570a2b6f 100644 --- a/cmake/tribits/doc/build_ref/TribitsBuildReferenceBody.rst +++ b/cmake/tribits/doc/build_ref/TribitsBuildReferenceBody.rst @@ -427,18 +427,12 @@ To find this output, look for the line:: and the dependencies are listed below this for each package in the form:: - -- _LIB_REQUIRED_DEP_TPLS: ... - -- _LIB_OPTIONAL_DEP_TPLS: ... - -- _LIB_REQUIRED_DEP_PACKAGES: <[PKG1> ... - -- _LIB_OPTIONAL_DEP_PACKAGES: ... - -- _TEST_REQUIRED_DEP_TPLS: ... - -- _TEST_OPTIONAL_DEP_TPLS: ... - -- _TEST_REQUIRED_DEP_PACKAGES: <[PKG5> ... - -- _TEST_OPTIONAL_DEP_PACKAGES: ... - + -- _LIB_DEFINED_DEPENDENCIES: [O] <[PKG1>[R] ... + -- _TEST_DEFINED_DEPENDENCIES: [R] <[PKG8>[R] ... + (Dependencies that don't exist are left out of the output. For example, if -there are no ``_LIB_OPTIONAL_DEP_PACKAGES`` dependencies, then that line -is not printed.) +there are no extra test dependencies, then ``_TEST_DEFINED_DEPENDENCIES`` +will not be printed.) To also see the direct forward/downstream dependencies for each package, also include:: @@ -459,8 +453,8 @@ Enable a set of packages .. __ENABLE_TESTS: -To enable an package ```` (and optionally also its tests -and examples), configure with:: +To enable a package ```` (and optionally also its tests and +examples), configure with:: -D _ENABLE_=ON \ -D _ENABLE_ALL_OPTIONAL_PACKAGES=ON \ @@ -471,15 +465,19 @@ as all packages that ```` can use. All of the package's optional "can use" upstream dependent packages are enabled with ``-D_ENABLE_ALL_OPTIONAL_PACKAGES=ON``. However, ``-D_ENABLE_TESTS=ON`` will only enable tests and examples for -```` (or any other packages specifically enabled). +```` (and any other packages explicitly enabled). -If a TriBITS package ```` has subpackages (e.g. ````, -````, etc.), then enabling the package is equivalent to setting:: +If a TriBITS package ```` has subpackages (e.g. subpackages +````, ````, ...), then enabling the package is equivalent to enabling +all of the required **and optional** subpackagses:: -D _ENABLE_=ON \ -D _ENABLE_=ON \ ... +(In this case, the parent package's optional subpackages are enabled +regardless the value of ``_ENABLE_ALL_OPTIONAL_PACKAGES``.) + However, a TriBITS subpackage will only be enabled if it is not already disabled either explicitly or implicitly. @@ -494,9 +492,6 @@ statement in an input ```*.cmake`` options files. However, setting ``-DXXX_ENABLE_YYY=TRUE`` and ``-DXXX_ENABLE_YYY=FALSE`` is allowed and will be interpreted correctly.. -NOTE: Setting ``_ENABLE_TESTS=ON`` also causes -``_ENABLE_EXAMPLES=ON`` to be set by default as well. - Enable or disable tests for specific packages +++++++++++++++++++++++++++++++++++++++++++++ @@ -517,7 +512,8 @@ packages. If one wants to enable a package along with the enable of other packages, but not the test suite for that package, then one can use a "exclude-list" -appraoch to disable the tests for that package by configuring with:: +appraoch to disable the tests for that package by configuring with, for +example:: -D _ENABLE_=ON \ -D _ENABLE_=ON \ @@ -527,12 +523,12 @@ appraoch to disable the tests for that package by configuring with:: The above will enable the package test suites for ```` and ```` but **not** for ```` (or any other -packages that might get implicitly enabled). One might use this if one wants -to build and install package ```` but does not want to -build and run the test suite for that package. +packages that might get implicitly enabled). One might use this approch if +one wants to build and install package ```` but does not +want to build and run the test suite for that package. Alternatively, one can use an "include-list" appraoch to enable packages and -only enable tests for specific packages. For example, configuring with:: +only enable tests for specific packages, for example, configuring with:: -D _ENABLE_=ON \ -D _ENABLE_TESTS=ON \ @@ -558,7 +554,7 @@ Enable to test all effects of changing a given package(s) .. __ENABLE_ALL_FORWARD_DEP_PACKAGES: -To enable an package ```` to test it and all of its +To enable a package ```` to test it and all of its down-stream packages, configure with:: -D _ENABLE_=ON \ @@ -568,8 +564,9 @@ down-stream packages, configure with:: The above set of arguments will result in package ```` and all packages that depend on ```` to be enabled and have all of their tests turned on. Tests will not be enabled in packages that do not -depend on ```` in this case. This speeds up and robustifies -pre-push testing. +depend (at least implicitly) on ```` in this case. This +speeds up and robustifies testing for changes in specific packages (like in +per-merge testing in a continuous integration process). NOTE: setting ``_ENABLE_ALL_FORWARD_DEP_PACKAGES=ON`` also automatically sets and overrides `_ENABLE_ALL_OPTIONAL_PACKAGES`_ to @@ -580,7 +577,7 @@ packages for testing purposes unless you are enabling all optional packages.) Enable all packages (and optionally all tests) ++++++++++++++++++++++++++++++++++++++++++++++ -To enable all defined packages and subpackages add the configure option:: +To enable all defined packages, add the configure option:: -D _ENABLE_ALL_PACKAGES=ON \ @@ -589,13 +586,12 @@ packages, add the configure option:: -D _ENABLE_TESTS=ON \ -Specific packages can be disabled (i.e. "black-listed") by adding +Specific packages can be disabled (i.e. "exclude-listed") by adding ``_ENABLE_=OFF``. This will also disable all packages that depend on ````. Note, all examples are also enabled by default when setting -``_ENABLE_TESTS=ON`` (and so examples are considered a subset of the -tests). +``_ENABLE_TESTS=ON``. By default, setting ``_ENABLE_ALL_PACKAGES=ON`` only enables primary tested (PT) packages and code. To have this also enable all secondary tested @@ -613,50 +609,58 @@ details. Disable a package and all its dependencies ++++++++++++++++++++++++++++++++++++++++++ -To disable an package and all of the packages that depend on it, add the -configure options:: +To disable a package and all of the packages that depend on it, add the +configure option:: -D _ENABLE_=OFF For example:: - -D _ENABLE_=ON \ + -D _ENABLE_=ON \ -D _ENABLE_ALL_OPTIONAL_PACKAGES=ON \ - -D _ENABLE_=ON \ + -D _ENABLE_=OFF \ -will enable ```` and all of the packages that it depends on except -for ```` and all of its forward dependencies. +will enable ```` and all of the packages that it depends on +except for ```` and all of its forward dependencies. -If a TriBITS package ```` has subpackages (e.g. ````, -````, etc.), then disabling the package is equivalent to setting:: +If a TriBITS package ```` has subpackages (e.g. a parent +package with subpackages ````, ````, ...), then disabling the parent +package is equivalent to disabling all of the required and optional +subpackages:: -D _ENABLE_=OFF \ -D _ENABLE_=OFF \ ... -The disable of the subpackage is this case will override any enables. +The disable of the subpackages in this case will override any enables. + +.. __DISABLE_ENABLED_FORWARD_DEP_PACKAGES: If a disabled package is a required dependency of some explicitly enabled -downstream package, then the configure will error out if -``_DISABLE_ENABLED_FORWARD_DEP_PACKAGES=OFF``. Otherwise, a WARNING -will be printed and the downstream package will be disabled and configuration -will continue. +downstream package, then the configure will error out if:: + + -D _DISABLE_ENABLED_FORWARD_DEP_PACKAGES=OFF \ + +is set. Otherwise, if ``_DISABLE_ENABLED_FORWARD_DEP_PACKAGES=ON``, +a ``NOTE`` will be printed and the downstream package will be disabled and +configuration will continue. Remove all package enables in the cache +++++++++++++++++++++++++++++++++++++++ To wipe the set of package enables in the ``CMakeCache.txt`` file so they can -be reset again from scratch, configure with:: +be reset again from scratch, re-configure with:: - $ ./-do-confiugre -D _UNENABLE_ENABLED_PACKAGES=TRUE + $ cmake -D _UNENABLE_ENABLED_PACKAGES=TRUE . This option will set to empty '' all package enables, leaving all other cache variables as they are. You can then reconfigure with a new set of package enables for a different set of packages. This allows you to avoid more -expensive configure time checks and to preserve other cache variables that you -have set and don't want to loose. For example, one would want to do this to -avoid compiler and TPL checks. +expensive configure time checks (like the standard CMake compiler checks) and +to preserve other cache variables that you have set and don't want to loose. +For example, one would want to do this to avoid more expensive compiler and +TPL checks. Selecting compiler and linker options @@ -1595,27 +1599,70 @@ NOTE: Newer versions of CMake may automatically determine when these options need to be turned on so watch for that in looking at the build lines. +External Packages/Third-Party Library (TPL) support +--------------------------------------------------- + +A set of external packages/third-party libraries (TPL) can be enabled and +disabled and the locations of those can be specified at configure time (if +they are not found in the default path). + + Enabling support for an optional Third-Party Library (TPL) ----------------------------------------------------------- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -To enable a given TPL, set:: +To enable a given external packages/TPL, set:: -D TPL_ENABLE_=ON where ```` = ``BLAS``, ``LAPACK`` ``Boost``, ``Netcdf``, etc. +(Requires TPLs for enabled package will automatically be enabled.) The full list of TPLs that is defined and can be enabled is shown by doing a configure with CMake and then grepping the configure output for ``Final set of -.* TPLs``. The set of TPL names listed in ``'Final set of enabled external packages/TPLs'`` and -``'Final set of non-enabled external packages/TPLs'`` gives the full list of TPLs that can be -enabled (or disabled). +.* TPLs``. The set of TPL names listed in ``'Final set of enabled external +packages/TPLs'`` and ``'Final set of non-enabled external packages/TPLs'`` +gives the full list of TPLs that can be enabled (or disabled). + +Optional package-specific support for a TPL can be turned off by setting:: + + -D _ENABLE_=OFF + +This gives the user full control over what TPLs are supported by which package +independent of whether the TPL is enabled or not. + +Support for an optional TPL can also be turned on implicitly by setting:: + + -D _ENABLE_=ON + +where ```` is a TriBITS package that has an optional +dependency on ````. That will result in setting +``TPL_ENABLE_=ON`` internally (but not set in the cache) if +``TPL_ENABLE_=OFF`` is not already set. + + +Specifying the location of the parts of an enabled external package/TPL ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Once an external package/TPL is enabled, the parts of that TPL must be found. +For many external packages/TPLs, this will be done automatically by searching +the environment paths. + +Some external packages/TPLs are specified with a call to +``find_package()`` (see CMake documentation for +``find_package()``). Many other external packages/TPLs use a legacy TriBITS +system that locates the parts using the CMake commands ``find_file()`` and +``find_library()`` as described below. + +Every defined external package/TPL uses a specification provided in a +``FindTPL.cmake`` module file. This file describes how the package +is found in a way that provides modern CMake IMPORTED targets (including the +``::all_libs`` target) that is used by the downstream packages. Some TPLs require only libraries (e.g. Fortran libraries like BLAS or LAPACK), some TPL require only include directories, and some TPLs require both. -Each TPL specification is defined in a ``FindTPL.cmake`` module file. -The job of each of these of these module files is to set the CMake cache -variables: +For ``FindTPL.cmake`` files using the legacy TriBITS TPL system, a +TPL is fully specified through the following cache variables: * ``TPL__INCLUDE_DIRS:PATH``: List of paths to header files for the TPL (if the TPL supplies header files). @@ -1623,8 +1670,8 @@ variables: * ``TPL__LIBRARIES:PATH``: List of (absolute) paths to libraries, ordered as they will be on the link line (of the TPL supplies libraries). -These variables are the only variables that are actually used in the CMake -build system. Therefore, one can set these two variables as CMake cache +These variables are the only variables are used to create IMPORTED CMake +targets for the TPL. One can set these two variables as CMake cache variables, for ``SomeTPL`` for example, with:: -D TPL_SomeTPL_INCLUDE_DIRS="${LIB_BASE}/include/a;${LIB_BASE}/include/b" \ @@ -1634,7 +1681,7 @@ Using this approach, one can be guaranteed that these libraries and these include directories and will used in the compile and link lines for the packages that depend on this TPL ``SomeTPL``. -**WARNING:** When specifying ``TPL__INCLUDE_DIRS`` and/or +**NOTE:** When specifying ``TPL__INCLUDE_DIRS`` and/or ``TPL__LIBRARIES``, the build system will use these without question. It will **not** check for the existence of these directories or files so make sure that these files and directories exist before these are used in the @@ -1642,29 +1689,31 @@ compiles and links. (This can actually be a feature in rare cases the libraries and header files don't actually get created until after the configure step is complete but before the build step.) -**WARNING:** It is **not recommended** to specify the TPLs libraries as just a set -of link options as, for example:: +**NOTE:** It is generally *not recommended* to specify the TPLs libraries as +just a set of link options as, for example:: TPL_SomeTPL_LIBRARIES="-L/some/dir;-llib1;-llib2;..." -This is not compatible with proper CMake usage and it not guaranteed to be -supported for all use cases or all platforms. (CMake really wants to have -full library paths when linking.) +But this is supported as long as this link line contains only link library +directories and library names. (Link options that are not order-sensitive are +also supported like ``-mkl``.) When the variables ``TPL__INCLUDE_DIRS`` and ``TPL__LIBRARIES`` are not specified, then most ``FindTPL.cmake`` modules use a default find operation. Some will -call ``find_package()`` internally by default and some may implement -the default find in some other way. To know for sure, see the documentation -for the specific TPL (e.g. looking in the ``FindTPL.cmake`` file to -be sure). NOTE: if a given ``FindTPL.cmake`` would use -``find_package()`` by default, this can be disabled by configuring -with:: +call ``find_package()`` internally by default and some may +implement the default find in some other way. To know for sure, see the +documentation for the specific external package/TPL (e.g. looking in the +``FindTPL.cmake`` file to be sure). NOTE: if a given +``FindTPL.cmake`` will use ``find_package()`` by +default, this can be disabled by configuring with:: -D_ALLOW_PACKAGE_PREFIND=OFF -Most TPLs, however, use a standard system for finding include directories -and/or libraries based on the function +(Not all ``FindTPL.cmake`` files support this option.) + +Many ``FindTPL.cmake`` files, use the legacy TriBITS TPL system for +finding include directories and/or libraries based on the function `tribits_tpl_find_include_dirs_and_libraries()`_. These simple standard ``FindTPL.cmake`` modules specify a set of header files and/or libraries that must be found. The directories where these header files and @@ -1684,9 +1733,9 @@ library files are looked for are specified using the CMake cache variables: files will be searched for using ``find_library()``, for each library, in order. -Most ``FindTPL.cmake`` modules will define a default set of libraries -to look for and therefore ``_LIBRARY_NAMES`` can typically be left -off. +Most of these ``FindTPL.cmake`` modules will define a default set of +libraries to look for and therefore ``_LIBRARY_NAMES`` can typically +be left off. Therefore, to find the same set of libraries for ``SimpleTPL`` shown above, one would specify:: @@ -1698,30 +1747,14 @@ override that using:: -D SomeTPL_LIBRARY_NAMES="lib1;lib2" -Therefore, this is in fact the preferred way to specify the libraries for a -TPL. +Therefore, this is in fact the preferred way to specify the libraries for +these legacy TriBITS TPLs. In order to allow a TPL that normally requires one or more libraries to ignore the libraries, one can set ``_LIBRARY_NAMES`` to empty, for example:: -D _LIBRARY_NAMES="" -Optional package-specific support for a TPL can be turned off by setting:: - - -D _ENABLE_=OFF - -This gives the user full control over what TPLs are supported by which package -independent of whether the TPL is enabled or not. - -Support for an optional TPL can also be turned on implicitly by setting:: - - -D _ENABLE_=ON - -where ```` is a TriBITS package that has an optional -dependency on ````. That will result in setting -``TPL_ENABLE_=ON`` internally (but not set in the cache) if -``TPL_ENABLE_=OFF`` is not already set. - If all the parts of a TPL are not found on an initial configure, the configure will error out with a helpful error message. In that case, one can change the variables ``_INCLUDE_DIRS``, ``_LIBRARY_NAMES``, and/or @@ -1731,14 +1764,6 @@ a complete configure from scratch which saves time. Or, one can avoid the find operations by directly setting ``TPL__INCLUDE_DIRS`` and ``TPL__LIBRARIES`` as described above. -**WARNING:** The cmake cache variable ``TPL__LIBRARY_DIRS`` does -**not** control where libraries are found. Instead, this variable is set -during the find processes and is not actually used in the CMake build system -at all. - -In summary, this gives the user complete and direct control in specifying -exactly what is used in the build process. - **TPL Example 1: Standard BLAS Library** Suppose one wants to find the standard BLAS library ``blas`` in the @@ -1842,7 +1867,7 @@ libraries in the right order by configuring with:: Adjusting upstream dependencies for a Third-Party Library (TPL) ---------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Some TPLs have dependencies on one or more upstream TPLs. These dependencies must be specified correctly for the compile and links to work correctly. The @@ -1857,34 +1882,38 @@ the upstream TPLs are enabled), set:: A dependency on an upstream TPL ```` will be set if the an upstream TPL ```` is actually enabled. -If any of the specified TPLs are listed after ```` in the -``TPLsList.cmake`` file or are not enabled, then a configure-time error will -occur. +If any of the specified dependent TPLs ```` are listed after +```` in the ``TPLsList.cmake`` file (or are not listed at all), then +a configure-time error will occur. To take complete control over what dependencies an TPL has, set:: -D _LIB_ENABLED_DEPENDENCIES=";;..." If the upstream TPLs listed here are not defined upstream and enabled TPLs, -then an error will occur. +then a configure-time error will occur. Disabling support for a Third-Party Library (TPL) --------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++ Disabling a TPL explicitly can be done using:: -D TPL_ENABLE_=OFF +This will result in the disabling of any direct or indirect downstream +packages that have a required dependency on ```` as described in +`Disable a package and all its dependencies`_. + NOTE: If a disabled TPL is a required dependency of some explicitly enabled downstream package, then the configure will error out if -_DISABLE_ENABLED_FORWARD_DEP_PACKAGES=OFF. Otherwise, a WARNING will -be printed and the downstream package will be disabled and configuration will -continue. +`_DISABLE_ENABLED_FORWARD_DEP_PACKAGES`_ ``= OFF``. Otherwise, a +NOTE will be printed and the downstream package will be disabled and +configuration will continue. Disabling tentatively enabled TPLs ----------------------------------- +++++++++++++++++++++++++++++++++++ To disable a tentatively enabled TPL, set:: @@ -1908,7 +1937,7 @@ also want to explicitly disable the TPL as shown above. Require all TPL libraries be found ----------------------------------- +++++++++++++++++++++++++++++++++++ By default, some TPLs don't require that all of the libraries listed in ``_LIBRARY_NAMES`` be found. To change this behavior so that all @@ -1920,7 +1949,7 @@ This makes the configure process catch more mistakes with the env. Disable warnings from TPL header files --------------------------------------- +++++++++++++++++++++++++++++++++++++++ To disable warnings coming from included TPL header files for C and C++ code, set:: @@ -1939,9 +1968,8 @@ project is pulling in module files from TPLs. xSDK Configuration Options -------------------------- -The configure of will adhere to the xSDK configuration standard -(todo: put in reference to final document) simply by setting the CMake cache -variable:: +The configure of will adhere to the `xSDK Community Package +Policies`_ simply by setting the CMake cache variable:: -D USE_XSDK_DEFAULTS=TRUE @@ -2061,6 +2089,26 @@ This will override the global behavior set by ````. +Adjusting CMake DEPRECATION warnings +------------------------------------ + +By default, deprecated TriBITS features being used in the project's CMake +files will result in CMake deprecation warning messages (issued by calling +``message(DEPRECATION ...)`` internally). The handling of these deprecation +warnings can be changed by setting the CMake cache variable +``TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE``. For example, to remove all +deprecation warnings, set:: + + -D TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE=IGNORE + +Other valid values include: + +* ``DEPRECATION``: Issue a CMake ``DEPRECATION`` message and continue (default). +* ``AUTHOR_WARNING``: Issue a CMake ``AUTHOR_WARNING`` message and continue. +* ``SEND_ERROR``: Issue a CMake ``SEND_ERROR`` message and continue. +* ``FATAL_ERROR``: Issue a CMake ``FATAL_ERROR`` message and exit. + + Disabling deprecated code ------------------------- @@ -2887,13 +2935,19 @@ package directories. In development mode, the failure to find a package directory is usually a programming error (i.e. a miss-spelled package directory name). But in a tarball release of the project, package directories may be purposefully missing (see `Creating a tarball of the source tree`_) and -must be ignored. When building from a reduced source tarball created from the +must be ignored. + +When building from a reduced source tarball created from the development sources, set:: - -D _ASSERT_MISSING_PACKAGES=OFF + -D _ASSERT_DEFINED_DEPENDENCIES=OFF + +or to ``IGNORE``. (valid values include ``FATAL_ERROR``, ``SEND_ERROR``, +``WARNING``, ``NOTICE``, ``IGNORE`` and ``OFF``) Setting this ``OFF`` will cause the TriBITS CMake configure to simply ignore -any missing packages and turn off all dependencies on these missing packages. +any undefined packages and turn off all dependencies on these missing +packages. Another type of checking is for optional inserted/external packages (e.g. packages who's source can optionally be included and is flagged with @@ -2904,27 +2958,29 @@ printed by configuring with:: -D _WARN_ABOUT_MISSING_EXTERNAL_PACKAGES=TRUE -These warnings (starting with 'NOTE', not 'WARNING' that would otherwise -trigger warnings in CDash) about missing inserted/external packages will print -regardless of the setting for ``_ASSERT_MISSING_PACKAGES``. +These warnings starting with 'NOTE' (not starting with 'WARNING' that would +otherwise trigger warnings in CDash) about missing inserted/external packages +will print regardless of the setting for +``_ASSERT_DEFINED_DEPENDENCIES``. Finally, ``_ENABLE_DEVELOPMENT_MODE=ON`` results in a number of checks for invalid usage of TriBITS in the project's ``CMakeLists.txt`` files -and will abort configure with a fatal error on the first check failure. This -is appropriate for development mode when a project is clean of all such -invalid usage patterns but there are times when it makes sense to report these -check failures in different ways (such as when upgrading TriBITS in a project -that has some invalid usage patterns that just happen work but may be +and will, by default, abort configure with a fatal error on the first failed +check. This is appropriate for development mode when a project is clean of all +such invalid usage patterns but there are times when it makes sense to report +these check failures in different ways (such as when upgrading TriBITS in a +project that has some invalid usage patterns that just happen work but may be disallowed in future versions of TriBITS). To change how these invalid usage checks are handled, set:: -D _ASSERT_CORRECT_TRIBITS_USAGE= -where ```` can be 'FATAL_ERROR', 'SEND_ERROR', 'WARNING', or -'IGNORE'. +where ```` can be ``FATAL_ERROR``, ``SEND_ERROR``, ``WARNING``, +``IGNORE`` or ``OFF`` (where ``IGNORE`` or ``OFF`` avoids any error reporting +or warnings). For ``_ENABLE_DEVELOPMENT_MODE=OFF``, the default for -``_ASSERT_CORRECT_TRIBITS_USAGE`` is actually set to ``IGNORE``. +``_ASSERT_CORRECT_TRIBITS_USAGE`` is set to ``IGNORE``. Building (Makefile generator) @@ -4048,10 +4104,10 @@ generators on your system). NOTE: When configuring from an untarred source tree that has missing packages, one must configure with:: - -D _ASSERT_MISSING_PACKAGES=OFF + -D _ASSERT_DEFINED_DEPENDENCIES=OFF Otherwise, TriBITS will error out complaining about missing packages. (Note -that ``_ASSERT_MISSING_PACKAGES`` will default to ```OFF``` in +that ``_ASSERT_DEFINED_DEPENDENCIES`` will default to ```OFF``` in release mode, i.e. ``_ENABLE_DEVELOPMENT_MODE==OFF``.) @@ -4302,4 +4358,6 @@ dashboard``. .. _TriBITS TribitsExampleApp Tests: https://github.com/TriBITSPub/TriBITS/blob/master/test/core/ExamplesUnitTests/TribitsExampleApp_Tests.cmake +.. _xSDK Community Package Policies: https://doi.org/10.6084/m9.figshare.4495136 + .. LocalWords: templated instantiation Makefiles CMake diff --git a/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableAllPackages.txt b/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableAllPackages.txt index 07c2c9d87e59..da111da02420 100644 --- a/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableAllPackages.txt +++ b/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableAllPackages.txt @@ -8,10 +8,13 @@ Enabling all packages that are not currently disabled because of \ -- Setting Trilinos_ENABLE_ThyraEpetra=ON -- Setting Trilinos_ENABLE_Thyra=ON -Enabling all remaining required TPLs for current set of enabled packages ... +Enabling all required (and optional since Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES=ON) upstream packages for current set of enabled packages +(Trilinos_ENABLE_SECONDARY_TESTED_CODE=OFF) ... --- Setting TPL_ENABLE_BLAS=ON because it is required by the enabled package Teuchos --- Setting TPL_ENABLE_LAPACK=ON because it is required by the enabled package Teuchos +-- NOTE: Not Setting Trilinos_ENABLE_ThyraGoodStuff=ON even though Thyra has an optional dependence on ThyraGoodStuff because Trilinos_ENABLE_SECONDARY_TESTED_CODE=OFF +-- NOTE: Not Setting Trilinos_ENABLE_ThyraEpetraExt=ON even though Thyra has an optional dependence on ThyraEpetraExt because Trilinos_ENABLE_SECONDARY_TESTED_CODE=OFF +-- Setting TPL_ENABLE_BLAS=ON because Epetra has a required dependence on BLAS +-- Setting TPL_ENABLE_LAPACK=ON because Epetra has a required dependence on LAPACK Final set of enabled top-level packages: Teuchos RTOp Epetra Thyra 4 Final set of enabled packages: Teuchos RTOp Epetra ThyraCoreLibs ThyraEpetra Thyra 6 diff --git a/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyraEpetra_EnableTests.txt b/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyraEpetra_EnableTests.txt index 9ad431f62a25..0d3f79b5ccd8 100644 --- a/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyraEpetra_EnableTests.txt +++ b/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyraEpetra_EnableTests.txt @@ -21,11 +21,8 @@ Enabling all required (and optional since Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES= -- Setting Trilinos_ENABLE_ThyraCoreLibs=ON because ThyraEpetra has a required dependence on ThyraCoreLibs -- Setting Trilinos_ENABLE_Teuchos=ON because ThyraCoreLibs has a required dependence on Teuchos -- Setting Trilinos_ENABLE_RTOp=ON because ThyraCoreLibs has a required dependence on RTOp - -Enabling all remaining required TPLs for current set of enabled packages ... - --- Setting TPL_ENABLE_BLAS=ON because it is required by the enabled package Teuchos --- Setting TPL_ENABLE_LAPACK=ON because it is required by the enabled package Teuchos +-- Setting TPL_ENABLE_BLAS=ON because Epetra has a required dependence on BLAS +-- Setting TPL_ENABLE_LAPACK=ON because Epetra has a required dependence on LAPACK Enabling the shell of non-enabled parent packages (mostly for show) that have at least one subpackage enabled ... diff --git a/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests.txt b/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests.txt index 46e1cdc7ae5c..c66d07690338 100644 --- a/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests.txt +++ b/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests.txt @@ -40,17 +40,14 @@ Enabling all required (and optional since Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES= -- Setting Trilinos_ENABLE_Epetra=ON because ThyraEpetra has a required dependence on Epetra -- Setting Trilinos_ENABLE_Teuchos=ON because ThyraCoreLibs has a required dependence on Teuchos -- Setting Trilinos_ENABLE_RTOp=ON because ThyraCoreLibs has a required dependence on RTOp +-- Setting TPL_ENABLE_BLAS=ON because Epetra has a required dependence on BLAS +-- Setting TPL_ENABLE_LAPACK=ON because Epetra has a required dependence on LAPACK Enabling all optional intra-package enables _ENABLE_ that are not currently disabled if both sets of packages are enabled ... -- Setting Thyra_ENABLE_ThyraEpetra=ON since Trilinos_ENABLE_Thyra=ON AND Trilinos_ENABLE_ThyraEpetra=ON -Enabling all remaining required TPLs for current set of enabled packages ... - --- Setting TPL_ENABLE_BLAS=ON because it is required by the enabled package Teuchos --- Setting TPL_ENABLE_LAPACK=ON because it is required by the enabled package Teuchos - Final set of enabled top-level packages: Teuchos RTOp Epetra Thyra 4 Final set of enabled packages: Teuchos RTOp Epetra ThyraCoreLibs ThyraEpetra Thyra 6 Final set of non-enabled top-level packages: Triutils EpetraExt 2 diff --git a/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests_EnableBoost_ST.txt b/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests_EnableBoost_ST.txt index 00efe417fd24..3aa2f7a337f0 100644 --- a/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests_EnableBoost_ST.txt +++ b/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests_EnableBoost_ST.txt @@ -40,27 +40,38 @@ Enabling all required (and optional since Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES= -- Setting Trilinos_ENABLE_Teuchos=ON because ThyraCoreLibs has a required dependence on Teuchos -- Setting Trilinos_ENABLE_RTOp=ON because ThyraCoreLibs has a required dependence on RTOp -- Setting Trilinos_ENABLE_Triutils=ON because EpetraExt has an optional dependence on Triutils +-- Setting TPL_ENABLE_BLAS=ON because Epetra has a required dependence on BLAS +-- Setting TPL_ENABLE_LAPACK=ON because Epetra has a required dependence on LAPACK Enabling all optional intra-package enables _ENABLE_ that are \ not currently disabled if both sets of packages are enabled ... --- Setting EpetraExt_ENABLE_Triutils=ON since Trilinos_ENABLE_EpetraExt=ON \ - AND Trilinos_ENABLE_Triutils=ON --- Setting Thyra_ENABLE_ThyraGoodStuff=ON since Trilinos_ENABLE_Thyra=ON \ - AND Trilinos_ENABLE_ThyraGoodStuff=ON --- Setting Thyra_ENABLE_ThyraEpetra=ON since Trilinos_ENABLE_Thyra=ON \ - AND Trilinos_ENABLE_ThyraEpetra=ON --- Setting Thyra_ENABLE_ThyraEpetraExt=ON since Trilinos_ENABLE_Thyra=ON \ - AND Trilinos_ENABLE_ThyraEpetraExt=ON - -Enabling all remaining required TPLs for current set of enabled packages ... - --- Setting TPL_ENABLE_BLAS=ON because it is required by the enabled package Teuchos --- Setting TPL_ENABLE_LAPACK=ON because it is required by the enabled package Teuchos - -Enabling all optional package TPL support _ENABLE_ not currently disabled for enabled TPLs ... - --- Setting Teuchos_ENABLE_Boost=ON since TPL_ENABLE_Boost=ON +-- Setting Teuchos_ENABLE_BLAS=ON since Trilinos_ENABLE_Teuchos=ON AND TPL_ENABLE_BLAS=ON +-- Setting Teuchos_ENABLE_LAPACK=ON since Trilinos_ENABLE_Teuchos=ON AND TPL_ENABLE_LAPACK=ON +-- Setting Teuchos_ENABLE_Boost=ON since Trilinos_ENABLE_Teuchos=ON AND TPL_ENABLE_Boost=ON +-- NOT setting Teuchos_ENABLE_MPI=ON since MPI is NOT enabled at this point! +-- Setting RTOp_ENABLE_Teuchos=ON since Trilinos_ENABLE_RTOp=ON AND Trilinos_ENABLE_Teuchos=ON +-- Setting Epetra_ENABLE_BLAS=ON since Trilinos_ENABLE_Epetra=ON AND TPL_ENABLE_BLAS=ON +-- Setting Epetra_ENABLE_LAPACK=ON since Trilinos_ENABLE_Epetra=ON AND TPL_ENABLE_LAPACK=ON +-- NOT setting Epetra_ENABLE_MPI=ON since MPI is NOT enabled at this point! +-- Setting Triutils_ENABLE_Epetra=ON since Trilinos_ENABLE_Triutils=ON AND Trilinos_ENABLE_Epetra=ON +-- Setting EpetraExt_ENABLE_Teuchos=ON since Trilinos_ENABLE_EpetraExt=ON AND Trilinos_ENABLE_Teuchos=ON +-- Setting EpetraExt_ENABLE_Epetra=ON since Trilinos_ENABLE_EpetraExt=ON AND Trilinos_ENABLE_Epetra=ON +-- Setting EpetraExt_ENABLE_Triutils=ON since Trilinos_ENABLE_EpetraExt=ON AND Trilinos_ENABLE_Triutils=ON +-- NOT setting EpetraExt_ENABLE_UMFPACK=ON since UMFPACK is NOT enabled at this point! +-- NOT setting EpetraExt_ENABLE_AMD=ON since AMD is NOT enabled at this point! +-- NOT setting EpetraExt_ENABLE_PETSC=ON since PETSC is NOT enabled at this point! +-- Setting ThyraCoreLibs_ENABLE_Teuchos=ON since Trilinos_ENABLE_ThyraCoreLibs=ON AND Trilinos_ENABLE_Teuchos=ON +-- Setting ThyraCoreLibs_ENABLE_RTOp=ON since Trilinos_ENABLE_ThyraCoreLibs=ON AND Trilinos_ENABLE_RTOp=ON +-- Setting ThyraGoodStuff_ENABLE_ThyraCoreLibs=ON since Trilinos_ENABLE_ThyraGoodStuff=ON AND Trilinos_ENABLE_ThyraCoreLibs=ON +-- Setting ThyraEpetra_ENABLE_Epetra=ON since Trilinos_ENABLE_ThyraEpetra=ON AND Trilinos_ENABLE_Epetra=ON +-- Setting ThyraEpetra_ENABLE_ThyraCoreLibs=ON since Trilinos_ENABLE_ThyraEpetra=ON AND Trilinos_ENABLE_ThyraCoreLibs=ON +-- Setting ThyraEpetraExt_ENABLE_ThyraEpetra=ON since Trilinos_ENABLE_ThyraEpetraExt=ON AND Trilinos_ENABLE_ThyraEpetra=ON +-- Setting ThyraEpetraExt_ENABLE_EpetraExt=ON since Trilinos_ENABLE_ThyraEpetraExt=ON AND Trilinos_ENABLE_EpetraExt=ON +-- Setting Thyra_ENABLE_ThyraCoreLibs=ON since Trilinos_ENABLE_Thyra=ON AND Trilinos_ENABLE_ThyraCoreLibs=ON +-- Setting Thyra_ENABLE_ThyraGoodStuff=ON since Trilinos_ENABLE_Thyra=ON AND Trilinos_ENABLE_ThyraGoodStuff=ON +-- Setting Thyra_ENABLE_ThyraEpetra=ON since Trilinos_ENABLE_Thyra=ON AND Trilinos_ENABLE_ThyraEpetra=ON +-- Setting Thyra_ENABLE_ThyraEpetraExt=ON since Trilinos_ENABLE_Thyra=ON AND Trilinos_ENABLE_ThyraEpetraExt=ON Final set of enabled top-level packages: Teuchos RTOp Epetra Triutils EpetraExt Thyra 6 Final set of enabled packages: Teuchos RTOp Epetra Triutils EpetraExt ThyraCoreLibs \ diff --git a/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests_EnableBoost_ST_RequiredOnly.txt b/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests_EnableBoost_ST_RequiredOnly.txt index 3647d4d81d82..268535389cf3 100644 --- a/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests_EnableBoost_ST_RequiredOnly.txt +++ b/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests_EnableBoost_ST_RequiredOnly.txt @@ -47,25 +47,37 @@ Enabling all required upstream packages for current set of \ dependence on Teuchos -- Setting Trilinos_ENABLE_RTOp=ON because ThyraCoreLibs has a required \ dependence on RTOp +-- Setting TPL_ENABLE_BLAS=ON because Epetra has a required dependence on BLAS +-- Setting TPL_ENABLE_LAPACK=ON because Epetra has a required dependence on LAPACK Enabling all optional intra-package enables _ENABLE_ \ that are not currently disabled if both sets of packages are enabled ... --- Setting Thyra_ENABLE_ThyraGoodStuff=ON since Trilinos_ENABLE_Thyra=ON \ - AND Trilinos_ENABLE_ThyraGoodStuff=ON --- Setting Thyra_ENABLE_ThyraEpetra=ON since Trilinos_ENABLE_Thyra=ON \ - AND Trilinos_ENABLE_ThyraEpetra=ON --- Setting Thyra_ENABLE_ThyraEpetraExt=ON since Trilinos_ENABLE_Thyra=ON \ - AND Trilinos_ENABLE_ThyraEpetraExt=ON - -Enabling all remaining required TPLs for current set of enabled packages ... - --- Setting TPL_ENABLE_BLAS=ON because it is required by the enabled package Teuchos --- Setting TPL_ENABLE_LAPACK=ON because it is required by the enabled package Teuchos - -Enabling all optional package TPL support _ENABLE_ not currently disabled for enabled TPLs ... - --- Setting Teuchos_ENABLE_Boost=ON since TPL_ENABLE_Boost=ON +-- Setting Teuchos_ENABLE_BLAS=ON since Trilinos_ENABLE_Teuchos=ON AND TPL_ENABLE_BLAS=ON +-- Setting Teuchos_ENABLE_LAPACK=ON since Trilinos_ENABLE_Teuchos=ON AND TPL_ENABLE_LAPACK=ON +-- Setting Teuchos_ENABLE_Boost=ON since Trilinos_ENABLE_Teuchos=ON AND TPL_ENABLE_Boost=ON +-- NOT setting Teuchos_ENABLE_MPI=ON since MPI is NOT enabled at this point! +-- Setting RTOp_ENABLE_Teuchos=ON since Trilinos_ENABLE_RTOp=ON AND Trilinos_ENABLE_Teuchos=ON +-- Setting Epetra_ENABLE_BLAS=ON since Trilinos_ENABLE_Epetra=ON AND TPL_ENABLE_BLAS=ON +-- Setting Epetra_ENABLE_LAPACK=ON since Trilinos_ENABLE_Epetra=ON AND TPL_ENABLE_LAPACK=ON +-- NOT setting Epetra_ENABLE_MPI=ON since MPI is NOT enabled at this point! +-- Setting EpetraExt_ENABLE_Teuchos=ON since Trilinos_ENABLE_EpetraExt=ON AND Trilinos_ENABLE_Teuchos=ON +-- Setting EpetraExt_ENABLE_Epetra=ON since Trilinos_ENABLE_EpetraExt=ON AND Trilinos_ENABLE_Epetra=ON +-- NOT setting EpetraExt_ENABLE_Triutils=ON since Triutils is NOT enabled at this point! +-- NOT setting EpetraExt_ENABLE_UMFPACK=ON since UMFPACK is NOT enabled at this point! +-- NOT setting EpetraExt_ENABLE_AMD=ON since AMD is NOT enabled at this point! +-- NOT setting EpetraExt_ENABLE_PETSC=ON since PETSC is NOT enabled at this point! +-- Setting ThyraCoreLibs_ENABLE_Teuchos=ON since Trilinos_ENABLE_ThyraCoreLibs=ON AND Trilinos_ENABLE_Teuchos=ON +-- Setting ThyraCoreLibs_ENABLE_RTOp=ON since Trilinos_ENABLE_ThyraCoreLibs=ON AND Trilinos_ENABLE_RTOp=ON +-- Setting ThyraGoodStuff_ENABLE_ThyraCoreLibs=ON since Trilinos_ENABLE_ThyraGoodStuff=ON AND Trilinos_ENABLE_ThyraCoreLibs=ON +-- Setting ThyraEpetra_ENABLE_Epetra=ON since Trilinos_ENABLE_ThyraEpetra=ON AND Trilinos_ENABLE_Epetra=ON +-- Setting ThyraEpetra_ENABLE_ThyraCoreLibs=ON since Trilinos_ENABLE_ThyraEpetra=ON AND Trilinos_ENABLE_ThyraCoreLibs=ON +-- Setting ThyraEpetraExt_ENABLE_ThyraEpetra=ON since Trilinos_ENABLE_ThyraEpetraExt=ON AND Trilinos_ENABLE_ThyraEpetra=ON +-- Setting ThyraEpetraExt_ENABLE_EpetraExt=ON since Trilinos_ENABLE_ThyraEpetraExt=ON AND Trilinos_ENABLE_EpetraExt=ON +-- Setting Thyra_ENABLE_ThyraCoreLibs=ON since Trilinos_ENABLE_Thyra=ON AND Trilinos_ENABLE_ThyraCoreLibs=ON +-- Setting Thyra_ENABLE_ThyraGoodStuff=ON since Trilinos_ENABLE_Thyra=ON AND Trilinos_ENABLE_ThyraGoodStuff=ON +-- Setting Thyra_ENABLE_ThyraEpetra=ON since Trilinos_ENABLE_Thyra=ON AND Trilinos_ENABLE_ThyraEpetra=ON +-- Setting Thyra_ENABLE_ThyraEpetraExt=ON since Trilinos_ENABLE_Thyra=ON AND Trilinos_ENABLE_ThyraEpetraExt=ON Final set of enabled top-level packages: Teuchos RTOp Epetra EpetraExt Thyra 5 Final set of enabled packages: Teuchos RTOp Epetra EpetraExt ThyraCoreLibs ThyraGoodStuff ThyraEpetra ThyraEpetraExt Thyra 9 diff --git a/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/ExpectedDependencies.txt b/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/ExpectedDependencies.txt index 3d636a3b981a..51dbaaa44879 100644 --- a/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/ExpectedDependencies.txt +++ b/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/ExpectedDependencies.txt @@ -15,73 +15,96 @@ Package dependencies information: -- Trilinos_DEFINED_PACKAGES: MPI BLAS LAPACK Boost UMFPACK AMD PETSC Teuchos RTOp Epetra Triutils EpetraExt ThyraCoreLibs ThyraGoodStuff ThyraCrazyStuff ThyraEpetra ThyraEpetraExt Thyra -- Trilinos_NUM_DEFINED_PACKAGES='18' --- Teuchos_LIB_REQUIRED_DEP_TPLS: BLAS LAPACK --- Teuchos_LIB_OPTIONAL_DEP_TPLS: Boost MPI +-- MPI_FORWARD_LIB_DEFINED_DEPENDENCIES: Teuchos[O] Epetra[O] --- RTOp_LIB_REQUIRED_DEP_PACKAGES: Teuchos +-- BLAS_FORWARD_LIB_DEFINED_DEPENDENCIES: LAPACK[R] Teuchos[R] Epetra[R] --- Epetra_LIB_REQUIRED_DEP_TPLS: BLAS LAPACK --- Epetra_LIB_OPTIONAL_DEP_TPLS: MPI +-- LAPACK_LIB_DEFINED_DEPENDENCIES: BLAS[R] +-- LAPACK_FORWARD_LIB_DEFINED_DEPENDENCIES: Teuchos[R] Epetra[R] --- Triutils_LIB_REQUIRED_DEP_PACKAGES: Epetra +-- Boost_FORWARD_LIB_DEFINED_DEPENDENCIES: Teuchos[O] --- EpetraExt_LIB_REQUIRED_DEP_PACKAGES: Teuchos Epetra --- EpetraExt_LIB_OPTIONAL_DEP_PACKAGES: Triutils --- EpetraExt_LIB_OPTIONAL_DEP_TPLS: UMFPACK AMD PETSC +-- UMFPACK_FORWARD_LIB_DEFINED_DEPENDENCIES: EpetraExt[O] --- ThyraCoreLibs_LIB_REQUIRED_DEP_PACKAGES: Teuchos RTOp +-- AMD_FORWARD_LIB_DEFINED_DEPENDENCIES: EpetraExt[O] --- ThyraGoodStuff_LIB_REQUIRED_DEP_PACKAGES: ThyraCoreLibs +-- PETSC_FORWARD_LIB_DEFINED_DEPENDENCIES: EpetraExt[O] --- ThyraCrazyStuff_LIB_REQUIRED_DEP_PACKAGES: ThyraGoodStuff +-- Teuchos_LIB_DEFINED_DEPENDENCIES: BLAS[R] LAPACK[R] Boost[O] MPI[O] +-- Teuchos_FORWARD_LIB_DEFINED_DEPENDENCIES: RTOp[R] EpetraExt[R] ThyraCoreLibs[R] --- ThyraEpetra_LIB_REQUIRED_DEP_PACKAGES: Epetra ThyraCoreLibs +-- RTOp_LIB_DEFINED_DEPENDENCIES: Teuchos[R] +-- RTOp_FORWARD_LIB_DEFINED_DEPENDENCIES: ThyraCoreLibs[R] --- ThyraEpetraExt_LIB_REQUIRED_DEP_PACKAGES: ThyraEpetra EpetraExt +-- Epetra_LIB_DEFINED_DEPENDENCIES: BLAS[R] LAPACK[R] MPI[O] +-- Epetra_FORWARD_LIB_DEFINED_DEPENDENCIES: Triutils[R] EpetraExt[R] ThyraEpetra[R] --- Thyra_LIB_REQUIRED_DEP_PACKAGES: ThyraCoreLibs --- Thyra_LIB_OPTIONAL_DEP_PACKAGES: ThyraGoodStuff ThyraCrazyStuff ThyraEpetra ThyraEpetraExt +-- Triutils_LIB_DEFINED_DEPENDENCIES: Epetra[R] +-- Triutils_FORWARD_LIB_DEFINED_DEPENDENCIES: EpetraExt[O] -Dumping direct dependencies for each package ... +-- EpetraExt_LIB_DEFINED_DEPENDENCIES: Teuchos[R] Epetra[R] Triutils[O] UMFPACK[O] AMD[O] PETSC[O] +-- EpetraExt_FORWARD_LIB_DEFINED_DEPENDENCIES: ThyraEpetraExt[R] --- MPI_LIB_DEFINED_DEPENDENCIES: +-- ThyraCoreLibs_LIB_DEFINED_DEPENDENCIES: Teuchos[R] RTOp[R] +-- ThyraCoreLibs_FORWARD_LIB_DEFINED_DEPENDENCIES: ThyraGoodStuff[R] ThyraEpetra[R] Thyra[R] --- BLAS_LIB_DEFINED_DEPENDENCIES: +-- ThyraGoodStuff_LIB_DEFINED_DEPENDENCIES: ThyraCoreLibs[R] +-- ThyraGoodStuff_FORWARD_LIB_DEFINED_DEPENDENCIES: ThyraCrazyStuff[R] Thyra[O] --- LAPACK_LIB_DEFINED_DEPENDENCIES: +-- ThyraCrazyStuff_LIB_DEFINED_DEPENDENCIES: ThyraGoodStuff[R] +-- ThyraCrazyStuff_FORWARD_LIB_DEFINED_DEPENDENCIES: Thyra[O] --- Boost_LIB_DEFINED_DEPENDENCIES: +-- ThyraEpetra_LIB_DEFINED_DEPENDENCIES: Epetra[R] ThyraCoreLibs[R] +-- ThyraEpetra_FORWARD_LIB_DEFINED_DEPENDENCIES: ThyraEpetraExt[R] Thyra[O] --- UMFPACK_LIB_DEFINED_DEPENDENCIES: +-- ThyraEpetraExt_LIB_DEFINED_DEPENDENCIES: ThyraEpetra[R] EpetraExt[R] +-- ThyraEpetraExt_FORWARD_LIB_DEFINED_DEPENDENCIES: Thyra[O] --- AMD_LIB_DEFINED_DEPENDENCIES: +-- Thyra_LIB_DEFINED_DEPENDENCIES: ThyraCoreLibs[R] ThyraGoodStuff[O] ThyraCrazyStuff[O] ThyraEpetra[O] ThyraEpetraExt[O] --- PETSC_LIB_DEFINED_DEPENDENCIES: +Dumping direct enabled dependencies for each package ... --- Teuchos_LIB_ENABLED_DEPENDENCIES: BLAS LAPACK --- Teuchos_LIB_DEFINED_DEPENDENCIES: BLAS LAPACK Boost MPI +-- MPI: No enabled dependencies! --- RTOp_LIB_ENABLED_DEPENDENCIES: Teuchos --- RTOp_LIB_DEFINED_DEPENDENCIES: Teuchos +-- BLAS: No enabled dependencies! --- Epetra_LIB_ENABLED_DEPENDENCIES: BLAS LAPACK --- Epetra_LIB_DEFINED_DEPENDENCIES: BLAS LAPACK MPI +-- LAPACK_LIB_ENABLED_DEPENDENCIES: BLAS[R] --- Triutils_LIB_DEFINED_DEPENDENCIES: Epetra +-- Boost: No enabled dependencies! --- EpetraExt_LIB_DEFINED_DEPENDENCIES: Teuchos Epetra Triutils UMFPACK AMD PETSC +-- UMFPACK: No enabled dependencies! --- ThyraCoreLibs_LIB_ENABLED_DEPENDENCIES: Teuchos RTOp --- ThyraCoreLibs_LIB_DEFINED_DEPENDENCIES: Teuchos RTOp +-- AMD: No enabled dependencies! --- ThyraGoodStuff_LIB_DEFINED_DEPENDENCIES: ThyraCoreLibs +-- PETSC: No enabled dependencies! --- ThyraCrazyStuff_LIB_DEFINED_DEPENDENCIES: ThyraGoodStuff +-- Teuchos_LIB_ENABLED_DEPENDENCIES: BLAS[R] LAPACK[R] --- ThyraEpetra_LIB_ENABLED_DEPENDENCIES: Epetra ThyraCoreLibs --- ThyraEpetra_LIB_DEFINED_DEPENDENCIES: Epetra ThyraCoreLibs +-- RTOp_LIB_ENABLED_DEPENDENCIES: Teuchos[R] --- ThyraEpetraExt_LIB_DEFINED_DEPENDENCIES: ThyraEpetra EpetraExt +-- Epetra_LIB_ENABLED_DEPENDENCIES: BLAS[R] LAPACK[R] --- Thyra_LIB_ENABLED_DEPENDENCIES: ThyraCoreLibs ThyraEpetra --- Thyra_LIB_DEFINED_DEPENDENCIES: ThyraCoreLibs ThyraGoodStuff ThyraCrazyStuff ThyraEpetra ThyraEpetraExt +-- Triutils: No enabled dependencies! + +-- EpetraExt: No enabled dependencies! + +-- ThyraCoreLibs_LIB_ENABLED_DEPENDENCIES: Teuchos[R] RTOp[R] + +-- ThyraGoodStuff: No enabled dependencies! + +-- ThyraCrazyStuff: No enabled dependencies! + +-- ThyraEpetra_LIB_ENABLED_DEPENDENCIES: Epetra[R] ThyraCoreLibs[R] + +-- ThyraEpetraExt: No enabled dependencies! + +-- Thyra_LIB_ENABLED_DEPENDENCIES: ThyraCoreLibs[R] ThyraEpetra[O] + +Setting up export dependencies for all enabled packages ... + +-- Teuchos: No library dependencies! +-- RTOp_FULL_ENABLED_DEP_PACKAGES: Teuchos +-- Epetra: No library dependencies! +-- ThyraCoreLibs_FULL_ENABLED_DEP_PACKAGES: RTOp Teuchos +-- ThyraEpetra_FULL_ENABLED_DEP_PACKAGES: ThyraCoreLibs Epetra RTOp Teuchos +-- Thyra_FULL_ENABLED_DEP_PACKAGES: ThyraEpetra ThyraCoreLibs Epetra RTOp Teuchos diff --git a/cmake/tribits/doc/guides/TribitsCoreDetailedReference.rst b/cmake/tribits/doc/guides/TribitsCoreDetailedReference.rst index 50a99b926381..2cc0fb95e97d 100644 --- a/cmake/tribits/doc/guides/TribitsCoreDetailedReference.rst +++ b/cmake/tribits/doc/guides/TribitsCoreDetailedReference.rst @@ -61,6 +61,7 @@ The global project-level TriBITS options for which defaults can be provided by a given TriBITS project are: * `${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE`_ +* `${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES`_ * `${PROJECT_NAME}_C_Standard`_ * `${PROJECT_NAME}_CHECK_FOR_UNPARSED_ARGUMENTS`_ * `${PROJECT_NAME}_CONFIGURE_OPTIONS_FILE_APPEND`_ @@ -97,6 +98,7 @@ a given TriBITS project are: * `CMAKE_INSTALL_RPATH_USE_LINK_PATH`_ * `MPI_EXEC_MAX_NUMPROCS`_ * `PythonInterp_FIND_VERSION`_ +* `TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE`_ These options are described below. @@ -120,6 +122,25 @@ These options are described below. in the project's base `/ProjectName.cmake`_ file. + +.. _${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES: + +**${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES** + + To set ``${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES`` a different default, + set:: + + set(${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_DEFAULT ) + + in the project's base `/ProjectName.cmake`_ file, where + ```` can be ``FATAL_ERROR``, ``SEND_ERROR``, ``WARNING``, + ``NOTICE`` or ``IGNORE`` + + Otherwise, the default is ``WARNING`` when + ``${PROJECT_NAME}_ENABLE_DEVELOPMENT_MODE`` is ``ON`` and if ``IGNORE`` if + ``${PROJECT_NAME}_ENABLE_DEVELOPMENT_MODE`` is ``OFF``. + + .. _${PROJECT_NAME}_C_Standard: **${PROJECT_NAME}_C_Standard** @@ -349,11 +370,12 @@ These options are described below. to ``OFF`` when creating a release (see `Project and Repository Versioning and Release Mode`_). When ``${PROJECT_NAME}_ENABLE_DEVELOPMENT_MODE`` is ``ON``, several other variables are given defaults appropriate for - development mode. For example, ``${PROJECT_NAME}_ASSERT_MISSING_PACKAGES`` - is set to ``ON`` by default in development mode but is set to ``OFF`` by - default in release mode. In addition, strong compiler warnings are enabled - by default in development mode but are disabled by default in release mode. - This variable also affects the behavior of `tribits_set_st_for_dev_mode()`_. + development mode. For example, + ``${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES`` is set to ``FATAL_ERROR`` by + default in development mode but is set to ``IGNORE`` by default in release + mode. In addition, strong compiler warnings are enabled by default in + development mode but are disabled by default in release mode. This variable + also affects the behavior of `tribits_set_st_for_dev_mode()`_. .. _${PROJECT_NAME}_ENABLE_Fortran: @@ -841,6 +863,19 @@ These options are described below. -D PythonInterp_FIND_VERSION="3.6.2" +.. _TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE: + +**TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE** + + Determines how the function `tribits_deprecated()`_ behaves. To change the + default behavor, such as call ``message(FATAL_ERROR ...)``, set:: + + set(TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE_DEFAULT FATAL_ERROR) + + in the project's `/ProjectName.cmake`_ file, or + `/CMakeLists.txt`_ file, or on the individual package basis in + its `/CMakeLists.txt`_ file. + TriBITS Macros and Functions ---------------------------- diff --git a/cmake/tribits/doc/guides/TribitsGuidesBody.rst b/cmake/tribits/doc/guides/TribitsGuidesBody.rst index f6ab1b1b733f..876566808da4 100644 --- a/cmake/tribits/doc/guides/TribitsGuidesBody.rst +++ b/cmake/tribits/doc/guides/TribitsGuidesBody.rst @@ -1780,6 +1780,8 @@ defined: the package is in relation to other packages. NOTE: This variable is **only** defined if the package is actually enabled! + .. _${PACKAGE_NAME}_PARENT_REPOSITORY: + ``${PACKAGE_NAME}_PARENT_REPOSITORY`` The name of the package's parent repository. This can be used by a @@ -2161,8 +2163,8 @@ version will be used all of the downstream packages that uses it. Also, by defining a TriBITS TPL, automatic enable/disable logic will be applied as described in `Package Dependencies and Enable/Disable Logic`_. For example, if an external package/TPL is explicitly disabled, all of the downstream -packages that depend on it will be automatically disabled as well (see `TPL -disable triggers auto-disables of downstream dependencies`_). +packages that depend on it will be automatically disabled as well (see +`Package disable triggers auto-disables of downstream dependencies`_). .. _Globally unique TriBITS TPL names: @@ -3361,21 +3363,20 @@ system are: 6) `EX TPLs given default unset enable/disable state`_ 7) `Required TPLs are auto-enabled for enabled packages`_ 8) `Optional TPLs only enabled explicitly by the user`_ -9) `TPL disable triggers auto-disables of downstream dependencies`_ -10) `Disables trump enables where there is a conflict`_ -11) `Enable/disable of parent package is enable/disable for subpackages`_ -12) `Enable/disable of parent package tests/examples is enable/disable for subpackages tests/examples`_ -13) `Subpackage enable does not auto-enable the parent package`_ -14) `Support for optional package/TPL is enabled by default`_ -15) `Support for optional package can be explicitly disabled`_ -16) `Explicit enable of optional package/TPL support auto-enables package/TPL`_ -17) `ST packages only auto-enabled if ST code is enabled`_ -18) `_ENABLE_ALL_FORWARD_DEP_PACKAGES enables downstream packages/tests`_ -19) `_ENABLE_ALL_PACKAGES enables all PT (cond. ST) packages`_ -20) `_ENABLE_TESTS only enables explicitly enabled package tests`_ -21) `If no packages are enabled, nothing will get built`_ -22) `TriBITS prints all enables and disables to stdout`_ -23) `TriBITS auto-enables/disables done using non-cache local variables`_ +9) `Disables trump enables where there is a conflict`_ +10) `Enable/disable of parent package is enable/disable for subpackages`_ +11) `Enable/disable of parent package tests/examples is enable/disable for subpackages tests/examples`_ +12) `Subpackage enable does not auto-enable the parent package`_ +13) `Support for optional package/TPL is enabled by default`_ +14) `Support for optional package can be explicitly disabled`_ +15) `Explicit enable of optional package/TPL support auto-enables package/TPL`_ +16) `ST packages only auto-enabled if ST code is enabled`_ +17) `_ENABLE_ALL_FORWARD_DEP_PACKAGES enables downstream packages/tests`_ +18) `_ENABLE_ALL_PACKAGES enables all PT (cond. ST) packages`_ +19) `_ENABLE_TESTS only enables explicitly enabled package tests`_ +20) `If no packages are enabled, nothing will get built`_ +21) `TriBITS prints all enables and disables to stdout`_ +22) `TriBITS auto-enables/disables done using non-cache local variables`_ In more detail, these rules/behaviors are: @@ -3443,15 +3444,16 @@ In more detail, these rules/behaviors are: .. _Package disable triggers auto-disables of downstream dependencies: -4) **Package disable triggers auto-disables of downstream dependencies**: - Any package ```` can be explicitly **disabled** by the - user by setting the cache variable - ``${PROJECT_NAME}_ENABLE_=OFF`` - (e.g. ``Trilinos_ENABLE_Teuchos=OFF``). When an package is explicitly - disabled, it will result in the disable of all `downstream`_ packages - that have required dependency on it. It will also disable optional support - for the disabled packages in downstream packages that list it as an - optional dependency. For an example, see `Explicit disable of a package`_. +4) **Package disable triggers auto-disables of downstream dependencies**: Any + package ```` can be explicitly **disabled** by the user by + setting the cache variable ``${PROJECT_NAME}_ENABLE_=OFF`` + (or ``TPL_ENABLE_=OFF`` for an external package/TPL) + (e.g. ``Trilinos_ENABLE_Teuchos=OFF``, ``TPL_ENABLE_BLAS=OFF``). When an + package is explicitly disabled, it will result in the disable of all + dependent `downstream`_ external packages/TPLs and internal packages that + have required dependency on it. It will also disable optional support for + the disabled packages in downstream packages that list it as an optional + dependency. For an example, see `Explicit disable of a package`_. .. _PT/ST TPLs given default unset enable/disable state: @@ -3505,24 +3507,9 @@ In more detail, these rules/behaviors are: ``TPL_ENABLE_Boost=ON``. For an example, see `Explicit enable of a package, its tests, an optional TPL, with ST enabled`_. -.. _TPL disable triggers auto-disables of downstream dependencies: - -9) **TPL disable triggers auto-disables of downstream dependencies**: Any TPLs - that are explicitly disabled (i.e. ``TPL_ENABLE_=OFF``) will - result in the disable of all `downstream`_ dependent packages that have a - required dependency on the TPL. For example, if the user sets - ``TPL_ENABLE_LAPACK=OFF``, then this will result in the disable of packages - ``Teuchos`` and ``Epetra``, and all of the required packages downstream - from them. Also, the explicitly disabled TPL will result in the disable of - optional support in all downstream packages. For example, if the user sets - ``TPL_ENABLE_MPI=OFF``, then TriBITS will automatically set - ``Teuchos_ENABLE_MPI=OFF`` and ``Epetra_ENABLE_MPI=OFF``. For examples, - see `Explicit disable of an optional TPL`_ and `Explicit disable of a - required TPL`_. - .. _Disables trump enables where there is a conflict: -10) **Disables trump enables where there is a conflict** and TriBITS will +9) **Disables trump enables where there is a conflict** and TriBITS will never override a disable in order to satisfy some dependency. For example, if the user sets ``Trilinos_ENABLE_Teuchos=OFF`` and ``Trilinos_ENABLE_RTOp=ON``, then TriBITS will **not** override the @@ -3553,7 +3540,7 @@ In more detail, these rules/behaviors are: .. _Enable/disable of parent package is enable/disable for subpackages: -11) **Enable/disable of parent package is enable/disable for subpackages**: An +10) **Enable/disable of parent package is enable/disable for subpackages**: An explicit enable/disable of a top-level parent package with subpackages with ``${PROJECT_NAME}_ENABLE_=(ON|OFF)`` is equivalent to the explicit enable/disable of all of the parent package's subpackages. @@ -3576,7 +3563,7 @@ In more detail, these rules/behaviors are: .. _Enable/disable of parent package tests/examples is enable/disable for subpackages tests/examples: -12) **Enable/disable of parent package tests/examples is enable/disable for +11) **Enable/disable of parent package tests/examples is enable/disable for subpackages tests/examples**: Setting ``_ENABLE_TESTS=[ON|OFF]`` is equivalent to setting the default for ``_ENABLE_TESTS=[ON|OFF]`` for each @@ -3590,7 +3577,7 @@ In more detail, these rules/behaviors are: .. _Subpackage enable does not auto-enable the parent package: -13) **Subpackage enable does not auto-enable the parent package**: Enabling an +12) **Subpackage enable does not auto-enable the parent package**: Enabling an package that is a subpackage does **not** automatically enable the parent package (except for at the very end, mostly just for show). For example, enabling the package ``ThyraEpetra`` does not result in enable @@ -3613,7 +3600,7 @@ In more detail, these rules/behaviors are: .. _Support for optional package/TPL is enabled by default: -14) **Support for optional package/TPL is enabled by default**: For an package +13) **Support for optional package/TPL is enabled by default**: For an package ```` with an optional dependency on an `upstream`_ package or TPL ````, TriBITS will automatically set the intra-enable variable @@ -3630,7 +3617,7 @@ In more detail, these rules/behaviors are: .. _Support for optional package can be explicitly disabled: -15) **Support for optional package can be explicitly disabled:** Even +14) **Support for optional package can be explicitly disabled:** Even though TriBITS will automatically set ``_ENABLE_=ON`` by default if ```` and ```` are both @@ -3650,7 +3637,7 @@ In more detail, these rules/behaviors are: .. _Explicit enable of optional package/TPL support auto-enables package/TPL: -16) **Explicit enable of optional package/TPL support auto-enables +15) **Explicit enable of optional package/TPL support auto-enables package/TPL**: If the user explicitly enables the TriBITS package ```` and explicitly sets ``_ENABLE_=ON`` on input, @@ -3670,7 +3657,7 @@ In more detail, these rules/behaviors are: .. _ST packages only auto-enabled if ST code is enabled: -17) **ST packages only auto-enabled if ST code is enabled**: TriBITS will +16) **ST packages only auto-enabled if ST code is enabled**: TriBITS will only enable an optional ``ST`` package when ``${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES=ON`` if ``${PROJECT_NAME}_SECONDARY_TESTED_CODE=ON`` is also set. Otherwise, when @@ -3689,7 +3676,7 @@ In more detail, these rules/behaviors are: .. __ENABLE_ALL_FORWARD_DEP_PACKAGES enables downstream packages/tests: -18) **_ENABLE_ALL_FORWARD_DEP_PACKAGES enables downstream packages/tests**: +17) **_ENABLE_ALL_FORWARD_DEP_PACKAGES enables downstream packages/tests**: Setting the user cache-variable ``${PROJECT_NAME}_ENABLE_ALL_FORWARD_PACKAGES=ON`` will result in the `downstream`_ ``PT`` packages and tests to be enabled (and all ``PT`` @@ -3707,7 +3694,7 @@ In more detail, these rules/behaviors are: .. __ENABLE_ALL_PACKAGES enables all PT (cond. ST) packages: -19) **_ENABLE_ALL_PACKAGES enables all PT (cond. ST) packages**: +18) **_ENABLE_ALL_PACKAGES enables all PT (cond. ST) packages**: Setting the user cache-variable ``${PROJECT_NAME}_ENABLE_ALL_PACKAGES=ON`` will result in the enable of all ``PT`` packages when ``${PROJECT_NAME}_SECONDARY_TESTED_CODE=OFF`` and all ``PT`` and ``ST`` @@ -3726,7 +3713,7 @@ In more detail, these rules/behaviors are: .. __ENABLE_TESTS only enables explicitly enabled package tests: -20) **_ENABLE_TESTS only enables explicitly enabled package +19) **_ENABLE_TESTS only enables explicitly enabled package tests**: Setting ``${PROJECT_NAME}_ENABLE_TESTS=ON`` will **only enable tests for explicitly enabled packages** on input. For example, configuring with ``Trilinos_ENABLE_RTOp=ON`` and @@ -3741,7 +3728,7 @@ In more detail, these rules/behaviors are: .. _If no packages are enabled, nothing will get built: -21) **If no packages are enabled, nothing will get built**: Most TriBITS +20) **If no packages are enabled, nothing will get built**: Most TriBITS projects are set up such that if the user does not explicitly enable at least one package in some way, then nothing will be enabled or built. In this case, when ``${PROJECT_NAME}_ALLOW_NO_PACKAGES=TRUE`` a warning @@ -3755,7 +3742,7 @@ In more detail, these rules/behaviors are: .. _TriBITS prints all enables and disables to stdout: -22) **TriBITS prints all enables and disables to stdout**: TriBITS prints out +21) **TriBITS prints all enables and disables to stdout**: TriBITS prints out (to ``cmake`` stdout) the initial set of enables/disables on input, prints a line whenever it sets (or overrides) an enable or disable, and prints out the final set of enables/disables. Therefore, the user just needs to @@ -3768,7 +3755,7 @@ In more detail, these rules/behaviors are: .. _TriBITS auto-enables/disables done using non-cache local variables: -23) **TriBITS auto-enables/disables done using non-cache local variables**: +22) **TriBITS auto-enables/disables done using non-cache local variables**: TriBITS setting (or overrides) of enable/disable cache variables are done by setting local non-cache variables at the top project-level scope (i.e. the ``/CMakeLists.txt`` file scope). This is done so diff --git a/cmake/tribits/doc/guides/TribitsMacroFunctionDocTemplate.rst b/cmake/tribits/doc/guides/TribitsMacroFunctionDocTemplate.rst index c045c1962e54..c0916454df5b 100644 --- a/cmake/tribits/doc/guides/TribitsMacroFunctionDocTemplate.rst +++ b/cmake/tribits/doc/guides/TribitsMacroFunctionDocTemplate.rst @@ -44,6 +44,7 @@ @MACRO: tribits_project_enable_all() + @MACRO: tribits_repository_define_packages() + @MACRO: tribits_repository_define_tpls() + +@MACRO: tribits_set_and_inc_dirs() + @FUNCTION: tribits_set_st_for_dev_mode() + @MACRO: tribits_subpackage() + @MACRO: tribits_subpackage_postprocess() + diff --git a/cmake/tribits/doc/guides/TribitsSystemMacroFunctionDocTemplate.rst b/cmake/tribits/doc/guides/TribitsSystemMacroFunctionDocTemplate.rst index e42125762328..a8c9f53d216a 100644 --- a/cmake/tribits/doc/guides/TribitsSystemMacroFunctionDocTemplate.rst +++ b/cmake/tribits/doc/guides/TribitsSystemMacroFunctionDocTemplate.rst @@ -13,8 +13,9 @@ understand the internals of TriBITS. @FUNCTION: tribits_abort_on_missing_package() + @FUNCTION: tribits_abort_on_self_dep() + @MACRO: tribits_adjust_package_enables() + -@FUNCTION: tribits_append_forward_dep_packages() + +@MACRO: tribits_append_forward_dep_packages() + @MACRO: tribits_assert_read_dependency_vars() + +@FUNCTION: tribits_dump_package_dependencies_info() + @FUNCTION: tribits_extpkg_add_find_upstream_dependencies_str() + @FUNCTION: tribits_extpkg_create_all_libs_target() + @FUNCTION: tribits_extpkg_install_config_file() + @@ -22,7 +23,10 @@ understand the internals of TriBITS. @FUNCTION: tribits_extpkg_process_libraries_list() + @MACRO: tribits_extpkg_setup_enabled_dependencies() + @FUNCTION: tribits_extpkg_write_config_version_file() + -@FUNCTION: tribits_dump_package_dependencies_info() + +@FUNCTION: tribits_get_sublist_disabled() + +@FUNCTION: tribits_get_sublist_enabled() + +@FUNCTION: tribits_get_sublist_nondisabled() + +@FUNCTION: tribits_get_sublist_nonenabled() + @FUNCTION: tribits_print_initial_dependency_info() + @FUNCTION: tribits_print_tentatively_enabled_tpls() + @MACRO: tribits_parse_subpackages_append_packages_add_options() + @@ -42,7 +46,7 @@ understand the internals of TriBITS. @MACRO: tribits_read_subpackage_deps_file_add_to_graph() + @MACRO: tribits_read_toplevel_package_deps_files_add_to_graph() + @MACRO: tribits_save_off_dependency_vars() + -@FUNCTION: tribits_set_dep_packages() + +@MACRO: tribits_set_dep_packages() + @FUNCTION: tribits_trace_file_processing() + @FUNCTION: tribits_write_package_client_export_files_install_targets() + @MACRO: tribits_write_xml_dependency_files() + diff --git a/cmake/tribits/doc/guides/UtilsMacroFunctionDocTemplate.rst b/cmake/tribits/doc/guides/UtilsMacroFunctionDocTemplate.rst index f5c4cf3970d2..acc98214c162 100644 --- a/cmake/tribits/doc/guides/UtilsMacroFunctionDocTemplate.rst +++ b/cmake/tribits/doc/guides/UtilsMacroFunctionDocTemplate.rst @@ -31,7 +31,6 @@ @FUNCTION: print_var() + @FUNCTION: print_var_with_spaces() + @FUNCTION: remove_global_duplicates() + -@MACRO: set_and_inc_dirs() + @FUNCTION: set_cache_on_off_empty() + @MACRO: set_default() + @MACRO: set_default_and_from_env() + @@ -39,6 +38,10 @@ @FUNCTION: timer_get_raw_seconds() + @FUNCTION: timer_get_rel_seconds() + @FUNCTION: timer_print_rel_time() + +@FUNCTION: tribits_add_enum_cache_var() + +@FUNCTION: tribits_deprecated() + +@FUNCTION: tribits_deprecated_command() + +@MACRO: tribits_create_reverse_list() + @FUNCTION: tribits_strip_quotes_from_str() + @FUNCTION: unittest_compare_const() + @FUNCTION: unittest_has_substr_const() + diff --git a/cmake/tribits/doc/guides/users_guide/TribitsUsersGuide.rst b/cmake/tribits/doc/guides/users_guide/TribitsUsersGuide.rst index 96d44b9e9abe..be4cee320ff3 100644 --- a/cmake/tribits/doc/guides/users_guide/TribitsUsersGuide.rst +++ b/cmake/tribits/doc/guides/users_guide/TribitsUsersGuide.rst @@ -106,3 +106,5 @@ Appendix .. _tribits_read_all_project_deps_files_create_deps_graph(): TribitsMaintainersGuide.html#tribits-read-all-project-deps-files-create-deps-graph .. _${PACKAGE_NAME}_LIB_DEFINED_DEPENDENCIES: TribitsMaintainersGuide.html#package-name-lib-enabled-dependencies + +.. _${PACKAGE_NAME}_TEST_DEFINED_DEPENDENCIES: TribitsMaintainersGuide.html#package-name-test-enabled-dependencies diff --git a/cmake/tribits/examples/InsertedPkg/CMakeLists.txt b/cmake/tribits/examples/InsertedPkg/CMakeLists.txt index 59554162100b..7df9c56e8157 100644 --- a/cmake/tribits/examples/InsertedPkg/CMakeLists.txt +++ b/cmake/tribits/examples/InsertedPkg/CMakeLists.txt @@ -1,6 +1,6 @@ tribits_package(InsertedPkg) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) tribits_add_library( externalpkg diff --git a/cmake/tribits/examples/MixedSharedStaticLibs/shared_only/CMakeLists.txt b/cmake/tribits/examples/MixedSharedStaticLibs/shared_only/CMakeLists.txt index 5a4746eda691..7cec4e8cad26 100644 --- a/cmake/tribits/examples/MixedSharedStaticLibs/shared_only/CMakeLists.txt +++ b/cmake/tribits/examples/MixedSharedStaticLibs/shared_only/CMakeLists.txt @@ -1,6 +1,6 @@ tribits_subpackage(SharedOnly) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) tribits_add_library( shared_only_lib diff --git a/cmake/tribits/examples/MixedSharedStaticLibs/static_only/CMakeLists.txt b/cmake/tribits/examples/MixedSharedStaticLibs/static_only/CMakeLists.txt index 62e8bddd8490..7df2594891a6 100644 --- a/cmake/tribits/examples/MixedSharedStaticLibs/static_only/CMakeLists.txt +++ b/cmake/tribits/examples/MixedSharedStaticLibs/static_only/CMakeLists.txt @@ -1,6 +1,6 @@ tribits_subpackage(StaticOnly) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) tribits_add_library( static_only_lib diff --git a/cmake/tribits/examples/MockTrilinos/TPLsList.cmake b/cmake/tribits/examples/MockTrilinos/TPLsList.cmake index 7e9335cf2908..e83c918dce24 100644 --- a/cmake/tribits/examples/MockTrilinos/TPLsList.cmake +++ b/cmake/tribits/examples/MockTrilinos/TPLsList.cmake @@ -10,6 +10,7 @@ tribits_repository_define_tpls( ADOLC cmake/TPLs/ ST ADIC cmake/TPLs/ EX TVMET cmake/TPLs/ ST + #Zlib cmake/TPLs/ PT # Listed in zoltan/cmake/Dependencies.cmake! y12m cmake/TPLs/ ST SuperLUDist cmake/TPLs/ ST SuperLU cmake/TPLs/ ST diff --git a/cmake/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLLAPACKDependencies.cmake b/cmake/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLLAPACKDependencies.cmake new file mode 100644 index 000000000000..0256dbbfd4dd --- /dev/null +++ b/cmake/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLLAPACKDependencies.cmake @@ -0,0 +1,2 @@ +tribits_extpkg_define_dependencies( LAPACK + DEPENDENCIES BLAS) diff --git a/cmake/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLParMETISDependencies.cmake b/cmake/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLParMETISDependencies.cmake new file mode 100644 index 000000000000..d999aca2b2ae --- /dev/null +++ b/cmake/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLParMETISDependencies.cmake @@ -0,0 +1,2 @@ +tribits_extpkg_define_dependencies( ParMETIS + DEPENDENCIES METIS) diff --git a/cmake/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLSuperLUDependencies.cmake b/cmake/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLSuperLUDependencies.cmake new file mode 100644 index 000000000000..47a938258d0d --- /dev/null +++ b/cmake/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLSuperLUDependencies.cmake @@ -0,0 +1,2 @@ +tribits_extpkg_define_dependencies( SuperLU + DEPENDENCIES ParMETIS BLAS) diff --git a/cmake/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLSuperLUDistDependencies.cmake b/cmake/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLSuperLUDistDependencies.cmake new file mode 100644 index 000000000000..d0419545d2cd --- /dev/null +++ b/cmake/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLSuperLUDistDependencies.cmake @@ -0,0 +1,2 @@ +tribits_extpkg_define_dependencies( SuperLUDist + DEPENDENCIES ParMETIS BLAS) diff --git a/cmake/tribits/examples/MockTrilinos/packages/zoltan/cmake/Dependencies.cmake b/cmake/tribits/examples/MockTrilinos/packages/zoltan/cmake/Dependencies.cmake index 06261248bff8..5d3bfcfe0062 100644 --- a/cmake/tribits/examples/MockTrilinos/packages/zoltan/cmake/Dependencies.cmake +++ b/cmake/tribits/examples/MockTrilinos/packages/zoltan/cmake/Dependencies.cmake @@ -37,6 +37,12 @@ # ************************************************************************ # @HEADER +if (SHOW_INVALID_TPL_NAME_ERROR) + set(Zlib_str Zlib) +else() + set(Zlib_str "") +endif() + tribits_package_define_dependencies( - LIB_OPTIONAL_TPLS MPI ParMETIS Scotch Zlib + LIB_OPTIONAL_TPLS MPI ParMETIS Scotch ${Zlib_str} ) diff --git a/cmake/tribits/examples/ReducedMockTrilinos/TPLsList.cmake b/cmake/tribits/examples/ReducedMockTrilinos/TPLsList.cmake index 542b88f79412..4de9acf2a02c 100644 --- a/cmake/tribits/examples/ReducedMockTrilinos/TPLsList.cmake +++ b/cmake/tribits/examples/ReducedMockTrilinos/TPLsList.cmake @@ -1,8 +1,8 @@ tribits_repository_define_tpls( - MPI "${${PROJECT_NAME}_TRIBITS_DIR}/core/std_tpls/" PT - BLAS "${${PROJECT_NAME}_TRIBITS_DIR}/core/std_tpls/" PT - LAPACK "${${PROJECT_NAME}_TRIBITS_DIR}/core/std_tpls/" PT - Boost "${${PROJECT_NAME}_TRIBITS_DIR}/core/std_tpls/" ST + MPI "${${PROJECT_NAME}_TRIBITS_DIR}/core/std_tpls/" PT + BLAS "${${PROJECT_NAME}_TRIBITS_DIR}/common_tpls/" PT + LAPACK "${${PROJECT_NAME}_TRIBITS_DIR}/common_tpls/" PT + Boost cmake/TPLs/ ST UMFPACK cmake/TPLs/ ST AMD cmake/TPLs/ EX PETSC "${${PROJECT_NAME}_TRIBITS_DIR}/common_tpls/" ST diff --git a/cmake/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/PackagesList.cmake b/cmake/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/PackagesList.cmake new file mode 100644 index 000000000000..41002b84335d --- /dev/null +++ b/cmake/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/PackagesList.cmake @@ -0,0 +1,3 @@ +tribits_repository_define_packages( + DependsOnLAPACK . PT + ) diff --git a/cmake/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/TPLsList.cmake b/cmake/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/TPLsList.cmake new file mode 100644 index 000000000000..e85baf197743 --- /dev/null +++ b/cmake/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/TPLsList.cmake @@ -0,0 +1 @@ +tribits_repository_define_tpls() diff --git a/cmake/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/cmake/Dependencies.cmake b/cmake/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/cmake/Dependencies.cmake new file mode 100644 index 000000000000..3f688dcd49e9 --- /dev/null +++ b/cmake/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/cmake/Dependencies.cmake @@ -0,0 +1,3 @@ +tribits_package_define_dependencies( + LIB_REQUIRED_TPLS LAPACK + ) diff --git a/cmake/tribits/examples/TargetDefinesPkg/CMakeLists.txt b/cmake/tribits/examples/TargetDefinesPkg/CMakeLists.txt index 4ca9cd0fa681..0952d5736ffd 100644 --- a/cmake/tribits/examples/TargetDefinesPkg/CMakeLists.txt +++ b/cmake/tribits/examples/TargetDefinesPkg/CMakeLists.txt @@ -1,6 +1,6 @@ tribits_package(TargetDefinesPkg) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) tribits_add_library( targetdefinespkg diff --git a/cmake/tribits/examples/TribitsExampleApp/AppHelperFuncs.cmake b/cmake/tribits/examples/TribitsExampleApp/AppHelperFuncs.cmake index 471f33eb2d20..bfd38d81577b 100644 --- a/cmake/tribits/examples/TribitsExampleApp/AppHelperFuncs.cmake +++ b/cmake/tribits/examples/TribitsExampleApp/AppHelperFuncs.cmake @@ -65,7 +65,6 @@ macro(getTribitsExProjStuffForAppByProject) message(" TribitsExProj_DIR = ${TribitsExProj_DIR}") message(" TribitsExProj_VERSION = ${TribitsExProj_VERSION}") message(" TribitsExProj_PACKAGE_LIST = ${TribitsExProj_PACKAGE_LIST}") - message(" TribitsExProj_TPL_LIST = ${TribitsExProj_TPL_LIST}") message(" TribitsExProj_BUILD_SHARED_LIBS = ${TribitsExProj_BUILD_SHARED_LIBS}") message("End of TribitsExProj details\n") @@ -139,7 +138,7 @@ endfunction() # function(getExpectedAppDepsStr expectedDepsStrOut) - if ("SimpleTpl" IN_LIST SimpleCxx_TPL_LIST) + if (TARGET SimpleTpl::all_libs) set(simpleCxxDeps "simpletpl ") else() set(simpleCxxDeps "") diff --git a/cmake/tribits/examples/TribitsExampleProject/CMakeLists.txt b/cmake/tribits/examples/TribitsExampleProject/CMakeLists.txt index a44121b807fa..f413d381b010 100644 --- a/cmake/tribits/examples/TribitsExampleProject/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsExampleProject/CMakeLists.txt @@ -27,6 +27,8 @@ include("${CMAKE_CURRENT_SOURCE_DIR}/ProjectName.cmake") # not in an include file :-( project(${PROJECT_NAME} NONE) +set(TRIBITS_HIDE_DEPRECATED_INCLUDE_DIRECTORIES_OVERRIDE TRUE) + # # B) Pull in the TriBITS system and execute # diff --git a/cmake/tribits/examples/TribitsExampleProject/packages/mixed_lang/src/CMakeLists.txt b/cmake/tribits/examples/TribitsExampleProject/packages/mixed_lang/src/CMakeLists.txt index a8d33b430650..ddbeb6658fe0 100644 --- a/cmake/tribits/examples/TribitsExampleProject/packages/mixed_lang/src/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsExampleProject/packages/mixed_lang/src/CMakeLists.txt @@ -4,12 +4,12 @@ tribits_configure_file(${PACKAGE_NAME}_config.h) set(HEADERS "") set(SOURCES "") -include_directories(${CMAKE_CURRENT_BINARY_DIR}) +tribits_include_directories(${CMAKE_CURRENT_BINARY_DIR}) append_set(HEADERS ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h ) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) append_set(HEADERS MixedLang.hpp Ray_Tracer.hh diff --git a/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/src/CMakeLists.txt b/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/src/CMakeLists.txt index d00de0da8757..234a196d5144 100644 --- a/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/src/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/src/CMakeLists.txt @@ -11,12 +11,12 @@ tribits_configure_file(${PACKAGE_NAME}_config.h) set(HEADERS "") set(SOURCES "") -include_directories(${CMAKE_CURRENT_BINARY_DIR}) +tribits_include_directories(${CMAKE_CURRENT_BINARY_DIR}) append_set(HEADERS ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h ) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) append_set(HEADERS SimpleCxx_HelloWorld.hpp ) diff --git a/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/test/CMakeLists.txt b/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/test/CMakeLists.txt index 4b39105c91bc..f553d4ef2bc9 100644 --- a/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/test/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/test/CMakeLists.txt @@ -1,3 +1,6 @@ +tribits_include_directories( REQUIRED_DURING_INSTALLATION_TESTING + ${CMAKE_CURRENT_SOURCE_DIR}/inc ) + tribits_add_executable_and_test( HelloWorldTests SOURCES diff --git a/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/test/SimpleCxx_HelloWorld_Tests.cpp b/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/test/SimpleCxx_HelloWorld_Tests.cpp index 575555ffbe59..85430c8cffea 100644 --- a/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/test/SimpleCxx_HelloWorld_Tests.cpp +++ b/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/test/SimpleCxx_HelloWorld_Tests.cpp @@ -1,9 +1,4 @@ - -#include -#include -#include -#include "SimpleCxx_HelloWorld.hpp" -#include "HeaderOnlyTpl_stuff.hpp" +#include "SimpleCxx_HelloWorld_Tests.hpp" #define TEST_FIND_SUBSTR_IN_STR(SUBSTR, STR) \ diff --git a/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/test/inc/SimpleCxx_HelloWorld_Tests.hpp b/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/test/inc/SimpleCxx_HelloWorld_Tests.hpp new file mode 100644 index 000000000000..78b70ccc3d89 --- /dev/null +++ b/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/test/inc/SimpleCxx_HelloWorld_Tests.hpp @@ -0,0 +1,10 @@ +#ifndef SIMPLECXX_HELLOWORLD_TESTS_HPP +#define SIMPLECXX_HELLOWORLD_TESTS_HPP + +#include +#include +#include +#include "SimpleCxx_HelloWorld.hpp" +#include "HeaderOnlyTpl_stuff.hpp" + +#endif // SIMPLECXX_HELLOWORLD_TESTS_HPP diff --git a/cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/a/CMakeLists.txt b/cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/a/CMakeLists.txt index e7cdf9cf6f63..9de350b0a25a 100644 --- a/cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/a/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/a/CMakeLists.txt @@ -16,9 +16,9 @@ tribits_pkg_export_cache_var(${PACKAGE_NAME}_SPECIAL_VALUE) tribits_configure_file(${PACKAGE_NAME}_config.h) -include_directories(${CMAKE_CURRENT_BINARY_DIR}) +tribits_include_directories(${CMAKE_CURRENT_BINARY_DIR}) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) tribits_add_library(pws_a SOURCES A.cpp HEADERS A.hpp ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h diff --git a/cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/b/src/CMakeLists.txt b/cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/b/src/CMakeLists.txt index cde554625db3..0f64659a5c98 100644 --- a/cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/b/src/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/b/src/CMakeLists.txt @@ -1,10 +1,10 @@ tribits_configure_file(${PACKAGE_NAME}_config.h) -include_directories(${CMAKE_CURRENT_BINARY_DIR}) +tribits_include_directories(${CMAKE_CURRENT_BINARY_DIR}) include(${CMAKE_CURRENT_LIST_DIR}/ShowLibErrors.cmake) -include_directories(${CMAKE_CURRENT_BINARY_DIR}) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_include_directories(${CMAKE_CURRENT_BINARY_DIR}) +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) tribits_add_library(pws_b SOURCES B.cpp HEADERS B.hpp ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h diff --git a/cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/b/tests/testlib/CMakeLists.txt b/cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/b/tests/testlib/CMakeLists.txt index 407fc6a27fe7..215659e60f2b 100644 --- a/cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/b/tests/testlib/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/b/tests/testlib/CMakeLists.txt @@ -1,6 +1,6 @@ # Define the include dirs for the TESTONLY lib. -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) # # Create a test-only b_mixed_lang lib which uses the optional test dependent diff --git a/cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/c/CMakeLists.txt b/cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/c/CMakeLists.txt index 475912fac4ab..696a5815c850 100644 --- a/cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/c/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/c/CMakeLists.txt @@ -7,7 +7,7 @@ tribits_add_executable( c_util include(${CMAKE_CURRENT_LIST_DIR}/ShowLibErrors.cmake) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) tribits_add_library(pws_c SOURCES C.cpp HEADERS wsp_c/C.hpp diff --git a/cmake/tribits/examples/TribitsExampleProject/packages/wrap_external/CMakeLists.txt b/cmake/tribits/examples/TribitsExampleProject/packages/wrap_external/CMakeLists.txt index 3adfc2cdb90b..0efcd994f721 100644 --- a/cmake/tribits/examples/TribitsExampleProject/packages/wrap_external/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsExampleProject/packages/wrap_external/CMakeLists.txt @@ -145,7 +145,7 @@ add_dependencies(build_external_func pws_a) append_set(${PACKAGE_NAME}_LIB_TARGETS external_func) global_set(${PACKAGE_NAME}_LIBRARIES external_func pws_a) global_set(${PACKAGE_NAME}_HAS_NATIVE_LIBRARIES ON) -include_directories(${EXTERNAL_FUNC_SOURCE_DIR}) +tribits_include_directories(${EXTERNAL_FUNC_SOURCE_DIR}) # NOTE: Above, you have to add the upstream dependent libraries to the current # package's list of libraries because you can't link to an importing lib with # link_target_libraries() :-( diff --git a/cmake/tribits/examples/TribitsExampleProject2/CMakeLists.txt b/cmake/tribits/examples/TribitsExampleProject2/CMakeLists.txt index 661cb556e0a0..8e63bc40e843 100644 --- a/cmake/tribits/examples/TribitsExampleProject2/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsExampleProject2/CMakeLists.txt @@ -7,6 +7,7 @@ cmake_minimum_required(VERSION 3.17.0 FATAL_ERROR) include("${CMAKE_CURRENT_SOURCE_DIR}/ProjectName.cmake") project(${PROJECT_NAME} LANGUAGES NONE) +set(TRIBITS_HIDE_DEPRECATED_INCLUDE_DIRECTORIES_OVERRIDE TRUE) set(${PROJECT_NAME}_TRIBITS_DIR "${CMAKE_CURRENT_LIST_DIR}/../.." CACHE STRING "TriBITS base directory (default assumes in TriBITS source tree)") diff --git a/cmake/tribits/examples/TribitsExampleProject2/packages/package1/src/CMakeLists.txt b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/src/CMakeLists.txt index a0d23199e246..b74162bb25ed 100644 --- a/cmake/tribits/examples/TribitsExampleProject2/packages/package1/src/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/src/CMakeLists.txt @@ -1,7 +1,7 @@ set(HEADERS "") set(SOURCES "") -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) append_set(HEADERS Package1.hpp diff --git a/cmake/tribits/examples/TribitsExampleProject2/packages/package2/src/CMakeLists.txt b/cmake/tribits/examples/TribitsExampleProject2/packages/package2/src/CMakeLists.txt index 1de2194cb03a..5f95a0ef0b9a 100644 --- a/cmake/tribits/examples/TribitsExampleProject2/packages/package2/src/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsExampleProject2/packages/package2/src/CMakeLists.txt @@ -2,9 +2,9 @@ set(HEADERS "") set(SOURCES "") tribits_configure_file(${PACKAGE_NAME}_config.h) -include_directories(${CMAKE_CURRENT_BINARY_DIR}) +tribits_include_directories(${CMAKE_CURRENT_BINARY_DIR}) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) append_set(HEADERS ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h diff --git a/cmake/tribits/examples/TribitsExampleProject2/packages/package3/src/CMakeLists.txt b/cmake/tribits/examples/TribitsExampleProject2/packages/package3/src/CMakeLists.txt index ffe0ecc60d12..8b36f56b97af 100644 --- a/cmake/tribits/examples/TribitsExampleProject2/packages/package3/src/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsExampleProject2/packages/package3/src/CMakeLists.txt @@ -2,9 +2,9 @@ set(HEADERS "") set(SOURCES "") tribits_configure_file(${PACKAGE_NAME}_config.h) -include_directories(${CMAKE_CURRENT_BINARY_DIR}) +tribits_include_directories(${CMAKE_CURRENT_BINARY_DIR}) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) append_set(HEADERS ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h diff --git a/cmake/tribits/examples/TribitsExampleProjectAddons/packages/addon1/src/CMakeLists.txt b/cmake/tribits/examples/TribitsExampleProjectAddons/packages/addon1/src/CMakeLists.txt index d4fffaa075b4..c890968cdb23 100644 --- a/cmake/tribits/examples/TribitsExampleProjectAddons/packages/addon1/src/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsExampleProjectAddons/packages/addon1/src/CMakeLists.txt @@ -1,4 +1,4 @@ -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) tribits_add_library(addon1 SOURCES Addon1.cpp HEADERS Addon1.hpp diff --git a/cmake/tribits/examples/TribitsOldSimpleExampleApp/CMakeLists.txt b/cmake/tribits/examples/TribitsOldSimpleExampleApp/CMakeLists.txt index 34302ee7b669..b0d9d5d0699b 100644 --- a/cmake/tribits/examples/TribitsOldSimpleExampleApp/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsOldSimpleExampleApp/CMakeLists.txt @@ -52,11 +52,14 @@ target_include_directories(app enable_testing() -if ("SimpleTpl" IN_LIST TribitsExProj_TPL_LIST) +if ("SimpleTpl" IN_LIST TribitsExProj_TPL_LIST OR TARGET SimpleTpl::all_libs) set(simpleCxxDeps "simpletpl headeronlytpl") else() set(simpleCxxDeps "headeronlytpl") endif() +# NOTE: Above, TribitsExProj_TPL_LIST does not exist in new TriBITS so to make +# this work for new TriBITS as well, we need to check for target +# SimpleTpl::all_libs. Small price to pay for progress! add_test(NAME util_test COMMAND util) set_tests_properties(util_test PROPERTIES diff --git a/cmake/tribits/examples/TribitsSimpleExampleApp/CMakeLists.txt b/cmake/tribits/examples/TribitsSimpleExampleApp/CMakeLists.txt index 425e0717cdde..58725b4fc565 100644 --- a/cmake/tribits/examples/TribitsSimpleExampleApp/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsSimpleExampleApp/CMakeLists.txt @@ -39,7 +39,7 @@ target_link_libraries(app PRIVATE TribitsExProj::all_selected_libs) enable_testing() -if ("SimpleTpl" IN_LIST TribitsExProj_TPL_LIST) +if (TARGET SimpleTpl::all_libs) set(simpleCxxDeps "simpletpl headeronlytpl") else() set(simpleCxxDeps "headeronlytpl") diff --git a/commonTools/gtest/CMakeLists.txt b/commonTools/gtest/CMakeLists.txt index 210d6218c186..72535fe88c20 100644 --- a/commonTools/gtest/CMakeLists.txt +++ b/commonTools/gtest/CMakeLists.txt @@ -5,7 +5,7 @@ SET(${PACKAGE_NAME}_SKIP_INSTALL FALSE CACHE BOOL ADD_DEFINITIONS(-DGTEST_HAS_PTHREAD=0) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) APPEND_SET(HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/gtest/gtest.h diff --git a/packages/adelus/example/CMakeLists.txt b/packages/adelus/example/CMakeLists.txt index 3fdcc9bfa670..de56f780fc00 100644 --- a/packages/adelus/example/CMakeLists.txt +++ b/packages/adelus/example/CMakeLists.txt @@ -54,7 +54,7 @@ PROJECT(my_Adelus_driver C CXX) ADD_DEFINITIONS(-DKKVIEW_API) -INCLUDE_DIRECTORIES(${Trilinos_INCLUDE_DIRS} ${Trilinos_TPL_INCLUDE_DIRS}) +TRIBITS_INCLUDE_DIRECTORIES(${Trilinos_INCLUDE_DIRS} ${Trilinos_TPL_INCLUDE_DIRS}) LINK_DIRECTORIES(${Trilinos_LIBRARY_DIRS} ${Trilinos_TPL_LIBRARY_DIRS}) ADD_EXECUTABLE(adelus_driver adelus_driver.cpp) diff --git a/packages/adelus/src/CMakeLists.txt b/packages/adelus/src/CMakeLists.txt index 81717dd70d3b..3228959e7b45 100644 --- a/packages/adelus/src/CMakeLists.txt +++ b/packages/adelus/src/CMakeLists.txt @@ -21,13 +21,13 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) SET(HEADERS ${HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h ) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # # Core files diff --git a/packages/amesos/src/CMakeLists.txt b/packages/amesos/src/CMakeLists.txt index ac5445e53316..74fe29686dfb 100644 --- a/packages/amesos/src/CMakeLists.txt +++ b/packages/amesos/src/CMakeLists.txt @@ -20,7 +20,7 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) SET(HEADERS ${HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h @@ -30,7 +30,7 @@ SET(HEADERS ${HEADERS} # support files # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(SOURCES ${SOURCES} Amesos_Status.cpp diff --git a/packages/amesos2/src/CMakeLists.txt b/packages/amesos2/src/CMakeLists.txt index 0504cf45a19a..49725393f27a 100644 --- a/packages/amesos2/src/CMakeLists.txt +++ b/packages/amesos2/src/CMakeLists.txt @@ -60,7 +60,7 @@ SET(SOURCES "") ASSERT_DEFINED(PROJECT_SOURCE_DIR) -INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}) # If we use Trilinos_version then "make install" will fail. #APPEND_SET(HEADERS @@ -69,7 +69,7 @@ INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}) # Set headers (for IDEs and installing) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) APPEND_SET(HEADERS ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h @@ -78,14 +78,14 @@ APPEND_SET(HEADERS # NOTE: Above, we add the XXX_config.h file so that MS Visual Studio # will know to include this file in the dependency analysis -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) -#INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/basker) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/KLU2/Include) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/KLU2/Source) -INCLUDE_DIRECTORIES(${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/AMD/Include) -INCLUDE_DIRECTORIES(${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/COLAMD/Include) -INCLUDE_DIRECTORIES(${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/BTF/Include) -INCLUDE_DIRECTORIES(${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/UFconfig) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +#TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/basker) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/KLU2/Include) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/KLU2/Source) +TRIBITS_INCLUDE_DIRECTORIES(${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/AMD/Include) +TRIBITS_INCLUDE_DIRECTORIES(${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/COLAMD/Include) +TRIBITS_INCLUDE_DIRECTORIES(${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/BTF/Include) +TRIBITS_INCLUDE_DIRECTORIES(${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/UFconfig) APPEND_SET(HEADERS Amesos2.hpp @@ -258,7 +258,7 @@ IF (${PACKAGE_NAME}_ENABLE_Basker) Amesos2_Basker.cpp ) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/basker) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/basker) APPEND_SET(HEADERS basker/basker.hpp basker/basker_decl.hpp diff --git a/packages/amesos2/src/KLU2/Source/CMakeLists.txt b/packages/amesos2/src/KLU2/Source/CMakeLists.txt index bb834a60373e..cd0c09eddeac 100644 --- a/packages/amesos2/src/KLU2/Source/CMakeLists.txt +++ b/packages/amesos2/src/KLU2/Source/CMakeLists.txt @@ -61,11 +61,11 @@ SET(SOURCES "") ASSERT_DEFINED(PROJECT_SOURCE_DIR) -INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}) # Set headers (for IDEs and installing) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) APPEND_SET(HEADERS ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h @@ -74,12 +74,12 @@ APPEND_SET(HEADERS # NOTE: Above, we add the XXX_config.h file so that MS Visual Studio # will know to include this file in the dependency analysis -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../Include) -INCLUDE_DIRECTORIES(${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/AMD/Include) -INCLUDE_DIRECTORIES(${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/COLAMD/Include) -INCLUDE_DIRECTORIES(${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/BTF/Include) -INCLUDE_DIRECTORIES(${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/UFconfig) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../Include) +TRIBITS_INCLUDE_DIRECTORIES(${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/AMD/Include) +TRIBITS_INCLUDE_DIRECTORIES(${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/COLAMD/Include) +TRIBITS_INCLUDE_DIRECTORIES(${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/BTF/Include) +TRIBITS_INCLUDE_DIRECTORIES(${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/UFconfig) APPEND_SET(HEADERS klu2_analyze_given.hpp diff --git a/packages/anasazi/epetra/src-rbgen/CMakeLists.txt b/packages/anasazi/epetra/src-rbgen/CMakeLists.txt index e656ed7342d6..7e81360f6fb9 100644 --- a/packages/anasazi/epetra/src-rbgen/CMakeLists.txt +++ b/packages/anasazi/epetra/src-rbgen/CMakeLists.txt @@ -12,8 +12,8 @@ SET(HEADERS "") SET(NOINSTALLHEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../src-rbgen) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../src-rbgen) # Abstract headers APPEND_SET(HEADERS diff --git a/packages/anasazi/epetra/src/CMakeLists.txt b/packages/anasazi/epetra/src/CMakeLists.txt index 31808b60d7cc..ccfdd298d0a8 100644 --- a/packages/anasazi/epetra/src/CMakeLists.txt +++ b/packages/anasazi/epetra/src/CMakeLists.txt @@ -19,7 +19,7 @@ CONFIGURE_FILE("${Trilinos_SOURCE_DIR}/packages/Trilinos_DLLExportMacro.h.in" SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) APPEND_SET(HEADERS ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}epetra_DLLExportMacro.h @@ -29,7 +29,7 @@ APPEND_SET(HEADERS # Core Files # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) APPEND_SET(HEADERS AnasaziEpetraAdapter.hpp diff --git a/packages/anasazi/epetra/util/ModeLaplace/CMakeLists.txt b/packages/anasazi/epetra/util/ModeLaplace/CMakeLists.txt index 4f8634ddb410..0677098dd017 100644 --- a/packages/anasazi/epetra/util/ModeLaplace/CMakeLists.txt +++ b/packages/anasazi/epetra/util/ModeLaplace/CMakeLists.txt @@ -19,7 +19,7 @@ CONFIGURE_FILE("${Trilinos_SOURCE_DIR}/packages/Trilinos_DLLExportMacro.h.in" SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) APPEND_SET(HEADERS ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}epetra_ModeLaplace_DLLExportMacro.h ) @@ -28,7 +28,7 @@ APPEND_SET(HEADERS # Core Files # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) APPEND_SET(HEADERS BlockPCGSolver.h diff --git a/packages/anasazi/src-rbgen/CMakeLists.txt b/packages/anasazi/src-rbgen/CMakeLists.txt index d27665c2de73..b7aa155894f1 100644 --- a/packages/anasazi/src-rbgen/CMakeLists.txt +++ b/packages/anasazi/src-rbgen/CMakeLists.txt @@ -12,7 +12,7 @@ SET(HEADERS "") SET(NOINSTALLHEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # Abstract headers APPEND_SET(HEADERS diff --git a/packages/anasazi/src/CMakeLists.txt b/packages/anasazi/src/CMakeLists.txt index 2442699c34d5..d882ecc53cec 100644 --- a/packages/anasazi/src/CMakeLists.txt +++ b/packages/anasazi/src/CMakeLists.txt @@ -36,7 +36,7 @@ CONFIGURE_FILE("${Trilinos_SOURCE_DIR}/packages/Trilinos_DLLExportMacro.h.in" SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) SET(HEADERS ${HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h @@ -47,7 +47,7 @@ SET(HEADERS ${HEADERS} # Core Files # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) APPEND_SET(HEADERS AnasaziBasicEigenproblem.hpp @@ -149,7 +149,7 @@ APPEND_SET(HEADERS ASSERT_DEFINED(Anasazi_ENABLE_ThyraCore) IF (Anasazi_ENABLE_ThyraCore) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../thyra/src) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../thyra/src) APPEND_SET(HEADERS ../thyra/src/AnasaziThyraAdapter.hpp ../thyra/src/AnasaziThyraDebugAdapter.hpp @@ -158,7 +158,7 @@ ENDIF() ASSERT_DEFINED(Anasazi_ENABLE_Tpetra) IF (Anasazi_ENABLE_Tpetra) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../tpetra/src) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../tpetra/src) # The AnasaziTpetraAdapter headers are already pulled in by # <./packages/anasazi/tpetra/src/CMakeLists.txt>. ENDIF() diff --git a/packages/anasazi/test/CMakeLists.txt b/packages/anasazi/test/CMakeLists.txt index 2c9310b768e6..51adf9fd4f96 100644 --- a/packages/anasazi/test/CMakeLists.txt +++ b/packages/anasazi/test/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/MVOPTester) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/MVOPTester) ADD_SUBDIRECTORY(MVOPTester) ADD_SUBDIRECTORY(OrthoManager) diff --git a/packages/anasazi/test/OrthoManager/CMakeLists.txt b/packages/anasazi/test/OrthoManager/CMakeLists.txt index 06826bd9a689..99da387d570e 100644 --- a/packages/anasazi/test/OrthoManager/CMakeLists.txt +++ b/packages/anasazi/test/OrthoManager/CMakeLists.txt @@ -6,7 +6,7 @@ IF (${PACKAGE_NAME}_ENABLE_Triutils) # FIXME (mfh 04 Aug 2010) IF ({${PACKAGE_NAME}_ENABLE_COMPLEX) - INCLUDE_DIRECTORIES(../MVOPTester) + TRIBITS_INCLUDE_DIRECTORIES(../MVOPTester) TRIBITS_ADD_EXECUTABLE_AND_TEST( OrthoManagerComplexTester diff --git a/packages/anasazi/thyra/src/CMakeLists.txt b/packages/anasazi/thyra/src/CMakeLists.txt index 2f59e80fa9e4..796154d065d6 100644 --- a/packages/anasazi/thyra/src/CMakeLists.txt +++ b/packages/anasazi/thyra/src/CMakeLists.txt @@ -17,7 +17,7 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) SET(HEADERS ${HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h @@ -27,7 +27,7 @@ SET(HEADERS ${HEADERS} # Core Files # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) APPEND_SET(HEADERS AnasaziBasicEigenproblem.hpp diff --git a/packages/anasazi/tpetra/src/CMakeLists.txt b/packages/anasazi/tpetra/src/CMakeLists.txt index 37be72368a39..6660448f0b39 100644 --- a/packages/anasazi/tpetra/src/CMakeLists.txt +++ b/packages/anasazi/tpetra/src/CMakeLists.txt @@ -15,13 +15,13 @@ SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) # # Core Files # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) APPEND_SET(HEADERS AnasaziTpetraAdapter.hpp diff --git a/packages/aztecoo/src/CMakeLists.txt b/packages/aztecoo/src/CMakeLists.txt index 4e9738592059..b27c6f58a3b4 100644 --- a/packages/aztecoo/src/CMakeLists.txt +++ b/packages/aztecoo/src/CMakeLists.txt @@ -27,13 +27,13 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) SET(HEADERS ${HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h ) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # # C files diff --git a/packages/belos/doc/parameterList/CMakeLists.txt b/packages/belos/doc/parameterList/CMakeLists.txt index b307d66ad464..b5d958c7f771 100644 --- a/packages/belos/doc/parameterList/CMakeLists.txt +++ b/packages/belos/doc/parameterList/CMakeLists.txt @@ -2,7 +2,7 @@ IF (${PACKAGE_NAME}_ENABLE_Tpetra) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../../tpetra/src ) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../../tpetra/src ) # Create the ValidParameters executable TRIBITS_ADD_EXECUTABLE( diff --git a/packages/belos/epetra/src/CMakeLists.txt b/packages/belos/epetra/src/CMakeLists.txt index 1f9c2c6a29d4..0f658527713c 100644 --- a/packages/belos/epetra/src/CMakeLists.txt +++ b/packages/belos/epetra/src/CMakeLists.txt @@ -15,13 +15,13 @@ SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) # # Core Files # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) APPEND_SET(HEADERS BelosEpetraAdapter.hpp diff --git a/packages/belos/kokkos/example/CMakeLists.txt b/packages/belos/kokkos/example/CMakeLists.txt index b493959ea9af..2539e714db0c 100644 --- a/packages/belos/kokkos/example/CMakeLists.txt +++ b/packages/belos/kokkos/example/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${Belos_SOURCE_DIR}/kokkos/src) +TRIBITS_INCLUDE_DIRECTORIES(${Belos_SOURCE_DIR}/kokkos/src) TRIBITS_ADD_EXECUTABLE_AND_TEST( Kokkos_BlockGmresEx diff --git a/packages/belos/kokkos/src/CMakeLists.txt b/packages/belos/kokkos/src/CMakeLists.txt index 4d8c6851c1f1..3308e7f45a4d 100644 --- a/packages/belos/kokkos/src/CMakeLists.txt +++ b/packages/belos/kokkos/src/CMakeLists.txt @@ -15,13 +15,13 @@ SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) # # Core Files # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) APPEND_SET(HEADERS BelosKokkosAdapter.hpp diff --git a/packages/belos/kokkos/test/CMakeLists.txt b/packages/belos/kokkos/test/CMakeLists.txt index 2a37af1bd697..68b112e0894f 100644 --- a/packages/belos/kokkos/test/CMakeLists.txt +++ b/packages/belos/kokkos/test/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${Belos_SOURCE_DIR}/kokkos/src) +TRIBITS_INCLUDE_DIRECTORIES(${Belos_SOURCE_DIR}/kokkos/src) TRIBITS_ADD_EXECUTABLE_AND_TEST( KokkosMVOPTest diff --git a/packages/belos/src/CMakeLists.txt b/packages/belos/src/CMakeLists.txt index 664dc48f770f..36df2b008ce6 100644 --- a/packages/belos/src/CMakeLists.txt +++ b/packages/belos/src/CMakeLists.txt @@ -13,13 +13,13 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) SET(HEADERS ${HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h ) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # CORE APPEND_SET(HEADERS diff --git a/packages/belos/test/GCRODR/CMakeLists.txt b/packages/belos/test/GCRODR/CMakeLists.txt index db62c961fb79..fe9e1488a034 100644 --- a/packages/belos/test/GCRODR/CMakeLists.txt +++ b/packages/belos/test/GCRODR/CMakeLists.txt @@ -1,6 +1,6 @@ -INCLUDE_DIRECTORIES(REQUIRED_DURING_INSTALLATION_TESTING ${CMAKE_CURRENT_SOURCE_DIR}/../MVOPTester) +TRIBITS_INCLUDE_DIRECTORIES(REQUIRED_DURING_INSTALLATION_TESTING ${CMAKE_CURRENT_SOURCE_DIR}/../MVOPTester) ASSERT_DEFINED(${PACKAGE_NAME}_ENABLE_Triutils) IF (${PACKAGE_NAME}_ENABLE_Triutils) @@ -8,7 +8,7 @@ IF (${PACKAGE_NAME}_ENABLE_Triutils) ASSERT_DEFINED(Teuchos_ENABLE_COMPLEX) IF(Teuchos_ENABLE_COMPLEX) - INCLUDE_DIRECTORIES(../MVOPTester) + TRIBITS_INCLUDE_DIRECTORIES(../MVOPTester) TRIBITS_ADD_EXECUTABLE_AND_TEST( gcrodr_complex_hb diff --git a/packages/belos/tpetra/src/CMakeLists.txt b/packages/belos/tpetra/src/CMakeLists.txt index e0062875cc05..0abb87db2e00 100644 --- a/packages/belos/tpetra/src/CMakeLists.txt +++ b/packages/belos/tpetra/src/CMakeLists.txt @@ -15,13 +15,13 @@ SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) # # Core Files # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) APPEND_SET(HEADERS BelosMultiVecTraits_Tpetra.hpp diff --git a/packages/belos/xpetra/src/CMakeLists.txt b/packages/belos/xpetra/src/CMakeLists.txt index 65897f3b1a0d..b72027256ee8 100644 --- a/packages/belos/xpetra/src/CMakeLists.txt +++ b/packages/belos/xpetra/src/CMakeLists.txt @@ -15,13 +15,13 @@ SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) # # Core Files # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) APPEND_SET(HEADERS BelosXpetraAdapter.hpp diff --git a/packages/common/auxiliarySoftware/SuiteSparse/src/CMakeLists.txt b/packages/common/auxiliarySoftware/SuiteSparse/src/CMakeLists.txt index 76cdf26bc963..a358b6f5e84a 100644 --- a/packages/common/auxiliarySoftware/SuiteSparse/src/CMakeLists.txt +++ b/packages/common/auxiliarySoftware/SuiteSparse/src/CMakeLists.txt @@ -21,14 +21,14 @@ SET(HEADERS ${HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h ) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/AMD/Include) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/BTF/Include) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/CAMD/Include) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/CCOLAMD/Include) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/COLAMD/Include) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/KLU/Include) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/UFconfig) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/AMD/Include) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/BTF/Include) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/CAMD/Include) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/CCOLAMD/Include) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/COLAMD/Include) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/KLU/Include) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/UFconfig) file(GLOB AMD_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/AMD/Include/*.h) file(GLOB BTF_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/BTF/Include/*.h) diff --git a/packages/compadre/examples/CMakeLists.tribits.cmake b/packages/compadre/examples/CMakeLists.tribits.cmake index a6ee5a92d0ef..523f31cae25d 100644 --- a/packages/compadre/examples/CMakeLists.tribits.cmake +++ b/packages/compadre/examples/CMakeLists.tribits.cmake @@ -1,4 +1,4 @@ -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) #tribits_add_executable( # UnitTests diff --git a/packages/compadre/src/CMakeLists.tribits.cmake b/packages/compadre/src/CMakeLists.tribits.cmake index c714908c844c..8a7511905816 100644 --- a/packages/compadre/src/CMakeLists.tribits.cmake +++ b/packages/compadre/src/CMakeLists.tribits.cmake @@ -11,13 +11,13 @@ bob_config_header(${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_Config.h ${PACKAGE set(HEADERS "") set(SOURCES "") -include_directories(${CMAKE_CURRENT_BINARY_DIR}) +tribits_include_directories(${CMAKE_CURRENT_BINARY_DIR}) set(HEADERS ${HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_Config.h ) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) append_glob(HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp) list(REMOVE_ITEM HEADERS diff --git a/packages/domi/doc/parameterList/CMakeLists.txt b/packages/domi/doc/parameterList/CMakeLists.txt index eb835efbac0a..6a5d03b56fde 100644 --- a/packages/domi/doc/parameterList/CMakeLists.txt +++ b/packages/domi/doc/parameterList/CMakeLists.txt @@ -42,7 +42,7 @@ # *********************************************************************** # @HEADER -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # Create the ValidParameters executable TRIBITS_ADD_EXECUTABLE( diff --git a/packages/domi/src/CMakeLists.txt b/packages/domi/src/CMakeLists.txt index 31e31e2a08d3..91776dfcb0e2 100644 --- a/packages/domi/src/CMakeLists.txt +++ b/packages/domi/src/CMakeLists.txt @@ -73,8 +73,8 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) # # Set the include directories -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # # Define the header and source files (and directories) diff --git a/packages/domi/test/MDArray/CMakeLists.txt b/packages/domi/test/MDArray/CMakeLists.txt index cb78a965ddcf..7874d2c5e660 100644 --- a/packages/domi/test/MDArray/CMakeLists.txt +++ b/packages/domi/test/MDArray/CMakeLists.txt @@ -44,7 +44,7 @@ #INCLUDE(TribitsCopyFilesToBinaryDir) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # Unit test the Slice class TRIBITS_ADD_EXECUTABLE_AND_TEST( diff --git a/packages/domi/test/MDComm/CMakeLists.txt b/packages/domi/test/MDComm/CMakeLists.txt index 721542809a95..c2aa3f3f66ba 100644 --- a/packages/domi/test/MDComm/CMakeLists.txt +++ b/packages/domi/test/MDComm/CMakeLists.txt @@ -44,7 +44,7 @@ #INCLUDE(TribitsCopyFilesToBinaryDir) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # Create the MDComm unit test executable TRIBITS_ADD_EXECUTABLE( diff --git a/packages/domi/test/MDMap/CMakeLists.txt b/packages/domi/test/MDMap/CMakeLists.txt index f464419e7dcb..a18f050171c9 100644 --- a/packages/domi/test/MDMap/CMakeLists.txt +++ b/packages/domi/test/MDMap/CMakeLists.txt @@ -44,7 +44,7 @@ #INCLUDE(TribitsCopyFilesToBinaryDir) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # Create the MDMap unit test executable TRIBITS_ADD_EXECUTABLE( diff --git a/packages/domi/test/MDVector/CMakeLists.txt b/packages/domi/test/MDVector/CMakeLists.txt index d497e29ea175..dfec34d53a32 100644 --- a/packages/domi/test/MDVector/CMakeLists.txt +++ b/packages/domi/test/MDVector/CMakeLists.txt @@ -44,7 +44,7 @@ #INCLUDE(TribitsCopyFilesToBinaryDir) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # Create the MDVector unit test executable TRIBITS_ADD_EXECUTABLE( diff --git a/packages/epetra/CMakeLists.txt b/packages/epetra/CMakeLists.txt index 91727f9c3167..72e200ce0acf 100644 --- a/packages/epetra/CMakeLists.txt +++ b/packages/epetra/CMakeLists.txt @@ -70,7 +70,7 @@ IF(TPL_ENABLE_MKL) OFF ) IF(Epetra_ENABLE_MKL_SPARSE) - INCLUDE_DIRECTORIES(${TPL_MKL_INCLUDE_DIRS}) + TRIBITS_INCLUDE_DIRECTORIES(${TPL_MKL_INCLUDE_DIRS}) TRIBITS_ADD_OPTION_AND_DEFINE(${PACKAGE_NAME}_DISABLE_MKL_SPARSE_MM Epetra_DISABLE_MKL_SPARSE_MM diff --git a/packages/epetra/src/CMakeLists.txt b/packages/epetra/src/CMakeLists.txt index 508dd7e27ff9..427a313a2901 100644 --- a/packages/epetra/src/CMakeLists.txt +++ b/packages/epetra/src/CMakeLists.txt @@ -26,7 +26,7 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) # Set the base Trilinos directory in order to find Trilinos_version.h ASSERT_DEFINED(PROJECT_SOURCE_DIR) -INCLUDE_DIRECTORIES(${Trilinos_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${Trilinos_BINARY_DIR}) SET(CURRENT_PACKAGE EPETRA) CONFIGURE_FILE("${Trilinos_SOURCE_DIR}/packages/Trilinos_DLLExportMacro.h.in" @@ -39,14 +39,14 @@ CONFIGURE_FILE("${Trilinos_SOURCE_DIR}/packages/Trilinos_DLLExportMacro.h.in" SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) SET(HEADERS ${HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_DLLExportMacro.h ) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(HEADERS ${HEADERS} Epetra_BLAS.h diff --git a/packages/epetraext/src/CMakeLists.txt b/packages/epetraext/src/CMakeLists.txt index 0e0b05695f51..f74358217703 100644 --- a/packages/epetraext/src/CMakeLists.txt +++ b/packages/epetraext/src/CMakeLists.txt @@ -20,12 +20,12 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) SET(HEADERS ${HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h ) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(HEADERS ${HEADERS} EpetraExt_ConfigDefs.h @@ -50,7 +50,7 @@ SET(SOURCES ${SOURCES} IF (${PACKAGE_NAME}_BUILD_TRANSFORM) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/transform) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/transform) SET(HEADERS ${HEADERS} transform/EpetraExt_SubCopy_CrsMatrix.h @@ -121,7 +121,7 @@ ENDIF() IF (${PACKAGE_NAME}_BUILD_BTF) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/btf) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/btf) SET(HEADERS ${HEADERS} btf/EpetraExt_BTF_CrsGraph.h @@ -157,7 +157,7 @@ ENDIF() IF (${PACKAGE_NAME}_BUILD_INOUT) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/inout) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/inout) SET(HEADERS ${HEADERS} inout/EpetraExt_mmio.h @@ -217,7 +217,7 @@ ENDIF() IF (${PACKAGE_NAME}_BUILD_COLORING) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/coloring) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/coloring) SET(HEADERS ${HEADERS} coloring/EpetraExt_MapColoring.h @@ -238,7 +238,7 @@ ENDIF() IF (${PACKAGE_NAME}_BUILD_MATLAB) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/matlab) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/matlab) SET(HEADERS ${HEADERS} matlab/EpetraExt_MatlabEngine.h @@ -262,7 +262,7 @@ ENDIF() IF (${PACKAGE_NAME}_BUILD_MODEL_EVALUATOR) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/model_evaluator) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/model_evaluator) SET(HEADERS ${HEADERS} model_evaluator/EpetraExt_ModelEvaluator.h @@ -283,7 +283,7 @@ ENDIF() IF (${PACKAGE_NAME}_BUILD_BLOCK) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/block) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/block) SET(HEADERS ${HEADERS} block/EpetraExt_BlockCrsMatrix.h @@ -328,7 +328,7 @@ ENDIF() IF (${PACKAGE_NAME}_BUILD_RESTRICT) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/restrict) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/restrict) SET(HEADERS ${HEADERS} restrict/EpetraExt_RestrictedMultiVectorWrapper.h @@ -348,7 +348,7 @@ ENDIF() IF (${PACKAGE_NAME}_USING_PETSC) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/petsc) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/petsc) SET(HEADERS ${HEADERS} petsc/EpetraExt_PETScAIJMatrix.h @@ -366,7 +366,7 @@ ENDIF() ASSERT_DEFINED(${PACKAGE_NAME}_ENABLE_HYPRE) IF (${PACKAGE_NAME}_ENABLE_HYPRE) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/hypre) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/hypre) SET(HEADERS ${HEADERS} hypre/EpetraExt_HypreIJMatrix.h @@ -386,7 +386,7 @@ IF (${PROJECT_NAME}_ENABLE_PyTrilinos) FIND_PACKAGE(PythonInclude REQUIRED) - INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH}) + TRIBITS_INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH}) ENDIF() diff --git a/packages/epetraext/test/CMakeLists.txt b/packages/epetraext/test/CMakeLists.txt index ec4c87c1dde7..d1793b2f99cb 100644 --- a/packages/epetraext/test/CMakeLists.txt +++ b/packages/epetraext/test/CMakeLists.txt @@ -1,7 +1,7 @@ # Compile against epetra_test_err.h in all tests? -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) IF (${PACKAGE_NAME}_BUILD_TRANSFORM) diff --git a/packages/fei/base/CMakeLists.txt b/packages/fei/base/CMakeLists.txt index abd14e3820ec..01e9f222e515 100644 --- a/packages/fei/base/CMakeLists.txt +++ b/packages/fei/base/CMakeLists.txt @@ -17,14 +17,14 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../) # # Core headers # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) FILE(GLOB HEADERS *.hpp *.h) diff --git a/packages/fei/support-Trilinos/CMakeLists.txt b/packages/fei/support-Trilinos/CMakeLists.txt index 381c2bc56fd6..30bcd746a3a8 100644 --- a/packages/fei/support-Trilinos/CMakeLists.txt +++ b/packages/fei/support-Trilinos/CMakeLists.txt @@ -17,8 +17,8 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../) SET(HEADERS ${HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h @@ -28,7 +28,7 @@ SET(HEADERS ${HEADERS} # Core headers # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) FILE(GLOB HEADERS *.hpp) FILE(GLOB SOURCES *.cpp) diff --git a/packages/fei/unit_tests/CMakeLists.txt b/packages/fei/unit_tests/CMakeLists.txt index a35d476c0a2e..c76c624b2c01 100644 --- a/packages/fei/unit_tests/CMakeLists.txt +++ b/packages/fei/unit_tests/CMakeLists.txt @@ -1,10 +1,10 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../base) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../support-Trilinos) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../base) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../support-Trilinos) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/) TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) diff --git a/packages/galeri/src-epetra/CMakeLists.txt b/packages/galeri/src-epetra/CMakeLists.txt index c6edd3204c2d..9237c6a51677 100644 --- a/packages/galeri/src-epetra/CMakeLists.txt +++ b/packages/galeri/src-epetra/CMakeLists.txt @@ -20,8 +20,8 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../headers) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../headers) SET(HEADERS ${HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h @@ -31,7 +31,7 @@ SET(HEADERS ${HEADERS} # src # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(HEADERS ${HEADERS} ../headers/Galeri_ConfigDefs.h @@ -64,7 +64,7 @@ ENDIF() # src/Maps # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Maps) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Maps) SET(HEADERS ${HEADERS} Maps/Galeri_Linear.h @@ -79,7 +79,7 @@ SET(HEADERS ${HEADERS} # src/CrsMatrices # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/CRSMatrices) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/CRSMatrices) SET(HEADERS ${HEADERS} CrsMatrices/Galeri_BigCross2D.h @@ -113,7 +113,7 @@ SET(HEADERS ${HEADERS} # src/FiniteElements # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/FiniteElements) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/FiniteElements) SET(HEADERS ${HEADERS} FiniteElements/Galeri_AbstractGrid.h diff --git a/packages/galeri/src-xpetra/CMakeLists.txt b/packages/galeri/src-xpetra/CMakeLists.txt index 45ad6c367fe1..e407ea8ec3be 100644 --- a/packages/galeri/src-xpetra/CMakeLists.txt +++ b/packages/galeri/src-xpetra/CMakeLists.txt @@ -3,11 +3,11 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../src-epetra) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/../src-epetra) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../headers) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../src-epetra) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/../src-epetra) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../headers) APPEND_SET(HEADERS diff --git a/packages/ifpack/src/CMakeLists.txt b/packages/ifpack/src/CMakeLists.txt index 8d2f708abfec..0d0f320f675b 100644 --- a/packages/ifpack/src/CMakeLists.txt +++ b/packages/ifpack/src/CMakeLists.txt @@ -37,13 +37,13 @@ ENDIF () SET(HEADERS) SET(SOURCES) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) SET(HEADERS ${HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h ) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(HEADERS ${HEADERS} Ifpack_ConfigDefs.h @@ -187,7 +187,7 @@ ENDIF() IF (${PACKAGE_NAME}_ENABLE_Amesos) - INCLUDE_DIRECTORIES( + TRIBITS_INCLUDE_DIRECTORIES( ${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/AMD/Include ${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/UFconfig ) @@ -205,7 +205,7 @@ IF (${PACKAGE_NAME}_ENABLE_Amesos) ENDIF() IF (${PACKAGE_NAME}_ENABLE_Euclid) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/euclid) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/euclid) SET(HEADERS ${HEADERS} euclid/Euclid_dh.h @@ -275,7 +275,7 @@ IF (${PACKAGE_NAME}_ENABLE_Euclid) ENDIF() IF (${PACKAGE_NAME}_ENABLE_SUPPORTGRAPH) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/supportgraph) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/supportgraph) SET (HEADERS ${HEADERS} supportgraph/Ifpack_SupportGraph.h @@ -296,7 +296,7 @@ APPEND_SET(${PACKAGE_NAME}_EXPERIMENTAL_SOURCES ASSERT_DEFINED(${PACKAGE_NAME}_ENABLE_Experimental) IF(${PACKAGE_NAME}_ENABLE_Experimental) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/supportgraph) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/supportgraph) # # Add experimental files to HEADERS and SOURCES. # diff --git a/packages/ifpack/test/AztecOO/CMakeLists.txt b/packages/ifpack/test/AztecOO/CMakeLists.txt index c147906de95c..746c9ee6d08c 100644 --- a/packages/ifpack/test/AztecOO/CMakeLists.txt +++ b/packages/ifpack/test/AztecOO/CMakeLists.txt @@ -1,8 +1,8 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/) TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) diff --git a/packages/ifpack/test/AztecOO_LL/CMakeLists.txt b/packages/ifpack/test/AztecOO_LL/CMakeLists.txt index cfb437736aac..f3f3042905c2 100644 --- a/packages/ifpack/test/AztecOO_LL/CMakeLists.txt +++ b/packages/ifpack/test/AztecOO_LL/CMakeLists.txt @@ -1,8 +1,8 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/) TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) diff --git a/packages/ifpack2/adapters/CMakeLists.txt b/packages/ifpack2/adapters/CMakeLists.txt index 8429b54fed38..1b85a39b3aaf 100644 --- a/packages/ifpack2/adapters/CMakeLists.txt +++ b/packages/ifpack2/adapters/CMakeLists.txt @@ -8,14 +8,14 @@ SET(HEADERS "") SET(SOURCES "") IF(${PACKAGE_NAME}_ENABLE_ThyraTpetraAdapters) - SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}/thyra) + TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}/thyra) APPEND_GLOB(HEADERS ${DIR}/*.hpp) APPEND_GLOB(SOURCES ${DIR}/*.cpp) TRILINOS_CREATE_CLIENT_TEMPLATE_HEADERS(${DIR}) ENDIF(${PACKAGE_NAME}_ENABLE_ThyraTpetraAdapters) # Must glob the binary dir last to get all of the auto-generated headers -SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_BINARY_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.hpp) # diff --git a/packages/ifpack2/example/CMakeLists.txt b/packages/ifpack2/example/CMakeLists.txt index 803792c8dbea..5573b6591c92 100644 --- a/packages/ifpack2/example/CMakeLists.txt +++ b/packages/ifpack2/example/CMakeLists.txt @@ -1,5 +1,5 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) TRIBITS_ADD_EXECUTABLE( ex1 diff --git a/packages/ifpack2/src/CMakeLists.txt b/packages/ifpack2/src/CMakeLists.txt index d16b67b28e6c..5e39aa9e18a6 100644 --- a/packages/ifpack2/src/CMakeLists.txt +++ b/packages/ifpack2/src/CMakeLists.txt @@ -188,7 +188,7 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) SET(HEADERS "") SET(SOURCES "") -SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.hpp) APPEND_GLOB(SOURCES ${DIR}/*.cpp) TRILINOS_CREATE_CLIENT_TEMPLATE_HEADERS(${DIR}) @@ -196,7 +196,7 @@ TRILINOS_CREATE_CLIENT_TEMPLATE_HEADERS(${DIR}) # SupportGraph requires some TPLs and options to be enabled. IF (${PACKAGE_NAME}_ENABLE_Experimental AND ${PACKAGE_NAME}_ENABLE_Lemon AND ${PACKAGE_NAME}_ENABLE_Amesos2 AND ${PACKAGE_NAME}_ENABLE_Cholmod) TRILINOS_CREATE_CLIENT_TEMPLATE_HEADERS(${DIR}/supportgraph) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/supportgraph) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/supportgraph) SET(HEADERS ${HEADERS} supportgraph/Ifpack2_SupportGraph_decl.hpp supportgraph/Ifpack2_SupportGraph_def.hpp @@ -207,7 +207,7 @@ IF (${PACKAGE_NAME}_ENABLE_Experimental AND ${PACKAGE_NAME}_ENABLE_Lemon AND ${P ENDIF() # Must glob the binary dir last to get all of the auto-generated headers -SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_BINARY_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.hpp) APPEND_SET(HEADERS ${DIR}/${PACKAGE_NAME}_config.h ) APPEND_SET(HEADERS ${DIR}/${PACKAGE_NAME}_ETIHelperMacros.h ) diff --git a/packages/ifpack2/test/belos/AdditiveSchwarzRILUK/CMakeLists.txt b/packages/ifpack2/test/belos/AdditiveSchwarzRILUK/CMakeLists.txt index 0fc6e497d3e8..29e2017d892c 100644 --- a/packages/ifpack2/test/belos/AdditiveSchwarzRILUK/CMakeLists.txt +++ b/packages/ifpack2/test/belos/AdditiveSchwarzRILUK/CMakeLists.txt @@ -1,6 +1,6 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) TRIBITS_ADD_EXECUTABLE_AND_TEST( AdditiveSchwarz_RILUK diff --git a/packages/ifpack2/test/belos/CMakeLists.txt b/packages/ifpack2/test/belos/CMakeLists.txt index 7117233c6a38..04a482a25812 100644 --- a/packages/ifpack2/test/belos/CMakeLists.txt +++ b/packages/ifpack2/test/belos/CMakeLists.txt @@ -1,6 +1,6 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) ADD_SUBDIRECTORY(AdditiveSchwarzRILUK) diff --git a/packages/ifpack2/test/vanka/CMakeLists.txt b/packages/ifpack2/test/vanka/CMakeLists.txt index ec5a59f299de..542cd4ae6a84 100644 --- a/packages/ifpack2/test/vanka/CMakeLists.txt +++ b/packages/ifpack2/test/vanka/CMakeLists.txt @@ -1,6 +1,6 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../src) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../src) TRIBITS_ADD_EXECUTABLE_AND_TEST( TomVankaTest diff --git a/packages/intrepid/src/CMakeLists.txt b/packages/intrepid/src/CMakeLists.txt index 296bf127a750..c1958b25c4f4 100644 --- a/packages/intrepid/src/CMakeLists.txt +++ b/packages/intrepid/src/CMakeLists.txt @@ -17,13 +17,13 @@ TRIBITS_CONFIGURE_FILE(Intrepid_config.h) SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) APPEND_SET(HEADERS ${CMAKE_CURRENT_BINARY_DIR}/Intrepid_config.h ) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # # All headers @@ -37,7 +37,7 @@ APPEND_SET(HEADERS # Shared headers # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Shared) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Shared) APPEND_SET(HEADERS Shared/Intrepid_ArrayToolsDefCloneScale.hpp Shared/Intrepid_ArrayToolsDefContractions.hpp @@ -67,10 +67,10 @@ APPEND_SET(HEADERS # Discretization headers # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Discretization/Integration) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Discretization/FunctionSpaceTools) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Discretization/Basis) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Discretization/TensorProductSpaceTools) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Discretization/Integration) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Discretization/FunctionSpaceTools) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Discretization/Basis) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Discretization/TensorProductSpaceTools) APPEND_SET(HEADERS Discretization/Integration/Intrepid_AdaptiveSparseGridInterfaceDef.hpp @@ -220,7 +220,7 @@ APPEND_SET(HEADERS # Cell headers # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Cell) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Cell) APPEND_SET(HEADERS Cell/Intrepid_CellTools.hpp Cell/Intrepid_CellToolsDef.hpp diff --git a/packages/intrepid2/perf-test/CMakeLists.txt b/packages/intrepid2/perf-test/CMakeLists.txt index 4c90c57ef130..1fc39aecf0d9 100644 --- a/packages/intrepid2/perf-test/CMakeLists.txt +++ b/packages/intrepid2/perf-test/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) ADD_SUBDIRECTORY(ComputeBasis) ADD_SUBDIRECTORY(DynRankView) diff --git a/packages/intrepid2/perf-test/ComputeBasis/CMakeLists.txt b/packages/intrepid2/perf-test/ComputeBasis/CMakeLists.txt index 5ddadcc0cd50..9658e1232597 100644 --- a/packages/intrepid2/perf-test/ComputeBasis/CMakeLists.txt +++ b/packages/intrepid2/perf-test/ComputeBasis/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) IF(Kokkos_ENABLE_SERIAL) ADD_SUBDIRECTORY(Serial) diff --git a/packages/intrepid2/perf-test/ComputeBasis/Cuda/CMakeLists.txt b/packages/intrepid2/perf-test/ComputeBasis/Cuda/CMakeLists.txt index 3efdb02678fa..cc34271a198c 100644 --- a/packages/intrepid2/perf-test/ComputeBasis/Cuda/CMakeLists.txt +++ b/packages/intrepid2/perf-test/ComputeBasis/Cuda/CMakeLists.txt @@ -1,5 +1,5 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(SOURCES "") diff --git a/packages/intrepid2/perf-test/ComputeBasis/OpenMP/CMakeLists.txt b/packages/intrepid2/perf-test/ComputeBasis/OpenMP/CMakeLists.txt index 3efdb02678fa..cc34271a198c 100644 --- a/packages/intrepid2/perf-test/ComputeBasis/OpenMP/CMakeLists.txt +++ b/packages/intrepid2/perf-test/ComputeBasis/OpenMP/CMakeLists.txt @@ -1,5 +1,5 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(SOURCES "") diff --git a/packages/intrepid2/perf-test/ComputeBasis/Serial/CMakeLists.txt b/packages/intrepid2/perf-test/ComputeBasis/Serial/CMakeLists.txt index 3efdb02678fa..cc34271a198c 100644 --- a/packages/intrepid2/perf-test/ComputeBasis/Serial/CMakeLists.txt +++ b/packages/intrepid2/perf-test/ComputeBasis/Serial/CMakeLists.txt @@ -1,5 +1,5 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(SOURCES "") diff --git a/packages/intrepid2/perf-test/DynRankView/CMakeLists.txt b/packages/intrepid2/perf-test/DynRankView/CMakeLists.txt index 3c2750bb9190..69b55c972bed 100644 --- a/packages/intrepid2/perf-test/DynRankView/CMakeLists.txt +++ b/packages/intrepid2/perf-test/DynRankView/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) IF(Kokkos_ENABLE_SERIAL) ADD_SUBDIRECTORY(Serial) diff --git a/packages/intrepid2/perf-test/DynRankView/Cuda/CMakeLists.txt b/packages/intrepid2/perf-test/DynRankView/Cuda/CMakeLists.txt index 458cb62315bb..048e49724335 100644 --- a/packages/intrepid2/perf-test/DynRankView/Cuda/CMakeLists.txt +++ b/packages/intrepid2/perf-test/DynRankView/Cuda/CMakeLists.txt @@ -1,5 +1,5 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(SOURCES "") diff --git a/packages/intrepid2/perf-test/DynRankView/OpenMP/CMakeLists.txt b/packages/intrepid2/perf-test/DynRankView/OpenMP/CMakeLists.txt index 458cb62315bb..048e49724335 100644 --- a/packages/intrepid2/perf-test/DynRankView/OpenMP/CMakeLists.txt +++ b/packages/intrepid2/perf-test/DynRankView/OpenMP/CMakeLists.txt @@ -1,5 +1,5 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(SOURCES "") diff --git a/packages/intrepid2/perf-test/DynRankView/Serial/CMakeLists.txt b/packages/intrepid2/perf-test/DynRankView/Serial/CMakeLists.txt index afcb274528dc..addaa1d469f1 100644 --- a/packages/intrepid2/perf-test/DynRankView/Serial/CMakeLists.txt +++ b/packages/intrepid2/perf-test/DynRankView/Serial/CMakeLists.txt @@ -1,5 +1,5 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(SOURCES "") diff --git a/packages/intrepid2/src/CMakeLists.txt b/packages/intrepid2/src/CMakeLists.txt index 960310c600c2..cca7b476b23f 100644 --- a/packages/intrepid2/src/CMakeLists.txt +++ b/packages/intrepid2/src/CMakeLists.txt @@ -49,11 +49,11 @@ LIST(REMOVE_DUPLICATES INCDIRS) FOREACH(INCDIR ${INCDIRS}) ## MESSAGE( STATUS "INCDIR : " ${INCDIR} ) - INCLUDE_DIRECTORIES(${INCDIR}) + TRIBITS_INCLUDE_DIRECTORIES(${INCDIR}) ENDFOREACH() -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # # D) Define the targets for package's library(s) diff --git a/packages/intrepid2/unit-test/Cell/CMakeLists.txt b/packages/intrepid2/unit-test/Cell/CMakeLists.txt index 06dac30b0010..3be30cf0436c 100644 --- a/packages/intrepid2/unit-test/Cell/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Cell/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/DeRHAM_HEX_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/DeRHAM_HEX_FEM/CMakeLists.txt index 5529d05453c5..b7f2c86eabc9 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/DeRHAM_HEX_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/DeRHAM_HEX_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/DeRHAM_QUAD_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/DeRHAM_QUAD_FEM/CMakeLists.txt index 0d28c5e10775..fdc7df24790b 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/DeRHAM_QUAD_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/DeRHAM_QUAD_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/DeRHAM_TET_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/DeRHAM_TET_FEM/CMakeLists.txt index f2e011f36049..67a01d904ea5 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/DeRHAM_TET_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/DeRHAM_TET_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/DeRHAM_TRI_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/DeRHAM_TRI_FEM/CMakeLists.txt index 17c83d7bb6fa..dc47f75c718f 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/DeRHAM_TRI_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/DeRHAM_TRI_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_HEX_I1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_HEX_I1_FEM/CMakeLists.txt index 945499ecaca3..9c85536c8f04 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_HEX_I1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_HEX_I1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_HEX_In_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_HEX_In_FEM/CMakeLists.txt index 46f1e06404ee..5e06a09eb454 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_HEX_In_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_HEX_In_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_QUAD_I1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_QUAD_I1_FEM/CMakeLists.txt index 8d312baa49a8..cb69d71df184 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_QUAD_I1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_QUAD_I1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_QUAD_In_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_QUAD_In_FEM/CMakeLists.txt index 75da846685f7..8755589ff621 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_QUAD_In_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_QUAD_In_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_TET_I1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_TET_I1_FEM/CMakeLists.txt index c55825a86240..f5d634954c8f 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_TET_I1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_TET_I1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_TET_In_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_TET_In_FEM/CMakeLists.txt index bc26f191637d..133b3a77868a 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_TET_In_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_TET_In_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_TRI_I1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_TRI_I1_FEM/CMakeLists.txt index 4444a2e23d59..76766346b5cf 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_TRI_I1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_TRI_I1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_TRI_In_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_TRI_In_FEM/CMakeLists.txt index c4eb3e10e148..5ce72d53a974 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_TRI_In_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_TRI_In_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_WEDGE_I1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_WEDGE_I1_FEM/CMakeLists.txt index f420d7c985f3..485e7dfdfadd 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_WEDGE_I1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_WEDGE_I1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_HEX_I1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_HEX_I1_FEM/CMakeLists.txt index 921df7b61e41..c8d281bcb49d 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_HEX_I1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_HEX_I1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_HEX_In_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_HEX_In_FEM/CMakeLists.txt index 5152c351ccc1..05d15e60e70f 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_HEX_In_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_HEX_In_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_QUAD_I1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_QUAD_I1_FEM/CMakeLists.txt index 36691f2b1336..bcda1ff0b32d 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_QUAD_I1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_QUAD_I1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_QUAD_In_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_QUAD_In_FEM/CMakeLists.txt index 52de5115eaee..a5b01981d6f6 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_QUAD_In_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_QUAD_In_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_TET_I1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_TET_I1_FEM/CMakeLists.txt index b69d69649f72..4ed14e31a822 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_TET_I1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_TET_I1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_TET_In_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_TET_In_FEM/CMakeLists.txt index 6bd08296ed5f..60a34963742f 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_TET_In_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_TET_In_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_TRI_I1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_TRI_I1_FEM/CMakeLists.txt index 2e91ea9296f6..cfa3c6d7ee13 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_TRI_I1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_TRI_I1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_TRI_In_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_TRI_In_FEM/CMakeLists.txt index fe86d0dd9382..0523c74171ea 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_TRI_In_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_TRI_In_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_WEDGE_I1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_WEDGE_I1_FEM/CMakeLists.txt index 1443291acc47..7d6c9a27cd75 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_WEDGE_I1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_WEDGE_I1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_HEX_C1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_HEX_C1_FEM/CMakeLists.txt index a569545a2326..16379535b189 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_HEX_C1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_HEX_C1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_HEX_C2_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_HEX_C2_FEM/CMakeLists.txt index d73db74fc767..c55ac04519c7 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_HEX_C2_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_HEX_C2_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_HEX_Cn_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_HEX_Cn_FEM/CMakeLists.txt index c0fb7238f19d..d427a02830a1 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_HEX_Cn_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_HEX_Cn_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # test diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_LINE_C1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_LINE_C1_FEM/CMakeLists.txt index 66be084d1d27..8e83e5e79e80 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_LINE_C1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_LINE_C1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_LINE_Cn_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_LINE_Cn_FEM/CMakeLists.txt index 0173946caa56..5c0294c42d18 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_LINE_Cn_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_LINE_Cn_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_LINE_Cn_FEM_JACOBI/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_LINE_Cn_FEM_JACOBI/CMakeLists.txt index adc0a21103ce..92a682bedd9c 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_LINE_Cn_FEM_JACOBI/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_LINE_Cn_FEM_JACOBI/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_PYR_C1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_PYR_C1_FEM/CMakeLists.txt index f5651ca47f51..c8d82611555d 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_PYR_C1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_PYR_C1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_QUAD_C1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_QUAD_C1_FEM/CMakeLists.txt index e6361a704af9..a9044329174d 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_QUAD_C1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_QUAD_C1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_QUAD_C2_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_QUAD_C2_FEM/CMakeLists.txt index a94d9156036a..3df9f211f62d 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_QUAD_C2_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_QUAD_C2_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_QUAD_Cn_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_QUAD_Cn_FEM/CMakeLists.txt index cc98f0025934..83c91c7674f8 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_QUAD_Cn_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_QUAD_Cn_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # test diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_C1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_C1_FEM/CMakeLists.txt index 45b3db19f768..52bc6c051780 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_C1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_C1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_C2_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_C2_FEM/CMakeLists.txt index 4696782c5f86..6c46e650c119 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_C2_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_C2_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_COMP12_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_COMP12_FEM/CMakeLists.txt index 2d8ee06a3274..ff36bd2c0a02 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_COMP12_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_COMP12_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_Cn_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_Cn_FEM/CMakeLists.txt index 2d689462f31a..fc56c9ac745f 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_Cn_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_Cn_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # test diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_Cn_FEM_ORTH/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_Cn_FEM_ORTH/CMakeLists.txt index 7c39ab11b1e2..d6b9202d58f9 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_Cn_FEM_ORTH/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_Cn_FEM_ORTH/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TRI_C1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TRI_C1_FEM/CMakeLists.txt index ff6f0df4d07e..9afb5b60d8b2 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TRI_C1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TRI_C1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TRI_C2_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TRI_C2_FEM/CMakeLists.txt index 4b2d6b4a5190..978408943f4b 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TRI_C2_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TRI_C2_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TRI_Cn_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TRI_Cn_FEM/CMakeLists.txt index 39d5e30bd420..04cb1bcfc9ef 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TRI_Cn_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TRI_Cn_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # test diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TRI_Cn_FEM_ORTH/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TRI_Cn_FEM_ORTH/CMakeLists.txt index 4c5df63a6501..d13a115f40a8 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TRI_Cn_FEM_ORTH/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TRI_Cn_FEM_ORTH/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_WEDGE_C1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_WEDGE_C1_FEM/CMakeLists.txt index 801c8242ed8d..7f8c1848100e 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_WEDGE_C1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_WEDGE_C1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_WEDGE_C2_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_WEDGE_C2_FEM/CMakeLists.txt index 933af0e02be4..9de6c70a099c 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_WEDGE_C2_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_WEDGE_C2_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HVOL_C0_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HVOL_C0_FEM/CMakeLists.txt index 8c5194b7e52e..35e9be038e07 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HVOL_C0_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HVOL_C0_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HVOL_HEX_Cn_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HVOL_HEX_Cn_FEM/CMakeLists.txt index 44f65705e1b0..4b64112810e0 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HVOL_HEX_Cn_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HVOL_HEX_Cn_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HVOL_LINE_Cn_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HVOL_LINE_Cn_FEM/CMakeLists.txt index 5bb953596def..5ff16a3809c5 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HVOL_LINE_Cn_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HVOL_LINE_Cn_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HVOL_QUAD_Cn_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HVOL_QUAD_Cn_FEM/CMakeLists.txt index da53d02dc7cd..9488b23dbbdc 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HVOL_QUAD_Cn_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HVOL_QUAD_Cn_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HVOL_TET_Cn_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HVOL_TET_Cn_FEM/CMakeLists.txt index 43b9c584caca..9cfc6eccf6c1 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HVOL_TET_Cn_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HVOL_TET_Cn_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HVOL_TRI_Cn_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HVOL_TRI_Cn_FEM/CMakeLists.txt index cb6063487996..512d8e2dcdc3 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HVOL_TRI_Cn_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HVOL_TRI_Cn_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/FunctionSpaceTools/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/FunctionSpaceTools/CMakeLists.txt index bc5626bfb86b..09ef41aa547f 100644 --- a/packages/intrepid2/unit-test/Discretization/FunctionSpaceTools/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/FunctionSpaceTools/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Integration/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Integration/CMakeLists.txt index 0936908bf589..e3b4f2fa13a2 100644 --- a/packages/intrepid2/unit-test/Discretization/Integration/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Integration/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/MonolithicExecutable/CMakeLists.txt b/packages/intrepid2/unit-test/MonolithicExecutable/CMakeLists.txt index 1b5019eb4b80..3b05fd70b8e2 100644 --- a/packages/intrepid2/unit-test/MonolithicExecutable/CMakeLists.txt +++ b/packages/intrepid2/unit-test/MonolithicExecutable/CMakeLists.txt @@ -4,7 +4,7 @@ #FILE(GLOB TEST_SOURCES "*.cpp" ${ETI_SOURCES} ) FILE(GLOB TEST_SOURCES "*.cpp") -INCLUDE_DIRECTORIES("../../assembly-examples") +TRIBITS_INCLUDE_DIRECTORIES("../../assembly-examples") TRIBITS_ADD_EXECUTABLE_AND_TEST( Intrepid2_Tests diff --git a/packages/intrepid2/unit-test/Orientation/CMakeLists.txt b/packages/intrepid2/unit-test/Orientation/CMakeLists.txt index e2c895af3c03..4ed6bae13257 100644 --- a/packages/intrepid2/unit-test/Orientation/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Orientation/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Projection/CMakeLists.txt b/packages/intrepid2/unit-test/Projection/CMakeLists.txt index 59edeef82e45..0dd72ae7ec25 100644 --- a/packages/intrepid2/unit-test/Projection/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Projection/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Shared/ArrayTools/CMakeLists.txt b/packages/intrepid2/unit-test/Shared/ArrayTools/CMakeLists.txt index fba6dceeb8be..b7fa5aca6a9d 100644 --- a/packages/intrepid2/unit-test/Shared/ArrayTools/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Shared/ArrayTools/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(Intrepid2_TEST_ETI_FILE "test_01;test_02;test_03;test_04;test_05") diff --git a/packages/intrepid2/unit-test/Shared/PointTools/CMakeLists.txt b/packages/intrepid2/unit-test/Shared/PointTools/CMakeLists.txt index 1e721c9ba703..08f122a52785 100644 --- a/packages/intrepid2/unit-test/Shared/PointTools/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Shared/PointTools/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(Intrepid2_TEST_ETI_FILE "test_01") diff --git a/packages/intrepid2/unit-test/Shared/Polylib/CMakeLists.txt b/packages/intrepid2/unit-test/Shared/Polylib/CMakeLists.txt index d251e33e3b5b..364cf1da008b 100644 --- a/packages/intrepid2/unit-test/Shared/Polylib/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Shared/Polylib/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(Intrepid2_TEST_ETI_FILE "test_01") diff --git a/packages/intrepid2/unit-test/Shared/RealSpaceTools/CMakeLists.txt b/packages/intrepid2/unit-test/Shared/RealSpaceTools/CMakeLists.txt index 7d54c87b93fb..c32dccfbd94b 100644 --- a/packages/intrepid2/unit-test/Shared/RealSpaceTools/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Shared/RealSpaceTools/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(Intrepid2_TEST_ETI_FILE "test_01") diff --git a/packages/intrepid2/unit-test/performance/StructuredIntegration/CMakeLists.txt b/packages/intrepid2/unit-test/performance/StructuredIntegration/CMakeLists.txt index 86db43427c93..9cd20e448e41 100644 --- a/packages/intrepid2/unit-test/performance/StructuredIntegration/CMakeLists.txt +++ b/packages/intrepid2/unit-test/performance/StructuredIntegration/CMakeLists.txt @@ -2,7 +2,7 @@ SET(SOURCES "") FILE(GLOB SOURCES *.cpp) -INCLUDE_DIRECTORIES("../../../assembly-examples") +TRIBITS_INCLUDE_DIRECTORIES("../../../assembly-examples") SET(LIBRARIES intrepid2) diff --git a/packages/isorropia/src/CMakeLists.txt b/packages/isorropia/src/CMakeLists.txt index 041a5f0dc60d..d275c4f717f2 100644 --- a/packages/isorropia/src/CMakeLists.txt +++ b/packages/isorropia/src/CMakeLists.txt @@ -21,13 +21,13 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) SET(HEADERS) SET(SOURCES) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) SET(HEADERS ${HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h ) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(HEADERS ${HEADERS} Isorropia_CostDescriber.hpp @@ -52,8 +52,8 @@ SET(SOURCES ${SOURCES} # src/epetra # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/epetra) -#INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../utils) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/epetra) +#TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../utils) SET(HEADERS ${HEADERS} epetra/Isorropia_EpetraCostDescriber.hpp @@ -85,7 +85,7 @@ SET(SOURCES ${SOURCES} # zoltan -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/epetra/zoltanLib) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/epetra/zoltanLib) SET(HEADERS ${HEADERS} epetra/zoltanLib/QueryObject.hpp diff --git a/packages/kokkos-kernels/perf_test/CMakeLists.txt b/packages/kokkos-kernels/perf_test/CMakeLists.txt index 91dc72786755..98172f4ada7b 100644 --- a/packages/kokkos-kernels/perf_test/CMakeLists.txt +++ b/packages/kokkos-kernels/perf_test/CMakeLists.txt @@ -24,7 +24,7 @@ TARGET_INCLUDE_DIRECTORIES(kokkoskernelsperf_gtest PUBLIC $ Date: Wed, 11 Jan 2023 10:23:59 -0700 Subject: [PATCH 02/14] Automatic snapshot commit from tribits at bf7c58f6 Origin repo remote tracking branch: 'github/master' Origin repo remote repo URL: 'github = git@github.com:TriBITSPub/TriBITS.git' Git describe: vera-release-3.5-start-1697-gd0ae49f2 At commit: commit bf7c58f60f8da7da81972e93bf7e67b3e821c6e2 Author: Roscoe A. Bartlett Date: Tue Jan 10 16:15:09 2023 -0700 Summary: Bring back deprecated _ASSERT_MISSING_PACKAGES (trilinos/Trilinos#11429) --- cmake/tribits/CHANGELOG.md | 17 +++++++++++ .../package_arch/TribitsGlobalMacros.cmake | 20 ++++++++----- .../TribitsReadDepsFilesCreateDepsGraph.cmake | 2 +- .../ExpectedDependencies.txt | 6 ++-- .../tribits/doc/guides/TribitsGuidesBody.rst | 30 ++++++++++++------- 5 files changed, 54 insertions(+), 21 deletions(-) diff --git a/cmake/tribits/CHANGELOG.md b/cmake/tribits/CHANGELOG.md index c0ad93274308..a03ba918a475 100644 --- a/cmake/tribits/CHANGELOG.md +++ b/cmake/tribits/CHANGELOG.md @@ -2,6 +2,23 @@ ChangeLog for TriBITS ---------------------------------------- +## 2023-01-10: + +* **Added:** Added back support for deprecated variable + `_ASSERT_MISSING_PACKAGES` that was removed + [2022-10-11](#2022-10-11). When `_ASSERT_MISSING_PACKAGES` is set + to a non-null value, it overrides the default value for + `_ASSERT_DEFINED_DEPENDENCIES` (but setting + `_ASSERT_DEFINED_DEPENDENCIES` in the cache takes precedence). + +## 2023-01-06: + +* **Changed:** Changed all TPL dependencies back to 'Optional' so that + disabling an external package/TPL will **not** disable any downstream + external packages/TPLs that list a dependency on that external package/TPL. + This undoes the change on [2022-10-20](#2022-10-20) and restores backward + compatibility to the behavior before that change. + ## 2022-12-20: * **Deprecated:** The macro `set_and_inc_dirs()` is deprecated and replaced by diff --git a/cmake/tribits/core/package_arch/TribitsGlobalMacros.cmake b/cmake/tribits/core/package_arch/TribitsGlobalMacros.cmake index 7f452f338b7a..63e0930da23a 100644 --- a/cmake/tribits/core/package_arch/TribitsGlobalMacros.cmake +++ b/cmake/tribits/core/package_arch/TribitsGlobalMacros.cmake @@ -720,6 +720,18 @@ macro(tribits_define_global_options_and_define_extra_repos) "Determines if a variety of development mode checks are turned on by default or not." ) + if (NOT "${${PROJECT_NAME}_ASSERT_MISSING_PACKAGES}" STREQUAL "") + tribits_deprecated("Warning, ${PROJECT_NAME}_ASSERT_MISSING_PACKAGES=" + "'${${PROJECT_NAME}_ASSERT_MISSING_PACKAGES}' is set and is no" + " longer supported! Please set" + " ${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES instead (see build ref)!" ) + if (${PROJECT_NAME}_ASSERT_MISSING_PACKAGES) + set(${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_DEFAULT FATAL_ERROR) + else() + set(${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_DEFAULT IGNORE) + endif() + endif() + if ("${${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_DEFAULT}" STREQUAL "") if (${PROJECT_NAME}_ENABLE_DEVELOPMENT_MODE) set(${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_DEFAULT FATAL_ERROR) @@ -727,6 +739,7 @@ macro(tribits_define_global_options_and_define_extra_repos) set(${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_DEFAULT IGNORE) endif() endif() + set(${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_ERROR_VALUES_LIST "FATAL_ERROR" "SEND_ERROR" ) set(${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_VALUES_LIST @@ -740,13 +753,6 @@ macro(tribits_define_global_options_and_define_extra_repos) ${${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_VALUES_LIST} IS_ADVANCED ) - if (NOT "${${PROJECT_NAME}_ASSERT_MISSING_PACKAGES}" STREQUAL "") - message(FATAL_ERROR "Error, ${PROJECT_NAME}_ASSERT_MISSING_PACKAGES=" - " '${${PROJECT_NAME}_ASSERT_MISSING_PACKAGES}' is set and is no" - " longer supported! Please set" - " ${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES=FATAL_ERROR instead!" ) - endif() - if ("${${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE_DEFAULT}" STREQUAL "") if (${PROJECT_NAME}_ENABLE_DEVELOPMENT_MODE) set(${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE_DEFAULT FATAL_ERROR) diff --git a/cmake/tribits/core/package_arch/TribitsReadDepsFilesCreateDepsGraph.cmake b/cmake/tribits/core/package_arch/TribitsReadDepsFilesCreateDepsGraph.cmake index 9ec045e0099b..bd5f09e61d37 100644 --- a/cmake/tribits/core/package_arch/TribitsReadDepsFilesCreateDepsGraph.cmake +++ b/cmake/tribits/core/package_arch/TribitsReadDepsFilesCreateDepsGraph.cmake @@ -223,7 +223,7 @@ macro(tribits_read_external_package_deps_files_add_to_graph tplName) tribits_trace_file_processing(TPL INCLUDE "${absTplDepsFile}") include(${absTplDepsFile}) foreach(depPkg IN LISTS ${tplName}_LIB_DEFINED_DEPENDENCIES) - global_set(${tplName}_LIB_DEP_REQUIRED_${depPkg} TRUE) + global_set(${tplName}_LIB_DEP_REQUIRED_${depPkg} FALSE) endforeach() tribits_append_forward_dep_packages(${tplName} LIB) endif() diff --git a/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/ExpectedDependencies.txt b/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/ExpectedDependencies.txt index 51dbaaa44879..dccdd4e45ef7 100644 --- a/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/ExpectedDependencies.txt +++ b/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/ExpectedDependencies.txt @@ -17,9 +17,9 @@ Package dependencies information: -- MPI_FORWARD_LIB_DEFINED_DEPENDENCIES: Teuchos[O] Epetra[O] --- BLAS_FORWARD_LIB_DEFINED_DEPENDENCIES: LAPACK[R] Teuchos[R] Epetra[R] +-- BLAS_FORWARD_LIB_DEFINED_DEPENDENCIES: LAPACK[O] Teuchos[R] Epetra[R] --- LAPACK_LIB_DEFINED_DEPENDENCIES: BLAS[R] +-- LAPACK_LIB_DEFINED_DEPENDENCIES: BLAS[O] -- LAPACK_FORWARD_LIB_DEFINED_DEPENDENCIES: Teuchos[R] Epetra[R] -- Boost_FORWARD_LIB_DEFINED_DEPENDENCIES: Teuchos[O] @@ -68,7 +68,7 @@ Dumping direct enabled dependencies for each package ... -- BLAS: No enabled dependencies! --- LAPACK_LIB_ENABLED_DEPENDENCIES: BLAS[R] +-- LAPACK_LIB_ENABLED_DEPENDENCIES: BLAS[O] -- Boost: No enabled dependencies! diff --git a/cmake/tribits/doc/guides/TribitsGuidesBody.rst b/cmake/tribits/doc/guides/TribitsGuidesBody.rst index 876566808da4..3b790406c7bc 100644 --- a/cmake/tribits/doc/guides/TribitsGuidesBody.rst +++ b/cmake/tribits/doc/guides/TribitsGuidesBody.rst @@ -2269,6 +2269,11 @@ This defines all of the TPLs that ```` could directly depends on but only dependencies for enabled upstream TPLs will be added to the IMPORTED targets. +NOTE: TPL-to-TPL dependencies are optional. Therefore, in the above example, +enabling the TPL ```` will not auto-enable a dependent upstream TPL +````. Likewise, disabling an upstream TPL ```` +will not auto-disable a dependent downstream TPL ````. + TriBITS External Package/TPL Core Variables ........................................... @@ -3676,19 +3681,24 @@ In more detail, these rules/behaviors are: .. __ENABLE_ALL_FORWARD_DEP_PACKAGES enables downstream packages/tests: -17) **_ENABLE_ALL_FORWARD_DEP_PACKAGES enables downstream packages/tests**: - Setting the user cache-variable +17) **_ENABLE_ALL_FORWARD_DEP_PACKAGES enables downstream + packages/tests**: Setting the user cache-variable ``${PROJECT_NAME}_ENABLE_ALL_FORWARD_PACKAGES=ON`` will result in the - `downstream`_ ``PT`` packages and tests to be enabled (and all ``PT`` - and ``ST`` packages and tests when + `downstream`_ ``PT`` internal packages and tests to be enabled (and all + ``PT`` and ``ST`` packages and tests when ``${PROJECT_NAME}_SECONDARY_TESTED_CODE=ON``) for all explicitly enabled - packages. For example, configuring with ``Trilinos_ENABLE_Epetra=ON``, - ``Trilinos_ENABLE_TESTS=ON``, and + internal packages. For example, in the mock Trilinos project, configuring + with ``Trilinos_ENABLE_Epetra=ON``, ``Trilinos_ENABLE_TESTS=ON``, and ``Trilinos_ENABLE_ALL_FORWARD_PACKAGES=ON`` will result the package - enables (and test and example enables) for the packages ``Triutils``, - ``EpetraExt``, ``ThyraCoreLibs``, ``ThyraEpetra`` and ``Thyra``. For an - example, see `Explicit enable of a package and downstream packages and - tests`_. + enables (and test and example enables) for the downstream packages + ``Triutils``, ``EpetraExt``, ``ThyraCoreLibs``, ``ThyraEpetra`` and + ``Thyra``. For an example, see `Explicit enable of a package and + downstream packages and tests`_. Note that when setting this option, the + enable of an external package/TPL will **not** result in the auto-enable + of downstream internal packages. For example, setting + ``Trilinos_ENABLE_BLAS=ON`` will not result in the auto-enable of any + internal packages that depend on ``BLAS`` like ``Teuchos`` (in the mock + Trilinos project). .. _${PROJECT_NAME}_ENABLE_ALL_PACKAGES: From 1d66f42d490267d0839e9ab018e77110d33f6c70 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Wed, 11 Jan 2023 11:00:27 -0700 Subject: [PATCH 03/14] ATDM: Replace Trilinos_ASSERT_MISSING_PACKAGES with Trilinos_ASSERT_DEFINED_DEPENDENCIES (#11429) I set the value of Trilinos_ASSERT_DEFINED_DEPENDENCIES=SEND_ERROR so that if any Trilinos package (including from add-on repos like Drekar) lists undefined TPLs, then they will see all of the errors instead of just aborting on the first error. (That makes the process to fix all of the errors go faster.) --- cmake/std/atdm/ATDMDevEnvSettings.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/std/atdm/ATDMDevEnvSettings.cmake b/cmake/std/atdm/ATDMDevEnvSettings.cmake index c5a6c1ca980b..b71215fd8f18 100644 --- a/cmake/std/atdm/ATDMDevEnvSettings.cmake +++ b/cmake/std/atdm/ATDMDevEnvSettings.cmake @@ -290,7 +290,7 @@ ATDM_SET_CACHE(Trilinos_ENABLE_EXPLICIT_INSTANTIATION ON CACHE BOOL) #ATDM_SET_CACHE(HDF5_NO_SYSTEM_PATHS ${ATDM_HDF5_NO_SYSTEM_PATHS} CACHE BOOL) ATDM_SET_CACHE(Trilinos_ENABLE_INSTALL_CMAKE_CONFIG_FILES ON CACHE BOOL) ATDM_SET_CACHE(Trilinos_ENABLE_DEVELOPMENT_MODE OFF CACHE BOOL) -ATDM_SET_CACHE(Trilinos_ASSERT_MISSING_PACKAGES ON CACHE BOOL) +ATDM_SET_CACHE(Trilinos_ASSERT_DEFINED_DEPENDENCIES SEND_ERROR CACHE BOOL) ATDM_SET_CACHE(Trilinos_LINK_SEARCH_START_STATIC "${ATDM_Trilinos_LINK_SEARCH_START_STATIC}" CACHE BOOL) ATDM_SET_CACHE(Trilinos_ENABLE_OpenMP "${ATDM_USE_OPENMP}" CACHE BOOL) ATDM_SET_CACHE(Trilinos_ENABLE_COMPLEX "${ATDM_COMPLEX}" CACHE BOOL) From 7fcd6ac3039dd5dd5bee28362bdecd8806a44477 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Tue, 17 Jan 2023 14:02:41 -0700 Subject: [PATCH 04/14] SEACAS: Add pragma once instead of include guards --- .../applications/conjoin/CJ_CodeTypes.h | 7 +- .../applications/conjoin/CJ_ExodusEntity.h | 4 +- .../applications/conjoin/CJ_ExodusFile.h | 6 +- .../applications/conjoin/CJ_Internals.h | 6 +- .../applications/conjoin/CJ_ObjectType.h | 7 +- .../applications/conjoin/CJ_SystemInterface.h | 4 +- .../applications/conjoin/CJ_Variables.h | 8 +- .../seacas/applications/conjoin/CJ_Version.h | 7 +- .../applications/cpup/CP_SystemInterface.h | 4 +- .../seacas/applications/cpup/CP_Version.h | 5 +- .../seacas/applications/ejoin/EJ_CodeTypes.h | 6 +- .../applications/ejoin/EJ_SystemInterface.h | 6 +- .../seacas/applications/ejoin/EJ_Version.h | 5 +- .../seacas/applications/ejoin/EJ_index_sort.h | 6 +- .../seacas/applications/ejoin/EJ_mapping.h | 6 +- .../seacas/applications/ejoin/EJ_match_xyz.h | 7 +- .../seacas/applications/ejoin/EJ_vector3d.h | 8 +- .../seacas/applications/epu/EP_ExodusEntity.h | 6 +- .../seacas/applications/epu/EP_ExodusFile.h | 6 +- .../seacas/applications/epu/EP_Internals.h | 6 +- .../seacas/applications/epu/EP_ObjectType.h | 7 +- .../applications/epu/EP_ParallelDisks.h | 7 +- .../applications/epu/EP_SystemInterface.h | 4 +- .../seacas/applications/epu/EP_Variables.h | 8 +- packages/seacas/applications/epu/EP_Version.h | 11 +-- .../applications/exodiff/ED_SystemInterface.h | 4 +- .../seacas/applications/exodiff/ED_Version.h | 11 +-- .../seacas/applications/exodiff/MinMaxData.h | 6 +- packages/seacas/applications/exodiff/Norm.h | 7 +- .../seacas/applications/exodiff/Tolerance.h | 7 +- .../seacas/applications/exodiff/edge_block.h | 6 +- .../seacas/applications/exodiff/exoII_read.h | 6 +- .../seacas/applications/exodiff/exo_block.h | 6 +- .../seacas/applications/exodiff/exo_entity.h | 5 +- .../seacas/applications/exodiff/exodiff.h | 8 +- .../seacas/applications/exodiff/face_block.h | 6 +- packages/seacas/applications/exodiff/map.h | 7 +- .../seacas/applications/exodiff/node_set.h | 8 +- .../seacas/applications/exodiff/side_set.h | 8 +- .../seacas/applications/exodiff/stringx.h | 8 +- packages/seacas/applications/exodiff/util.h | 8 +- .../applications/exomatlab/EML_CodeTypes.h | 8 +- .../exomatlab/EML_SystemInterface.h | 7 +- .../applications/exomatlab/EML_Version.h | 8 +- .../applications/nas2exo/N2EDataTypes.h | 5 +- .../applications/nas2exo/N2EExoWriter.h | 6 +- .../applications/nas2exo/N2ENasReader.h | 5 +- packages/seacas/applications/nem_slice/elb.h | 6 +- .../seacas/applications/nem_slice/elb_allo.h | 8 +- .../seacas/applications/nem_slice/elb_elem.h | 8 +- .../seacas/applications/nem_slice/elb_err.h | 8 +- .../seacas/applications/nem_slice/elb_exo.h | 8 +- .../seacas/applications/nem_slice/elb_graph.h | 8 +- .../applications/nem_slice/elb_groups.h | 8 +- .../seacas/applications/nem_slice/elb_inp.h | 8 +- .../applications/nem_slice/elb_loadbal.h | 6 +- .../applications/nem_slice/elb_output.h | 8 +- .../seacas/applications/nem_slice/elb_util.h | 8 +- .../nem_slice/fix_column_partitions.h | 8 +- .../seacas/applications/nem_slice/getsubopt.h | 10 +++ .../applications/nem_spread/el_check_monot.h | 9 +-- .../seacas/applications/nem_spread/el_elm.h | 10 +-- .../seacas/applications/nem_spread/globals.h | 7 +- .../applications/nem_spread/nem_spread.h | 7 +- .../applications/nem_spread/pe_common.h | 8 +- .../nem_spread/pe_str_util_const.h | 8 +- .../seacas/applications/nem_spread/ps_pario.h | 7 +- .../applications/nem_spread/ps_pario_const.h | 4 +- .../seacas/applications/nem_spread/rf_allo.h | 7 +- .../seacas/applications/nem_spread/rf_io.h | 7 +- .../applications/nem_spread/rf_io_const.h | 7 +- .../seacas/applications/nem_spread/rf_util.h | 7 +- .../applications/nem_spread/sort_utils.h | 6 +- .../applications/slice/SL_SystemInterface.h | 4 +- .../seacas/applications/slice/SL_Version.h | 5 +- packages/seacas/applications/zellij/Cell.h | 6 +- .../seacas/applications/zellij/Decompose.h | 6 +- packages/seacas/applications/zellij/Grid.h | 4 +- .../seacas/applications/zellij/UnitCell.h | 6 +- .../applications/zellij/ZE_SystemInterface.h | 4 +- .../seacas/applications/zellij/ZE_Version.h | 11 +-- .../seacas/libraries/aprepro_lib/apr_array.h | 6 +- .../libraries/aprepro_lib/apr_builtin.h | 5 +- .../libraries/aprepro_lib/apr_getline_int.h | 8 +- .../seacas/libraries/aprepro_lib/apr_symrec.h | 7 +- .../libraries/aprepro_lib/apr_tokenize.h | 6 +- .../seacas/libraries/aprepro_lib/apr_util.h | 6 +- .../seacas/libraries/aprepro_lib/aprepro.h | 6 +- .../libraries/aprepro_lib/init_structs.h | 7 +- .../libraries/chaco/internal/internal.h | 9 +-- packages/seacas/libraries/chaco/main/chaco.h | 19 ++--- packages/seacas/libraries/chaco/main/defs.h | 17 ++--- packages/seacas/libraries/chaco/main/params.h | 9 +-- .../seacas/libraries/chaco/main/structs.h | 27 +++---- .../libraries/chaco/refine_map/refine_map.h | 9 +-- .../libraries/chaco/util/chaco_random.h | 7 +- .../seacas/libraries/chaco/util/smalloc.h | 9 +-- .../libraries/exodus/cmake/exodus_config.h.in | 4 +- .../libraries/exodus/include/exodusII.h | 6 +- .../exodus/include/exodusII_cfg.h.in | 8 +- .../libraries/exodus/include/exodusII_int.h | 6 +- .../libraries/exodus/include/exodusII_par.h | 8 +- .../libraries/exodus/include/exodusII_test.h | 7 +- .../seacas/libraries/nemesis/ne_nemesisI.h | 76 +++++++++---------- .../seacas/libraries/nemesis/nemesis_cfg.h.in | 8 +- .../libraries/supes/ext_lib/getline_int.h | 8 +- packages/seacas/libraries/suplib_c/XGetopt.h | 6 +- .../seacas/libraries/suplib_c/add_to_log.h | 7 +- packages/seacas/libraries/suplib_c/adler.h | 6 +- .../libraries/suplib_c/open_file_limit.h | 7 +- .../seacas/libraries/suplib_cpp/FileInfo.h | 7 +- .../seacas/libraries/suplib_cpp/GetLongOpt.h | 5 +- .../seacas/libraries/suplib_cpp/SL_tokenize.h | 7 +- .../libraries/suplib_cpp/copy_string_cpp.h | 6 +- .../seacas/libraries/suplib_cpp/copyright.h | 6 +- packages/seacas/libraries/suplib_cpp/glob.h | 6 +- packages/seacas/libraries/suplib_cpp/hwm.h | 7 +- packages/seacas/libraries/suplib_cpp/iqsort.h | 6 +- .../seacas/libraries/suplib_cpp/pdqsort.h | 8 +- .../seacas/libraries/suplib_cpp/scopeguard.h | 7 +- .../seacas/libraries/suplib_cpp/sys_info.h | 8 +- .../seacas/libraries/suplib_cpp/time_stamp.h | 8 +- .../seacas/libraries/suplib_cpp/to_string.h | 12 --- packages/seacas/libraries/svdi/cgi/cdrcom.h | 7 +- packages/seacas/libraries/svdi/cgi/cgi.h | 5 +- packages/seacas/libraries/svdi/cgi/cgidef.h | 52 ++++++------- packages/seacas/libraries/svdi/cgi/data_def.h | 7 +- packages/seacas/libraries/svdi/cgi/devid.h | 7 +- packages/seacas/libraries/svdi/cgi/fortyp.h | 8 +- packages/seacas/libraries/svdi/cgi/ifdefx.h | 20 ++--- packages/seacas/libraries/svdi/cgi/mdcgi.h | 5 +- packages/seacas/libraries/svdi/cgi/sdcgi.h | 7 +- packages/seacas/libraries/svdi/cgi/stdtyp.h | 7 +- packages/seacas/libraries/svdi/cgi/svdi.h | 7 +- packages/seacas/libraries/svdi/cgi/vdicgi.h | 8 +- 135 files changed, 340 insertions(+), 756 deletions(-) create mode 100644 packages/seacas/applications/nem_slice/getsubopt.h delete mode 100644 packages/seacas/libraries/suplib_cpp/to_string.h diff --git a/packages/seacas/applications/conjoin/CJ_CodeTypes.h b/packages/seacas/applications/conjoin/CJ_CodeTypes.h index 45602f641de1..06141e44c6db 100644 --- a/packages/seacas/applications/conjoin/CJ_CodeTypes.h +++ b/packages/seacas/applications/conjoin/CJ_CodeTypes.h @@ -1,15 +1,12 @@ -// Copyright(C) 1999-2020 National Technology & Engineering Solutions +// Copyright(C) 1999-2020, 2022 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. // // See packages/seacas/LICENSE for details -#ifndef SEACAS_CodeTypes_H -#define SEACAS_CodeTypes_H +#pragma once #include #include using StringIdVector = std::vector>; using StringVector = std::vector; - -#endif diff --git a/packages/seacas/applications/conjoin/CJ_ExodusEntity.h b/packages/seacas/applications/conjoin/CJ_ExodusEntity.h index deafc054b133..40b03e37aeaf 100644 --- a/packages/seacas/applications/conjoin/CJ_ExodusEntity.h +++ b/packages/seacas/applications/conjoin/CJ_ExodusEntity.h @@ -3,8 +3,7 @@ // NTESS, the U.S. Government retains certain rights in this software. // // See packages/seacas/LICENSE for details -#ifndef SEACAS_ExodusEntity_H -#define SEACAS_ExodusEntity_H +#pragma once #define NO_NETCDF_2 #include "CJ_ObjectType.h" @@ -193,4 +192,3 @@ namespace Excn { size_t elementsBorder{0}; }; } // namespace Excn -#endif /* SEACAS_ExodusEntity_H */ diff --git a/packages/seacas/applications/conjoin/CJ_ExodusFile.h b/packages/seacas/applications/conjoin/CJ_ExodusFile.h index c09f16449a8f..5e15b3d830df 100644 --- a/packages/seacas/applications/conjoin/CJ_ExodusFile.h +++ b/packages/seacas/applications/conjoin/CJ_ExodusFile.h @@ -1,10 +1,9 @@ -// Copyright(C) 1999-2020 National Technology & Engineering Solutions +// Copyright(C) 1999-2020, 2022 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. // // See packages/seacas/LICENSE for details -#ifndef SEACAS_ExodusFile_H -#define SEACAS_ExodusFile_H +#pragma once #include "CJ_CodeTypes.h" #include @@ -43,4 +42,3 @@ namespace Excn { static int exodusMode_; }; } // namespace Excn -#endif /* SEACAS_ExodusFil_H */ diff --git a/packages/seacas/applications/conjoin/CJ_Internals.h b/packages/seacas/applications/conjoin/CJ_Internals.h index d28b95c065ea..83fbd697aad2 100644 --- a/packages/seacas/applications/conjoin/CJ_Internals.h +++ b/packages/seacas/applications/conjoin/CJ_Internals.h @@ -1,10 +1,9 @@ -// Copyright(C) 1999-2020 National Technology & Engineering Solutions +// Copyright(C) 1999-2020, 2022 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. // // See packages/seacas/LICENSE for details -#ifndef SEACAS_Internals_h -#define SEACAS_Internals_h +#pragma once #include // for vector namespace Excn { @@ -88,4 +87,3 @@ namespace Excn { int maximumNameLength; }; } // namespace Excn -#endif /* SEACAS_Internals_h */ diff --git a/packages/seacas/applications/conjoin/CJ_ObjectType.h b/packages/seacas/applications/conjoin/CJ_ObjectType.h index 4da069f67560..8a33931d2d7e 100644 --- a/packages/seacas/applications/conjoin/CJ_ObjectType.h +++ b/packages/seacas/applications/conjoin/CJ_ObjectType.h @@ -1,14 +1,11 @@ -// Copyright(C) 1999-2020 National Technology & Engineering Solutions +// Copyright(C) 1999-2020, 2022 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. // // See packages/seacas/LICENSE for details -#ifndef ObjectType_H -#define ObjectType_H +#pragma once namespace Excn { // Note that these are used as indices into truth table for ELBK, NSET, SSET... enum class ObjectType { EBLK = 0, NSET = 1, SSET = 2, NODE, ELEM, GLOBAL, TIME, DIM }; } // namespace Excn - -#endif diff --git a/packages/seacas/applications/conjoin/CJ_SystemInterface.h b/packages/seacas/applications/conjoin/CJ_SystemInterface.h index 230fd0170d52..ea7582fcc415 100644 --- a/packages/seacas/applications/conjoin/CJ_SystemInterface.h +++ b/packages/seacas/applications/conjoin/CJ_SystemInterface.h @@ -3,8 +3,7 @@ // NTESS, the U.S. Government retains certain rights in this software. // // See packages/seacas/LICENSE for details -#ifndef Sierra_SystemInterface_h -#define Sierra_SystemInterface_h +#pragma once #include "CJ_CodeTypes.h" #include "GetLongOpt.h" // for GetLongOption @@ -88,4 +87,3 @@ namespace Excn { StringIdVector ssetVarNames_{}; }; } // namespace Excn -#endif diff --git a/packages/seacas/applications/conjoin/CJ_Variables.h b/packages/seacas/applications/conjoin/CJ_Variables.h index 645fe623af55..02d20d0a90aa 100644 --- a/packages/seacas/applications/conjoin/CJ_Variables.h +++ b/packages/seacas/applications/conjoin/CJ_Variables.h @@ -1,10 +1,10 @@ -// Copyright(C) 1999-2020 National Technology & Engineering Solutions +// Copyright(C) 1999-2020, 2022 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. // // See packages/seacas/LICENSE for details -#ifndef SEACAS_Variables_H -#define SEACAS_Variables_H +#pragma once + #include #include #include @@ -69,5 +69,3 @@ namespace Excn { std::string type_{}; }; } // namespace Excn - -#endif diff --git a/packages/seacas/applications/conjoin/CJ_Version.h b/packages/seacas/applications/conjoin/CJ_Version.h index 77874d2f7541..a525f9aa7c69 100644 --- a/packages/seacas/applications/conjoin/CJ_Version.h +++ b/packages/seacas/applications/conjoin/CJ_Version.h @@ -1,15 +1,12 @@ -// Copyright(C) 1999-2021 National Technology & Engineering Solutions +// Copyright(C) 1999-2022 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. // // See packages/seacas/LICENSE for details -#ifndef SEACAS_Version_h -#define SEACAS_Version_h +#pragma once static char const *qainfo[] = { "conjoin", "1.4.9", "2021/03/05", }; - -#endif // SEACAS_Version_h diff --git a/packages/seacas/applications/cpup/CP_SystemInterface.h b/packages/seacas/applications/cpup/CP_SystemInterface.h index cdc80a2263c1..c0e2f6eafeac 100644 --- a/packages/seacas/applications/cpup/CP_SystemInterface.h +++ b/packages/seacas/applications/cpup/CP_SystemInterface.h @@ -5,8 +5,7 @@ * * See packages/seacas/LICENSE for details */ -#ifndef Sierra_SystemInterface_h -#define Sierra_SystemInterface_h +#pragma once #include "GetLongOpt.h" // for GetLongOption #include // for INT_MAX @@ -162,4 +161,3 @@ namespace Cpup { } #endif } // namespace Cpup -#endif diff --git a/packages/seacas/applications/cpup/CP_Version.h b/packages/seacas/applications/cpup/CP_Version.h index 716ba5cb7857..20af7b4ed63e 100644 --- a/packages/seacas/applications/cpup/CP_Version.h +++ b/packages/seacas/applications/cpup/CP_Version.h @@ -5,13 +5,10 @@ * * See packages/seacas/LICENSE for details */ -#ifndef SEACAS_Version_h -#define SEACAS_Version_h +#pragma once static char const *qainfo[] = { "cpup", "0.94 beta", "2022/10/31", }; - -#endif // SEACAS_Version_h diff --git a/packages/seacas/applications/ejoin/EJ_CodeTypes.h b/packages/seacas/applications/ejoin/EJ_CodeTypes.h index df0440f6a09a..2af3bda0861b 100644 --- a/packages/seacas/applications/ejoin/EJ_CodeTypes.h +++ b/packages/seacas/applications/ejoin/EJ_CodeTypes.h @@ -1,10 +1,9 @@ -// Copyright(C) 1999-2021 National Technology & Engineering Solutions +// Copyright(C) 1999-2022 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. // // See packages/seacas/LICENSE for details -#ifndef SEACAS_CodeTypes_H -#define SEACAS_CodeTypes_H +#pragma once #include #include @@ -20,4 +19,3 @@ using StringIdVector = std::vector>; using StringVector = std::vector; using RegionVector = std::vector; using Omissions = std::vector; -#endif diff --git a/packages/seacas/applications/ejoin/EJ_SystemInterface.h b/packages/seacas/applications/ejoin/EJ_SystemInterface.h index 87cb0feb2c1d..e0fff14fd04e 100644 --- a/packages/seacas/applications/ejoin/EJ_SystemInterface.h +++ b/packages/seacas/applications/ejoin/EJ_SystemInterface.h @@ -1,10 +1,9 @@ -// Copyright(C) 1999-2021 National Technology & Engineering Solutions +// Copyright(C) 1999-2022 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. // // See packages/seacas/LICENSE for details -#ifndef Sierra_SystemInterface_h -#define Sierra_SystemInterface_h +#pragma once #include "EJ_CodeTypes.h" // for StringIdVector, Omissions, etc #include "EJ_vector3d.h" // for vector3d @@ -117,4 +116,3 @@ class SystemInterface StringIdVector nsetVarNames_; StringIdVector ssetVarNames_; }; -#endif diff --git a/packages/seacas/applications/ejoin/EJ_Version.h b/packages/seacas/applications/ejoin/EJ_Version.h index d10228443cd6..73a91b76c49c 100644 --- a/packages/seacas/applications/ejoin/EJ_Version.h +++ b/packages/seacas/applications/ejoin/EJ_Version.h @@ -3,13 +3,10 @@ // NTESS, the U.S. Government retains certain rights in this software. // // See packages/seacas/LICENSE for details -#ifndef EJ_Version_h -#define EJ_Version_h +#pragma once static char const *qainfo[] = { "ejoin", "2022/01/24", "1.5.7", }; - -#endif diff --git a/packages/seacas/applications/ejoin/EJ_index_sort.h b/packages/seacas/applications/ejoin/EJ_index_sort.h index ac86808c2bfe..1592b8a5512f 100644 --- a/packages/seacas/applications/ejoin/EJ_index_sort.h +++ b/packages/seacas/applications/ejoin/EJ_index_sort.h @@ -1,14 +1,12 @@ -// Copyright(C) 1999-2020 National Technology & Engineering Solutions +// Copyright(C) 1999-2020, 2022 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. // // See packages/seacas/LICENSE for details -#ifndef INDEX_SORT_H -#define INDEX_SORT_H +#pragma once #include template void index_coord_sort(const std::vector &xyz, std::vector &index, int axis); template void index_sort(const std::vector &ids, std::vector &index); -#endif diff --git a/packages/seacas/applications/ejoin/EJ_mapping.h b/packages/seacas/applications/ejoin/EJ_mapping.h index e242a1684504..cc506ed52fee 100644 --- a/packages/seacas/applications/ejoin/EJ_mapping.h +++ b/packages/seacas/applications/ejoin/EJ_mapping.h @@ -1,10 +1,9 @@ -// Copyright(C) 1999-2020 National Technology & Engineering Solutions +// Copyright(C) 1999-2020, 2022 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. // // See packages/seacas/LICENSE for details -#ifndef EJOIN_MAPPING_H -#define EJOIN_MAPPING_H +#pragma once #include "EJ_CodeTypes.h" @@ -22,4 +21,3 @@ void build_local_element_map(RegionVector &part_mesh, std::vector &local_el template void generate_element_ids(RegionVector &part_mesh, const std::vector &local_element_map, std::vector &global_element_map); -#endif diff --git a/packages/seacas/applications/ejoin/EJ_match_xyz.h b/packages/seacas/applications/ejoin/EJ_match_xyz.h index 1e114a66955e..3c4a5533aa5f 100644 --- a/packages/seacas/applications/ejoin/EJ_match_xyz.h +++ b/packages/seacas/applications/ejoin/EJ_match_xyz.h @@ -1,15 +1,12 @@ -// Copyright(C) 1999-2020 National Technology & Engineering Solutions +// Copyright(C) 1999-2020, 2022 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. // // See packages/seacas/LICENSE for details -#ifndef MATCY_XYZ_H -#define MATCY_XYZ_H +#pragma once #include "EJ_match_xyz.h" template void match_node_xyz(RegionVector &part_mesh, double tolerance, std::vector &global_node_map, std::vector &local_node_map); - -#endif diff --git a/packages/seacas/applications/ejoin/EJ_vector3d.h b/packages/seacas/applications/ejoin/EJ_vector3d.h index 352b4437dca2..01415102cc15 100644 --- a/packages/seacas/applications/ejoin/EJ_vector3d.h +++ b/packages/seacas/applications/ejoin/EJ_vector3d.h @@ -1,11 +1,9 @@ -#ifndef VECTOR3D_H -#define VECTOR3D_H - -// Copyright(C) 1999-2020 National Technology & Engineering Solutions +// Copyright(C) 1999-2020, 2022 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. // // See packages/seacas/LICENSE for details +#pragma once class vector3d { @@ -93,5 +91,3 @@ inline vector3d &vector3d::operator-=(double scalar) z -= scalar; return *this; } - -#endif diff --git a/packages/seacas/applications/epu/EP_ExodusEntity.h b/packages/seacas/applications/epu/EP_ExodusEntity.h index bca4f8b48007..42c5e892b8ba 100644 --- a/packages/seacas/applications/epu/EP_ExodusEntity.h +++ b/packages/seacas/applications/epu/EP_ExodusEntity.h @@ -1,12 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ -#ifndef SEACAS_ExodusEntity_H -#define SEACAS_ExodusEntity_H +#pragma once #define NO_NETCDF_2 #include "EP_ObjectType.h" @@ -305,4 +304,3 @@ namespace Excn { int64_t elementsBorder{0}; }; } // namespace Excn -#endif /* SEACAS_ExodusEntity_H */ diff --git a/packages/seacas/applications/epu/EP_ExodusFile.h b/packages/seacas/applications/epu/EP_ExodusFile.h index 0091f32eecc5..a399ec457ef6 100644 --- a/packages/seacas/applications/epu/EP_ExodusFile.h +++ b/packages/seacas/applications/epu/EP_ExodusFile.h @@ -1,12 +1,11 @@ /* - * Copyright(C) 1999-2021 National Technology & Engineering Solutions + * Copyright(C) 1999-2022 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. * * See packages/seacas/LICENSE for details */ -#ifndef SEACAS_ExodusFile_H -#define SEACAS_ExodusFile_H +#pragma once #include #include @@ -50,4 +49,3 @@ namespace Excn { static int mode64bit_; }; } // namespace Excn -#endif /* SEACAS_ExodusFil_H */ diff --git a/packages/seacas/applications/epu/EP_Internals.h b/packages/seacas/applications/epu/EP_Internals.h index 1aec4bd680f3..40f27376ab2e 100644 --- a/packages/seacas/applications/epu/EP_Internals.h +++ b/packages/seacas/applications/epu/EP_Internals.h @@ -1,12 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ -#ifndef SEACAS_Internals_h -#define SEACAS_Internals_h +#pragma once #include // for string #include // for vector @@ -135,4 +134,3 @@ namespace Excn { int maximumNameLength; }; } // namespace Excn -#endif /* SEACAS_Internals_h */ diff --git a/packages/seacas/applications/epu/EP_ObjectType.h b/packages/seacas/applications/epu/EP_ObjectType.h index ccc71b1dd4bc..9c821e34a649 100644 --- a/packages/seacas/applications/epu/EP_ObjectType.h +++ b/packages/seacas/applications/epu/EP_ObjectType.h @@ -1,12 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ -#ifndef ObjectType_H -#define ObjectType_H +#pragma once namespace Excn { // Note that these are used as indices into truth table for ELBK, NSET, SSET, EDBLK, FABLK... @@ -25,5 +24,3 @@ namespace Excn { UNSET }; } // namespace Excn - -#endif diff --git a/packages/seacas/applications/epu/EP_ParallelDisks.h b/packages/seacas/applications/epu/EP_ParallelDisks.h index 729e96c419ec..5b5216dcecbf 100644 --- a/packages/seacas/applications/epu/EP_ParallelDisks.h +++ b/packages/seacas/applications/epu/EP_ParallelDisks.h @@ -1,13 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ - -#ifndef ParallelDisksH -#define ParallelDisksH +#pragma once #include @@ -34,4 +32,3 @@ namespace Excn { ParallelDisks &operator=(const ParallelDisks &); }; } // namespace Excn -#endif diff --git a/packages/seacas/applications/epu/EP_SystemInterface.h b/packages/seacas/applications/epu/EP_SystemInterface.h index 5fba99aaef80..3eb73995c475 100644 --- a/packages/seacas/applications/epu/EP_SystemInterface.h +++ b/packages/seacas/applications/epu/EP_SystemInterface.h @@ -5,8 +5,7 @@ * * See packages/seacas/LICENSE for details */ -#ifndef Sierra_SystemInterface_h -#define Sierra_SystemInterface_h +#pragma once #include "GetLongOpt.h" // for GetLongOption #include // for INT_MAX @@ -177,4 +176,3 @@ namespace Excn { return partCount_ > 0 ? partCount_ : processorCount_; } } // namespace Excn -#endif diff --git a/packages/seacas/applications/epu/EP_Variables.h b/packages/seacas/applications/epu/EP_Variables.h index 660595d12648..26d1fa7f1ad4 100644 --- a/packages/seacas/applications/epu/EP_Variables.h +++ b/packages/seacas/applications/epu/EP_Variables.h @@ -1,12 +1,12 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ -#ifndef SEACAS_Variables_H -#define SEACAS_Variables_H +#pragma once + #include "EP_ObjectType.h" #include #include @@ -75,5 +75,3 @@ namespace Excn { std::string type_{}; }; } // namespace Excn - -#endif diff --git a/packages/seacas/applications/epu/EP_Version.h b/packages/seacas/applications/epu/EP_Version.h index 64a97322a51f..4101873ee8fc 100644 --- a/packages/seacas/applications/epu/EP_Version.h +++ b/packages/seacas/applications/epu/EP_Version.h @@ -1,17 +1,14 @@ /* - * Copyright(C) 1999-2022 National Technology & Engineering Solutions + * Copyright(C) 1999-2023 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. * * See packages/seacas/LICENSE for details */ -#ifndef SEACAS_Version_h -#define SEACAS_Version_h +#pragma once static char const *qainfo[] = { "epu -- E Pluribus Unum", - "6.05", - "2022/02/18", + "6.06", + "2023/01/11", }; - -#endif // SEACAS_Version_h diff --git a/packages/seacas/applications/exodiff/ED_SystemInterface.h b/packages/seacas/applications/exodiff/ED_SystemInterface.h index c96aa0e4fb03..434756329247 100644 --- a/packages/seacas/applications/exodiff/ED_SystemInterface.h +++ b/packages/seacas/applications/exodiff/ED_SystemInterface.h @@ -3,8 +3,7 @@ // NTESS, the U.S. Government retains certain rights in this software. // // See packages/seacas/LICENSE for details -#ifndef Sierra_SystemInterface_h -#define Sierra_SystemInterface_h +#pragma once #include "GetLongOpt.h" // for GetLongOption #include "Tolerance.h" // for Tolerance, etc @@ -145,4 +144,3 @@ class SystemInterface }; extern SystemInterface interFace; -#endif diff --git a/packages/seacas/applications/exodiff/ED_Version.h b/packages/seacas/applications/exodiff/ED_Version.h index b8b60d6544ab..6aa9adbaa51c 100644 --- a/packages/seacas/applications/exodiff/ED_Version.h +++ b/packages/seacas/applications/exodiff/ED_Version.h @@ -1,12 +1,9 @@ -// Copyright(C) 1999-2022 National Technology & Engineering Solutions +// Copyright(C) 1999-2023 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. // // See packages/seacas/LICENSE for details -#ifndef ED_Version_h -#define ED_Version_h +#pragma once -static std::string version("3.23"); -static std::string verdate("2022-11-01"); - -#endif // ED_Version_h +static std::string version("3.25"); +static std::string verdate("2023-01-13"); diff --git a/packages/seacas/applications/exodiff/MinMaxData.h b/packages/seacas/applications/exodiff/MinMaxData.h index 8ea7a51c79fd..f7a431e1a077 100644 --- a/packages/seacas/applications/exodiff/MinMaxData.h +++ b/packages/seacas/applications/exodiff/MinMaxData.h @@ -1,10 +1,9 @@ -// Copyright(C) 1999-2021 National Technology & Engineering Solutions +// Copyright(C) 1999-2022 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. // // See packages/seacas/LICENSE for details -#ifndef MINMAXDATA_H -#define MINMAXDATA_H +#pragma once #include @@ -80,4 +79,3 @@ class MinMaxData ToleranceType type{ToleranceType::mm_unknown}; }; -#endif diff --git a/packages/seacas/applications/exodiff/Norm.h b/packages/seacas/applications/exodiff/Norm.h index a8b5f0827c3b..c41c119bb81b 100644 --- a/packages/seacas/applications/exodiff/Norm.h +++ b/packages/seacas/applications/exodiff/Norm.h @@ -1,10 +1,9 @@ -// Copyright(C) 1999-2020 National Technology & Engineering Solutions +// Copyright(C) 1999-2020, 2022 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. // // See packages/seacas/LICENSE for details -#ifndef ED_NORM_H -#define ED_NORM_H +#pragma once #include class Norm @@ -78,5 +77,3 @@ class Norm double l2_norm_2{0.0}; double l2_norm_d{0.0}; }; - -#endif diff --git a/packages/seacas/applications/exodiff/Tolerance.h b/packages/seacas/applications/exodiff/Tolerance.h index 2fe7d002609f..644b6df28fbe 100644 --- a/packages/seacas/applications/exodiff/Tolerance.h +++ b/packages/seacas/applications/exodiff/Tolerance.h @@ -1,10 +1,9 @@ -// Copyright(C) 1999-2020 National Technology & Engineering Solutions +// Copyright(C) 1999-2020, 2022 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. // // See packages/seacas/LICENSE for details -#ifndef TOLERANCE_H -#define TOLERANCE_H +#pragma once #include "map.h" #include @@ -131,5 +130,3 @@ inline double Tolerance::Delta(double v1, double v2) const } return 0.0; } - -#endif diff --git a/packages/seacas/applications/exodiff/edge_block.h b/packages/seacas/applications/exodiff/edge_block.h index 81bac95b33a5..f82ebf35dfd6 100644 --- a/packages/seacas/applications/exodiff/edge_block.h +++ b/packages/seacas/applications/exodiff/edge_block.h @@ -3,9 +3,7 @@ // NTESS, the U.S. Government retains certain rights in this software. // // See packages/seacas/LICENSE for details - -#ifndef EDGE_BLOCK_H -#define EDGE_BLOCK_H +#pragma once #include "exo_entity.h" #include @@ -39,5 +37,3 @@ template class Edge_Block : public Exo_Entity friend class ExoII_Read; }; - -#endif diff --git a/packages/seacas/applications/exodiff/exoII_read.h b/packages/seacas/applications/exodiff/exoII_read.h index 0abaebd8589b..8fe5ab78a154 100644 --- a/packages/seacas/applications/exodiff/exoII_read.h +++ b/packages/seacas/applications/exodiff/exoII_read.h @@ -3,9 +3,7 @@ // NTESS, the U.S. Government retains certain rights in this software. // // See packages/seacas/LICENSE for details - -#ifndef EXOII_READ_H -#define EXOII_READ_H +#pragma once #include "exo_entity.h" @@ -283,5 +281,3 @@ template inline INT ExoII_Read::Element_Order(size_t elmt_nu } return 0; } - -#endif diff --git a/packages/seacas/applications/exodiff/exo_block.h b/packages/seacas/applications/exodiff/exo_block.h index 6ea7ec785f73..b35cb404a021 100644 --- a/packages/seacas/applications/exodiff/exo_block.h +++ b/packages/seacas/applications/exodiff/exo_block.h @@ -3,9 +3,7 @@ // NTESS, the U.S. Government retains certain rights in this software. // // See packages/seacas/LICENSE for details - -#ifndef EXO_BLOCK_H -#define EXO_BLOCK_H +#pragma once #include "exo_entity.h" #include @@ -55,5 +53,3 @@ template class Exo_Block : public Exo_Entity friend class ExoII_Read; }; - -#endif diff --git a/packages/seacas/applications/exodiff/exo_entity.h b/packages/seacas/applications/exodiff/exo_entity.h index fb72deed4eeb..b6e378208610 100644 --- a/packages/seacas/applications/exodiff/exo_entity.h +++ b/packages/seacas/applications/exodiff/exo_entity.h @@ -3,9 +3,7 @@ // NTESS, the U.S. Government retains certain rights in this software. // // See packages/seacas/LICENSE for details - -#ifndef EXO_ENTITY_H -#define EXO_ENTITY_H +#pragma once #include #include @@ -95,4 +93,3 @@ class Exo_Entity template friend class ExoII_Read; }; -#endif diff --git a/packages/seacas/applications/exodiff/exodiff.h b/packages/seacas/applications/exodiff/exodiff.h index 46b14691c682..4f8e58170eec 100644 --- a/packages/seacas/applications/exodiff/exodiff.h +++ b/packages/seacas/applications/exodiff/exodiff.h @@ -1,14 +1,10 @@ -// Copyright(C) 1999-2020 National Technology & Engineering Solutions +// Copyright(C) 1999-2020, 2022 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. // // See packages/seacas/LICENSE for details -#ifndef exodiff_h -#define exodiff_h - +#pragma once #include std::string Version(); - -#endif diff --git a/packages/seacas/applications/exodiff/face_block.h b/packages/seacas/applications/exodiff/face_block.h index caf229e15df9..db1e574ff773 100644 --- a/packages/seacas/applications/exodiff/face_block.h +++ b/packages/seacas/applications/exodiff/face_block.h @@ -3,9 +3,7 @@ // NTESS, the U.S. Government retains certain rights in this software. // // See packages/seacas/LICENSE for details - -#ifndef FACE_BLOCK_H -#define FACE_BLOCK_H +#pragma once #include "exo_entity.h" #include @@ -39,5 +37,3 @@ template class Face_Block : public Exo_Entity friend class ExoII_Read; }; - -#endif diff --git a/packages/seacas/applications/exodiff/map.h b/packages/seacas/applications/exodiff/map.h index 1426a169faae..3fb92b77c0cd 100644 --- a/packages/seacas/applications/exodiff/map.h +++ b/packages/seacas/applications/exodiff/map.h @@ -1,10 +1,9 @@ -// Copyright(C) 1999-2020 National Technology & Engineering Solutions +// Copyright(C) 1999-2020, 2022 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. // // See packages/seacas/LICENSE for details -#ifndef EXODIFF_MAP_H -#define EXODIFF_MAP_H +#pragma once #include "exoII_read.h" enum class MapType { FILE_ORDER = 0, PARTIAL, USE_FILE_IDS, DISTANCE }; @@ -32,5 +31,3 @@ bool Check_Maps(const std::vector &node_map, const std::vector &elmt_m template bool Compare_Maps(ExoII_Read &file1, ExoII_Read &file2, const std::vector &node_map, const std::vector &elmt_map, bool partial_flag); - -#endif diff --git a/packages/seacas/applications/exodiff/node_set.h b/packages/seacas/applications/exodiff/node_set.h index 16c4ffe32768..1ce5cb614b93 100644 --- a/packages/seacas/applications/exodiff/node_set.h +++ b/packages/seacas/applications/exodiff/node_set.h @@ -1,11 +1,9 @@ -// Copyright(C) 1999-2020 National Technology & Engineering Solutions +// Copyright(C) 1999-2020, 2022 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. // // See packages/seacas/LICENSE for details - -#ifndef NODE_SET_H -#define NODE_SET_H +#pragma once #include "exo_entity.h" #include "side_set.h" // for Side_Set @@ -50,5 +48,3 @@ template class Node_Set : public Exo_Entity friend class ExoII_Read; }; - -#endif diff --git a/packages/seacas/applications/exodiff/side_set.h b/packages/seacas/applications/exodiff/side_set.h index e0d404324cc8..362b3f940c06 100644 --- a/packages/seacas/applications/exodiff/side_set.h +++ b/packages/seacas/applications/exodiff/side_set.h @@ -1,11 +1,9 @@ -// Copyright(C) 1999-2020 National Technology & Engineering Solutions +// Copyright(C) 1999-2020, 2022 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. // // See packages/seacas/LICENSE for details - -#ifndef SIDE_SET_H -#define SIDE_SET_H +#pragma once #include "exo_entity.h" #include @@ -55,5 +53,3 @@ template class Side_Set : public Exo_Entity friend class ExoII_Read; }; - -#endif diff --git a/packages/seacas/applications/exodiff/stringx.h b/packages/seacas/applications/exodiff/stringx.h index b947f0133d80..f624bb76a31d 100644 --- a/packages/seacas/applications/exodiff/stringx.h +++ b/packages/seacas/applications/exodiff/stringx.h @@ -1,11 +1,9 @@ -// Copyright(C) 1999-2021 National Technology & Engineering Solutions +// Copyright(C) 1999-2022 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. // // See packages/seacas/LICENSE for details - -#ifndef STRINGX_H -#define STRINGX_H +#pragma once #include #include @@ -45,5 +43,3 @@ char first_character(const std::string &s); //! will be ignored if the last argument is true. Returns the index of the //! string in the vector if found, otherwise returns -1. int find_string(const std::vector &lst, const std::string &s, bool nocase); - -#endif diff --git a/packages/seacas/applications/exodiff/util.h b/packages/seacas/applications/exodiff/util.h index 3ae90624656c..e21362ec02d9 100644 --- a/packages/seacas/applications/exodiff/util.h +++ b/packages/seacas/applications/exodiff/util.h @@ -1,13 +1,11 @@ /* - * Copyright(C) 1999-2021 National Technology & Engineering Solutions + * Copyright(C) 1999-2022 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. * * See packages/seacas/LICENSE for details */ -#ifndef EXODIFF_UTIL_H -#define EXODIFF_UTIL_H - +#pragma once #include #include #include @@ -22,5 +20,3 @@ void Warning(const std::string &x); void ERR_OUT(std::ostringstream &buf); void DIFF_OUT(std::ostringstream &buf, fmt::detail::color_type color = fmt::color::red); void DIFF_OUT(const std::string &buf, fmt::detail::color_type color = fmt::color::red); - -#endif diff --git a/packages/seacas/applications/exomatlab/EML_CodeTypes.h b/packages/seacas/applications/exomatlab/EML_CodeTypes.h index 475895990dc2..0b72736c3567 100644 --- a/packages/seacas/applications/exomatlab/EML_CodeTypes.h +++ b/packages/seacas/applications/exomatlab/EML_CodeTypes.h @@ -1,16 +1,12 @@ -// Copyright(C) 1999-2020 National Technology & Engineering Solutions +// Copyright(C) 1999-2020, 2022 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. // // See packages/seacas/LICENSE for details - -#ifndef SEACAS_CodeTypes_H -#define SEACAS_CodeTypes_H +#pragma once #include #include #include using StringIdVector = std::vector>; - -#endif diff --git a/packages/seacas/applications/exomatlab/EML_SystemInterface.h b/packages/seacas/applications/exomatlab/EML_SystemInterface.h index 8b1e91f9bb29..711372ad2e47 100644 --- a/packages/seacas/applications/exomatlab/EML_SystemInterface.h +++ b/packages/seacas/applications/exomatlab/EML_SystemInterface.h @@ -1,11 +1,9 @@ -// Copyright(C) 1999-2021 National Technology & Engineering Solutions +// Copyright(C) 1999-2022 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. // // See packages/seacas/LICENSE for details - -#ifndef _SystemInterface_h -#define _SystemInterface_h +#pragma once #include // for StringIdVector #include // for GetLongOption @@ -56,4 +54,3 @@ class SystemInterface bool listVars_{false}; char fieldSuffix_{0}; }; -#endif diff --git a/packages/seacas/applications/exomatlab/EML_Version.h b/packages/seacas/applications/exomatlab/EML_Version.h index 91c70b3cc106..dc7774e2c158 100644 --- a/packages/seacas/applications/exomatlab/EML_Version.h +++ b/packages/seacas/applications/exomatlab/EML_Version.h @@ -1,16 +1,12 @@ -// Copyright(C) 1999-2020 National Technology & Engineering Solutions +// Copyright(C) 1999-2020, 2022 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. // // See packages/seacas/LICENSE for details - -#ifndef SEACAS_Version_h -#define SEACAS_Version_h +#pragma once static char const *qainfo[] = { "exomatlab", "2012/04/17", "0.9.4", }; - -#endif // SEACAS_Version_h diff --git a/packages/seacas/applications/nas2exo/N2EDataTypes.h b/packages/seacas/applications/nas2exo/N2EDataTypes.h index b8d88acb82ab..0087527e8ef4 100644 --- a/packages/seacas/applications/nas2exo/N2EDataTypes.h +++ b/packages/seacas/applications/nas2exo/N2EDataTypes.h @@ -6,9 +6,7 @@ * John Niederhouse(ORG 1443, SNL, Coordinator) * Copyright: Sandia National Labs, 2020, 2021, 2022 */ - -#ifndef INCLUDE_N2EDATATYPES_H_ -#define INCLUDE_N2EDATATYPES_H_ +#pragma once #include #include @@ -63,4 +61,3 @@ namespace N2EModules { N2EGridPtList /*nodes*/>; } // namespace N2EModules -#endif /* INCLUDE_N2EDATATYPES_H_ */ diff --git a/packages/seacas/applications/nas2exo/N2EExoWriter.h b/packages/seacas/applications/nas2exo/N2EExoWriter.h index 2e764ebdcdef..ce12aa73f213 100644 --- a/packages/seacas/applications/nas2exo/N2EExoWriter.h +++ b/packages/seacas/applications/nas2exo/N2EExoWriter.h @@ -6,9 +6,7 @@ * John Niederhouse(ORG 1443, SNL, Coordinator) * Copyright: Sandia National Labs, OCT-2022 */ - -#ifndef _EXOWRITER_H_ -#define _EXOWRITER_H_ +#pragma once #include "N2EDataTypes.h" #include @@ -69,5 +67,3 @@ namespace ExoModules { }; } // namespace ExoModules - -#endif /* INCLUDE_N2EEXOWRITER_H_ */ diff --git a/packages/seacas/applications/nas2exo/N2ENasReader.h b/packages/seacas/applications/nas2exo/N2ENasReader.h index a0872651f705..a87ac53370a1 100644 --- a/packages/seacas/applications/nas2exo/N2ENasReader.h +++ b/packages/seacas/applications/nas2exo/N2ENasReader.h @@ -6,8 +6,7 @@ // Description : Testing nas2exo Library, C++ 14 //============================================================================ -#ifndef INCLUDE_N2ENASREADER_H_ -#define INCLUDE_N2ENASREADER_H_ +#pragma once #include "N2EDataTypes.h" #include @@ -63,5 +62,3 @@ namespace NasModules { }; } // namespace NasModules - -#endif /* INCLUDE_N2ENASREADER_H_ */ diff --git a/packages/seacas/applications/nem_slice/elb.h b/packages/seacas/applications/nem_slice/elb.h index cf754e36eb21..8ef4bb8a30fa 100644 --- a/packages/seacas/applications/nem_slice/elb.h +++ b/packages/seacas/applications/nem_slice/elb.h @@ -5,9 +5,7 @@ * * See packages/seacas/LICENSE for details */ - -#ifndef _EXOIILB_CONST_H_ -#define _EXOIILB_CONST_H_ +#pragma once #include "elb_elem.h" #include @@ -273,5 +271,3 @@ template struct Graph_Description #define EDGE_WGT 4 #define TIME_INDX 5 #define VAR_NAME 6 - -#endif /* _EXOIILB_CONST_H_ */ diff --git a/packages/seacas/applications/nem_slice/elb_allo.h b/packages/seacas/applications/nem_slice/elb_allo.h index b006dff10d9c..0aed5da2b5a0 100644 --- a/packages/seacas/applications/nem_slice/elb_allo.h +++ b/packages/seacas/applications/nem_slice/elb_allo.h @@ -1,14 +1,10 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ - -#ifndef _ELB_ALLO_CONST_H_ -#define _ELB_ALLO_CONST_H_ +#pragma once void *array_alloc(int numdim, ...); - -#endif /* _ELB_ALLO_CONST_H_ */ diff --git a/packages/seacas/applications/nem_slice/elb_elem.h b/packages/seacas/applications/nem_slice/elb_elem.h index fb00b1ba4c39..09c8aa6bd678 100644 --- a/packages/seacas/applications/nem_slice/elb_elem.h +++ b/packages/seacas/applications/nem_slice/elb_elem.h @@ -1,13 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ - -#ifndef _ELB_ELM_CONST_H -#define _ELB_ELM_CONST_H +#pragma once /* Define element types */ enum E_Type { @@ -109,5 +107,3 @@ int is_tet(E_Type etype); int is_wedge(E_Type etype); int is_pyramid(E_Type etype); int is_3d_element(E_Type etype); - -#endif /* _ELB_ELM_CONST_H */ diff --git a/packages/seacas/applications/nem_slice/elb_err.h b/packages/seacas/applications/nem_slice/elb_err.h index b1caefa9278e..6936d03a61c0 100644 --- a/packages/seacas/applications/nem_slice/elb_err.h +++ b/packages/seacas/applications/nem_slice/elb_err.h @@ -1,13 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ - -#ifndef _EXOIILB_ERR_CONST_H_ -#define _EXOIILB_ERR_CONST_H_ +#pragma once #include // for move #include // for string @@ -40,5 +38,3 @@ extern void error_add(int level, ); extern void error_report(); - -#endif /* _EXOIILB_ERR_CONST_H_ */ diff --git a/packages/seacas/applications/nem_slice/elb_exo.h b/packages/seacas/applications/nem_slice/elb_exo.h index 585fc80c57e3..ab3522fe5936 100644 --- a/packages/seacas/applications/nem_slice/elb_exo.h +++ b/packages/seacas/applications/nem_slice/elb_exo.h @@ -1,13 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ - -#ifndef _ELB_EXO_CONST_H_ -#define _ELB_EXO_CONST_H_ +#pragma once #include "elb.h" @@ -32,5 +30,3 @@ template int init_weight_struct(Problem_Description *problem, /* Problem information */ Mesh_Description *mesh, /* Mesh information structure */ Weight_Description *weight); /* Weight specification structure */ - -#endif /* _ELB_EXO_CONST_H_ */ diff --git a/packages/seacas/applications/nem_slice/elb_graph.h b/packages/seacas/applications/nem_slice/elb_graph.h index ec3fcb599af7..fbb801e976e6 100644 --- a/packages/seacas/applications/nem_slice/elb_graph.h +++ b/packages/seacas/applications/nem_slice/elb_graph.h @@ -1,13 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ - -#ifndef _ELB_GRAPH_CONST_H_ -#define _ELB_GRAPH_CONST_H_ +#pragma once struct Problem_Description; struct Sphere_Info; @@ -24,5 +22,3 @@ int generate_graph(Problem_Description *problem, /* Pointer to structure cont Weight_Description *weight, /* Pointer to structure for graph weighting */ Sphere_Info *sphere /* Pointer to sphere adjustment structure */ ); - -#endif /* _ELB_GRAPH_CONST_H_ */ diff --git a/packages/seacas/applications/nem_slice/elb_groups.h b/packages/seacas/applications/nem_slice/elb_groups.h index d9588f28eb73..11cd8d7c0997 100644 --- a/packages/seacas/applications/nem_slice/elb_groups.h +++ b/packages/seacas/applications/nem_slice/elb_groups.h @@ -1,13 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ - -#ifndef _ELB_GROUPS_CONST_H_ -#define _ELB_GROUPS_CONST_H_ +#pragma once #include // for size_t struct Machine_Description; @@ -24,5 +22,3 @@ template int get_group_info(Machine_Description *machine, Problem_Description *prob, Mesh_Description *mesh, Graph_Description *graph, int elem2grp[], int nprocg[], int nelemg[], size_t *max_vtx, size_t *max_adj); - -#endif /* _ELB_GROUPS_CONST_H_ */ diff --git a/packages/seacas/applications/nem_slice/elb_inp.h b/packages/seacas/applications/nem_slice/elb_inp.h index 3e1a4a01c0ad..f1e01bf45fc1 100644 --- a/packages/seacas/applications/nem_slice/elb_inp.h +++ b/packages/seacas/applications/nem_slice/elb_inp.h @@ -1,13 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ - -#ifndef _ELB_INP_CONST_H_ -#define _ELB_INP_CONST_H_ +#pragma once #include // for string struct Machine_Description; @@ -71,5 +69,3 @@ int check_inp_specs(std::string &exoII_inp_file, /* The ExodusII input F /* Various defines used by the input routines */ #define NS_NONE -1 - -#endif /* _ELB_INP_CONST_H_ */ diff --git a/packages/seacas/applications/nem_slice/elb_loadbal.h b/packages/seacas/applications/nem_slice/elb_loadbal.h index 56731f8c3cb7..5987c1a42ea2 100644 --- a/packages/seacas/applications/nem_slice/elb_loadbal.h +++ b/packages/seacas/applications/nem_slice/elb_loadbal.h @@ -1,12 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ -#ifndef _ELB_LOADBAL_CONST_H_ -#define _ELB_LOADBAL_CONST_H_ +#pragma once struct Machine_Description; struct Problem_Description; @@ -27,4 +26,3 @@ template int generate_maps(Machine_Description *machine, Problem_Description *problem, Mesh_Description *mesh, LB_Description *lb, Graph_Description *graph); -#endif /* _ELB_LOADBAL_CONST_H_ */ diff --git a/packages/seacas/applications/nem_slice/elb_output.h b/packages/seacas/applications/nem_slice/elb_output.h index 7c65a4ee554d..5a0b9f216b74 100644 --- a/packages/seacas/applications/nem_slice/elb_output.h +++ b/packages/seacas/applications/nem_slice/elb_output.h @@ -1,13 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ - -#ifndef _ELB_OUTPUT_CONST_H_ -#define _ELB_OUTPUT_CONST_H_ +#pragma once #include // for string struct Machine_Description; struct Problem_Description; @@ -23,5 +21,3 @@ int write_nemesis(std::string &nemI_out_file, Machine_Description *machine, template int write_vis(std::string &nemI_out_file, std::string &exoII_inp_file, Machine_Description *machine, Problem_Description *prob, Mesh_Description *mesh, LB_Description *lb); - -#endif /* _ELB_OUTPUT_CONST_H_ */ diff --git a/packages/seacas/applications/nem_slice/elb_util.h b/packages/seacas/applications/nem_slice/elb_util.h index 3ff567d70d44..b58818c6690d 100644 --- a/packages/seacas/applications/nem_slice/elb_util.h +++ b/packages/seacas/applications/nem_slice/elb_util.h @@ -1,13 +1,11 @@ /* - * Copyright(C) 1999-2021 National Technology & Engineering Solutions + * Copyright(C) 1999-2022 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. * * See packages/seacas/LICENSE for details */ - -#ifndef _ELB_UTIL_CONST_H_ -#define _ELB_UTIL_CONST_H_ +#pragma once #include // for size_t #include @@ -113,5 +111,3 @@ size_t find_inter(const INT set1[], /* the first set of integers */ ); template int64_t bin_search2(INT value, size_t num, INT List[]); - -#endif /* _ELB_UTIL_CONST_H_ */ diff --git a/packages/seacas/applications/nem_slice/fix_column_partitions.h b/packages/seacas/applications/nem_slice/fix_column_partitions.h index fe68184204bd..80ee9b6bd53d 100644 --- a/packages/seacas/applications/nem_slice/fix_column_partitions.h +++ b/packages/seacas/applications/nem_slice/fix_column_partitions.h @@ -1,13 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ - -#ifndef _ELB_FIX_COLUMN_PARTITIONS_H -#define _ELB_FIX_COLUMN_PARTITIONS_H +#pragma once #include "elb.h" // for LB_Description, etc @@ -24,5 +22,3 @@ template int fix_column_partitions(LB_Description *lb, Mesh_Description const *const mesh, Graph_Description const *const graph); - -#endif // _ELB_FIX_COLUMN_PARTITIONS_H diff --git a/packages/seacas/applications/nem_slice/getsubopt.h b/packages/seacas/applications/nem_slice/getsubopt.h new file mode 100644 index 000000000000..f5fb7728df1d --- /dev/null +++ b/packages/seacas/applications/nem_slice/getsubopt.h @@ -0,0 +1,10 @@ +/* + * Copyright(C) 1999-2020, 2022 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. + * + * See packages/seacas/LICENSE for details + */ +#pragma once +int +getsubopt (char **optionp, char *const *tokens, char **valuep) diff --git a/packages/seacas/applications/nem_spread/el_check_monot.h b/packages/seacas/applications/nem_spread/el_check_monot.h index 94988a5a218a..f52689a1dade 100644 --- a/packages/seacas/applications/nem_spread/el_check_monot.h +++ b/packages/seacas/applications/nem_spread/el_check_monot.h @@ -1,17 +1,14 @@ -#ifndef EL_CHECK_MONOT_H -#define EL_CHECK_MONOT_H - /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ +#pragma once #include -/******************************************************************************/ template int check_monot(INT *vector, size_t length) { /* @@ -27,5 +24,3 @@ template int check_monot(INT *vector, size_t length) } return (1); } -/******************************************************************************/ -#endif diff --git a/packages/seacas/applications/nem_spread/el_elm.h b/packages/seacas/applications/nem_spread/el_elm.h index 75a8d4e907a1..9d31124e1e9b 100644 --- a/packages/seacas/applications/nem_spread/el_elm.h +++ b/packages/seacas/applications/nem_spread/el_elm.h @@ -1,27 +1,23 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ +#pragma once /* * Define element types. */ /* 1-d elements */ - -#ifndef EL_ELM_H -#define EL_ELM_H - #define BAR2 0 #define BAR3 1 #define SHELL2 2 #define SHELL3 3 /* 2-d elements */ - #define QUAD4 14 #define QUAD8 18 #define QUAD9 19 @@ -31,7 +27,6 @@ #define TRI7 27 /* 3-d elements */ - #define HEX8 108 #define HEX16 116 #define HEX20 120 @@ -74,4 +69,3 @@ extern int elem_info(int info, int ielem_type, int supp); extern int get_type(const char string[], int nodes, int num_dim); -#endif diff --git a/packages/seacas/applications/nem_spread/globals.h b/packages/seacas/applications/nem_spread/globals.h index 4dedd5a92960..98100e03af64 100644 --- a/packages/seacas/applications/nem_spread/globals.h +++ b/packages/seacas/applications/nem_spread/globals.h @@ -1,12 +1,11 @@ -#ifndef GLOBALS_H -#define GLOBALS_H /* - * Copyright(C) 1999-2021 National Technology & Engineering Solutions + * Copyright(C) 1999-2022 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. * * See packages/seacas/LICENSE for details */ +#pragma once #include #include @@ -367,5 +366,3 @@ template class Globals safe_free((void **)&Elem_Type); } }; - -#endif diff --git a/packages/seacas/applications/nem_spread/nem_spread.h b/packages/seacas/applications/nem_spread/nem_spread.h index d43b65e74399..46470523511c 100644 --- a/packages/seacas/applications/nem_spread/nem_spread.h +++ b/packages/seacas/applications/nem_spread/nem_spread.h @@ -1,12 +1,11 @@ /* - * Copyright(C) 1999-2021 National Technology & Engineering Solutions + * Copyright(C) 1999-2022 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. * * See packages/seacas/LICENSE for details */ -#ifndef NEM_SPREAD_H -#define NEM_SPREAD_H +#pragma once #include "globals.h" #include "nem_spread.h" // for NemSpread, etc @@ -163,5 +162,3 @@ template class NemSpread ~NemSpread() { safe_free((void **)&GM_Elem_Types); } }; - -#endif diff --git a/packages/seacas/applications/nem_spread/pe_common.h b/packages/seacas/applications/nem_spread/pe_common.h index 8a6751a88896..b3e3715fc958 100644 --- a/packages/seacas/applications/nem_spread/pe_common.h +++ b/packages/seacas/applications/nem_spread/pe_common.h @@ -1,13 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ - -#ifndef _PE_COMMON_H -#define _PE_COMMON_H +#pragma once /*****************************************************************************/ /* This file contains defines that are common to both nem_spread, and */ @@ -28,5 +26,3 @@ #define PEX_MAX(x, y) (((x) > (y)) ? (x) : (y)) /* max function */ #define PEX_MIN(x, y) (((x) < (y)) ? (x) : (y)) /* min function */ - -#endif /* _PE_COMMON_H */ diff --git a/packages/seacas/applications/nem_spread/pe_str_util_const.h b/packages/seacas/applications/nem_spread/pe_str_util_const.h index a493d7e05d32..33b41b14cfb5 100644 --- a/packages/seacas/applications/nem_spread/pe_str_util_const.h +++ b/packages/seacas/applications/nem_spread/pe_str_util_const.h @@ -1,13 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ - -#ifndef _PE_STR_UTIL_CONST_H_ -#define _PE_STR_UTIL_CONST_H_ +#pragma once /* Function prototypes */ extern int token_compare(char *token, /* The input character string */ const char *key /* The key to compare with token */ @@ -25,5 +23,3 @@ extern void clean_string(char inp_str[], /* The string to clean */ extern void string_to_lower(char inp_str[], /* The string to convert to lower case */ char cstop /* Character where to stop */ ); - -#endif /* _PE_STR_UTIL_CONST_H_ */ diff --git a/packages/seacas/applications/nem_spread/ps_pario.h b/packages/seacas/applications/nem_spread/ps_pario.h index 338ba3e9b6c4..c2148fa16fe6 100644 --- a/packages/seacas/applications/nem_spread/ps_pario.h +++ b/packages/seacas/applications/nem_spread/ps_pario.h @@ -1,13 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ - -#ifndef PS_PARIO_H -#define PS_PARIO_H +#pragma once #include "ps_pario_const.h" @@ -16,4 +14,3 @@ double PIO_Time_Array[26]; /* Vector for timings */ struct Parallel_IO PIO_Info; std::string Par_Nem_File_Name; /* The par nemesis file name. */ -#endif diff --git a/packages/seacas/applications/nem_spread/ps_pario_const.h b/packages/seacas/applications/nem_spread/ps_pario_const.h index 9890495127a3..841fe8166293 100644 --- a/packages/seacas/applications/nem_spread/ps_pario_const.h +++ b/packages/seacas/applications/nem_spread/ps_pario_const.h @@ -5,8 +5,7 @@ * * See packages/seacas/LICENSE for details */ -#ifndef PS_PARIO_CONST_H -#define PS_PARIO_CONST_H +#pragma once #include "rf_io_const.h" #include @@ -62,4 +61,3 @@ extern std::string Par_Nem_File_Name; /* The parallel nemesis file name */ void gen_disk_map(struct Parallel_IO *pio_info, int proc_info[], int proc, int nproc); std::string gen_par_filename(const std::string &scalar_fname, int proc_for, int nprocs); -#endif diff --git a/packages/seacas/applications/nem_spread/rf_allo.h b/packages/seacas/applications/nem_spread/rf_allo.h index bf52c4caadbd..41dabc776cbc 100644 --- a/packages/seacas/applications/nem_spread/rf_allo.h +++ b/packages/seacas/applications/nem_spread/rf_allo.h @@ -1,16 +1,13 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ - -#ifndef RF_ALLO_H -#define RF_ALLO_H +#pragma once /* function declarations for dynamic array allocation */ extern void *array_alloc(const char *file, int lineno, int numdim, ...); extern void safe_free(void **ptr); -#endif diff --git a/packages/seacas/applications/nem_spread/rf_io.h b/packages/seacas/applications/nem_spread/rf_io.h index 605dfad31b84..53690cfe9303 100644 --- a/packages/seacas/applications/nem_spread/rf_io.h +++ b/packages/seacas/applications/nem_spread/rf_io.h @@ -1,13 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ - -#ifndef RF_IO_H -#define RF_IO_H +#pragma once std::string ExoFile; /* Exodus II File containing problem definition. */ /* This name is the root name. */ std::string Output_File_Base_Name; /* Base name of output file. If it has a suffix, it will be @@ -39,4 +37,3 @@ int Num_Nset_Var = 0; /* The number of nodeset variables to reserve */ /* space in the output file for. */ int Num_Sset_Var = 0; /* The number of sideset variables to reserve */ /* space in the output file for. */ -#endif diff --git a/packages/seacas/applications/nem_spread/rf_io_const.h b/packages/seacas/applications/nem_spread/rf_io_const.h index 4138af1c1f58..db1b2a5ba154 100644 --- a/packages/seacas/applications/nem_spread/rf_io_const.h +++ b/packages/seacas/applications/nem_spread/rf_io_const.h @@ -1,12 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ -#ifndef RF_IO_CONST_H -#define RF_IO_CONST_H +#pragma once #include #include @@ -92,5 +91,3 @@ extern int Num_Nset_Var; /* The number of nodeset variables to reserve */ extern int Num_Sset_Var; /* The number of sideset variables to reserve */ /* space in the output file for. */ - -#endif diff --git a/packages/seacas/applications/nem_spread/rf_util.h b/packages/seacas/applications/nem_spread/rf_util.h index d265edd6e310..9c5beabda787 100644 --- a/packages/seacas/applications/nem_spread/rf_util.h +++ b/packages/seacas/applications/nem_spread/rf_util.h @@ -1,12 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ -#ifndef _RF_UTIL_H -#define _RF_UTIL_H +#pragma once #include template inline void my_swap(T &r, T &s) @@ -56,5 +55,3 @@ template void my_sort(int64_t count, T ra[], U rb[]) /*****************************************************************************/ /*****************************************************************************/ extern void print_line(const char *charstr, int ntimes); - -#endif /* #ifndef _RF_UTIL_H */ diff --git a/packages/seacas/applications/nem_spread/sort_utils.h b/packages/seacas/applications/nem_spread/sort_utils.h index 5f7759bb93b2..14284004df99 100644 --- a/packages/seacas/applications/nem_spread/sort_utils.h +++ b/packages/seacas/applications/nem_spread/sort_utils.h @@ -1,15 +1,13 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ -#ifndef SORT_UTILS_H -#define SORT_UTILS_H +#pragma once template void gds_iqsort(INT v[], INT iv[], size_t N); template void gds_qsort(INT v[], size_t N); template void indexed_sort(INT v[], INT iv[], size_t N); -#endif diff --git a/packages/seacas/applications/slice/SL_SystemInterface.h b/packages/seacas/applications/slice/SL_SystemInterface.h index 09c8aa6c8f6d..94c6d949a347 100644 --- a/packages/seacas/applications/slice/SL_SystemInterface.h +++ b/packages/seacas/applications/slice/SL_SystemInterface.h @@ -3,8 +3,7 @@ // NTESS, the U.S. Government retains certain rights in this software. // // See packages/seacas/LICENSE for details -#ifndef Sierra_SystemInterface_h -#define Sierra_SystemInterface_h +#pragma once #include "GetLongOpt.h" @@ -115,4 +114,3 @@ class SystemInterface StringIdVector nsetVarNames_; StringIdVector ssetVarNames_; }; -#endif diff --git a/packages/seacas/applications/slice/SL_Version.h b/packages/seacas/applications/slice/SL_Version.h index 940e7ef94b7c..801f5174c3cc 100644 --- a/packages/seacas/applications/slice/SL_Version.h +++ b/packages/seacas/applications/slice/SL_Version.h @@ -3,13 +3,10 @@ // NTESS, the U.S. Government retains certain rights in this software. // // See packages/seacas/LICENSE for details -#ifndef SEACAS_Version_h -#define SEACAS_Version_h +#pragma once static char const *qainfo[] = { "slice", "2022/09/12", "2.0.00", }; - -#endif // SEACAS_Version_h diff --git a/packages/seacas/applications/zellij/Cell.h b/packages/seacas/applications/zellij/Cell.h index 9025d60469d7..8e058764d915 100644 --- a/packages/seacas/applications/zellij/Cell.h +++ b/packages/seacas/applications/zellij/Cell.h @@ -3,8 +3,8 @@ // NTESS, the U.S. Government retains certain rights in this software. // // See packages/seacas/LICENSE for details -#ifndef ZE_Cell_H -#define ZE_Cell_H +#pragma once + // // `Cell`: // -- for each location: @@ -162,5 +162,3 @@ class Cell //! 1 2 3 BL B BR std::array m_ranks{{0, -1, -1, -1, -1, -1, -1, -1, -1}}; }; - -#endif diff --git a/packages/seacas/applications/zellij/Decompose.h b/packages/seacas/applications/zellij/Decompose.h index e11c8fa70195..b65f02ca7d78 100644 --- a/packages/seacas/applications/zellij/Decompose.h +++ b/packages/seacas/applications/zellij/Decompose.h @@ -1,13 +1,11 @@ -// Copyright(C) 2021 National Technology & Engineering Solutions +// Copyright(C) 2021, 2022 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. // // See packages/seacas/LICENSE for details +#pragma once -#ifndef ZE_Decompose_H -#define ZE_Decompose_H #include class Grid; void decompose_grid(Grid &grid, int ranks, const std::string &method); -#endif diff --git a/packages/seacas/applications/zellij/Grid.h b/packages/seacas/applications/zellij/Grid.h index e456e45eac45..299578534b77 100644 --- a/packages/seacas/applications/zellij/Grid.h +++ b/packages/seacas/applications/zellij/Grid.h @@ -3,8 +3,7 @@ // NTESS, the U.S. Government retains certain rights in this software. // // See packages/seacas/LICENSE for details -#ifndef ZE_Grid_H -#define ZE_Grid_H +#pragma once #include @@ -130,4 +129,3 @@ class Grid Minimize m_minimizeOpenFiles{Minimize::NONE}; // 1: Unit, 2: output, 3: all unsigned int m_generatedSideSets{0}; }; -#endif diff --git a/packages/seacas/applications/zellij/UnitCell.h b/packages/seacas/applications/zellij/UnitCell.h index 411520a9fa07..00d037b8260d 100644 --- a/packages/seacas/applications/zellij/UnitCell.h +++ b/packages/seacas/applications/zellij/UnitCell.h @@ -1,10 +1,9 @@ -// Copyright(C) 2021 National Technology & Engineering Solutions +// Copyright(C) 2021, 2022 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. // // See packages/seacas/LICENSE for details -#ifndef ZE_UnitCell_H -#define ZE_UnitCell_H +#pragma once #include #include @@ -102,4 +101,3 @@ class UnitCell }; using UnitCellMap = std::map>; -#endif diff --git a/packages/seacas/applications/zellij/ZE_SystemInterface.h b/packages/seacas/applications/zellij/ZE_SystemInterface.h index 111f706dc9e0..d240cb375c3d 100644 --- a/packages/seacas/applications/zellij/ZE_SystemInterface.h +++ b/packages/seacas/applications/zellij/ZE_SystemInterface.h @@ -3,8 +3,7 @@ // NTESS, the U.S. Government retains certain rights in this software. // // See packages/seacas/LICENSE for details -#ifndef ZE_SystemInterface_h -#define ZE_SystemInterface_h +#pragma once #include "Ioss_GetLongOpt.h" // for GetLongOption #include @@ -88,4 +87,3 @@ class SystemInterface bool ignoreInternalSidesets_{false}; enum Minimize minimizeOpenFiles_ { Minimize::NONE }; }; -#endif diff --git a/packages/seacas/applications/zellij/ZE_Version.h b/packages/seacas/applications/zellij/ZE_Version.h index 5f2dfdde3017..9b0f6ad91dcc 100644 --- a/packages/seacas/applications/zellij/ZE_Version.h +++ b/packages/seacas/applications/zellij/ZE_Version.h @@ -1,15 +1,12 @@ -// Copyright(C) 2021, 2022 National Technology & Engineering Solutions +// Copyright(C) 2021, 2022, 2023 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. // // See packages/seacas/LICENSE for details -#ifndef ZE_Version_h -#define ZE_Version_h +#pragma once static char const *qainfo[] = { "zellij", - "2022/09/21", - "1.5.3", + "2023/01/11", + "1.5.4", }; - -#endif diff --git a/packages/seacas/libraries/aprepro_lib/apr_array.h b/packages/seacas/libraries/aprepro_lib/apr_array.h index 27cc5cb5d365..c3becf1ba990 100644 --- a/packages/seacas/libraries/aprepro_lib/apr_array.h +++ b/packages/seacas/libraries/aprepro_lib/apr_array.h @@ -1,12 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ -#ifndef SEAMS_ARRAY_H -#define SEAMS_ARRAY_H +#pragma once namespace SEAMS { struct array; @@ -17,4 +16,3 @@ namespace SEAMS { array *array_scale(const array *a, double s); array *array_mult(const array *a, const array *b); } // namespace SEAMS -#endif diff --git a/packages/seacas/libraries/aprepro_lib/apr_builtin.h b/packages/seacas/libraries/aprepro_lib/apr_builtin.h index 13d53b4f48db..d896cf29fb9b 100644 --- a/packages/seacas/libraries/aprepro_lib/apr_builtin.h +++ b/packages/seacas/libraries/aprepro_lib/apr_builtin.h @@ -5,8 +5,7 @@ * * See packages/seacas/LICENSE for details */ -#ifndef APR_BUILTIN_H -#define APR_BUILTIN_H +#pragma once #include @@ -156,5 +155,3 @@ namespace SEAMS { array *do_transpose(const array *a); array *do_array_from_string(const char *string, const char *delm); } // namespace SEAMS - -#endif diff --git a/packages/seacas/libraries/aprepro_lib/apr_getline_int.h b/packages/seacas/libraries/aprepro_lib/apr_getline_int.h index a14a817cc7a5..38badca8634d 100644 --- a/packages/seacas/libraries/aprepro_lib/apr_getline_int.h +++ b/packages/seacas/libraries/aprepro_lib/apr_getline_int.h @@ -1,11 +1,9 @@ -// Copyright(C) 1999-2021 National Technology & Engineering Solutions +// Copyright(C) 1999-2022 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. // // See packages/seacas/LICENSE for details - -#ifndef APREPRO_GETLINE_H -#define APREPRO_GETLINE_H +#pragma once #ifdef __cplusplus extern "C" { @@ -18,5 +16,3 @@ void ap_gl_histadd(char *); /* adds entries to hist */ #ifdef __cplusplus } /* close brackets on extern "C" declaration */ #endif - -#endif /* APREPRO_GETLINE_H */ diff --git a/packages/seacas/libraries/aprepro_lib/apr_symrec.h b/packages/seacas/libraries/aprepro_lib/apr_symrec.h index b3e569b362b6..f9fcc267f66a 100644 --- a/packages/seacas/libraries/aprepro_lib/apr_symrec.h +++ b/packages/seacas/libraries/aprepro_lib/apr_symrec.h @@ -1,4 +1,4 @@ -// Copyright(C) 1999-, 20212021 National Technology & Engineering Solutions +// Copyright(C) 1999-, 20212021, 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,9 +7,7 @@ // Might be good to add a callback function which would be called // when there was output -- In LexerOutput for example. Default // could be to just write to std::cout or to resultsOutput stringstream... - -#ifndef APREPRO_SYMREC_H -#define APREPRO_SYMREC_H +#pragma once #include #include @@ -90,4 +88,3 @@ namespace SEAMS { } }; } // namespace SEAMS -#endif diff --git a/packages/seacas/libraries/aprepro_lib/apr_tokenize.h b/packages/seacas/libraries/aprepro_lib/apr_tokenize.h index af1d3828e8db..969d47e9f12f 100644 --- a/packages/seacas/libraries/aprepro_lib/apr_tokenize.h +++ b/packages/seacas/libraries/aprepro_lib/apr_tokenize.h @@ -1,12 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ -#ifndef TOKENIZE_H -#define TOKENIZE_H +#pragma once #include #include @@ -18,4 +17,3 @@ namespace SEAMS { */ std::vector tokenize(const std::string &str, const std::string &separators); } // namespace SEAMS -#endif diff --git a/packages/seacas/libraries/aprepro_lib/apr_util.h b/packages/seacas/libraries/aprepro_lib/apr_util.h index 738775537dc4..09187fea651a 100644 --- a/packages/seacas/libraries/aprepro_lib/apr_util.h +++ b/packages/seacas/libraries/aprepro_lib/apr_util.h @@ -1,12 +1,11 @@ /* - * Copyright(C) 1999-2021 National Technology & Engineering Solutions + * Copyright(C) 1999-2022 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. * * See packages/seacas/LICENSE for details */ -#ifndef SEAMS_UTIL_H -#define SEAMS_UTIL_H +#pragma once #include "apr_symrec.h" #include "aprepro.h" @@ -31,4 +30,3 @@ namespace SEAMS { bool is_directory(const std::string &filepath); bool check_valid_var(const char *s); } // namespace SEAMS -#endif diff --git a/packages/seacas/libraries/aprepro_lib/aprepro.h b/packages/seacas/libraries/aprepro_lib/aprepro.h index 7bd994512f7e..1c63df90620b 100644 --- a/packages/seacas/libraries/aprepro_lib/aprepro.h +++ b/packages/seacas/libraries/aprepro_lib/aprepro.h @@ -7,9 +7,7 @@ // Might be good to add a callback function which would be called // when there was output -- In LexerOutput for example. Default // could be to just write to std::cout or to resultsOutput stringstream... - -#ifndef SEAMS_DRIVER_H -#define SEAMS_DRIVER_H +#pragma once #include #include @@ -271,5 +269,3 @@ namespace SEAMS { }; } // namespace SEAMS - -#endif // SEAMS_DRIVER_H diff --git a/packages/seacas/libraries/aprepro_lib/init_structs.h b/packages/seacas/libraries/aprepro_lib/init_structs.h index 49ae86a5b2e8..fa10e10af6bd 100644 --- a/packages/seacas/libraries/aprepro_lib/init_structs.h +++ b/packages/seacas/libraries/aprepro_lib/init_structs.h @@ -1,12 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ -#ifndef INIT_STRUCTS_H -#define INIT_STRUCTS_H +#pragma once namespace SEAMS { struct array; @@ -223,5 +222,3 @@ struct svar_init const char *vname; const char *value; }; - -#endif diff --git a/packages/seacas/libraries/chaco/internal/internal.h b/packages/seacas/libraries/chaco/internal/internal.h index 55878f6e1590..e9ee0b5a4f46 100644 --- a/packages/seacas/libraries/chaco/internal/internal.h +++ b/packages/seacas/libraries/chaco/internal/internal.h @@ -1,19 +1,16 @@ -#ifndef CHACO_INTERNAL_INTERNAL_H -#define CHACO_INTERNAL_INTERNAL_H - /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ /* Bidirectional list of integers. */ +#pragma once + struct bidint { int val; struct bidint *prev; struct bidint *next; }; - -#endif diff --git a/packages/seacas/libraries/chaco/main/chaco.h b/packages/seacas/libraries/chaco/main/chaco.h index b8bd5b4fecd6..cf8ba7bc2f8c 100644 --- a/packages/seacas/libraries/chaco/main/chaco.h +++ b/packages/seacas/libraries/chaco/main/chaco.h @@ -1,12 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ -#ifndef CHACO_H -#define CHACO_H +#pragma once /** * Calling Chaco from other programs. Throughout this document we have * assumed that Chaco is being used as a stand{alone program. However, @@ -170,14 +169,14 @@ extern "C" { #endif extern int INTER_FACE(int nvtxs, /**< number of vertices in full graph */ - int * start, /**< start of edge list for each vertex */ - int * adjacency, /**< edge list data */ - int * vwgts, /**< weights for all vertices */ + int *start, /**< start of edge list for each vertex */ + int *adjacency, /**< edge list data */ + int *vwgts, /**< weights for all vertices */ float *ewgts, /**< weights for all edges */ float *x, float *y, float *z, /**< coordinates for inertial method */ - char * outassignname, /**< name of assignment output file */ - char * outfilename, /**< output file name */ - int * assignment, /**< set number of each vtx (length n) */ + char *outassignname, /**< name of assignment output file */ + char *outfilename, /**< output file name */ + int *assignment, /**< set number of each vtx (length n) */ int architecture, /**< 0 => hypercube, d => d-dimensional mesh */ int ndims_tot, /**< total number of cube dimensions to divide */ int mesh_dims[3], /**< dimensions of mesh of processors */ @@ -200,5 +199,3 @@ extern int input_assign(FILE *, char *, int, int *); #ifdef __cplusplus } /* close brackets on extern "C" declaration */ #endif - -#endif diff --git a/packages/seacas/libraries/chaco/main/defs.h b/packages/seacas/libraries/chaco/main/defs.h index d15961c61960..bde4a08992a1 100644 --- a/packages/seacas/libraries/chaco/main/defs.h +++ b/packages/seacas/libraries/chaco/main/defs.h @@ -1,13 +1,12 @@ -#ifndef CHACO_MAIN_DEFS_H -#define CHACO_MAIN_DEFS_H - /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ +#pragma once + #include #include @@ -32,13 +31,11 @@ /* Define constants that are needed in various places */ #if defined(M_PI) -#define PI M_PI -#define TWOPI (2.0 * M_PI) +#define PI M_PI +#define TWOPI (2.0 * M_PI) #define HALFPI (0.5 * M_PI) #else -#define PI 3.141592653589793 -#define TWOPI 6.283185307179586 +#define PI 3.141592653589793 +#define TWOPI 6.283185307179586 #define HALFPI 1.570796326794896 #endif - -#endif diff --git a/packages/seacas/libraries/chaco/main/params.h b/packages/seacas/libraries/chaco/main/params.h index 199047893c6f..7f0abd23006b 100644 --- a/packages/seacas/libraries/chaco/main/params.h +++ b/packages/seacas/libraries/chaco/main/params.h @@ -1,17 +1,14 @@ -#ifndef CHACO_MAIN_PARAMS_H -#define CHACO_MAIN_PARAMS_H - /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ +#pragma once + #define NAME_LENGTH 256 /**< Maximum length of file name */ #define LINE_LENGTH 200 /**< Length of input files read at once */ #define MAXDIMS 3 /**< Most cuts allowed at one time */ #define MAXSETS 8 /**< 2^MAXDIMS */ - -#endif diff --git a/packages/seacas/libraries/chaco/main/structs.h b/packages/seacas/libraries/chaco/main/structs.h index 70120b8e6c2a..cc641cb7346d 100644 --- a/packages/seacas/libraries/chaco/main/structs.h +++ b/packages/seacas/libraries/chaco/main/structs.h @@ -1,20 +1,19 @@ -#ifndef CHACO_MAIN_STRUCTS_H -#define CHACO_MAIN_STRUCTS_H - /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ +#pragma once + /**< An array of these stores all the data for the graph/matrix. */ struct vtx_data { int vwgt; /**< weight of vertex */ int nedges; /**< number of neighbors of vertex in subgraph */ /**< Note: above always includes self-edge first */ - int * edges; /**< neighbor list in subgraph numbering scheme */ + int *edges; /**< neighbor list in subgraph numbering scheme */ float *ewgts; /**< weights of all the edges */ /**< Note: above 2 fields have self-edge first */ }; @@ -26,7 +25,7 @@ struct msg_data double dur; /**< duration of message */ double beg; /**< time at which message begins */ double end; /**< time at which message end */ - struct list * route; /**< linked list of ints stores message route */ + struct list *route; /**< linked list of ints stores message route */ struct msg_data *pntr; /**< pointer to next outgoing message from this set */ }; @@ -39,7 +38,7 @@ struct orthlink double betaji; /**< residual bound on good ritz pair */ double tau; /**< from orthogonality recursion */ double prevtau; /**< from orthogonality recursion */ - double * vec; /**< vector to orthogonalize against */ + double *vec; /**< vector to orthogonalize against */ struct orthlink *pntr; /**< pointer to next link */ }; @@ -52,7 +51,7 @@ struct orthlink_float double betaji; /**< residual bound on good ritz pair */ double tau; /**< from orthogonality recursion */ double prevtau; /**< from orthogonality recursion */ - float * vec; /**< vector to orthogonalize against */ + float *vec; /**< vector to orthogonalize against */ struct orthlink_float *pntr; /**< pointer to next link */ }; @@ -82,8 +81,8 @@ struct edgeslist /**< These store all the data needed to modify edges for connectivity. */ struct connect_data { - struct ilists * old_edges; /**< overwritten old edges */ - struct flists * old_ewgts; /**< overwritten old weights */ + struct ilists *old_edges; /**< overwritten old edges */ + struct flists *old_ewgts; /**< overwritten old weights */ struct edgeslist *new_edges; /**< list of new edges */ int old_nedges; /**< original number of edges in graph */ }; @@ -107,7 +106,7 @@ struct list struct lists { /**< linked list of lists */ - struct list * begin; /**< pointer to list */ + struct list *begin; /**< pointer to list */ struct lists *nextlist; /**< next list header */ }; @@ -125,14 +124,12 @@ struct ipairs struct ilists { /**< linked list of integer lists */ - int * list; + int *list; struct ilists *next; }; struct flists { /**< linked list of floating lists */ - float * list; + float *list; struct flists *next; }; - -#endif diff --git a/packages/seacas/libraries/chaco/refine_map/refine_map.h b/packages/seacas/libraries/chaco/refine_map/refine_map.h index 9a703b5503b3..33adc98f5eae 100644 --- a/packages/seacas/libraries/chaco/refine_map/refine_map.h +++ b/packages/seacas/libraries/chaco/refine_map/refine_map.h @@ -1,13 +1,12 @@ -#ifndef CHACO_REFINE_MAP_REFINE_MAP_H -#define CHACO_REFINE_MAP_REFINE_MAP_H - /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ +#pragma once + struct refine_vdata { float above; /* sum of edge weights pulling me higher */ @@ -23,5 +22,3 @@ struct refine_edata struct refine_edata *prev; /* pointer to previous guy in list */ struct refine_edata *next; /* pointer to next guy in list */ }; - -#endif diff --git a/packages/seacas/libraries/chaco/util/chaco_random.h b/packages/seacas/libraries/chaco/util/chaco_random.h index 2d1a9acdebbd..6f451c063e22 100644 --- a/packages/seacas/libraries/chaco/util/chaco_random.h +++ b/packages/seacas/libraries/chaco/util/chaco_random.h @@ -1,12 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ -#ifndef CHACO_UTIL_CHACO_RANDOM_H -#define CHACO_UTIL_CHACO_RANDOM_H +#pragma once #ifdef __cplusplus extern "C" { @@ -21,5 +20,3 @@ double rand_rect_port(void); #ifdef __cplusplus } /* close brackets on extern "C" declaration */ #endif - -#endif diff --git a/packages/seacas/libraries/chaco/util/smalloc.h b/packages/seacas/libraries/chaco/util/smalloc.h index fc78e7905bc4..a054f92326a6 100644 --- a/packages/seacas/libraries/chaco/util/smalloc.h +++ b/packages/seacas/libraries/chaco/util/smalloc.h @@ -1,13 +1,12 @@ -#ifndef CHACO_UTIL_SMALLOC_H -#define CHACO_UTIL_SMALLOC_H - /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ +#pragma once + #include /* Safe version of malloc. Does not initialize memory .*/ @@ -26,5 +25,3 @@ extern void *srealloc_ret(void *ptr, size_t n); /* Safe version of free. */ extern void sfree(void *ptr); - -#endif diff --git a/packages/seacas/libraries/exodus/cmake/exodus_config.h.in b/packages/seacas/libraries/exodus/cmake/exodus_config.h.in index e4dcd51f2765..c8e303978df1 100644 --- a/packages/seacas/libraries/exodus/cmake/exodus_config.h.in +++ b/packages/seacas/libraries/exodus/cmake/exodus_config.h.in @@ -1,7 +1,5 @@ -#ifndef EXODUS_CONFIG_H -#define EXODUS_CONFIG_H +#pragma once #cmakedefine EXODUS_THREADSAFE @SEACAS_DEPRECATED_DECLARATIONS@ -#endif diff --git a/packages/seacas/libraries/exodus/include/exodusII.h b/packages/seacas/libraries/exodus/include/exodusII.h index ce636683acf9..6fcf3cc9fadc 100644 --- a/packages/seacas/libraries/exodus/include/exodusII.h +++ b/packages/seacas/libraries/exodus/include/exodusII.h @@ -11,9 +11,7 @@ * exodusII.h - Exodus II API include file * *****************************************************************************/ - -#ifndef EXODUSII_H -#define EXODUSII_H +#pragma once #include "exodus_config.h" @@ -1828,5 +1826,3 @@ EXODUS_EXPORT int ex_get_idx(int exoid, /**< NetCDF/Exodus file ID #ifdef __cplusplus } /* close brackets on extern "C" declaration */ #endif - -#endif diff --git a/packages/seacas/libraries/exodus/include/exodusII_cfg.h.in b/packages/seacas/libraries/exodus/include/exodusII_cfg.h.in index adb788e2ddbb..f407c0ed7964 100644 --- a/packages/seacas/libraries/exodus/include/exodusII_cfg.h.in +++ b/packages/seacas/libraries/exodus/include/exodusII_cfg.h.in @@ -1,11 +1,9 @@ -# Copyright(C) 1999-2021 National Technology & Engineering Solutions +# Copyright(C) 1999-2022 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. # # See packages/seacas/LICENSE for details - -#ifndef __exodusII_cfg_h -#define __exodusII_cfg_h +#pragma once #cmakedefine EXODUSII_BUILD_SHARED_LIBS #if defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || \ @@ -20,5 +18,3 @@ #else # define EXODUS_EXPORT extern #endif - -#endif diff --git a/packages/seacas/libraries/exodus/include/exodusII_int.h b/packages/seacas/libraries/exodus/include/exodusII_int.h index cec2d7555938..af6e93bcac61 100644 --- a/packages/seacas/libraries/exodus/include/exodusII_int.h +++ b/packages/seacas/libraries/exodus/include/exodusII_int.h @@ -11,9 +11,7 @@ * exodusII_int.h - ExodusII header file for internal Exodus call use only * */ - -#ifndef EXODUSII_INT_H -#define EXODUSII_INT_H +#pragma once #include @@ -891,5 +889,3 @@ EXODUS_EXPORT int ex__default_max_name_length; #ifdef __cplusplus } #endif - -#endif diff --git a/packages/seacas/libraries/exodus/include/exodusII_par.h b/packages/seacas/libraries/exodus/include/exodusII_par.h index 5aa5420099e7..736959c05f2e 100644 --- a/packages/seacas/libraries/exodus/include/exodusII_par.h +++ b/packages/seacas/libraries/exodus/include/exodusII_par.h @@ -1,5 +1,5 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * @@ -9,14 +9,10 @@ * NOTE: Contents of this include file have been moved to exodusII.h * Retained here just for backward compatibility */ - -#ifndef EXODUS_II_PAR_HDR -#define EXODUS_II_PAR_HDR +#pragma once #include "exodusII.h" #if !defined(PARALLEL_AWARE_EXODUS) #error "Parallel-aware exodusII_par.h included in non-parallel context" #endif - -#endif diff --git a/packages/seacas/libraries/exodus/include/exodusII_test.h b/packages/seacas/libraries/exodus/include/exodusII_test.h index ce776a5a3e67..19624c5cedbf 100644 --- a/packages/seacas/libraries/exodus/include/exodusII_test.h +++ b/packages/seacas/libraries/exodus/include/exodusII_test.h @@ -1,12 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ -#ifndef __exodusII_test_h -#define __exodusII_test_h +#pragma once #include "exodusII.h" @@ -23,5 +22,3 @@ int cReadEdgeFace(int, char *[]); inline int CreateEdgeFace(int argc, char *argv[]) { return cCreateEdgeFace(argc, argv); } inline int ReadEdgeFace(int argc, char *argv[]) { return cReadEdgeFace(argc, argv); } - -#endif /* __exodusII_test_h */ diff --git a/packages/seacas/libraries/nemesis/ne_nemesisI.h b/packages/seacas/libraries/nemesis/ne_nemesisI.h index dc78c2fe4c68..9957e79452d5 100644 --- a/packages/seacas/libraries/nemesis/ne_nemesisI.h +++ b/packages/seacas/libraries/nemesis/ne_nemesisI.h @@ -1,5 +1,5 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * @@ -10,9 +10,7 @@ * This file contains prototypes for the functions found in the NEMESIS * library. ****************************************************************************/ - -#ifndef _NE_NEMESIS_H -#define _NE_NEMESIS_H +#pragma once #ifdef __cplusplus extern "C" { @@ -35,8 +33,8 @@ typedef void void_int; * Initial Information Routines *===========================================================================*/ extern int ne_get_init_info(int neid, /* NemesisI file ID */ - int * num_proc, /* Number of processors */ - int * num_proc_in_f, /* Number of procs in this file */ + int *num_proc, /* Number of processors */ + int *num_proc_in_f, /* Number of procs in this file */ char *ftype); extern int ne_put_init_info(int neid, /* NemesisI file ID */ @@ -143,8 +141,8 @@ extern int ne_get_n_side_set(int neid, /* NetCDF/Exodus f ex_entity_id side_set_id, /* Side-set ID to read */ int64_t start_side_num, /* Starting element number */ int64_t num_sides, /* Number of sides to read */ - void_int * side_set_elem_list, /* List of element IDs */ - void_int * side_set_side_list /* List of side IDs */ + void_int *side_set_elem_list, /* List of element IDs */ + void_int *side_set_side_list /* List of side IDs */ ); extern int ne_put_n_side_set(int neid, /* NetCDF/Exodus file ID */ @@ -159,21 +157,21 @@ extern int ne_get_n_side_set_df(int neid, /* NetCDF/Exodus fil ex_entity_id side_set_id, /* Side-set ID */ int64_t start_num, /* Starting df number */ int64_t num_df_to_get, /* Number of df's to read */ - void * side_set_df /* Distribution factors */ + void *side_set_df /* Distribution factors */ ); extern int ne_put_n_side_set_df(int neid, /* NetCDF/Exodus file ID */ ex_entity_id side_set_id, /* Side-set ID */ int64_t start_num, /* Starting df number */ int64_t num_df_to_get, /* Number of df's to write */ - void * side_set_df /* Distribution factors */ + void *side_set_df /* Distribution factors */ ); extern int ne_get_n_node_set(int neid, /* NetCDF/Exodus file ID */ ex_entity_id node_set_id, /* Node set ID */ int64_t start_node_num, /* Node index to start reading at */ int64_t num_node, /* Number of nodes to read */ - void_int * node_set_node_list /* List of nodes in node set */ + void_int *node_set_node_list /* List of nodes in node set */ ); extern int ne_put_n_node_set(int neid, /* NetCDF/Exodus file ID */ @@ -187,37 +185,37 @@ extern int ne_get_n_node_set_df(int neid, /* NetCDF/Exodus fil ex_entity_id node_set_id, /* Node-set ID */ int64_t start_num, /* Starting df number */ int64_t num_df_to_get, /* Number of df's to read */ - void * node_set_df /* Distribution factors */ + void *node_set_df /* Distribution factors */ ); extern int ne_put_n_node_set_df(int neid, /* NetCDF/Exodus file ID */ ex_entity_id node_set_id, /* Node-set ID */ int64_t start_num, /* Starting df number */ int64_t num_df_to_get, /* Number of df's to write */ - void * node_set_df /* Distribution factors */ + void *node_set_df /* Distribution factors */ ); extern int ne_get_n_coord(int neid, /* NetCDF/Exodus file ID */ int64_t start_node_num, /* Starting position to read from */ int64_t num_nodes, /* Number of coords to read */ - void * x_coor, /* Vector of X coordinates */ - void * y_coor, /* Vector of Y coordinates */ - void * z_coor /* Vector of Z coordinates */ + void *x_coor, /* Vector of X coordinates */ + void *y_coor, /* Vector of Y coordinates */ + void *z_coor /* Vector of Z coordinates */ ); extern int ne_put_n_coord(int neid, /* NetCDF/Exodus file ID */ int64_t start_node_num, /* Starting position to write to */ int64_t num_nodes, /* Number of coords to write */ - void * x_coor, /* Vector of X coordinates */ - void * y_coor, /* Vector of Y coordinates */ - void * z_coor /* Vector of Z coordinates */ + void *x_coor, /* Vector of X coordinates */ + void *y_coor, /* Vector of Y coordinates */ + void *z_coor /* Vector of Z coordinates */ ); extern int ne_get_n_elem_conn(int neid, /* NetCDF/Exodus file ID */ ex_entity_id elem_blk_id, /* Element block ID */ int64_t start_elem_num, /* Starting position to read from */ int64_t num_elems, /* Number of elements to read */ - void_int * connect /* Connectivity vector */ + void_int *connect /* Connectivity vector */ ); extern int ne_put_n_elem_conn(int neid, /* NetCDF/Exodus file ID */ @@ -231,19 +229,19 @@ extern int ne_get_n_elem_attr(int neid, /* NetCDF/Exodus file ex_entity_id elem_blk_id, /* Element block ID */ int64_t start_elem_num, /* Starting position to read from */ int64_t num_elems, /* Number of elements to read */ - void * attrib /* Attribute */ + void *attrib /* Attribute */ ); extern int ne_put_n_elem_attr(int neid, /* NetCDF/Exodus file ID */ ex_entity_id elem_blk_id, /* Element block ID */ int64_t start_elem_num, /* Starting position to write to */ int64_t num_elems, /* Number of elements to write */ - void * attrib /* Attribute */ + void *attrib /* Attribute */ ); extern int ne_get_elem_type(int neid, /* NetCDF/Exodus file ID */ ex_entity_id elem_blk_id, /* Element block ID */ - char * elem_type /* The name of the element type */ + char *elem_type /* The name of the element type */ ); /*============================================================================= @@ -256,7 +254,7 @@ extern int ne_get_n_elem_var(int neid, /* NetCDF/Exodus fi int64_t num_elem_this_blk, /* number of elements in block */ int64_t start_elem_num, /* Starting position for read */ int64_t num_elem, /* Number of elements to read */ - void * elem_var_vals /* variable values */ + void *elem_var_vals /* variable values */ ); extern int ne_put_elem_var_slab(int neid, /* NetCDF/Exodus file ID */ @@ -265,7 +263,7 @@ extern int ne_put_elem_var_slab(int neid, /* NetCDF/Exodus fi ex_entity_id elem_blk_id, /* elemental block id */ int64_t start_pos, /* Starting position to write to */ int64_t num_vals, /* Number of elements to write */ - void * elem_var_vals /* variable values */ + void *elem_var_vals /* variable values */ ); extern int ne_get_n_nodal_var(int neid, /* NetCDF/Exodus file ID */ @@ -273,7 +271,7 @@ extern int ne_get_n_nodal_var(int neid, /* NetCDF/Exodus file ID int nodal_var_index, /* index of desired nodal var */ int64_t start_node_num, /* starting node number */ int64_t num_nodes, /* number of nodes to read */ - void * nodal_vars /* array of nodal var values */ + void *nodal_vars /* array of nodal var values */ ); extern int ne_put_nodal_var_slab(int neid, /* NetCDF/Exodus file ID */ @@ -281,7 +279,7 @@ extern int ne_put_nodal_var_slab(int neid, /* NetCDF/Exodus file int nodal_var_index, /* Nodal variable index */ int64_t start_pos, /* Start position for write */ int64_t num_vals, /* Number of nodal variables */ - void * nodal_var_vals /* Nodal variable values */ + void *nodal_var_vals /* Nodal variable values */ ); /*============================================================================= @@ -370,31 +368,31 @@ extern int ne_put_cmap_params_cc(int neid, /* NetCDF/Exodus extern int ne_get_node_cmap(int neid, /* NetCDF/Exodus file ID */ ex_entity_id map_id, /* Map ID */ - void_int * node_ids, /* FEM node IDs */ - void_int * proc_ids, /* Processor IDs */ + void_int *node_ids, /* FEM node IDs */ + void_int *proc_ids, /* Processor IDs */ int processor /* This processor ID */ ); extern int ne_put_node_cmap(int neid, /* NetCDF/Exodus file ID */ ex_entity_id map_id, /* Nodal comm map ID */ - void_int * node_ids, /* FEM node IDs */ - void_int * proc_ids, /* Processor IDs */ + void_int *node_ids, /* FEM node IDs */ + void_int *proc_ids, /* Processor IDs */ int processor /* This processor ID */ ); extern int ne_get_elem_cmap(int neid, /* NetCDF/Exodus file ID */ ex_entity_id map_id, /* Elemental comm map ID */ - void_int * elem_ids, /* Element IDs */ - void_int * side_ids, /* Element side IDs */ - void_int * proc_ids, /* Processor IDs */ + void_int *elem_ids, /* Element IDs */ + void_int *side_ids, /* Element side IDs */ + void_int *proc_ids, /* Processor IDs */ int processor /* This processor ID */ ); extern int ne_put_elem_cmap(int neid, /* NetCDF/Exodus file ID */ ex_entity_id map_id, /* Elemental comm map ID */ - void_int * elem_ids, /* Vector of element IDs */ - void_int * side_ids, /* Vector of side IDs */ - void_int * proc_ids, /* Vector of processor IDs */ + void_int *elem_ids, /* Vector of element IDs */ + void_int *side_ids, /* Vector of side IDs */ + void_int *proc_ids, /* Vector of processor IDs */ int processor /* This processor ID */ ); @@ -403,12 +401,10 @@ extern int ne_put_elem_cmap(int neid, /* NetCDF/Exodus file ID */ */ int ne_get_idx(int neid, /* NetCDF/Exodus file ID */ const char *ne_var_name, /* Nemesis index variable name */ - int64_t * index, /* array of length 2 to hold results */ + int64_t *index, /* array of length 2 to hold results */ int pos /* position of this proc/cmap in index */ ); #ifdef __cplusplus } #endif - -#endif /* _NE_NEMESIS_H */ diff --git a/packages/seacas/libraries/nemesis/nemesis_cfg.h.in b/packages/seacas/libraries/nemesis/nemesis_cfg.h.in index 37b04f5cdb2d..b3a53a76479f 100755 --- a/packages/seacas/libraries/nemesis/nemesis_cfg.h.in +++ b/packages/seacas/libraries/nemesis/nemesis_cfg.h.in @@ -1,11 +1,9 @@ -# Copyright(C) 1999-2020 National Technology & Engineering Solutions +# Copyright(C) 1999-2020, 2022 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. # # See packages/seacas/LICENSE for details - -#ifndef __nemesis_cfg_h -#define __nemesis_cfg_h +#pragma once #define NEMESIS_VERSION_MAJOR @NEMESIS_VERSION_MAJOR@ #define NEMESIS_VERSION_MINOR @NEMESIS_VERSION_MINOR@ @@ -26,5 +24,3 @@ #else # define NEMESIS_EXPORT extern #endif - -#endif diff --git a/packages/seacas/libraries/supes/ext_lib/getline_int.h b/packages/seacas/libraries/supes/ext_lib/getline_int.h index dfa51b41dd82..374035f8c236 100644 --- a/packages/seacas/libraries/supes/ext_lib/getline_int.h +++ b/packages/seacas/libraries/supes/ext_lib/getline_int.h @@ -1,18 +1,14 @@ /* - * Copyright(C) 1999-2021 National Technology & Engineering Solutions + * Copyright(C) 1999-2022 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. * * See packages/seacas/LICENSE for details */ - -#ifndef GETLINE_H -#define GETLINE_H +#pragma once #define GL_BUF_SIZE 1024 char *getline_int(char *); /* read a line of input */ void gl_setwidth(int); /* specify width of screen */ void gl_histadd(char *); /* adds entries to hist */ - -#endif /* GETLINE_H */ diff --git a/packages/seacas/libraries/suplib_c/XGetopt.h b/packages/seacas/libraries/suplib_c/XGetopt.h index 31867cd8e334..eb33d8b48973 100644 --- a/packages/seacas/libraries/suplib_c/XGetopt.h +++ b/packages/seacas/libraries/suplib_c/XGetopt.h @@ -11,9 +11,7 @@ // damage or loss of business that this software may cause. // /////////////////////////////////////////////////////////////////////////////// - -#ifndef XGETOPT_H -#define XGETOPT_H +#pragma once #ifdef __cplusplus extern "C" { @@ -27,5 +25,3 @@ int getopt(int argc, char *const argv[], const char *optstring); #ifdef __cplusplus } /* close brackets on extern "C" declaration */ #endif - -#endif // XGETOPT_H diff --git a/packages/seacas/libraries/suplib_c/add_to_log.h b/packages/seacas/libraries/suplib_c/add_to_log.h index cd66740ab4cd..6db83e5ef39d 100644 --- a/packages/seacas/libraries/suplib_c/add_to_log.h +++ b/packages/seacas/libraries/suplib_c/add_to_log.h @@ -1,12 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ -#ifndef ADD_TO_LOG_H -#define ADD_TO_LOG_H +#pragma once #ifdef __cplusplus extern "C" { @@ -17,5 +16,3 @@ extern void add_to_log(const char *my_name, double elapsed); #ifdef __cplusplus } /* close brackets on extern "C" declaration */ #endif - -#endif diff --git a/packages/seacas/libraries/suplib_c/adler.h b/packages/seacas/libraries/suplib_c/adler.h index b6352a85d840..971de5aa7803 100644 --- a/packages/seacas/libraries/suplib_c/adler.h +++ b/packages/seacas/libraries/suplib_c/adler.h @@ -1,12 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ -#ifndef ADLER_H -#define ADLER_H +#pragma once #include #ifdef __cplusplus @@ -16,4 +15,3 @@ size_t adler(size_t adler, const void *vbuf, size_t len); #ifdef __cplusplus } /* close brackets on extern "C" declaration */ #endif -#endif diff --git a/packages/seacas/libraries/suplib_c/open_file_limit.h b/packages/seacas/libraries/suplib_c/open_file_limit.h index bd440371d4b0..fcde5d715d0d 100644 --- a/packages/seacas/libraries/suplib_c/open_file_limit.h +++ b/packages/seacas/libraries/suplib_c/open_file_limit.h @@ -1,11 +1,9 @@ -// Copyright(C) 1999-2021 National Technology & Engineering Solutions +// Copyright(C) 1999-2022 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. // // See packages/seacas/LICENSE for details - -#ifndef SUPLIB_OPEN_FILE_LIMIT_H -#define SUPLIB_OPEN_FILE_LIMIT_H +#pragma once #ifdef __cplusplus extern "C" { @@ -16,4 +14,3 @@ int open_file_limit(); #ifdef __cplusplus } /* close brackets on extern "C" declaration */ #endif -#endif diff --git a/packages/seacas/libraries/suplib_cpp/FileInfo.h b/packages/seacas/libraries/suplib_cpp/FileInfo.h index 0909c2f2c5f7..1cdbab174ed3 100644 --- a/packages/seacas/libraries/suplib_cpp/FileInfo.h +++ b/packages/seacas/libraries/suplib_cpp/FileInfo.h @@ -1,11 +1,9 @@ -// Copyright(C) 1999-2020 National Technology & Engineering Solutions +// Copyright(C) 1999-2020, 2022 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. // // See packages/seacas/LICENSE for details - -#ifndef FileInfo_h -#define FileInfo_h +#pragma once #include // for time_t #include // for string, operator!=, etc @@ -84,4 +82,3 @@ class FileInfo bool exists_{false}; ///< this is used frequently, check on creation bool readable_{false}; ///< this is used frequently, check on creation }; -#endif diff --git a/packages/seacas/libraries/suplib_cpp/GetLongOpt.h b/packages/seacas/libraries/suplib_cpp/GetLongOpt.h index 0f28e8827b24..6f1ca175feb0 100644 --- a/packages/seacas/libraries/suplib_cpp/GetLongOpt.h +++ b/packages/seacas/libraries/suplib_cpp/GetLongOpt.h @@ -6,9 +6,7 @@ * See packages/seacas/LICENSE for details */ /* S Manoharan. Advanced Computer Research Institute. Lyon. France */ - -#ifndef _GetLongOption_h_ -#define _GetLongOption_h_ +#pragma once #include #include @@ -110,4 +108,3 @@ class GetLongOption return value; } }; -#endif /* _GetLongOption_h_ */ diff --git a/packages/seacas/libraries/suplib_cpp/SL_tokenize.h b/packages/seacas/libraries/suplib_cpp/SL_tokenize.h index 68d7518eec04..e251ea3e8462 100644 --- a/packages/seacas/libraries/suplib_cpp/SL_tokenize.h +++ b/packages/seacas/libraries/suplib_cpp/SL_tokenize.h @@ -1,12 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ -#ifndef TOKENIZE_H -#define TOKENIZE_H +#pragma once #include #include @@ -26,5 +25,3 @@ namespace SLIB { std::vector tokenize(const std::string &str, const std::string &separators, bool allow_empty_token = false); } // namespace SLIB - -#endif diff --git a/packages/seacas/libraries/suplib_cpp/copy_string_cpp.h b/packages/seacas/libraries/suplib_cpp/copy_string_cpp.h index 3be5edcae336..c9e896207c3d 100644 --- a/packages/seacas/libraries/suplib_cpp/copy_string_cpp.h +++ b/packages/seacas/libraries/suplib_cpp/copy_string_cpp.h @@ -1,12 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ -#ifndef copy_string_cpp_h -#define copy_string_cpp_h +#pragma once #include #include @@ -26,4 +25,3 @@ inline void copy_string(char *dest, const std::string &source, size_t elements) { copy_string(dest, source.c_str(), elements); } -#endif diff --git a/packages/seacas/libraries/suplib_cpp/copyright.h b/packages/seacas/libraries/suplib_cpp/copyright.h index f2e615d53ef1..e43ba1885593 100644 --- a/packages/seacas/libraries/suplib_cpp/copyright.h +++ b/packages/seacas/libraries/suplib_cpp/copyright.h @@ -1,12 +1,10 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ -#ifndef SUPLIB_COPYRIGHT_H -#define SUPLIB_COPYRIGHT_H +#pragma once #include std::string copyright(const std::string &year_range); -#endif diff --git a/packages/seacas/libraries/suplib_cpp/glob.h b/packages/seacas/libraries/suplib_cpp/glob.h index 87de94787ddb..69e3025f6dcb 100644 --- a/packages/seacas/libraries/suplib_cpp/glob.h +++ b/packages/seacas/libraries/suplib_cpp/glob.h @@ -436,11 +436,7 @@ namespace glob { case Type::AT: case Type::ANY: case Type::STAR: - case Type::PLUS: { - std::tie(r, std::ignore) = BasicCheck(str, pos); - break; - } - + case Type::PLUS: case Type::NEG: { std::tie(r, std::ignore) = BasicCheck(str, pos); break; diff --git a/packages/seacas/libraries/suplib_cpp/hwm.h b/packages/seacas/libraries/suplib_cpp/hwm.h index 918205346dde..1271b7f0ca1d 100644 --- a/packages/seacas/libraries/suplib_cpp/hwm.h +++ b/packages/seacas/libraries/suplib_cpp/hwm.h @@ -1,11 +1,8 @@ -// Copyright(C) 1999-2021 National Technology & Engineering Solutions +// Copyright(C) 1999-2022 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. // // See packages/seacas/LICENSE for details -#ifndef HWM_H -#define HWM_H +#pragma once size_t get_hwm_memory_info(); - -#endif diff --git a/packages/seacas/libraries/suplib_cpp/iqsort.h b/packages/seacas/libraries/suplib_cpp/iqsort.h index 963f1a15f62b..b9c68f317e4b 100644 --- a/packages/seacas/libraries/suplib_cpp/iqsort.h +++ b/packages/seacas/libraries/suplib_cpp/iqsort.h @@ -1,11 +1,9 @@ -// Copyright(C) 1999-2020 National Technology & Engineering Solutions +// Copyright(C) 1999-2020, 2022 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. // // See packages/seacas/LICENSE for details -#ifndef IQSORT_H -#define IQSORT_H +#pragma once #include template void index_qsort(const T v[], INT iv[], size_t N); -#endif diff --git a/packages/seacas/libraries/suplib_cpp/pdqsort.h b/packages/seacas/libraries/suplib_cpp/pdqsort.h index 1a54a03c474a..cb48087de1cd 100644 --- a/packages/seacas/libraries/suplib_cpp/pdqsort.h +++ b/packages/seacas/libraries/suplib_cpp/pdqsort.h @@ -1,7 +1,7 @@ /* pdqsort.h - Pattern-defeating quicksort. - Copyright (c) 2021 Orson Peters + Copyright (c) 2021, 2022 Orson Peters 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. @@ -18,9 +18,7 @@ 3. This notice may not be removed or altered from any source distribution. */ - -#ifndef PDQSORT_H -#define PDQSORT_H +#pragma once #include #include @@ -610,5 +608,3 @@ template inline void pdqsort_branchless(Iter begin, Iter end) } #undef PDQSORT_PREFER_MOVE - -#endif diff --git a/packages/seacas/libraries/suplib_cpp/scopeguard.h b/packages/seacas/libraries/suplib_cpp/scopeguard.h index 6c5c75f7f384..21604f05c8be 100644 --- a/packages/seacas/libraries/suplib_cpp/scopeguard.h +++ b/packages/seacas/libraries/suplib_cpp/scopeguard.h @@ -1,12 +1,11 @@ /* - * Copyright(C) 1999-2021 National Technology & Engineering Solutions + * Copyright(C) 1999-2022 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. * * See packages/seacas/LICENSE for details */ -#ifndef SCOPEGUARD_H_ -#define SCOPEGUARD_H_ +#pragma once /* Scopeguard, by Andrei Alexandrescu and Petru Marginean, December 2000. @@ -269,5 +268,3 @@ MakeGuard(Ret (Obj2::*memFun)(P1a, P2a), Obj1 *obj, P1b p1, P2b p2) #define ON_BLOCK_EXIT ScopeGuard ANONYMOUS_VARIABLE(scopeGuard) = MakeGuard #define ON_BLOCK_EXIT_OBJ ScopeGuard ANONYMOUS_VARIABLE(scopeGuard) = MakeObjGuard - -#endif // SCOPEGUARD_H_ diff --git a/packages/seacas/libraries/suplib_cpp/sys_info.h b/packages/seacas/libraries/suplib_cpp/sys_info.h index 05ad0392c9b9..1c8f2393fc49 100644 --- a/packages/seacas/libraries/suplib_cpp/sys_info.h +++ b/packages/seacas/libraries/suplib_cpp/sys_info.h @@ -1,14 +1,10 @@ -// Copyright(C) 1999-2021 National Technology & Engineering Solutions +// Copyright(C) 1999-2022 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. // // See packages/seacas/LICENSE for details - -#ifndef SUPLIB_C_SYS_INFO_H -#define SUPLIB_C_SYS_INFO_H +#pragma once #include std::string sys_info(const std::string &codename); - -#endif diff --git a/packages/seacas/libraries/suplib_cpp/time_stamp.h b/packages/seacas/libraries/suplib_cpp/time_stamp.h index 81d4e167cfd9..ffb6efd7a045 100644 --- a/packages/seacas/libraries/suplib_cpp/time_stamp.h +++ b/packages/seacas/libraries/suplib_cpp/time_stamp.h @@ -1,13 +1,9 @@ -// Copyright(C) 1999-2021 National Technology & Engineering Solutions +// Copyright(C) 1999-2022 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. // // See packages/seacas/LICENSE for details - -#ifndef SUPLIB_CPP_TIME_STAMP_H -#define SUPLIB_CPP_TIME_STAMP_H +#pragma once #include std::string time_stamp(const std::string &format); - -#endif diff --git a/packages/seacas/libraries/suplib_cpp/to_string.h b/packages/seacas/libraries/suplib_cpp/to_string.h deleted file mode 100644 index 9ab96017e690..000000000000 --- a/packages/seacas/libraries/suplib_cpp/to_string.h +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright(C) 1999-2020 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. -// -// See packages/seacas/LICENSE for details -#ifndef TO_STRING_H -#define TO_STRING_H - -#include -std::string to_string(int t) { return std::to_string(t); } - -#endif diff --git a/packages/seacas/libraries/svdi/cgi/cdrcom.h b/packages/seacas/libraries/svdi/cgi/cdrcom.h index 44cccccbb6ec..31dd728aa808 100644 --- a/packages/seacas/libraries/svdi/cgi/cdrcom.h +++ b/packages/seacas/libraries/svdi/cgi/cdrcom.h @@ -1,5 +1,5 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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,8 +8,7 @@ /* cdrcom.h - external structure is used to hook up with fortran * common block /cdrcom/ */ -#ifndef CDRCOM_H -#define CDRCOM_H +#pragma once extern struct cdr { @@ -23,5 +22,3 @@ extern struct cdr int KBAUD; int KCOMTP; } cdrcom; - -#endif diff --git a/packages/seacas/libraries/svdi/cgi/cgi.h b/packages/seacas/libraries/svdi/cgi/cgi.h index c55e8b88870a..85975f123339 100644 --- a/packages/seacas/libraries/svdi/cgi/cgi.h +++ b/packages/seacas/libraries/svdi/cgi/cgi.h @@ -19,9 +19,7 @@ /* type and constant declarations */ /* */ /******************************************************************************/ - -#ifndef CGI_H -#define CGI_H +#pragma once #include "fortyp.h" #include "stdtyp.h" @@ -160,4 +158,3 @@ typedef enum csm_enum { dc_csm, ic_csm } csm_enum; void cgi_def_ini(void); /* end cgi.h */ -#endif diff --git a/packages/seacas/libraries/svdi/cgi/cgidef.h b/packages/seacas/libraries/svdi/cgi/cgidef.h index d10ef2643e02..cc98a4497ce1 100644 --- a/packages/seacas/libraries/svdi/cgi/cgidef.h +++ b/packages/seacas/libraries/svdi/cgi/cgidef.h @@ -1,5 +1,5 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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,9 +7,7 @@ */ /* cgidef.h CGI enumerated type definitions for C programs */ - -#ifndef CGIDEF_H -#define CGIDEF_H +#pragma once /* escape enumerations */ #define XEMFNM -28372 /* metafile name */ @@ -19,7 +17,7 @@ #define XEBELL -1003 /* ring the bell */ /* used in many places */ -#define CNO 0 +#define CNO 0 #define CYES 1 /* force clear viewsurface (argument of CPDS) */ @@ -28,7 +26,7 @@ /* clip indicator */ #define COFF 0 -#define CON 1 +#define CON 1 /* drawing surface clip indicator */ #define CDCOFF 0 @@ -36,7 +34,7 @@ #define CVPORT 2 /* error handling flag (arg of CERHCT) */ -#define CEHON 0 +#define CEHON 0 #define CEHROF 1 #define CEHDOF 2 @@ -50,8 +48,8 @@ #define CSOFT 1 /* display type (arg of CQD) */ -#define CVECT 0 -#define CRAST 1 +#define CVECT 0 +#define CRAST 1 #define COTHER 2 /* dynamic modification (arg of CQD, etc) */ @@ -60,11 +58,11 @@ #define CIMM 2 /* pixel location relative to coordinates (arg of CQD) */ -#define CPXON 0 +#define CPXON 0 #define CPXBET 1 /* support indicator */ -#define CSNO 0 +#define CSNO 0 #define CSYES 1 #define CSUNR 2 @@ -83,20 +81,20 @@ /* text precision */ #define CSTRNG 0 -#define CCHAR 1 +#define CCHAR 1 #define CSTROK 2 /* text path */ #define CTPRIT 0 #define CTPLFT 1 -#define CTPUP 2 +#define CTPUP 2 #define CTPDWN 3 /* text horizontal alignment */ #define CTALFT 0 #define CTACTR 1 #define CTARIT 2 -#define CTANH 3 +#define CTANH 3 #define CTACOH 4 /* text vertical alignment */ @@ -105,7 +103,7 @@ #define CTAHAF 2 #define CTABAS 3 #define CTABOT 4 -#define CTANV 5 +#define CTANV 5 #define CTACOV 6 /* interior style */ @@ -140,38 +138,38 @@ #define CLOCAL 2 /* pattern transformation support */ -#define CPTNO 0 +#define CPTNO 0 #define CPTUNS 1 #define CPTFUL 2 /* color selection mode availability (arg of CQC) */ -#define CCLRI 0 +#define CCLRI 0 #define CCLRID 1 /* color overwrite capability (arg of CQC) */ -#define CCSUB 0 -#define CCADD 1 -#define CCREP 2 +#define CCSUB 0 +#define CCADD 1 +#define CCREP 2 #define CCDMOD 3 /* response validity (arg of most CQxxxx routines) */ #define CINVAL 0 -#define CVAL 1 +#define CVAL 1 /* input class */ #define CLOCAT 0 /* #define CSTROK 1 */ #define CVALUA 2 #define CCHOIC 3 -#define CPICK 4 +#define CPICK 4 /* #define CSTRNG 5 */ #define CRASTR 6 -#define CGEN 7 +#define CGEN 7 /* request status */ #define CTRIGR 0 #define CBREAK 1 -#define CTIME 2 +#define CTIME 2 #define CMEASC 3 /* input device state */ @@ -189,11 +187,9 @@ /* action required flag */ #define CNOACT 0 -#define CACT 1 +#define CACT 1 /* pixel validity flag (arg of CGPXA) */ #define CVNONE 0 -#define CVALL 1 +#define CVALL 1 #define CVSOME 2 - -#endif diff --git a/packages/seacas/libraries/svdi/cgi/data_def.h b/packages/seacas/libraries/svdi/cgi/data_def.h index 03ee959dab66..c5e35f29cdf7 100644 --- a/packages/seacas/libraries/svdi/cgi/data_def.h +++ b/packages/seacas/libraries/svdi/cgi/data_def.h @@ -1,12 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ -#ifndef DATA_DEF_H -#define DATA_DEF_H +#pragma once /* ------------------------------------------------------------*/ /* >> DATA STRUCTURE DEFINITIONS */ /*-------------------------------------------------------------*/ @@ -219,5 +218,3 @@ typedef struct float color_array[256][3]; /* color values */ } dev_descrip_table; - -#endif diff --git a/packages/seacas/libraries/svdi/cgi/devid.h b/packages/seacas/libraries/svdi/cgi/devid.h index 570ca54662ec..3a9885eb7385 100644 --- a/packages/seacas/libraries/svdi/cgi/devid.h +++ b/packages/seacas/libraries/svdi/cgi/devid.h @@ -1,5 +1,5 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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,8 +8,7 @@ /* devid.h - these functions are used to map SVDI device code numbers * to device code character strings and vice versa */ -#ifndef DEVID_H -#define DEVID_H +#pragma once struct device_ids { @@ -56,5 +55,3 @@ static char *get_devid_char(float number) return (0); } #endif - -#endif diff --git a/packages/seacas/libraries/svdi/cgi/fortyp.h b/packages/seacas/libraries/svdi/cgi/fortyp.h index eab3f3f9068f..b3cd042ac5e7 100644 --- a/packages/seacas/libraries/svdi/cgi/fortyp.h +++ b/packages/seacas/libraries/svdi/cgi/fortyp.h @@ -1,16 +1,12 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ - -#ifndef FORTYP_H -#define FORTYP_H +#pragma once /* typedef long f_integer; */ typedef int f_integer; typedef float f_real; - -#endif diff --git a/packages/seacas/libraries/svdi/cgi/ifdefx.h b/packages/seacas/libraries/svdi/cgi/ifdefx.h index 46b5d7c0ab5e..dfe0ce3557e1 100644 --- a/packages/seacas/libraries/svdi/cgi/ifdefx.h +++ b/packages/seacas/libraries/svdi/cgi/ifdefx.h @@ -1,5 +1,5 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * @@ -19,18 +19,16 @@ * * This include file is used by MDCGI.C and all CGISxxx.C files. */ - -#ifndef IFDEFX_H -#define IFDEFX_H +#pragma once #if defined(ADDC_) #endif #if !defined(CRA) && !defined(ADDC_) && !defined(COUGAR) -#define xcoon_ xcoon +#define xcoon_ xcoon #define xcooff_ xcooff -#define xcact_ xcact +#define xcact_ xcact #define xcdact_ xcdact -#define xcsol_ xcsol +#define xcsol_ xcsol #define cgia60_ cgia60 #define cgi16c_ cgi16c #define cgi35c_ cgi35c @@ -54,11 +52,11 @@ #define cgifsq_ cgifsq #endif #if defined(CRA) -#define xcoon_ XCOON +#define xcoon_ XCOON #define xcooff_ XCOOFF -#define xcact_ XCACT +#define xcact_ XCACT #define xcdact_ XCDACT -#define xcsol_ XCSOL +#define xcsol_ XCSOL #define cgi16c_ CGI16C #define cgi35c_ CGI35C #define cgi48l_ CGI48L @@ -81,5 +79,3 @@ #define cgif3c_ CGIF3C #define cgifsq_ CGIFSQ #endif - -#endif diff --git a/packages/seacas/libraries/svdi/cgi/mdcgi.h b/packages/seacas/libraries/svdi/cgi/mdcgi.h index a97df19cc3bd..cc0b0e4cded9 100644 --- a/packages/seacas/libraries/svdi/cgi/mdcgi.h +++ b/packages/seacas/libraries/svdi/cgi/mdcgi.h @@ -5,11 +5,8 @@ * * See packages/seacas/LICENSE for details */ - -#ifndef MDCGI_H -#define MDCGI_H +#pragma once #include "cgi.h" // for device_struct, MAX_DEVICES, etc void xcoon_(anything **surface_id); /* which surface to turn output on for*/ void xcact_(void (*device_fn)(anything **, int, anything **), anything **p_surface_id); -#endif diff --git a/packages/seacas/libraries/svdi/cgi/sdcgi.h b/packages/seacas/libraries/svdi/cgi/sdcgi.h index cdfdb3b7f4db..ffc4eefda9d4 100644 --- a/packages/seacas/libraries/svdi/cgi/sdcgi.h +++ b/packages/seacas/libraries/svdi/cgi/sdcgi.h @@ -1,13 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ - -#ifndef SDCGI_H -#define SDCGI_H +#pragma once #include "fortyp.h" @@ -102,4 +100,3 @@ void crqlc_(f_integer *idev, f_real *timeout, f_integer *vstat, f_integer *rstat void cili_(f_integer *iclass, f_integer *idev); void cpxa_(f_real *x, f_real *y, f_integer *nx, f_integer *ny, f_integer *xscal, f_integer *yscal, f_integer *xdir, f_integer *ydir, f_integer *pxclrs); -#endif diff --git a/packages/seacas/libraries/svdi/cgi/stdtyp.h b/packages/seacas/libraries/svdi/cgi/stdtyp.h index 2f428f861f56..c0c4064ef137 100644 --- a/packages/seacas/libraries/svdi/cgi/stdtyp.h +++ b/packages/seacas/libraries/svdi/cgi/stdtyp.h @@ -1,5 +1,5 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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,8 +8,7 @@ /* stdtyp.h - standard types, from Plum, "C Programming Guidelines", p 17 * adapted to Sun3 Unix by Pat McGee, C6 */ -#ifndef STDTYP_H -#define STDTYP_H +#pragma once typedef char tiny; /* 8+ bit signed number */ typedef unsigned char utiny; /* 8+ bit unsigned number */ @@ -18,5 +17,3 @@ typedef short bits; /* 16+ bit thing for bit manipulation */ typedef long lbits; /* 32+ bit thing for bit manipulation */ typedef char anything; /* type to hold a pointer to anything */ - -#endif diff --git a/packages/seacas/libraries/svdi/cgi/svdi.h b/packages/seacas/libraries/svdi/cgi/svdi.h index dd0466722cc4..1779ef8a5f38 100644 --- a/packages/seacas/libraries/svdi/cgi/svdi.h +++ b/packages/seacas/libraries/svdi/cgi/svdi.h @@ -1,13 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ - -#ifndef SVDI_H -#define SVDI_H +#pragma once void vbstmp(int *); void vdakgl(int *charac, float *x, float *y); void vdbell(void); @@ -41,4 +39,3 @@ void vdstrs(int *nx1, int *nx2); void vdstrv(float *xmin, float *xmax, float *ymin, float *ymax); void vdterm(void); void vdtext(int *length, int *char_array); -#endif diff --git a/packages/seacas/libraries/svdi/cgi/vdicgi.h b/packages/seacas/libraries/svdi/cgi/vdicgi.h index 162feb9ceeb3..46430ef8edd2 100644 --- a/packages/seacas/libraries/svdi/cgi/vdicgi.h +++ b/packages/seacas/libraries/svdi/cgi/vdicgi.h @@ -1,13 +1,11 @@ /* - * Copyright(C) 1999-2020 National Technology & Engineering Solutions + * Copyright(C) 1999-2020, 2022 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. * * See packages/seacas/LICENSE for details */ - -#ifndef VDICGI_H -#define VDICGI_H +#pragma once void vdicgi_errh(char errmsg[]) void vdinit_ (float *aspect, int *justif) @@ -40,5 +38,3 @@ void vdakgl_ (int *charac, float *x, float *y) void vdstla_ (float *x, float *y) void vdstos_ (float attr_array[]) void vdfram_(int itype) - -#endif From 407ba1f297aa9d0b528cac0aac72a512f72ee79d Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Tue, 17 Jan 2023 14:11:27 -0700 Subject: [PATCH 05/14] SEACAS: Tribits update Update all CMakeLists.txt to remove deprecated functions; use new version --- packages/seacas/applications/algebra/CMakeLists.txt | 2 +- packages/seacas/applications/aprepro/CMakeLists.txt | 2 +- packages/seacas/applications/blot/CMakeLists.txt | 2 +- packages/seacas/applications/conjoin/CMakeLists.txt | 2 +- packages/seacas/applications/cpup/CMakeLists.txt | 2 +- packages/seacas/applications/ejoin/CMakeLists.txt | 2 +- packages/seacas/applications/epu/CMakeLists.txt | 2 +- packages/seacas/applications/ex1ex2v2/CMakeLists.txt | 2 +- packages/seacas/applications/ex2ex1v2/CMakeLists.txt | 2 +- packages/seacas/applications/exo2mat/CMakeLists.txt | 2 +- packages/seacas/applications/exo_format/CMakeLists.txt | 2 +- packages/seacas/applications/exodiff/CMakeLists.txt | 2 +- packages/seacas/applications/exomatlab/CMakeLists.txt | 2 +- packages/seacas/applications/exotec2/CMakeLists.txt | 2 +- packages/seacas/applications/exotxt/CMakeLists.txt | 2 +- packages/seacas/applications/explore/CMakeLists.txt | 2 +- packages/seacas/applications/fastq/CMakeLists.txt | 2 +- packages/seacas/applications/gen3d/CMakeLists.txt | 2 +- packages/seacas/applications/genshell/CMakeLists.txt | 2 +- packages/seacas/applications/gjoin/CMakeLists.txt | 2 +- packages/seacas/applications/grepos/CMakeLists.txt | 2 +- packages/seacas/applications/mapvar-kd/CMakeLists.txt | 2 +- packages/seacas/applications/mapvar/CMakeLists.txt | 2 +- packages/seacas/applications/mat2exo/CMakeLists.txt | 2 +- packages/seacas/applications/nas2exo/CMakeLists.txt | 2 +- packages/seacas/applications/nem_slice/CMakeLists.txt | 4 ++-- packages/seacas/applications/nem_spread/CMakeLists.txt | 2 +- packages/seacas/applications/numbers/CMakeLists.txt | 2 +- packages/seacas/applications/slice/CMakeLists.txt | 2 +- packages/seacas/applications/txtexo/CMakeLists.txt | 2 +- packages/seacas/applications/zellij/CMakeLists.txt | 4 ++-- packages/seacas/libraries/aprepro_lib/CMakeLists.txt | 2 +- packages/seacas/libraries/chaco/CMakeLists.txt | 2 +- packages/seacas/libraries/exoIIv2for32/CMakeLists.txt | 4 ++-- packages/seacas/libraries/exodus/CMakeLists.txt | 5 +++-- packages/seacas/libraries/exodus_for/CMakeLists.txt | 4 ++-- packages/seacas/libraries/ioss/src/CMakeLists.txt | 10 ++++------ .../seacas/libraries/ioss/src/adios/CMakeLists.txt | 4 ++-- .../libraries/ioss/src/adios/utest/CMakeLists.txt | 2 +- .../seacas/libraries/ioss/src/catalyst/CMakeLists.txt | 4 ++-- packages/seacas/libraries/ioss/src/cgns/CMakeLists.txt | 5 +++-- .../seacas/libraries/ioss/src/exodus/CMakeLists.txt | 5 +++-- .../seacas/libraries/ioss/src/faodel/CMakeLists.txt | 4 ++-- .../seacas/libraries/ioss/src/gen_struc/CMakeLists.txt | 4 ++-- .../seacas/libraries/ioss/src/generated/CMakeLists.txt | 5 +++-- .../seacas/libraries/ioss/src/heartbeat/CMakeLists.txt | 4 ++-- packages/seacas/libraries/ioss/src/init/CMakeLists.txt | 4 ++-- packages/seacas/libraries/ioss/src/main/CMakeLists.txt | 4 ++-- .../seacas/libraries/ioss/src/pamgen/CMakeLists.txt | 4 ++-- .../seacas/libraries/ioss/src/text_mesh/CMakeLists.txt | 4 ++-- .../seacas/libraries/ioss/src/transform/CMakeLists.txt | 4 ++-- .../libraries/ioss/src/unit_tests/CMakeLists.txt | 2 +- .../seacas/libraries/ioss/src/utest/CMakeLists.txt | 2 +- .../libraries/ioss/src/visualization/CMakeLists.txt | 4 ++-- .../ioss/src/visualization/catalyst/CMakeLists.txt | 6 +++--- .../src/visualization/catalyst/parser/CMakeLists.txt | 4 ++-- packages/seacas/libraries/mapvarlib/CMakeLists.txt | 2 +- packages/seacas/libraries/nemesis/CMakeLists.txt | 2 +- packages/seacas/libraries/plt/CMakeLists.txt | 2 +- packages/seacas/libraries/supes/CMakeLists.txt | 2 +- packages/seacas/libraries/suplib/CMakeLists.txt | 2 +- packages/seacas/libraries/suplib_c/CMakeLists.txt | 2 +- packages/seacas/libraries/suplib_cpp/CMakeLists.txt | 2 +- packages/seacas/libraries/svdi/CMakeLists.txt | 2 +- packages/seacas/scripts/CMakeLists.txt | 2 +- 65 files changed, 94 insertions(+), 92 deletions(-) diff --git a/packages/seacas/applications/algebra/CMakeLists.txt b/packages/seacas/applications/algebra/CMakeLists.txt index dce299ad19d3..5875a2ce34df 100644 --- a/packages/seacas/applications/algebra/CMakeLists.txt +++ b/packages/seacas/applications/algebra/CMakeLists.txt @@ -2,7 +2,7 @@ INCLUDE(FortranSettings) TRIBITS_SUBPACKAGE(Algebra) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" ) diff --git a/packages/seacas/applications/aprepro/CMakeLists.txt b/packages/seacas/applications/aprepro/CMakeLists.txt index 7c6d8ebec6c6..b74b9b4b272f 100644 --- a/packages/seacas/applications/aprepro/CMakeLists.txt +++ b/packages/seacas/applications/aprepro/CMakeLists.txt @@ -6,7 +6,7 @@ TRIBITS_SUBPACKAGE(Aprepro) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ) diff --git a/packages/seacas/applications/blot/CMakeLists.txt b/packages/seacas/applications/blot/CMakeLists.txt index 7f6363402821..191f5a2c15f6 100644 --- a/packages/seacas/applications/blot/CMakeLists.txt +++ b/packages/seacas/applications/blot/CMakeLists.txt @@ -2,7 +2,7 @@ INCLUDE(FortranSettings) TRIBITS_SUBPACKAGE(Blot) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" ) diff --git a/packages/seacas/applications/conjoin/CMakeLists.txt b/packages/seacas/applications/conjoin/CMakeLists.txt index dda1f406a4c1..f4e077fd14b0 100644 --- a/packages/seacas/applications/conjoin/CMakeLists.txt +++ b/packages/seacas/applications/conjoin/CMakeLists.txt @@ -1,7 +1,7 @@ TRIBITS_SUBPACKAGE(Conjoin) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" ) diff --git a/packages/seacas/applications/cpup/CMakeLists.txt b/packages/seacas/applications/cpup/CMakeLists.txt index 27425df8e777..50763858e15c 100644 --- a/packages/seacas/applications/cpup/CMakeLists.txt +++ b/packages/seacas/applications/cpup/CMakeLists.txt @@ -8,7 +8,7 @@ TRIBITS_SUBPACKAGE(Cpup) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" ) diff --git a/packages/seacas/applications/ejoin/CMakeLists.txt b/packages/seacas/applications/ejoin/CMakeLists.txt index 6905cb20de09..33e9eea351e1 100644 --- a/packages/seacas/applications/ejoin/CMakeLists.txt +++ b/packages/seacas/applications/ejoin/CMakeLists.txt @@ -1,7 +1,7 @@ TRIBITS_SUBPACKAGE(Ejoin) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" ) diff --git a/packages/seacas/applications/epu/CMakeLists.txt b/packages/seacas/applications/epu/CMakeLists.txt index c503ee6fc177..f59ef3da3d95 100644 --- a/packages/seacas/applications/epu/CMakeLists.txt +++ b/packages/seacas/applications/epu/CMakeLists.txt @@ -8,7 +8,7 @@ TRIBITS_SUBPACKAGE(Epu) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" ) diff --git a/packages/seacas/applications/ex1ex2v2/CMakeLists.txt b/packages/seacas/applications/ex1ex2v2/CMakeLists.txt index 9ab5a88b8916..f95751391267 100644 --- a/packages/seacas/applications/ex1ex2v2/CMakeLists.txt +++ b/packages/seacas/applications/ex1ex2v2/CMakeLists.txt @@ -2,7 +2,7 @@ INCLUDE(FortranSettings) TRIBITS_SUBPACKAGE(Ex1ex2v2) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" ) diff --git a/packages/seacas/applications/ex2ex1v2/CMakeLists.txt b/packages/seacas/applications/ex2ex1v2/CMakeLists.txt index 47116d797f16..1c0371a9a983 100644 --- a/packages/seacas/applications/ex2ex1v2/CMakeLists.txt +++ b/packages/seacas/applications/ex2ex1v2/CMakeLists.txt @@ -2,7 +2,7 @@ INCLUDE(FortranSettings) TRIBITS_SUBPACKAGE(Ex2ex1v2) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" ) diff --git a/packages/seacas/applications/exo2mat/CMakeLists.txt b/packages/seacas/applications/exo2mat/CMakeLists.txt index 85729277f2b2..e5bcaf796650 100644 --- a/packages/seacas/applications/exo2mat/CMakeLists.txt +++ b/packages/seacas/applications/exo2mat/CMakeLists.txt @@ -3,7 +3,7 @@ IF (TPL_ENABLE_Matio) TRIBITS_SUBPACKAGE(Exo2mat) LINK_DIRECTORIES(${Matio_LIBRARY_DIRS}) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${Matio_INCLUDE_DIRS}" "${CMAKE_CURRENT_SOURCE_DIR}" ) diff --git a/packages/seacas/applications/exo_format/CMakeLists.txt b/packages/seacas/applications/exo_format/CMakeLists.txt index dd8de28be3d0..d85e76440172 100644 --- a/packages/seacas/applications/exo_format/CMakeLists.txt +++ b/packages/seacas/applications/exo_format/CMakeLists.txt @@ -1,7 +1,7 @@ TRIBITS_SUBPACKAGE(Exo_format) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" ) diff --git a/packages/seacas/applications/exodiff/CMakeLists.txt b/packages/seacas/applications/exodiff/CMakeLists.txt index 44c24410bbe7..aff6048a1429 100644 --- a/packages/seacas/applications/exodiff/CMakeLists.txt +++ b/packages/seacas/applications/exodiff/CMakeLists.txt @@ -1,7 +1,7 @@ TRIBITS_SUBPACKAGE(Exodiff) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" ) diff --git a/packages/seacas/applications/exomatlab/CMakeLists.txt b/packages/seacas/applications/exomatlab/CMakeLists.txt index c1dc311c45bd..e9d79c3937e5 100644 --- a/packages/seacas/applications/exomatlab/CMakeLists.txt +++ b/packages/seacas/applications/exomatlab/CMakeLists.txt @@ -1,7 +1,7 @@ TRIBITS_SUBPACKAGE(Exomatlab) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" ) diff --git a/packages/seacas/applications/exotec2/CMakeLists.txt b/packages/seacas/applications/exotec2/CMakeLists.txt index 29c6e7532820..8b62aa6553ec 100644 --- a/packages/seacas/applications/exotec2/CMakeLists.txt +++ b/packages/seacas/applications/exotec2/CMakeLists.txt @@ -1,6 +1,6 @@ TRIBITS_SUBPACKAGE(Exotec2) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" ) diff --git a/packages/seacas/applications/exotxt/CMakeLists.txt b/packages/seacas/applications/exotxt/CMakeLists.txt index 6bcfd309c6f1..f2f398dc5805 100644 --- a/packages/seacas/applications/exotxt/CMakeLists.txt +++ b/packages/seacas/applications/exotxt/CMakeLists.txt @@ -2,7 +2,7 @@ INCLUDE(FortranSettings) TRIBITS_SUBPACKAGE(Exotxt) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" ) diff --git a/packages/seacas/applications/explore/CMakeLists.txt b/packages/seacas/applications/explore/CMakeLists.txt index 65521c108e4d..fe46e26a2b84 100644 --- a/packages/seacas/applications/explore/CMakeLists.txt +++ b/packages/seacas/applications/explore/CMakeLists.txt @@ -6,7 +6,7 @@ endif() TRIBITS_SUBPACKAGE(Explore) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" ) diff --git a/packages/seacas/applications/fastq/CMakeLists.txt b/packages/seacas/applications/fastq/CMakeLists.txt index acdee006db99..82c195508fb1 100644 --- a/packages/seacas/applications/fastq/CMakeLists.txt +++ b/packages/seacas/applications/fastq/CMakeLists.txt @@ -2,7 +2,7 @@ INCLUDE(FortranSettings) TRIBITS_SUBPACKAGE(Fastq) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" ) diff --git a/packages/seacas/applications/gen3d/CMakeLists.txt b/packages/seacas/applications/gen3d/CMakeLists.txt index e7cadf984ede..a5bfd5a421d9 100644 --- a/packages/seacas/applications/gen3d/CMakeLists.txt +++ b/packages/seacas/applications/gen3d/CMakeLists.txt @@ -2,7 +2,7 @@ INCLUDE(FortranSettings) TRIBITS_SUBPACKAGE(Gen3D) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" ) diff --git a/packages/seacas/applications/genshell/CMakeLists.txt b/packages/seacas/applications/genshell/CMakeLists.txt index 89094d96b9fb..e8602dd0d9ae 100644 --- a/packages/seacas/applications/genshell/CMakeLists.txt +++ b/packages/seacas/applications/genshell/CMakeLists.txt @@ -2,7 +2,7 @@ INCLUDE(FortranSettings) TRIBITS_SUBPACKAGE(Genshell) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" ) diff --git a/packages/seacas/applications/gjoin/CMakeLists.txt b/packages/seacas/applications/gjoin/CMakeLists.txt index 985338235efc..e57dabdc4b59 100644 --- a/packages/seacas/applications/gjoin/CMakeLists.txt +++ b/packages/seacas/applications/gjoin/CMakeLists.txt @@ -2,7 +2,7 @@ INCLUDE(FortranSettings) TRIBITS_SUBPACKAGE(Gjoin) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" ) diff --git a/packages/seacas/applications/grepos/CMakeLists.txt b/packages/seacas/applications/grepos/CMakeLists.txt index 0fd65fa63535..f16c010f08b2 100644 --- a/packages/seacas/applications/grepos/CMakeLists.txt +++ b/packages/seacas/applications/grepos/CMakeLists.txt @@ -2,7 +2,7 @@ INCLUDE(FortranSettings) TRIBITS_SUBPACKAGE(Grepos) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" ) diff --git a/packages/seacas/applications/mapvar-kd/CMakeLists.txt b/packages/seacas/applications/mapvar-kd/CMakeLists.txt index 0e270295a0a3..cea8076f04cf 100644 --- a/packages/seacas/applications/mapvar-kd/CMakeLists.txt +++ b/packages/seacas/applications/mapvar-kd/CMakeLists.txt @@ -2,7 +2,7 @@ INCLUDE(FortranSettings) TRIBITS_SUBPACKAGE(Mapvar-kd) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" ) diff --git a/packages/seacas/applications/mapvar/CMakeLists.txt b/packages/seacas/applications/mapvar/CMakeLists.txt index 06d0fe0a5eb6..3d34f2e7a4d1 100644 --- a/packages/seacas/applications/mapvar/CMakeLists.txt +++ b/packages/seacas/applications/mapvar/CMakeLists.txt @@ -2,7 +2,7 @@ INCLUDE(FortranSettings) TRIBITS_SUBPACKAGE(Mapvar) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" ) diff --git a/packages/seacas/applications/mat2exo/CMakeLists.txt b/packages/seacas/applications/mat2exo/CMakeLists.txt index 4d55d96f290f..af5b608077ef 100644 --- a/packages/seacas/applications/mat2exo/CMakeLists.txt +++ b/packages/seacas/applications/mat2exo/CMakeLists.txt @@ -3,7 +3,7 @@ IF (TPL_ENABLE_Matio) TRIBITS_SUBPACKAGE(Mat2exo) LINK_DIRECTORIES(${Matio_LIBRARY_DIRS}) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${Matio_INCLUDE_DIRS}" "${CMAKE_CURRENT_SOURCE_DIR}" ) diff --git a/packages/seacas/applications/nas2exo/CMakeLists.txt b/packages/seacas/applications/nas2exo/CMakeLists.txt index 02b4c8ba70c8..433df4bb02e8 100644 --- a/packages/seacas/applications/nas2exo/CMakeLists.txt +++ b/packages/seacas/applications/nas2exo/CMakeLists.txt @@ -3,7 +3,7 @@ TRIBITS_SUBPACKAGE(Nas2exo) -INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}") +TRIBITS_INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}") SET(HEADERS "") diff --git a/packages/seacas/applications/nem_slice/CMakeLists.txt b/packages/seacas/applications/nem_slice/CMakeLists.txt index bd5cf47d2955..d1d7e0b47d5a 100644 --- a/packages/seacas/applications/nem_slice/CMakeLists.txt +++ b/packages/seacas/applications/nem_slice/CMakeLists.txt @@ -4,12 +4,12 @@ TRIBITS_SUBPACKAGE(Nemslice) ASSERT_DEFINED(${PROJECT_NAME}_ENABLE_Zoltan) IF (${PROJECT_NAME}_ENABLE_Zoltan) - INCLUDE_DIRECTORIES(${Zoltan_INCLUDE_DIRS}) + TRIBITS_INCLUDE_DIRECTORIES(${Zoltan_INCLUDE_DIRS}) SET(ZOLTAN_DEP zoltan) ADD_DEFINITIONS(-DUSE_ZOLTAN) ENDIF() -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(HEADERS "") APPEND_GLOB(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.C) diff --git a/packages/seacas/applications/nem_spread/CMakeLists.txt b/packages/seacas/applications/nem_spread/CMakeLists.txt index 77c9f51f699c..e8a2767dd136 100644 --- a/packages/seacas/applications/nem_spread/CMakeLists.txt +++ b/packages/seacas/applications/nem_spread/CMakeLists.txt @@ -1,7 +1,7 @@ TRIBITS_SUBPACKAGE(Nemspread) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" ) diff --git a/packages/seacas/applications/numbers/CMakeLists.txt b/packages/seacas/applications/numbers/CMakeLists.txt index 5b8fe6b40539..cf480b10b1fc 100644 --- a/packages/seacas/applications/numbers/CMakeLists.txt +++ b/packages/seacas/applications/numbers/CMakeLists.txt @@ -2,7 +2,7 @@ INCLUDE(FortranSettings) TRIBITS_SUBPACKAGE(Numbers) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" ) diff --git a/packages/seacas/applications/slice/CMakeLists.txt b/packages/seacas/applications/slice/CMakeLists.txt index c6e4e1b1abed..08d4167478e5 100644 --- a/packages/seacas/applications/slice/CMakeLists.txt +++ b/packages/seacas/applications/slice/CMakeLists.txt @@ -5,7 +5,7 @@ IF (TPL_ENABLE_METIS) ADD_DEFINITIONS(-DUSE_METIS) ENDIF() -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(HEADERS "") APPEND_GLOB(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.C) diff --git a/packages/seacas/applications/txtexo/CMakeLists.txt b/packages/seacas/applications/txtexo/CMakeLists.txt index bd545d932ba6..931cc80715cc 100644 --- a/packages/seacas/applications/txtexo/CMakeLists.txt +++ b/packages/seacas/applications/txtexo/CMakeLists.txt @@ -2,7 +2,7 @@ INCLUDE(FortranSettings) TRIBITS_SUBPACKAGE(Txtexo) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" ) diff --git a/packages/seacas/applications/zellij/CMakeLists.txt b/packages/seacas/applications/zellij/CMakeLists.txt index 1ba1d8f45aa5..9faf02941b16 100644 --- a/packages/seacas/applications/zellij/CMakeLists.txt +++ b/packages/seacas/applications/zellij/CMakeLists.txt @@ -3,12 +3,12 @@ TRIBITS_SUBPACKAGE(Zellij) ASSERT_DEFINED(${PROJECT_NAME}_ENABLE_Zoltan) IF (${PROJECT_NAME}_ENABLE_Zoltan) - INCLUDE_DIRECTORIES(${Zoltan_INCLUDE_DIRS}) + TRIBITS_INCLUDE_DIRECTORIES(${Zoltan_INCLUDE_DIRS}) SET(ZOLTAN_DEP zoltan) ADD_DEFINITIONS(-DUSE_ZOLTAN) ENDIF() -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" ) diff --git a/packages/seacas/libraries/aprepro_lib/CMakeLists.txt b/packages/seacas/libraries/aprepro_lib/CMakeLists.txt index ef391f1c6034..331bc5841cf5 100644 --- a/packages/seacas/libraries/aprepro_lib/CMakeLists.txt +++ b/packages/seacas/libraries/aprepro_lib/CMakeLists.txt @@ -15,7 +15,7 @@ IF (${CMAKE_PROJECT_NAME}_ENABLE_SEACASExodus) ADD_DEFINITIONS(-DEXODUS_SUPPORT) ENDIF() -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} ) diff --git a/packages/seacas/libraries/chaco/CMakeLists.txt b/packages/seacas/libraries/chaco/CMakeLists.txt index 5f43a4e0c7fe..576abc8a8440 100644 --- a/packages/seacas/libraries/chaco/CMakeLists.txt +++ b/packages/seacas/libraries/chaco/CMakeLists.txt @@ -6,7 +6,7 @@ SET(CHACO_VERSION_PATCH "0") SET(CHACO_VERSION "${CHACO_VERSION_MAJOR}.${CHACO_VERSION_MINOR}") SET(CHACO_VERSION_FULL "${CHACO_VERSION}.${CHACO_VERSION_PATCH}") -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}/main" "${CMAKE_CURRENT_SOURCE_DIR}/util" ) diff --git a/packages/seacas/libraries/exoIIv2for32/CMakeLists.txt b/packages/seacas/libraries/exoIIv2for32/CMakeLists.txt index 855f3899842e..0a93d767439f 100644 --- a/packages/seacas/libraries/exoIIv2for32/CMakeLists.txt +++ b/packages/seacas/libraries/exoIIv2for32/CMakeLists.txt @@ -4,12 +4,12 @@ TRIBITS_SUBPACKAGE(ExoIIv2for32) add_definitions(-DDEFAULT_REAL_INT) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}/../exodus_for/include" "${CMAKE_CURRENT_SOURCE_DIR}/test" ) -SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) TRIBITS_ADD_LIBRARY( exoIIv2for32 diff --git a/packages/seacas/libraries/exodus/CMakeLists.txt b/packages/seacas/libraries/exodus/CMakeLists.txt index 2ed3ec4abd01..15860b2a8d15 100644 --- a/packages/seacas/libraries/exodus/CMakeLists.txt +++ b/packages/seacas/libraries/exodus/CMakeLists.txt @@ -4,7 +4,7 @@ if (SEACASExodus_ENABLE_STATIC) INCLUDE(InstallSymLink) endif() -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}/include" ) @@ -19,10 +19,11 @@ if (NOT ${EXODUS_THREADSAFE}) list(REMOVE_ITEM SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/ex_threadsafe.c) endif() -SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_BINARY_DIR}) SET(HEADERS include/exodusII.h + include/exodusII_int.h include/exodusII_par.h ${CMAKE_CURRENT_BINARY_DIR}/exodus_config.h ) diff --git a/packages/seacas/libraries/exodus_for/CMakeLists.txt b/packages/seacas/libraries/exodus_for/CMakeLists.txt index b043503fc6c4..2ff709977506 100644 --- a/packages/seacas/libraries/exodus_for/CMakeLists.txt +++ b/packages/seacas/libraries/exodus_for/CMakeLists.txt @@ -6,13 +6,13 @@ endif() TRIBITS_SUBPACKAGE(Exodus_for) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_SOURCE_DIR}/test" ) SET(SOURCES "") -SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(SOURCES ${DIR}/src/*.c ${DIR}/src/*.F) LIST(REMOVE_ITEM SOURCES "${DIR}/src/exo_jack-windows.c") diff --git a/packages/seacas/libraries/ioss/src/CMakeLists.txt b/packages/seacas/libraries/ioss/src/CMakeLists.txt index 8ba229bc73e6..606ec254e673 100644 --- a/packages/seacas/libraries/ioss/src/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/CMakeLists.txt @@ -48,8 +48,10 @@ IF (NOT TPL_ENABLE_ParMETIS) ADD_DEFINITIONS(-DNO_PARMETIS_SUPPORT) ENDIF() -SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/Ioss_*.h) +APPEND_GLOB(HEADERS ${DIR}/tokenize.h) +APPEND_GLOB(HEADERS ${DIR}/io_info.h) APPEND_GLOB(HEADERS ${DIR}/*hopscotch*.h) APPEND_GLOB(HEADERS ${DIR}/robin*.h) APPEND_GLOB(HEADERS ${DIR}/pdq*.h) @@ -61,16 +63,12 @@ IF (NOT TPL_ENABLE_MPI) LIST(REMOVE_ITEM HEADERS ${DIR}/Ioss_Decomposition.h) ENDIF() -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" "${Zoltan_INCLUDE_DIRS}" ) -IF (NOT TPL_ENABLE_fmt) - INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/private_copy_fmt") -ENDIF() - list(APPEND HEADERS "${CMAKE_CURRENT_BINARY_DIR}/ioss_export.h") diff --git a/packages/seacas/libraries/ioss/src/adios/CMakeLists.txt b/packages/seacas/libraries/ioss/src/adios/CMakeLists.txt index 7e89884fd80e..b57478459103 100644 --- a/packages/seacas/libraries/ioss/src/adios/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/adios/CMakeLists.txt @@ -1,11 +1,11 @@ SET(HEADERS "") SET(SOURCES "") -SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.h*) APPEND_GLOB(SOURCES ${DIR}/*.C) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}/../" "${CMAKE_CURRENT_BINARY_DIR}/../" ) diff --git a/packages/seacas/libraries/ioss/src/adios/utest/CMakeLists.txt b/packages/seacas/libraries/ioss/src/adios/utest/CMakeLists.txt index 30df5e2befac..23d861ef1271 100644 --- a/packages/seacas/libraries/ioss/src/adios/utest/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/adios/utest/CMakeLists.txt @@ -10,7 +10,7 @@ TRIBITS_ADD_TEST( NUM_MPI_PROCS 1 ) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}/../" "${CMAKE_CURRENT_BINARY_DIR}/../" "${CMAKE_CURRENT_SOURCE_DIR}/../../" diff --git a/packages/seacas/libraries/ioss/src/catalyst/CMakeLists.txt b/packages/seacas/libraries/ioss/src/catalyst/CMakeLists.txt index 658bbdc19783..7ee0946b9039 100644 --- a/packages/seacas/libraries/ioss/src/catalyst/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/catalyst/CMakeLists.txt @@ -1,11 +1,11 @@ SET(HEADERS "") SET(SOURCES "") -SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.h*) APPEND_GLOB(SOURCES ${DIR}/*.C) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}/../" "${CMAKE_CURRENT_BINARY_DIR}/../" ) diff --git a/packages/seacas/libraries/ioss/src/cgns/CMakeLists.txt b/packages/seacas/libraries/ioss/src/cgns/CMakeLists.txt index e9b57d50e385..968ee75e240f 100644 --- a/packages/seacas/libraries/ioss/src/cgns/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/cgns/CMakeLists.txt @@ -14,7 +14,7 @@ ELSE() ENDIF() ENDIF() -SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.h) APPEND_GLOB(SOURCES ${DIR}/*.C) @@ -23,7 +23,7 @@ IF (NOT TPL_ENABLE_MPI) LIST(REMOVE_ITEM HEADERS ${DIR}/Iocgns_ParallelDatabaseIO.h ${DIR}/Iocgns_DecompositionData.h) ENDIF() -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}/../" "${CMAKE_CURRENT_BINARY_DIR}/../" ) @@ -34,6 +34,7 @@ list(APPEND HEADERS TRIBITS_ADD_LIBRARY( Iocgns HEADERS ${HEADERS} + HEADERS_INSTALL_SUBDIR cgns SOURCES ${SOURCES} DEPLIBS Ioss ) diff --git a/packages/seacas/libraries/ioss/src/exodus/CMakeLists.txt b/packages/seacas/libraries/ioss/src/exodus/CMakeLists.txt index 9b54cccef5b0..cc0b2153b8de 100644 --- a/packages/seacas/libraries/ioss/src/exodus/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/exodus/CMakeLists.txt @@ -2,11 +2,11 @@ SET(HEADERS "") SET(SOURCES "") -SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.h) APPEND_GLOB(SOURCES ${DIR}/*.C) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}/../" "${CMAKE_CURRENT_BINARY_DIR}/../" ) @@ -17,6 +17,7 @@ list(APPEND HEADERS TRIBITS_ADD_LIBRARY( Ioex HEADERS ${HEADERS} + HEADERS_INSTALL_SUBDIR exodus SOURCES ${SOURCES} DEPLIBS Ioss ) diff --git a/packages/seacas/libraries/ioss/src/faodel/CMakeLists.txt b/packages/seacas/libraries/ioss/src/faodel/CMakeLists.txt index 335c3c8c20c3..6d7203df36cd 100644 --- a/packages/seacas/libraries/ioss/src/faodel/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/faodel/CMakeLists.txt @@ -1,11 +1,11 @@ SET(HEADERS "") SET(SOURCES "") -SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.h) APPEND_GLOB(SOURCES ${DIR}/*.C) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}/../" "${CMAKE_CURRENT_BINARY_DIR}/../" ${Boost_INCLUDE_DIR} diff --git a/packages/seacas/libraries/ioss/src/gen_struc/CMakeLists.txt b/packages/seacas/libraries/ioss/src/gen_struc/CMakeLists.txt index 8b78f41f5fc3..ee920059c989 100644 --- a/packages/seacas/libraries/ioss/src/gen_struc/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/gen_struc/CMakeLists.txt @@ -1,11 +1,11 @@ SET(HEADERS "") SET(SOURCES "") -SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.h) APPEND_GLOB(SOURCES ${DIR}/*.C) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}/../" "${CMAKE_CURRENT_BINARY_DIR}/../" ) diff --git a/packages/seacas/libraries/ioss/src/generated/CMakeLists.txt b/packages/seacas/libraries/ioss/src/generated/CMakeLists.txt index 42eeb7b0a852..69f428dac5ca 100644 --- a/packages/seacas/libraries/ioss/src/generated/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/generated/CMakeLists.txt @@ -2,11 +2,11 @@ SET(HEADERS "") SET(SOURCES "") -SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.h) APPEND_GLOB(SOURCES ${DIR}/*.C) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}/../" "${CMAKE_CURRENT_BINARY_DIR}/../" ) @@ -17,6 +17,7 @@ list(APPEND HEADERS TRIBITS_ADD_LIBRARY( Iogn HEADERS ${HEADERS} + HEADERS_INSTALL_SUBDIR generated SOURCES ${SOURCES} DEPLIBS Ioss ) diff --git a/packages/seacas/libraries/ioss/src/heartbeat/CMakeLists.txt b/packages/seacas/libraries/ioss/src/heartbeat/CMakeLists.txt index 9774ca3fa8ef..04c879739885 100644 --- a/packages/seacas/libraries/ioss/src/heartbeat/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/heartbeat/CMakeLists.txt @@ -2,11 +2,11 @@ SET(HEADERS "") SET(SOURCES "") -SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.h) APPEND_GLOB(SOURCES ${DIR}/*.C) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}/../" "${CMAKE_CURRENT_BINARY_DIR}/../" ) diff --git a/packages/seacas/libraries/ioss/src/init/CMakeLists.txt b/packages/seacas/libraries/ioss/src/init/CMakeLists.txt index 5728726bc05a..50073939170c 100644 --- a/packages/seacas/libraries/ioss/src/init/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/init/CMakeLists.txt @@ -2,11 +2,11 @@ SET(HEADERS "") SET(SOURCES "") -SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.h) APPEND_GLOB(SOURCES ${DIR}/*.C) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}/../" "${CMAKE_CURRENT_BINARY_DIR}/../" ) diff --git a/packages/seacas/libraries/ioss/src/main/CMakeLists.txt b/packages/seacas/libraries/ioss/src/main/CMakeLists.txt index 2d99b7de7edf..9bea1013c5a0 100644 --- a/packages/seacas/libraries/ioss/src/main/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/main/CMakeLists.txt @@ -1,11 +1,11 @@ SET(HEADERS "") SET(SOURCES "") -SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.h) APPEND_GLOB(SOURCES ${DIR}/*.C) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}/../" "${CMAKE_CURRENT_BINARY_DIR}/../" ) diff --git a/packages/seacas/libraries/ioss/src/pamgen/CMakeLists.txt b/packages/seacas/libraries/ioss/src/pamgen/CMakeLists.txt index 88d46366b37f..f57d7a440d54 100644 --- a/packages/seacas/libraries/ioss/src/pamgen/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/pamgen/CMakeLists.txt @@ -2,11 +2,11 @@ SET(HEADERS "") SET(SOURCES "") -SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.h) APPEND_GLOB(SOURCES ${DIR}/*.C) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}/../" "${CMAKE_CURRENT_BINARY_DIR}/../" ) diff --git a/packages/seacas/libraries/ioss/src/text_mesh/CMakeLists.txt b/packages/seacas/libraries/ioss/src/text_mesh/CMakeLists.txt index 371a67cb134d..3f7715018fad 100644 --- a/packages/seacas/libraries/ioss/src/text_mesh/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/text_mesh/CMakeLists.txt @@ -2,11 +2,11 @@ SET(HEADERS "") SET(SOURCES "") -SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.h) APPEND_GLOB(SOURCES ${DIR}/*.C) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}/../" "${CMAKE_CURRENT_BINARY_DIR}/../" ) diff --git a/packages/seacas/libraries/ioss/src/transform/CMakeLists.txt b/packages/seacas/libraries/ioss/src/transform/CMakeLists.txt index eba8de75f4b9..340ca1dd0654 100644 --- a/packages/seacas/libraries/ioss/src/transform/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/transform/CMakeLists.txt @@ -2,11 +2,11 @@ SET(HEADERS "") SET(SOURCES "") -SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.h) APPEND_GLOB(SOURCES ${DIR}/*.C) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}/../" "${CMAKE_CURRENT_BINARY_DIR}/../" ) diff --git a/packages/seacas/libraries/ioss/src/unit_tests/CMakeLists.txt b/packages/seacas/libraries/ioss/src/unit_tests/CMakeLists.txt index 190f9991becc..d8a21dc400b4 100644 --- a/packages/seacas/libraries/ioss/src/unit_tests/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/unit_tests/CMakeLists.txt @@ -28,7 +28,7 @@ TRIBITS_ADD_TEST( NUM_MPI_PROCS 4 ) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../" "${CMAKE_CURRENT_BINARY_DIR}/../" diff --git a/packages/seacas/libraries/ioss/src/utest/CMakeLists.txt b/packages/seacas/libraries/ioss/src/utest/CMakeLists.txt index cd68d4c2e17f..f19564f89aee 100644 --- a/packages/seacas/libraries/ioss/src/utest/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/utest/CMakeLists.txt @@ -122,7 +122,7 @@ TRIBITS_ADD_EXECUTABLE_AND_TEST( ) ENDIF() -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}/../" "${CMAKE_CURRENT_BINARY_DIR}/../" ) diff --git a/packages/seacas/libraries/ioss/src/visualization/CMakeLists.txt b/packages/seacas/libraries/ioss/src/visualization/CMakeLists.txt index 53d19c32908e..d5186c3063d6 100644 --- a/packages/seacas/libraries/ioss/src/visualization/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/visualization/CMakeLists.txt @@ -2,7 +2,7 @@ SET(HEADERS "") SET(SOURCES "") -SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/cgns/*.h) APPEND_GLOB(SOURCES ${DIR}/cgns/*.C) APPEND_GLOB(HEADERS ${DIR}/exodus/*.h) @@ -10,7 +10,7 @@ APPEND_GLOB(SOURCES ${DIR}/exodus/*.C) APPEND_GLOB(HEADERS ${DIR}/utils/*.h) APPEND_GLOB(SOURCES ${DIR}/utils/*.C) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}/../" "${CMAKE_CURRENT_BINARY_DIR}/../" ) diff --git a/packages/seacas/libraries/ioss/src/visualization/catalyst/CMakeLists.txt b/packages/seacas/libraries/ioss/src/visualization/catalyst/CMakeLists.txt index 99f798eb024b..a5c1c687843c 100644 --- a/packages/seacas/libraries/ioss/src/visualization/catalyst/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/visualization/catalyst/CMakeLists.txt @@ -37,9 +37,9 @@ IF("${isSystemDir}" STREQUAL "-1") SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") ENDIF() -INCLUDE_DIRECTORIES("manager") -INCLUDE_DIRECTORIES("parser") -INCLUDE_DIRECTORIES("../../") +TRIBITS_INCLUDE_DIRECTORIES("manager") +TRIBITS_INCLUDE_DIRECTORIES("parser") +TRIBITS_INCLUDE_DIRECTORIES("../../") ADD_SUBDIRECTORY(manager) ADD_SUBDIRECTORY(parser) diff --git a/packages/seacas/libraries/ioss/src/visualization/catalyst/parser/CMakeLists.txt b/packages/seacas/libraries/ioss/src/visualization/catalyst/parser/CMakeLists.txt index af3ad3ab34c7..afcef80c27dc 100644 --- a/packages/seacas/libraries/ioss/src/visualization/catalyst/parser/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/visualization/catalyst/parser/CMakeLists.txt @@ -34,8 +34,8 @@ ENDIF() SET_SOURCE_FILES_PROPERTIES(${FlexOutput} PROPERTIES GENERATED TRUE) SET_SOURCE_FILES_PROPERTIES(${BisonOutput} PROPERTIES GENERATED TRUE) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) FIND_PACKAGE(ParaView QUIET) diff --git a/packages/seacas/libraries/mapvarlib/CMakeLists.txt b/packages/seacas/libraries/mapvarlib/CMakeLists.txt index 2b7708beee9c..31ad5e35a61e 100644 --- a/packages/seacas/libraries/mapvarlib/CMakeLists.txt +++ b/packages/seacas/libraries/mapvarlib/CMakeLists.txt @@ -8,7 +8,7 @@ SET(SUPLIB_VERSION_PATCH "0") SET(MAPVARLIB_VERSION "${MAPVARLIB_VERSION_MAJOR}.${MAPVARLIB_VERSION_MINOR}") SET(MAPVARLIB_VERSION_FULL "${MAPVARLIB_VERSION}.${MAPVARLIB_VERSION_PATCH}") -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" ) diff --git a/packages/seacas/libraries/nemesis/CMakeLists.txt b/packages/seacas/libraries/nemesis/CMakeLists.txt index 154cf9e9e39b..cfee14ffa13a 100644 --- a/packages/seacas/libraries/nemesis/CMakeLists.txt +++ b/packages/seacas/libraries/nemesis/CMakeLists.txt @@ -13,7 +13,7 @@ CONFIGURE_FILE( ${CMAKE_CURRENT_BINARY_DIR}/nemesis_cfg.h @ONLY IMMEDIATE) -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" ) diff --git a/packages/seacas/libraries/plt/CMakeLists.txt b/packages/seacas/libraries/plt/CMakeLists.txt index b2a67a10b9e5..3ef04a6090ad 100644 --- a/packages/seacas/libraries/plt/CMakeLists.txt +++ b/packages/seacas/libraries/plt/CMakeLists.txt @@ -9,7 +9,7 @@ SET(PLT_VERSION "${PLT_VERSION_MAJOR}.${PLT_VERSION_MINOR}") SET(PLT_VERSION_FULL "${PLT_VERSION}.${PLT_VERSION_PATCH}") SET(SOURCES "") -SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(SOURCES ${DIR}/*.f ${DIR}/*.F ${DIR}/*.c) diff --git a/packages/seacas/libraries/supes/CMakeLists.txt b/packages/seacas/libraries/supes/CMakeLists.txt index 6a008c2deb30..5859e9e1ff63 100644 --- a/packages/seacas/libraries/supes/CMakeLists.txt +++ b/packages/seacas/libraries/supes/CMakeLists.txt @@ -9,7 +9,7 @@ SET(SUPES_VERSION_PATCH "0") SET(SUPES_VERSION "${SUPES_VERSION_MAJOR}.${SUPES_VERSION_MINOR}") SET(SUPES_VERSION_FULL "${SUPES_VERSION}.${SUPES_VERSION_PATCH}") -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/mem_mgr" "${CMAKE_CURRENT_SOURCE_DIR}/ext_lib" diff --git a/packages/seacas/libraries/suplib/CMakeLists.txt b/packages/seacas/libraries/suplib/CMakeLists.txt index 316f2ea877f0..bdf4ca93b3c5 100644 --- a/packages/seacas/libraries/suplib/CMakeLists.txt +++ b/packages/seacas/libraries/suplib/CMakeLists.txt @@ -8,7 +8,7 @@ SET(SUPLIB_VERSION_PATCH "0") SET(SUPLIB_VERSION "${SUPLIB_VERSION_MAJOR}.${SUPLIB_VERSION_MINOR}") SET(SUPLIB_VERSION_FULL "${SUPLIB_VERSION}.${SUPLIB_VERSION_PATCH}") -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" ) diff --git a/packages/seacas/libraries/suplib_c/CMakeLists.txt b/packages/seacas/libraries/suplib_c/CMakeLists.txt index c5c0d0fd3183..52f7c57f638b 100644 --- a/packages/seacas/libraries/suplib_c/CMakeLists.txt +++ b/packages/seacas/libraries/suplib_c/CMakeLists.txt @@ -6,7 +6,7 @@ SET(SUPLIBC_VERSION_PATCH "0") SET(SUPLIBC_VERSION "${SUPLIBC_VERSION_MAJOR}.${SUPLIBC_VERSION_MINOR}") SET(SUPLIBC_VERSION_FULL "${SUPLIBC_VERSION}.${SUPLIBC_VERSION_PATCH}") -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" ) diff --git a/packages/seacas/libraries/suplib_cpp/CMakeLists.txt b/packages/seacas/libraries/suplib_cpp/CMakeLists.txt index 5eb15b5a76b3..c9f1d5704cac 100644 --- a/packages/seacas/libraries/suplib_cpp/CMakeLists.txt +++ b/packages/seacas/libraries/suplib_cpp/CMakeLists.txt @@ -7,7 +7,7 @@ SET(SUPLIBCPP_VERSION_PATCH "0") SET(SUPLIBCPP_VERSION "${SUPLIBCPP_VERSION_MAJOR}.${SUPLIBCPP_VERSION_MINOR}") SET(SUPLIBCPP_VERSION_FULL "${SUPLIBCPP_VERSION}.${SUPLIBCPP_VERSION_PATCH}") -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" ) diff --git a/packages/seacas/libraries/svdi/CMakeLists.txt b/packages/seacas/libraries/svdi/CMakeLists.txt index 01351903d9f4..15fd50af94c1 100644 --- a/packages/seacas/libraries/svdi/CMakeLists.txt +++ b/packages/seacas/libraries/svdi/CMakeLists.txt @@ -8,7 +8,7 @@ SET(SVDI_VERSION_PATCH "0") SET(SVDI_VERSION "${SVDI_VERSION_MAJOR}.${SVDI_VERSION_MINOR}") SET(SVDI_VERSION_FULL "${SVDI_VERSION}.${SVDI_VERSION_PATCH}") -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/cgi" "${CMAKE_CURRENT_SOURCE_DIR}/vdi_drivers" diff --git a/packages/seacas/scripts/CMakeLists.txt b/packages/seacas/scripts/CMakeLists.txt index b881c3822cf7..4b15d31b98f6 100644 --- a/packages/seacas/scripts/CMakeLists.txt +++ b/packages/seacas/scripts/CMakeLists.txt @@ -60,7 +60,7 @@ IF (${PROJECT_NAME}_ENABLE_SEACASConjoin) INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/pconjoin DESTINATION bin) ENDIF() -INCLUDE_DIRECTORIES( +TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}" ) From 5e6bf207dbf929a43761100fe3c140fde03904bf Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Tue, 17 Jan 2023 14:18:29 -0700 Subject: [PATCH 06/14] SEACAS: General changes * Move to C++17 * EPU: Fix nodal variable consistency check * BLOT: Better labelling of coordinate output * EXODIFF: Allow -t for -tolerance backward compatibility * EXPLORE: Better labelling of coordinate output * NEM_SLICE: Support getsubopt on windows * SLICE: Clean up warnings * ZELLIJ: Better floating point sorting/equal tests * APREPRO: Clean up warnings * EXODUS: Clean up warnings * SUPLIB: Time stamp working with current lib{fmt} * DECOMP: Support specifying weight options to nem_slice --- packages/seacas/CMakeLists.txt | 2 +- packages/seacas/README.md | 2 +- packages/seacas/applications/blot/prxyz.f | 4 +- packages/seacas/applications/epu/epu.C | 8 +- .../applications/exodiff/ED_SystemInterface.C | 19 ++- .../seacas/applications/explore/exp_prxyz.f | 4 +- .../seacas/applications/nem_slice/elb_inp.C | 153 +++++++++++------- .../seacas/applications/nem_slice/elb_util.C | 8 +- .../seacas/applications/nem_slice/getsubopt.c | 88 ++++++++++ packages/seacas/applications/slice/Slice.C | 12 +- .../seacas/applications/zellij/UnitCell.C | 55 +++++-- .../applications/zellij/ZE_SystemInterface.C | 16 +- .../libraries/aprepro_lib/CMakeLists.txt | 1 + .../libraries/aprepro_lib/apr_aprepro.cc | 6 +- packages/seacas/libraries/chaco/README | 2 +- packages/seacas/libraries/exodus/Doxyfile | 2 +- .../seacas/libraries/exodus/src/ex_inquire.c | 4 +- .../libraries/exodus/src/ex_put_assemblies.c | 1 + packages/seacas/libraries/nemesis/README | 4 +- .../seacas/libraries/suplib_cpp/time_stamp.C | 4 +- packages/seacas/scripts/decomp | 26 ++- packages/seacas/scripts/decomp.in | 78 ++++----- packages/seacas/scripts/tests/test_exodus3.py | 32 ++-- 23 files changed, 356 insertions(+), 175 deletions(-) create mode 100644 packages/seacas/applications/nem_slice/getsubopt.c diff --git a/packages/seacas/CMakeLists.txt b/packages/seacas/CMakeLists.txt index 8351f3db629f..21b0e0da8fd8 100644 --- a/packages/seacas/CMakeLists.txt +++ b/packages/seacas/CMakeLists.txt @@ -17,7 +17,7 @@ TRIBITS_ADD_OPTION_AND_DEFINE( set(${PROJECT_NAME}_C_Standard_DEFAULT c99) -SET(${PROJECT_NAME}_CMAKE_CXX_STANDARD_DEFAULT 14) +SET(${PROJECT_NAME}_CMAKE_CXX_STANDARD_DEFAULT 17) SET(${PROJECT_NAME}_CMAKE_CXX_STANDARDS_ALLOWED "(14|17|20)") ADVANCED_SET(CMAKE_CXX_STANDARD ${${PROJECT_NAME}_CMAKE_CXX_STANDARD_DEFAULT} CACHE STRING diff --git a/packages/seacas/README.md b/packages/seacas/README.md index 5e814ee7cab5..5c2a78f721d0 100644 --- a/packages/seacas/README.md +++ b/packages/seacas/README.md @@ -72,7 +72,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. | -| H5VERSION | V112, V110, V18 | V110 | Use HDF5-1.12.X, HDF5-1.10.X or HDF5-1.8.X | +| H5VERSION | V114, V110, V18 | V110 | Use HDF5-1.14.X, HDF5-1.10.X or HDF5-1.8.X | | BB | YES, NO | NO | Enable Burst Buffer support in PnetCDF | | JOBS | {count} | 2 | Number of "jobs" used for simultaneous compiles | | SUDO | "" or sudo | "" | If need to be superuser to install | diff --git a/packages/seacas/applications/blot/prxyz.f b/packages/seacas/applications/blot/prxyz.f index 2de5a0afbe30..b93da2a2d307 100644 --- a/packages/seacas/applications/blot/prxyz.f +++ b/packages/seacas/applications/blot/prxyz.f @@ -1,4 +1,4 @@ -C Copyright(C) 1999-2020 National Technology & Engineering Solutions +C Copyright(C) 1999-2020, 2023 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 @@ -65,7 +65,7 @@ SUBROUTINE PRXYZ (OPTION, NOUT, NDIM, NAMECO, NUMNP, LISNP, 10000 FORMAT (/, 1X, 'COORDINATES') 10010 FORMAT (/, 1X, 'Node Ids are Global Ids',/, - * 5X, 6X, 4X, 5 (3X, A8, :, 3X), :, /, + * 5X, 14X, 4X, 5 (3X, A8, :, 3X), :, /, & (1X, 5 (3X, A8, :, 3X))) 10020 FORMAT (1X, 'Node ', I9, 4X, 5 (1X, 1PE13.6), :, /, & (1X, 5 (1X, 1PE13.6))) diff --git a/packages/seacas/applications/epu/epu.C b/packages/seacas/applications/epu/epu.C index 2c2bd7dcc3ea..daab9699cb6a 100644 --- a/packages/seacas/applications/epu/epu.C +++ b/packages/seacas/applications/epu/epu.C @@ -1,5 +1,5 @@ /* - * Copyright(C) 1999-2022 National Technology & Engineering Solutions + * Copyright(C) 1999-2023 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. * @@ -1477,9 +1477,10 @@ int epu(SystemInterface &interFace, int start_part, int part_count, int cycle, T } if (nodal_vars.count(InOut::OUT) > 0) { + T fill_val = -std::numeric_limits::max(); for (int i = 0; i < nodal_vars.count(InOut::IN); i++) { if (debug_level & 2) { - std::fill(master_values.begin(), master_values.end(), T(0.0)); + std::fill(master_values.begin(), master_values.end(), fill_val); } for (p = 0; p < part_count; p++) { @@ -1495,7 +1496,8 @@ int epu(SystemInterface &interFace, int start_part, int part_count, int cycle, T if (debug_level & 2) { for (size_t j = 0; j < node_count; j++) { size_t nodal_value = local_node_to_global[p][j]; - if (master_values[nodal_value] != 0 && master_values[nodal_value] != values[j]) { + if (master_values[nodal_value] != fill_val && + master_values[nodal_value] != values[j]) { fmt::print(stderr, "Variable {}, Node {}, old = {}, new = {}\n", i + 1, fmt::group_digits(nodal_value), master_values[nodal_value], values[j]); } diff --git a/packages/seacas/applications/exodiff/ED_SystemInterface.C b/packages/seacas/applications/exodiff/ED_SystemInterface.C index d9b421142614..6ca1366558b5 100644 --- a/packages/seacas/applications/exodiff/ED_SystemInterface.C +++ b/packages/seacas/applications/exodiff/ED_SystemInterface.C @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2020, 2022 National Technology & Engineering Solutions +// Copyright(C) 1999-2023 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. // @@ -488,6 +488,8 @@ void SystemInterface::enroll_options() options_.enroll("maxnames", GetLongOption::MandatoryValue, "[deprecated -- no longer needed]", "1000"); + options_.enroll("t", GetLongOption::MandatoryValue, "Backward-compatible option for -tolerance", + "1.0E-6"); options_.enroll("m", GetLongOption::NoValue, "Backward-compatible option for -map", nullptr); options_.enroll("p", GetLongOption::NoValue, "Backward-compatible option for -partial.", nullptr); options_.enroll("s", GetLongOption::NoValue, "Backward-compatible option for -short", nullptr); @@ -608,7 +610,17 @@ bool SystemInterface::parse_options(int argc, char **argv) } } - default_tol.value = options_.get_option_value("tolerance", default_tol.value); + { + auto t1 = options_.get_option_value("t", default_tol.value); + auto t2 = options_.get_option_value("tolerance", default_tol.value); + if (t1 != default_tol.value) { + default_tol.value = t1; + } + else if (t2 != default_tol.value) { + default_tol.value = t2; + } + } + coord_tol.value = options_.get_option_value("coordinate_tolerance", coord_tol.value); default_tol.floor = options_.get_option_value("Floor", default_tol.floor); final_time_tol.value = options_.get_option_value("final_time_tolerance", final_time_tol.value); @@ -1549,7 +1561,8 @@ namespace { cmd_file.getline(line, 256); xline = line; while (!cmd_file.eof()) { - if (xline.empty() || (xline[0] != '\t' && first_character(xline) != '#')) { + if (xline.empty() || + ((xline[0] != '\t' && xline[0] != ' ') && first_character(xline) != '#')) { break; } diff --git a/packages/seacas/applications/explore/exp_prxyz.f b/packages/seacas/applications/explore/exp_prxyz.f index 12ea4b8bc42a..c97ca0b991ef 100644 --- a/packages/seacas/applications/explore/exp_prxyz.f +++ b/packages/seacas/applications/explore/exp_prxyz.f @@ -1,4 +1,4 @@ -C Copyright(C) 1999-2020 National Technology & Engineering Solutions +C Copyright(C) 1999-2020, 2023 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 @@ -75,6 +75,6 @@ SUBROUTINE PRXYZ (OPTION, NOUT, NDIM, NAMECO, NUMNP, LISNP, CORD, 30 FORMAT('(1X, ''Node'', I12, 5 (2X, ',A,'), :, /,', $ '(15X, 5 (2X, ',A,')))') -10010 FORMAT (/, 1X, 4X, 5X, 4X, 5 (2X, A8, :, 7X), :, /, +10010 FORMAT (/, 1X, 8X, 5X, 4X, 5 (2X, A8, :, 3X), :, /, & (1X, 6 (7X, A8, :, 9X))) END diff --git a/packages/seacas/applications/nem_slice/elb_inp.C b/packages/seacas/applications/nem_slice/elb_inp.C index 6239838a440f..19de028fc2d6 100644 --- a/packages/seacas/applications/nem_slice/elb_inp.C +++ b/packages/seacas/applications/nem_slice/elb_inp.C @@ -1,5 +1,5 @@ /* - * Copyright(C) 1999-2021 National Technology & Engineering Solutions + * Copyright(C) 1999-2023 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. * @@ -36,6 +36,8 @@ #include // for ex_close, EX_READ, etc namespace { + int my_getsubopt(char **optionp, char *const *tokens, char **valuep); + void print_usage(); std::string remove_extension(const std::string &filename) @@ -175,21 +177,10 @@ int cmd_line_arg_parse(int argc, char *argv[], /* Args as passe case 'w': /* Weighting options */ sub_opt = optarg; -#if defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || \ - defined(__MINGW32__) || defined(_WIN64) || defined(__MINGW64__) - fmt::print(stderr, "Windows build does not use getsubopt yet...\n"); - exit(1); -#else while (sub_opt != nullptr && *sub_opt != '\0') { - switch (getsubopt(&sub_opt, (char *const *)weight_subopts, &value)) { + switch (my_getsubopt(&sub_opt, (char *const *)weight_subopts, &value)) { case READ_EXO: - if (value == nullptr) { - ctemp = - fmt::format("FATAL: must specify a file name with {}", weight_subopts[READ_EXO]); - Gen_Error(0, ctemp); - return 0; - } - if (strlen(value) == 0) { + if (value == nullptr || strlen(value) == 0) { ctemp = fmt::format("FATAL: must specify a file name with {}", weight_subopts[READ_EXO]); Gen_Error(0, ctemp); @@ -213,12 +204,7 @@ int cmd_line_arg_parse(int argc, char *argv[], /* Args as passe break; /* End "case READ_EXO" */ case VAR_INDX: - if (value == nullptr) { - ctemp = fmt::format("FATAL: must specify a value with {}", weight_subopts[VAR_INDX]); - Gen_Error(0, ctemp); - return 0; - } - if (strlen(value) == 0) { + if (value == nullptr || strlen(value) == 0) { ctemp = fmt::format("FATAL: must specify a value with {}", weight_subopts[VAR_INDX]); Gen_Error(0, ctemp); return 0; @@ -233,12 +219,7 @@ int cmd_line_arg_parse(int argc, char *argv[], /* Args as passe break; case TIME_INDX: - if (value == nullptr) { - ctemp = fmt::format("FATAL: must specify a value with {}", weight_subopts[TIME_INDX]); - Gen_Error(0, ctemp); - return 0; - } - if (strlen(value) == 0) { + if (value == nullptr || strlen(value) == 0) { ctemp = fmt::format("FATAL: must specify a value with {}", weight_subopts[TIME_INDX]); Gen_Error(0, ctemp); return 0; @@ -253,12 +234,7 @@ int cmd_line_arg_parse(int argc, char *argv[], /* Args as passe break; case VAR_NAME: - if (value == nullptr) { - ctemp = fmt::format("FATAL: must specify a value with {}", weight_subopts[VAR_NAME]); - Gen_Error(0, ctemp); - return 0; - } - if (strlen(value) == 0) { + if (value == nullptr || strlen(value) == 0) { ctemp = fmt::format("FATAL: must specify a value with {}", weight_subopts[VAR_NAME]); Gen_Error(0, ctemp); return 0; @@ -327,10 +303,9 @@ int cmd_line_arg_parse(int argc, char *argv[], /* Args as passe Gen_Error(0, ctemp); return 0; - } /* End "switch(getsubopt(&sub_opt, weight_subopts, &value))" */ + } /* End "switch(my_getsubopt(&sub_opt, weight_subopts, &value))" */ - } /* End "while(*sub_opt != '\0')" */ -#endif + } /* End "while(*sub_opt != '\0')" */ break; /* End "case 'w'" */ case 'a': @@ -371,15 +346,10 @@ int cmd_line_arg_parse(int argc, char *argv[], /* Args as passe if (sub_opt != nullptr) { string_to_lower(sub_opt, '\0'); } -#if defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || \ - defined(__MINGW32__) || defined(_WIN64) || defined(__MINGW64__) - fmt::print(stderr, "Windows build does not use getsubopt yet...\n"); - exit(1); -#else while (sub_opt != nullptr && *sub_opt != '\0') { /* Switch over the machine description */ - switch (getsubopt(&sub_opt, (char *const *)mach_subopts, &value)) { + switch (my_getsubopt(&sub_opt, (char *const *)mach_subopts, &value)) { case HCUBE: case HYPERCUBE: if (machine->type < 0) { @@ -465,10 +435,9 @@ int cmd_line_arg_parse(int argc, char *argv[], /* Args as passe default: Gen_Error(0, "FATAL: unknown machine type"); return 0; - } /* End "switch(getsubopt(&sub_opt, mach_subopts, &value))" */ + } /* End "switch(my_getsubopt(&sub_opt, mach_subopts, &value))" */ - } /* End "while(*sub_opt != '\0')" */ -#endif + } /* End "while(*sub_opt != '\0')" */ break; /* End "case 'm'" */ case 'l': @@ -477,13 +446,8 @@ int cmd_line_arg_parse(int argc, char *argv[], /* Args as passe if (sub_opt != nullptr) { string_to_lower(sub_opt, '\0'); } -#if defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || \ - defined(__MINGW32__) || defined(_WIN64) || defined(__MINGW64__) - fmt::print(stderr, "Windows build does not use getsubopt yet...\n"); - exit(1); -#else while (sub_opt != nullptr && *sub_opt != '\0') { - switch (getsubopt(&sub_opt, (char *const *)lb_subopts, &value)) { + switch (my_getsubopt(&sub_opt, (char *const *)lb_subopts, &value)) { case MULTIKL: lb->type = MULTIKL; break; case SPECTRAL: lb->type = SPECTRAL; break; @@ -560,10 +524,9 @@ int cmd_line_arg_parse(int argc, char *argv[], /* Args as passe Gen_Error(0, ctemp); return 0; - } /* End "switch(getsubopt(&sup_opt, mach_subopts, &value))" */ + } /* End "switch(my_getsubopt(&sup_opt, mach_subopts, &value))" */ - } /* End "while(*sup_opt != '\0')" */ -#endif + } /* End "while(*sup_opt != '\0')" */ break; /* End "case 'l'" */ case 'S': prob->no_sph = 1; break; @@ -574,13 +537,8 @@ int cmd_line_arg_parse(int argc, char *argv[], /* Args as passe if (sub_opt != nullptr) { string_to_lower(sub_opt, '\0'); } -#if defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || \ - defined(__MINGW32__) || defined(_WIN64) || defined(__MINGW64__) - fmt::print(stderr, "Windows build does not use getsubopt yet...\n"); - exit(1); -#else while (sub_opt != nullptr && *sub_opt != '\0') { - switch (getsubopt(&sub_opt, (char *const *)solve_subopts, &value)) { + switch (my_getsubopt(&sub_opt, (char *const *)solve_subopts, &value)) { case TOLER: if (value == nullptr) { fmt::print(stderr, "FATAL: tolerance specification requires \ @@ -620,10 +578,9 @@ value\n"); default: fmt::print(stderr, "FATAL: unknown solver option\n"); return 0; - } /* End "switch(getsubopt(&sub_opt, solve_subopts, &value))" */ + } /* End "switch(my_getsubopt(&sub_opt, solve_subopts, &value))" */ - } /* End "while(sub_opt != '\0')" */ -#endif + } /* End "while(sub_opt != '\0')" */ break; /* End "case 's'" */ case 'g': @@ -1757,6 +1714,78 @@ int check_inp_specs(std::string &exoII_inp_file, std::string &nemI_out_file, } /*-------------------End check_inp_specs()-----------------*/ namespace { + /* Parse comma separate list into words. + Copyright (C) 1996, 1997, 1999, 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1996. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + + const char *my_strchrnul(const char *s, int c) + { + const char *result = strchr(s, c); + + if (!result) { + result = (char *)s + strlen(s); + } + + return (result); + } + + /* Parse comma separated suboption from *OPTIONP and match against + strings in TOKENS. If found return index and set *VALUEP to + optional value introduced by an equal sign. If the suboption is + not part of TOKENS return in *VALUEP beginning of unknown + suboption. On exit *OPTIONP is set to the beginning of the next + token or at the terminating NUL character. */ + int my_getsubopt(char **optionp, char *const *tokens, char **valuep) + { + if (**optionp == '\0') + return -1; + + /* Find end of next token. */ + char *endp = (char *)my_strchrnul(*optionp, ','); + + /* Find start of value. */ + char *vstart = (char *)memchr(*optionp, '=', endp - *optionp); + if (vstart == nullptr) + vstart = endp; + + /* Try to match the characters between *OPTIONP and VSTART against + one of the TOKENS. */ + for (int cnt = 0; tokens[cnt] != nullptr; ++cnt) + if (strncmp(*optionp, tokens[cnt], vstart - *optionp) == 0 && + tokens[cnt][vstart - *optionp] == '\0') { + /* We found the current option in TOKENS. */ + *valuep = vstart != endp ? vstart + 1 : nullptr; + + if (*endp != '\0') + *endp++ = '\0'; + *optionp = endp; + + return cnt; + } + + /* The current suboption does not match any option. */ + *valuep = *optionp; + + if (*endp != '\0') + *endp++ = '\0'; + *optionp = endp; + + return -1; + } + void print_usage() { fmt::print("\nusage:\t{} [-h] [<-n|-e> -o " diff --git a/packages/seacas/applications/nem_slice/elb_util.C b/packages/seacas/applications/nem_slice/elb_util.C index f3e1ad41de66..93d258d8c98d 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-2021 National Technology & Engineering Solutions + * Copyright(C) 1999-2022 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. * @@ -309,12 +309,14 @@ namespace { } } +#ifndef NDEBUG template void assert_sorted(INT *vector, size_t vecsize) { for (size_t i = 1; i < vecsize; i++) { assert(vector[i - 1] <= vector[i]); } } +#endif } // namespace /***************************************************************************** @@ -329,7 +331,9 @@ template void find_first_last(int64_t val, size_t vecsize, int64_t *vector, int6 template void find_first_last(INT val, size_t vecsize, INT *vector, INT *first, INT *last) { - /* assert_sorted(vector, vecsize); */ +#ifndef NDEBUG + assert_sorted(vector, vecsize); +#endif *first = -1; *last = -1; diff --git a/packages/seacas/applications/nem_slice/getsubopt.c b/packages/seacas/applications/nem_slice/getsubopt.c new file mode 100644 index 000000000000..8d9b8e6d0c99 --- /dev/null +++ b/packages/seacas/applications/nem_slice/getsubopt.c @@ -0,0 +1,88 @@ +/* + * code lifted from uClibc + * http://git.uclibc.org/uClibc/tree/libc/unistd/getsubopt.c + */ + +/* Parse comma separate list into words. + Copyright (C) 1996, 1997, 1999, 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1996. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + + +#include +#include + +char *strchrnul(const char *s, int c) +{ + char *result; + + result = strchr( s, c ); + + if( !result ) + { + result = (char *)s + strlen( s ); + } + + return( result ); +} + +/* Parse comma separated suboption from *OPTIONP and match against + strings in TOKENS. If found return index and set *VALUEP to + optional value introduced by an equal sign. If the suboption is + not part of TOKENS return in *VALUEP beginning of unknown + suboption. On exit *OPTIONP is set to the beginning of the next + token or at the terminating NUL character. */ +int +getsubopt (char **optionp, char *const *tokens, char **valuep) +{ + char *endp, *vstart; + int cnt; + + if (**optionp == '\0') + return -1; + + /* Find end of next token. */ + endp = strchrnul (*optionp, ','); + + /* Find start of value. */ + vstart = memchr (*optionp, '=', endp - *optionp); + if (vstart == NULL) + vstart = endp; + + /* Try to match the characters between *OPTIONP and VSTART against + one of the TOKENS. */ + for (cnt = 0; tokens[cnt] != NULL; ++cnt) + if (strncmp (*optionp, tokens[cnt], vstart - *optionp) == 0 + && tokens[cnt][vstart - *optionp] == '\0') + { + /* We found the current option in TOKENS. */ + *valuep = vstart != endp ? vstart + 1 : NULL; + + if (*endp != '\0') + *endp++ = '\0'; + *optionp = endp; + + return cnt; + } + + /* The current suboption does not match any option. */ + *valuep = *optionp; + + if (*endp != '\0') + *endp++ = '\0'; + *optionp = endp; + + return -1; +} diff --git a/packages/seacas/applications/slice/Slice.C b/packages/seacas/applications/slice/Slice.C index 2e9e8bae7847..0136879548ef 100644 --- a/packages/seacas/applications/slice/Slice.C +++ b/packages/seacas/applications/slice/Slice.C @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2022 National Technology & Engineering Solutions +// Copyright(C) 1999-2023 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. // @@ -457,7 +457,7 @@ namespace { template void create_adjacency_list(const Ioss::Region ®ion, std::vector &pointer, - std::vector &adjacency, INT dummy) + std::vector &adjacency, INT) { progress(__func__); // Size of pointer list is element count + 1; @@ -500,7 +500,7 @@ namespace { template void decompose_elements(const Ioss::Region ®ion, SystemInterface &interFace, - std::vector &elem_to_proc, INT dummy) + std::vector &elem_to_proc, IOSS_MAYBE_UNUSED INT dummy) { progress(__func__); // Populate the 'elem_to_proc' vector with a mapping from element to processor. @@ -1730,8 +1730,8 @@ namespace { } progress("\tProc_node reserved"); - size_t sum_on_proc_count = 0; - Ioss::DatabaseIO *db = region.get_database(); + IOSS_MAYBE_UNUSED size_t sum_on_proc_count = 0; + Ioss::DatabaseIO *db = region.get_database(); const auto &ebs = region.get_element_blocks(); size_t block_count = ebs.size(); @@ -1913,7 +1913,7 @@ namespace { Ioss::copy_database(region, output_region, options); // KLUGE: The metadata has already been written on - // output_region, but we couln't define the maps until now, so + // output_region, but we couldn't define the maps until now, so // need to update the metadata with map information and hope // that no other maps exist on the database... if (interFace.outputDecompMap_) { diff --git a/packages/seacas/applications/zellij/UnitCell.C b/packages/seacas/applications/zellij/UnitCell.C index 99553588a2c8..8a8af04274ff 100644 --- a/packages/seacas/applications/zellij/UnitCell.C +++ b/packages/seacas/applications/zellij/UnitCell.C @@ -1,4 +1,4 @@ -// Copyright(C) 2021 National Technology & Engineering Solutions +// Copyright(C) 2021, 2023 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. // @@ -76,9 +76,13 @@ namespace { void sort_face_nodes(std::vector &face_nodes, const std::vector &coord_j, const std::vector &coord_i) { - Ioss::sort(face_nodes.begin(), face_nodes.end(), [&coord_j, &coord_i](size_t a, size_t b) { - return float(coord_i[a]) < float(coord_i[b]) || - (approx_equal(coord_i[a], coord_i[b]) && float(coord_j[a]) < float(coord_j[b])); + // NOTE: The `!approx_equal(coord_j[a], coord_j[b])` portion of the less than comparison + // is meant to handle values close to but one or both are not exactly zero. + Ioss::sort(face_nodes.begin(), face_nodes.end(), [&coord_j](size_t a, size_t b) { + return !approx_equal(coord_j[a], coord_j[b]) && float(coord_j[a]) < float(coord_j[b]); + }); + std::stable_sort(face_nodes.begin(), face_nodes.end(), [&coord_i](size_t a, size_t b) { + return !approx_equal(coord_i[a], coord_i[b]) && float(coord_i[a]) < float(coord_i[b]); }); } } // namespace @@ -100,31 +104,64 @@ UnitCell::UnitCell(std::shared_ptr region) : m_region(region) minmax_x = std::make_pair(*x_min_max_it.first, *x_min_max_it.second); minmax_y = std::make_pair(*y_min_max_it.first, *y_min_max_it.second); + if (debug_level & 4) { + fmt::print("Min / Max X = {} ... {}\n", minmax_x.first, minmax_x.second); + fmt::print("Min / Max Y = {} ... {}\n", minmax_y.first, minmax_y.second); + } // Now iterate all nodes and categorize if on a face -- minx, maxx, miny, maxy, gather_face_nodes(coord_x, minmax_x, min_I_face, max_I_face); gather_face_nodes(coord_y, minmax_y, min_J_face, max_J_face); + if (debug_level & 4) { + fmt::print("Nodes on X Face = {}\n", min_I_face.size()); + fmt::print("Nodes on Y Face = {}\n", min_J_face.size()); + } sort_face_nodes(min_I_face, coord_z, coord_y); sort_face_nodes(max_I_face, coord_z, coord_y); sort_face_nodes(min_J_face, coord_z, coord_x); sort_face_nodes(max_J_face, coord_z, coord_x); - if (debug_level & 4) { // Output each set of nodes -- fmt::print("\nSORTED:\n"); - fmt::print("Min I: {}\n\n", fmt::join(min_I_face, " ")); - fmt::print("Max I: {}\n\n", fmt::join(max_I_face, " ")); - fmt::print("Min J: {}\n\n", fmt::join(min_J_face, " ")); - fmt::print("Max J: {}\n\n", fmt::join(max_J_face, " ")); + fmt::print("\tMin/Max I Face:\n"); + for (size_t i = 0; i < min_I_face.size(); i++) { + auto min_I = min_I_face[i]; + auto max_I = max_I_face[i]; + fmt::print("\t\t{:10}: {:12.4e} {:12.4e} {:12.4e}\t{:10}: {:12.4e} {:12.4e} {:12.4e}\n", + min_I, coord_x[min_I], coord_y[min_I], coord_z[min_I], max_I, coord_x[max_I], + coord_y[max_I], coord_z[max_I]); + } + fmt::print("\tMin/Max J Face:\n"); + for (size_t i = 0; i < min_J_face.size(); i++) { + auto min_J = min_J_face[i]; + auto max_J = max_J_face[i]; + fmt::print("\t\t{:10}: {:12.4e} {:12.4e} {:12.4e}\t{:10}: {:12.4e} {:12.4e} {:12.4e}\n", + min_J, coord_x[min_J], coord_y[min_J], coord_z[min_J], max_J, coord_x[max_J], + coord_y[max_J], coord_z[max_J]); + } } #ifndef NDEBUG for (size_t i = 0; i < min_I_face.size(); i++) { auto minI = min_I_face[i]; auto maxI = max_I_face[i]; + SMART_ASSERT((size_t)minI < coord_y.size()); + SMART_ASSERT((size_t)maxI < coord_y.size()); + SMART_ASSERT((size_t)minI < coord_z.size()); + SMART_ASSERT((size_t)maxI < coord_z.size()); SMART_ASSERT(approx_equal(coord_y[minI], coord_y[maxI]))(coord_y[minI])(coord_y[maxI]); SMART_ASSERT(approx_equal(coord_z[minI], coord_z[maxI]))(coord_z[minI])(coord_z[maxI]); } + for (size_t i = 0; i < min_J_face.size(); i++) { + auto minJ = min_J_face[i]; + auto maxJ = max_J_face[i]; + SMART_ASSERT((size_t)minJ < coord_x.size()); + SMART_ASSERT((size_t)maxJ < coord_x.size()); + SMART_ASSERT((size_t)minJ < coord_z.size()); + SMART_ASSERT((size_t)maxJ < coord_z.size()); + SMART_ASSERT(approx_equal(coord_x[minJ], coord_x[maxJ]))(coord_x[minJ])(coord_z[maxJ]); + SMART_ASSERT(approx_equal(coord_z[minJ], coord_z[maxJ]))(coord_z[minJ])(coord_z[maxJ]); + } #endif // Determine 'K' -- size of minI_minJ corner list. diff --git a/packages/seacas/applications/zellij/ZE_SystemInterface.C b/packages/seacas/applications/zellij/ZE_SystemInterface.C index 6955806efcd5..43f784401eaa 100644 --- a/packages/seacas/applications/zellij/ZE_SystemInterface.C +++ b/packages/seacas/applications/zellij/ZE_SystemInterface.C @@ -39,36 +39,36 @@ void SystemInterface::enroll_options() options_.enroll( "rcb", Ioss::GetLongOption::NoValue, - "Use recursive coordinate bisection method to decompose the input mesh in a parallel run.", + "Use recursive coordinate bisection method to decompose the input lattice for parallel output.", nullptr); options_.enroll( "rib", Ioss::GetLongOption::NoValue, - "Use recursive inertial bisection method to decompose the input mesh in a parallel run.", + "Use recursive inertial bisection method to decompose the input lattice for parallel output.", nullptr); options_.enroll("hsfc", Ioss::GetLongOption::NoValue, - "Use hilbert space-filling curve method to decompose the input mesh in a " - "parallel run. [default]", + "Use hilbert space-filling curve method to decompose the input lattice for " + "parallel output. [default]", nullptr); options_.enroll("linear", Ioss::GetLongOption::NoValue, - "Use the linear method to decompose the input mesh in a parallel run.\n" + "Use the linear method to decompose the input lattice for parallel output.\n" "\t\tElements in order first n/p to proc 0, next to proc 1.", nullptr); options_.enroll("cyclic", Ioss::GetLongOption::NoValue, - "Use the cyclic method to decompose the input mesh in a parallel run.\n" + "Use the cyclic method to decompose the input lattice for parallel output.\n" "\t\tElements handed out to id % proc_count", nullptr); options_.enroll("random", Ioss::GetLongOption::NoValue, - "Use the random method to decompose the input mesh in a parallel run.\n" + "Use the random method to decompose the input lattice for parallel output.\n" "\t\tElements assigned randomly to processors in a way that preserves balance\n" "\t\t(do *not* use for a real run)", nullptr, nullptr, true); options_.enroll("ranks", Ioss::GetLongOption::MandatoryValue, - "Number of ranks to decompose mesh across", "1"); + "Number of ranks to decompose mesh/lattice across", "1"); options_.enroll("start_rank", Ioss::GetLongOption::MandatoryValue, "In partial output mode, start outputting decomposed files at this rank", "0"); diff --git a/packages/seacas/libraries/aprepro_lib/CMakeLists.txt b/packages/seacas/libraries/aprepro_lib/CMakeLists.txt index 331bc5841cf5..8c896e3099ed 100644 --- a/packages/seacas/libraries/aprepro_lib/CMakeLists.txt +++ b/packages/seacas/libraries/aprepro_lib/CMakeLists.txt @@ -30,6 +30,7 @@ endif() SET(HEADERS aprepro.h + apr_tokenize.h ) SET(SOURCES diff --git a/packages/seacas/libraries/aprepro_lib/apr_aprepro.cc b/packages/seacas/libraries/aprepro_lib/apr_aprepro.cc index 4bb30be2eb86..869fc77877b9 100644 --- a/packages/seacas/libraries/aprepro_lib/apr_aprepro.cc +++ b/packages/seacas/libraries/aprepro_lib/apr_aprepro.cc @@ -323,7 +323,7 @@ namespace SEAMS { /* See if file exists in current directory (or as specified) */ auto pointer = new std::fstream(file, smode); - if ((pointer == nullptr || pointer->bad() || !pointer->good()) && + if ((pointer->bad() || !pointer->good()) && !ap_options.include_path.empty()) { /* If there is an include path specified, try opening file there */ std::string file_path(ap_options.include_path); @@ -334,7 +334,7 @@ namespace SEAMS { } /* If pointer still null, print error message */ - if (pointer == nullptr || pointer->fail() || pointer->bad() || !pointer->good()) { + if (pointer->fail() || pointer->bad() || !pointer->good()) { std::string err = "Can't open '" + file + "'. " + strerror(errno); error(err, false); delete pointer; @@ -356,7 +356,7 @@ namespace SEAMS { auto pointer = new std::fstream(file, smode); - if ((pointer == nullptr || pointer->bad() || !pointer->good()) && + if ((pointer->bad() || !pointer->good()) && !ap_options.include_path.empty()) { /* If there is an include path specified, try opening file there */ std::string file_path(ap_options.include_path); diff --git a/packages/seacas/libraries/chaco/README b/packages/seacas/libraries/chaco/README index 99b0203391f3..ba5d586457c3 100644 --- a/packages/seacas/libraries/chaco/README +++ b/packages/seacas/libraries/chaco/README @@ -1,2 +1,2 @@ -Documentation vailable from http://sandialabs.github.io/seacas/#chaco +Documentation available from http://sandialabs.github.io/seacas/#chaco diff --git a/packages/seacas/libraries/exodus/Doxyfile b/packages/seacas/libraries/exodus/Doxyfile index 8081dd4064e5..201e25c8aa9f 100644 --- a/packages/seacas/libraries/exodus/Doxyfile +++ b/packages/seacas/libraries/exodus/Doxyfile @@ -86,7 +86,7 @@ CREATE_SUBDIRS = NO # level increment doubles the number of directories, resulting in 4096 # directories at level 8 which is the default and also the maximum value. The # sub-directories are organized in 2 levels, the first level always has a fixed -# numer of 16 directories. +# number of 16 directories. # Minimum value: 0, maximum value: 8, default value: 8. # This tag requires that the tag CREATE_SUBDIRS is set to YES. diff --git a/packages/seacas/libraries/exodus/src/ex_inquire.c b/packages/seacas/libraries/exodus/src/ex_inquire.c index 77958805f85c..fdbec746dc3c 100644 --- a/packages/seacas/libraries/exodus/src/ex_inquire.c +++ b/packages/seacas/libraries/exodus/src/ex_inquire.c @@ -211,9 +211,7 @@ static int ex_inquire_internal(int exoid, int req_info, int64_t *ret_int, float flt_cvt(ret_float, version); } - if (ret_int) { - *ret_int = EX_API_VERS_NODOT; - } + *ret_int = EX_API_VERS_NODOT; break; case EX_INQ_DB_MAX_ALLOWED_NAME_LENGTH: diff --git a/packages/seacas/libraries/exodus/src/ex_put_assemblies.c b/packages/seacas/libraries/exodus/src/ex_put_assemblies.c index e5908dbd8ab6..d37fe4999be2 100644 --- a/packages/seacas/libraries/exodus/src/ex_put_assemblies.c +++ b/packages/seacas/libraries/exodus/src/ex_put_assemblies.c @@ -172,6 +172,7 @@ int ex_put_assemblies(int exoid, size_t count, const struct ex_assembly *assembl free(entlst_id); EX_FUNC_LEAVE(EX_FATAL); } + in_define = false; } /* Update the maximum_name_length attribute on the file. */ diff --git a/packages/seacas/libraries/nemesis/README b/packages/seacas/libraries/nemesis/README index e94eab1f9c24..83a9a2aafe4d 100644 --- a/packages/seacas/libraries/nemesis/README +++ b/packages/seacas/libraries/nemesis/README @@ -13,13 +13,13 @@ information. The NEMESIS information is written and read via C or C++ callable functions which compromise the NEMESIS I API. NOTE: -All nemesis functinality has been moved into the exodus library API. +All nemesis functionality has been moved into the exodus library API. All (almost) nemesis API functions are available in exodus by replacing the `ne_` at the beginning of the function name with `ex_`. For example, the nemesis function `ne_get_init_global` is known as `ex_get_init_global` in the exodus library API. -The nemesis library is only retained for backward compatiblity; for +The nemesis library is only retained for backward compatibility; for all new development, the exodus library should be used instead. diff --git a/packages/seacas/libraries/suplib_cpp/time_stamp.C b/packages/seacas/libraries/suplib_cpp/time_stamp.C index aacf4aae245b..aca247ceab7b 100644 --- a/packages/seacas/libraries/suplib_cpp/time_stamp.C +++ b/packages/seacas/libraries/suplib_cpp/time_stamp.C @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2021 National Technology & Engineering Solutions +// Copyright(C) 1999-2021, 2023 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,6 @@ std::string time_stamp(const std::string &format) time_t calendar_time = std::time(nullptr); struct tm *local_time = std::localtime(&calendar_time); - std::string time_string = fmt::format(format, *local_time); + std::string time_string = fmt::format(fmt::runtime(format), *local_time); return time_string; } diff --git a/packages/seacas/scripts/decomp b/packages/seacas/scripts/decomp index 14ed34d8fc4d..63580a1be4ab 100755 --- a/packages/seacas/scripts/decomp +++ b/packages/seacas/scripts/decomp @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright(C) 1999-2020 National Technology & Engineering Solutions +# Copyright(C) 1999-2020, 2023 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. # @@ -20,7 +20,7 @@ Usage: decomp [-h] --processors [-n ] [--root ] [--subdir ] [--spread_suffix ] [--multikl] [--spectral] [--inertial] [--linear] [--rcb] [--rcb_ignore_z] [--rib] [--hsfc] [--random] [--scattered] - [...others...] meshfile.ext + [--weight ] [...others...] meshfile.ext Decomposition methods: [0..3] = speed ranking 0=fastest (See chaco and/or zoltan documentation for more details) @@ -56,6 +56,7 @@ Other options: --nodal Nodal Decomposition (-N) --elemental Elemental Decomposition (default, -E) --input Optional nem_slice input file (-i) +--weight Specification of weighting options (-w) --viz_mesh Output mesh showing processor distribution of elements. (-V) --spheres_linear Decompose sphere elements using linear method (matches old behavior) (-s) --processors #p Specify number of processors (-p, -j) @@ -63,6 +64,9 @@ Other options: --subdir sub_dir Continuation of the path on the separate disks to the files (-S) --spread_suffix x Suffix for parallel files (default: meshfile suffix) (-X) --64 Force creation of 64-bit integer decomposed files (-6) +-n options Specify additional nem_slice options + + Documentation: https://sandialabs.github.io/seacas-docs/sphinx/html/index.html#decomp" help-email: sierra-help@sandia.gov DECOMP_USAGE_EOF @@ -112,6 +116,7 @@ Other options: -V Output mesh showing processor distribution of elements -6 Force creation of 64-bit integer decomposed files + Documentation: https://sandialabs.github.io/seacas-docs/sphinx/html/index.html#decomp" help-email: sierra-help@sandia.gov DECOMP_USAGE_EOF @@ -149,6 +154,7 @@ function execute_loadbalance { input=$6 LAUNCH=$7 decomp_type=$8 + weighting=$9 nemesis=$basename.$suffix_mesh.nem genesis=$basename.$suffix_mesh @@ -174,16 +180,16 @@ function execute_loadbalance { then echo ${txtblu} echo "Executing:" - echo " $LAUNCH $NEM_SLICE $decomp_type $spheres $do_viz $decomp_method $nem_slice_flag -o $nemesis -m mesh=$processors -a $input $genesis" + echo " $LAUNCH $NEM_SLICE $decomp_type $spheres $do_viz $decomp_method $weighting $nem_slice_flag -o $nemesis -m mesh=$processors -a $input $genesis" echo ${txtrst} - (${NOOP:+echo }$LAUNCH $NEM_SLICE $decomp_type $spheres $do_viz $decomp_method $nem_slice_flag -o $nemesis -m mesh=$processors -a $input $genesis) + (${NOOP:+echo }$LAUNCH $NEM_SLICE $decomp_type $spheres $do_viz $decomp_method $weighting $nem_slice_flag -o $nemesis -m mesh=$processors -a $input $genesis) load_rc=$? else echo ${txtblu} echo "Executing:" - echo " $LAUNCH $NEM_SLICE $decomp_type $spheres $do_viz $decomp_method $nem_slice_flag -o $nemesis -m mesh=$processors $genesis" + echo " $LAUNCH $NEM_SLICE $decomp_type $spheres $do_viz $decomp_method $weighting $nem_slice_flag -o $nemesis -m mesh=$processors $genesis" echo ${txtrst} - (${NOOP:+echo }$LAUNCH $NEM_SLICE $decomp_type $spheres $do_viz $decomp_method $nem_slice_flag -o $nemesis -m mesh=$processors $genesis) + (${NOOP:+echo }$LAUNCH $NEM_SLICE $decomp_type $spheres $do_viz $decomp_method $weighting $nem_slice_flag -o $nemesis -m mesh=$processors $genesis) load_rc=$? fi return $load_rc @@ -276,6 +282,7 @@ debug_level='0' decomp_type="-e" decomp_method="-l inertial" nem_slice_flag="-c" +weighting='' rootdir="`pwd`/" subdir="." suffix_spread='' @@ -309,7 +316,7 @@ fi if [ $OLDGETOPT -eq 1 ] ; then TEMP=$(getopt Hh6ENn:i:o:p:j:r:R:S:X:sl:vVd: $*) else - TEMP=$(getopt -o Hh6ENn:i:o:p:j:r:R:S:X:sl:vVd: -a \ + TEMP=$(getopt -o Hh6ENn:i:o:p:j:r:R:S:X:sl:vVd:w: -a \ --long input: \ --long launch: \ --long nolaunch \ @@ -339,6 +346,7 @@ else --long scattered \ --long brick \ --long zpinch \ + --long weight: -n 'decomp' -- "$@") fi @@ -366,6 +374,8 @@ while true ; do decomp_type="-e" ; shift ;; (-i|--input) input=$2 ; shift 2 ;; + (-w|--weight) + weighting="-w $2" ; shift 2 ;; (-p|-j|--processors) processors=$2 ; shift 2 ;; (-R|--rootdir) @@ -517,7 +527,7 @@ then fi ######################################################################## -execute_loadbalance "$basename" "$processors" "$decomp_method" "$nem_slice_flag" "$NEM_SLICE" "$input" "$LAUNCH" "$decomp_type" +execute_loadbalance "$basename" "$processors" "$decomp_method" "$nem_slice_flag" "$NEM_SLICE" "$input" "$LAUNCH" "$decomp_type" "$weighting" if [ $? -ne 0 ] then echo ${txtred} diff --git a/packages/seacas/scripts/decomp.in b/packages/seacas/scripts/decomp.in index 652551b3898a..2042c3cf31ba 100644 --- a/packages/seacas/scripts/decomp.in +++ b/packages/seacas/scripts/decomp.in @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright(C) 1999-2020 National Technology & Engineering Solutions +# Copyright(C) 1999-2020, 2023 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. # @@ -19,7 +19,7 @@ Usage: decomp [-h] --processors [-n ] [--root ] [--subdir ] [--spread_suffix ] [--multikl] [--spectral] [--inertial] [--linear] [--rcb] [--rcb_ignore_z] [--rib] [--hsfc] [--random] [--scattered] - [...others...] meshfile.ext + [--weight ] [...others...] meshfile.ext Decomposition methods: [0..3] = speed ranking 0=fastest (See chaco and/or zoltan documentation for more details) @@ -46,19 +46,22 @@ Decomposition methods: [0..3] = speed ranking 0=fastest For example "--multikl" is the same as "-l multikl" Other options: ---help Print this message (-h) ---nodal Nodal Decomposition (-N) ---elemental Elemental Decomposition (default, -E) ---input Optional nem_slice input file (-i) ---viz_mesh Output mesh showing processor distribution of elements. (-V) ---spheres_linear Decompose sphere elements using linear method (matches old behavior) (-s) ---processors #p Specify number of processors (-p, -j) ---root root_dir Root directory to begin the path to on the separate disks (-R) ---subdir sub_dir Continuation of the path on the separate disks to the files (-S) ---spread_suffix x Suffix for parallel files (default: meshfile suffix) (-X) ---64 Force creation of 64-bit integer decomposed files (-6) - - help-email: seacas-users@software.sandia.gov +--help Print this message (-h) +--nodal Nodal Decomposition (-N) +--elemental Elemental Decomposition (default, -E) +--input Optional nem_slice input file (-i) +--weight Specification of weighting options (-w) +--viz_mesh Output mesh showing processor distribution of elements. (-V) +--spheres_linear Decompose sphere elements using linear method (matches old behavior) (-s) +--processors <#p> Specify number of processors (-p, -j) +--root Root directory to begin the path to on the separate disks (-R) +--subdir Continuation of the path on the separate disks to the files (-S) +--spread_suffix Suffix for parallel files (default: meshfile suffix) (-X) +--64 Force creation of 64-bit integer decomposed files (-6) +-n Specify nem_slice options + + Documentation: https://sandialabs.github.io/seacas-docs/sphinx/html/index.html#decomp" + help-email: sierra-help@sandia.gov DECOMP_USAGE_EOF exit 1 @@ -107,6 +110,7 @@ Other options: -V Output mesh showing processor distribution of elements -6 Force creation of 64-bit integer decomposed files + Documentation: https://sandialabs.github.io/seacas-docs/sphinx/html/index.html#decomp" help-email: sierra-help@sandia.gov DECOMP_USAGE_EOF @@ -143,6 +147,7 @@ function execute_loadbalance { NEM_SLICE=$5 input=$6 decomp_type=$7 + weighting=$8 nemesis=$basename.$suffix_mesh.nem genesis=$basename.$suffix_mesh @@ -160,24 +165,20 @@ function execute_loadbalance { return -1 fi - date=`date '+%m/%d/%y'` - time=`date '+%H:%M:%S'` - prob_dir=`pwd | sed "s/.*\///g"` - - if [ -n "$input" -a -e "$input" ] + if [ -n "$input" ] && [ -e "$input" ] then echo ${txtblu} echo "Executing:" - echo " $NEM_SLICE $decomp_type $spheres $do_viz $decomp_method $nem_slice_flag -o $nemesis -m mesh=$processors -a $input $genesis" + echo " $NEM_SLICE $decomp_type $spheres $do_viz $decomp_method $weighting $nem_slice_flag -o $nemesis -m mesh=$processors -a $input $genesis" echo ${txtrst} - ($NEM_SLICE $decomp_type $spheres $do_viz $decomp_method $nem_slice_flag -o $nemesis -m mesh=$processors -a $input $genesis) + ($NEM_SLICE $decomp_type $spheres $do_viz $decomp_method $weighting $nem_slice_flag -o $nemesis -m mesh=$processors -a $input $genesis) load_rc=$? else echo ${txtblu} echo "Executing:" - echo " $NEM_SLICE $decomp_type $spheres $do_viz $decomp_method $nem_slice_flag -o $nemesis -m mesh=$processors $genesis" + echo " $NEM_SLICE $decomp_type $spheres $do_viz $decomp_method $weighting $nem_slice_flag -o $nemesis -m mesh=$processors $genesis" echo ${txtrst} - ($NEM_SLICE $decomp_type $spheres $decomp_method $do_viz $nem_slice_flag -o $nemesis -m mesh=$processors $genesis) + ($NEM_SLICE $decomp_type $spheres $decomp_method $do_viz $weighting $nem_slice_flag -o $nemesis -m mesh=$processors $genesis) load_rc=$? fi return $load_rc @@ -270,12 +271,12 @@ debug_level='0' decomp_type="-e" decomp_method="-l inertial" nem_slice_flag="-c" -rootdir="`pwd`/" +weighting='' +rootdir="$(pwd)/" subdir="." suffix_spread='' spheres="-S" do_viz="" -curdir=`pwd` use64="" if [ "$ACCESS" == "" ] @@ -300,7 +301,7 @@ popd > /dev/null # 3. If not, then assume we are running in the cmake build directory # and update the paths to nem_slice and nem_spread accordingly... -if [ -x ${basedir}/nem_slice -a -x ${basedir}/nem_spread ]; then +if [ -x ${basedir}/nem_slice ] && [ -x ${basedir}/nem_spread ]; then NEM_SLICE=${basedir}/nem_slice NEM_SPREAD=${basedir}/nem_spread elif [ "${basedir}" == "${instdir}" ] ; then @@ -313,7 +314,7 @@ fi ######################################################################## # Test that the getopt being used will handle the long options... -TEST=`getopt -T` +TEST=$(getopt -T) if [ $? != 4 ] ; then old_getopt OLDGETOPT=1 @@ -328,12 +329,12 @@ fi ######################################################################## # decomp options: if [ $OLDGETOPT -eq 1 ] ; then - TEMP=`getopt Hh6ENn:i:o:p:j:r:R:S:X:sl:vVd: $*` + TEMP=$(getopt Hh6ENn:i:o:p:j:r:R:S:X:sl:vVd: "$@") else - TEMP=`getopt -o Hh6ENn:i:o:p:j:r:R:S:X:sl:vVd: -a \ + TEMP=$(getopt -o Hh6ENn:i:o:p:j:r:R:S:X:sl:vVd:w: -a \ --long input:,help,nem_slice_flag,64,processors:,rootdir:,subdir:,spread_suffix:,spheres_linear,viz_mesh,verbose,debug:,nodal,elemental \ - --long multikl,rcb,rcb_ignore_z,rib,hsfc,spectral,inertial,linear,random,scattered,brick,zpinch \ - -n 'decomp' -- "$@"` + --long multikl,rcb,rcb_ignore_z,rib,hsfc,spectral,inertial,linear,random,scattered,brick,zpinch,weight: \ + -n 'decomp' -- "$@") fi if [ $? != 0 ] ; then usage ; exit 1 ; fi @@ -342,9 +343,7 @@ if [ $? != 0 ] ; then usage ; exit 1 ; fi eval set -- "$TEMP" while true ; do case "$1" in - -h|--help) - usage ; shift ;; - -H|--help) + -h|-H|--help) usage_new ; shift ;; -v|--verbose) set -x ; shift ;; @@ -360,6 +359,8 @@ while true ; do decomp_type="-e" ; shift ;; -i|--input) input=$2 ; shift 2 ;; + -w|--weight) + weighting="-w $2" ; shift 2 ;; -p|-j|--processors) processors=$2 ; shift 2 ;; -R|--rootdir) @@ -464,7 +465,7 @@ then fi ######################################################################## -execute_loadbalance "$basename" "$processors" "$decomp_method" "$nem_slice_flag" "$NEM_SLICE" "$input" "$decomp_type" +execute_loadbalance "$basename" "$processors" "$decomp_method" "$nem_slice_flag" "$NEM_SLICE" "$input" "$decomp_type" "$weighting" if [ $? -ne 0 ] then echo ${txtred} @@ -504,12 +505,13 @@ else time_used="0.000u 0.000s 0:00.00 0.0% 0+0k 0+0io 0pf+0w " # Get name of user running code - userid=`echo $LOGNAME` + userid=$LOGNAME # Write info to audit.log file if [ -w ${ACCESS}/etc/audit.log ] then - echo "decomp ${userid} `date` ${time_used} `hostname`" >> ${ACCESS}/etc/audit.log + date=$(date '+%m/%d/%y') + echo "decomp ${userid} ${date} ${time_used} $(hostname)" >> ${ACCESS}/etc/audit.log fi fi diff --git a/packages/seacas/scripts/tests/test_exodus3.py b/packages/seacas/scripts/tests/test_exodus3.py index b6d950192726..01045fa23837 100755 --- a/packages/seacas/scripts/tests/test_exodus3.py +++ b/packages/seacas/scripts/tests/test_exodus3.py @@ -60,25 +60,21 @@ def test_copy_opened_in_append_mode(self): name="Unit_test", type=exo.ex_entity_type.EX_ASSEMBLY, id=444 ) new.entity_list = [100, 222] - temp_exo_path2 = self.temp_exo_path + "2" + temp_exo_path2 = f"{self.temp_exo_path}2" with exo.exodus(self.temp_exo_path, mode="r") as temp_exofile: - expected = [assem for assem in temp_exofile.get_ids("EX_ASSEMBLY")] + expected = list(temp_exofile.get_ids("EX_ASSEMBLY")) with temp_exofile.copy(temp_exo_path2, True, mode="a") as temp_exofile2: temp_exofile2.put_assembly(new) - copied_output = [ - assem for assem in temp_exofile2.get_ids("EX_ASSEMBLY") - ] + copied_output = list(temp_exofile2.get_ids("EX_ASSEMBLY")) self.assertNotEqual(temp_exofile.modeChar, temp_exofile2.modeChar) self.assertNotEqual(expected, copied_output) def test_copy_opened_in_read_mode(self): - temp_exo_path2 = self.temp_exo_path + "2" + temp_exo_path2 = f"{self.temp_exo_path}2" with exo.exodus(self.temp_exo_path, mode="r") as temp_exofile: with temp_exofile.copy(temp_exo_path2, True, mode="r") as temp_exofile2: - expected = [assem for assem in temp_exofile.get_ids("EX_ASSEMBLY")] - copied_output = [ - assem for assem in temp_exofile2.get_ids("EX_ASSEMBLY") - ] + expected = list(temp_exofile.get_ids("EX_ASSEMBLY")) + copied_output = list(temp_exofile2.get_ids("EX_ASSEMBLY")) self.assertEqual(temp_exofile.modeChar, temp_exofile2.modeChar) self.assertEqual(expected, copied_output) @@ -138,15 +134,15 @@ def test_get_assemblies(self): exo.assembly(name="NewAssembly", type="EX_ASSEMBLY", id=222), exo.assembly(name="FromPython", type="EX_ASSEMBLY", id=333), ] + entity_lists = [ + [200, 300, 400], + [10, 11, 12, 13], + [14, 15, 16], + [10, 16], + [100, 200, 300, 400], + [100, 222], + ] for i, x in enumerate(expected): - entity_lists = [ - [200, 300, 400], - [10, 11, 12, 13], - [14, 15, 16], - [10, 16], - [100, 200, 300, 400], - [100, 222], - ] x.entity_list = entity_lists[i] self.maxDiff = None self.assertEqual(str(expected), str(assemblies)) From d859f6aabbe98e07c29fe53422279f9f0286036c Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Tue, 17 Jan 2023 14:33:57 -0700 Subject: [PATCH 07/14] IOSS: Multiple changes * Use IOSS_MAYBE_UNUSED for variables that might be unused (parallel vs serial, asserts) * CGNS: Fix hang due to inconsistent calling on different ranks * Refactor duplicate field behavior -- IGNORE, WARN, ERROR * "sideset_{id}" is alias to "surface_{id}". Also "nodeset_{id}" with "nodelist_{id}" --- .../libraries/ioss/src/Ioss_CodeTypes.h | 21 +- .../libraries/ioss/src/Ioss_DatabaseIO.C | 35 +- .../libraries/ioss/src/Ioss_DatabaseIO.h | 26 +- .../seacas/libraries/ioss/src/Ioss_Doxygen.h | 1 + .../libraries/ioss/src/Ioss_FaceGenerator.C | 13 +- .../seacas/libraries/ioss/src/Ioss_FileInfo.C | 28 +- .../seacas/libraries/ioss/src/Ioss_FileInfo.h | 3 +- .../seacas/libraries/ioss/src/Ioss_Getline.C | 941 ++++++++++++++++++ .../seacas/libraries/ioss/src/Ioss_Getline.c | 934 ----------------- .../seacas/libraries/ioss/src/Ioss_Glob.h | 6 +- .../libraries/ioss/src/Ioss_GroupingEntity.C | 49 +- .../libraries/ioss/src/Ioss_GroupingEntity.h | 52 +- packages/seacas/libraries/ioss/src/Ioss_Map.C | 186 +++- packages/seacas/libraries/ioss/src/Ioss_Map.h | 23 +- .../libraries/ioss/src/Ioss_ParallelUtils.C | 101 +- .../libraries/ioss/src/Ioss_ParallelUtils.h | 59 +- .../seacas/libraries/ioss/src/Ioss_Region.C | 16 +- .../libraries/ioss/src/Ioss_StructuredBlock.h | 12 +- .../seacas/libraries/ioss/src/Ioss_Utils.h | 3 +- .../ioss/src/Ioss_ZoneConnectivity.h | 11 +- .../ioss/src/cgns/Iocgns_DatabaseIO.C | 28 +- .../ioss/src/cgns/Iocgns_ParallelDatabaseIO.C | 10 +- .../libraries/ioss/src/cgns/Iocgns_Utils.C | 74 +- .../ioss/src/exodus/Ioex_BaseDatabaseIO.C | 16 +- .../ioss/src/exodus/Ioex_DatabaseIO.C | 25 +- .../ioss/src/exodus/Ioex_DecompositionData.C | 58 +- .../ioss/src/exodus/Ioex_ParallelDatabaseIO.C | 14 +- .../ioss/src/gen_struc/Iogs_DatabaseIO.h | 50 +- .../ioss/src/generated/Iogn_DatabaseIO.h | 48 +- .../ioss/src/heartbeat/Iohb_DatabaseIO.C | 57 +- .../ioss/src/heartbeat/Iohb_DatabaseIO.h | 58 +- .../ioss/src/heartbeat/Iohb_Layout.C | 28 +- .../ioss/src/heartbeat/Iohb_Layout.h | 43 +- .../libraries/ioss/src/main/io_modify.C | 2 +- .../ioss/src/pamgen/Iopg_DatabaseIO.h | 50 +- .../ioss/src/text_mesh/Iotm_DatabaseIO.C | 2 +- .../ioss/src/text_mesh/Iotm_DatabaseIO.h | 46 +- .../ioss/src/text_mesh/Iotm_TextMesh.C | 4 +- .../ioss/src/text_mesh/Iotm_TextMesh.h | 5 +- .../text_mesh/Iotm_TextMeshAdjacencyGraph.h | 2 +- .../text_mesh/Iotm_TextMeshSidesetSplitter.h | 4 +- .../text_mesh/Iotm_TextMeshTopologyMapping.h | 3 +- .../ioss/src/utest/Utst_IofxDatabaseIO.C | 2 +- .../ioss/src/utest/Utst_blob_write_read.C | 2 +- .../libraries/ioss/src/utest/Utst_heartbeat.C | 9 +- .../visualization/cgns/Iovs_cgns_DatabaseIO.C | 14 +- .../visualization/cgns/Iovs_cgns_DatabaseIO.h | 172 +--- .../exodus/Iovs_exodus_DatabaseIO.C | 2 +- .../ioss/src/visualization/utils/Iovs_Utils.C | 14 +- 49 files changed, 1785 insertions(+), 1577 deletions(-) create mode 100644 packages/seacas/libraries/ioss/src/Ioss_Getline.C delete mode 100644 packages/seacas/libraries/ioss/src/Ioss_Getline.c diff --git a/packages/seacas/libraries/ioss/src/Ioss_CodeTypes.h b/packages/seacas/libraries/ioss/src/Ioss_CodeTypes.h index a8851f2bdd86..ebd4959f2959 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_CodeTypes.h +++ b/packages/seacas/libraries/ioss/src/Ioss_CodeTypes.h @@ -45,16 +45,27 @@ inline const std::string IOSS_SYM_TENSOR() { return std::string("sym_tensor_33") #include #endif +#if (__cplusplus >= 201703L) +#define IOSS_MAYBE_UNUSED [[maybe_unused]] +#else +#define IOSS_MAYBE_UNUSED +#endif + #if defined(SEACAS_HAVE_MPI) #include -#define PAR_UNUSED(x) using Ioss_MPI_Comm = MPI_Comm; +#define IOSS_PAR_UNUSED(x) #else -#define PAR_UNUSED(x) \ +using Ioss_MPI_Comm = int; +#if (__cplusplus >= 201703L) +// For C++17, we rely on IOSS_MAYBE_UNUSED instead. Can eventually remove all IOSS_PAR_UNUSED... +#define IOSS_PAR_UNUSED(x) +#else +#define IOSS_PAR_UNUSED(x) \ do { \ (void)(x); \ } while (0) -using Ioss_MPI_Comm = int; +#endif #endif #ifdef SEACAS_HAVE_KOKKOS @@ -95,12 +106,12 @@ using Kokkos_Complex = Kokkos::complex; #endif // For use to create a no-op get or put_field_internal function... -#define NOOP_GFI(type) \ +#define IOSS_NOOP_GFI(type) \ int64_t get_field_internal(const type *, const Ioss::Field &, void *, size_t) const override \ { \ return -1; \ } -#define NOOP_PFI(type) \ +#define IOSS_NOOP_PFI(type) \ int64_t put_field_internal(const type *, const Ioss::Field &, void *, size_t) const override \ { \ return -1; \ diff --git a/packages/seacas/libraries/ioss/src/Ioss_DatabaseIO.C b/packages/seacas/libraries/ioss/src/Ioss_DatabaseIO.C index 67495eea1fa3..6fa180275f9c 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_DatabaseIO.C +++ b/packages/seacas/libraries/ioss/src/Ioss_DatabaseIO.C @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2022 National Technology & Engineering Solutions +// Copyright(C) 1999-2023 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. // @@ -207,6 +207,39 @@ namespace Ioss { Utils::check_set_bool_property(properties, "FIELD_STRIP_TRAILING_UNDERSCORE", fieldStripTrailing_); + // Determine how to handle duplicate incompatible fields (transient and attribute field with + // same name, ...) + if (properties.exists("DUPLICATE_FIELD_NAME_BEHAVIOR")) { + auto prop = properties.get("DUPLICATE_FIELD_NAME_BEHAVIOR").get_string(); + if (prop == "IGNORE") { + duplicateFieldBehavior = DuplicateFieldBehavior::IGNORE_; + } + else if (prop == "WARNING") { + duplicateFieldBehavior = DuplicateFieldBehavior::WARNING_; + } + else if (prop == "ERROR") { + duplicateFieldBehavior = DuplicateFieldBehavior::ERROR_; + } + else { + std::ostringstream errmsg; + fmt::print(errmsg, + "Invalid value ({}) for property `DUPLICATE_FIELD_NAME_BEHAVIOR`.\n" + "\tValid values are `IGNORE`, `WARNING`, or `ERROR`\n", + prop); + IOSS_ERROR(errmsg); + } + } + else { + bool allow_duplicate = false; + Utils::check_set_bool_property(properties, "IGNORE_DUPLICATE_FIELD_NAMES", allow_duplicate); + if (allow_duplicate) { + duplicateFieldBehavior = DuplicateFieldBehavior::WARNING_; + } + else { + duplicateFieldBehavior = DuplicateFieldBehavior::ERROR_; + } + } + if (properties.exists("SURFACE_SPLIT_TYPE")) { Ioss::SurfaceSplitType split_type = Ioss::SPLIT_INVALID; auto type = properties.get("SURFACE_SPLIT_TYPE").get_type(); diff --git a/packages/seacas/libraries/ioss/src/Ioss_DatabaseIO.h b/packages/seacas/libraries/ioss/src/Ioss_DatabaseIO.h index 2c0215663fc4..0e08df14a777 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_DatabaseIO.h +++ b/packages/seacas/libraries/ioss/src/Ioss_DatabaseIO.h @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2022 National Technology & Engineering Solutions +// Copyright(C) 1999-2023 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. // @@ -50,6 +50,8 @@ namespace Ioss { namespace Ioss { class EntityBlock; + enum class DuplicateFieldBehavior { UNSET_, IGNORE_, WARNING_, ERROR_ }; + // Contains (parent_element, side) topology pairs using TopoContainer = std::vector>; @@ -433,6 +435,8 @@ namespace Ioss { void set_field_recognition(bool yes_no) { enableFieldRecognition = yes_no; } void set_field_strip_trailing_(bool yes_no) { fieldStripTrailing_ = yes_no; } + DuplicateFieldBehavior get_duplicate_field_behavior() const { return duplicateFieldBehavior; } + void set_lower_case_variable_names(bool true_false) const { lowerCaseVariableNames = true_false; @@ -823,16 +827,18 @@ namespace Ioss { private: #endif - Region *region_{nullptr}; - char fieldSeparator{'_'}; - bool fieldSeparatorSpecified{false}; - bool enableFieldRecognition{true}; - bool fieldStripTrailing_{false}; - bool isInput; - bool isParallelConsistent{ + Region *region_{nullptr}; + char fieldSeparator{'_'}; + DuplicateFieldBehavior duplicateFieldBehavior{DuplicateFieldBehavior::UNSET_}; + + bool fieldSeparatorSpecified{false}; + bool enableFieldRecognition{true}; + bool fieldStripTrailing_{false}; + bool isInput; + bool isParallelConsistent{ true}; // True if application will make field data get/put calls parallel - // consistently. - // True is default and required for parallel-io databases. + // consistently. + // True is default and required for parallel-io databases. // Even if false, metadata operations must be called by all processors bool singleProcOnly{false}; // True if history or heartbeat which is only written from proc 0... diff --git a/packages/seacas/libraries/ioss/src/Ioss_Doxygen.h b/packages/seacas/libraries/ioss/src/Ioss_Doxygen.h index ae99fa8ef15a..5346246216d5 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_Doxygen.h +++ b/packages/seacas/libraries/ioss/src/Ioss_Doxygen.h @@ -84,6 +84,7 @@ PARALLEL_IO_MODE | netcdf4, hdf5, pnetcdf, (mpiio and mpiposix are deprecated) FIELD_STRIP_TRAILING_UNDERSCORE | on / [off] | If `FIELD_SUFFIX_SEPARATOR` is empty and there are fields that end with an underscore, then strip the underscore. (`a_x`, `a_y`, `a_z` is vector field `a`). IGNORE_ATTRIBUTE_NAMES | on/[off] | Do not read the attribute names that may exist on an input database. Instead for an element block with N attributes, the fields will be named `attribute_1` ... `attribute_N` SURFACE_SPLIT_TYPE | {type} | Specify how to split sidesets into homogeneous sideblocks. Either an integer or string: 1 or `TOPOLOGY`, 2 or `BLOCK`, 3 or `NO_SPLIT`. Default is `TOPOLOGY` if not specified. + DUPLICATE_FIELD_NAME_BEHAVIOR | {behavior} | Determine how to handle duplicate incompatible fields on a database. Valid values are `IGNORE`, `WARNING`, or `ERROR` (default). An incompatible field is two or more fields with the same name, but different sizes or roles or types. ## Output Database-Related Properties Property | Value | Description diff --git a/packages/seacas/libraries/ioss/src/Ioss_FaceGenerator.C b/packages/seacas/libraries/ioss/src/Ioss_FaceGenerator.C index 48536cf10cbb..04e6bb08d47c 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_FaceGenerator.C +++ b/packages/seacas/libraries/ioss/src/Ioss_FaceGenerator.C @@ -29,7 +29,7 @@ // Options for generating hash function key... #define USE_MURMUR -//#define USE_RANDOM +// #define USE_RANDOM #define DO_TIMING 0 @@ -112,12 +112,13 @@ namespace { } template - void resolve_parallel_faces(Ioss::Region ®ion, Ioss::FaceUnorderedSet &faces, - const std::vector &hash_ids, INT /*dummy*/) + void resolve_parallel_faces(IOSS_MAYBE_UNUSED Ioss::Region ®ion, + IOSS_MAYBE_UNUSED Ioss::FaceUnorderedSet &faces, + IOSS_MAYBE_UNUSED const std::vector &hash_ids, INT /*dummy*/) { - PAR_UNUSED(region); - PAR_UNUSED(faces); - PAR_UNUSED(hash_ids); + IOSS_PAR_UNUSED(region); + IOSS_PAR_UNUSED(faces); + IOSS_PAR_UNUSED(hash_ids); #ifdef SEACAS_HAVE_MPI size_t proc_count = region.get_database()->util().parallel_size(); diff --git a/packages/seacas/libraries/ioss/src/Ioss_FileInfo.C b/packages/seacas/libraries/ioss/src/Ioss_FileInfo.C index 728358082e95..4c4cb2065c14 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_FileInfo.C +++ b/packages/seacas/libraries/ioss/src/Ioss_FileInfo.C @@ -28,8 +28,8 @@ #else #include #if defined(__APPLE__) && defined(__MACH__) -#include #include +#include #else #include #endif @@ -85,10 +85,11 @@ namespace Ioss { //: Returns TRUE if the file exists (is readable) bool FileInfo::exists() const { return exists_; } - int FileInfo::parallel_exists(Ioss_MPI_Comm communicator, std::string &where) const + int FileInfo::parallel_exists(IOSS_MAYBE_UNUSED Ioss_MPI_Comm communicator, + IOSS_MAYBE_UNUSED std::string &where) const { - PAR_UNUSED(communicator); - PAR_UNUSED(where); + IOSS_PAR_UNUSED(communicator); + IOSS_PAR_UNUSED(where); int sum = exists_ ? 1 : 0; #ifdef SEACAS_HAVE_MPI @@ -169,11 +170,11 @@ namespace Ioss { bool FileInfo::is_nfs() const { #if !defined(__IOSS_WINDOWS__) -#define NFS_FS 0x6969 /* statfs defines that 0x6969 is NFS filesystem */ +#define NFS_FS 0x6969 /* statfs defines that 0x6969 is NFS filesystem */ auto tmp_path = pathname(); if (tmp_path.empty()) { - char *current_cwd = getcwd(nullptr, 0); - tmp_path = std::string(current_cwd); + char *current_cwd = getcwd(nullptr, 0); + tmp_path = std::string(current_cwd); free(current_cwd); } #if defined(__IOSS_WINDOWS__) @@ -186,10 +187,10 @@ namespace Ioss { struct statfs stat_fs; // We want to run `statfs` on the path; not the filename since it might not exist. if (statfs(path, &stat_fs) == -1) { - free(path); - std::ostringstream errmsg; - errmsg << "ERROR: Could not run statfs on '" << filename_ << "'.\n"; - IOSS_ERROR(errmsg); + free(path); + std::ostringstream errmsg; + errmsg << "ERROR: Could not run statfs on '" << filename_ << "'.\n"; + IOSS_ERROR(errmsg); } free(path); return (stat_fs.f_type == NFS_FS); @@ -380,9 +381,10 @@ namespace Ioss { } } - void FileInfo::create_path(const std::string &filename, Ioss_MPI_Comm communicator) + void FileInfo::create_path(const std::string &filename, + IOSS_MAYBE_UNUSED Ioss_MPI_Comm communicator) { - PAR_UNUSED(communicator); + IOSS_PAR_UNUSED(communicator); #ifdef SEACAS_HAVE_MPI int error_found = 0; std::ostringstream errmsg; diff --git a/packages/seacas/libraries/ioss/src/Ioss_FileInfo.h b/packages/seacas/libraries/ioss/src/Ioss_FileInfo.h index a8ca47a6fc28..9a0727413701 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_FileInfo.h +++ b/packages/seacas/libraries/ioss/src/Ioss_FileInfo.h @@ -95,7 +95,8 @@ namespace Ioss { //! This function is used to create the path to an output directory (or history, restart, etc.) //! if it does not exist. Called by all processors. Will throw exception if path does not //! specify a valid directory or if the path cannot be created. - static void create_path(const std::string &filename, Ioss_MPI_Comm communicator); + static void create_path(const std::string &filename, + IOSS_MAYBE_UNUSED Ioss_MPI_Comm communicator); static void create_path(const std::string &filename); private: diff --git a/packages/seacas/libraries/ioss/src/Ioss_Getline.C b/packages/seacas/libraries/ioss/src/Ioss_Getline.C new file mode 100644 index 000000000000..c4ee9ce2c186 --- /dev/null +++ b/packages/seacas/libraries/ioss/src/Ioss_Getline.C @@ -0,0 +1,941 @@ + +/* + * Copyright (C) 1991, 1992, 1993, 2021, 2022 by Chris Thewalt (thewalt@ce.berkeley.edu) + * + * Permission to use, copy, modify, and distribute this software + * for any purpose and without fee is hereby granted, provided + * that the above copyright notices appear in all copies and that both the + * copyright notice and this permission notice appear in supporting + * documentation. This software is provided "as is" without express or + * implied warranty. + * + * Thanks to the following people who have provided enhancements and fixes: + * Ron Ueberschaer, Christoph Keller, Scott Schwartz, Steven List, + * DaviD W. Sanderson, Goran Bostrom, Michael Gleason, Glenn Kasten, + * Edin Hodzic, Eric J Bivona, Kai Uwe Rommel, Danny Quah, Ulrich Betzler + */ + +/* + * Note: This version has been updated by Mike Gleason + */ + +#if defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || \ + defined(__MINGW32__) || defined(_WIN64) + +#define __windows__ 1 +#include +#include +#define NOMINMAX +#include +#define sleep(a) Sleep(a * 1000) +#ifndef write +#define write _write +#define read _read +#endif +#else + +#ifndef __unix__ +#define __unix__ 1 +#endif + +#include +struct termios new_termios, old_termios; +#endif + +/********************* C library headers ********************************/ +#include +#include +#include +#include +#include +#ifndef _MSC_VER +#include +#endif + +#include "Ioss_Getline.h" + +const int IO_GL_BUF_SIZE{1024}; + +/******************** external interface *********************************/ + +int io_gl_filename_quoting_desired = -1; /* default to unspecified */ +const char *io_gl_filename_quote_characters = " \t*?<>|;&()[]$`"; +int io_gl_ellipses_during_completion = 1; +char io_gl_buf[IO_GL_BUF_SIZE]; /* input buffer */ + +/******************** internal interface *********************************/ + +namespace { + int io_gl_init_done = -1; /* terminal mode flag */ + int io_gl_termw = 80; /* actual terminal width */ + int io_gl_scroll = 27; /* width of EOL scrolling region */ + int io_gl_width = 0; /* net size available for input */ + int io_gl_extent = 0; /* how far to redraw, 0 means all */ + int io_gl_overwrite = 0; /* overwrite mode */ + int io_gl_pos, io_gl_cnt = 0; /* position and size of input */ + char io_gl_killbuf[IO_GL_BUF_SIZE] = ""; /* killed text */ + const char *io_gl_prompt; /* to save the prompt string */ + int io_gl_search_mode = 0; /* search mode flag */ + + void io_gl_init(void); /* prepare to edit a line */ + void io_gl_cleanup(void); /* to undo io_gl_init */ + void io_gl_char_init(void); /* get ready for no echo input */ + void io_gl_char_cleanup(void); /* undo io_gl_char_init */ + /* returns printable prompt width */ + + void io_gl_addchar(int c); /* install specified char */ + void io_gl_del(int loc, int); /* del, either left (-1) or cur (0) */ + void io_gl_error(const char *const buf); /* write error msg and die */ + void io_gl_fixup(const char *prompt, int change, + int cursor); /* fixup state variables and screen */ + int io_gl_getc(void); /* read one char from terminal */ + void io_gl_kill(int pos); /* delete to EOL */ + void io_gl_newline(void); /* handle \n or \r */ + void io_gl_putc(int c); /* write one char to terminal */ + void io_gl_puts(const char *const buf); /* write a line to terminal */ + void io_gl_redraw(void); /* issue \n and redraw all */ + void io_gl_transpose(void); /* transpose two chars */ + void io_gl_yank(void); /* yank killed text */ + + void hist_init(void); /* initializes hist pointers */ + char *hist_next(void); /* return ptr to next item */ + char *hist_prev(void); /* return ptr to prev item */ + char *hist_save(const char *p); /* makes copy of a string, without NL */ + + void search_addchar(int c); /* increment search string */ + void search_term(void); /* reset with current contents */ + void search_back(int new_search); /* look back for current string */ + void search_forw(int new_search); /* look forw for current string */ + void io_gl_beep(void); /* try to play a system beep sound */ + + char *copy_string(char *dest, char const *source, long int elements) + { + char *d; + for (d = dest; d + 1 < dest + elements && *source; d++, source++) { + *d = *source; + } + *d = '\0'; + return d; + } +} // namespace +/************************ nonportable part *********************************/ + +#ifdef MSDOS +#include +#endif + +namespace { + void io_gl_char_init(void) /* turn off input echo */ + { +#ifdef __unix__ + tcgetattr(0, &old_termios); + new_termios = old_termios; + new_termios.c_iflag &= ~(BRKINT | ISTRIP | IXON | IXOFF); + new_termios.c_iflag |= (IGNBRK | IGNPAR); + new_termios.c_lflag &= ~(ICANON | ISIG | IEXTEN | ECHO); + new_termios.c_cc[VMIN] = 1; + new_termios.c_cc[VTIME] = 0; + tcsetattr(0, TCSANOW, &new_termios); +#endif /* __unix__ */ + } + + void io_gl_char_cleanup(void) /* undo effects of io_gl_char_init */ + { +#ifdef __unix__ + tcsetattr(0, TCSANOW, &old_termios); +#endif /* __unix__ */ + } +} // namespace +#if defined(MSDOS) || defined(__windows__) + +#define K_UP 0x48 +#define K_DOWN 0x50 +#define K_LEFT 0x4B +#define K_RIGHT 0x4D +#define K_DELETE 0x53 +#define K_INSERT 0x52 +#define K_HOME 0x47 +#define K_END 0x4F +#define K_PGUP 0x49 +#define K_PGDN 0x51 + +int pc_keymap(int c) +{ + switch (c) { + case K_UP: + case K_PGUP: + c = 16; /* up -> ^P */ + break; + case K_DOWN: + case K_PGDN: + c = 14; /* down -> ^N */ + break; + case K_LEFT: + c = 2; /* left -> ^B */ + break; + case K_RIGHT: + c = 6; /* right -> ^F */ + break; + case K_END: + c = 5; /* end -> ^E */ + break; + case K_HOME: + c = 1; /* home -> ^A */ + break; + case K_INSERT: + c = 15; /* insert -> ^O */ + break; + case K_DELETE: + c = 4; /* del -> ^D */ + break; + default: c = 0; /* make it garbage */ + } + return c; +} +#endif /* defined(MSDOS) || defined(__windows__) */ + +namespace { + int io_gl_getc(void) + /* get a character without echoing it to screen */ + { +#ifdef __unix__ + char ch; + int c; + while ((c = read(0, &ch, 1)) == -1) { + if (errno != EINTR) { + break; + } + } + c = (ch <= 0) ? -1 : ch; +#endif /* __unix__ */ +#ifdef MSDOS + int c = _bios_keybrd(_NKEYBRD_READ); + if ((c & 0377) == 224) { + c = pc_keymap((c >> 8) & 0377); + } + else { + c &= 0377; + } +#endif /* MSDOS */ +#ifdef __windows__ + int c = (int)_getch(); + if ((c == 0) || (c == 0xE0)) { + /* Read key code */ + c = (int)_getch(); + c = pc_keymap(c); + } + else if (c == '\r') { + /* Note: we only get \r from the console, + * and not a matching \n. + */ + c = '\n'; + } +#endif + return c; + } + + void io_gl_putc(int c) + { + char ch = (char)(unsigned char)c; + + write(1, &ch, 1); + if (ch == '\n') { + ch = '\r'; + write(1, &ch, 1); /* RAW mode needs '\r', does not hurt */ + } + } + + /******************** fairly portable part *********************************/ + + void io_gl_puts(const char *const buf) + { + if (buf) { + int len = strlen(buf); + write(1, buf, len); + } + } + + void io_gl_error(const char *const buf) + { + int len = strlen(buf); + + io_gl_cleanup(); + write(2, buf, len); + exit(1); + } + + void io_gl_init(void) + /* set up variables and terminal */ + { + if (io_gl_init_done < 0) { /* -1 only on startup */ + const char *cp = (const char *)getenv("COLUMNS"); + if (cp != NULL) { + int w = strtol(cp, NULL, 10); + if (w > 20) + io_gl_setwidth(w); + } + hist_init(); + } + if (isatty(0) == 0 || isatty(1) == 0) + io_gl_error("\n*** Error: getline(): not interactive, use stdio.\n"); + io_gl_char_init(); + io_gl_init_done = 1; + } + + void io_gl_cleanup(void) + /* undo effects of io_gl_init, as necessary */ + { + if (io_gl_init_done > 0) + io_gl_char_cleanup(); + io_gl_init_done = 0; +#ifdef __windows__ + Sleep(40); + FlushConsoleInputBuffer(GetStdHandle(STD_INPUT_HANDLE)); +#endif + } +} // namespace + +void io_gl_setwidth(int w) +{ + if (w > 250) + w = 250; + if (w > 20) { + io_gl_termw = w; + io_gl_scroll = w / 3; + } + else { + io_gl_error("\n*** Error: minimum screen width is 21\n"); + } +} + +char *io_getline_int(const char *prompt) +{ + io_gl_init(); + io_gl_prompt = (prompt) ? prompt : ""; + io_gl_buf[0] = '\0'; + io_gl_fixup(io_gl_prompt, -2, IO_GL_BUF_SIZE); + +#ifdef __windows__ + FlushConsoleInputBuffer(GetStdHandle(STD_INPUT_HANDLE)); +#endif + + int c; + while ((c = io_gl_getc()) >= 0) { + io_gl_extent = 0; /* reset to full extent */ + if (isprint(c)) { + if (io_gl_search_mode) { + search_addchar(c); + } + else { + io_gl_addchar(c); + } + } + else { + if (io_gl_search_mode) { + if (c == '\033' || c == '\016' || c == '\020') { + search_term(); + c = 0; /* ignore the character */ + } + else if (c == '\010' || c == '\177') { + search_addchar(-1); /* unwind search string */ + c = 0; + } + else if (c != '\022' && c != '\023') { + search_term(); /* terminate and handle char */ + } + } + switch (c) { + case '\n': + case '\r': /* newline */ + io_gl_newline(); + io_gl_cleanup(); + return io_gl_buf; + case '\001': + io_gl_fixup(io_gl_prompt, -1, 0); /* ^A */ + break; + case '\002': + io_gl_fixup(io_gl_prompt, -1, io_gl_pos - 1); /* ^B */ + break; + case '\004': /* ^D */ + if (io_gl_cnt == 0) { + io_gl_buf[0] = '\0'; + io_gl_cleanup(); + io_gl_putc('\n'); + return io_gl_buf; + } + else { + io_gl_del(0, 1); + } + break; + case '\005': + io_gl_fixup(io_gl_prompt, -1, io_gl_cnt); /* ^E */ + break; + case '\006': + io_gl_fixup(io_gl_prompt, -1, io_gl_pos + 1); /* ^F */ + break; + case '\010': + case '\177': + io_gl_del(-1, 0); /* ^H and DEL */ + break; + case '\t': /* TAB */ break; + case '\013': + io_gl_kill(io_gl_pos); /* ^K */ + break; + case '\014': + io_gl_redraw(); /* ^L */ + break; + case '\016': /* ^N */ + copy_string(io_gl_buf, hist_next(), IO_GL_BUF_SIZE); + io_gl_fixup(io_gl_prompt, 0, IO_GL_BUF_SIZE); + break; + case '\017': + io_gl_overwrite = !io_gl_overwrite; /* ^O */ + break; + case '\020': /* ^P */ + copy_string(io_gl_buf, hist_prev(), IO_GL_BUF_SIZE); + io_gl_fixup(io_gl_prompt, 0, IO_GL_BUF_SIZE); + break; + case '\022': + search_back(1); /* ^R */ + break; + case '\023': + search_forw(1); /* ^S */ + break; + case '\024': + io_gl_transpose(); /* ^T */ + break; + case '\025': + io_gl_kill(0); /* ^U */ + break; + case '\031': + io_gl_yank(); /* ^Y */ + break; + default: + if (c > 0) + io_gl_beep(); + break; + } + } + } + io_gl_cleanup(); + io_gl_buf[0] = '\0'; + return io_gl_buf; +} + +namespace { + void io_gl_addchar(int c) + + /* adds the character c to the input buffer at current location */ + { + if (io_gl_cnt >= IO_GL_BUF_SIZE - 1) + io_gl_error("\n*** Error: getline(): input buffer overflow\n"); + if (io_gl_overwrite == 0 || io_gl_pos == io_gl_cnt) { + int i; + for (i = io_gl_cnt; i >= io_gl_pos; i--) + io_gl_buf[i + 1] = io_gl_buf[i]; + io_gl_buf[io_gl_pos] = (char)c; + io_gl_fixup(io_gl_prompt, io_gl_pos, io_gl_pos + 1); + } + else { + io_gl_buf[io_gl_pos] = (char)c; + io_gl_extent = 1; + io_gl_fixup(io_gl_prompt, io_gl_pos, io_gl_pos + 1); + } + } + + void io_gl_yank(void) + /* adds the kill buffer to the input buffer at current location */ + { + int len = strlen(io_gl_killbuf); + if (len > 0) { + if (io_gl_overwrite == 0) { + if (io_gl_cnt + len >= IO_GL_BUF_SIZE - 1) + io_gl_error("\n*** Error: getline(): input buffer overflow\n"); + for (int i = io_gl_cnt; i >= io_gl_pos; i--) + io_gl_buf[i + len] = io_gl_buf[i]; + for (int i = 0; i < len; i++) + io_gl_buf[io_gl_pos + i] = io_gl_killbuf[i]; + io_gl_fixup(io_gl_prompt, io_gl_pos, io_gl_pos + len); + } + else { + if (io_gl_pos + len > io_gl_cnt) { + if (io_gl_pos + len >= IO_GL_BUF_SIZE - 1) + io_gl_error("\n*** Error: getline(): input buffer overflow\n"); + io_gl_buf[io_gl_pos + len] = '\0'; + } + for (int i = 0; i < len; i++) + io_gl_buf[io_gl_pos + i] = io_gl_killbuf[i]; + io_gl_extent = len; + io_gl_fixup(io_gl_prompt, io_gl_pos, io_gl_pos + len); + } + } + else + io_gl_beep(); + } + + void io_gl_transpose(void) + /* switch character under cursor and to left of cursor */ + { + if (io_gl_pos > 0 && io_gl_cnt > io_gl_pos) { + int c = io_gl_buf[io_gl_pos - 1]; + io_gl_buf[io_gl_pos - 1] = io_gl_buf[io_gl_pos]; + io_gl_buf[io_gl_pos] = (char)c; + io_gl_extent = 2; + io_gl_fixup(io_gl_prompt, io_gl_pos - 1, io_gl_pos); + } + else + io_gl_beep(); + } + + void io_gl_newline(void) + /* + * Cleans up entire line before returning to caller. A \n is appended. + * If line longer than screen, we redraw starting at beginning + */ + { + int change = io_gl_cnt; + int len = io_gl_cnt; + int loc = io_gl_width - 5; /* shifts line back to start position */ + + if (io_gl_cnt >= IO_GL_BUF_SIZE - 1) + io_gl_error("\n*** Error: getline(): input buffer overflow\n"); + if (loc > len) + loc = len; + io_gl_fixup(io_gl_prompt, change, loc); /* must do this before appending \n */ + io_gl_buf[len] = '\n'; + io_gl_buf[len + 1] = '\0'; + io_gl_putc('\n'); + } + + void io_gl_del(int loc, int killsave) + + /* + * Delete a character. The loc variable can be: + * -1 : delete character to left of cursor + * 0 : delete character under cursor + */ + { + if ((loc == -1 && io_gl_pos > 0) || (loc == 0 && io_gl_pos < io_gl_cnt)) { + int j = 0; + for (int i = io_gl_pos + loc; i < io_gl_cnt; i++) { + if ((j == 0) && (killsave != 0)) { + io_gl_killbuf[0] = io_gl_buf[i]; + io_gl_killbuf[1] = '\0'; + j = 1; + } + io_gl_buf[i] = io_gl_buf[i + 1]; + } + io_gl_fixup(io_gl_prompt, io_gl_pos + loc, io_gl_pos + loc); + } + else + io_gl_beep(); + } + + void io_gl_kill(int pos) + + /* delete from pos to the end of line */ + { + if (pos < io_gl_cnt) { + copy_string(io_gl_killbuf, io_gl_buf + pos, IO_GL_BUF_SIZE); + io_gl_buf[pos] = '\0'; + io_gl_fixup(io_gl_prompt, pos, pos); + } + else + io_gl_beep(); + } + + void io_gl_redraw(void) + /* emit a newline, reset and redraw prompt and current input line */ + { + if (io_gl_init_done > 0) { + io_gl_putc('\n'); + io_gl_fixup(io_gl_prompt, -2, io_gl_pos); + } + } + + void io_gl_fixup(const char *prompt, int change, int cursor) + + /* + * This function is used both for redrawing when input changes or for + * moving within the input line. The parameters are: + * prompt: compared to last_prompt[] for changes; + * change : the index of the start of changes in the input buffer, + * with -1 indicating no changes, -2 indicating we're on + * a new line, redraw everything. + * cursor : the desired location of the cursor after the call. + * A value of IO_GL_BUF_SIZE can be used to indicate the cursor should + * move just past the end of the input line. + */ + { + static int io_gl_shift; /* index of first on screen character */ + static int off_right; /* true if more text right of screen */ + static int off_left; /* true if more text left of screen */ + static char last_prompt[80] = ""; + int left = 0, right = -1; /* bounds for redraw */ + int new_right = -1; /* alternate right bound, using io_gl_extent */ + + if (change == -2) { /* reset */ + io_gl_pos = io_gl_cnt = io_gl_shift = off_right = off_left = 0; + io_gl_putc('\r'); + io_gl_puts(prompt); + copy_string(last_prompt, prompt, 80); + change = 0; + io_gl_width = io_gl_termw - strlen(prompt); + } + else if (strcmp(prompt, last_prompt) != 0) { + int l1 = strlen(last_prompt); + int l2 = strlen(prompt); + io_gl_cnt = io_gl_cnt + l1 - l2; + copy_string(last_prompt, prompt, 80); + io_gl_putc('\r'); + io_gl_puts(prompt); + io_gl_pos = io_gl_shift; + io_gl_width = io_gl_termw - l2; + change = 0; + } + /* how much to erase at end of line */ + int pad = (off_right) ? io_gl_width - 1 : io_gl_cnt - io_gl_shift; /* old length */ + int backup = io_gl_pos - io_gl_shift; /* how far to backup before fixing */ + if (change >= 0) { + io_gl_cnt = strlen(io_gl_buf); + if (change > io_gl_cnt) + change = io_gl_cnt; + } + if (cursor > io_gl_cnt) { + if (cursor != IO_GL_BUF_SIZE) { /* IO_GL_BUF_SIZE means end of line */ + if (io_gl_ellipses_during_completion == 0) { + io_gl_beep(); + } + } + cursor = io_gl_cnt; + } + if (cursor < 0) { + io_gl_beep(); + cursor = 0; + } + int extra = 0; /* adjusts when shift (scroll) happens */ + if (off_right || (off_left && cursor < io_gl_shift + io_gl_width - io_gl_scroll / 2)) { + extra = 2; /* shift the scrolling boundary */ + } + int new_shift = cursor + extra + io_gl_scroll - io_gl_width; + if (new_shift > 0) { + new_shift /= io_gl_scroll; + new_shift *= io_gl_scroll; + } + else + new_shift = 0; + if (new_shift != io_gl_shift) { /* scroll occurs */ + io_gl_shift = new_shift; + off_left = (io_gl_shift) ? 1 : 0; + off_right = (io_gl_cnt > io_gl_shift + io_gl_width - 1) ? 1 : 0; + left = io_gl_shift; + new_right = right = (off_right) ? io_gl_shift + io_gl_width - 2 : io_gl_cnt; + } + else if (change >= 0) { /* no scroll, but text changed */ + if (change < io_gl_shift + off_left) { + left = io_gl_shift; + } + else { + left = change; + backup = io_gl_pos - change; + } + off_right = (io_gl_cnt > io_gl_shift + io_gl_width - 1) ? 1 : 0; + right = (off_right) ? io_gl_shift + io_gl_width - 2 : io_gl_cnt; + new_right = (io_gl_extent && (right > left + io_gl_extent)) ? left + io_gl_extent : right; + } + pad -= (off_right) ? io_gl_width - 1 : io_gl_cnt - io_gl_shift; + pad = (pad < 0) ? 0 : pad; + if (left <= right) { /* clean up screen */ + for (int i = 0; i < backup; i++) + io_gl_putc('\b'); + if (left == io_gl_shift && off_left) { + io_gl_putc('$'); + left++; + } + for (int i = left; i < new_right; i++) + io_gl_putc(io_gl_buf[i]); + io_gl_pos = new_right; + if (off_right && new_right == right) { + io_gl_putc('$'); + io_gl_pos++; + } + else { + for (int i = 0; i < pad; i++) /* erase remains of prev line */ + io_gl_putc(' '); + io_gl_pos += pad; + } + } + int i = io_gl_pos - cursor; /* move to final cursor location */ + if (i > 0) { + while (i--) + io_gl_putc('\b'); + } + else { + for (int ii = io_gl_pos; ii < cursor; ii++) + io_gl_putc(io_gl_buf[ii]); + } + io_gl_pos = cursor; + } + + /******************* History stuff **************************************/ + +#ifndef HIST_SIZE +#define HIST_SIZE 100 +#endif + + int hist_pos = 0, hist_last = 0; + char *hist_buf[HIST_SIZE]; + char hist_empty_elem[2] = ""; + + void hist_init(void) + { + hist_buf[0] = hist_empty_elem; + for (int i = 1; i < HIST_SIZE; i++) + hist_buf[i] = NULL; + } +} // namespace +void io_gl_histadd(const char *buf) +{ + static char *prev = NULL; + + /* in case we call io_gl_histadd() before we call getline() */ + if (io_gl_init_done < 0) { /* -1 only on startup */ + hist_init(); + io_gl_init_done = 0; + } + const char *p = buf; + while (*p == ' ' || *p == '\t' || *p == '\n') + p++; + if (*p) { + int len = strlen(buf); + if (strchr(p, '\n')) /* previously line already has NL stripped */ + len--; + if ((prev == NULL) || ((int)strlen(prev) != len) || strncmp(prev, buf, (size_t)len) != 0) { + hist_buf[hist_last] = hist_save(buf); + prev = hist_buf[hist_last]; + hist_last = (hist_last + 1) % HIST_SIZE; + if (hist_buf[hist_last] && *hist_buf[hist_last]) { + free(hist_buf[hist_last]); + } + hist_buf[hist_last] = hist_empty_elem; + } + } + hist_pos = hist_last; +} + +namespace { + char *hist_prev(void) + /* loads previous hist entry into input buffer, sticks on first */ + { + char *p = NULL; + int next = (hist_pos - 1 + HIST_SIZE) % HIST_SIZE; + + if (hist_buf[hist_pos] != NULL && next != hist_last) { + hist_pos = next; + p = hist_buf[hist_pos]; + } + if (p == NULL) { + p = hist_empty_elem; + io_gl_beep(); + } + return p; + } + + char *hist_next(void) + /* loads next hist entry into input buffer, clears on last */ + { + char *p = NULL; + + if (hist_pos != hist_last) { + hist_pos = (hist_pos + 1) % HIST_SIZE; + p = hist_buf[hist_pos]; + } + if (p == NULL) { + p = hist_empty_elem; + io_gl_beep(); + } + return p; + } + + char *hist_save(const char *p) + + /* makes a copy of the string */ + { + char *s = NULL; + size_t len = strlen(p); + const char *nl = strpbrk(p, "\n\r"); + + if (nl) { + if ((s = (char *)malloc(len)) != NULL) { + copy_string(s, p, len); + s[len - 1] = '\0'; + } + } + else { + if ((s = (char *)malloc(len + 1)) != NULL) { + copy_string(s, p, len + 1); + } + } + if (s == NULL) + io_gl_error("\n*** Error: hist_save() failed on malloc\n"); + return s; + } + + /******************* Search stuff **************************************/ + + char search_prompt[101]; /* prompt includes search string */ + char search_string[100]; + int search_pos = 0; /* current location in search_string */ + int search_forw_flg = 0; /* search direction flag */ + int search_last = 0; /* last match found */ + + void search_update(int c) + { + if (c == 0) { + search_pos = 0; + search_string[0] = '\0'; + search_prompt[0] = '?'; + search_prompt[1] = ' '; + search_prompt[2] = '\0'; + } + else if (c > 0) { + search_string[search_pos] = (char)c; + search_string[search_pos + 1] = (char)0; + search_prompt[search_pos] = (char)c; + search_prompt[search_pos + 1] = (char)'?'; + search_prompt[search_pos + 2] = (char)' '; + search_prompt[search_pos + 3] = (char)0; + search_pos++; + } + else { + if (search_pos > 0) { + search_pos--; + search_string[search_pos] = (char)0; + search_prompt[search_pos] = (char)'?'; + search_prompt[search_pos + 1] = (char)' '; + search_prompt[search_pos + 2] = (char)0; + } + else { + io_gl_beep(); + hist_pos = hist_last; + } + } + } + + void search_addchar(int c) + { + search_update(c); + if (c < 0) { + if (search_pos > 0) { + hist_pos = search_last; + } + else { + io_gl_buf[0] = '\0'; + hist_pos = hist_last; + } + copy_string(io_gl_buf, hist_buf[hist_pos], IO_GL_BUF_SIZE); + } + + char *loc = NULL; + if ((loc = strstr(io_gl_buf, search_string)) != NULL) { + io_gl_fixup(search_prompt, 0, loc - io_gl_buf); + } + else if (search_pos > 0) { + if (search_forw_flg) { + search_forw(0); + } + else { + search_back(0); + } + } + else { + io_gl_fixup(search_prompt, 0, 0); + } + } + + void search_term(void) + { + io_gl_search_mode = 0; + if (io_gl_buf[0] == 0) /* not found, reset hist list */ + hist_pos = hist_last; + io_gl_fixup(io_gl_prompt, 0, io_gl_pos); + } + + void search_back(int new_search) + { + search_forw_flg = 0; + if (io_gl_search_mode == 0) { + search_last = hist_pos = hist_last; + search_update(0); + io_gl_search_mode = 1; + io_gl_buf[0] = '\0'; + io_gl_fixup(search_prompt, 0, 0); + } + else if (search_pos > 0) { + int found = 0; + while (!found) { + char *loc; + char *p = hist_prev(); + if (*p == 0) { /* not found, done looking */ + io_gl_buf[0] = '\0'; + io_gl_fixup(search_prompt, 0, 0); + found = 1; + } + else if ((loc = strstr(p, search_string)) != NULL) { + copy_string(io_gl_buf, p, IO_GL_BUF_SIZE); + io_gl_fixup(search_prompt, 0, loc - p); + if (new_search) + search_last = hist_pos; + found = 1; + } + } + } + else { + io_gl_beep(); + } + } + + void search_forw(int new_search) + { + char *loc; + + search_forw_flg = 1; + if (io_gl_search_mode == 0) { + search_last = hist_pos = hist_last; + search_update(0); + io_gl_search_mode = 1; + io_gl_buf[0] = '\0'; + io_gl_fixup(search_prompt, 0, 0); + } + else if (search_pos > 0) { + int found = 0; + while (!found) { + char *p = hist_next(); + if (*p == 0) { /* not found, done looking */ + io_gl_buf[0] = '\0'; + io_gl_fixup(search_prompt, 0, 0); + found = 1; + } + else if ((loc = strstr(p, search_string)) != NULL) { + copy_string(io_gl_buf, p, IO_GL_BUF_SIZE); + io_gl_fixup(search_prompt, 0, loc - p); + if (new_search) + search_last = hist_pos; + found = 1; + } + } + } + else { + io_gl_beep(); + } + } + + void io_gl_beep(void) + { +#ifdef __windows__ + MessageBeep(MB_OK); +#else + io_gl_putc('\007'); +#endif + } /* io_gl_beep */ +} // namespace diff --git a/packages/seacas/libraries/ioss/src/Ioss_Getline.c b/packages/seacas/libraries/ioss/src/Ioss_Getline.c deleted file mode 100644 index 8b9265667d40..000000000000 --- a/packages/seacas/libraries/ioss/src/Ioss_Getline.c +++ /dev/null @@ -1,934 +0,0 @@ - -/* - * Copyright (C) 1991, 1992, 1993, 2021, 2022 by Chris Thewalt (thewalt@ce.berkeley.edu) - * - * Permission to use, copy, modify, and distribute this software - * for any purpose and without fee is hereby granted, provided - * that the above copyright notices appear in all copies and that both the - * copyright notice and this permission notice appear in supporting - * documentation. This software is provided "as is" without express or - * implied warranty. - * - * Thanks to the following people who have provided enhancements and fixes: - * Ron Ueberschaer, Christoph Keller, Scott Schwartz, Steven List, - * DaviD W. Sanderson, Goran Bostrom, Michael Gleason, Glenn Kasten, - * Edin Hodzic, Eric J Bivona, Kai Uwe Rommel, Danny Quah, Ulrich Betzler - */ - -/* - * Note: This version has been updated by Mike Gleason - */ - -#if defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || \ - defined(__MINGW32__) || defined(_WIN64) - -#define __windows__ 1 -#include -#include -#define NOMINMAX -#include -#define sleep(a) Sleep(a * 1000) -#ifndef write -#define write _write -#define read _read -#endif -#else - -#ifndef __unix__ -#define __unix__ 1 -#endif - -#include -struct termios new_termios, old_termios; -#endif - -/********************* C library headers ********************************/ -#include -#include -#include -#include -#include -#ifndef _MSC_VER -#include -#endif - -#include "Ioss_Getline.h" - -#define IO_GL_BUF_SIZE 1024 - -/******************** external interface *********************************/ - -int io_gl_filename_quoting_desired = -1; /* default to unspecified */ -const char *io_gl_filename_quote_characters = " \t*?<>|;&()[]$`"; -int io_gl_ellipses_during_completion = 1; -char io_gl_buf[IO_GL_BUF_SIZE]; /* input buffer */ - -/******************** internal interface *********************************/ - -static int io_gl_init_done = -1; /* terminal mode flag */ -static int io_gl_termw = 80; /* actual terminal width */ -static int io_gl_scroll = 27; /* width of EOL scrolling region */ -static int io_gl_width = 0; /* net size available for input */ -static int io_gl_extent = 0; /* how far to redraw, 0 means all */ -static int io_gl_overwrite = 0; /* overwrite mode */ -static int io_gl_pos, io_gl_cnt = 0; /* position and size of input */ -static char io_gl_killbuf[IO_GL_BUF_SIZE] = ""; /* killed text */ -static const char *io_gl_prompt; /* to save the prompt string */ -static int io_gl_search_mode = 0; /* search mode flag */ - -static void io_gl_init(void); /* prepare to edit a line */ -static void io_gl_cleanup(void); /* to undo io_gl_init */ -static void io_gl_char_init(void); /* get ready for no echo input */ -static void io_gl_char_cleanup(void); /* undo io_gl_char_init */ - /* returns printable prompt width */ - -static void io_gl_addchar(int c); /* install specified char */ -static void io_gl_del(int loc, int); /* del, either left (-1) or cur (0) */ -static void io_gl_error(const char *const buf); /* write error msg and die */ -static void io_gl_fixup(const char *prompt, int change, - int cursor); /* fixup state variables and screen */ -static int io_gl_getc(void); /* read one char from terminal */ -static void io_gl_kill(int pos); /* delete to EOL */ -static void io_gl_newline(void); /* handle \n or \r */ -static void io_gl_putc(int c); /* write one char to terminal */ -static void io_gl_puts(const char *const buf); /* write a line to terminal */ -static void io_gl_redraw(void); /* issue \n and redraw all */ -static void io_gl_transpose(void); /* transpose two chars */ -static void io_gl_yank(void); /* yank killed text */ - -static void hist_init(void); /* initializes hist pointers */ -static char *hist_next(void); /* return ptr to next item */ -static char *hist_prev(void); /* return ptr to prev item */ -static char *hist_save(const char *p); /* makes copy of a string, without NL */ - -static void search_addchar(int c); /* increment search string */ -static void search_term(void); /* reset with current contents */ -static void search_back(int new_search); /* look back for current string */ -static void search_forw(int new_search); /* look forw for current string */ -static void io_gl_beep(void); /* try to play a system beep sound */ - -static char *copy_string(char *dest, char const *source, long int elements) -{ - char *d; - for (d = dest; d + 1 < dest + elements && *source; d++, source++) { - *d = *source; - } - *d = '\0'; - return d; -} - -/************************ nonportable part *********************************/ - -#ifdef MSDOS -#include -#endif - -static void io_gl_char_init(void) /* turn off input echo */ -{ -#ifdef __unix__ - tcgetattr(0, &old_termios); - new_termios = old_termios; - new_termios.c_iflag &= ~(BRKINT | ISTRIP | IXON | IXOFF); - new_termios.c_iflag |= (IGNBRK | IGNPAR); - new_termios.c_lflag &= ~(ICANON | ISIG | IEXTEN | ECHO); - new_termios.c_cc[VMIN] = 1; - new_termios.c_cc[VTIME] = 0; - tcsetattr(0, TCSANOW, &new_termios); -#endif /* __unix__ */ -} - -static void io_gl_char_cleanup(void) /* undo effects of io_gl_char_init */ -{ -#ifdef __unix__ - tcsetattr(0, TCSANOW, &old_termios); -#endif /* __unix__ */ -} - -#if defined(MSDOS) || defined(__windows__) - -#define K_UP 0x48 -#define K_DOWN 0x50 -#define K_LEFT 0x4B -#define K_RIGHT 0x4D -#define K_DELETE 0x53 -#define K_INSERT 0x52 -#define K_HOME 0x47 -#define K_END 0x4F -#define K_PGUP 0x49 -#define K_PGDN 0x51 - -int pc_keymap(int c) -{ - switch (c) { - case K_UP: - case K_PGUP: - c = 16; /* up -> ^P */ - break; - case K_DOWN: - case K_PGDN: - c = 14; /* down -> ^N */ - break; - case K_LEFT: - c = 2; /* left -> ^B */ - break; - case K_RIGHT: - c = 6; /* right -> ^F */ - break; - case K_END: - c = 5; /* end -> ^E */ - break; - case K_HOME: - c = 1; /* home -> ^A */ - break; - case K_INSERT: - c = 15; /* insert -> ^O */ - break; - case K_DELETE: - c = 4; /* del -> ^D */ - break; - default: c = 0; /* make it garbage */ - } - return c; -} -#endif /* defined(MSDOS) || defined(__windows__) */ - -static int io_gl_getc(void) -/* get a character without echoing it to screen */ -{ -#ifdef __unix__ - char ch; - int c; - while ((c = read(0, &ch, 1)) == -1) { - if (errno != EINTR) { - break; - } - } - c = (ch <= 0) ? -1 : ch; -#endif /* __unix__ */ -#ifdef MSDOS - int c = _bios_keybrd(_NKEYBRD_READ); - if ((c & 0377) == 224) { - c = pc_keymap((c >> 8) & 0377); - } - else { - c &= 0377; - } -#endif /* MSDOS */ -#ifdef __windows__ - int c = (int)_getch(); - if ((c == 0) || (c == 0xE0)) { - /* Read key code */ - c = (int)_getch(); - c = pc_keymap(c); - } - else if (c == '\r') { - /* Note: we only get \r from the console, - * and not a matching \n. - */ - c = '\n'; - } -#endif - return c; -} - -static void io_gl_putc(int c) -{ - char ch = (char)(unsigned char)c; - - write(1, &ch, 1); - if (ch == '\n') { - ch = '\r'; - write(1, &ch, 1); /* RAW mode needs '\r', does not hurt */ - } -} - -/******************** fairly portable part *********************************/ - -static void io_gl_puts(const char *const buf) -{ - if (buf) { - int len = strlen(buf); - write(1, buf, len); - } -} - -static void io_gl_error(const char *const buf) -{ - int len = strlen(buf); - - io_gl_cleanup(); - write(2, buf, len); - exit(1); -} - -static void io_gl_init(void) -/* set up variables and terminal */ -{ - if (io_gl_init_done < 0) { /* -1 only on startup */ - const char *cp = (const char *)getenv("COLUMNS"); - if (cp != NULL) { - int w = strtol(cp, NULL, 10); - if (w > 20) - io_gl_setwidth(w); - } - hist_init(); - } - if (isatty(0) == 0 || isatty(1) == 0) - io_gl_error("\n*** Error: getline(): not interactive, use stdio.\n"); - io_gl_char_init(); - io_gl_init_done = 1; -} - -static void io_gl_cleanup(void) -/* undo effects of io_gl_init, as necessary */ -{ - if (io_gl_init_done > 0) - io_gl_char_cleanup(); - io_gl_init_done = 0; -#ifdef __windows__ - Sleep(40); - FlushConsoleInputBuffer(GetStdHandle(STD_INPUT_HANDLE)); -#endif -} - -void io_gl_setwidth(int w) -{ - if (w > 250) - w = 250; - if (w > 20) { - io_gl_termw = w; - io_gl_scroll = w / 3; - } - else { - io_gl_error("\n*** Error: minimum screen width is 21\n"); - } -} - -char *io_getline_int(const char *prompt) -{ - io_gl_init(); - io_gl_prompt = (prompt) ? prompt : ""; - io_gl_buf[0] = '\0'; - io_gl_fixup(io_gl_prompt, -2, IO_GL_BUF_SIZE); - -#ifdef __windows__ - FlushConsoleInputBuffer(GetStdHandle(STD_INPUT_HANDLE)); -#endif - - int c; - while ((c = io_gl_getc()) >= 0) { - io_gl_extent = 0; /* reset to full extent */ - if (isprint(c)) { - if (io_gl_search_mode) { - search_addchar(c); - } - else { - io_gl_addchar(c); - } - } - else { - if (io_gl_search_mode) { - if (c == '\033' || c == '\016' || c == '\020') { - search_term(); - c = 0; /* ignore the character */ - } - else if (c == '\010' || c == '\177') { - search_addchar(-1); /* unwind search string */ - c = 0; - } - else if (c != '\022' && c != '\023') { - search_term(); /* terminate and handle char */ - } - } - switch (c) { - case '\n': - case '\r': /* newline */ - io_gl_newline(); - io_gl_cleanup(); - return io_gl_buf; - case '\001': - io_gl_fixup(io_gl_prompt, -1, 0); /* ^A */ - break; - case '\002': - io_gl_fixup(io_gl_prompt, -1, io_gl_pos - 1); /* ^B */ - break; - case '\004': /* ^D */ - if (io_gl_cnt == 0) { - io_gl_buf[0] = '\0'; - io_gl_cleanup(); - io_gl_putc('\n'); - return io_gl_buf; - } - else { - io_gl_del(0, 1); - } - break; - case '\005': - io_gl_fixup(io_gl_prompt, -1, io_gl_cnt); /* ^E */ - break; - case '\006': - io_gl_fixup(io_gl_prompt, -1, io_gl_pos + 1); /* ^F */ - break; - case '\010': - case '\177': - io_gl_del(-1, 0); /* ^H and DEL */ - break; - case '\t': /* TAB */ break; - case '\013': - io_gl_kill(io_gl_pos); /* ^K */ - break; - case '\014': - io_gl_redraw(); /* ^L */ - break; - case '\016': /* ^N */ - copy_string(io_gl_buf, hist_next(), IO_GL_BUF_SIZE); - io_gl_fixup(io_gl_prompt, 0, IO_GL_BUF_SIZE); - break; - case '\017': - io_gl_overwrite = !io_gl_overwrite; /* ^O */ - break; - case '\020': /* ^P */ - copy_string(io_gl_buf, hist_prev(), IO_GL_BUF_SIZE); - io_gl_fixup(io_gl_prompt, 0, IO_GL_BUF_SIZE); - break; - case '\022': - search_back(1); /* ^R */ - break; - case '\023': - search_forw(1); /* ^S */ - break; - case '\024': - io_gl_transpose(); /* ^T */ - break; - case '\025': - io_gl_kill(0); /* ^U */ - break; - case '\031': - io_gl_yank(); /* ^Y */ - break; - default: - if (c > 0) - io_gl_beep(); - break; - } - } - } - io_gl_cleanup(); - io_gl_buf[0] = '\0'; - return io_gl_buf; -} - -static void io_gl_addchar(int c) - -/* adds the character c to the input buffer at current location */ -{ - if (io_gl_cnt >= IO_GL_BUF_SIZE - 1) - io_gl_error("\n*** Error: getline(): input buffer overflow\n"); - if (io_gl_overwrite == 0 || io_gl_pos == io_gl_cnt) { - int i; - for (i = io_gl_cnt; i >= io_gl_pos; i--) - io_gl_buf[i + 1] = io_gl_buf[i]; - io_gl_buf[io_gl_pos] = (char)c; - io_gl_fixup(io_gl_prompt, io_gl_pos, io_gl_pos + 1); - } - else { - io_gl_buf[io_gl_pos] = (char)c; - io_gl_extent = 1; - io_gl_fixup(io_gl_prompt, io_gl_pos, io_gl_pos + 1); - } -} - -static void io_gl_yank(void) -/* adds the kill buffer to the input buffer at current location */ -{ - int len = strlen(io_gl_killbuf); - if (len > 0) { - if (io_gl_overwrite == 0) { - if (io_gl_cnt + len >= IO_GL_BUF_SIZE - 1) - io_gl_error("\n*** Error: getline(): input buffer overflow\n"); - for (int i = io_gl_cnt; i >= io_gl_pos; i--) - io_gl_buf[i + len] = io_gl_buf[i]; - for (int i = 0; i < len; i++) - io_gl_buf[io_gl_pos + i] = io_gl_killbuf[i]; - io_gl_fixup(io_gl_prompt, io_gl_pos, io_gl_pos + len); - } - else { - if (io_gl_pos + len > io_gl_cnt) { - if (io_gl_pos + len >= IO_GL_BUF_SIZE - 1) - io_gl_error("\n*** Error: getline(): input buffer overflow\n"); - io_gl_buf[io_gl_pos + len] = '\0'; - } - for (int i = 0; i < len; i++) - io_gl_buf[io_gl_pos + i] = io_gl_killbuf[i]; - io_gl_extent = len; - io_gl_fixup(io_gl_prompt, io_gl_pos, io_gl_pos + len); - } - } - else - io_gl_beep(); -} - -static void io_gl_transpose(void) -/* switch character under cursor and to left of cursor */ -{ - if (io_gl_pos > 0 && io_gl_cnt > io_gl_pos) { - int c = io_gl_buf[io_gl_pos - 1]; - io_gl_buf[io_gl_pos - 1] = io_gl_buf[io_gl_pos]; - io_gl_buf[io_gl_pos] = (char)c; - io_gl_extent = 2; - io_gl_fixup(io_gl_prompt, io_gl_pos - 1, io_gl_pos); - } - else - io_gl_beep(); -} - -static void io_gl_newline(void) -/* - * Cleans up entire line before returning to caller. A \n is appended. - * If line longer than screen, we redraw starting at beginning - */ -{ - int change = io_gl_cnt; - int len = io_gl_cnt; - int loc = io_gl_width - 5; /* shifts line back to start position */ - - if (io_gl_cnt >= IO_GL_BUF_SIZE - 1) - io_gl_error("\n*** Error: getline(): input buffer overflow\n"); - if (loc > len) - loc = len; - io_gl_fixup(io_gl_prompt, change, loc); /* must do this before appending \n */ - io_gl_buf[len] = '\n'; - io_gl_buf[len + 1] = '\0'; - io_gl_putc('\n'); -} - -static void io_gl_del(int loc, int killsave) - -/* - * Delete a character. The loc variable can be: - * -1 : delete character to left of cursor - * 0 : delete character under cursor - */ -{ - if ((loc == -1 && io_gl_pos > 0) || (loc == 0 && io_gl_pos < io_gl_cnt)) { - int j = 0; - for (int i = io_gl_pos + loc; i < io_gl_cnt; i++) { - if ((j == 0) && (killsave != 0)) { - io_gl_killbuf[0] = io_gl_buf[i]; - io_gl_killbuf[1] = '\0'; - j = 1; - } - io_gl_buf[i] = io_gl_buf[i + 1]; - } - io_gl_fixup(io_gl_prompt, io_gl_pos + loc, io_gl_pos + loc); - } - else - io_gl_beep(); -} - -static void io_gl_kill(int pos) - -/* delete from pos to the end of line */ -{ - if (pos < io_gl_cnt) { - copy_string(io_gl_killbuf, io_gl_buf + pos, IO_GL_BUF_SIZE); - io_gl_buf[pos] = '\0'; - io_gl_fixup(io_gl_prompt, pos, pos); - } - else - io_gl_beep(); -} - -static void io_gl_redraw(void) -/* emit a newline, reset and redraw prompt and current input line */ -{ - if (io_gl_init_done > 0) { - io_gl_putc('\n'); - io_gl_fixup(io_gl_prompt, -2, io_gl_pos); - } -} - -static void io_gl_fixup(const char *prompt, int change, int cursor) - -/* - * This function is used both for redrawing when input changes or for - * moving within the input line. The parameters are: - * prompt: compared to last_prompt[] for changes; - * change : the index of the start of changes in the input buffer, - * with -1 indicating no changes, -2 indicating we're on - * a new line, redraw everything. - * cursor : the desired location of the cursor after the call. - * A value of IO_GL_BUF_SIZE can be used to indicate the cursor should - * move just past the end of the input line. - */ -{ - static int io_gl_shift; /* index of first on screen character */ - static int off_right; /* true if more text right of screen */ - static int off_left; /* true if more text left of screen */ - static char last_prompt[80] = ""; - int left = 0, right = -1; /* bounds for redraw */ - int new_right = -1; /* alternate right bound, using io_gl_extent */ - - if (change == -2) { /* reset */ - io_gl_pos = io_gl_cnt = io_gl_shift = off_right = off_left = 0; - io_gl_putc('\r'); - io_gl_puts(prompt); - copy_string(last_prompt, prompt, 80); - change = 0; - io_gl_width = io_gl_termw - strlen(prompt); - } - else if (strcmp(prompt, last_prompt) != 0) { - int l1 = strlen(last_prompt); - int l2 = strlen(prompt); - io_gl_cnt = io_gl_cnt + l1 - l2; - copy_string(last_prompt, prompt, 80); - io_gl_putc('\r'); - io_gl_puts(prompt); - io_gl_pos = io_gl_shift; - io_gl_width = io_gl_termw - l2; - change = 0; - } - /* how much to erase at end of line */ - int pad = (off_right) ? io_gl_width - 1 : io_gl_cnt - io_gl_shift; /* old length */ - int backup = io_gl_pos - io_gl_shift; /* how far to backup before fixing */ - if (change >= 0) { - io_gl_cnt = strlen(io_gl_buf); - if (change > io_gl_cnt) - change = io_gl_cnt; - } - if (cursor > io_gl_cnt) { - if (cursor != IO_GL_BUF_SIZE) { /* IO_GL_BUF_SIZE means end of line */ - if (io_gl_ellipses_during_completion == 0) { - io_gl_beep(); - } - } - cursor = io_gl_cnt; - } - if (cursor < 0) { - io_gl_beep(); - cursor = 0; - } - int extra = 0; /* adjusts when shift (scroll) happens */ - if (off_right || (off_left && cursor < io_gl_shift + io_gl_width - io_gl_scroll / 2)) { - extra = 2; /* shift the scrolling boundary */ - } - int new_shift = cursor + extra + io_gl_scroll - io_gl_width; - if (new_shift > 0) { - new_shift /= io_gl_scroll; - new_shift *= io_gl_scroll; - } - else - new_shift = 0; - if (new_shift != io_gl_shift) { /* scroll occurs */ - io_gl_shift = new_shift; - off_left = (io_gl_shift) ? 1 : 0; - off_right = (io_gl_cnt > io_gl_shift + io_gl_width - 1) ? 1 : 0; - left = io_gl_shift; - new_right = right = (off_right) ? io_gl_shift + io_gl_width - 2 : io_gl_cnt; - } - else if (change >= 0) { /* no scroll, but text changed */ - if (change < io_gl_shift + off_left) { - left = io_gl_shift; - } - else { - left = change; - backup = io_gl_pos - change; - } - off_right = (io_gl_cnt > io_gl_shift + io_gl_width - 1) ? 1 : 0; - right = (off_right) ? io_gl_shift + io_gl_width - 2 : io_gl_cnt; - new_right = (io_gl_extent && (right > left + io_gl_extent)) ? left + io_gl_extent : right; - } - pad -= (off_right) ? io_gl_width - 1 : io_gl_cnt - io_gl_shift; - pad = (pad < 0) ? 0 : pad; - if (left <= right) { /* clean up screen */ - for (int i = 0; i < backup; i++) - io_gl_putc('\b'); - if (left == io_gl_shift && off_left) { - io_gl_putc('$'); - left++; - } - for (int i = left; i < new_right; i++) - io_gl_putc(io_gl_buf[i]); - io_gl_pos = new_right; - if (off_right && new_right == right) { - io_gl_putc('$'); - io_gl_pos++; - } - else { - for (int i = 0; i < pad; i++) /* erase remains of prev line */ - io_gl_putc(' '); - io_gl_pos += pad; - } - } - int i = io_gl_pos - cursor; /* move to final cursor location */ - if (i > 0) { - while (i--) - io_gl_putc('\b'); - } - else { - for (int ii = io_gl_pos; ii < cursor; ii++) - io_gl_putc(io_gl_buf[ii]); - } - io_gl_pos = cursor; -} - -/******************* History stuff **************************************/ - -#ifndef HIST_SIZE -#define HIST_SIZE 100 -#endif - -static int hist_pos = 0, hist_last = 0; -static char *hist_buf[HIST_SIZE]; -static char hist_empty_elem[2] = ""; - -static void hist_init(void) -{ - hist_buf[0] = hist_empty_elem; - for (int i = 1; i < HIST_SIZE; i++) - hist_buf[i] = NULL; -} - -void io_gl_histadd(const char *buf) -{ - static char *prev = NULL; - - /* in case we call io_gl_histadd() before we call getline() */ - if (io_gl_init_done < 0) { /* -1 only on startup */ - hist_init(); - io_gl_init_done = 0; - } - const char *p = buf; - while (*p == ' ' || *p == '\t' || *p == '\n') - p++; - if (*p) { - int len = strlen(buf); - if (strchr(p, '\n')) /* previously line already has NL stripped */ - len--; - if ((prev == NULL) || ((int)strlen(prev) != len) || strncmp(prev, buf, (size_t)len) != 0) { - hist_buf[hist_last] = hist_save(buf); - prev = hist_buf[hist_last]; - hist_last = (hist_last + 1) % HIST_SIZE; - if (hist_buf[hist_last] && *hist_buf[hist_last]) { - free(hist_buf[hist_last]); - } - hist_buf[hist_last] = hist_empty_elem; - } - } - hist_pos = hist_last; -} - -static char *hist_prev(void) -/* loads previous hist entry into input buffer, sticks on first */ -{ - char *p = NULL; - int next = (hist_pos - 1 + HIST_SIZE) % HIST_SIZE; - - if (hist_buf[hist_pos] != NULL && next != hist_last) { - hist_pos = next; - p = hist_buf[hist_pos]; - } - if (p == NULL) { - p = hist_empty_elem; - io_gl_beep(); - } - return p; -} - -static char *hist_next(void) -/* loads next hist entry into input buffer, clears on last */ -{ - char *p = NULL; - - if (hist_pos != hist_last) { - hist_pos = (hist_pos + 1) % HIST_SIZE; - p = hist_buf[hist_pos]; - } - if (p == NULL) { - p = hist_empty_elem; - io_gl_beep(); - } - return p; -} - -static char *hist_save(const char *p) - -/* makes a copy of the string */ -{ - char *s = NULL; - size_t len = strlen(p); - char *nl = strpbrk(p, "\n\r"); - - if (nl) { - if ((s = (char *)malloc(len)) != NULL) { - copy_string(s, p, len); - s[len - 1] = '\0'; - } - } - else { - if ((s = (char *)malloc(len + 1)) != NULL) { - copy_string(s, p, len + 1); - } - } - if (s == NULL) - io_gl_error("\n*** Error: hist_save() failed on malloc\n"); - return s; -} - -/******************* Search stuff **************************************/ - -static char search_prompt[101]; /* prompt includes search string */ -static char search_string[100]; -static int search_pos = 0; /* current location in search_string */ -static int search_forw_flg = 0; /* search direction flag */ -static int search_last = 0; /* last match found */ - -static void search_update(int c) -{ - if (c == 0) { - search_pos = 0; - search_string[0] = '\0'; - search_prompt[0] = '?'; - search_prompt[1] = ' '; - search_prompt[2] = '\0'; - } - else if (c > 0) { - search_string[search_pos] = (char)c; - search_string[search_pos + 1] = (char)0; - search_prompt[search_pos] = (char)c; - search_prompt[search_pos + 1] = (char)'?'; - search_prompt[search_pos + 2] = (char)' '; - search_prompt[search_pos + 3] = (char)0; - search_pos++; - } - else { - if (search_pos > 0) { - search_pos--; - search_string[search_pos] = (char)0; - search_prompt[search_pos] = (char)'?'; - search_prompt[search_pos + 1] = (char)' '; - search_prompt[search_pos + 2] = (char)0; - } - else { - io_gl_beep(); - hist_pos = hist_last; - } - } -} - -static void search_addchar(int c) -{ - search_update(c); - if (c < 0) { - if (search_pos > 0) { - hist_pos = search_last; - } - else { - io_gl_buf[0] = '\0'; - hist_pos = hist_last; - } - copy_string(io_gl_buf, hist_buf[hist_pos], IO_GL_BUF_SIZE); - } - - char *loc = NULL; - if ((loc = strstr(io_gl_buf, search_string)) != NULL) { - io_gl_fixup(search_prompt, 0, loc - io_gl_buf); - } - else if (search_pos > 0) { - if (search_forw_flg) { - search_forw(0); - } - else { - search_back(0); - } - } - else { - io_gl_fixup(search_prompt, 0, 0); - } -} - -static void search_term(void) -{ - io_gl_search_mode = 0; - if (io_gl_buf[0] == 0) /* not found, reset hist list */ - hist_pos = hist_last; - io_gl_fixup(io_gl_prompt, 0, io_gl_pos); -} - -static void search_back(int new_search) -{ - search_forw_flg = 0; - if (io_gl_search_mode == 0) { - search_last = hist_pos = hist_last; - search_update(0); - io_gl_search_mode = 1; - io_gl_buf[0] = '\0'; - io_gl_fixup(search_prompt, 0, 0); - } - else if (search_pos > 0) { - int found = 0; - while (!found) { - char *loc; - char *p = hist_prev(); - if (*p == 0) { /* not found, done looking */ - io_gl_buf[0] = '\0'; - io_gl_fixup(search_prompt, 0, 0); - found = 1; - } - else if ((loc = strstr(p, search_string)) != NULL) { - copy_string(io_gl_buf, p, IO_GL_BUF_SIZE); - io_gl_fixup(search_prompt, 0, loc - p); - if (new_search) - search_last = hist_pos; - found = 1; - } - } - } - else { - io_gl_beep(); - } -} - -static void search_forw(int new_search) -{ - char *loc; - - search_forw_flg = 1; - if (io_gl_search_mode == 0) { - search_last = hist_pos = hist_last; - search_update(0); - io_gl_search_mode = 1; - io_gl_buf[0] = '\0'; - io_gl_fixup(search_prompt, 0, 0); - } - else if (search_pos > 0) { - int found = 0; - while (!found) { - char *p = hist_next(); - if (*p == 0) { /* not found, done looking */ - io_gl_buf[0] = '\0'; - io_gl_fixup(search_prompt, 0, 0); - found = 1; - } - else if ((loc = strstr(p, search_string)) != NULL) { - copy_string(io_gl_buf, p, IO_GL_BUF_SIZE); - io_gl_fixup(search_prompt, 0, loc - p); - if (new_search) - search_last = hist_pos; - found = 1; - } - } - } - else { - io_gl_beep(); - } -} - -static void io_gl_beep(void) -{ -#ifdef __windows__ - MessageBeep(MB_OK); -#else - io_gl_putc('\007'); -#endif -} /* io_gl_beep */ diff --git a/packages/seacas/libraries/ioss/src/Ioss_Glob.h b/packages/seacas/libraries/ioss/src/Ioss_Glob.h index 0aa834f05cb7..83c4b4db5ce4 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_Glob.h +++ b/packages/seacas/libraries/ioss/src/Ioss_Glob.h @@ -441,11 +441,7 @@ namespace Ioss { case Type::AT: case Type::ANY: case Type::STAR: - case Type::PLUS: { - std::tie(r, std::ignore) = BasicCheck(str, pos); - break; - } - + case Type::PLUS: case Type::NEG: { std::tie(r, std::ignore) = BasicCheck(str, pos); break; diff --git a/packages/seacas/libraries/ioss/src/Ioss_GroupingEntity.C b/packages/seacas/libraries/ioss/src/Ioss_GroupingEntity.C index 133ae14edda3..dcb35926aae4 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_GroupingEntity.C +++ b/packages/seacas/libraries/ioss/src/Ioss_GroupingEntity.C @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2022 National Technology & Engineering Solutions +// Copyright(C) 1999-2023 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. // @@ -173,28 +173,31 @@ bool Ioss::GroupingEntity::check_for_duplicate(const Ioss::Field &new_field) con { // See if a field with the same name exists... if (field_exists(new_field.get_name())) { - // Get the existing field so we can compare with `new_field` - const Ioss::Field &field = fields.getref(new_field.get_name()); - if (field != new_field) { - bool allow_duplicate = false; - Utils::check_set_bool_property(get_database()->get_property_manager(), - "IGNORE_DUPLICATE_FIELD_NAMES", allow_duplicate); - std::string warn_err = allow_duplicate ? "WARNING" : "ERROR"; - std::ostringstream errmsg; - fmt::print(errmsg, - "{}: Duplicate incompatible fields named '{}' on {} {}:\n" - "\tExisting field: {} {} of size {} bytes with role '{}' and storage '{}',\n" - "\tDuplicate field: {} {} of size {} bytes with role '{}' and storage '{}'.", - warn_err, new_field.get_name(), type_string(), name(), field.raw_count(), - field.type_string(), field.get_size(), field.role_string(), - field.raw_storage()->name(), new_field.raw_count(), new_field.type_string(), - new_field.get_size(), new_field.role_string(), new_field.raw_storage()->name()); - if (!allow_duplicate) { - IOSS_ERROR(errmsg); - } - else { - fmt::print(Ioss::WarnOut(), "{}\n", errmsg.str()); - return true; + auto behavior = get_database()->get_duplicate_field_behavior(); + if (behavior != DuplicateFieldBehavior::IGNORE_) { + // Get the existing field so we can compare with `new_field` + const Ioss::Field &field = fields.getref(new_field.get_name()); + if (field != new_field) { + std::string warn_err = behavior == DuplicateFieldBehavior::WARNING_ ? "" : "ERROR: "; + std::ostringstream errmsg; + fmt::print(errmsg, + "{}Duplicate incompatible fields named '{}' on {} {}:\n" + "\tExisting field: {} {} of size {} bytes with role '{}' and storage '{}',\n" + "\tDuplicate field: {} {} of size {} bytes with role '{}' and storage '{}'.", + warn_err, new_field.get_name(), type_string(), name(), field.raw_count(), + field.type_string(), field.get_size(), field.role_string(), + field.raw_storage()->name(), new_field.raw_count(), new_field.type_string(), + new_field.get_size(), new_field.role_string(), new_field.raw_storage()->name()); + if (behavior == DuplicateFieldBehavior::WARNING_) { + auto util = get_database()->util(); + if (util.parallel_rank() == 0) { + fmt::print(Ioss::WarnOut(), "{}\n", errmsg.str()); + } + return true; + } + else { + IOSS_ERROR(errmsg); + } } } } diff --git a/packages/seacas/libraries/ioss/src/Ioss_GroupingEntity.h b/packages/seacas/libraries/ioss/src/Ioss_GroupingEntity.h index 6fb5a8fdec47..542bb9b8a6da 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_GroupingEntity.h +++ b/packages/seacas/libraries/ioss/src/Ioss_GroupingEntity.h @@ -163,18 +163,18 @@ namespace Ioss { // ======================================================================== // Property-related information.... // Just forward it through to the property manager... - void property_add(const Property &new_prop); - void property_erase(const std::string &property_name); - bool property_exists(const std::string &property_name) const; - Property get_property(const std::string &property_name) const; - int64_t get_optional_property(const std::string &property, int64_t optional_value) const; - std::string get_optional_property(const std::string &property_name, - const std::string &optional_value) const; - NameList property_describe() const; - int property_describe(NameList *names) const; - NameList property_describe(Ioss::Property::Origin origin) const; - int property_describe(Ioss::Property::Origin origin, NameList *names) const; - size_t property_count() const; + inline void property_add(const Property &new_prop); + inline void property_erase(const std::string &property_name); + inline bool property_exists(const std::string &property_name) const; + inline Property get_property(const std::string &property_name) const; + inline int64_t get_optional_property(const std::string &property, int64_t optional_value) const; + inline std::string get_optional_property(const std::string &property_name, + const std::string &optional_value) const; + inline NameList property_describe() const; + inline int property_describe(NameList *names) const; + inline NameList property_describe(Ioss::Property::Origin origin) const; + inline int property_describe(Ioss::Property::Origin origin, NameList *names) const; + 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; @@ -184,20 +184,20 @@ namespace Ioss { // FIELDS // ======================================================================== // Just forward these through to the field manager... - void field_add(Field new_field); - void field_erase(const std::string &field_name); - void field_erase(Field::RoleType role); - bool field_exists(const std::string &field_name) const; - Field get_field(const std::string &field_name) const; - const Field &get_fieldref(const std::string &field_name) const; - int field_describe(NameList *names) const; - NameList field_describe() const; - int field_describe(Field::RoleType role, NameList *names) const; - NameList field_describe(Field::RoleType role) const; - size_t field_count() const; - size_t field_count(Field::RoleType role) const; - - bool check_for_duplicate(const Ioss::Field &new_field) const; + void field_add(Field new_field); + inline void field_erase(const std::string &field_name); + inline void field_erase(Field::RoleType role); + inline bool field_exists(const std::string &field_name) const; + inline Field get_field(const std::string &field_name) const; + inline const Field &get_fieldref(const std::string &field_name) const; + inline int field_describe(NameList *names) const; + inline NameList field_describe() const; + inline int field_describe(Field::RoleType role, NameList *names) const; + inline NameList field_describe(Field::RoleType role) const; + inline size_t field_count() const; + size_t field_count(Field::RoleType role) const; + + bool check_for_duplicate(const Ioss::Field &new_field) const; // Put this fields data into 'data'. diff --git a/packages/seacas/libraries/ioss/src/Ioss_Map.C b/packages/seacas/libraries/ioss/src/Ioss_Map.C index c3d1e6267e88..3c4b8887d72a 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_Map.C +++ b/packages/seacas/libraries/ioss/src/Ioss_Map.C @@ -17,6 +17,9 @@ #include #include // for vector, vector<>::iterator, etc +// If defined, then only build m_reverseMap when it is used. +#undef USE_LAZY_REVERSE + namespace { template bool is_one2one(INT *ids, size_t num_to_get, size_t offset) { @@ -69,9 +72,13 @@ bool Ioss::Map::is_sequential(bool check_all) const IOSS_FUNC_ENTER(m_); auto &new_map = const_cast(m_map); size_t map_size = m_map.size(); + if (m_offset == -1 && map_size > 1) { + m_offset = m_map[1] - 1; + } for (int64_t i = 1; i < (int64_t)map_size; i++) { if (m_map[i] != i + m_offset) { new_map[0] = 1; + m_offset = -1; return false; } } @@ -99,14 +106,72 @@ void Ioss::Map::build_reverse_map(int64_t num_to_get, int64_t offset) void Ioss::Map::build_reverse_map__(int64_t num_to_get, int64_t offset) { // Stored as an unordered map -- key:global_id, value:local_id - if (is_sequential()) { - return; + if (!is_sequential()) { +#if defined MAP_USE_SORTED_VECTOR + ReverseMapContainer new_ids; + if (m_reverse.empty()) { + // This is first time that the m_reverse map is being built.. + // m_map is no longer 1-to-1. + // Just iterate m_map and add all values that are non-zero + new_ids.reserve(m_map.size() - 1); + for (size_t i = 1; i < m_map.size(); i++) { + if (m_map[i] != 0) { + new_ids.emplace_back(m_map[i], i); + } + } + } + else { + new_ids.reserve(num_to_get); + for (int64_t i = 0; i < num_to_get; i++) { + int64_t local_id = offset + i + 1; + new_ids.emplace_back(m_map[local_id], local_id); + + if (m_map[local_id] <= 0) { + std::ostringstream errmsg; + fmt::print(errmsg, + "\nERROR: {0} map detected non-positive global id {1} for {0} with local id {2} " + "on processor {3}.\n", + m_entityType, m_map[local_id], local_id, m_myProcessor); + IOSS_ERROR(errmsg); + } + } } + // new_ids is a vector of pairs + Ioss::sort(new_ids); + + int64_t new_id_min = new_ids.empty() ? 0 : new_ids.front().first; + int64_t old_id_max = m_reverse.empty() ? 0 : m_reverse.back().first; + if (new_ids.size() + 1 == m_map.size()) { + SMART_ASSERT(m_reverse.empty() || m_reverse.size() + 1 == m_map.size()); + new_ids.swap(m_reverse); + } + else if (new_id_min > old_id_max) { + m_reverse.insert(m_reverse.end(), new_ids.begin(), new_ids.end()); + } + else { + // Copy reverseElementMap to old_ids, empty reverseElementMap. + ReverseMapContainer old_ids; + old_ids.swap(m_reverse); + SMART_ASSERT(m_reverse.empty()); + + // Merge old_ids and new_ids to reverseElementMap. + m_reverse.reserve(old_ids.size() + new_ids.size()); + std::merge( + old_ids.begin(), old_ids.end(), new_ids.begin(), new_ids.end(), + std::inserter(m_reverse, m_reverse.begin()), + [](const Ioss::IdPair &lhs, const Ioss::IdPair &rhs) { return lhs.first < rhs.first; }); + } + + // Check for duplicate ids... + // Maybe debug only... + verify_no_duplicate_ids(m_reverse); +#else if (m_reverse.empty()) { // This is first time that the m_reverse map is being built.. // m_map is no longer 1-to-1. // Just iterate m_map and add all values that are non-zero + m_reverse.max_load_factor(0.95); m_reverse.reserve(m_map.size()); for (size_t i = 1; i < m_map.size(); i++) { if (m_map[i] != 0) { @@ -148,8 +213,37 @@ void Ioss::Map::build_reverse_map__(int64_t num_to_get, int64_t offset) } } } +#if IOSS_DEBUG_OUTPUT + fmt::print("[{}] ({}) Map Size = {}\n", m_myProcessor, m_entityType, m_map.size()); + fmt::print("[{}] ({}) Size = {}\n", m_myProcessor, m_entityType, m_reverse.size()); + fmt::print("[{}] ({}) Bucket Count = {}\n", m_myProcessor, m_entityType, m_reverse.bucket_count()); + fmt::print("[{}] ({}) Load Factor = {}\n", m_myProcessor, m_entityType, m_reverse.load_factor()); + fmt::print("[{}] ({}) Max Load Factor = {}\n\n", m_myProcessor, m_entityType, m_reverse.max_load_factor()); +#endif +#endif +} } +#if defined MAP_USE_SORTED_VECTOR +void Ioss::Map::verify_no_duplicate_ids(std::vector &reverse_map) +{ + // Check for duplicate ids... + auto dup = std::adjacent_find( + reverse_map.begin(), reverse_map.end(), + [](const Ioss::IdPair &lhs, const Ioss::IdPair &rhs) { return lhs.first == rhs.first; }); + if (dup != reverse_map.end()) { + auto other = dup + 1; + std::ostringstream errmsg; + fmt::print(errmsg, + "\nERROR: Duplicate {0} global id detected on processor {1}, filename '{2}'.\n" + " Global id {3} assigned to local {0}s {4} and {5}.\n", + m_entityType, m_myProcessor, m_filename, (*dup).first, (*dup).second, + (*other).second); + IOSS_ERROR(errmsg); + } +} +#endif + template IOSS_EXPORT bool Ioss::Map::set_map(int *ids, size_t count, size_t offset, bool in_define_mode); template IOSS_EXPORT bool Ioss::Map::set_map(int64_t *ids, size_t count, size_t offset, @@ -182,7 +276,11 @@ bool Ioss::Map::set_map(INT *ids, size_t count, size_t offset, bool in_define_mo // that can be done, need to build a reverseMap of the current // one-to-one data... set_is_sequential(false); - build_reverse_map__(m_map.size() - 1, 0); +#if !defined USE_LAZY_REVERSE + if (m_map.size() - 1 > count) { + build_reverse_map__(m_map.size() - 1, 0); + } +#endif m_offset = 0; } else { @@ -193,17 +291,29 @@ bool Ioss::Map::set_map(INT *ids, size_t count, size_t offset, bool in_define_mo } } + // Determine if `changed` which means an entity was redefined... + // This is used to determine whether a `reorder` map is needed. bool changed = false; // True if redefining an entry for (size_t i = 0; i < count; i++) { int64_t local_id = offset + i + 1; SMART_ASSERT((size_t)local_id < m_map.size())(local_id)(m_map.size()); if (m_map[local_id] > 0 && m_map[local_id] != ids[i]) { changed = true; + break; } - m_map[local_id] = ids[i]; - if (local_id != ids[i] - m_offset) { - set_is_sequential(false); - } + } + +#if defined USE_LAZY_REVERSE + // Build this now before we redefine an entry + if (!in_define_mode && changed) { + build_reverse_map__(m_map.size() - 1, 0); + } +#endif + + for (size_t i = 0; i < count; i++) { + int64_t local_id = offset + i + 1; + SMART_ASSERT((size_t)local_id < m_map.size())(local_id)(m_map.size()); + if (ids[i] <= 0) { std::ostringstream errmsg; fmt::print(errmsg, @@ -212,13 +322,20 @@ bool Ioss::Map::set_map(INT *ids, size_t count, size_t offset, bool in_define_mo m_entityType, ids[i], local_id, m_myProcessor, m_filename); IOSS_ERROR(errmsg); } + + m_map[local_id] = ids[i]; + if (local_id != ids[i] - m_offset) { + set_is_sequential(false); + } } if (in_define_mode) { if (changed) { m_reverse.clear(); } +#if !defined USE_LAZY_REVERSE build_reverse_map__(count, offset); +#endif } else if (changed) { // Build the reorderEntityMap which does a direct mapping from @@ -404,25 +521,31 @@ void Ioss::Map::build_reorder_map__(int64_t start, int64_t count) // using -1 as invalid value...) // Note: To further add confusion, the reorder map is 0-based - // and the reverse map and 'map' are 1-baed. This is + // and the reverse map and 'map' are 1-based. This is // just a consequence of how they are intended to be used... // - // start is based on a 0-based array -- start of the reorderMap to build. + // `start` is based on a 0-based array -- start of the reorderMap to build. if (m_reorder.empty()) { // See if actually need a reorder map first... - bool need_reorder_map = false; - int64_t my_end = start + count; - for (int64_t i = start; i < my_end; i++) { - int64_t global_id = m_map[i + 1]; - int64_t orig_local_id = global_to_local__(global_id) - 1; - - // The reordering should only be a permutation of the original - // ordering within this entity block... - SMART_ASSERT(orig_local_id >= start && orig_local_id <= my_end)(orig_local_id)(start)(my_end); - if (i != orig_local_id) { - need_reorder_map = true; - break; + bool need_reorder_map = false; + if (m_reverse.empty()) { + need_reorder_map = true; + } + else { + int64_t my_end = start + count; + for (int64_t i = start; i < my_end; i++) { + int64_t global_id = m_map[i + 1]; + int64_t orig_local_id = global_to_local__(global_id) - 1; + + // The reordering should only be a permutation of the original + // ordering within this entity block... + SMART_ASSERT(orig_local_id >= start && orig_local_id <= my_end) + (orig_local_id)(start)(my_end); + if (i != orig_local_id) { + need_reorder_map = true; + break; + } } } if (need_reorder_map) { @@ -464,11 +587,31 @@ int64_t Ioss::Map::global_to_local(int64_t global, bool must_exist) const int64_t Ioss::Map::global_to_local__(int64_t global, bool must_exist) const { int64_t local = global; +#if defined USE_LAZY_REVERSE + if (!is_sequential() && m_reverse.empty() && m_reorder.empty()) { + auto *new_this = const_cast(this); + new_this->build_reverse_map_no_lock(); + } +#endif + if (!is_sequential() && !m_reverse.empty()) { // Possible for !is_sequential() which means non-one-to-one, but // reverseMap is empty (which implied one-to-one) if the ORIGINAL mapping defined // during dbState == STATE_MODEL was one-to-one, but there is a // reordering which is due to new id ordering defined after STATE_MODEL... +#if defined MAP_USE_SORTED_VECTOR + auto iter = std::lower_bound( + m_reverse.begin(), m_reverse.end(), global, + [](const Ioss::IdPair &lhs, int64_t val) -> bool { return lhs.first < val; }); + if (iter != m_reverse.end() && iter->first == global) { + if (iter != m_reverse.end()) { + local = iter->second; + } + } + else { + local = 0; + } +#else auto iter = m_reverse.find(global); if (iter != m_reverse.end()) { local = iter->second; @@ -476,6 +619,7 @@ int64_t Ioss::Map::global_to_local__(int64_t global, bool must_exist) const else { local = 0; } +#endif } else if (!must_exist && global > static_cast(m_map.size()) - 1) { local = 0; diff --git a/packages/seacas/libraries/ioss/src/Ioss_Map.h b/packages/seacas/libraries/ioss/src/Ioss_Map.h index 8c17fe40b87a..2bd95e169bde 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_Map.h +++ b/packages/seacas/libraries/ioss/src/Ioss_Map.h @@ -9,12 +9,12 @@ #include "ioss_export.h" #include -#include // for size_t -#include // for int64_t -#include // for string -#include // for vector +#include +#include +#include +#include -#define MAP_USE_HOPSCOTCH +#define MAP_USE_STD #if defined MAP_USE_STD #include #elif defined MAP_USE_HOPSCOTCH @@ -30,7 +30,10 @@ namespace Ioss { namespace Ioss { using MapContainer = std::vector; -#if defined MAP_USE_STD +#if defined MAP_USE_SORTED_VECTOR + using IdPair = std::pair; + using ReverseMapContainer = std::vector; +#elif defined MAP_USE_STD using ReverseMapContainer = std::unordered_map; #elif defined MAP_USE_HOPSCOTCH // The `b` variant requires less-than-comparable key, but is faster @@ -55,7 +58,7 @@ namespace Ioss { Map &operator=(const Map &from) = delete; ~Map() = default; - void set_rank(int processor) {m_myProcessor = processor;} + void set_rank(int processor) { m_myProcessor = processor; } void set_size(size_t entity_count); size_t size() const { return m_map.empty() ? 0 : m_map.size() - 1; } @@ -103,7 +106,9 @@ namespace Ioss { int64_t global_to_local__(int64_t global, bool must_exist = true) const; void build_reorder_map__(int64_t start, int64_t count); void build_reverse_map__(int64_t num_to_get, int64_t offset); - +#if defined MAP_USE_SORTED_VECTOR + void verify_no_duplicate_ids(std::vector &reverse_map); +#endif #if defined(IOSS_THREADSAFE) mutable std::mutex m_; #endif @@ -112,7 +117,7 @@ namespace Ioss { ReverseMapContainer m_reverse{}; std::string m_entityType{"unknown"}; // node, element, edge, face std::string m_filename{"undefined"}; // For error messages only. - int64_t m_offset{-1}; // local to global offset if m_map is sequential. + mutable int64_t m_offset{-1}; // local to global offset if m_map is sequential. int m_myProcessor{0}; // For error messages... bool m_defined{false}; // For use by some clients; not all, so don't read too much into value... }; diff --git a/packages/seacas/libraries/ioss/src/Ioss_ParallelUtils.C b/packages/seacas/libraries/ioss/src/Ioss_ParallelUtils.C index a82d6ca14cc3..75ff1fb20e4f 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_ParallelUtils.C +++ b/packages/seacas/libraries/ioss/src/Ioss_ParallelUtils.C @@ -95,9 +95,9 @@ void Ioss::ParallelUtils::add_environment_properties(Ioss::PropertyManager &prop } bool Ioss::ParallelUtils::get_environment(const std::string &name, std::string &value, - bool sync_parallel) const + IOSS_MAYBE_UNUSED bool sync_parallel) const { - PAR_UNUSED(sync_parallel); + IOSS_PAR_UNUSED(sync_parallel); #ifdef SEACAS_HAVE_MPI char *result_string = nullptr; std::vector broadcast_string; @@ -150,7 +150,7 @@ bool Ioss::ParallelUtils::get_environment(const std::string &name, std::string & } bool Ioss::ParallelUtils::get_environment(const std::string &name, int &value, - bool sync_parallel) const + IOSS_MAYBE_UNUSED bool sync_parallel) const { std::string str_value; bool success = get_environment(name, str_value, sync_parallel); @@ -160,11 +160,12 @@ bool Ioss::ParallelUtils::get_environment(const std::string &name, int &value, return success; } -bool Ioss::ParallelUtils::get_environment(const std::string &name, bool sync_parallel) const +bool Ioss::ParallelUtils::get_environment(const std::string &name, + IOSS_MAYBE_UNUSED bool sync_parallel) const { // Return true if 'name' defined, no matter what the value. // Return false if 'name' not defined. - PAR_UNUSED(sync_parallel); + IOSS_PAR_UNUSED(sync_parallel); #ifdef SEACAS_HAVE_MPI char *result_string = nullptr; int string_length = 0; @@ -259,9 +260,9 @@ void Ioss::ParallelUtils::hwm_memory_stats(int64_t &min, int64_t &max, int64_t & // Generate a "globally unique id" which is unique over all entities // of a specific type over all processors. // Used by some applications for uniquely identifying an entity. -int64_t Ioss::ParallelUtils::generate_guid(size_t id, int rank) const +int64_t Ioss::ParallelUtils::generate_guid(size_t id, IOSS_MAYBE_UNUSED int rank) const { - PAR_UNUSED(rank); + IOSS_PAR_UNUSED(rank); #ifdef SEACAS_HAVE_MPI static size_t lpow2 = 0; if (lpow2 == 0) { @@ -276,10 +277,11 @@ int64_t Ioss::ParallelUtils::generate_guid(size_t id, int rank) const #endif } -void Ioss::ParallelUtils::attribute_reduction(const int length, char buffer[]) const +void Ioss::ParallelUtils::attribute_reduction(IOSS_MAYBE_UNUSED const int length, + IOSS_MAYBE_UNUSED char buffer[]) const { - PAR_UNUSED(length); - PAR_UNUSED(buffer); + IOSS_PAR_UNUSED(length); + IOSS_PAR_UNUSED(buffer); #ifdef SEACAS_HAVE_MPI if (1 < parallel_size()) { static_assert(sizeof(char) == 1, ""); @@ -373,17 +375,20 @@ void Ioss::ParallelUtils::global_count(const Int64Vector &local_counts, #endif } -template IOSS_EXPORT int Ioss::ParallelUtils::global_minmax(int, Ioss::ParallelUtils::MinMax which) const; -template IOSS_EXPORT unsigned int Ioss::ParallelUtils::global_minmax(unsigned int, - Ioss::ParallelUtils::MinMax which) const; -template IOSS_EXPORT int64_t Ioss::ParallelUtils::global_minmax(int64_t, - Ioss::ParallelUtils::MinMax which) const; -template IOSS_EXPORT double Ioss::ParallelUtils::global_minmax(double, Ioss::ParallelUtils::MinMax which) const; +template IOSS_EXPORT int +Ioss::ParallelUtils::global_minmax(int, Ioss::ParallelUtils::MinMax which) const; +template IOSS_EXPORT unsigned int +Ioss::ParallelUtils::global_minmax(unsigned int, Ioss::ParallelUtils::MinMax which) const; +template IOSS_EXPORT int64_t +Ioss::ParallelUtils::global_minmax(int64_t, Ioss::ParallelUtils::MinMax which) const; +template IOSS_EXPORT double +Ioss::ParallelUtils::global_minmax(double, Ioss::ParallelUtils::MinMax which) const; template -T Ioss::ParallelUtils::global_minmax(T local_minmax, Ioss::ParallelUtils::MinMax which) const +T Ioss::ParallelUtils::global_minmax(T local_minmax, + IOSS_MAYBE_UNUSED Ioss::ParallelUtils::MinMax which) const { - PAR_UNUSED(which); + IOSS_PAR_UNUSED(which); T minmax = local_minmax; #ifdef SEACAS_HAVE_MPI @@ -419,10 +424,13 @@ template IOSS_EXPORT void Ioss::ParallelUtils::broadcast(int &value, int) const; /// \relates Ioss::ParallelUtils::broadcast template IOSS_EXPORT void Ioss::ParallelUtils::broadcast(int64_t &value, int) const; -template <> void Ioss::ParallelUtils::broadcast(std::string &my_str, int root) const +namespace Ioss { +template <> +void ParallelUtils::broadcast(IOSS_MAYBE_UNUSED std::string &my_str, + IOSS_MAYBE_UNUSED int root) const { - PAR_UNUSED(my_str); - PAR_UNUSED(root); + IOSS_PAR_UNUSED(my_str); + IOSS_PAR_UNUSED(root); #ifdef SEACAS_HAVE_MPI if (parallel_size() > 1) { const int success = MPI_Bcast(const_cast(my_str.data()), (int)my_str.size() + 1, @@ -435,11 +443,14 @@ template <> void Ioss::ParallelUtils::broadcast(std::string &my_str, int root) c } #endif } +} // namespace Ioss + -template void Ioss::ParallelUtils::broadcast(T &my_value, int root) const +template +void Ioss::ParallelUtils::broadcast(IOSS_MAYBE_UNUSED T &my_value, IOSS_MAYBE_UNUSED int root) const { - PAR_UNUSED(my_value); - PAR_UNUSED(root); + IOSS_PAR_UNUSED(my_value); + IOSS_PAR_UNUSED(root); #ifdef SEACAS_HAVE_MPI if (parallel_size() > 1) { const int success = MPI_Bcast((void *)&my_value, 1, mpi_type(T()), root, communicator_); @@ -463,11 +474,14 @@ template IOSS_EXPORT void Ioss::ParallelUtils::broadcast(std::vector /// \relates Ioss::ParallelUtils::broadcast template IOSS_EXPORT void Ioss::ParallelUtils::broadcast(std::vector &, int) const; /// \relates Ioss::ParallelUtils::broadcast +namespace Ioss { template <> -IOSS_EXPORT void Ioss::ParallelUtils::broadcast(std::vector> &my_value, int root) const +IOSS_EXPORT void +ParallelUtils::broadcast(IOSS_MAYBE_UNUSED std::vector> &my_value, + IOSS_MAYBE_UNUSED int root) const { - PAR_UNUSED(my_value); - PAR_UNUSED(root); + IOSS_PAR_UNUSED(my_value); + IOSS_PAR_UNUSED(root); #ifdef SEACAS_HAVE_MPI if (parallel_size() > 1) { const int success = @@ -480,11 +494,14 @@ IOSS_EXPORT void Ioss::ParallelUtils::broadcast(std::vector> } #endif } +} // namespace Ioss -template void Ioss::ParallelUtils::broadcast(std::vector &my_value, int root) const +template +void Ioss::ParallelUtils::broadcast(IOSS_MAYBE_UNUSED std::vector &my_value, + IOSS_MAYBE_UNUSED int root) const { - PAR_UNUSED(my_value); - PAR_UNUSED(root); + IOSS_PAR_UNUSED(my_value); + IOSS_PAR_UNUSED(root); #ifdef SEACAS_HAVE_MPI if (parallel_size() > 1) { const int success = @@ -509,9 +526,11 @@ template IOSS_EXPORT void Ioss::ParallelUtils::all_gather(int, std::vector /// \relates Ioss::ParallelUtils::all_gather template IOSS_EXPORT void Ioss::ParallelUtils::all_gather(int64_t, std::vector &) const; /// \relates Ioss::ParallelUtils::all_gather -template IOSS_EXPORT void Ioss::ParallelUtils::all_gather(std::vector &, std::vector &) const; +template IOSS_EXPORT void Ioss::ParallelUtils::all_gather(std::vector &, + std::vector &) const; /// \relates Ioss::ParallelUtils::all_gather -template IOSS_EXPORT void Ioss::ParallelUtils::all_gather(std::vector &, std::vector &) const; +template IOSS_EXPORT void Ioss::ParallelUtils::all_gather(std::vector &, + std::vector &) const; template void Ioss::ParallelUtils::gather(T my_value, std::vector &result) const { @@ -597,10 +616,10 @@ void Ioss::ParallelUtils::progress(const std::string &output) const /// \relates Ioss::ParallelUtils::gather template IOSS_EXPORT void Ioss::ParallelUtils::gather(std::vector &my_values, - std::vector &result) const; + std::vector &result) const; /// \relates Ioss::ParallelUtils::gather template IOSS_EXPORT void Ioss::ParallelUtils::gather(std::vector &my_values, - std::vector &result) const; + std::vector &result) const; template void Ioss::ParallelUtils::gather(std::vector &my_values, std::vector &result) const { @@ -628,17 +647,17 @@ void Ioss::ParallelUtils::gather(std::vector &my_values, std::vector &resu /// \relates Ioss::ParallelUtils::gather template IOSS_EXPORT int Ioss::ParallelUtils::gather(int num_vals, int size_per_val, - std::vector &my_values, - std::vector &result) const; + std::vector &my_values, + std::vector &result) const; /// \relates Ioss::ParallelUtils::gather template IOSS_EXPORT int Ioss::ParallelUtils::gather(int num_vals, int size_per_val, - std::vector &my_values, - std::vector &result) const; + std::vector &my_values, + std::vector &result) const; template -int Ioss::ParallelUtils::gather(int num_vals, int size_per_val, std::vector &my_values, - std::vector &result) const +int Ioss::ParallelUtils::gather(int num_vals, IOSS_MAYBE_UNUSED int size_per_val, + std::vector &my_values, std::vector &result) const { - PAR_UNUSED(size_per_val); + IOSS_PAR_UNUSED(size_per_val); #ifdef SEACAS_HAVE_MPI std::vector vals_per_proc; gather(num_vals, vals_per_proc); diff --git a/packages/seacas/libraries/ioss/src/Ioss_ParallelUtils.h b/packages/seacas/libraries/ioss/src/Ioss_ParallelUtils.h index 5594063897d1..2d23b26c8b2c 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_ParallelUtils.h +++ b/packages/seacas/libraries/ioss/src/Ioss_ParallelUtils.h @@ -14,6 +14,10 @@ #include // for size_t #include // for string #include // for vector +#if IOSS_DEBUG_OUTPUT +#include +#include +#endif #ifdef SEACAS_HAVE_MPI #include @@ -57,7 +61,8 @@ namespace Ioss { * getenv system call is only done on processor 0. * If '!sync_parallel', then don't push to other processors. */ - bool get_environment(const std::string &name, std::string &value, bool sync_parallel) const; + bool get_environment(const std::string &name, std::string &value, + IOSS_MAYBE_UNUSED bool sync_parallel) const; /*! * Returns 'true' if 'name' is defined in the environment. The @@ -67,7 +72,8 @@ namespace Ioss { * system call is only done on processor 0. If '!sync_parallel', * then don't push to other processors. */ - bool get_environment(const std::string &name, int &value, bool sync_parallel) const; + bool get_environment(const std::string &name, int &value, + IOSS_MAYBE_UNUSED bool sync_parallel) const; /*! * Returns 'true' if 'name' is defined in the environment no @@ -75,7 +81,7 @@ namespace Ioss { * getenv system call is only done on processor 0. * If '!sync_parallel', then don't push to other processors. */ - bool get_environment(const std::string &name, bool sync_parallel) const; + bool get_environment(const std::string &name, IOSS_MAYBE_UNUSED bool sync_parallel) const; std::string decode_filename(const std::string &filename, bool is_parallel) const; @@ -90,7 +96,7 @@ namespace Ioss { * knowledge of the value should initialize to '0' and the * processors with knowledge set the appropriate values. */ - void attribute_reduction(int length, char buffer[]) const; + void attribute_reduction(IOSS_MAYBE_UNUSED int length, IOSS_MAYBE_UNUSED char buffer[]) const; /*! * Generate a "globally unique id" which is unique over all entities @@ -98,7 +104,7 @@ namespace Ioss { * Used by some applications for uniquely identifying an entity. * If `rank` == -1, then use parallel_rank; otherwise use rank */ - int64_t generate_guid(size_t id, int rank = -1) const; + int64_t generate_guid(IOSS_MAYBE_UNUSED size_t id, int rank = -1) const; /*! Return min, max, average memory used by any process */ void memory_stats(int64_t &min, int64_t &max, int64_t &avg) const; @@ -115,10 +121,12 @@ namespace Ioss { void global_count(const IntVector &local_counts, IntVector &global_counts) const; void global_count(const Int64Vector &local_counts, Int64Vector &global_counts) const; - template T global_minmax(T local_minmax, MinMax which) const; + template + T global_minmax(IOSS_MAYBE_UNUSED T local_minmax, IOSS_MAYBE_UNUSED MinMax which) const; template - void global_array_minmax(std::vector &local_minmax, MinMax which) const; + void global_array_minmax(IOSS_MAYBE_UNUSED std::vector &local_minmax, + IOSS_MAYBE_UNUSED MinMax which) const; template void gather(T my_value, std::vector &result) const; template void all_gather(T my_value, std::vector &result) const; @@ -221,6 +229,21 @@ namespace Ioss { // -- if (sendcnts[#proc-1] + senddisp[#proc-1] < 2^31, then we are ok // 2) They are of type 64-bit integers, and storing data in the 64-bit integer range. // -- call special alltoallv which does point-to-point sends +#if IOSS_DEBUG_OUTPUT + { + Ioss::ParallelUtils utils(comm); + int processor_count = utils.parallel_size(); + + int max_comm = sendcnts[processor_count - 1] + senddisp[processor_count - 1]; + std::vector comm_size; + + utils.gather(max_comm, comm_size); + int my_rank = utils.parallel_rank(); + if (my_rank == 0) { + fmt::print("Send Communication Size: {}\n", fmt::join(comm_size, ", ")); + } + } +#endif #if 1 int processor_count = 0; MPI_Comm_size(comm, &processor_count); @@ -254,6 +277,21 @@ namespace Ioss { const std::vector &recvcnts, const std::vector &recvdisp, Ioss_MPI_Comm comm) { +#if IOSS_DEBUG_OUTPUT + { + Ioss::ParallelUtils utils(comm); + int processor_count = utils.parallel_size(); + + int max_comm = sendcnts[processor_count - 1] + senddisp[processor_count - 1]; + std::vector comm_size; + + utils.gather(max_comm, comm_size); + int my_rank = utils.parallel_rank(); + if (my_rank == 0) { + fmt::print("Send Communication Size: {}\n", fmt::join(comm_size, ", ")); + } + } +#endif return MPI_Alltoallv((void *)sendbuf.data(), const_cast(sendcnts.data()), const_cast(senddisp.data()), mpi_type(T(0)), recvbuf.data(), const_cast(recvcnts.data()), const_cast(recvdisp.data()), @@ -262,10 +300,11 @@ namespace Ioss { #endif template - void ParallelUtils::global_array_minmax(std::vector &local_minmax, MinMax which) const + void ParallelUtils::global_array_minmax(IOSS_MAYBE_UNUSED std::vector &local_minmax, + IOSS_MAYBE_UNUSED MinMax which) const { - PAR_UNUSED(local_minmax); - PAR_UNUSED(which); + IOSS_PAR_UNUSED(local_minmax); + IOSS_PAR_UNUSED(which); #ifdef SEACAS_HAVE_MPI if (parallel_size() > 1 && !local_minmax.empty()) { if (Ioss::SerializeIO::isEnabled() && Ioss::SerializeIO::inBarrier()) { diff --git a/packages/seacas/libraries/ioss/src/Ioss_Region.C b/packages/seacas/libraries/ioss/src/Ioss_Region.C index 3ef881663588..647a74422182 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_Region.C +++ b/packages/seacas/libraries/ioss/src/Ioss_Region.C @@ -480,7 +480,7 @@ namespace Ioss { int64_t num_ts = get_property("state_count").get_int(); auto max_sb = std::max( - {get_property("spatial_dimension").get_int(), get_property("node_block_count").get_int(), + {get_property("spatial_dimension").get_int(), get_property("node_block_count").get_int(), get_property("edge_block_count").get_int(), get_property("face_block_count").get_int(), get_property("element_block_count").get_int(), get_property("structured_block_count").get_int(), get_property("node_set_count").get_int(), @@ -1377,6 +1377,13 @@ namespace Ioss { if (get_state() == STATE_DEFINE_MODEL) { // Add name as alias to itself to simplify later uses... add_alias__(sideset); + + // Also add "sideset_{id}" as an alias. + auto id = sideset->get_optional_property(id_str(), -1); + if (id != -1) { + std::string ss_alias = fmt::format("sideset_{}", id); + add_alias__(sideset->name(), ss_alias, sideset->type()); + } sideSets.push_back(sideset); return true; } @@ -1397,6 +1404,13 @@ namespace Ioss { if (get_state() == STATE_DEFINE_MODEL) { // Add name as alias to itself to simplify later uses... add_alias__(nodeset); + + // Also add "nodeset_{id}" as an alias. + auto id = nodeset->get_optional_property(id_str(), -1); + if (id != -1) { + std::string ns_alias = fmt::format("nodeset_{}", id); + add_alias__(nodeset->name(), ns_alias, nodeset->type()); + } nodeSets.push_back(nodeset); return true; } diff --git a/packages/seacas/libraries/ioss/src/Ioss_StructuredBlock.h b/packages/seacas/libraries/ioss/src/Ioss_StructuredBlock.h index 7d251e76aaa0..49627e30c68f 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_StructuredBlock.h +++ b/packages/seacas/libraries/ioss/src/Ioss_StructuredBlock.h @@ -16,6 +16,7 @@ #include #include #include +#include #include #if defined(SEACAS_HAVE_CGNS) && !defined(BUILT_IN_SIERRA) @@ -51,7 +52,8 @@ namespace Ioss { // necessary. BoundaryCondition() = default; - BoundaryCondition(const BoundaryCondition ©_from) = default; + BoundaryCondition(const BoundaryCondition ©_from) = default; + BoundaryCondition &operator=(const BoundaryCondition ©_from) = default; // Determine which "face" of the parent block this BC is applied to. int which_face() const; @@ -360,3 +362,11 @@ namespace Ioss { } }; } // namespace Ioss + +#if FMT_VERSION >= 90000 +namespace fmt { + template <> struct formatter : ostream_formatter + { + }; +} // namespace fmt +#endif diff --git a/packages/seacas/libraries/ioss/src/Ioss_Utils.h b/packages/seacas/libraries/ioss/src/Ioss_Utils.h index b52e637255fb..2db497042758 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_Utils.h +++ b/packages/seacas/libraries/ioss/src/Ioss_Utils.h @@ -238,7 +238,8 @@ namespace Ioss { return pow2; } - template static bool check_block_order(const std::vector &blocks) + template + static bool check_block_order(IOSS_MAYBE_UNUSED const std::vector &blocks) { #ifndef NDEBUG // Verify that element blocks are defined in sorted offset order... diff --git a/packages/seacas/libraries/ioss/src/Ioss_ZoneConnectivity.h b/packages/seacas/libraries/ioss/src/Ioss_ZoneConnectivity.h index f561a04de5a6..15e94aa81086 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_ZoneConnectivity.h +++ b/packages/seacas/libraries/ioss/src/Ioss_ZoneConnectivity.h @@ -11,6 +11,7 @@ #include #include #include +#include #include #if defined(SEACAS_HAVE_CGNS) && !defined(BUILT_IN_SIERRA) @@ -62,7 +63,8 @@ namespace Ioss { m_isActive = has_faces(); } - ZoneConnectivity(const ZoneConnectivity ©_from) = default; + ZoneConnectivity(const ZoneConnectivity ©_from) = default; + ZoneConnectivity &operator=(const ZoneConnectivity ©_from) = default; // Return number of nodes in the connection shared with the donor zone. size_t get_shared_node_count() const @@ -147,3 +149,10 @@ namespace Ioss { IOSS_EXPORT std::ostream &operator<<(std::ostream &os, const ZoneConnectivity &zgc); } // namespace Ioss +#if FMT_VERSION >= 90000 +namespace fmt { + template <> struct formatter : ostream_formatter + { + }; +} // namespace fmt +#endif diff --git a/packages/seacas/libraries/ioss/src/cgns/Iocgns_DatabaseIO.C b/packages/seacas/libraries/ioss/src/cgns/Iocgns_DatabaseIO.C index eaa0385eed82..e7702d026068 100644 --- a/packages/seacas/libraries/ioss/src/cgns/Iocgns_DatabaseIO.C +++ b/packages/seacas/libraries/ioss/src/cgns/Iocgns_DatabaseIO.C @@ -759,11 +759,13 @@ namespace Iocgns { int64_t DatabaseIO::element_global_to_local__(int64_t global) const { return global; } - void DatabaseIO::create_structured_block_fpp(int base, int num_zones, size_t & /* num_node */) + void DatabaseIO::create_structured_block_fpp(IOSS_MAYBE_UNUSED int base, + IOSS_MAYBE_UNUSED int num_zones, + size_t & /* num_node */) { SMART_ASSERT(isParallel); - PAR_UNUSED(base); - PAR_UNUSED(num_zones); + IOSS_PAR_UNUSED(base); + IOSS_PAR_UNUSED(num_zones); #if CG_BUILD_PARALLEL // Each processor may have a different set of zones. This routine // will sync the information such that at return, each procesosr @@ -1333,7 +1335,8 @@ namespace Iocgns { "ERROR: CGNS: Zone {} adjacency data is not correct type. Require " "Abutting1to1 and PointList." " {}\t{}\t{}", - zone, static_cast(connect_type), static_cast(ptset_type), static_cast(donor_ptset_type)); + zone, static_cast(connect_type), static_cast(ptset_type), + static_cast(donor_ptset_type)); IOSS_ERROR(errmsg); } @@ -1763,9 +1766,7 @@ namespace Iocgns { if (!is_input()) { m_timesteps.push_back(time); SMART_ASSERT(m_timesteps.size() == (size_t)state); - } - if (!is_input()) { bool do_flush = true; if (m_flushInterval != 1) { if (m_flushInterval == 0 || state % m_flushInterval != 0) { @@ -1817,8 +1818,8 @@ namespace Iocgns { cgsize_t first = 1; // Create a lambda to eliminate some duplicate code in coordinate outputs... - auto coord_lambda = [&data, &first, - base, this](const char *ordinate, int cgns_file_ptr, + auto coord_lambda = [&data, &first, base, + this](const char *ordinate, int cgns_file_ptr, const std::vector &block_local_node_map) { auto *rdata = static_cast(data); @@ -1873,7 +1874,8 @@ namespace Iocgns { // ======================================================================== // Repetitive code for each coordinate direction; use a lambda to consolidate... auto blk_coord_lambda = [block_map, base, zone, &coord, first, num_coord, phys_dimension, - &rdata, this](const char *ord_name, int ordinate, int cgns_file_ptr) { + &rdata, + this](const char *ord_name, int ordinate, int cgns_file_ptr) { CGCHECK(cg_coord_read(cgns_file_ptr, base, zone, ord_name, CGNS_ENUMV(RealDouble), &first, &num_coord, coord.data())); @@ -2264,8 +2266,8 @@ namespace Iocgns { // ======================================================================== // Repetitive code for each coordinate direction; use a lambda to consolidate... - auto coord_lambda = [base, zone, &coord, &rmin, &rmax, phys_dimension, num_to_get, - &rdata, this](const char *ord_name, int ordinate, int cgns_file_ptr) { + auto coord_lambda = [base, zone, &coord, &rmin, &rmax, phys_dimension, num_to_get, &rdata, + this](const char *ord_name, int ordinate, int cgns_file_ptr) { CGCHECK(cg_coord_read(cgns_file_ptr, base, zone, ord_name, CGNS_ENUMV(RealDouble), rmin, rmax, coord.data())); @@ -2577,8 +2579,8 @@ namespace Iocgns { // ======================================================================== // Repetitive code for each coordinate direction; use a lambda to consolidate... - auto coord_lambda = [&coord, num_to_get, phys_dimension, &rdata, base, - zone, this](const char *ord_name, int ordinate, int cgns_file_ptr) { + auto coord_lambda = [&coord, num_to_get, phys_dimension, &rdata, base, zone, + this](const char *ord_name, int ordinate, int cgns_file_ptr) { int crd_index = 0; // Map to global coordinate position... diff --git a/packages/seacas/libraries/ioss/src/cgns/Iocgns_ParallelDatabaseIO.C b/packages/seacas/libraries/ioss/src/cgns/Iocgns_ParallelDatabaseIO.C index 47be1b239e99..ed78c453bf25 100644 --- a/packages/seacas/libraries/ioss/src/cgns/Iocgns_ParallelDatabaseIO.C +++ b/packages/seacas/libraries/ioss/src/cgns/Iocgns_ParallelDatabaseIO.C @@ -1298,18 +1298,18 @@ namespace Iocgns { (rmax[0] - rmin[0] + 1) * (rmax[1] - rmin[1] + 1) * (rmax[2] - rmin[2] + 1)); } + int field_offset = Utils::index(field); int comp_count = field.get_component_count(Ioss::Field::InOut::INPUT); if (comp_count == 1) { - CGCHECKM(cg_field_read(get_file_pointer(), base, zone, solution_index, - field.get_name().c_str(), CGNS_ENUMV(RealDouble), rmin, rmax, - rdata)); + CGCHECKM(cgp_field_read_data(get_file_pointer(), base, zone, solution_index, + field_offset, rmin, rmax, rdata)); } else { std::vector cgns_data(num_to_get); for (int i = 0; i < comp_count; i++) { std::string var_name = get_component_name(field, Ioss::Field::InOut::INPUT, i + 1); - CGCHECKM(cg_field_read(get_file_pointer(), base, zone, solution_index, var_name.c_str(), - CGNS_ENUMV(RealDouble), rmin, rmax, cgns_data.data())); + CGCHECKM(cgp_field_read_data(get_file_pointer(), base, zone, solution_index, field_offset + i, + rmin, rmax, cgns_data.data())); for (cgsize_t j = 0; j < num_to_get; j++) { rdata[comp_count * j + i] = cgns_data[j]; } diff --git a/packages/seacas/libraries/ioss/src/cgns/Iocgns_Utils.C b/packages/seacas/libraries/ioss/src/cgns/Iocgns_Utils.C index 18999721bbee..1390ab590285 100644 --- a/packages/seacas/libraries/ioss/src/cgns/Iocgns_Utils.C +++ b/packages/seacas/libraries/ioss/src/cgns/Iocgns_Utils.C @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2022 National Technology & Engineering Solutions +// Copyright(C) 1999-2023 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. // @@ -288,9 +288,11 @@ namespace { // size will be processor dependent. auto &sblocks = region->get_structured_blocks(); std::vector fld_count; - fld_count.reserve(sblocks.size()); + fld_count.reserve(2 * sblocks.size()); for (const auto &block : sblocks) { fld_count.push_back(block->field_count(Ioss::Field::TRANSIENT)); + const auto &nb = block->get_node_block(); + fld_count.push_back(nb.field_count(Ioss::Field::TRANSIENT)); } auto par = region->get_database()->util(); par.global_array_minmax(fld_count, Ioss::ParallelUtils::DO_MAX); @@ -315,7 +317,22 @@ namespace { } } else { - offset += (CGNS_MAX_NAME_LENGTH + 1) * 2 * fld_count[i]; + offset += (CGNS_MAX_NAME_LENGTH + 1) * 2 * fld_count[2*i]; + } + const auto &nb = block->get_node_block(); + Ioss::NameList node_fields = nb.field_describe(Ioss::Field::TRANSIENT); + if (!node_fields.empty()) { + for (const auto &field_name : node_fields) { + const Ioss::Field &field = nb.get_fieldref(field_name); + std::string type = field.raw_storage()->name(); + Ioss::Utils::copy_string(&fld_names[offset], field_name, CGNS_MAX_NAME_LENGTH + 1); + offset += CGNS_MAX_NAME_LENGTH + 1; + Ioss::Utils::copy_string(&fld_names[offset], type, CGNS_MAX_NAME_LENGTH + 1); + offset += CGNS_MAX_NAME_LENGTH + 1; + } + } + else { + offset += (CGNS_MAX_NAME_LENGTH + 1) * 2 * fld_count[2*i+1]; } } @@ -325,16 +342,15 @@ namespace { // names. Now need to add the missing fields to the blocks that // are not 'native' to this processor... // + offset = 0; for (size_t i = 0; i < sblocks.size(); i++) { auto &block = sblocks[i]; - if (block->field_count(Ioss::Field::TRANSIENT) != (size_t)fld_count[i]) { + if (block->field_count(Ioss::Field::TRANSIENT) != (size_t)fld_count[2*i]) { // Verify that either has 0 or correct number of fields... assert(block->field_count(Ioss::Field::TRANSIENT) == 0); // Extract the field name and storage type... - offset = (CGNS_MAX_NAME_LENGTH + 1) * 2 * i; - - for (int nf = 0; nf < fld_count[i]; nf++) { + for (int nf = 0; nf < fld_count[2 * i]; nf++) { std::string fld_name(&fld_names[offset]); offset += CGNS_MAX_NAME_LENGTH + 1; std::string fld_type(&fld_names[offset]); @@ -344,7 +360,31 @@ namespace { Ioss::Field(fld_name, Ioss::Field::DOUBLE, fld_type, Ioss::Field::TRANSIENT, 0)); } } - assert(block->field_count(Ioss::Field::TRANSIENT) == (size_t)fld_count[i]); + else { + offset += (CGNS_MAX_NAME_LENGTH + 1) * 2 * fld_count[2*i]; + } + assert(block->field_count(Ioss::Field::TRANSIENT) == (size_t)fld_count[2 * i]); + + auto &nb = block->get_node_block(); + if (nb.field_count(Ioss::Field::TRANSIENT) != (size_t)fld_count[2*i + 1]) { + // Verify that either has 0 or correct number of fields... + assert(nb.field_count(Ioss::Field::TRANSIENT) == 0); + + // Extract the field name and storage type... + for (int nf = 0; nf < fld_count[2 * i + 1]; nf++) { + std::string fld_name(&fld_names[offset]); + offset += CGNS_MAX_NAME_LENGTH + 1; + std::string fld_type(&fld_names[offset]); + offset += CGNS_MAX_NAME_LENGTH + 1; + + nb.field_add( + Ioss::Field(fld_name, Ioss::Field::DOUBLE, fld_type, Ioss::Field::TRANSIENT, 0)); + } + } + else { + offset += (CGNS_MAX_NAME_LENGTH + 1) * 2 * fld_count[2*i+1]; + } + assert(nb.field_count(Ioss::Field::TRANSIENT) == (size_t)fld_count[2 * i + 1]); } } @@ -620,7 +660,7 @@ namespace { } #endif - void consolidate_zgc(const Ioss::Region ®ion) + void consolidate_zgc(IOSS_MAYBE_UNUSED const Ioss::Region ®ion) { // In parallel, the zgc are not necessarily consistent across processors... // and the owner/donor ranges are processor specific. @@ -637,7 +677,7 @@ namespace { // 3 int[3] transform; (values range from -3 to +3 (could store as single int) // CGNS_MAX_NAME_LENGTH characters + 17 ints / connection. - PAR_UNUSED(region); + IOSS_PAR_UNUSED(region); #if CG_BUILD_PARALLEL const int BYTE_PER_NAME = CGNS_MAX_NAME_LENGTH; const int INT_PER_ZGC = 17; @@ -1315,6 +1355,17 @@ size_t Iocgns::Utils::common_write_meta_data(int file_ptr, const Ioss::Region &r donor_range[4] -= zgc.m_donorOffset[1]; donor_range[5] -= zgc.m_donorOffset[2]; } + + if (is_parallel_io || !is_parallel) { + if (zgc.m_ownerZone == zgc.m_donorZone && zgc.m_ownerRangeBeg == zgc.m_donorRangeBeg && + zgc.m_ownerRangeEnd == zgc.m_donorRangeEnd) { +#if IOSS_DEBUG_OUTPUT + fmt::print("Removing ZGC {} on zone {}\n", connect_name, db_zone); +#endif + continue; + } + } + CGERR(cg_1to1_write(file_ptr, base, db_zone, connect_name.c_str(), donor_name.c_str(), owner_range.data(), donor_range.data(), zgc.m_transform.data(), &zgc_idx)); @@ -2232,7 +2283,8 @@ void Iocgns::Utils::add_transient_variables(int cgns_file_ptr, const std::vector auto *nb = const_cast(cnb); if (nb == nullptr) { std::ostringstream errmsg; - fmt::print(errmsg, "ERROR: CGNS: Null entity accessing nodeblock for structured block {}.", + fmt::print(errmsg, + "ERROR: CGNS: Null entity accessing nodeblock for structured block {}.", block->name()); IOSS_ERROR(errmsg); } diff --git a/packages/seacas/libraries/ioss/src/exodus/Ioex_BaseDatabaseIO.C b/packages/seacas/libraries/ioss/src/exodus/Ioex_BaseDatabaseIO.C index 1281cb6dcb22..c5c874d61102 100644 --- a/packages/seacas/libraries/ioss/src/exodus/Ioex_BaseDatabaseIO.C +++ b/packages/seacas/libraries/ioss/src/exodus/Ioex_BaseDatabaseIO.C @@ -660,7 +660,7 @@ namespace Ioex { Ioss::Utils::copy_string(info[i], lines[j], max_line_length + 1); } } - + if (using_parallel_io()) { util().broadcast(total_lines); } @@ -3080,13 +3080,15 @@ namespace { assert((int)offset == attribute_count + 1); } - void check_variable_consistency(const ex_var_params &exo_params, int my_processor, - const std::string &filename, const Ioss::ParallelUtils &util) + void check_variable_consistency(IOSS_MAYBE_UNUSED const ex_var_params &exo_params, + IOSS_MAYBE_UNUSED int my_processor, + IOSS_MAYBE_UNUSED const std::string &filename, + IOSS_MAYBE_UNUSED const Ioss::ParallelUtils &util) { - PAR_UNUSED(exo_params); - PAR_UNUSED(my_processor); - PAR_UNUSED(filename); - PAR_UNUSED(util); + IOSS_PAR_UNUSED(exo_params); + IOSS_PAR_UNUSED(my_processor); + IOSS_PAR_UNUSED(filename); + IOSS_PAR_UNUSED(util); #ifdef SEACAS_HAVE_MPI const int num_types = 10; std::vector var_counts(num_types); diff --git a/packages/seacas/libraries/ioss/src/exodus/Ioex_DatabaseIO.C b/packages/seacas/libraries/ioss/src/exodus/Ioex_DatabaseIO.C index 5a05adb4149d..e6ffc25e37c1 100644 --- a/packages/seacas/libraries/ioss/src/exodus/Ioex_DatabaseIO.C +++ b/packages/seacas/libraries/ioss/src/exodus/Ioex_DatabaseIO.C @@ -2418,21 +2418,19 @@ int64_t DatabaseIO::get_field_internal(const Ioss::ElementBlock *eb, const Ioss: } } else if (field.get_name() == "connectivity_face") { - int face_count = field.get_component_count(Ioss::Field::InOut::INPUT); - // The connectivity is stored in a 1D array. // The element_face index varies fastest if (my_element_count > 0) { - get_connectivity_data(get_file_pointer(), data, EX_ELEM_BLOCK, id, 2); + int face_count = field.get_component_count(Ioss::Field::InOut::INPUT); + get_connectivity_data(get_file_pointer(), data, EX_ELEM_BLOCK, id, 2); get_map(EX_FACE_BLOCK).map_data(data, field, num_to_get * face_count); } } else if (field.get_name() == "connectivity_edge") { - int edge_count = field.get_component_count(Ioss::Field::InOut::INPUT); - // The connectivity is stored in a 1D array. // The element_edge index varies fastest if (my_element_count > 0) { + int edge_count = field.get_component_count(Ioss::Field::InOut::INPUT); get_connectivity_data(get_file_pointer(), data, EX_ELEM_BLOCK, id, 1); get_map(EX_EDGE_BLOCK).map_data(data, field, num_to_get * edge_count); } @@ -2584,34 +2582,33 @@ int64_t DatabaseIO::get_field_internal(const Ioss::FaceBlock *eb, const Ioss::Fi // (The 'genesis' portion) if (field.get_name() == "connectivity") { - int face_nodes = eb->topology()->number_nodes(); - assert(field.get_component_count(Ioss::Field::InOut::INPUT) == face_nodes); - // The connectivity is stored in a 1D array. // The face_node index varies fastet if (my_face_count > 0) { + int face_nodes = eb->topology()->number_nodes(); + assert(field.get_component_count(Ioss::Field::InOut::INPUT) == face_nodes); + get_connectivity_data(get_file_pointer(), data, EX_FACE_BLOCK, id, 0); get_map(EX_NODE_BLOCK).map_data(data, field, num_to_get * face_nodes); } } else if (field.get_name() == "connectivity_edge") { - int edge_count = field.get_component_count(Ioss::Field::InOut::INPUT); - // The connectivity is stored in a 1D array. // The face_edge index varies fastest if (my_face_count > 0) { + int edge_count = field.get_component_count(Ioss::Field::InOut::INPUT); get_connectivity_data(get_file_pointer(), data, EX_FACE_BLOCK, id, 1); get_map(EX_EDGE_BLOCK).map_data(data, field, num_to_get * edge_count); } } else if (field.get_name() == "connectivity_raw") { - // "connectivity_raw" has nodes in local id space (1-based) - assert(field.get_component_count(Ioss::Field::InOut::INPUT) == - eb->topology()->number_nodes()); - // The connectivity is stored in a 1D array. // The face_node index varies fastet if (my_face_count > 0) { + // "connectivity_raw" has nodes in local id space (1-based) + assert(field.get_component_count(Ioss::Field::InOut::INPUT) == + eb->topology()->number_nodes()); + get_connectivity_data(get_file_pointer(), data, EX_FACE_BLOCK, id, 0); } } diff --git a/packages/seacas/libraries/ioss/src/exodus/Ioex_DecompositionData.C b/packages/seacas/libraries/ioss/src/exodus/Ioex_DecompositionData.C index eab77e9a19e5..cb8bcedf2e99 100644 --- a/packages/seacas/libraries/ioss/src/exodus/Ioex_DecompositionData.C +++ b/packages/seacas/libraries/ioss/src/exodus/Ioex_DecompositionData.C @@ -4,9 +4,9 @@ // // See packages/seacas/LICENSE for details +#include #include #if defined PARALLEL_AWARE_EXODUS -#include #include // for ElementTopology #include // for Field, etc #include // for Map, MapContainer @@ -420,7 +420,7 @@ namespace Ioex { sum += overlap * element_nodes; } else { - int64_t id = block.id; + int64_t id = block.id; ex_get_partial_conn(filePtr, EX_ELEM_BLOCK, id, 0, 0, nullptr, nullptr, nullptr); } } @@ -554,10 +554,14 @@ namespace Ioex { } while (entitys_to_read > 0); } - // Each processor knows how many of the entityset entities it owns; - // broadcast that information (the count) to the other - // processors. The first processor with non-zero entity count is - // the "root" for this entityset. + // Each processor knows how many of the entityset entities it + // owns; + // + // The first processor with non-zero entity count is the + // "root" for this entityset. + // + // A split communicator is created + // containing only the ranks that have non-zero entity count { std::vector has_entitys_local(set_count); for (size_t i = 0; i < set_count; i++) { @@ -571,13 +575,11 @@ namespace Ioex { for (size_t i = 0; i < set_count; i++) { entity_sets[i].hasEntities.resize(m_processorCount); entity_sets[i].root_ = m_processorCount; - int count = 0; for (int p = 0; p < m_processorCount; p++) { if (p < entity_sets[i].root_ && has_entitys[p * set_count + i] != 0) { entity_sets[i].root_ = p; } entity_sets[i].hasEntities[p] = has_entitys[p * set_count + i]; - count += has_entitys[p * set_count + i]; } int color = entity_sets[i].hasEntities[m_processor] ? 1 : MPI_UNDEFINED; MPI_Comm_split(comm_, color, m_processor, &entity_sets[i].setComm_); @@ -935,8 +937,9 @@ namespace Ioex { /// relates DecompositionData::get_user_map template - int DecompositionData::get_user_map(int filePtr, ex_entity_type obj_type, ex_entity_id id, int map_index, - size_t offset, size_t count, void* map_data) const + int DecompositionData::get_user_map(int filePtr, ex_entity_type obj_type, ex_entity_id id, + int map_index, size_t offset, size_t count, + void *map_data) const { m_decomposition.show_progress(__func__); if (obj_type == EX_ELEM_MAP) { @@ -1387,36 +1390,39 @@ namespace Ioex { } template - int DecompositionData::get_elem_map(int filePtr, ex_entity_id id, int map_index, size_t offset, size_t count, - void* ioss_data) const + int DecompositionData::get_elem_map(int filePtr, ex_entity_id id, int map_index, + size_t offset, size_t count, void *ioss_data) const { m_decomposition.show_progress(__func__); // Reading an element blocks worth of map data and returning in `ioss_data` - // The map is the `map_index`th map on the database. + // The map is the `map_index`th map on the database. // Find blk_seq corresponding to block the specified id... - size_t blk_seq = get_block_seq(EX_ELEM_BLOCK, id); - size_t eb_count = get_block_element_count(blk_seq); - size_t eb_offset = count == 0 ? 0 : get_block_element_offset(blk_seq); - int ierr = 0; + size_t blk_seq = get_block_seq(EX_ELEM_BLOCK, id); + size_t eb_count = get_block_element_count(blk_seq); + size_t eb_offset = count == 0 ? 0 : get_block_element_offset(blk_seq); + int ierr = 0; if (m_decomposition.m_method == "LINEAR") { - ierr = ex_get_partial_num_map(filePtr, EX_ELEM_MAP, map_index, offset + eb_offset + 1, eb_count, (INT*)ioss_data); + ierr = ex_get_partial_num_map(filePtr, EX_ELEM_MAP, map_index, offset + eb_offset + 1, + eb_count, (INT *)ioss_data); } else { std::vector file_data(eb_count); - ierr = ex_get_partial_num_map(filePtr, EX_ELEM_MAP, map_index, offset + eb_offset + 1, eb_count, file_data.data()); + ierr = ex_get_partial_num_map(filePtr, EX_ELEM_MAP, map_index, offset + eb_offset + 1, + eb_count, file_data.data()); if (ierr >= 0) { - m_decomposition.communicate_block_data(file_data.data(), (INT*)ioss_data, el_blocks[blk_seq], 1); + m_decomposition.communicate_block_data(file_data.data(), (INT *)ioss_data, + el_blocks[blk_seq], 1); } } return ierr; } template - int DecompositionData::get_node_map(int filePtr, int map_index, - size_t offset, size_t count, void* ioss_data) const - { - return -1; - } + int DecompositionData::get_node_map(int filePtr, int map_index, size_t offset, size_t count, + void *ioss_data) const + { + return -1; + } template int DecompositionData::get_set_mesh_var(int filePtr, ex_entity_type type, ex_entity_id id, const Ioss::Field &field, @@ -1930,5 +1936,5 @@ namespace Ioex { } } // namespace Ioex #else -const char ioss_exodus_decomposition_data_unused_symbol_dummy = '\0'; +IOSS_MAYBE_UNUSED const char ioss_exodus_decomposition_data_unused_symbol_dummy = '\0'; #endif diff --git a/packages/seacas/libraries/ioss/src/exodus/Ioex_ParallelDatabaseIO.C b/packages/seacas/libraries/ioss/src/exodus/Ioex_ParallelDatabaseIO.C index a2cd0f2e9c24..d58a05f4265e 100644 --- a/packages/seacas/libraries/ioss/src/exodus/Ioex_ParallelDatabaseIO.C +++ b/packages/seacas/libraries/ioss/src/exodus/Ioex_ParallelDatabaseIO.C @@ -11,6 +11,7 @@ // // See packages/seacas/LICENSE for details +#include #include #if defined PARALLEL_AWARE_EXODUS #include @@ -36,8 +37,6 @@ #include #include -#include - #include #include #include @@ -2407,7 +2406,7 @@ int64_t ParallelDatabaseIO::get_Xset_field_internal(const Ioss::EntitySet *ns, // Find corresponding set in file decomp class... if (role == Ioss::Field::MESH) { - int64_t id = Ioex::get_id(ns, &ids_); + int64_t id = Ioex::get_id(ns, &ids_); if (field.get_name() == "ids" || field.get_name() == "ids_raw") { if (field.get_type() == Ioss::Field::INTEGER) { @@ -3870,7 +3869,7 @@ int64_t ParallelDatabaseIO::put_field_internal(const Ioss::ElementBlock *eb, int *comp32 = reinterpret_cast(component.data()); int index = comp; - for (int64_t i = 0; i < my_element_count; i++) { + for (size_t i = 0; i < my_element_count; i++) { comp32[i] = data32[index]; index += comp_count; } @@ -3880,13 +3879,16 @@ int64_t ParallelDatabaseIO::put_field_internal(const Ioss::ElementBlock *eb, int64_t *comp64 = reinterpret_cast(component.data()); int index = comp; - for (int64_t i = 0; i < my_element_count; i++) { + for (size_t i = 0; i < my_element_count; i++) { comp64[i] = data64[index]; index += comp_count; } } auto eb_offset = eb->get_offset(); // Offset of beginning of the element block elements for this block + auto proc_offset = eb->get_optional_property( + "_processor_offset", 0); // Offset of this processors elements within that block. + auto file_count = eb->get_optional_property("locally_owned_count", my_element_count); int index = -1 * (field.get_index() + comp); // Negative since specifying index, not id to exodus API. @@ -4903,5 +4905,5 @@ void ParallelDatabaseIO::check_valid_values() const } } // namespace Ioex #else -const char ioss_exodus_parallel_database_unused_symbol_dummy = '\0'; +IOSS_MAYBE_UNUSED const char ioss_exodus_parallel_database_unused_symbol_dummy = '\0'; #endif diff --git a/packages/seacas/libraries/ioss/src/gen_struc/Iogs_DatabaseIO.h b/packages/seacas/libraries/ioss/src/gen_struc/Iogs_DatabaseIO.h index f523580523aa..405ad13ec5f4 100644 --- a/packages/seacas/libraries/ioss/src/gen_struc/Iogs_DatabaseIO.h +++ b/packages/seacas/libraries/ioss/src/gen_struc/Iogs_DatabaseIO.h @@ -105,33 +105,33 @@ namespace Iogs { const Ioss::Map &get_node_map() const; const Ioss::Map &get_element_map() const; - NOOP_GFI(Ioss::ElementBlock) - NOOP_GFI(Ioss::EdgeBlock) - NOOP_GFI(Ioss::FaceBlock) - NOOP_GFI(Ioss::NodeSet) - NOOP_GFI(Ioss::EdgeSet) - NOOP_GFI(Ioss::FaceSet) - NOOP_GFI(Ioss::ElementSet) - NOOP_GFI(Ioss::SideSet) - NOOP_GFI(Ioss::Assembly) - NOOP_GFI(Ioss::Blob) + IOSS_NOOP_GFI(Ioss::ElementBlock) + IOSS_NOOP_GFI(Ioss::EdgeBlock) + IOSS_NOOP_GFI(Ioss::FaceBlock) + IOSS_NOOP_GFI(Ioss::NodeSet) + IOSS_NOOP_GFI(Ioss::EdgeSet) + IOSS_NOOP_GFI(Ioss::FaceSet) + IOSS_NOOP_GFI(Ioss::ElementSet) + IOSS_NOOP_GFI(Ioss::SideSet) + IOSS_NOOP_GFI(Ioss::Assembly) + IOSS_NOOP_GFI(Ioss::Blob) // Input only database -- these will never be called... - NOOP_PFI(Ioss::Region) - NOOP_PFI(Ioss::NodeBlock) - NOOP_PFI(Ioss::EdgeBlock) - NOOP_PFI(Ioss::FaceBlock) - NOOP_PFI(Ioss::ElementBlock) - NOOP_PFI(Ioss::StructuredBlock) - NOOP_PFI(Ioss::SideBlock) - NOOP_PFI(Ioss::NodeSet) - NOOP_PFI(Ioss::EdgeSet) - NOOP_PFI(Ioss::FaceSet) - NOOP_PFI(Ioss::ElementSet) - NOOP_PFI(Ioss::SideSet) - NOOP_PFI(Ioss::CommSet) - NOOP_PFI(Ioss::Assembly) - NOOP_PFI(Ioss::Blob) + IOSS_NOOP_PFI(Ioss::Region) + IOSS_NOOP_PFI(Ioss::NodeBlock) + IOSS_NOOP_PFI(Ioss::EdgeBlock) + IOSS_NOOP_PFI(Ioss::FaceBlock) + IOSS_NOOP_PFI(Ioss::ElementBlock) + IOSS_NOOP_PFI(Ioss::StructuredBlock) + IOSS_NOOP_PFI(Ioss::SideBlock) + IOSS_NOOP_PFI(Ioss::NodeSet) + IOSS_NOOP_PFI(Ioss::EdgeSet) + IOSS_NOOP_PFI(Ioss::FaceSet) + IOSS_NOOP_PFI(Ioss::ElementSet) + IOSS_NOOP_PFI(Ioss::SideSet) + IOSS_NOOP_PFI(Ioss::CommSet) + IOSS_NOOP_PFI(Ioss::Assembly) + IOSS_NOOP_PFI(Ioss::Blob) int64_t get_field_internal(const Ioss::Region *reg, const Ioss::Field &field, void *data, size_t data_size) const override; diff --git a/packages/seacas/libraries/ioss/src/generated/Iogn_DatabaseIO.h b/packages/seacas/libraries/ioss/src/generated/Iogn_DatabaseIO.h index 70d0aef4fd29..3c0bbfed00cd 100644 --- a/packages/seacas/libraries/ioss/src/generated/Iogn_DatabaseIO.h +++ b/packages/seacas/libraries/ioss/src/generated/Iogn_DatabaseIO.h @@ -119,32 +119,32 @@ namespace Iogn { int64_t get_field_internal(const Ioss::SideBlock *ns, const Ioss::Field &field, void *data, size_t data_size) const override; - NOOP_GFI(Ioss::EdgeBlock) - NOOP_GFI(Ioss::FaceBlock) - NOOP_GFI(Ioss::StructuredBlock) - NOOP_GFI(Ioss::EdgeSet) - NOOP_GFI(Ioss::FaceSet) - NOOP_GFI(Ioss::ElementSet) - NOOP_GFI(Ioss::SideSet) - NOOP_GFI(Ioss::Assembly) - NOOP_GFI(Ioss::Blob) + IOSS_NOOP_GFI(Ioss::EdgeBlock) + IOSS_NOOP_GFI(Ioss::FaceBlock) + IOSS_NOOP_GFI(Ioss::StructuredBlock) + IOSS_NOOP_GFI(Ioss::EdgeSet) + IOSS_NOOP_GFI(Ioss::FaceSet) + IOSS_NOOP_GFI(Ioss::ElementSet) + IOSS_NOOP_GFI(Ioss::SideSet) + IOSS_NOOP_GFI(Ioss::Assembly) + IOSS_NOOP_GFI(Ioss::Blob) // Input only database -- these will never be called... - NOOP_PFI(Ioss::Region) - NOOP_PFI(Ioss::NodeBlock) - NOOP_PFI(Ioss::EdgeBlock) - NOOP_PFI(Ioss::FaceBlock) - NOOP_PFI(Ioss::ElementBlock) - NOOP_PFI(Ioss::StructuredBlock) - NOOP_PFI(Ioss::SideBlock) - NOOP_PFI(Ioss::NodeSet) - NOOP_PFI(Ioss::EdgeSet) - NOOP_PFI(Ioss::FaceSet) - NOOP_PFI(Ioss::ElementSet) - NOOP_PFI(Ioss::SideSet) - NOOP_PFI(Ioss::CommSet) - NOOP_PFI(Ioss::Assembly) - NOOP_PFI(Ioss::Blob) + IOSS_NOOP_PFI(Ioss::Region) + IOSS_NOOP_PFI(Ioss::NodeBlock) + IOSS_NOOP_PFI(Ioss::EdgeBlock) + IOSS_NOOP_PFI(Ioss::FaceBlock) + IOSS_NOOP_PFI(Ioss::ElementBlock) + IOSS_NOOP_PFI(Ioss::StructuredBlock) + IOSS_NOOP_PFI(Ioss::SideBlock) + IOSS_NOOP_PFI(Ioss::NodeSet) + IOSS_NOOP_PFI(Ioss::EdgeSet) + IOSS_NOOP_PFI(Ioss::FaceSet) + IOSS_NOOP_PFI(Ioss::ElementSet) + IOSS_NOOP_PFI(Ioss::SideSet) + IOSS_NOOP_PFI(Ioss::CommSet) + IOSS_NOOP_PFI(Ioss::Assembly) + IOSS_NOOP_PFI(Ioss::Blob) void add_transient_fields(Ioss::GroupingEntity *entity); diff --git a/packages/seacas/libraries/ioss/src/heartbeat/Iohb_DatabaseIO.C b/packages/seacas/libraries/ioss/src/heartbeat/Iohb_DatabaseIO.C index 8491138a3f2c..6e7cadfb1fa0 100644 --- a/packages/seacas/libraries/ioss/src/heartbeat/Iohb_DatabaseIO.C +++ b/packages/seacas/libraries/ioss/src/heartbeat/Iohb_DatabaseIO.C @@ -5,14 +5,13 @@ // See packages/seacas/LICENSE for details #include -#include +#include + #include #include #include +#include #include -#include -#include -#include #include #include @@ -21,7 +20,6 @@ #include "Ioss_DatabaseIO.h" #include "Ioss_EntityType.h" #include "Ioss_Field.h" -#include "Ioss_FileInfo.h" #include "Ioss_IOFactory.h" #include "Ioss_ParallelUtils.h" #include "Ioss_Property.h" @@ -29,6 +27,7 @@ #include "Ioss_State.h" #include "Ioss_Utils.h" #include "Ioss_VariableType.h" +#include namespace Ioss { class CommSet; @@ -185,7 +184,7 @@ namespace Iohb { if (new_this->logStream == nullptr) { std::ostringstream errmsg; - errmsg << "ERROR: Could not create heartbeat file '" << get_filename() << "'\n"; + fmt::print(errmsg, "ERROR: Could not create heartbeat file '{}'\n", get_filename()); IOSS_ERROR(errmsg); } } @@ -231,17 +230,16 @@ namespace Iohb { new_this->tsFormat = properties.get("TIME_STAMP_FORMAT").get_string(); } - if (properties.exists("SHOW_TIME_STAMP")) { - bool show_time_stamp = properties.get("SHOW_TIME_STAMP").get_int() == 1; - if (show_time_stamp) { - if (tsFormat.empty()) { - new_this->tsFormat = defaultTsFormat; - } - } - else { - new_this->tsFormat = ""; + bool show_time_stamp = false; + Ioss::Utils::check_set_bool_property(properties, "SHOW_TIME_STAMP", show_time_stamp); + if (show_time_stamp) { + if (tsFormat.empty()) { + new_this->tsFormat = defaultTsFormat; } } + else { + new_this->tsFormat = ""; + } if (properties.exists("PRECISION")) { new_this->precision_ = properties.get("PRECISION").get_int(); @@ -255,18 +253,13 @@ namespace Iohb { new_this->fieldWidth_ = precision_ + 7; } - if (properties.exists("SHOW_LABELS")) { - new_this->showLabels = (properties.get("SHOW_LABELS").get_int() == 1); - } + Ioss::Utils::check_set_bool_property(properties, "SHOW_LABELS", new_this->showLabels); - if (properties.exists("SHOW_LEGEND")) { - new_this->showLegend = - (properties.get("SHOW_LEGEND").get_int() == 1 && !new_this->appendOutput); + if (!new_this->appendOutput) { + Ioss::Utils::check_set_bool_property(properties, "SHOW_LEGEND", new_this->showLegend); } - if (properties.exists("SHOW_TIME_FIELD")) { - new_this->addTimeField = (properties.get("SHOW_TIME_FIELD").get_int() == 1); - } + Ioss::Utils::check_set_bool_property(properties, "SHOW_TIME_FIELD", new_this->addTimeField); // SpyHis format is specific format, so don't override these settings: if (fileFormat == Iohb::Format::SPYHIS) { @@ -333,15 +326,16 @@ namespace Iohb { if (legend_ != nullptr) { if (fileFormat == Iohb::Format::SPYHIS) { time_t calendar_time = time(nullptr); - *logStream << "% Sierra SPYHIS Output " << ctime(&calendar_time); - *logStream << *legend_ << '\n'; // Legend output twice for SPYHIS + // ctime include \n; the legend is output twice for SPYHIS. + fmt::print(*logStream, "% Sierra SPYHIS Output {}{}\n", ctime(&calendar_time), + legend_->layout()); // ctime includes \n } - *logStream << *legend_ << '\n'; + fmt::print(*logStream, "{}\n", legend_->layout()); legend_.reset(); } - *logStream << *layout_ << '\n'; + fmt::print(*logStream, "{}\n", layout_->layout()); layout_.reset(); // Flush the buffer to disk... @@ -393,7 +387,7 @@ namespace Iohb { layout.add_literal(" "); layout.add_literal(*reinterpret_cast(data)); if (logStream != nullptr) { - *logStream << layout << '\n'; + fmt::print(*logStream, "{}\n", layout.layout()); } } else { @@ -403,7 +397,7 @@ namespace Iohb { else { if (layout_ == nullptr) { std::ostringstream errmsg; - errmsg << "INTERNAL ERROR: Unexpected nullptr layout.\n"; + fmt::print(errmsg, "INTERNAL ERROR: Unexpected nullptr layout.\n"); IOSS_ERROR(errmsg); } if (field.get_type() == Ioss::Field::INTEGER) { @@ -428,7 +422,8 @@ namespace Iohb { } else { std::ostringstream errmsg; - errmsg << "ERROR: Can not handle non-TRANSIENT or non-REDUCTION fields on regions.\n"; + fmt::print(errmsg, + "ERROR: Can not handle non-TRANSIENT or non-REDUCTION fields on regions.\n"); IOSS_ERROR(errmsg); } return num_to_get; diff --git a/packages/seacas/libraries/ioss/src/heartbeat/Iohb_DatabaseIO.h b/packages/seacas/libraries/ioss/src/heartbeat/Iohb_DatabaseIO.h index 290eccf63285..ec4c5bf2b36e 100644 --- a/packages/seacas/libraries/ioss/src/heartbeat/Iohb_DatabaseIO.h +++ b/packages/seacas/libraries/ioss/src/heartbeat/Iohb_DatabaseIO.h @@ -97,39 +97,39 @@ namespace Iohb { void initialize() const; - NOOP_GFI(Ioss::Region) - NOOP_GFI(Ioss::NodeBlock) - NOOP_GFI(Ioss::EdgeBlock) - NOOP_GFI(Ioss::FaceBlock) - NOOP_GFI(Ioss::ElementBlock) - NOOP_GFI(Ioss::StructuredBlock) - NOOP_GFI(Ioss::SideBlock) - NOOP_GFI(Ioss::NodeSet) - NOOP_GFI(Ioss::EdgeSet) - NOOP_GFI(Ioss::FaceSet) - NOOP_GFI(Ioss::ElementSet) - NOOP_GFI(Ioss::SideSet) - NOOP_GFI(Ioss::CommSet) - NOOP_GFI(Ioss::Assembly) - NOOP_GFI(Ioss::Blob) + IOSS_NOOP_GFI(Ioss::Region) + IOSS_NOOP_GFI(Ioss::NodeBlock) + IOSS_NOOP_GFI(Ioss::EdgeBlock) + IOSS_NOOP_GFI(Ioss::FaceBlock) + IOSS_NOOP_GFI(Ioss::ElementBlock) + IOSS_NOOP_GFI(Ioss::StructuredBlock) + IOSS_NOOP_GFI(Ioss::SideBlock) + IOSS_NOOP_GFI(Ioss::NodeSet) + IOSS_NOOP_GFI(Ioss::EdgeSet) + IOSS_NOOP_GFI(Ioss::FaceSet) + IOSS_NOOP_GFI(Ioss::ElementSet) + IOSS_NOOP_GFI(Ioss::SideSet) + IOSS_NOOP_GFI(Ioss::CommSet) + IOSS_NOOP_GFI(Ioss::Assembly) + IOSS_NOOP_GFI(Ioss::Blob) int64_t put_field_internal(const Ioss::Region *region, const Ioss::Field &field, void *data, size_t data_size) const override; - NOOP_PFI(Ioss::NodeBlock) - NOOP_PFI(Ioss::EdgeBlock) - NOOP_PFI(Ioss::FaceBlock) - NOOP_PFI(Ioss::ElementBlock) - NOOP_PFI(Ioss::StructuredBlock) - NOOP_PFI(Ioss::SideBlock) - NOOP_PFI(Ioss::NodeSet) - NOOP_PFI(Ioss::EdgeSet) - NOOP_PFI(Ioss::FaceSet) - NOOP_PFI(Ioss::ElementSet) - NOOP_PFI(Ioss::SideSet) - NOOP_PFI(Ioss::CommSet) - NOOP_PFI(Ioss::Assembly) - NOOP_PFI(Ioss::Blob) + IOSS_NOOP_PFI(Ioss::NodeBlock) + IOSS_NOOP_PFI(Ioss::EdgeBlock) + IOSS_NOOP_PFI(Ioss::FaceBlock) + IOSS_NOOP_PFI(Ioss::ElementBlock) + IOSS_NOOP_PFI(Ioss::StructuredBlock) + IOSS_NOOP_PFI(Ioss::SideBlock) + IOSS_NOOP_PFI(Ioss::NodeSet) + IOSS_NOOP_PFI(Ioss::EdgeSet) + IOSS_NOOP_PFI(Ioss::FaceSet) + IOSS_NOOP_PFI(Ioss::ElementSet) + IOSS_NOOP_PFI(Ioss::SideSet) + IOSS_NOOP_PFI(Ioss::CommSet) + IOSS_NOOP_PFI(Ioss::Assembly) + IOSS_NOOP_PFI(Ioss::Blob) time_t timeLastFlush_{0}; time_t flushInterval_{10}; diff --git a/packages/seacas/libraries/ioss/src/heartbeat/Iohb_Layout.C b/packages/seacas/libraries/ioss/src/heartbeat/Iohb_Layout.C index 9c749333ef2e..27db8d2ae852 100644 --- a/packages/seacas/libraries/ioss/src/heartbeat/Iohb_Layout.C +++ b/packages/seacas/libraries/ioss/src/heartbeat/Iohb_Layout.C @@ -1,12 +1,11 @@ -// Copyright(C) 1999-2021 National Technology & Engineering Solutions +// Copyright(C) 1999-2022 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. // // See packages/seacas/LICENSE for details #include -#include // for operator<<, string, etc -#include // for vector, vector<>::size_type +#include namespace Iohb { Layout::Layout(bool show_labels, int precision, std::string separator, int field_width) @@ -17,28 +16,11 @@ namespace Iohb { Layout::~Layout() = default; - std::ostream &operator<<(std::ostream &o, Layout &lo) - { - o << lo.layout_.str(); - return o; - } - - void Layout::add_literal(const std::string &label) { layout_ << label; } + void Layout::add_literal(const std::string &label) { fmt::print(layout_, "{}", label); } void Layout::add_legend(const std::string &label) { - if (legendStarted && !separator_.empty()) { - layout_ << separator_; - } - else { - legendStarted = true; - } - - if (fieldWidth_ != 0) { - layout_ << std::setw(fieldWidth_) << label; - } - else { - layout_ << label; - } + fmt::print(layout_, "{}{:>{}}", legendStarted ? separator_ : "", label, fieldWidth_); + legendStarted = true; } } // namespace Iohb diff --git a/packages/seacas/libraries/ioss/src/heartbeat/Iohb_Layout.h b/packages/seacas/libraries/ioss/src/heartbeat/Iohb_Layout.h index 2044e4a453b6..f33b05a9ddaa 100644 --- a/packages/seacas/libraries/ioss/src/heartbeat/Iohb_Layout.h +++ b/packages/seacas/libraries/ioss/src/heartbeat/Iohb_Layout.h @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2022 National Technology & Engineering Solutions +// Copyright(C) 1999-2023 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,8 +8,7 @@ #include "iohb_export.h" -#include // for operator<<, setw, etc -#include +#include #include #include #include @@ -24,7 +23,7 @@ namespace Iohb { ~Layout(); - friend std::ostream &operator<<(std::ostream & /*o*/, Layout & /*lo*/); + const std::string layout() const { return layout_.str(); } void add_literal(const std::string &label); void add_legend(const std::string &label); @@ -47,30 +46,24 @@ namespace Iohb { inline void Layout::output_common(const std::string &name) { if (count_++ > 0 && !separator_.empty()) { - layout_ << separator_; + fmt::print(layout_, "{}", separator_); } if (showLabels && name != "") { - layout_ << name; - layout_ << "="; - } - else if (fieldWidth_ != 0) { - layout_ << std::setw(fieldWidth_); + fmt::print(layout_, "{}=", name); } } template inline void Layout::add(const std::string &name, const T &value) { output_common(name); - layout_ << value; + fmt::print(layout_, "{0:{1}}", value, fieldWidth_); } template <> inline void Layout::add(const std::string &name, const double &value) { output_common(name); - layout_.setf(std::ios::scientific); - layout_.setf(std::ios::showpoint); - layout_ << std::setprecision(precision_) << value; + fmt::print(layout_, "{0: {1}.{2}e}", value, fieldWidth_, precision_); } template @@ -81,15 +74,7 @@ namespace Iohb { } else { output_common(name); - for (size_t i = 0; i < value.size(); i++) { - if (!showLabels && (fieldWidth_ != 0)) { - layout_ << std::setw(fieldWidth_); - } - layout_ << value[i]; - if (i < value.size() - 1 && !separator_.empty()) { - layout_ << separator_; - } - } + fmt::print(layout_, "{0:{1}}", fmt::join(value, separator_), fieldWidth_); } } @@ -100,17 +85,7 @@ namespace Iohb { } else { output_common(name); - layout_.setf(std::ios::scientific); - layout_.setf(std::ios::showpoint); - for (size_t i = 0; i < value.size(); i++) { - if (!showLabels && (fieldWidth_ != 0)) { - layout_ << std::setw(fieldWidth_); - } - layout_ << std::setprecision(precision_) << value[i]; - if (i < value.size() - 1 && !separator_.empty()) { - layout_ << separator_; - } - } + fmt::print(layout_, "{0:{2}.{1}e}", fmt::join(value, separator_), precision_, fieldWidth_); } } diff --git a/packages/seacas/libraries/ioss/src/main/io_modify.C b/packages/seacas/libraries/ioss/src/main/io_modify.C index 50a217d41d1e..bd26d1d2f6ec 100644 --- a/packages/seacas/libraries/ioss/src/main/io_modify.C +++ b/packages/seacas/libraries/ioss/src/main/io_modify.C @@ -1256,7 +1256,7 @@ namespace { idx++; while (!(Ioss::Utils::str_equal(tokens[idx], "x") || Ioss::Utils::str_equal(tokens[idx], "y") || - Ioss::Utils::str_equal(tokens[idx], "x"))) { + Ioss::Utils::str_equal(tokens[idx], "z"))) { auto name = tokens[idx++]; auto *ge = region.get_entity(name, Ioss::ELEMENTBLOCK); if (ge == nullptr) { diff --git a/packages/seacas/libraries/ioss/src/pamgen/Iopg_DatabaseIO.h b/packages/seacas/libraries/ioss/src/pamgen/Iopg_DatabaseIO.h index 282a8a8249fe..4944438abd4f 100644 --- a/packages/seacas/libraries/ioss/src/pamgen/Iopg_DatabaseIO.h +++ b/packages/seacas/libraries/ioss/src/pamgen/Iopg_DatabaseIO.h @@ -118,33 +118,33 @@ namespace Iopg { int64_t get_field_internal(const Ioss::CommSet *cs, const Ioss::Field &field, void *data, size_t data_size) const override; - NOOP_GFI(Ioss::Region) - NOOP_GFI(Ioss::EdgeBlock) - NOOP_GFI(Ioss::FaceBlock) - NOOP_GFI(Ioss::StructuredBlock) - NOOP_GFI(Ioss::EdgeSet) - NOOP_GFI(Ioss::FaceSet) - NOOP_GFI(Ioss::ElementSet) - NOOP_GFI(Ioss::SideSet) - NOOP_GFI(Ioss::Blob) - NOOP_GFI(Ioss::Assembly) + IOSS_NOOP_GFI(Ioss::Region) + IOSS_NOOP_GFI(Ioss::EdgeBlock) + IOSS_NOOP_GFI(Ioss::FaceBlock) + IOSS_NOOP_GFI(Ioss::StructuredBlock) + IOSS_NOOP_GFI(Ioss::EdgeSet) + IOSS_NOOP_GFI(Ioss::FaceSet) + IOSS_NOOP_GFI(Ioss::ElementSet) + IOSS_NOOP_GFI(Ioss::SideSet) + IOSS_NOOP_GFI(Ioss::Blob) + IOSS_NOOP_GFI(Ioss::Assembly) // Input only database -- these will never be called... - NOOP_PFI(Ioss::Region) - NOOP_PFI(Ioss::NodeBlock) - NOOP_PFI(Ioss::EdgeBlock) - NOOP_PFI(Ioss::FaceBlock) - NOOP_PFI(Ioss::ElementBlock) - NOOP_PFI(Ioss::StructuredBlock) - NOOP_PFI(Ioss::SideBlock) - NOOP_PFI(Ioss::NodeSet) - NOOP_PFI(Ioss::EdgeSet) - NOOP_PFI(Ioss::FaceSet) - NOOP_PFI(Ioss::ElementSet) - NOOP_PFI(Ioss::SideSet) - NOOP_PFI(Ioss::CommSet) - NOOP_PFI(Ioss::Assembly) - NOOP_PFI(Ioss::Blob) + IOSS_NOOP_PFI(Ioss::Region) + IOSS_NOOP_PFI(Ioss::NodeBlock) + IOSS_NOOP_PFI(Ioss::EdgeBlock) + IOSS_NOOP_PFI(Ioss::FaceBlock) + IOSS_NOOP_PFI(Ioss::ElementBlock) + IOSS_NOOP_PFI(Ioss::StructuredBlock) + IOSS_NOOP_PFI(Ioss::SideBlock) + IOSS_NOOP_PFI(Ioss::NodeSet) + IOSS_NOOP_PFI(Ioss::EdgeSet) + IOSS_NOOP_PFI(Ioss::FaceSet) + IOSS_NOOP_PFI(Ioss::ElementSet) + IOSS_NOOP_PFI(Ioss::SideSet) + IOSS_NOOP_PFI(Ioss::CommSet) + IOSS_NOOP_PFI(Ioss::Assembly) + IOSS_NOOP_PFI(Ioss::Blob) std::string databaseTitle; diff --git a/packages/seacas/libraries/ioss/src/text_mesh/Iotm_DatabaseIO.C b/packages/seacas/libraries/ioss/src/text_mesh/Iotm_DatabaseIO.C index 1a48aabdc7ee..b6827aa17720 100644 --- a/packages/seacas/libraries/ioss/src/text_mesh/Iotm_DatabaseIO.C +++ b/packages/seacas/libraries/ioss/src/text_mesh/Iotm_DatabaseIO.C @@ -556,7 +556,7 @@ namespace Iotm { } int64_t DatabaseIO::get_field_internal(const Ioss::Assembly *assembly, const Ioss::Field &field, - void *data, size_t data_size) const + void * /* data */, size_t data_size) const { { Ioss::SerializeIO serializeIO__(this); diff --git a/packages/seacas/libraries/ioss/src/text_mesh/Iotm_DatabaseIO.h b/packages/seacas/libraries/ioss/src/text_mesh/Iotm_DatabaseIO.h index 5dbb0c0dea5a..8e71b1eaf668 100644 --- a/packages/seacas/libraries/ioss/src/text_mesh/Iotm_DatabaseIO.h +++ b/packages/seacas/libraries/ioss/src/text_mesh/Iotm_DatabaseIO.h @@ -120,31 +120,31 @@ namespace Iotm { int64_t get_field_internal(const Ioss::Assembly *assem, const Ioss::Field &field, void *data, size_t data_size) const override; - NOOP_GFI(Ioss::EdgeBlock) - NOOP_GFI(Ioss::FaceBlock) - NOOP_GFI(Ioss::StructuredBlock) - NOOP_GFI(Ioss::EdgeSet) - NOOP_GFI(Ioss::FaceSet) - NOOP_GFI(Ioss::ElementSet) - NOOP_GFI(Ioss::SideSet) - NOOP_GFI(Ioss::Blob) + IOSS_NOOP_GFI(Ioss::EdgeBlock) + IOSS_NOOP_GFI(Ioss::FaceBlock) + IOSS_NOOP_GFI(Ioss::StructuredBlock) + IOSS_NOOP_GFI(Ioss::EdgeSet) + IOSS_NOOP_GFI(Ioss::FaceSet) + IOSS_NOOP_GFI(Ioss::ElementSet) + IOSS_NOOP_GFI(Ioss::SideSet) + IOSS_NOOP_GFI(Ioss::Blob) // Input only database -- these will never be called... - NOOP_PFI(Ioss::Region) - NOOP_PFI(Ioss::NodeBlock) - NOOP_PFI(Ioss::EdgeBlock) - NOOP_PFI(Ioss::FaceBlock) - NOOP_PFI(Ioss::ElementBlock) - NOOP_PFI(Ioss::StructuredBlock) - NOOP_PFI(Ioss::SideBlock) - NOOP_PFI(Ioss::NodeSet) - NOOP_PFI(Ioss::EdgeSet) - NOOP_PFI(Ioss::FaceSet) - NOOP_PFI(Ioss::ElementSet) - NOOP_PFI(Ioss::SideSet) - NOOP_PFI(Ioss::CommSet) - NOOP_PFI(Ioss::Assembly) - NOOP_PFI(Ioss::Blob) + IOSS_NOOP_PFI(Ioss::Region) + IOSS_NOOP_PFI(Ioss::NodeBlock) + IOSS_NOOP_PFI(Ioss::EdgeBlock) + IOSS_NOOP_PFI(Ioss::FaceBlock) + IOSS_NOOP_PFI(Ioss::ElementBlock) + IOSS_NOOP_PFI(Ioss::StructuredBlock) + IOSS_NOOP_PFI(Ioss::SideBlock) + IOSS_NOOP_PFI(Ioss::NodeSet) + IOSS_NOOP_PFI(Ioss::EdgeSet) + IOSS_NOOP_PFI(Ioss::FaceSet) + IOSS_NOOP_PFI(Ioss::ElementSet) + IOSS_NOOP_PFI(Ioss::SideSet) + IOSS_NOOP_PFI(Ioss::CommSet) + IOSS_NOOP_PFI(Ioss::Assembly) + IOSS_NOOP_PFI(Ioss::Blob) void add_transient_fields(Ioss::GroupingEntity *entity); diff --git a/packages/seacas/libraries/ioss/src/text_mesh/Iotm_TextMesh.C b/packages/seacas/libraries/ioss/src/text_mesh/Iotm_TextMesh.C index 872050daa69c..a1e98da9d4e1 100644 --- a/packages/seacas/libraries/ioss/src/text_mesh/Iotm_TextMesh.C +++ b/packages/seacas/libraries/ioss/src/text_mesh/Iotm_TextMesh.C @@ -31,13 +31,13 @@ namespace Iotm { void error_handler(const std::ostringstream &message) { throw std::logic_error((message).str()); } - TextMesh::TextMesh(int proc_count, int my_proc) : m_myProcessor(my_proc) + TextMesh::TextMesh(IOSS_MAYBE_UNUSED int proc_count, int my_proc) : m_myProcessor(my_proc) { m_errorHandler = [](const std::ostringstream &errmsg) { error_handler(errmsg); }; initialize(); } - TextMesh::TextMesh(const std::string ¶meters, int proc_count, int my_proc) + TextMesh::TextMesh(const std::string ¶meters, IOSS_MAYBE_UNUSED int proc_count, int my_proc) : m_myProcessor(my_proc) { m_errorHandler = [](const std::ostringstream &errmsg) { error_handler(errmsg); }; diff --git a/packages/seacas/libraries/ioss/src/text_mesh/Iotm_TextMesh.h b/packages/seacas/libraries/ioss/src/text_mesh/Iotm_TextMesh.h index 530b51e62bcf..964a9929580f 100644 --- a/packages/seacas/libraries/ioss/src/text_mesh/Iotm_TextMesh.h +++ b/packages/seacas/libraries/ioss/src/text_mesh/Iotm_TextMesh.h @@ -56,8 +56,9 @@ namespace Iotm { class IOTM_EXPORT TextMesh { public: - explicit TextMesh(const std::string ¶meters, int proc_count = 1, int my_proc = 0); - TextMesh(int proc_count = 1, int my_proc = 0); + explicit TextMesh(const std::string ¶meters, IOSS_MAYBE_UNUSED int proc_count = 1, + int my_proc = 0); + TextMesh(IOSS_MAYBE_UNUSED int proc_count = 1, int my_proc = 0); TextMesh(); TextMesh(const TextMesh &) = delete; TextMesh &operator=(const TextMesh &) = delete; diff --git a/packages/seacas/libraries/ioss/src/text_mesh/Iotm_TextMeshAdjacencyGraph.h b/packages/seacas/libraries/ioss/src/text_mesh/Iotm_TextMeshAdjacencyGraph.h index 49d7401f36fc..d61128f9523c 100644 --- a/packages/seacas/libraries/ioss/src/text_mesh/Iotm_TextMeshAdjacencyGraph.h +++ b/packages/seacas/libraries/ioss/src/text_mesh/Iotm_TextMeshAdjacencyGraph.h @@ -601,7 +601,7 @@ namespace Iotm { bool has_any_shell_connection_on_side(size_t thisIndex, int thisSide) { - Criterion criterion = [&](const Topology &topo1, const Topology &topo2) { + Criterion criterion = [&](const Topology & /* topo1 */, const Topology &topo2) { return topo2.is_shell(); }; diff --git a/packages/seacas/libraries/ioss/src/text_mesh/Iotm_TextMeshSidesetSplitter.h b/packages/seacas/libraries/ioss/src/text_mesh/Iotm_TextMeshSidesetSplitter.h index de9389b85f38..537490384dfc 100644 --- a/packages/seacas/libraries/ioss/src/text_mesh/Iotm_TextMeshSidesetSplitter.h +++ b/packages/seacas/libraries/ioss/src/text_mesh/Iotm_TextMeshSidesetSplitter.h @@ -289,8 +289,8 @@ namespace Iotm { split_by_criterion(sideset, elementData, criterion); } - void split_by_no_split(const SidesetData &sideset, - const std::vector> &elementData) + void split_by_no_split(const SidesetData &sideset, + const std::vector> & /* elementData */) { std::vector splitIndex(sideset.data.size()); std::iota(std::begin(splitIndex), std::end(splitIndex), 0); diff --git a/packages/seacas/libraries/ioss/src/text_mesh/Iotm_TextMeshTopologyMapping.h b/packages/seacas/libraries/ioss/src/text_mesh/Iotm_TextMeshTopologyMapping.h index 338c8b806ee2..52373d75d9e0 100644 --- a/packages/seacas/libraries/ioss/src/text_mesh/Iotm_TextMeshTopologyMapping.h +++ b/packages/seacas/libraries/ioss/src/text_mesh/Iotm_TextMeshTopologyMapping.h @@ -56,7 +56,8 @@ namespace Iotm { set_valid_spatial_dimensions({false, false, false, false}); } - TopologyMapEntry(const TopologyMapEntry &topo) = default; + TopologyMapEntry(const TopologyMapEntry &topo) = default; + TopologyMapEntry &operator=(const TopologyMapEntry &topo) = default; bool operator==(const Ioss::ElementTopology *topo) const { return topo == topology; } diff --git a/packages/seacas/libraries/ioss/src/utest/Utst_IofxDatabaseIO.C b/packages/seacas/libraries/ioss/src/utest/Utst_IofxDatabaseIO.C index 37bfb6e06588..a7a4d1a6cadc 100644 --- a/packages/seacas/libraries/ioss/src/utest/Utst_IofxDatabaseIO.C +++ b/packages/seacas/libraries/ioss/src/utest/Utst_IofxDatabaseIO.C @@ -403,7 +403,7 @@ namespace { } // EndDocTest2 } // namespace -int main(int argc, char **argv) +int main(IOSS_MAYBE_UNUSED int argc, char **argv) { #ifdef SEACAS_HAVE_MPI MPI_Init(&argc, &argv); diff --git a/packages/seacas/libraries/ioss/src/utest/Utst_blob_write_read.C b/packages/seacas/libraries/ioss/src/utest/Utst_blob_write_read.C index 6b8711e3cb8b..11389fb3b650 100644 --- a/packages/seacas/libraries/ioss/src/utest/Utst_blob_write_read.C +++ b/packages/seacas/libraries/ioss/src/utest/Utst_blob_write_read.C @@ -58,7 +58,7 @@ namespace { } } // namespace -int main(int argc, char *argv[]) +int main(IOSS_MAYBE_UNUSED int argc, IOSS_MAYBE_UNUSED char *argv[]) { #ifdef SEACAS_HAVE_MPI MPI_Init(&argc, &argv); diff --git a/packages/seacas/libraries/ioss/src/utest/Utst_heartbeat.C b/packages/seacas/libraries/ioss/src/utest/Utst_heartbeat.C index 71a1ec2188af..e8ba2edbd079 100644 --- a/packages/seacas/libraries/ioss/src/utest/Utst_heartbeat.C +++ b/packages/seacas/libraries/ioss/src/utest/Utst_heartbeat.C @@ -5,8 +5,8 @@ #include #include -#include #include +#include #include @@ -18,9 +18,10 @@ namespace { Ioss::Init::Initializer init_db; Ioss::PropertyManager properties; - properties.add(Ioss::Property("SHOW_LABELS", 0)); - properties.add(Ioss::Property("SHOW_LEGEND", 1)); + properties.add(Ioss::Property("SHOW_LABELS", "yes")); + properties.add(Ioss::Property("SHOW_LEGEND", "no")); properties.add(Ioss::Property("SHOW_TIME_STAMP", 1)); + properties.add(Ioss::Property("TIME_STAMP_FORMAT", "{%F %H:%M:%S}")); Ioss::DatabaseIO *dbo = Ioss::IOFactory::create("heartbeat", filename, Ioss::WRITE_HEARTBEAT, Ioss::ParallelUtils::comm_world(), properties); if (dbo == nullptr || !dbo->ok(true)) { @@ -65,7 +66,7 @@ namespace { } } // namespace -int main(int argc, char **argv) +int main(IOSS_MAYBE_UNUSED int argc, char **argv) { #ifdef SEACAS_HAVE_MPI MPI_Init(&argc, &argv); diff --git a/packages/seacas/libraries/ioss/src/visualization/cgns/Iovs_cgns_DatabaseIO.C b/packages/seacas/libraries/ioss/src/visualization/cgns/Iovs_cgns_DatabaseIO.C index 18c7c4088cd0..974b05b0048b 100644 --- a/packages/seacas/libraries/ioss/src/visualization/cgns/Iovs_cgns_DatabaseIO.C +++ b/packages/seacas/libraries/ioss/src/visualization/cgns/Iovs_cgns_DatabaseIO.C @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2021 National Technology & Engineering Solutions +// Copyright(C) 1999-2022 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. // @@ -26,18 +26,18 @@ namespace Iovs_cgns { Iovs::Utils::DatabaseInfo dbinfo; dbinfo.databaseFilename = this->DBFilename; dbinfo.separatorCharacter = std::string(1, this->get_field_separator()); - dbinfo.parallelUtils = &this->util(); + dbinfo.parallelUtils = &this->util(); Iovs::Utils::getInstance().checkDbUsage(db_usage); Iovs::Utils::getInstance().createDatabaseOutputFile(dbinfo); - dbState = Ioss::STATE_UNKNOWN; + dbState = Ioss::STATE_UNKNOWN; Iovs::Utils::getInstance().writeToCatalystLogFile(dbinfo, props); this->catCGNSMesh = Iovs::Utils::getInstance().createCatalystCGNSMesh(dbinfo, props); } DatabaseIO::~DatabaseIO() { this->catCGNSMesh->Delete(); } - bool DatabaseIO::begin__(Ioss::State state) { return true; } + bool DatabaseIO::begin__(Ioss::State) { return true; } bool DatabaseIO::end__(Ioss::State state) { @@ -58,7 +58,7 @@ namespace Iovs_cgns { return true; } - bool DatabaseIO::end_state__(int state, double time) + bool DatabaseIO::end_state__(int, double) { std::vector error_codes; std::vector error_messages; @@ -162,8 +162,8 @@ namespace Iovs_cgns { return num_to_get; } - int64_t DatabaseIO::put_field_internal(const Ioss::ElementBlock *eb, const Ioss::Field &field, - void *data, size_t data_size) const + int64_t DatabaseIO::put_field_internal(const Ioss::ElementBlock *, const Ioss::Field &field, + void *, size_t data_size) const { size_t num_to_get = field.verify(data_size); diff --git a/packages/seacas/libraries/ioss/src/visualization/cgns/Iovs_cgns_DatabaseIO.h b/packages/seacas/libraries/ioss/src/visualization/cgns/Iovs_cgns_DatabaseIO.h index 791bcd005eb9..636f69ef7603 100644 --- a/packages/seacas/libraries/ioss/src/visualization/cgns/Iovs_cgns_DatabaseIO.h +++ b/packages/seacas/libraries/ioss/src/visualization/cgns/Iovs_cgns_DatabaseIO.h @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2021 National Technology & Engineering Solutions +// Copyright(C) 1999-2022 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. // @@ -38,151 +38,39 @@ namespace Iovs_cgns { void read_meta_data__() override; - int64_t get_field_internal(const Ioss::Region *reg, const Ioss::Field &field, void *data, - size_t data_size) const override - { - return 0; - } - int64_t get_field_internal(const Ioss::NodeBlock *nb, const Ioss::Field &field, void *data, - size_t data_size) const override - { - return 0; - } - int64_t get_field_internal(const Ioss::EdgeBlock *nb, const Ioss::Field &field, void *data, - size_t data_size) const override - { - return 0; - } - int64_t get_field_internal(const Ioss::FaceBlock *nb, const Ioss::Field &field, void *data, - size_t data_size) const override - { - return 0; - } - int64_t get_field_internal(const Ioss::ElementBlock *eb, const Ioss::Field &field, void *data, - size_t data_size) const override - { - return 0; - } - int64_t get_field_internal(const Ioss::SideBlock *fb, const Ioss::Field &field, void *data, - size_t data_size) const override - { - return 0; - } - int64_t get_field_internal(const Ioss::NodeSet *ns, const Ioss::Field &field, void *data, - size_t data_size) const override - { - return 0; - } - int64_t get_field_internal(const Ioss::EdgeSet *ns, const Ioss::Field &field, void *data, - size_t data_size) const override - { - return 0; - } - int64_t get_field_internal(const Ioss::FaceSet *ns, const Ioss::Field &field, void *data, - size_t data_size) const override - { - return 0; - } - int64_t get_field_internal(const Ioss::ElementSet *ns, const Ioss::Field &field, void *data, - size_t data_size) const override - { - return 0; - } - int64_t get_field_internal(const Ioss::SideSet *fs, const Ioss::Field &field, void *data, - size_t data_size) const override - { - return 0; - } - int64_t get_field_internal(const Ioss::CommSet *cs, const Ioss::Field &field, void *data, - size_t data_size) const override - { - return 0; - } - int64_t get_field_internal(const Ioss::StructuredBlock *sb, const Ioss::Field &field, - void *data, size_t data_size) const override - { - return 0; - } - int64_t get_field_internal(const Ioss::Assembly * /*sb*/, const Ioss::Field & /*field*/, - void * /*data*/, size_t /*data_size*/) const override - { - return 0; - } - int64_t get_field_internal(const Ioss::Blob * /*sb*/, const Ioss::Field & /*field*/, - void * /*data*/, size_t /*data_size*/) const override - { - return 0; - } - - int64_t put_field_internal(const Ioss::Region *reg, const Ioss::Field &field, void *data, - size_t data_size) const override - { - return 0; - } - int64_t put_field_internal(const Ioss::NodeBlock *nb, const Ioss::Field &field, void *data, - size_t data_size) const override - { - return 0; - } - int64_t put_field_internal(const Ioss::EdgeBlock *nb, const Ioss::Field &field, void *data, - size_t data_size) const override - { - return 0; - } - int64_t put_field_internal(const Ioss::FaceBlock *nb, const Ioss::Field &field, void *data, - size_t data_size) const override - { - return 0; - } + IOSS_NOOP_GFI(Ioss::Region) + IOSS_NOOP_GFI(Ioss::NodeBlock) + IOSS_NOOP_GFI(Ioss::EdgeBlock) + IOSS_NOOP_GFI(Ioss::FaceBlock) + IOSS_NOOP_GFI(Ioss::ElementBlock) + IOSS_NOOP_GFI(Ioss::StructuredBlock) + IOSS_NOOP_GFI(Ioss::SideBlock) + IOSS_NOOP_GFI(Ioss::NodeSet) + IOSS_NOOP_GFI(Ioss::EdgeSet) + IOSS_NOOP_GFI(Ioss::FaceSet) + IOSS_NOOP_GFI(Ioss::ElementSet) + IOSS_NOOP_GFI(Ioss::SideSet) + IOSS_NOOP_GFI(Ioss::CommSet) + IOSS_NOOP_GFI(Ioss::Assembly) + IOSS_NOOP_GFI(Ioss::Blob) + int64_t put_field_internal(const Ioss::ElementBlock *eb, const Ioss::Field &field, void *data, size_t data_size) const override; - int64_t put_field_internal(const Ioss::SideBlock *eb, const Ioss::Field &field, void *data, - size_t data_size) const override - { - return 0; - } - int64_t put_field_internal(const Ioss::NodeSet *ns, const Ioss::Field &field, void *data, - size_t data_size) const override - { - return 0; - } - int64_t put_field_internal(const Ioss::EdgeSet *ns, const Ioss::Field &field, void *data, - size_t data_size) const override - { - return 0; - } - int64_t put_field_internal(const Ioss::FaceSet *ns, const Ioss::Field &field, void *data, - size_t data_size) const override - { - return 0; - } - int64_t put_field_internal(const Ioss::ElementSet *ns, const Ioss::Field &field, void *data, - size_t data_size) const override - { - return 0; - } - int64_t put_field_internal(const Ioss::SideSet *fs, const Ioss::Field &field, void *data, - size_t data_size) const override - { - return 0; - } - int64_t put_field_internal(const Ioss::CommSet *cs, const Ioss::Field &field, void *data, - size_t data_size) const override - { - return 0; - } int64_t put_field_internal(const Ioss::StructuredBlock *sb, const Ioss::Field &field, void *data, size_t data_size) const override; - int64_t put_field_internal(const Ioss::Assembly * /*sb*/, const Ioss::Field & /*field*/, - void * /*data*/, size_t /*data_size*/) const override - { - return 0; - } - int64_t put_field_internal(const Ioss::Blob * /*sb*/, const Ioss::Field & /*field*/, - void * /*data*/, size_t /*data_size*/) const override - { - return 0; - } + IOSS_NOOP_PFI(Ioss::Region) + IOSS_NOOP_PFI(Ioss::NodeBlock) + IOSS_NOOP_PFI(Ioss::EdgeBlock) + IOSS_NOOP_PFI(Ioss::FaceBlock) + IOSS_NOOP_PFI(Ioss::SideBlock) + IOSS_NOOP_PFI(Ioss::NodeSet) + IOSS_NOOP_PFI(Ioss::EdgeSet) + IOSS_NOOP_PFI(Ioss::FaceSet) + IOSS_NOOP_PFI(Ioss::ElementSet) + IOSS_NOOP_PFI(Ioss::SideSet) + IOSS_NOOP_PFI(Ioss::CommSet) + IOSS_NOOP_PFI(Ioss::Assembly) + IOSS_NOOP_PFI(Ioss::Blob) std::unique_ptr catCGNSMesh; }; diff --git a/packages/seacas/libraries/ioss/src/visualization/exodus/Iovs_exodus_DatabaseIO.C b/packages/seacas/libraries/ioss/src/visualization/exodus/Iovs_exodus_DatabaseIO.C index 223416144ed9..98fa35b16b04 100644 --- a/packages/seacas/libraries/ioss/src/visualization/exodus/Iovs_exodus_DatabaseIO.C +++ b/packages/seacas/libraries/ioss/src/visualization/exodus/Iovs_exodus_DatabaseIO.C @@ -644,7 +644,7 @@ namespace Iovs_exodus { return -4; } - int64_t DatabaseIO::put_field_internal(const Ioss::NodeSet *ns, const Ioss::Field &field, + int64_t DatabaseIO::put_field_internal(const Ioss::NodeSet * /* ns */, const Ioss::Field &field, void *data, size_t data_size) const { int64_t num_to_get = field.verify(data_size); diff --git a/packages/seacas/libraries/ioss/src/visualization/utils/Iovs_Utils.C b/packages/seacas/libraries/ioss/src/visualization/utils/Iovs_Utils.C index 1c274bacecd4..8b3d82379e11 100644 --- a/packages/seacas/libraries/ioss/src/visualization/utils/Iovs_Utils.C +++ b/packages/seacas/libraries/ioss/src/visualization/utils/Iovs_Utils.C @@ -526,10 +526,11 @@ namespace Iovs { } } - void Utils::broadCastString(std::string &s, const DatabaseInfo &dbinfo) + void Utils::broadCastString(IOSS_MAYBE_UNUSED std::string &s, + IOSS_MAYBE_UNUSED const DatabaseInfo &dbinfo) { - PAR_UNUSED(s); - PAR_UNUSED(dbinfo); + IOSS_PAR_UNUSED(s); + IOSS_PAR_UNUSED(dbinfo); #ifdef SEACAS_HAVE_MPI int size = s.size(); dbinfo.parallelUtils->broadcast(size); @@ -540,10 +541,11 @@ namespace Iovs { #endif } - void Utils::broadCastStatusCode(bool &statusCode, const DatabaseInfo &dbinfo) + void Utils::broadCastStatusCode(IOSS_MAYBE_UNUSED bool &statusCode, + IOSS_MAYBE_UNUSED const DatabaseInfo &dbinfo) { - PAR_UNUSED(statusCode); - PAR_UNUSED(dbinfo); + IOSS_PAR_UNUSED(statusCode); + IOSS_PAR_UNUSED(dbinfo); #ifdef SEACAS_HAVE_MPI int code = statusCode; From b614847e9e43e213b767d13f24f0fac5934d0fa2 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Tue, 17 Jan 2023 14:59:47 -0700 Subject: [PATCH 08/14] SEACAS: Tribits update --- packages/seacas/libraries/exoIIv2for32/CMakeLists.txt | 2 +- packages/seacas/libraries/exodus/CMakeLists.txt | 2 +- packages/seacas/libraries/exodus_for/CMakeLists.txt | 2 +- packages/seacas/libraries/ioss/src/CMakeLists.txt | 2 +- packages/seacas/libraries/ioss/src/adios/CMakeLists.txt | 2 +- packages/seacas/libraries/ioss/src/catalyst/CMakeLists.txt | 2 +- packages/seacas/libraries/ioss/src/cgns/CMakeLists.txt | 2 +- packages/seacas/libraries/ioss/src/exodus/CMakeLists.txt | 2 +- packages/seacas/libraries/ioss/src/faodel/CMakeLists.txt | 2 +- packages/seacas/libraries/ioss/src/gen_struc/CMakeLists.txt | 2 +- packages/seacas/libraries/ioss/src/generated/CMakeLists.txt | 2 +- packages/seacas/libraries/ioss/src/heartbeat/CMakeLists.txt | 2 +- packages/seacas/libraries/ioss/src/init/CMakeLists.txt | 2 +- packages/seacas/libraries/ioss/src/main/CMakeLists.txt | 2 +- packages/seacas/libraries/ioss/src/pamgen/CMakeLists.txt | 2 +- packages/seacas/libraries/ioss/src/text_mesh/CMakeLists.txt | 2 +- packages/seacas/libraries/ioss/src/transform/CMakeLists.txt | 2 +- .../seacas/libraries/ioss/src/visualization/CMakeLists.txt | 2 +- .../libraries/ioss/src/visualization/catalyst/CMakeLists.txt | 4 ++-- packages/seacas/libraries/plt/CMakeLists.txt | 2 +- 20 files changed, 21 insertions(+), 21 deletions(-) diff --git a/packages/seacas/libraries/exoIIv2for32/CMakeLists.txt b/packages/seacas/libraries/exoIIv2for32/CMakeLists.txt index 0a93d767439f..5b680a8a5c27 100644 --- a/packages/seacas/libraries/exoIIv2for32/CMakeLists.txt +++ b/packages/seacas/libraries/exoIIv2for32/CMakeLists.txt @@ -9,7 +9,7 @@ TRIBITS_INCLUDE_DIRECTORIES( "${CMAKE_CURRENT_SOURCE_DIR}/test" ) -TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) TRIBITS_ADD_LIBRARY( exoIIv2for32 diff --git a/packages/seacas/libraries/exodus/CMakeLists.txt b/packages/seacas/libraries/exodus/CMakeLists.txt index 15860b2a8d15..31c28371add0 100644 --- a/packages/seacas/libraries/exodus/CMakeLists.txt +++ b/packages/seacas/libraries/exodus/CMakeLists.txt @@ -19,7 +19,7 @@ if (NOT ${EXODUS_THREADSAFE}) list(REMOVE_ITEM SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/ex_threadsafe.c) endif() -TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_BINARY_DIR}) +SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_BINARY_DIR}) SET(HEADERS include/exodusII.h diff --git a/packages/seacas/libraries/exodus_for/CMakeLists.txt b/packages/seacas/libraries/exodus_for/CMakeLists.txt index 2ff709977506..c486de45012b 100644 --- a/packages/seacas/libraries/exodus_for/CMakeLists.txt +++ b/packages/seacas/libraries/exodus_for/CMakeLists.txt @@ -12,7 +12,7 @@ TRIBITS_INCLUDE_DIRECTORIES( ) SET(SOURCES "") -TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(SOURCES ${DIR}/src/*.c ${DIR}/src/*.F) LIST(REMOVE_ITEM SOURCES "${DIR}/src/exo_jack-windows.c") diff --git a/packages/seacas/libraries/ioss/src/CMakeLists.txt b/packages/seacas/libraries/ioss/src/CMakeLists.txt index 606ec254e673..27a5e9820427 100644 --- a/packages/seacas/libraries/ioss/src/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/CMakeLists.txt @@ -48,7 +48,7 @@ IF (NOT TPL_ENABLE_ParMETIS) ADD_DEFINITIONS(-DNO_PARMETIS_SUPPORT) ENDIF() -TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/Ioss_*.h) APPEND_GLOB(HEADERS ${DIR}/tokenize.h) APPEND_GLOB(HEADERS ${DIR}/io_info.h) diff --git a/packages/seacas/libraries/ioss/src/adios/CMakeLists.txt b/packages/seacas/libraries/ioss/src/adios/CMakeLists.txt index b57478459103..cfb59559c276 100644 --- a/packages/seacas/libraries/ioss/src/adios/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/adios/CMakeLists.txt @@ -1,7 +1,7 @@ SET(HEADERS "") SET(SOURCES "") -TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.h*) APPEND_GLOB(SOURCES ${DIR}/*.C) diff --git a/packages/seacas/libraries/ioss/src/catalyst/CMakeLists.txt b/packages/seacas/libraries/ioss/src/catalyst/CMakeLists.txt index 7ee0946b9039..49fb5a0bd932 100644 --- a/packages/seacas/libraries/ioss/src/catalyst/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/catalyst/CMakeLists.txt @@ -1,7 +1,7 @@ SET(HEADERS "") SET(SOURCES "") -TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.h*) APPEND_GLOB(SOURCES ${DIR}/*.C) diff --git a/packages/seacas/libraries/ioss/src/cgns/CMakeLists.txt b/packages/seacas/libraries/ioss/src/cgns/CMakeLists.txt index 968ee75e240f..e9efa9fcdad4 100644 --- a/packages/seacas/libraries/ioss/src/cgns/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/cgns/CMakeLists.txt @@ -14,7 +14,7 @@ ELSE() ENDIF() ENDIF() -TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.h) APPEND_GLOB(SOURCES ${DIR}/*.C) diff --git a/packages/seacas/libraries/ioss/src/exodus/CMakeLists.txt b/packages/seacas/libraries/ioss/src/exodus/CMakeLists.txt index cc0b2153b8de..8b375a3361bc 100644 --- a/packages/seacas/libraries/ioss/src/exodus/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/exodus/CMakeLists.txt @@ -2,7 +2,7 @@ SET(HEADERS "") SET(SOURCES "") -TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.h) APPEND_GLOB(SOURCES ${DIR}/*.C) diff --git a/packages/seacas/libraries/ioss/src/faodel/CMakeLists.txt b/packages/seacas/libraries/ioss/src/faodel/CMakeLists.txt index 6d7203df36cd..a1efc7ba75a2 100644 --- a/packages/seacas/libraries/ioss/src/faodel/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/faodel/CMakeLists.txt @@ -1,7 +1,7 @@ SET(HEADERS "") SET(SOURCES "") -TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.h) APPEND_GLOB(SOURCES ${DIR}/*.C) diff --git a/packages/seacas/libraries/ioss/src/gen_struc/CMakeLists.txt b/packages/seacas/libraries/ioss/src/gen_struc/CMakeLists.txt index ee920059c989..eb791e956021 100644 --- a/packages/seacas/libraries/ioss/src/gen_struc/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/gen_struc/CMakeLists.txt @@ -1,7 +1,7 @@ SET(HEADERS "") SET(SOURCES "") -TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.h) APPEND_GLOB(SOURCES ${DIR}/*.C) diff --git a/packages/seacas/libraries/ioss/src/generated/CMakeLists.txt b/packages/seacas/libraries/ioss/src/generated/CMakeLists.txt index 69f428dac5ca..86a38058321f 100644 --- a/packages/seacas/libraries/ioss/src/generated/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/generated/CMakeLists.txt @@ -2,7 +2,7 @@ SET(HEADERS "") SET(SOURCES "") -TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.h) APPEND_GLOB(SOURCES ${DIR}/*.C) diff --git a/packages/seacas/libraries/ioss/src/heartbeat/CMakeLists.txt b/packages/seacas/libraries/ioss/src/heartbeat/CMakeLists.txt index 04c879739885..092cda7bb5df 100644 --- a/packages/seacas/libraries/ioss/src/heartbeat/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/heartbeat/CMakeLists.txt @@ -2,7 +2,7 @@ SET(HEADERS "") SET(SOURCES "") -TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.h) APPEND_GLOB(SOURCES ${DIR}/*.C) diff --git a/packages/seacas/libraries/ioss/src/init/CMakeLists.txt b/packages/seacas/libraries/ioss/src/init/CMakeLists.txt index 50073939170c..acb0c0d9262a 100644 --- a/packages/seacas/libraries/ioss/src/init/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/init/CMakeLists.txt @@ -2,7 +2,7 @@ SET(HEADERS "") SET(SOURCES "") -TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.h) APPEND_GLOB(SOURCES ${DIR}/*.C) diff --git a/packages/seacas/libraries/ioss/src/main/CMakeLists.txt b/packages/seacas/libraries/ioss/src/main/CMakeLists.txt index 9bea1013c5a0..742ebe0ebda9 100644 --- a/packages/seacas/libraries/ioss/src/main/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/main/CMakeLists.txt @@ -1,7 +1,7 @@ SET(HEADERS "") SET(SOURCES "") -TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.h) APPEND_GLOB(SOURCES ${DIR}/*.C) diff --git a/packages/seacas/libraries/ioss/src/pamgen/CMakeLists.txt b/packages/seacas/libraries/ioss/src/pamgen/CMakeLists.txt index f57d7a440d54..6e6d311babc5 100644 --- a/packages/seacas/libraries/ioss/src/pamgen/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/pamgen/CMakeLists.txt @@ -2,7 +2,7 @@ SET(HEADERS "") SET(SOURCES "") -TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.h) APPEND_GLOB(SOURCES ${DIR}/*.C) diff --git a/packages/seacas/libraries/ioss/src/text_mesh/CMakeLists.txt b/packages/seacas/libraries/ioss/src/text_mesh/CMakeLists.txt index 3f7715018fad..cd18aa547de7 100644 --- a/packages/seacas/libraries/ioss/src/text_mesh/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/text_mesh/CMakeLists.txt @@ -2,7 +2,7 @@ SET(HEADERS "") SET(SOURCES "") -TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.h) APPEND_GLOB(SOURCES ${DIR}/*.C) diff --git a/packages/seacas/libraries/ioss/src/transform/CMakeLists.txt b/packages/seacas/libraries/ioss/src/transform/CMakeLists.txt index 340ca1dd0654..292f9698531b 100644 --- a/packages/seacas/libraries/ioss/src/transform/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/transform/CMakeLists.txt @@ -2,7 +2,7 @@ SET(HEADERS "") SET(SOURCES "") -TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.h) APPEND_GLOB(SOURCES ${DIR}/*.C) diff --git a/packages/seacas/libraries/ioss/src/visualization/CMakeLists.txt b/packages/seacas/libraries/ioss/src/visualization/CMakeLists.txt index d5186c3063d6..a3db7f2ddc05 100644 --- a/packages/seacas/libraries/ioss/src/visualization/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/visualization/CMakeLists.txt @@ -2,7 +2,7 @@ SET(HEADERS "") SET(SOURCES "") -TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/cgns/*.h) APPEND_GLOB(SOURCES ${DIR}/cgns/*.C) APPEND_GLOB(HEADERS ${DIR}/exodus/*.h) diff --git a/packages/seacas/libraries/ioss/src/visualization/catalyst/CMakeLists.txt b/packages/seacas/libraries/ioss/src/visualization/catalyst/CMakeLists.txt index a5c1c687843c..be0d6d5e0e2e 100644 --- a/packages/seacas/libraries/ioss/src/visualization/catalyst/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/visualization/catalyst/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright(C) 1999-2021 National Technology & Engineering Solutions +# Copyright(C) 1999-2021, 2023 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,7 +8,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.8.0) PROJECT(CatalystIossAdapter) -SET(CMAKE_CXX_STANDARD 14) +SET(CMAKE_CXX_STANDARD 17) SET(PVCSA_VERSION CACHE STRING "Version string to append to catalyst adapter library.") diff --git a/packages/seacas/libraries/plt/CMakeLists.txt b/packages/seacas/libraries/plt/CMakeLists.txt index 3ef04a6090ad..b2a67a10b9e5 100644 --- a/packages/seacas/libraries/plt/CMakeLists.txt +++ b/packages/seacas/libraries/plt/CMakeLists.txt @@ -9,7 +9,7 @@ SET(PLT_VERSION "${PLT_VERSION_MAJOR}.${PLT_VERSION_MINOR}") SET(PLT_VERSION_FULL "${PLT_VERSION}.${PLT_VERSION_PATCH}") SET(SOURCES "") -TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(SOURCES ${DIR}/*.f ${DIR}/*.F ${DIR}/*.c) From 1d16ef4f2d75110a55c691062ccd03bdf56a4834 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Tue, 17 Jan 2023 15:54:09 -0700 Subject: [PATCH 09/14] IOSS: lib{fmt} - revert unintended removal --- packages/seacas/libraries/ioss/src/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/seacas/libraries/ioss/src/CMakeLists.txt b/packages/seacas/libraries/ioss/src/CMakeLists.txt index 27a5e9820427..8816cf077d93 100644 --- a/packages/seacas/libraries/ioss/src/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/CMakeLists.txt @@ -69,6 +69,10 @@ TRIBITS_INCLUDE_DIRECTORIES( "${Zoltan_INCLUDE_DIRS}" ) +IF (NOT TPL_ENABLE_fmt) + INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/private_copy_fmt") +ENDIF() + list(APPEND HEADERS "${CMAKE_CURRENT_BINARY_DIR}/ioss_export.h") From 1166269d2e7152b93648a9e4152e6a18ff88a4fa Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Tue, 17 Jan 2023 16:56:53 -0700 Subject: [PATCH 10/14] IOSS: Remove some IOSS_MAYBE_UNUSED until can determine why failing --- .../seacas/libraries/ioss/src/Ioss_ParallelUtils.C | 10 +++++----- .../libraries/ioss/src/text_mesh/Iotm_TextMesh.h | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/seacas/libraries/ioss/src/Ioss_ParallelUtils.C b/packages/seacas/libraries/ioss/src/Ioss_ParallelUtils.C index 75ff1fb20e4f..08a92a7ac601 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_ParallelUtils.C +++ b/packages/seacas/libraries/ioss/src/Ioss_ParallelUtils.C @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2022 National Technology & Engineering Solutions +// Copyright(C) 1999-2023 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. // @@ -447,7 +447,7 @@ void ParallelUtils::broadcast(IOSS_MAYBE_UNUSED std::string &my_str, template -void Ioss::ParallelUtils::broadcast(IOSS_MAYBE_UNUSED T &my_value, IOSS_MAYBE_UNUSED int root) const +void Ioss::ParallelUtils::broadcast(T &my_value, int root) const { IOSS_PAR_UNUSED(my_value); IOSS_PAR_UNUSED(root); @@ -497,8 +497,8 @@ ParallelUtils::broadcast(IOSS_MAYBE_UNUSED std::vector> &my_ } // namespace Ioss template -void Ioss::ParallelUtils::broadcast(IOSS_MAYBE_UNUSED std::vector &my_value, - IOSS_MAYBE_UNUSED int root) const +void Ioss::ParallelUtils::broadcast(std::vector &my_value, + int root) const { IOSS_PAR_UNUSED(my_value); IOSS_PAR_UNUSED(root); @@ -654,7 +654,7 @@ template IOSS_EXPORT int Ioss::ParallelUtils::gather(int num_vals, int size_per_ std::vector &my_values, std::vector &result) const; template -int Ioss::ParallelUtils::gather(int num_vals, IOSS_MAYBE_UNUSED int size_per_val, +int Ioss::ParallelUtils::gather(int num_vals, int size_per_val, std::vector &my_values, std::vector &result) const { IOSS_PAR_UNUSED(size_per_val); diff --git a/packages/seacas/libraries/ioss/src/text_mesh/Iotm_TextMesh.h b/packages/seacas/libraries/ioss/src/text_mesh/Iotm_TextMesh.h index 964a9929580f..20b909da1a58 100644 --- a/packages/seacas/libraries/ioss/src/text_mesh/Iotm_TextMesh.h +++ b/packages/seacas/libraries/ioss/src/text_mesh/Iotm_TextMesh.h @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2022 National Technology & Engineering Solutions +// Copyright(C) 1999-2023 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. // @@ -56,9 +56,9 @@ namespace Iotm { class IOTM_EXPORT TextMesh { public: - explicit TextMesh(const std::string ¶meters, IOSS_MAYBE_UNUSED int proc_count = 1, + explicit TextMesh(const std::string ¶meters, int proc_count = 1, int my_proc = 0); - TextMesh(IOSS_MAYBE_UNUSED int proc_count = 1, int my_proc = 0); + TextMesh(int proc_count = 1, int my_proc = 0); TextMesh(); TextMesh(const TextMesh &) = delete; TextMesh &operator=(const TextMesh &) = delete; From 6cd32cbff44d51152f598e9ee5de6526c7061c96 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Tue, 17 Jan 2023 17:00:13 -0700 Subject: [PATCH 11/14] IOSS: Remove some IOSS_MAYBE_UNUSED until can determine why failing --- .../seacas/libraries/ioss/src/text_mesh/Iotm_TextMesh.C | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/seacas/libraries/ioss/src/text_mesh/Iotm_TextMesh.C b/packages/seacas/libraries/ioss/src/text_mesh/Iotm_TextMesh.C index a1e98da9d4e1..a43857e4220c 100644 --- a/packages/seacas/libraries/ioss/src/text_mesh/Iotm_TextMesh.C +++ b/packages/seacas/libraries/ioss/src/text_mesh/Iotm_TextMesh.C @@ -1,4 +1,4 @@ -// Copyright(C) 1999-2022 National Technology & Engineering Solutions +// Copyright(C) 1999-2023 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. // @@ -31,13 +31,13 @@ namespace Iotm { void error_handler(const std::ostringstream &message) { throw std::logic_error((message).str()); } - TextMesh::TextMesh(IOSS_MAYBE_UNUSED int proc_count, int my_proc) : m_myProcessor(my_proc) + TextMesh::TextMesh(int proc_count, int my_proc) : m_myProcessor(my_proc) { m_errorHandler = [](const std::ostringstream &errmsg) { error_handler(errmsg); }; initialize(); } - TextMesh::TextMesh(const std::string ¶meters, IOSS_MAYBE_UNUSED int proc_count, int my_proc) + TextMesh::TextMesh(const std::string ¶meters, int proc_count, int my_proc) : m_myProcessor(my_proc) { m_errorHandler = [](const std::ostringstream &errmsg) { error_handler(errmsg); }; From b12a9cab562e87e1f8a68e83322f045b1c58729f Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Tue, 17 Jan 2023 18:00:51 -0700 Subject: [PATCH 12/14] IOSS: Fix shadowed variable warnings --- .../libraries/ioss/src/exodus/Ioex_ParallelDatabaseIO.C | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/seacas/libraries/ioss/src/exodus/Ioex_ParallelDatabaseIO.C b/packages/seacas/libraries/ioss/src/exodus/Ioex_ParallelDatabaseIO.C index d58a05f4265e..21c4b107aa7a 100644 --- a/packages/seacas/libraries/ioss/src/exodus/Ioex_ParallelDatabaseIO.C +++ b/packages/seacas/libraries/ioss/src/exodus/Ioex_ParallelDatabaseIO.C @@ -5,7 +5,7 @@ // strange cases // // -// Copyright(C) 1999-2022 National Technology & Engineering Solutions +// Copyright(C) 1999-2023 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. // @@ -3869,7 +3869,7 @@ int64_t ParallelDatabaseIO::put_field_internal(const Ioss::ElementBlock *eb, int *comp32 = reinterpret_cast(component.data()); int index = comp; - for (size_t i = 0; i < my_element_count; i++) { + for (int64_t i = 0; i < my_element_count; i++) { comp32[i] = data32[index]; index += comp_count; } @@ -3879,16 +3879,13 @@ int64_t ParallelDatabaseIO::put_field_internal(const Ioss::ElementBlock *eb, int64_t *comp64 = reinterpret_cast(component.data()); int index = comp; - for (size_t i = 0; i < my_element_count; i++) { + for (int64_t i = 0; i < my_element_count; i++) { comp64[i] = data64[index]; index += comp_count; } } auto eb_offset = eb->get_offset(); // Offset of beginning of the element block elements for this block - auto proc_offset = eb->get_optional_property( - "_processor_offset", 0); // Offset of this processors elements within that block. - auto file_count = eb->get_optional_property("locally_owned_count", my_element_count); int index = -1 * (field.get_index() + comp); // Negative since specifying index, not id to exodus API. From e93ac6996fa854443e13856874ad4b366db93650 Mon Sep 17 00:00:00 2001 From: Samuel Browne Date: Wed, 18 Jan 2023 07:32:26 -0700 Subject: [PATCH 13/14] Fix shadowing warning User Support Ticket(s) or Story Referenced: N/A --- packages/tpetra/core/src/Tpetra_CrsGraph_def.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/tpetra/core/src/Tpetra_CrsGraph_def.hpp b/packages/tpetra/core/src/Tpetra_CrsGraph_def.hpp index 5d91883c092d..9a45a39776a7 100644 --- a/packages/tpetra/core/src/Tpetra_CrsGraph_def.hpp +++ b/packages/tpetra/core/src/Tpetra_CrsGraph_def.hpp @@ -2793,8 +2793,8 @@ namespace Tpetra { // FIXME get rid of the else-clause when the minimum CXX standard required is bumped to C++17 #ifdef KOKKOS_ENABLE_CXX17 if constexpr (same) { // size_t == row_offset_type - using execution_space = typename device_type::execution_space; - Kokkos::deep_copy (execution_space(), + using lexecution_space = typename device_type::execution_space; + Kokkos::deep_copy (lexecution_space(), ptr_rot, ptr_in); } From c0a9c549f3d9d9a1327a7c40f94a114745e828a8 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Wed, 18 Jan 2023 07:42:31 -0700 Subject: [PATCH 14/14] FMT: new version, nvidia fixes --- .../ioss/src/private_copy_fmt/fmt/chrono.h | 32 ++- .../ioss/src/private_copy_fmt/fmt/color.h | 6 +- .../ioss/src/private_copy_fmt/fmt/core.h | 86 +++--- .../src/private_copy_fmt/fmt/format-inl.h | 42 ++- .../ioss/src/private_copy_fmt/fmt/format.h | 257 ++++++++++++------ .../ioss/src/private_copy_fmt/fmt/locale.h | 2 - .../ioss/src/private_copy_fmt/fmt/os.h | 18 -- .../ioss/src/private_copy_fmt/fmt/ostream.h | 4 +- .../ioss/src/private_copy_fmt/fmt/ranges.h | 14 +- .../ioss/src/private_copy_fmt/fmt/std.h | 138 +++++++++- .../ioss/src/private_copy_fmt/fmt/xchar.h | 23 +- .../seacas/libraries/suplib_cpp/fmt/chrono.h | 32 ++- .../seacas/libraries/suplib_cpp/fmt/color.h | 6 +- .../seacas/libraries/suplib_cpp/fmt/core.h | 84 +++--- .../libraries/suplib_cpp/fmt/format-inl.h | 42 ++- .../seacas/libraries/suplib_cpp/fmt/format.h | 257 ++++++++++++------ packages/seacas/libraries/suplib_cpp/fmt/os.h | 18 -- .../seacas/libraries/suplib_cpp/fmt/ostream.h | 4 +- .../seacas/libraries/suplib_cpp/fmt/ranges.h | 14 +- .../seacas/libraries/suplib_cpp/fmt/std.h | 138 +++++++++- .../seacas/libraries/suplib_cpp/fmt/xchar.h | 23 +- 21 files changed, 919 insertions(+), 321 deletions(-) delete mode 100644 packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/locale.h diff --git a/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/chrono.h b/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/chrono.h index b112f76e991c..1a8d8d04c2aa 100644 --- a/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/chrono.h +++ b/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/chrono.h @@ -22,6 +22,15 @@ FMT_BEGIN_NAMESPACE +// Check if std::chrono::utc_timestamp is available. +#ifndef FMT_USE_UTC_TIME +# ifdef __cpp_lib_chrono +# define FMT_USE_UTC_TIME (__cpp_lib_chrono >= 201907L) +# else +# define FMT_USE_UTC_TIME 0 +# endif +#endif + // Enable tzset. #ifndef FMT_USE_TZSET // UWP doesn't provide _tzset. @@ -427,7 +436,7 @@ auto write(OutputIt out, const std::tm& time, const std::locale& loc, char format, char modifier = 0) -> OutputIt { auto&& buf = get_buffer(out); do_write(buf, time, loc, format, modifier); - return buf.out(); + return get_iterator(buf, out); } template ::value)> inline Int to_nonnegative_int(T value, Int upper) { FMT_ASSERT(std::is_unsigned::value || - (value >= 0 && to_unsigned(value) <= to_unsigned(upper)), + (value >= 0 && to_unsigned(value) <= to_unsigned(upper)), "invalid value"); (void)upper; return static_cast(value); @@ -2014,6 +2023,25 @@ struct formatter, } }; +#if FMT_USE_UTC_TIME +template +struct formatter, + Char> : formatter { + FMT_CONSTEXPR formatter() { + basic_string_view default_specs = + detail::string_literal{}; + this->do_parse(default_specs.begin(), default_specs.end()); + } + + template + auto format(std::chrono::time_point val, + FormatContext& ctx) const -> decltype(ctx.out()) { + return formatter::format( + localtime(std::chrono::utc_clock::to_sys(val)), ctx); + } +}; +#endif + template struct formatter { private: enum class spec { diff --git a/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/color.h b/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/color.h index 4c163277ef18..e9b880ad431c 100644 --- a/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/color.h +++ b/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/color.h @@ -425,14 +425,18 @@ FMT_CONSTEXPR ansi_color_escape make_emphasis(emphasis em) noexcept { template inline void fputs(const Char* chars, FILE* stream) { int result = std::fputs(chars, stream); +#if !__NVCC__ if (result < 0) FMT_THROW(system_error(errno, FMT_STRING("cannot write to file"))); +#endif } template <> inline void fputs(const wchar_t* chars, FILE* stream) { int result = std::fputws(chars, stream); +#if !__NVCC__ if (result < 0) FMT_THROW(system_error(errno, FMT_STRING("cannot write to file"))); +#endif } template inline void reset_color(FILE* stream) { @@ -566,7 +570,7 @@ OutputIt vformat_to( basic_format_args>> args) { auto&& buf = detail::get_buffer(out); detail::vformat_to(buf, ts, format_str, args); - return detail::get_iterator(buf); + return detail::get_iterator(buf, out); } /** diff --git a/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/core.h b/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/core.h index c6bb12ed2b81..af61b22c44ec 100644 --- a/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/core.h +++ b/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/core.h @@ -16,12 +16,10 @@ #include #include -#ifndef FMT_HEADER_ONLY -#define FMT_HEADER_ONLY -#endif - // The fmt library version in the form major * 10000 + minor * 100 + patch. -#define FMT_VERSION 90100 +#define FMT_VERSION 90101 + +#define FMT_HEADER_ONLY #if defined(__clang__) && !defined(__ibmxl__) # define FMT_CLANG_VERSION (__clang_major__ * 100 + __clang_minor__) @@ -73,9 +71,7 @@ # define FMT_HAS_FEATURE(x) 0 #endif -#if (defined(__has_include) || FMT_ICC_VERSION >= 1600 || \ - FMT_MSC_VERSION > 1900) && \ - !defined(__INTELLISENSE__) +#if defined(__has_include) || FMT_ICC_VERSION >= 1600 || FMT_MSC_VERSION > 1900 # define FMT_HAS_INCLUDE(x) __has_include(x) #else # define FMT_HAS_INCLUDE(x) 0 @@ -281,7 +277,7 @@ # if defined(__cpp_nontype_template_args) && \ ((FMT_GCC_VERSION >= 903 && FMT_CPLUSPLUS >= 201709L) || \ __cpp_nontype_template_args >= 201911L) && \ - !defined(__NVCOMPILER) + !defined(__NVCOMPILER) && !defined(__LCC__) # define FMT_USE_NONTYPE_TEMPLATE_ARGS 1 # else # define FMT_USE_NONTYPE_TEMPLATE_ARGS 0 @@ -290,7 +286,7 @@ // Enable minimal optimizations for more compact code in debug mode. FMT_GCC_PRAGMA("GCC push_options") -#if !defined(__OPTIMIZE__) && !defined(__NVCOMPILER) +#if !defined(__OPTIMIZE__) && !defined(__NVCOMPILER) && !defined(__LCC__) FMT_GCC_PRAGMA("GCC optimize(\"Og\")") #endif @@ -336,7 +332,7 @@ struct monostate { #ifdef FMT_DOC # define FMT_ENABLE_IF(...) #else -# define FMT_ENABLE_IF(...) enable_if_t<(__VA_ARGS__), int> = 0 +# define FMT_ENABLE_IF(...) fmt::enable_if_t<(__VA_ARGS__), int> = 0 #endif FMT_BEGIN_DETAIL_NAMESPACE @@ -410,7 +406,6 @@ template auto convert_for_visit(T) -> monostate { return {}; } template FMT_CONSTEXPR auto to_unsigned(Int value) -> typename std::make_unsigned::type { - FMT_ASSERT(std::is_unsigned::value || value >= 0, "negative value"); return static_cast::type>(value); } @@ -490,6 +485,18 @@ template class basic_string_view { size_ -= n; } + FMT_CONSTEXPR_CHAR_TRAITS bool starts_with( + basic_string_view sv) const noexcept { + return size_ >= sv.size_ && + std::char_traits::compare(data_, sv.data_, sv.size_) == 0; + } + FMT_CONSTEXPR_CHAR_TRAITS bool starts_with(Char c) const noexcept { + return size_ >= 1 && std::char_traits::eq(*data_, c); + } + FMT_CONSTEXPR_CHAR_TRAITS bool starts_with(const Char* s) const { + return starts_with(basic_string_view(s)); + } + // Lexicographically compare this string reference to other. FMT_CONSTEXPR_CHAR_TRAITS auto compare(basic_string_view other) const -> int { size_t str_size = size_ < other.size_ ? size_ : other.size_; @@ -759,8 +766,11 @@ class compile_parse_context using base::check_arg_id; FMT_CONSTEXPR void check_dynamic_spec(int arg_id) { + detail::ignore_unused(arg_id); +#if !defined(__LCC__) if (arg_id < num_args_ && types_ && !is_integral_type(types_[arg_id])) this->on_error("width/precision is not integer"); +#endif } }; FMT_END_DETAIL_NAMESPACE @@ -896,11 +906,11 @@ template class buffer { buffer(const buffer&) = delete; void operator=(const buffer&) = delete; - auto begin() noexcept -> T* { return ptr_; } - auto end() noexcept -> T* { return ptr_ + size_; } + FMT_INLINE auto begin() noexcept -> T* { return ptr_; } + FMT_INLINE auto end() noexcept -> T* { return ptr_ + size_; } - auto begin() const noexcept -> const T* { return ptr_; } - auto end() const noexcept -> const T* { return ptr_ + size_; } + FMT_INLINE auto begin() const noexcept -> const T* { return ptr_; } + FMT_INLINE auto end() const noexcept -> const T* { return ptr_ + size_; } /** Returns the size of this buffer. */ constexpr auto size() const noexcept -> size_t { return size_; } @@ -1114,13 +1124,19 @@ template auto get_buffer(OutputIt out) -> iterator_buffer { return iterator_buffer(out); } +template , Buf>::value)> +auto get_buffer(std::back_insert_iterator out) -> buffer& { + return get_container(out); +} -template -auto get_iterator(Buffer& buf) -> decltype(buf.out()) { +template +FMT_INLINE auto get_iterator(Buf& buf, OutputIt) -> decltype(buf.out()) { return buf.out(); } -template auto get_iterator(buffer& buf) -> buffer_appender { - return buffer_appender(buf); +template +auto get_iterator(buffer&, OutputIt out) -> OutputIt { + return out; } template @@ -1471,7 +1487,7 @@ template struct arg_mapper { std::is_enum::value&& std::is_convertible::value && !has_format_as::value && !has_formatter::value && !has_fallback_formatter::value)> - FMT_DEPRECATED FMT_CONSTEXPR FMT_INLINE auto map(const T& val) + FMT_CONSTEXPR FMT_INLINE auto map(const T& val) -> decltype(std::declval().map( static_cast>(val))) { return map(static_cast>(val)); @@ -1547,11 +1563,6 @@ FMT_END_DETAIL_NAMESPACE class appender : public std::back_insert_iterator> { using base = std::back_insert_iterator>; - template - friend auto get_buffer(appender out) -> detail::buffer& { - return detail::get_container(out); - } - public: using std::back_insert_iterator>::back_insert_iterator; appender(base it) noexcept : base(it) {} @@ -1623,6 +1634,9 @@ template class basic_format_arg { ``vis(value)`` will be called with the value of type ``double``. \endrst */ +#if FMT_ICC_VERSION != 0 +#pragma warning(disable : 1595) +#endif template FMT_CONSTEXPR FMT_INLINE auto visit_format_arg( Visitor&& vis, const basic_format_arg& arg) -> decltype(vis(0)) { @@ -1716,7 +1730,7 @@ class locale_ref { const void* locale_; // A type-erased pointer to std::locale. public: - constexpr locale_ref() : locale_(nullptr) {} + constexpr FMT_INLINE locale_ref() : locale_(nullptr) {} template explicit locale_ref(const Locale& loc); explicit operator bool() const noexcept { return locale_ != nullptr; } @@ -2386,6 +2400,7 @@ FMT_CONSTEXPR auto parse_align(const Char* begin, const Char* end, auto c = *begin; if (c == '{') return handler.on_error("invalid fill character '{'"), begin; + if (c == '}') return begin; handler.on_fill(basic_string_view(begin, to_unsigned(p - begin))); begin = p + 1; } else @@ -3013,11 +3028,11 @@ void check_format_string(S format_str) { ignore_unused(invalid_format); } +// Don't use type_identity for args to simplify symbols. template -void vformat_to( - buffer& buf, basic_string_view fmt, - basic_format_args)> args, - locale_ref loc = {}); +void vformat_to(buffer& buf, basic_string_view fmt, + basic_format_args args, + locale_ref loc = {}); FMT_API void vprint_mojibake(std::FILE*, string_view, format_args); #ifndef _WIN32 @@ -3169,6 +3184,7 @@ template class basic_format_string { basic_format_string(basic_runtime r) : str_(r.str) {} FMT_INLINE operator basic_string_view() const { return str_; } + FMT_INLINE basic_string_view get() const { return str_; } }; #if FMT_GCC_VERSION && FMT_GCC_VERSION < 409 @@ -3214,10 +3230,9 @@ FMT_NODISCARD FMT_INLINE auto format(format_string fmt, T&&... args) template ::value)> auto vformat_to(OutputIt out, string_view fmt, format_args args) -> OutputIt { - using detail::get_buffer; - auto&& buf = get_buffer(out); + auto&& buf = detail::get_buffer(out); detail::vformat_to(buf, fmt, args, {}); - return detail::get_iterator(buf); + return detail::get_iterator(buf, out); } /** @@ -3276,7 +3291,8 @@ template FMT_NODISCARD FMT_INLINE auto formatted_size(format_string fmt, T&&... args) -> size_t { auto buf = detail::counting_buffer<>(); - detail::vformat_to(buf, string_view(fmt), fmt::make_format_args(args...), {}); + detail::vformat_to(buf, string_view(fmt), + format_args(fmt::make_format_args(args...)), {}); return buf.count(); } diff --git a/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/format-inl.h b/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/format-inl.h index 22b1ec8df0eb..9ac55e47f22f 100644 --- a/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/format-inl.h +++ b/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/format-inl.h @@ -80,8 +80,10 @@ FMT_FUNC void report_error(format_func func, int error_code, inline void fwrite_fully(const void* ptr, size_t size, size_t count, FILE* stream) { size_t written = std::fwrite(ptr, size, count, stream); +#if !__NVCC__ if (written < count) FMT_THROW(system_error(errno, FMT_STRING("cannot write to file"))); +#endif } #ifndef FMT_STATIC_THOUSANDS_SEPARATOR @@ -115,17 +117,50 @@ template FMT_FUNC Char decimal_point_impl(locale_ref) { return '.'; } #endif + +FMT_FUNC auto write_loc(appender out, loc_value value, + const format_specs& specs, locale_ref loc) -> bool { +#ifndef FMT_STATIC_THOUSANDS_SEPARATOR + auto locale = loc.get(); + // We cannot use the num_put facet because it may produce output in + // a wrong encoding. + using facet = format_facet; + if (std::has_facet(locale)) + return std::use_facet(locale).put(out, value, specs); + return facet(locale).put(out, value, specs); +#endif + return false; +} } // namespace detail +template typename Locale::id format_facet::id; + +#ifndef FMT_STATIC_THOUSANDS_SEPARATOR +template format_facet::format_facet(Locale& loc) { + auto& numpunct = std::use_facet>(loc); + grouping_ = numpunct.grouping(); + if (!grouping_.empty()) separator_ = std::string(1, numpunct.thousands_sep()); +} + +template <> +FMT_API FMT_FUNC auto format_facet::do_put( + appender out, loc_value val, const format_specs& specs) const -> bool { + return val.visit( + detail::loc_writer<>{out, specs, separator_, grouping_, decimal_point_}); +} +#endif + #if !FMT_MSC_VERSION FMT_API FMT_FUNC format_error::~format_error() noexcept = default; #endif +#if !__NVCC__ FMT_FUNC std::system_error vsystem_error(int error_code, string_view format_str, format_args args) { auto ec = std::error_code(error_code, std::generic_category()); return std::system_error(ec, vformat(format_str, args)); } +#endif namespace detail { @@ -1413,9 +1448,8 @@ template <> struct formatter { return ctx.begin(); } - template - auto format(const detail::bigint& n, FormatContext& ctx) const -> - typename FormatContext::iterator { + auto format(const detail::bigint& n, format_context& ctx) const + -> format_context::iterator { auto out = ctx.out(); bool first = true; for (auto i = n.bigits_.size(); i > 0; --i) { @@ -1451,12 +1485,14 @@ FMT_FUNC detail::utf8_to_utf16::utf8_to_utf16(string_view s) { FMT_FUNC void format_system_error(detail::buffer& out, int error_code, const char* message) noexcept { +#if !__NVCC__ FMT_TRY { auto ec = std::error_code(error_code, std::generic_category()); write(std::back_inserter(out), std::system_error(ec, message).what()); return; } FMT_CATCH(...) {} +#endif format_error_code(out, error_code, message); } diff --git a/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/format.h b/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/format.h index 99d11bbcdcf9..8dda88727d5c 100644 --- a/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/format.h +++ b/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/format.h @@ -33,13 +33,14 @@ #ifndef FMT_FORMAT_H_ #define FMT_FORMAT_H_ -#include // std::signbit -#include // uint32_t -#include // std::memcpy -#include // std::numeric_limits -#include // std::uninitialized_copy -#include // std::runtime_error -#include // std::system_error +#include // std::signbit +#include // uint32_t +#include // std::memcpy +#include // std::initializer_list +#include // std::numeric_limits +#include // std::uninitialized_copy +#include // std::runtime_error +#include // std::system_error #ifdef __cpp_lib_bit_cast # include // std::bitcast @@ -706,6 +707,7 @@ FMT_CONSTEXPR inline size_t compute_width(string_view s) { return true; } }; + // We could avoid branches by using utf8_decode directly. for_each_codepoint(s, count_code_points{&num_code_points}); return num_code_points; } @@ -737,6 +739,21 @@ inline auto code_point_index(basic_string_view s, size_t n) string_view(reinterpret_cast(s.data()), s.size()), n); } +template struct is_integral : std::is_integral {}; +template <> struct is_integral : std::true_type {}; +template <> struct is_integral : std::true_type {}; + +template +using is_signed = + std::integral_constant::is_signed || + std::is_same::value>; + +template +using is_integer = + bool_constant::value && !std::is_same::value && + !std::is_same::value && + !std::is_same::value>; + #ifndef FMT_USE_FLOAT128 # ifdef __SIZEOF_FLOAT128__ # define FMT_USE_FLOAT128 1 @@ -944,13 +961,11 @@ FMT_API bool write_console(std::FILE* f, string_view text); FMT_API void print(std::FILE*, string_view); } // namespace detail -/** A formatting error such as invalid format string. */ +/** An error reported from a formatting function. */ FMT_CLASS_API class FMT_API format_error : public std::runtime_error { public: - explicit format_error(const char* message) : std::runtime_error(message) {} - explicit format_error(const std::string& message) - : std::runtime_error(message) {} + using std::runtime_error::runtime_error; format_error(const format_error&) = default; format_error& operator=(const format_error&) = default; format_error(format_error&&) = default; @@ -984,16 +999,52 @@ constexpr auto compile_string_to_view(detail::std_string_view s) } } // namespace detail_exported -FMT_BEGIN_DETAIL_NAMESPACE +class loc_value { + private: + basic_format_arg value_; -template struct is_integral : std::is_integral {}; -template <> struct is_integral : std::true_type {}; -template <> struct is_integral : std::true_type {}; + public: + template ::value)> + loc_value(T value) : value_(detail::make_arg(value)) {} -template -using is_signed = - std::integral_constant::is_signed || - std::is_same::value>; + template ::value)> + loc_value(T) {} + + template auto visit(Visitor&& vis) -> decltype(vis(0)) { + return visit_format_arg(vis, value_); + } +}; + +// A locale facet that formats values in UTF-8. +// It is parameterized on the locale to avoid the heavy include. +template class format_facet : public Locale::facet { + private: + std::string separator_; + std::string grouping_; + std::string decimal_point_; + + protected: + virtual auto do_put(appender out, loc_value val, + const format_specs& specs) const -> bool; + + public: + static FMT_API typename Locale::id id; + + explicit format_facet(Locale& loc); + explicit format_facet(string_view sep = "", + std::initializer_list g = {3}, + std::string decimal_point = ".") + : separator_(sep.data(), sep.size()), + grouping_(g.begin(), g.end()), + decimal_point_(decimal_point) {} + + auto put(appender out, loc_value val, const format_specs& specs) const + -> bool { + return do_put(out, val, specs); + } +}; + +FMT_BEGIN_DETAIL_NAMESPACE // Returns true if value is negative, false otherwise. // Same as `value < 0` but doesn't produce warnings if T is an unsigned type. @@ -1235,10 +1286,10 @@ FMT_CONSTEXPR20 auto format_decimal(Char* out, UInt value, int size) template >::value)> -inline auto format_decimal(Iterator out, UInt value, int size) +FMT_CONSTEXPR inline auto format_decimal(Iterator out, UInt value, int size) -> format_decimal_result { // Buffer is large enough to hold all digits (digits10 + 1). - Char buffer[digits10() + 1]; + Char buffer[digits10() + 1] = {}; auto end = format_decimal(buffer, value, size).end; return {out, detail::copy_str_noinline(buffer, end, out)}; } @@ -1625,7 +1676,9 @@ auto snprintf_float(T value, int precision, float_specs specs, template using convert_float_result = - conditional_t::value || sizeof(T) == sizeof(double), + conditional_t::value || + std::numeric_limits::digits == + std::numeric_limits::digits, double, T>; template @@ -1930,19 +1983,19 @@ FMT_CONSTEXPR FMT_INLINE auto write_int(OutputIt out, int num_digits, template class digit_grouping { private: - thousands_sep_result sep_; + std::string grouping_; + std::basic_string thousands_sep_; struct next_state { std::string::const_iterator group; int pos; }; - next_state initial_state() const { return {sep_.grouping.begin(), 0}; } + next_state initial_state() const { return {grouping_.begin(), 0}; } // Returns the next digit group separator position. int next(next_state& state) const { - if (!sep_.thousands_sep) return max_value(); - if (state.group == sep_.grouping.end()) - return state.pos += sep_.grouping.back(); + if (thousands_sep_.empty()) return max_value(); + if (state.group == grouping_.end()) return state.pos += grouping_.back(); if (*state.group <= 0 || *state.group == max_value()) return max_value(); state.pos += *state.group++; @@ -1951,14 +2004,15 @@ template class digit_grouping { public: explicit digit_grouping(locale_ref loc, bool localized = true) { - if (localized) - sep_ = thousands_sep(loc); - else - sep_.thousands_sep = Char(); + if (!localized) return; + auto sep = thousands_sep(loc); + grouping_ = sep.grouping; + if (sep.thousands_sep) thousands_sep_.assign(1, sep.thousands_sep); } - explicit digit_grouping(thousands_sep_result sep) : sep_(sep) {} + digit_grouping(std::string grouping, std::basic_string sep) + : grouping_(std::move(grouping)), thousands_sep_(std::move(sep)) {} - Char separator() const { return sep_.thousands_sep; } + bool has_separator() const { return !thousands_sep_.empty(); } int count_separators(int num_digits) const { int count = 0; @@ -1981,7 +2035,9 @@ template class digit_grouping { for (int i = 0, sep_index = static_cast(separators.size() - 1); i < num_digits; ++i) { if (num_digits - i == separators[sep_index]) { - *out++ = separator(); + out = + copy_str(thousands_sep_.data(), + thousands_sep_.data() + thousands_sep_.size(), out); --sep_index; } *out++ = static_cast(digits[to_unsigned(i)]); @@ -1990,10 +2046,11 @@ template class digit_grouping { } }; +// Writes a decimal integer with digit grouping. template -auto write_int_localized(OutputIt out, UInt value, unsigned prefix, - const basic_format_specs& specs, - const digit_grouping& grouping) -> OutputIt { +auto write_int(OutputIt out, UInt value, unsigned prefix, + const basic_format_specs& specs, + const digit_grouping& grouping) -> OutputIt { static_assert(std::is_same, UInt>::value, ""); int num_digits = count_digits(value); char digits[40]; @@ -2010,13 +2067,13 @@ auto write_int_localized(OutputIt out, UInt value, unsigned prefix, }); } -template -auto write_int_localized(OutputIt& out, UInt value, unsigned prefix, - const basic_format_specs& specs, locale_ref loc) - -> bool { - auto grouping = digit_grouping(loc); - out = write_int_localized(out, value, prefix, specs, grouping); - return true; +// Writes a localized value. +FMT_API auto write_loc(appender out, loc_value value, const format_specs& specs, + locale_ref loc) -> bool; +template +inline auto write_loc(OutputIt, loc_value, const basic_format_specs&, + locale_ref) -> bool { + return false; } FMT_CONSTEXPR inline void prefix_append(unsigned& prefix, unsigned value) { @@ -2045,21 +2102,39 @@ FMT_CONSTEXPR auto make_write_int_arg(T value, sign_t sign) return {abs_value, prefix}; } +template struct loc_writer { + buffer_appender out; + const basic_format_specs& specs; + std::basic_string sep; + std::string grouping; + std::basic_string decimal_point; + + template ::value)> + auto operator()(T value) -> bool { + auto arg = make_write_int_arg(value, specs.sign); + write_int(out, static_cast>(arg.abs_value), arg.prefix, + specs, digit_grouping(grouping, sep)); + return true; + } + + template ::value)> + auto operator()(T) -> bool { + return false; + } + + auto operator()(...) -> bool { return false; } +}; + template FMT_CONSTEXPR FMT_INLINE auto write_int(OutputIt out, write_int_arg arg, const basic_format_specs& specs, - locale_ref loc) -> OutputIt { + locale_ref) -> OutputIt { static_assert(std::is_same>::value, ""); auto abs_value = arg.abs_value; auto prefix = arg.prefix; switch (specs.type) { case presentation_type::none: case presentation_type::dec: { - if (specs.localized && - write_int_localized(out, static_cast>(abs_value), - prefix, specs, loc)) { - return out; - } auto num_digits = count_digits(abs_value); return write_int( out, num_digits, prefix, specs, [=](reserve_iterator it) { @@ -2119,6 +2194,7 @@ template & specs, locale_ref loc) -> OutputIt { + if (specs.localized && write_loc(out, value, specs, loc)) return out; return write_int_noinline(out, make_write_int_arg(value, specs.sign), specs, loc); } @@ -2130,6 +2206,7 @@ template & specs, locale_ref loc) -> OutputIt { + if (specs.localized && write_loc(out, value, specs, loc)) return out; return write_int(out, make_write_int_arg(value, specs.sign), specs, loc); } @@ -2281,7 +2358,7 @@ template FMT_CONSTEXPR20 auto write_significand(OutputIt out, T significand, int significand_size, int exponent, const Grouping& grouping) -> OutputIt { - if (!grouping.separator()) { + if (!grouping.has_separator()) { out = write_significand(out, significand, significand_size); return detail::fill_n(out, exponent, static_cast('0')); } @@ -2343,7 +2420,7 @@ FMT_CONSTEXPR20 auto write_significand(OutputIt out, T significand, int significand_size, int integral_size, Char decimal_point, const Grouping& grouping) -> OutputIt { - if (!grouping.separator()) { + if (!grouping.has_separator()) { return write_significand(out, significand, significand_size, integral_size, decimal_point); } @@ -2466,7 +2543,7 @@ template class fallback_digit_grouping { public: constexpr fallback_digit_grouping(locale_ref, bool) {} - constexpr Char separator() const { return Char(); } + constexpr bool has_separator() const { return false; } constexpr int count_separators(int) const { return 0; } @@ -2506,14 +2583,14 @@ template ::value&& FMT_CONSTEXPR20 bool isfinite(T value) { constexpr T inf = T(std::numeric_limits::infinity()); if (is_constant_evaluated()) - return !detail::isnan(value) && value != inf && value != -inf; + return !detail::isnan(value) && value < inf && value > -inf; return std::isfinite(value); } template ::value)> FMT_CONSTEXPR bool isfinite(T value) { T inf = T(std::numeric_limits::infinity()); // std::isfinite doesn't support __float128. - return !detail::isnan(value) && value != inf && value != -inf; + return !detail::isnan(value) && value < inf && value > -inf; } template ::value)> @@ -3181,13 +3258,10 @@ FMT_CONSTEXPR20 auto format_float(Float value, int precision, float_specs specs, } return exp; } - -template ::value)> -FMT_CONSTEXPR20 auto write(OutputIt out, T value, - basic_format_specs specs, locale_ref loc = {}) +template +FMT_CONSTEXPR20 auto write_float(OutputIt out, T value, + basic_format_specs specs, locale_ref loc) -> OutputIt { - if (const_check(!is_supported_floating_point(value))) return out; float_specs fspecs = parse_float_type_spec(specs); fspecs.sign = specs.sign; if (detail::signbit(value)) { // value < 0 is false for NaN so use signbit. @@ -3233,6 +3307,17 @@ FMT_CONSTEXPR20 auto write(OutputIt out, T value, return write_float(out, f, specs, fspecs, loc); } +template ::value)> +FMT_CONSTEXPR20 auto write(OutputIt out, T value, + basic_format_specs specs, locale_ref loc = {}) + -> OutputIt { + if (const_check(!is_supported_floating_point(value))) return out; + return specs.localized && write_loc(out, value, specs, loc) + ? out + : write_float(out, value, specs, loc); +} + template ::value)> FMT_CONSTEXPR20 auto write(OutputIt out, T value) -> OutputIt { @@ -3341,8 +3426,8 @@ template enable_if_t< std::is_class::value && !is_string::value && !is_floating_point::value && !std::is_same::value && - !std::is_same().map(value))>::value, + !std::is_same().map( + value))>>::value, OutputIt> { return write(out, arg_mapper().map(value)); } @@ -3411,12 +3496,6 @@ template struct custom_formatter { template void operator()(T) const {} }; -template -using is_integer = - bool_constant::value && !std::is_same::value && - !std::is_same::value && - !std::is_same::value>; - template class width_checker { public: explicit FMT_CONSTEXPR width_checker(ErrorHandler& eh) : handler_(eh) {} @@ -3598,9 +3677,10 @@ FMT_API void report_error(format_func func, int error_code, const char* message) noexcept; FMT_END_DETAIL_NAMESPACE +#if !__NVCC__ FMT_API auto vsystem_error(int error_code, string_view format_str, format_args args) -> std::system_error; - +#endif /** \rst Constructs :class:`std::system_error` with a message formatted with @@ -3618,12 +3698,13 @@ FMT_API auto vsystem_error(int error_code, string_view format_str, throw fmt::system_error(errno, "cannot open file '{}'", filename); \endrst */ +#if !__NVCC__ template auto system_error(int error_code, format_string fmt, T&&... args) -> std::system_error { return vsystem_error(error_code, fmt, fmt::make_format_args(args...)); } - +#endif /** \rst Formats an error message for an error returned by an operating system or a @@ -3912,9 +3993,9 @@ template struct formatter> : formatter { specs_.width_ref, ctx); detail::handle_dynamic_spec( specs_.precision, specs_.precision_ref, ctx); - return detail::write_int_localized( + return detail::write_int( ctx.out(), static_cast>(t.value), 0, specs_, - detail::digit_grouping({"\3", ','})); + detail::digit_grouping("\3", ",")); } }; @@ -4027,9 +4108,9 @@ auto join(Range&& range, string_view sep) */ template ::value)> inline auto to_string(const T& value) -> std::string { - auto result = std::string(); - detail::write(std::back_inserter(result), value); - return result; + auto buffer = memory_buffer(); + detail::write(appender(buffer), value); + return {buffer.data(), buffer.size()}; } template ::value)> @@ -4053,10 +4134,9 @@ FMT_NODISCARD auto to_string(const basic_memory_buffer& buf) FMT_BEGIN_DETAIL_NAMESPACE template -void vformat_to( - buffer& buf, basic_string_view fmt, - basic_format_args)> args, - locale_ref loc) { +void vformat_to(buffer& buf, basic_string_view fmt, + basic_format_args args, + locale_ref loc) { // workaround for msvc bug regarding name-lookup in module // link names into function scope using detail::arg_formatter; @@ -4137,6 +4217,9 @@ void vformat_to( } #ifndef FMT_HEADER_ONLY +extern template FMT_API void vformat_to( + buffer&, string_view, basic_format_args, + locale_ref); extern template FMT_API auto thousands_sep_impl(locale_ref) -> thousands_sep_result; extern template FMT_API auto thousands_sep_impl(locale_ref) @@ -4193,7 +4276,7 @@ auto vformat_to(OutputIt out, const Locale& loc, string_view fmt, using detail::get_buffer; auto&& buf = get_buffer(out); detail::vformat_to(buf, fmt, args, detail::locale_ref(loc)); - return detail::get_iterator(buf); + return detail::get_iterator(buf, out); } template ::value)> +FMT_NODISCARD FMT_INLINE auto formatted_size(const Locale& loc, + format_string fmt, + T&&... args) -> size_t { + auto buf = detail::counting_buffer<>(); + detail::vformat_to(buf, string_view(fmt), + format_args(fmt::make_format_args(args...)), + detail::locale_ref(loc)); + return buf.count(); +} + FMT_MODULE_EXPORT_END FMT_END_NAMESPACE diff --git a/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/locale.h b/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/locale.h deleted file mode 100644 index 7571b5261ba7..000000000000 --- a/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/locale.h +++ /dev/null @@ -1,2 +0,0 @@ -#include "xchar.h" -#warning fmt/locale.h is deprecated, include fmt/format.h or fmt/xchar.h instead diff --git a/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/os.h b/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/os.h index d82be1125a4b..8e697ec4e6fa 100644 --- a/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/os.h +++ b/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/os.h @@ -120,24 +120,6 @@ template class basic_cstring_view { using cstring_view = basic_cstring_view; using wcstring_view = basic_cstring_view; -template struct formatter { - template - FMT_CONSTEXPR auto parse(ParseContext& ctx) -> decltype(ctx.begin()) { - return ctx.begin(); - } - - template - FMT_CONSTEXPR auto format(const std::error_code& ec, FormatContext& ctx) const - -> decltype(ctx.out()) { - auto out = ctx.out(); - out = detail::write_bytes(out, ec.category().name(), - basic_format_specs()); - out = detail::write(out, Char(':')); - out = detail::write(out, ec.value()); - return out; - } -}; - #ifdef _WIN32 FMT_API const std::error_category& system_category() noexcept; diff --git a/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/ostream.h b/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/ostream.h index c3cdd4a61b2c..86ec47e13ad7 100644 --- a/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/ostream.h +++ b/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/ostream.h @@ -84,8 +84,8 @@ inline bool write_ostream_unicode(std::ostream& os, fmt::string_view data) { #elif defined(_WIN32) && defined(__GLIBCXX__) auto* rdbuf = os.rdbuf(); FILE* c_file; - if (auto* fbuf = dynamic_cast<__gnu_cxx::stdio_sync_filebuf*>(rdbuf)) - c_file = fbuf->file(); + if (auto* sfbuf = dynamic_cast<__gnu_cxx::stdio_sync_filebuf*>(rdbuf)) + c_file = sfbuf->file(); else if (auto* fbuf = dynamic_cast<__gnu_cxx::stdio_filebuf*>(rdbuf)) c_file = fbuf->file(); else diff --git a/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/ranges.h b/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/ranges.h index dea7d60dd6bb..2105a668822c 100644 --- a/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/ranges.h +++ b/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/ranges.h @@ -211,16 +211,16 @@ class is_tuple_formattable_ { static constexpr const bool value = false; }; template class is_tuple_formattable_ { - template - static std::true_type check2(index_sequence, - integer_sequence); + template + static std::true_type check2(index_sequence, + integer_sequence); static std::false_type check2(...); - template + template static decltype(check2( - index_sequence{}, + index_sequence{}, integer_sequence< - bool, (is_formattable::type, - C>::value)...>{})) check(index_sequence); + bool, (is_formattable::type, + C>::value)...>{})) check(index_sequence); public: static constexpr const bool value = diff --git a/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/std.h b/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/std.h index 41d2b2838b6d..ec7abaa99f05 100644 --- a/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/std.h +++ b/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/std.h @@ -8,8 +8,12 @@ #ifndef FMT_STD_H_ #define FMT_STD_H_ +#include +#include +#include #include #include +#include #include #include "ostream.h" @@ -27,6 +31,16 @@ # endif #endif +// GCC 4 does not support FMT_HAS_INCLUDE. +#if FMT_HAS_INCLUDE() || defined(__GLIBCXX__) +# include +// Android NDK with gabi++ library on some archtectures does not implement +// abi::__cxa_demangle(). +# ifndef __GABIXX_CXXABI_H__ +# define FMT_HAS_ABI_CXA_DEMANGLE +# endif +#endif + #ifdef __cpp_lib_filesystem FMT_BEGIN_NAMESPACE @@ -100,19 +114,16 @@ template using variant_index_sequence = std::make_index_sequence::value>; -// variant_size and variant_alternative check. -template -struct is_variant_like_ : std::false_type {}; -template -struct is_variant_like_::value)>> - : std::true_type {}; +template struct is_variant_like_ : std::false_type {}; +template +struct is_variant_like_> : std::true_type {}; -// formattable element check +// formattable element check. template class is_variant_formattable_ { - template + template static std::conjunction< - is_formattable, C>...> - check(std::index_sequence); + is_formattable, C>...> + check(std::index_sequence); public: static constexpr const bool value = @@ -166,6 +177,113 @@ struct formatter< } }; FMT_END_NAMESPACE +#endif // __cpp_lib_variant + +FMT_BEGIN_NAMESPACE + +template struct formatter { + template + FMT_CONSTEXPR auto parse(ParseContext& ctx) -> decltype(ctx.begin()) { + return ctx.begin(); + } + + template + FMT_CONSTEXPR auto format(const std::error_code& ec, FormatContext& ctx) const + -> decltype(ctx.out()) { + auto out = ctx.out(); + out = detail::write_bytes(out, ec.category().name(), + basic_format_specs()); + out = detail::write(out, Char(':')); + out = detail::write(out, ec.value()); + return out; + } +}; + +template +struct formatter< + T, Char, + typename std::enable_if::value>::type> { + private: + bool with_typename_ = false; + + public: + FMT_CONSTEXPR auto parse(basic_format_parse_context& ctx) + -> decltype(ctx.begin()) { + auto it = ctx.begin(); + auto end = ctx.end(); + if (it == end || *it == '}') return it; + if (*it == 't') { + ++it; + with_typename_ = true; + } + return it; + } + + template + auto format(const std::exception& ex, + basic_format_context& ctx) const -> OutputIt { + basic_format_specs spec; + auto out = ctx.out(); + if (!with_typename_) + return detail::write_bytes(out, string_view(ex.what()), spec); + + const std::type_info& ti = typeid(ex); +#ifdef FMT_HAS_ABI_CXA_DEMANGLE + int status = 0; + std::size_t size = 0; + std::unique_ptr demangled_name_ptr( + abi::__cxa_demangle(ti.name(), nullptr, &size, &status), &std::free); + + string_view demangled_name_view; + if (demangled_name_ptr) { + demangled_name_view = demangled_name_ptr.get(); + + // Normalization of stdlib inline namespace names. + // libc++ inline namespaces. + // std::__1::* -> std::* + // std::__1::__fs::* -> std::* + // libstdc++ inline namespaces. + // std::__cxx11::* -> std::* + // std::filesystem::__cxx11::* -> std::filesystem::* + if (demangled_name_view.starts_with("std::")) { + char* begin = demangled_name_ptr.get(); + char* to = begin + 5; // std:: + for (char *from = to, *end = begin + demangled_name_view.size(); + from < end;) { + // This is safe, because demangled_name is NUL-terminated. + if (from[0] == '_' && from[1] == '_') { + char* next = from + 1; + while (next < end && *next != ':') next++; + if (next[0] == ':' && next[1] == ':') { + from = next + 2; + continue; + } + } + *to++ = *from++; + } + demangled_name_view = {begin, detail::to_unsigned(to - begin)}; + } + } else { + demangled_name_view = string_view(ti.name()); + } + out = detail::write_bytes(out, demangled_name_view, spec); +#elif FMT_MSC_VERSION + string_view demangled_name_view(ti.name()); + if (demangled_name_view.starts_with("class ")) + demangled_name_view.remove_prefix(6); + else if (demangled_name_view.starts_with("struct ")) + demangled_name_view.remove_prefix(7); + out = detail::write_bytes(out, demangled_name_view, spec); +#else + out = detail::write_bytes(out, string_view(ti.name()), spec); #endif + out = detail::write(out, Char(':')); + out = detail::write(out, Char(' ')); + out = detail::write_bytes(out, string_view(ex.what()), spec); + + return out; + } +}; +FMT_END_NAMESPACE #endif // FMT_STD_H_ diff --git a/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/xchar.h b/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/xchar.h index 3b5bc15ca0a1..40e699b64253 100644 --- a/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/xchar.h +++ b/packages/seacas/libraries/ioss/src/private_copy_fmt/fmt/xchar.h @@ -12,11 +12,30 @@ #include "format.h" +#ifndef FMT_STATIC_THOUSANDS_SEPARATOR +# include +#endif + FMT_BEGIN_NAMESPACE namespace detail { + template using is_exotic_char = bool_constant::value>; + +inline auto write_loc(std::back_insert_iterator> out, + loc_value value, const basic_format_specs& specs, + locale_ref loc) -> bool { +#ifndef FMT_STATIC_THOUSANDS_SEPARATOR + auto& numpunct = + std::use_facet>(loc.get()); + auto separator = std::wstring(); + auto grouping = numpunct.grouping(); + if (!grouping.empty()) separator = std::wstring(1, numpunct.thousands_sep()); + return value.visit(loc_writer{out, specs, separator, grouping, {}}); +#endif + return false; } +} // namespace detail FMT_MODULE_EXPORT_BEGIN @@ -126,7 +145,7 @@ auto vformat_to(OutputIt out, const S& format_str, -> OutputIt { auto&& buf = detail::get_buffer(out); detail::vformat_to(buf, detail::to_string_view(format_str), args); - return detail::get_iterator(buf); + return detail::get_iterator(buf, out); } template = 201907L) +# else +# define FMT_USE_UTC_TIME 0 +# endif +#endif + // Enable tzset. #ifndef FMT_USE_TZSET // UWP doesn't provide _tzset. @@ -427,7 +436,7 @@ auto write(OutputIt out, const std::tm& time, const std::locale& loc, char format, char modifier = 0) -> OutputIt { auto&& buf = get_buffer(out); do_write(buf, time, loc, format, modifier); - return buf.out(); + return get_iterator(buf, out); } template ::value)> inline Int to_nonnegative_int(T value, Int upper) { FMT_ASSERT(std::is_unsigned::value || - (value >= 0 && to_unsigned(value) <= to_unsigned(upper)), + (value >= 0 && to_unsigned(value) <= to_unsigned(upper)), "invalid value"); (void)upper; return static_cast(value); @@ -2014,6 +2023,25 @@ struct formatter, } }; +#if FMT_USE_UTC_TIME +template +struct formatter, + Char> : formatter { + FMT_CONSTEXPR formatter() { + basic_string_view default_specs = + detail::string_literal{}; + this->do_parse(default_specs.begin(), default_specs.end()); + } + + template + auto format(std::chrono::time_point val, + FormatContext& ctx) const -> decltype(ctx.out()) { + return formatter::format( + localtime(std::chrono::utc_clock::to_sys(val)), ctx); + } +}; +#endif + template struct formatter { private: enum class spec { diff --git a/packages/seacas/libraries/suplib_cpp/fmt/color.h b/packages/seacas/libraries/suplib_cpp/fmt/color.h index 4c163277ef18..e9b880ad431c 100644 --- a/packages/seacas/libraries/suplib_cpp/fmt/color.h +++ b/packages/seacas/libraries/suplib_cpp/fmt/color.h @@ -425,14 +425,18 @@ FMT_CONSTEXPR ansi_color_escape make_emphasis(emphasis em) noexcept { template inline void fputs(const Char* chars, FILE* stream) { int result = std::fputs(chars, stream); +#if !__NVCC__ if (result < 0) FMT_THROW(system_error(errno, FMT_STRING("cannot write to file"))); +#endif } template <> inline void fputs(const wchar_t* chars, FILE* stream) { int result = std::fputws(chars, stream); +#if !__NVCC__ if (result < 0) FMT_THROW(system_error(errno, FMT_STRING("cannot write to file"))); +#endif } template inline void reset_color(FILE* stream) { @@ -566,7 +570,7 @@ OutputIt vformat_to( basic_format_args>> args) { auto&& buf = detail::get_buffer(out); detail::vformat_to(buf, ts, format_str, args); - return detail::get_iterator(buf); + return detail::get_iterator(buf, out); } /** diff --git a/packages/seacas/libraries/suplib_cpp/fmt/core.h b/packages/seacas/libraries/suplib_cpp/fmt/core.h index f55accb4b598..af61b22c44ec 100644 --- a/packages/seacas/libraries/suplib_cpp/fmt/core.h +++ b/packages/seacas/libraries/suplib_cpp/fmt/core.h @@ -16,12 +16,10 @@ #include #include -#ifndef FMT_HEADER_ONLY -#define FMT_HEADER_ONLY -#endif - // The fmt library version in the form major * 10000 + minor * 100 + patch. -#define FMT_VERSION 90100 +#define FMT_VERSION 90101 + +#define FMT_HEADER_ONLY #if defined(__clang__) && !defined(__ibmxl__) # define FMT_CLANG_VERSION (__clang_major__ * 100 + __clang_minor__) @@ -73,9 +71,7 @@ # define FMT_HAS_FEATURE(x) 0 #endif -#if (defined(__has_include) || FMT_ICC_VERSION >= 1600 || \ - FMT_MSC_VERSION > 1900) && \ - !defined(__INTELLISENSE__) +#if defined(__has_include) || FMT_ICC_VERSION >= 1600 || FMT_MSC_VERSION > 1900 # define FMT_HAS_INCLUDE(x) __has_include(x) #else # define FMT_HAS_INCLUDE(x) 0 @@ -281,7 +277,7 @@ # if defined(__cpp_nontype_template_args) && \ ((FMT_GCC_VERSION >= 903 && FMT_CPLUSPLUS >= 201709L) || \ __cpp_nontype_template_args >= 201911L) && \ - !defined(__NVCOMPILER) + !defined(__NVCOMPILER) && !defined(__LCC__) # define FMT_USE_NONTYPE_TEMPLATE_ARGS 1 # else # define FMT_USE_NONTYPE_TEMPLATE_ARGS 0 @@ -290,7 +286,7 @@ // Enable minimal optimizations for more compact code in debug mode. FMT_GCC_PRAGMA("GCC push_options") -#if !defined(__OPTIMIZE__) && !defined(__NVCOMPILER) +#if !defined(__OPTIMIZE__) && !defined(__NVCOMPILER) && !defined(__LCC__) FMT_GCC_PRAGMA("GCC optimize(\"Og\")") #endif @@ -336,7 +332,7 @@ struct monostate { #ifdef FMT_DOC # define FMT_ENABLE_IF(...) #else -# define FMT_ENABLE_IF(...) enable_if_t<(__VA_ARGS__), int> = 0 +# define FMT_ENABLE_IF(...) fmt::enable_if_t<(__VA_ARGS__), int> = 0 #endif FMT_BEGIN_DETAIL_NAMESPACE @@ -410,7 +406,6 @@ template auto convert_for_visit(T) -> monostate { return {}; } template FMT_CONSTEXPR auto to_unsigned(Int value) -> typename std::make_unsigned::type { - FMT_ASSERT(std::is_unsigned::value || value >= 0, "negative value"); return static_cast::type>(value); } @@ -490,6 +485,18 @@ template class basic_string_view { size_ -= n; } + FMT_CONSTEXPR_CHAR_TRAITS bool starts_with( + basic_string_view sv) const noexcept { + return size_ >= sv.size_ && + std::char_traits::compare(data_, sv.data_, sv.size_) == 0; + } + FMT_CONSTEXPR_CHAR_TRAITS bool starts_with(Char c) const noexcept { + return size_ >= 1 && std::char_traits::eq(*data_, c); + } + FMT_CONSTEXPR_CHAR_TRAITS bool starts_with(const Char* s) const { + return starts_with(basic_string_view(s)); + } + // Lexicographically compare this string reference to other. FMT_CONSTEXPR_CHAR_TRAITS auto compare(basic_string_view other) const -> int { size_t str_size = size_ < other.size_ ? size_ : other.size_; @@ -759,8 +766,11 @@ class compile_parse_context using base::check_arg_id; FMT_CONSTEXPR void check_dynamic_spec(int arg_id) { + detail::ignore_unused(arg_id); +#if !defined(__LCC__) if (arg_id < num_args_ && types_ && !is_integral_type(types_[arg_id])) this->on_error("width/precision is not integer"); +#endif } }; FMT_END_DETAIL_NAMESPACE @@ -896,11 +906,11 @@ template class buffer { buffer(const buffer&) = delete; void operator=(const buffer&) = delete; - auto begin() noexcept -> T* { return ptr_; } - auto end() noexcept -> T* { return ptr_ + size_; } + FMT_INLINE auto begin() noexcept -> T* { return ptr_; } + FMT_INLINE auto end() noexcept -> T* { return ptr_ + size_; } - auto begin() const noexcept -> const T* { return ptr_; } - auto end() const noexcept -> const T* { return ptr_ + size_; } + FMT_INLINE auto begin() const noexcept -> const T* { return ptr_; } + FMT_INLINE auto end() const noexcept -> const T* { return ptr_ + size_; } /** Returns the size of this buffer. */ constexpr auto size() const noexcept -> size_t { return size_; } @@ -1114,13 +1124,19 @@ template auto get_buffer(OutputIt out) -> iterator_buffer { return iterator_buffer(out); } +template , Buf>::value)> +auto get_buffer(std::back_insert_iterator out) -> buffer& { + return get_container(out); +} -template -auto get_iterator(Buffer& buf) -> decltype(buf.out()) { +template +FMT_INLINE auto get_iterator(Buf& buf, OutputIt) -> decltype(buf.out()) { return buf.out(); } -template auto get_iterator(buffer& buf) -> buffer_appender { - return buffer_appender(buf); +template +auto get_iterator(buffer&, OutputIt out) -> OutputIt { + return out; } template @@ -1547,11 +1563,6 @@ FMT_END_DETAIL_NAMESPACE class appender : public std::back_insert_iterator> { using base = std::back_insert_iterator>; - template - friend auto get_buffer(appender out) -> detail::buffer& { - return detail::get_container(out); - } - public: using std::back_insert_iterator>::back_insert_iterator; appender(base it) noexcept : base(it) {} @@ -1623,6 +1634,9 @@ template class basic_format_arg { ``vis(value)`` will be called with the value of type ``double``. \endrst */ +#if FMT_ICC_VERSION != 0 +#pragma warning(disable : 1595) +#endif template FMT_CONSTEXPR FMT_INLINE auto visit_format_arg( Visitor&& vis, const basic_format_arg& arg) -> decltype(vis(0)) { @@ -1716,7 +1730,7 @@ class locale_ref { const void* locale_; // A type-erased pointer to std::locale. public: - constexpr locale_ref() : locale_(nullptr) {} + constexpr FMT_INLINE locale_ref() : locale_(nullptr) {} template explicit locale_ref(const Locale& loc); explicit operator bool() const noexcept { return locale_ != nullptr; } @@ -2386,6 +2400,7 @@ FMT_CONSTEXPR auto parse_align(const Char* begin, const Char* end, auto c = *begin; if (c == '{') return handler.on_error("invalid fill character '{'"), begin; + if (c == '}') return begin; handler.on_fill(basic_string_view(begin, to_unsigned(p - begin))); begin = p + 1; } else @@ -3013,11 +3028,11 @@ void check_format_string(S format_str) { ignore_unused(invalid_format); } +// Don't use type_identity for args to simplify symbols. template -void vformat_to( - buffer& buf, basic_string_view fmt, - basic_format_args)> args, - locale_ref loc = {}); +void vformat_to(buffer& buf, basic_string_view fmt, + basic_format_args args, + locale_ref loc = {}); FMT_API void vprint_mojibake(std::FILE*, string_view, format_args); #ifndef _WIN32 @@ -3169,6 +3184,7 @@ template class basic_format_string { basic_format_string(basic_runtime r) : str_(r.str) {} FMT_INLINE operator basic_string_view() const { return str_; } + FMT_INLINE basic_string_view get() const { return str_; } }; #if FMT_GCC_VERSION && FMT_GCC_VERSION < 409 @@ -3214,10 +3230,9 @@ FMT_NODISCARD FMT_INLINE auto format(format_string fmt, T&&... args) template ::value)> auto vformat_to(OutputIt out, string_view fmt, format_args args) -> OutputIt { - using detail::get_buffer; - auto&& buf = get_buffer(out); + auto&& buf = detail::get_buffer(out); detail::vformat_to(buf, fmt, args, {}); - return detail::get_iterator(buf); + return detail::get_iterator(buf, out); } /** @@ -3276,7 +3291,8 @@ template FMT_NODISCARD FMT_INLINE auto formatted_size(format_string fmt, T&&... args) -> size_t { auto buf = detail::counting_buffer<>(); - detail::vformat_to(buf, string_view(fmt), fmt::make_format_args(args...), {}); + detail::vformat_to(buf, string_view(fmt), + format_args(fmt::make_format_args(args...)), {}); return buf.count(); } diff --git a/packages/seacas/libraries/suplib_cpp/fmt/format-inl.h b/packages/seacas/libraries/suplib_cpp/fmt/format-inl.h index 22b1ec8df0eb..9ac55e47f22f 100644 --- a/packages/seacas/libraries/suplib_cpp/fmt/format-inl.h +++ b/packages/seacas/libraries/suplib_cpp/fmt/format-inl.h @@ -80,8 +80,10 @@ FMT_FUNC void report_error(format_func func, int error_code, inline void fwrite_fully(const void* ptr, size_t size, size_t count, FILE* stream) { size_t written = std::fwrite(ptr, size, count, stream); +#if !__NVCC__ if (written < count) FMT_THROW(system_error(errno, FMT_STRING("cannot write to file"))); +#endif } #ifndef FMT_STATIC_THOUSANDS_SEPARATOR @@ -115,17 +117,50 @@ template FMT_FUNC Char decimal_point_impl(locale_ref) { return '.'; } #endif + +FMT_FUNC auto write_loc(appender out, loc_value value, + const format_specs& specs, locale_ref loc) -> bool { +#ifndef FMT_STATIC_THOUSANDS_SEPARATOR + auto locale = loc.get(); + // We cannot use the num_put facet because it may produce output in + // a wrong encoding. + using facet = format_facet; + if (std::has_facet(locale)) + return std::use_facet(locale).put(out, value, specs); + return facet(locale).put(out, value, specs); +#endif + return false; +} } // namespace detail +template typename Locale::id format_facet::id; + +#ifndef FMT_STATIC_THOUSANDS_SEPARATOR +template format_facet::format_facet(Locale& loc) { + auto& numpunct = std::use_facet>(loc); + grouping_ = numpunct.grouping(); + if (!grouping_.empty()) separator_ = std::string(1, numpunct.thousands_sep()); +} + +template <> +FMT_API FMT_FUNC auto format_facet::do_put( + appender out, loc_value val, const format_specs& specs) const -> bool { + return val.visit( + detail::loc_writer<>{out, specs, separator_, grouping_, decimal_point_}); +} +#endif + #if !FMT_MSC_VERSION FMT_API FMT_FUNC format_error::~format_error() noexcept = default; #endif +#if !__NVCC__ FMT_FUNC std::system_error vsystem_error(int error_code, string_view format_str, format_args args) { auto ec = std::error_code(error_code, std::generic_category()); return std::system_error(ec, vformat(format_str, args)); } +#endif namespace detail { @@ -1413,9 +1448,8 @@ template <> struct formatter { return ctx.begin(); } - template - auto format(const detail::bigint& n, FormatContext& ctx) const -> - typename FormatContext::iterator { + auto format(const detail::bigint& n, format_context& ctx) const + -> format_context::iterator { auto out = ctx.out(); bool first = true; for (auto i = n.bigits_.size(); i > 0; --i) { @@ -1451,12 +1485,14 @@ FMT_FUNC detail::utf8_to_utf16::utf8_to_utf16(string_view s) { FMT_FUNC void format_system_error(detail::buffer& out, int error_code, const char* message) noexcept { +#if !__NVCC__ FMT_TRY { auto ec = std::error_code(error_code, std::generic_category()); write(std::back_inserter(out), std::system_error(ec, message).what()); return; } FMT_CATCH(...) {} +#endif format_error_code(out, error_code, message); } diff --git a/packages/seacas/libraries/suplib_cpp/fmt/format.h b/packages/seacas/libraries/suplib_cpp/fmt/format.h index 99d11bbcdcf9..8dda88727d5c 100644 --- a/packages/seacas/libraries/suplib_cpp/fmt/format.h +++ b/packages/seacas/libraries/suplib_cpp/fmt/format.h @@ -33,13 +33,14 @@ #ifndef FMT_FORMAT_H_ #define FMT_FORMAT_H_ -#include // std::signbit -#include // uint32_t -#include // std::memcpy -#include // std::numeric_limits -#include // std::uninitialized_copy -#include // std::runtime_error -#include // std::system_error +#include // std::signbit +#include // uint32_t +#include // std::memcpy +#include // std::initializer_list +#include // std::numeric_limits +#include // std::uninitialized_copy +#include // std::runtime_error +#include // std::system_error #ifdef __cpp_lib_bit_cast # include // std::bitcast @@ -706,6 +707,7 @@ FMT_CONSTEXPR inline size_t compute_width(string_view s) { return true; } }; + // We could avoid branches by using utf8_decode directly. for_each_codepoint(s, count_code_points{&num_code_points}); return num_code_points; } @@ -737,6 +739,21 @@ inline auto code_point_index(basic_string_view s, size_t n) string_view(reinterpret_cast(s.data()), s.size()), n); } +template struct is_integral : std::is_integral {}; +template <> struct is_integral : std::true_type {}; +template <> struct is_integral : std::true_type {}; + +template +using is_signed = + std::integral_constant::is_signed || + std::is_same::value>; + +template +using is_integer = + bool_constant::value && !std::is_same::value && + !std::is_same::value && + !std::is_same::value>; + #ifndef FMT_USE_FLOAT128 # ifdef __SIZEOF_FLOAT128__ # define FMT_USE_FLOAT128 1 @@ -944,13 +961,11 @@ FMT_API bool write_console(std::FILE* f, string_view text); FMT_API void print(std::FILE*, string_view); } // namespace detail -/** A formatting error such as invalid format string. */ +/** An error reported from a formatting function. */ FMT_CLASS_API class FMT_API format_error : public std::runtime_error { public: - explicit format_error(const char* message) : std::runtime_error(message) {} - explicit format_error(const std::string& message) - : std::runtime_error(message) {} + using std::runtime_error::runtime_error; format_error(const format_error&) = default; format_error& operator=(const format_error&) = default; format_error(format_error&&) = default; @@ -984,16 +999,52 @@ constexpr auto compile_string_to_view(detail::std_string_view s) } } // namespace detail_exported -FMT_BEGIN_DETAIL_NAMESPACE +class loc_value { + private: + basic_format_arg value_; -template struct is_integral : std::is_integral {}; -template <> struct is_integral : std::true_type {}; -template <> struct is_integral : std::true_type {}; + public: + template ::value)> + loc_value(T value) : value_(detail::make_arg(value)) {} -template -using is_signed = - std::integral_constant::is_signed || - std::is_same::value>; + template ::value)> + loc_value(T) {} + + template auto visit(Visitor&& vis) -> decltype(vis(0)) { + return visit_format_arg(vis, value_); + } +}; + +// A locale facet that formats values in UTF-8. +// It is parameterized on the locale to avoid the heavy include. +template class format_facet : public Locale::facet { + private: + std::string separator_; + std::string grouping_; + std::string decimal_point_; + + protected: + virtual auto do_put(appender out, loc_value val, + const format_specs& specs) const -> bool; + + public: + static FMT_API typename Locale::id id; + + explicit format_facet(Locale& loc); + explicit format_facet(string_view sep = "", + std::initializer_list g = {3}, + std::string decimal_point = ".") + : separator_(sep.data(), sep.size()), + grouping_(g.begin(), g.end()), + decimal_point_(decimal_point) {} + + auto put(appender out, loc_value val, const format_specs& specs) const + -> bool { + return do_put(out, val, specs); + } +}; + +FMT_BEGIN_DETAIL_NAMESPACE // Returns true if value is negative, false otherwise. // Same as `value < 0` but doesn't produce warnings if T is an unsigned type. @@ -1235,10 +1286,10 @@ FMT_CONSTEXPR20 auto format_decimal(Char* out, UInt value, int size) template >::value)> -inline auto format_decimal(Iterator out, UInt value, int size) +FMT_CONSTEXPR inline auto format_decimal(Iterator out, UInt value, int size) -> format_decimal_result { // Buffer is large enough to hold all digits (digits10 + 1). - Char buffer[digits10() + 1]; + Char buffer[digits10() + 1] = {}; auto end = format_decimal(buffer, value, size).end; return {out, detail::copy_str_noinline(buffer, end, out)}; } @@ -1625,7 +1676,9 @@ auto snprintf_float(T value, int precision, float_specs specs, template using convert_float_result = - conditional_t::value || sizeof(T) == sizeof(double), + conditional_t::value || + std::numeric_limits::digits == + std::numeric_limits::digits, double, T>; template @@ -1930,19 +1983,19 @@ FMT_CONSTEXPR FMT_INLINE auto write_int(OutputIt out, int num_digits, template class digit_grouping { private: - thousands_sep_result sep_; + std::string grouping_; + std::basic_string thousands_sep_; struct next_state { std::string::const_iterator group; int pos; }; - next_state initial_state() const { return {sep_.grouping.begin(), 0}; } + next_state initial_state() const { return {grouping_.begin(), 0}; } // Returns the next digit group separator position. int next(next_state& state) const { - if (!sep_.thousands_sep) return max_value(); - if (state.group == sep_.grouping.end()) - return state.pos += sep_.grouping.back(); + if (thousands_sep_.empty()) return max_value(); + if (state.group == grouping_.end()) return state.pos += grouping_.back(); if (*state.group <= 0 || *state.group == max_value()) return max_value(); state.pos += *state.group++; @@ -1951,14 +2004,15 @@ template class digit_grouping { public: explicit digit_grouping(locale_ref loc, bool localized = true) { - if (localized) - sep_ = thousands_sep(loc); - else - sep_.thousands_sep = Char(); + if (!localized) return; + auto sep = thousands_sep(loc); + grouping_ = sep.grouping; + if (sep.thousands_sep) thousands_sep_.assign(1, sep.thousands_sep); } - explicit digit_grouping(thousands_sep_result sep) : sep_(sep) {} + digit_grouping(std::string grouping, std::basic_string sep) + : grouping_(std::move(grouping)), thousands_sep_(std::move(sep)) {} - Char separator() const { return sep_.thousands_sep; } + bool has_separator() const { return !thousands_sep_.empty(); } int count_separators(int num_digits) const { int count = 0; @@ -1981,7 +2035,9 @@ template class digit_grouping { for (int i = 0, sep_index = static_cast(separators.size() - 1); i < num_digits; ++i) { if (num_digits - i == separators[sep_index]) { - *out++ = separator(); + out = + copy_str(thousands_sep_.data(), + thousands_sep_.data() + thousands_sep_.size(), out); --sep_index; } *out++ = static_cast(digits[to_unsigned(i)]); @@ -1990,10 +2046,11 @@ template class digit_grouping { } }; +// Writes a decimal integer with digit grouping. template -auto write_int_localized(OutputIt out, UInt value, unsigned prefix, - const basic_format_specs& specs, - const digit_grouping& grouping) -> OutputIt { +auto write_int(OutputIt out, UInt value, unsigned prefix, + const basic_format_specs& specs, + const digit_grouping& grouping) -> OutputIt { static_assert(std::is_same, UInt>::value, ""); int num_digits = count_digits(value); char digits[40]; @@ -2010,13 +2067,13 @@ auto write_int_localized(OutputIt out, UInt value, unsigned prefix, }); } -template -auto write_int_localized(OutputIt& out, UInt value, unsigned prefix, - const basic_format_specs& specs, locale_ref loc) - -> bool { - auto grouping = digit_grouping(loc); - out = write_int_localized(out, value, prefix, specs, grouping); - return true; +// Writes a localized value. +FMT_API auto write_loc(appender out, loc_value value, const format_specs& specs, + locale_ref loc) -> bool; +template +inline auto write_loc(OutputIt, loc_value, const basic_format_specs&, + locale_ref) -> bool { + return false; } FMT_CONSTEXPR inline void prefix_append(unsigned& prefix, unsigned value) { @@ -2045,21 +2102,39 @@ FMT_CONSTEXPR auto make_write_int_arg(T value, sign_t sign) return {abs_value, prefix}; } +template struct loc_writer { + buffer_appender out; + const basic_format_specs& specs; + std::basic_string sep; + std::string grouping; + std::basic_string decimal_point; + + template ::value)> + auto operator()(T value) -> bool { + auto arg = make_write_int_arg(value, specs.sign); + write_int(out, static_cast>(arg.abs_value), arg.prefix, + specs, digit_grouping(grouping, sep)); + return true; + } + + template ::value)> + auto operator()(T) -> bool { + return false; + } + + auto operator()(...) -> bool { return false; } +}; + template FMT_CONSTEXPR FMT_INLINE auto write_int(OutputIt out, write_int_arg arg, const basic_format_specs& specs, - locale_ref loc) -> OutputIt { + locale_ref) -> OutputIt { static_assert(std::is_same>::value, ""); auto abs_value = arg.abs_value; auto prefix = arg.prefix; switch (specs.type) { case presentation_type::none: case presentation_type::dec: { - if (specs.localized && - write_int_localized(out, static_cast>(abs_value), - prefix, specs, loc)) { - return out; - } auto num_digits = count_digits(abs_value); return write_int( out, num_digits, prefix, specs, [=](reserve_iterator it) { @@ -2119,6 +2194,7 @@ template & specs, locale_ref loc) -> OutputIt { + if (specs.localized && write_loc(out, value, specs, loc)) return out; return write_int_noinline(out, make_write_int_arg(value, specs.sign), specs, loc); } @@ -2130,6 +2206,7 @@ template & specs, locale_ref loc) -> OutputIt { + if (specs.localized && write_loc(out, value, specs, loc)) return out; return write_int(out, make_write_int_arg(value, specs.sign), specs, loc); } @@ -2281,7 +2358,7 @@ template FMT_CONSTEXPR20 auto write_significand(OutputIt out, T significand, int significand_size, int exponent, const Grouping& grouping) -> OutputIt { - if (!grouping.separator()) { + if (!grouping.has_separator()) { out = write_significand(out, significand, significand_size); return detail::fill_n(out, exponent, static_cast('0')); } @@ -2343,7 +2420,7 @@ FMT_CONSTEXPR20 auto write_significand(OutputIt out, T significand, int significand_size, int integral_size, Char decimal_point, const Grouping& grouping) -> OutputIt { - if (!grouping.separator()) { + if (!grouping.has_separator()) { return write_significand(out, significand, significand_size, integral_size, decimal_point); } @@ -2466,7 +2543,7 @@ template class fallback_digit_grouping { public: constexpr fallback_digit_grouping(locale_ref, bool) {} - constexpr Char separator() const { return Char(); } + constexpr bool has_separator() const { return false; } constexpr int count_separators(int) const { return 0; } @@ -2506,14 +2583,14 @@ template ::value&& FMT_CONSTEXPR20 bool isfinite(T value) { constexpr T inf = T(std::numeric_limits::infinity()); if (is_constant_evaluated()) - return !detail::isnan(value) && value != inf && value != -inf; + return !detail::isnan(value) && value < inf && value > -inf; return std::isfinite(value); } template ::value)> FMT_CONSTEXPR bool isfinite(T value) { T inf = T(std::numeric_limits::infinity()); // std::isfinite doesn't support __float128. - return !detail::isnan(value) && value != inf && value != -inf; + return !detail::isnan(value) && value < inf && value > -inf; } template ::value)> @@ -3181,13 +3258,10 @@ FMT_CONSTEXPR20 auto format_float(Float value, int precision, float_specs specs, } return exp; } - -template ::value)> -FMT_CONSTEXPR20 auto write(OutputIt out, T value, - basic_format_specs specs, locale_ref loc = {}) +template +FMT_CONSTEXPR20 auto write_float(OutputIt out, T value, + basic_format_specs specs, locale_ref loc) -> OutputIt { - if (const_check(!is_supported_floating_point(value))) return out; float_specs fspecs = parse_float_type_spec(specs); fspecs.sign = specs.sign; if (detail::signbit(value)) { // value < 0 is false for NaN so use signbit. @@ -3233,6 +3307,17 @@ FMT_CONSTEXPR20 auto write(OutputIt out, T value, return write_float(out, f, specs, fspecs, loc); } +template ::value)> +FMT_CONSTEXPR20 auto write(OutputIt out, T value, + basic_format_specs specs, locale_ref loc = {}) + -> OutputIt { + if (const_check(!is_supported_floating_point(value))) return out; + return specs.localized && write_loc(out, value, specs, loc) + ? out + : write_float(out, value, specs, loc); +} + template ::value)> FMT_CONSTEXPR20 auto write(OutputIt out, T value) -> OutputIt { @@ -3341,8 +3426,8 @@ template enable_if_t< std::is_class::value && !is_string::value && !is_floating_point::value && !std::is_same::value && - !std::is_same().map(value))>::value, + !std::is_same().map( + value))>>::value, OutputIt> { return write(out, arg_mapper().map(value)); } @@ -3411,12 +3496,6 @@ template struct custom_formatter { template void operator()(T) const {} }; -template -using is_integer = - bool_constant::value && !std::is_same::value && - !std::is_same::value && - !std::is_same::value>; - template class width_checker { public: explicit FMT_CONSTEXPR width_checker(ErrorHandler& eh) : handler_(eh) {} @@ -3598,9 +3677,10 @@ FMT_API void report_error(format_func func, int error_code, const char* message) noexcept; FMT_END_DETAIL_NAMESPACE +#if !__NVCC__ FMT_API auto vsystem_error(int error_code, string_view format_str, format_args args) -> std::system_error; - +#endif /** \rst Constructs :class:`std::system_error` with a message formatted with @@ -3618,12 +3698,13 @@ FMT_API auto vsystem_error(int error_code, string_view format_str, throw fmt::system_error(errno, "cannot open file '{}'", filename); \endrst */ +#if !__NVCC__ template auto system_error(int error_code, format_string fmt, T&&... args) -> std::system_error { return vsystem_error(error_code, fmt, fmt::make_format_args(args...)); } - +#endif /** \rst Formats an error message for an error returned by an operating system or a @@ -3912,9 +3993,9 @@ template struct formatter> : formatter { specs_.width_ref, ctx); detail::handle_dynamic_spec( specs_.precision, specs_.precision_ref, ctx); - return detail::write_int_localized( + return detail::write_int( ctx.out(), static_cast>(t.value), 0, specs_, - detail::digit_grouping({"\3", ','})); + detail::digit_grouping("\3", ",")); } }; @@ -4027,9 +4108,9 @@ auto join(Range&& range, string_view sep) */ template ::value)> inline auto to_string(const T& value) -> std::string { - auto result = std::string(); - detail::write(std::back_inserter(result), value); - return result; + auto buffer = memory_buffer(); + detail::write(appender(buffer), value); + return {buffer.data(), buffer.size()}; } template ::value)> @@ -4053,10 +4134,9 @@ FMT_NODISCARD auto to_string(const basic_memory_buffer& buf) FMT_BEGIN_DETAIL_NAMESPACE template -void vformat_to( - buffer& buf, basic_string_view fmt, - basic_format_args)> args, - locale_ref loc) { +void vformat_to(buffer& buf, basic_string_view fmt, + basic_format_args args, + locale_ref loc) { // workaround for msvc bug regarding name-lookup in module // link names into function scope using detail::arg_formatter; @@ -4137,6 +4217,9 @@ void vformat_to( } #ifndef FMT_HEADER_ONLY +extern template FMT_API void vformat_to( + buffer&, string_view, basic_format_args, + locale_ref); extern template FMT_API auto thousands_sep_impl(locale_ref) -> thousands_sep_result; extern template FMT_API auto thousands_sep_impl(locale_ref) @@ -4193,7 +4276,7 @@ auto vformat_to(OutputIt out, const Locale& loc, string_view fmt, using detail::get_buffer; auto&& buf = get_buffer(out); detail::vformat_to(buf, fmt, args, detail::locale_ref(loc)); - return detail::get_iterator(buf); + return detail::get_iterator(buf, out); } template ::value)> +FMT_NODISCARD FMT_INLINE auto formatted_size(const Locale& loc, + format_string fmt, + T&&... args) -> size_t { + auto buf = detail::counting_buffer<>(); + detail::vformat_to(buf, string_view(fmt), + format_args(fmt::make_format_args(args...)), + detail::locale_ref(loc)); + return buf.count(); +} + FMT_MODULE_EXPORT_END FMT_END_NAMESPACE diff --git a/packages/seacas/libraries/suplib_cpp/fmt/os.h b/packages/seacas/libraries/suplib_cpp/fmt/os.h index d82be1125a4b..8e697ec4e6fa 100644 --- a/packages/seacas/libraries/suplib_cpp/fmt/os.h +++ b/packages/seacas/libraries/suplib_cpp/fmt/os.h @@ -120,24 +120,6 @@ template class basic_cstring_view { using cstring_view = basic_cstring_view; using wcstring_view = basic_cstring_view; -template struct formatter { - template - FMT_CONSTEXPR auto parse(ParseContext& ctx) -> decltype(ctx.begin()) { - return ctx.begin(); - } - - template - FMT_CONSTEXPR auto format(const std::error_code& ec, FormatContext& ctx) const - -> decltype(ctx.out()) { - auto out = ctx.out(); - out = detail::write_bytes(out, ec.category().name(), - basic_format_specs()); - out = detail::write(out, Char(':')); - out = detail::write(out, ec.value()); - return out; - } -}; - #ifdef _WIN32 FMT_API const std::error_category& system_category() noexcept; diff --git a/packages/seacas/libraries/suplib_cpp/fmt/ostream.h b/packages/seacas/libraries/suplib_cpp/fmt/ostream.h index c3cdd4a61b2c..86ec47e13ad7 100644 --- a/packages/seacas/libraries/suplib_cpp/fmt/ostream.h +++ b/packages/seacas/libraries/suplib_cpp/fmt/ostream.h @@ -84,8 +84,8 @@ inline bool write_ostream_unicode(std::ostream& os, fmt::string_view data) { #elif defined(_WIN32) && defined(__GLIBCXX__) auto* rdbuf = os.rdbuf(); FILE* c_file; - if (auto* fbuf = dynamic_cast<__gnu_cxx::stdio_sync_filebuf*>(rdbuf)) - c_file = fbuf->file(); + if (auto* sfbuf = dynamic_cast<__gnu_cxx::stdio_sync_filebuf*>(rdbuf)) + c_file = sfbuf->file(); else if (auto* fbuf = dynamic_cast<__gnu_cxx::stdio_filebuf*>(rdbuf)) c_file = fbuf->file(); else diff --git a/packages/seacas/libraries/suplib_cpp/fmt/ranges.h b/packages/seacas/libraries/suplib_cpp/fmt/ranges.h index dea7d60dd6bb..2105a668822c 100644 --- a/packages/seacas/libraries/suplib_cpp/fmt/ranges.h +++ b/packages/seacas/libraries/suplib_cpp/fmt/ranges.h @@ -211,16 +211,16 @@ class is_tuple_formattable_ { static constexpr const bool value = false; }; template class is_tuple_formattable_ { - template - static std::true_type check2(index_sequence, - integer_sequence); + template + static std::true_type check2(index_sequence, + integer_sequence); static std::false_type check2(...); - template + template static decltype(check2( - index_sequence{}, + index_sequence{}, integer_sequence< - bool, (is_formattable::type, - C>::value)...>{})) check(index_sequence); + bool, (is_formattable::type, + C>::value)...>{})) check(index_sequence); public: static constexpr const bool value = diff --git a/packages/seacas/libraries/suplib_cpp/fmt/std.h b/packages/seacas/libraries/suplib_cpp/fmt/std.h index 41d2b2838b6d..ec7abaa99f05 100644 --- a/packages/seacas/libraries/suplib_cpp/fmt/std.h +++ b/packages/seacas/libraries/suplib_cpp/fmt/std.h @@ -8,8 +8,12 @@ #ifndef FMT_STD_H_ #define FMT_STD_H_ +#include +#include +#include #include #include +#include #include #include "ostream.h" @@ -27,6 +31,16 @@ # endif #endif +// GCC 4 does not support FMT_HAS_INCLUDE. +#if FMT_HAS_INCLUDE() || defined(__GLIBCXX__) +# include +// Android NDK with gabi++ library on some archtectures does not implement +// abi::__cxa_demangle(). +# ifndef __GABIXX_CXXABI_H__ +# define FMT_HAS_ABI_CXA_DEMANGLE +# endif +#endif + #ifdef __cpp_lib_filesystem FMT_BEGIN_NAMESPACE @@ -100,19 +114,16 @@ template using variant_index_sequence = std::make_index_sequence::value>; -// variant_size and variant_alternative check. -template -struct is_variant_like_ : std::false_type {}; -template -struct is_variant_like_::value)>> - : std::true_type {}; +template struct is_variant_like_ : std::false_type {}; +template +struct is_variant_like_> : std::true_type {}; -// formattable element check +// formattable element check. template class is_variant_formattable_ { - template + template static std::conjunction< - is_formattable, C>...> - check(std::index_sequence); + is_formattable, C>...> + check(std::index_sequence); public: static constexpr const bool value = @@ -166,6 +177,113 @@ struct formatter< } }; FMT_END_NAMESPACE +#endif // __cpp_lib_variant + +FMT_BEGIN_NAMESPACE + +template struct formatter { + template + FMT_CONSTEXPR auto parse(ParseContext& ctx) -> decltype(ctx.begin()) { + return ctx.begin(); + } + + template + FMT_CONSTEXPR auto format(const std::error_code& ec, FormatContext& ctx) const + -> decltype(ctx.out()) { + auto out = ctx.out(); + out = detail::write_bytes(out, ec.category().name(), + basic_format_specs()); + out = detail::write(out, Char(':')); + out = detail::write(out, ec.value()); + return out; + } +}; + +template +struct formatter< + T, Char, + typename std::enable_if::value>::type> { + private: + bool with_typename_ = false; + + public: + FMT_CONSTEXPR auto parse(basic_format_parse_context& ctx) + -> decltype(ctx.begin()) { + auto it = ctx.begin(); + auto end = ctx.end(); + if (it == end || *it == '}') return it; + if (*it == 't') { + ++it; + with_typename_ = true; + } + return it; + } + + template + auto format(const std::exception& ex, + basic_format_context& ctx) const -> OutputIt { + basic_format_specs spec; + auto out = ctx.out(); + if (!with_typename_) + return detail::write_bytes(out, string_view(ex.what()), spec); + + const std::type_info& ti = typeid(ex); +#ifdef FMT_HAS_ABI_CXA_DEMANGLE + int status = 0; + std::size_t size = 0; + std::unique_ptr demangled_name_ptr( + abi::__cxa_demangle(ti.name(), nullptr, &size, &status), &std::free); + + string_view demangled_name_view; + if (demangled_name_ptr) { + demangled_name_view = demangled_name_ptr.get(); + + // Normalization of stdlib inline namespace names. + // libc++ inline namespaces. + // std::__1::* -> std::* + // std::__1::__fs::* -> std::* + // libstdc++ inline namespaces. + // std::__cxx11::* -> std::* + // std::filesystem::__cxx11::* -> std::filesystem::* + if (demangled_name_view.starts_with("std::")) { + char* begin = demangled_name_ptr.get(); + char* to = begin + 5; // std:: + for (char *from = to, *end = begin + demangled_name_view.size(); + from < end;) { + // This is safe, because demangled_name is NUL-terminated. + if (from[0] == '_' && from[1] == '_') { + char* next = from + 1; + while (next < end && *next != ':') next++; + if (next[0] == ':' && next[1] == ':') { + from = next + 2; + continue; + } + } + *to++ = *from++; + } + demangled_name_view = {begin, detail::to_unsigned(to - begin)}; + } + } else { + demangled_name_view = string_view(ti.name()); + } + out = detail::write_bytes(out, demangled_name_view, spec); +#elif FMT_MSC_VERSION + string_view demangled_name_view(ti.name()); + if (demangled_name_view.starts_with("class ")) + demangled_name_view.remove_prefix(6); + else if (demangled_name_view.starts_with("struct ")) + demangled_name_view.remove_prefix(7); + out = detail::write_bytes(out, demangled_name_view, spec); +#else + out = detail::write_bytes(out, string_view(ti.name()), spec); #endif + out = detail::write(out, Char(':')); + out = detail::write(out, Char(' ')); + out = detail::write_bytes(out, string_view(ex.what()), spec); + + return out; + } +}; +FMT_END_NAMESPACE #endif // FMT_STD_H_ diff --git a/packages/seacas/libraries/suplib_cpp/fmt/xchar.h b/packages/seacas/libraries/suplib_cpp/fmt/xchar.h index 3b5bc15ca0a1..40e699b64253 100644 --- a/packages/seacas/libraries/suplib_cpp/fmt/xchar.h +++ b/packages/seacas/libraries/suplib_cpp/fmt/xchar.h @@ -12,11 +12,30 @@ #include "format.h" +#ifndef FMT_STATIC_THOUSANDS_SEPARATOR +# include +#endif + FMT_BEGIN_NAMESPACE namespace detail { + template using is_exotic_char = bool_constant::value>; + +inline auto write_loc(std::back_insert_iterator> out, + loc_value value, const basic_format_specs& specs, + locale_ref loc) -> bool { +#ifndef FMT_STATIC_THOUSANDS_SEPARATOR + auto& numpunct = + std::use_facet>(loc.get()); + auto separator = std::wstring(); + auto grouping = numpunct.grouping(); + if (!grouping.empty()) separator = std::wstring(1, numpunct.thousands_sep()); + return value.visit(loc_writer{out, specs, separator, grouping, {}}); +#endif + return false; } +} // namespace detail FMT_MODULE_EXPORT_BEGIN @@ -126,7 +145,7 @@ auto vformat_to(OutputIt out, const S& format_str, -> OutputIt { auto&& buf = detail::get_buffer(out); detail::vformat_to(buf, detail::to_string_view(format_str), args); - return detail::get_iterator(buf); + return detail::get_iterator(buf, out); } template