From c24337db0201ad731b4b581669476bf62217cfde Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Thu, 3 Nov 2022 16:10:42 -0600 Subject: [PATCH 01/35] Remove usage of deprecated function (#429) --- tribits/core/package_arch/TribitsProjectImpl.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tribits/core/package_arch/TribitsProjectImpl.cmake b/tribits/core/package_arch/TribitsProjectImpl.cmake index fc9e30109..892cecc6b 100644 --- a/tribits/core/package_arch/TribitsProjectImpl.cmake +++ b/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 From 0fbf95aee1f174c90fcbf5bd2ce47ffd4bf1e097 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Thu, 3 Nov 2022 16:47:49 -0600 Subject: [PATCH 02/35] Remove extra spaces at end of lines (#63) Noticed this while working on #63 --- test/core/DependencyUnitTests/CMakeLists.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/core/DependencyUnitTests/CMakeLists.txt b/test/core/DependencyUnitTests/CMakeLists.txt index e3fd5213a..0288b9479 100644 --- a/test/core/DependencyUnitTests/CMakeLists.txt +++ b/test/core/DependencyUnitTests/CMakeLists.txt @@ -894,7 +894,7 @@ create_dependency_handling_test_case( create_dependency_handling_test_case( EnableThyra_DisableEpetra_EnableThyraEpetraExt_DisableEnabledDownstreamPackages ARGS -DTrilinos_ENABLE_Thyra:BOOL=ON -DTrilinos_ENABLE_Epetra:BOOL=OFF - -DTrilinos_ENABLE_ThyraEpetraExt:BOOL=ON + -DTrilinos_ENABLE_ThyraEpetraExt:BOOL=ON -DTrilinos_DISABLE_ENABLED_FORWARD_DEP_PACKAGES=ON PASS_REGULAR_EXPRESSION_ALL "Explicitly enabled top-level packages on input .by user.: Thyra 1" @@ -912,7 +912,7 @@ create_dependency_handling_test_case( ARGS -DTrilinos_ENABLE_Stratimikos=ON -DTrilinos_ENABLE_Thyra=OFF PASS_REGULAR_EXPRESSION_ALL "Setting subpackage enable Trilinos_ENABLE_ThyraCoreLibs=OFF because parent package Trilinos_ENABLE_Thyra=OFF" - "Setting subpackage enable Trilinos_ENABLE_ThyraGoodStuff=OFF because parent package Trilinos_ENABLE_Thyra=OFF" + "Setting subpackage enable Trilinos_ENABLE_ThyraGoodStuff=OFF because parent package Trilinos_ENABLE_Thyra=OFF" "Setting subpackage enable Trilinos_ENABLE_ThyraEpetra=OFF because parent package Trilinos_ENABLE_Thyra=OFF" "Setting subpackage enable Trilinos_ENABLE_ThyraEpetraExt=OFF because parent package Trilinos_ENABLE_Thyra=OFF" "Setting subpackage enable Trilinos_ENABLE_ThyraTpetra=OFF because parent package Trilinos_ENABLE_Thyra=OFF" @@ -926,7 +926,7 @@ create_dependency_handling_test_case( -DTrilinos_DISABLE_ENABLED_FORWARD_DEP_PACKAGES=ON PASS_REGULAR_EXPRESSION_ALL "Setting subpackage enable Trilinos_ENABLE_ThyraCoreLibs=OFF because parent package Trilinos_ENABLE_Thyra=OFF" - "Setting subpackage enable Trilinos_ENABLE_ThyraGoodStuff=OFF because parent package Trilinos_ENABLE_Thyra=OFF" + "Setting subpackage enable Trilinos_ENABLE_ThyraGoodStuff=OFF because parent package Trilinos_ENABLE_Thyra=OFF" "Setting subpackage enable Trilinos_ENABLE_ThyraEpetra=OFF because parent package Trilinos_ENABLE_Thyra=OFF" "Setting subpackage enable Trilinos_ENABLE_ThyraEpetraExt=OFF because parent package Trilinos_ENABLE_Thyra=OFF" "Setting subpackage enable Trilinos_ENABLE_ThyraTpetra=OFF because parent package Trilinos_ENABLE_Thyra=OFF" @@ -1118,7 +1118,7 @@ create_dependency_handling_test_case( ARGS -DTrilinos_ENABLE_Stratimikos=ON -DTrilinos_ENABLE_Ifpack=ON -DTrilinos_HOSTTYPE:STRING=BadSystem2 PASS_REGULAR_EXPRESSION_ALL - "NOTE: User has set Trilinos_ENABLE_Ifpack=ON but the" + "NOTE: User has set Trilinos_ENABLE_Ifpack=ON but the" "package Ifpack is not supported on this platform type 'BadSystem2'" "Final set of enabled top-level packages: Teuchos RTOp Epetra Zoltan Triutils EpetraExt Thyra Isorropia AztecOO Galeri Amesos Ifpack ML Stratimikos 14" "Final set of enabled packages: Teuchos RTOp Epetra Zoltan Triutils EpetraExt ThyraCoreLibs ThyraEpetra ThyraEpetraExt Thyra Isorropia AztecOO Galeri Amesos Ifpack ML Stratimikos 17" @@ -1161,7 +1161,7 @@ create_dependency_handling_test_case( create_dependency_handling_test_case( DefaultExtraReposFile_EnableAllPackages_TraceFileProcessing - ARGS + ARGS -DTrilinos_EXTRAREPOS_FILE=${MOCK_TRILINOS_DIR}/cmake/ExtraRepositoriesList.cmake -DTrilinos_ENABLE_KNOWN_EXTERNAL_REPOS_TYPE=Nightly -DTrilinos_IGNORE_MISSING_EXTRA_REPOSITORIES=TRUE @@ -1195,7 +1195,7 @@ create_dependency_handling_test_case( create_dependency_handling_test_case( PreAndExtraReposFile_Nightly_EnableAllPackages - ARGS + ARGS -DTrilinos_EXTRAREPOS_FILE=${CMAKE_CURRENT_SOURCE_DIR}/PreAndExtraRepositoriesList.cmake -DTrilinos_ENABLE_KNOWN_EXTERNAL_REPOS_TYPE=Nightly -DTrilinos_ENABLE_SECONDARY_TESTED_CODE:BOOL=ON @@ -1217,7 +1217,7 @@ create_dependency_handling_test_case( create_dependency_handling_test_case( PreAndExtraReposFile_Continuous_EnableAllPackages - ARGS + ARGS -DTrilinos_EXTRAREPOS_FILE=${CMAKE_CURRENT_SOURCE_DIR}/PreAndExtraRepositoriesList.cmake -DTrilinos_ENABLE_KNOWN_EXTERNAL_REPOS_TYPE=Continuous -DTrilinos_ENABLE_SECONDARY_TESTED_CODE:BOOL=ON @@ -1239,7 +1239,7 @@ create_dependency_handling_test_case( create_dependency_handling_test_case( PreAndExtraReposFile_Continuous_AssertMissing_EnableAllPackages - ARGS + ARGS -DTrilinos_EXTRAREPOS_FILE=${CMAKE_CURRENT_SOURCE_DIR}/PreAndExtraRepositoriesList.cmake -DTrilinos_ENABLE_KNOWN_EXTERNAL_REPOS_TYPE=Continuous -DTrilinos_ENABLE_SECONDARY_TESTED_CODE:BOOL=ON From 3824dfcda7585a4632beda4f629797a364a22659 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Tue, 18 Oct 2022 19:39:28 -0600 Subject: [PATCH 03/35] Add common_tpls/FindTPLLAPACKDependencies.cmake (#63) This is the right thing to do but it also helps in testing dependencies printouts for ReducedMockTrilinos. --- tribits/common_tpls/FindTPLLAPACKDependencies.cmake | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tribits/common_tpls/FindTPLLAPACKDependencies.cmake diff --git a/tribits/common_tpls/FindTPLLAPACKDependencies.cmake b/tribits/common_tpls/FindTPLLAPACKDependencies.cmake new file mode 100644 index 000000000..0256dbbfd --- /dev/null +++ b/tribits/common_tpls/FindTPLLAPACKDependencies.cmake @@ -0,0 +1,2 @@ +tribits_extpkg_define_dependencies( LAPACK + DEPENDENCIES BLAS) From d410d630db0b8643c8604f4949c57be21bfcd1d1 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Tue, 18 Oct 2022 19:43:02 -0600 Subject: [PATCH 04/35] Don't overwrite _[LIB|TEST]_DEFINED_DEPENDENCIES, change deps order, fix printing deps (#63) I did several things here: * Renamed the macro tribits_setup_direct_package_dependencies_lists_and_lib_required_enable_vars() to tribits_setup_enabled_dependencies_lists_and_enable_vars() * Removed the resetting of _[LIB|TEST]_DEFINED_DEPENDENCIES after the adjustment of the enables/disables. (This resulted in _[LIB|TEST]_DEFINED_DEPENDENCIES also listing out TPLs as well.) * Refactored tribits_print_nonempty_package_deps_list() to accept 'definedOrEnabled' argument. * Changed the order of TPLs and Packagse in _[LIB|TEST]_DEFINED_DEPENDENCIES so that PACKAGES are listed first, then TPLS second. This just looks more logical. (This required updating some of the tests that are sensitive to this ordering.) * Changed the printing of _[LIB|TEST]_ENABLED_DEPENDENCIES to use tribits_print_nonempty_package_deps_list(). * Changed printing of ": No dependendies!" to ": No defined dependendies!" (to differentiate from ": No enabled dependendies!" --- common_tools/FindTPLLAPACKDependencies.cmake | 2 + ...sts_EnableAllPackages_DumpDependencies.txt | 175 +++++++++--------- .../TribitsExampleProject_Tests.cmake | 30 +-- .../TribitsAdjustPackageEnables.cmake | 41 ++-- .../TribitsPrintDependencyInfo.cmake | 17 +- .../TribitsReadDepsFilesCreateDepsGraph.cmake | 5 +- .../ExpectedDependencies.txt | 44 ++--- .../TPLs/FindTPLLAPACKDependencies.cmake | 2 + .../TPLs/FindTPLParMETISDependencies.cmake | 2 + .../TPLs/FindTPLSuperLUDependencies.cmake | 2 + .../TPLs/FindTPLSuperLUDistDependencies.cmake | 2 + .../ReducedMockTrilinos/TPLsList.cmake | 8 +- 12 files changed, 162 insertions(+), 168 deletions(-) create mode 100644 common_tools/FindTPLLAPACKDependencies.cmake create mode 100644 tribits/examples/MockTrilinos/cmake/TPLs/FindTPLLAPACKDependencies.cmake create mode 100644 tribits/examples/MockTrilinos/cmake/TPLs/FindTPLParMETISDependencies.cmake create mode 100644 tribits/examples/MockTrilinos/cmake/TPLs/FindTPLSuperLUDependencies.cmake create mode 100644 tribits/examples/MockTrilinos/cmake/TPLs/FindTPLSuperLUDistDependencies.cmake diff --git a/common_tools/FindTPLLAPACKDependencies.cmake b/common_tools/FindTPLLAPACKDependencies.cmake new file mode 100644 index 000000000..0256dbbfd --- /dev/null +++ b/common_tools/FindTPLLAPACKDependencies.cmake @@ -0,0 +1,2 @@ +tribits_extpkg_define_dependencies( LAPACK + DEPENDENCIES BLAS) diff --git a/test/core/DependencyUnitTests/DepTests_EnableAllPackages_DumpDependencies.txt b/test/core/DependencyUnitTests/DepTests_EnableAllPackages_DumpDependencies.txt index b4c93e821..8d216faa0 100644 --- a/test/core/DependencyUnitTests/DepTests_EnableAllPackages_DumpDependencies.txt +++ b/test/core/DependencyUnitTests/DepTests_EnableAllPackages_DumpDependencies.txt @@ -15,6 +15,44 @@ Package dependencies information: -- Trilinos_DEFINED_PACKAGES: MPI BLAS LAPACK Boost Scotch METIS ParMETIS CppUnit ADOLC ADIC TVMET y12m SuperLUDist SuperLU UMFPACK AMD PETSC MUMPS DUMMY TrilinosFramework Teuchos RTOp Epetra Zoltan Shards Triutils Tpetra EpetraExt Stokhos Sacado ThyraCoreLibs ThyraGoodStuff ThyraCrazyStuff ThyraEpetra ThyraEpetraExt ThyraTpetra Thyra Isorropia AztecOO Galeri Amesos Intrepid Ifpack ML Belos Stratimikos RBGen Phalanx Panzer -- Trilinos_NUM_DEFINED_PACKAGES='49' +-- MPI: No defined dependencies! + +-- BLAS: No defined dependencies! + +-- LAPACK_LIB_DEFINED_DEPENDENCIES: BLAS[O] + +-- Boost: No defined dependencies! + +-- Scotch: No defined dependencies! + +-- METIS: No defined dependencies! + +-- ParMETIS_LIB_DEFINED_DEPENDENCIES: METIS[O] + +-- CppUnit: No defined dependencies! + +-- ADOLC: No defined dependencies! + +-- ADIC: No defined dependencies! + +-- TVMET: No defined dependencies! + +-- y12m: No defined dependencies! + +-- SuperLUDist_LIB_DEFINED_DEPENDENCIES: ParMETIS[O] BLAS[O] + +-- SuperLU_LIB_DEFINED_DEPENDENCIES: ParMETIS[O] BLAS[O] + +-- UMFPACK: No defined dependencies! + +-- AMD: No defined dependencies! + +-- PETSC: No defined dependencies! + +-- MUMPS: No defined dependencies! + +-- DUMMY: No defined dependencies! + -- TrilinosFramework_TEST_OPTIONAL_DEP_TPLS: MPI -- TrilinosFramework_TEST_DEFINED_DEPENDENCIES: MPI[O] @@ -213,7 +251,7 @@ Package dependencies information: -- ML_LIB_OPTIONAL_DEP_TPLS: MPI METIS ParMETIS PETSC -- ML_TEST_OPTIONAL_DEP_TPLS: METIS ParMETIS --- ML_LIB_DEFINED_DEPENDENCIES: BLAS[R] LAPACK[R] Teuchos[O] Epetra[O] Zoltan[O] Galeri[O] Amesos[O] Ifpack[O] AztecOO[O] EpetraExt[O] Isorropia[O] MPI[O] METIS[O] ParMETIS[O] PETSC[O] +-- ML_LIB_DEFINED_DEPENDENCIES: Teuchos[O] Epetra[O] Zoltan[O] Galeri[O] Amesos[O] Ifpack[O] AztecOO[O] EpetraExt[O] Isorropia[O] BLAS[R] LAPACK[R] MPI[O] METIS[O] ParMETIS[O] PETSC[O] -- ML_TEST_DEFINED_DEPENDENCIES: METIS[O] ParMETIS[O] -- ML_FORWARD_LIB_DEFINED_DEPENDENCIES: Stratimikos[O] -- ML_FORWARD_TEST_DEFINED_DEPENDENCIES: Belos[O] @@ -242,7 +280,7 @@ Package dependencies information: -- RBGen_LIB_OPTIONAL_DEP_PACKAGES: Epetra EpetraExt -- RBGen_LIB_REQUIRED_DEP_TPLS: DUMMY --- RBGen_LIB_DEFINED_DEPENDENCIES: Teuchos[R] DUMMY[R] Epetra[O] EpetraExt[O] +-- RBGen_LIB_DEFINED_DEPENDENCIES: Teuchos[R] Epetra[O] EpetraExt[O] DUMMY[R] -- Phalanx_LIB_REQUIRED_DEP_PACKAGES: Teuchos Shards Sacado -- Phalanx_TEST_OPTIONAL_DEP_PACKAGES: Belos Epetra Ifpack Intrepid @@ -259,136 +297,105 @@ Package dependencies information: -- Panzer_TEST_OPTIONAL_DEP_PACKAGES: Stratimikos -- Panzer_LIB_REQUIRED_DEP_TPLS: MPI Boost --- Panzer_LIB_DEFINED_DEPENDENCIES: Teuchos[R] Sacado[R] Phalanx[R] Intrepid[R] Thyra[R] Tpetra[R] Epetra[R] EpetraExt[R] MPI[R] Boost[R] Stokhos[O] +-- Panzer_LIB_DEFINED_DEPENDENCIES: Teuchos[R] Sacado[R] Phalanx[R] Intrepid[R] Thyra[R] Tpetra[R] Epetra[R] EpetraExt[R] Stokhos[O] MPI[R] Boost[R] -- Panzer_TEST_DEFINED_DEPENDENCIES: Stratimikos[O] -Dumping direct dependencies for each package ... +Dumping direct enabled dependencies for each package ... --- MPI_LIB_DEFINED_DEPENDENCIES: +-- MPI: No enabled dependencies! --- BLAS_LIB_DEFINED_DEPENDENCIES: +-- BLAS: No enabled dependencies! --- LAPACK_LIB_DEFINED_DEPENDENCIES: +-- LAPACK_LIB_ENABLED_DEPENDENCIES: BLAS[O] --- Boost_LIB_DEFINED_DEPENDENCIES: +-- Boost: No enabled dependencies! --- Scotch_LIB_DEFINED_DEPENDENCIES: +-- Scotch: No enabled dependencies! --- METIS_LIB_DEFINED_DEPENDENCIES: +-- METIS: No enabled dependencies! --- ParMETIS_LIB_DEFINED_DEPENDENCIES: +-- ParMETIS: No enabled dependencies! --- CppUnit_LIB_DEFINED_DEPENDENCIES: +-- CppUnit: No enabled dependencies! --- ADOLC_LIB_DEFINED_DEPENDENCIES: +-- ADOLC: No enabled dependencies! --- ADIC_LIB_DEFINED_DEPENDENCIES: +-- ADIC: No enabled dependencies! --- TVMET_LIB_DEFINED_DEPENDENCIES: +-- TVMET: No enabled dependencies! --- y12m_LIB_DEFINED_DEPENDENCIES: +-- y12m: No enabled dependencies! --- SuperLUDist_LIB_DEFINED_DEPENDENCIES: +-- SuperLUDist: No enabled dependencies! --- SuperLU_LIB_DEFINED_DEPENDENCIES: +-- SuperLU: No enabled dependencies! --- UMFPACK_LIB_DEFINED_DEPENDENCIES: +-- UMFPACK: No enabled dependencies! --- AMD_LIB_DEFINED_DEPENDENCIES: +-- AMD: No enabled dependencies! --- PETSC_LIB_DEFINED_DEPENDENCIES: +-- PETSC: No enabled dependencies! --- MUMPS_LIB_DEFINED_DEPENDENCIES: +-- MUMPS: No enabled dependencies! --- DUMMY_LIB_DEFINED_DEPENDENCIES: +-- DUMMY: No enabled dependencies! --- TrilinosFramework_LIB_DEFINED_DEPENDENCIES: --- TrilinosFramework_TEST_DEFINED_DEPENDENCIES: MPI +-- TrilinosFramework: No enabled dependencies! --- Teuchos_LIB_ENABLED_DEPENDENCIES: BLAS LAPACK --- Teuchos_LIB_DEFINED_DEPENDENCIES: BLAS LAPACK Boost MPI +-- Teuchos_LIB_ENABLED_DEPENDENCIES: BLAS[R] LAPACK[R] --- RTOp_LIB_ENABLED_DEPENDENCIES: Teuchos --- RTOp_LIB_DEFINED_DEPENDENCIES: Teuchos +-- RTOp_LIB_ENABLED_DEPENDENCIES: Teuchos[R] --- Epetra_LIB_ENABLED_DEPENDENCIES: BLAS LAPACK --- Epetra_LIB_DEFINED_DEPENDENCIES: BLAS LAPACK MPI +-- Epetra_LIB_ENABLED_DEPENDENCIES: BLAS[R] LAPACK[R] --- Zoltan_LIB_DEFINED_DEPENDENCIES: MPI ParMETIS Scotch +-- Zoltan: No enabled dependencies! --- Shards_TEST_DEFINED_DEPENDENCIES: Teuchos +-- Shards: No enabled dependencies! --- Triutils_LIB_ENABLED_DEPENDENCIES: Epetra --- Triutils_LIB_DEFINED_DEPENDENCIES: Epetra +-- Triutils_LIB_ENABLED_DEPENDENCIES: Epetra[R] --- Tpetra_LIB_ENABLED_DEPENDENCIES: Teuchos --- Tpetra_LIB_DEFINED_DEPENDENCIES: Teuchos --- Tpetra_TEST_DEFINED_DEPENDENCIES: Triutils +-- Tpetra_LIB_ENABLED_DEPENDENCIES: Teuchos[R] --- EpetraExt_LIB_ENABLED_DEPENDENCIES: Teuchos Epetra Triutils Zoltan --- EpetraExt_LIB_DEFINED_DEPENDENCIES: Teuchos Epetra Triutils Zoltan UMFPACK AMD PETSC +-- EpetraExt_LIB_ENABLED_DEPENDENCIES: Teuchos[R] Epetra[R] Triutils[O] Zoltan[O] --- Stokhos_LIB_DEFINED_DEPENDENCIES: Teuchos +-- Stokhos: No enabled dependencies! --- Sacado_LIB_DEFINED_DEPENDENCIES: Teuchos Stokhos Epetra EpetraExt --- Sacado_TEST_DEFINED_DEPENDENCIES: ADOLC CppUnit +-- Sacado: No enabled dependencies! --- ThyraCoreLibs_LIB_ENABLED_DEPENDENCIES: Teuchos RTOp --- ThyraCoreLibs_LIB_DEFINED_DEPENDENCIES: Teuchos RTOp +-- ThyraCoreLibs_LIB_ENABLED_DEPENDENCIES: Teuchos[R] RTOp[R] --- ThyraGoodStuff_LIB_DEFINED_DEPENDENCIES: ThyraCoreLibs +-- ThyraGoodStuff: No enabled dependencies! --- ThyraCrazyStuff_LIB_DEFINED_DEPENDENCIES: ThyraGoodStuff +-- ThyraCrazyStuff: No enabled dependencies! --- ThyraEpetra_LIB_ENABLED_DEPENDENCIES: Epetra ThyraCoreLibs --- ThyraEpetra_LIB_DEFINED_DEPENDENCIES: Epetra ThyraCoreLibs +-- ThyraEpetra_LIB_ENABLED_DEPENDENCIES: Epetra[R] ThyraCoreLibs[R] --- ThyraEpetraExt_LIB_ENABLED_DEPENDENCIES: ThyraEpetra EpetraExt --- ThyraEpetraExt_LIB_DEFINED_DEPENDENCIES: ThyraEpetra EpetraExt +-- ThyraEpetraExt_LIB_ENABLED_DEPENDENCIES: ThyraEpetra[R] EpetraExt[R] --- ThyraTpetra_LIB_ENABLED_DEPENDENCIES: Tpetra ThyraCoreLibs --- ThyraTpetra_LIB_DEFINED_DEPENDENCIES: Tpetra ThyraCoreLibs +-- ThyraTpetra_LIB_ENABLED_DEPENDENCIES: Tpetra[R] ThyraCoreLibs[R] --- Thyra_LIB_ENABLED_DEPENDENCIES: ThyraCoreLibs ThyraEpetra ThyraEpetraExt ThyraTpetra --- Thyra_LIB_DEFINED_DEPENDENCIES: ThyraCoreLibs ThyraGoodStuff ThyraCrazyStuff ThyraEpetra ThyraEpetraExt ThyraTpetra +-- Thyra_LIB_ENABLED_DEPENDENCIES: ThyraCoreLibs[R] ThyraEpetra[O] ThyraEpetraExt[O] ThyraTpetra[O] --- Isorropia_LIB_ENABLED_DEPENDENCIES: Teuchos Epetra Zoltan EpetraExt --- Isorropia_LIB_DEFINED_DEPENDENCIES: Teuchos Epetra Zoltan EpetraExt +-- Isorropia_LIB_ENABLED_DEPENDENCIES: Teuchos[R] Epetra[R] Zoltan[R] EpetraExt[O] --- AztecOO_LIB_ENABLED_DEPENDENCIES: Epetra Triutils Teuchos --- AztecOO_LIB_DEFINED_DEPENDENCIES: Epetra Triutils Teuchos y12m +-- AztecOO_LIB_ENABLED_DEPENDENCIES: Epetra[R] Triutils[R] Teuchos[O] --- Galeri_LIB_ENABLED_DEPENDENCIES: Teuchos Epetra EpetraExt --- Galeri_LIB_DEFINED_DEPENDENCIES: Teuchos Epetra EpetraExt +-- Galeri_LIB_ENABLED_DEPENDENCIES: Teuchos[R] Epetra[R] EpetraExt[O] --- Amesos_LIB_ENABLED_DEPENDENCIES: Teuchos Epetra EpetraExt --- Amesos_LIB_DEFINED_DEPENDENCIES: Teuchos Epetra EpetraExt SuperLUDist ParMETIS UMFPACK SuperLU MUMPS --- Amesos_TEST_DEFINED_DEPENDENCIES: Triutils Galeri +-- Amesos_LIB_ENABLED_DEPENDENCIES: Teuchos[R] Epetra[R] EpetraExt[O] --- Intrepid_LIB_ENABLED_DEPENDENCIES: Teuchos Shards --- Intrepid_LIB_DEFINED_DEPENDENCIES: Teuchos Shards Sacado --- Intrepid_TEST_DEFINED_DEPENDENCIES: Epetra EpetraExt Amesos +-- Intrepid_LIB_ENABLED_DEPENDENCIES: Teuchos[R] Shards[R] --- Ifpack_LIB_ENABLED_DEPENDENCIES: Teuchos Epetra Amesos AztecOO --- Ifpack_LIB_DEFINED_DEPENDENCIES: Teuchos Epetra Amesos AztecOO --- Ifpack_TEST_DEFINED_DEPENDENCIES: Galeri +-- Ifpack_LIB_ENABLED_DEPENDENCIES: Teuchos[R] Epetra[R] Amesos[O] AztecOO[O] --- ML_LIB_ENABLED_DEPENDENCIES: Teuchos Epetra Zoltan Galeri Amesos Ifpack AztecOO EpetraExt Isorropia BLAS LAPACK --- ML_LIB_DEFINED_DEPENDENCIES: Teuchos Epetra Zoltan Galeri Amesos Ifpack AztecOO EpetraExt Isorropia BLAS LAPACK MPI METIS ParMETIS PETSC --- ML_TEST_DEFINED_DEPENDENCIES: METIS ParMETIS +-- ML_LIB_ENABLED_DEPENDENCIES: Teuchos[O] Epetra[O] Zoltan[O] Galeri[O] Amesos[O] Ifpack[O] AztecOO[O] EpetraExt[O] Isorropia[O] BLAS[R] LAPACK[R] --- Belos_LIB_DEFINED_DEPENDENCIES: Teuchos Epetra Tpetra --- Belos_TEST_DEFINED_DEPENDENCIES: Triutils EpetraExt Ifpack ML +-- Belos: No enabled dependencies! --- Stratimikos_LIB_ENABLED_DEPENDENCIES: ThyraEpetraExt ThyraCoreLibs Amesos AztecOO Ifpack ML --- Stratimikos_LIB_DEFINED_DEPENDENCIES: ThyraEpetraExt ThyraCoreLibs Amesos AztecOO Belos Ifpack ML --- Stratimikos_TEST_DEFINED_DEPENDENCIES: Triutils +-- Stratimikos_LIB_ENABLED_DEPENDENCIES: ThyraEpetraExt[R] ThyraCoreLibs[R] Amesos[O] AztecOO[O] Ifpack[O] ML[O] --- RBGen_LIB_ENABLED_DEPENDENCIES: Teuchos Epetra EpetraExt DUMMY --- RBGen_LIB_DEFINED_DEPENDENCIES: Teuchos Epetra EpetraExt DUMMY +-- RBGen_LIB_ENABLED_DEPENDENCIES: Teuchos[R] Epetra[O] EpetraExt[O] DUMMY[R] --- Phalanx_LIB_DEFINED_DEPENDENCIES: Teuchos Shards Sacado Boost --- Phalanx_TEST_DEFINED_DEPENDENCIES: Belos Epetra Ifpack Intrepid TVMET +-- Phalanx: No enabled dependencies! --- Panzer_LIB_DEFINED_DEPENDENCIES: Teuchos Sacado Phalanx Intrepid Thyra Tpetra Epetra EpetraExt Stokhos MPI Boost --- Panzer_TEST_DEFINED_DEPENDENCIES: Stratimikos +-- Panzer: No enabled dependencies! diff --git a/test/core/ExamplesUnitTests/TribitsExampleProject_Tests.cmake b/test/core/ExamplesUnitTests/TribitsExampleProject_Tests.cmake index 5a1349f28..619b15183 100644 --- a/test/core/ExamplesUnitTests/TribitsExampleProject_Tests.cmake +++ b/test/core/ExamplesUnitTests/TribitsExampleProject_Tests.cmake @@ -197,30 +197,32 @@ function(TribitsExampleProject_ALL_ST_NoFortran sharedOrStatic serialOrMpi) "Setting TribitsExProj_ENABLE_WithSubpackages=ON" "Setting TPL_ENABLE_HeaderOnlyTpl=ON because it is required by the enabled package SimpleCxx" "Set cache entries for optional packages/TPLs and tests/examples for packages actually enabled ..." - "Dumping direct dependencies for each package ..." - "-- SimpleCxx_LIB_ENABLED_DEPENDENCIES: HeaderOnlyTpl" - "-- SimpleCxx_LIB_DEFINED_DEPENDENCIES: HeaderOnlyTpl SimpleTpl" - "-- MixedLang_LIB_DEFINED_DEPENDENCIES: " - "-- WithSubpackagesA_LIB_ENABLED_DEPENDENCIES: SimpleCxx" - "-- WithSubpackagesA_LIB_DEFINED_DEPENDENCIES: SimpleCxx" - "-- WithSubpackagesB_LIB_ENABLED_DEPENDENCIES: SimpleCxx WithSubpackagesA" - "-- WithSubpackagesB_LIB_DEFINED_DEPENDENCIES: SimpleCxx WithSubpackagesA" - "-- WithSubpackagesB_TEST_DEFINED_DEPENDENCIES: MixedLang" - "-- WithSubpackagesC_LIB_ENABLED_DEPENDENCIES: WithSubpackagesA WithSubpackagesB" - "-- WithSubpackagesC_LIB_DEFINED_DEPENDENCIES: WithSubpackagesA WithSubpackagesB" - "-- WithSubpackages_LIB_ENABLED_DEPENDENCIES: WithSubpackagesA WithSubpackagesB WithSubpackagesC" - "-- WithSubpackages_LIB_DEFINED_DEPENDENCIES: WithSubpackagesA WithSubpackagesB WithSubpackagesC" - "-- WrapExternal_LIB_DEFINED_DEPENDENCIES: WithSubpackagesA MixedLang" + + "Dumping direct enabled dependencies for each package ..." + "-- MPI: No enabled dependencies!" + "-- HeaderOnlyTpl: No enabled dependencies!" + "-- SimpleTpl: No enabled dependencies!" + "-- SimpleCxx_LIB_ENABLED_DEPENDENCIES: HeaderOnlyTpl.R." + "-- MixedLang: No enabled dependencies!" + "-- WithSubpackagesA_LIB_ENABLED_DEPENDENCIES: SimpleCxx.R." + "-- WithSubpackagesB_LIB_ENABLED_DEPENDENCIES: SimpleCxx.R. WithSubpackagesA.O." + "-- WithSubpackagesC_LIB_ENABLED_DEPENDENCIES: WithSubpackagesA.R. WithSubpackagesB.R." + "-- WithSubpackages_LIB_ENABLED_DEPENDENCIES: WithSubpackagesA.R. WithSubpackagesB.O. WithSubpackagesC.O." + "-- WrapExternal: No enabled dependencies!" + "Final set of enabled top-level packages: SimpleCxx WithSubpackages 2" "Final set of enabled packages: SimpleCxx WithSubpackagesA WithSubpackagesB WithSubpackagesC WithSubpackages 5" "Final set of enabled external packages/TPLs: ${FINAL_ENABLED_TPLS}" "Final set of non-enabled top-level packages: MixedLang WrapExternal 2" + "Processing enabled external package/TPL: HeaderOnlyTpl" "-- File Trace: TPL INCLUDE .+/TribitsExampleProject/cmake/tpls/FindTPLHeaderOnlyTpl.cmake" "-- TPL_HeaderOnlyTpl_INCLUDE_DIRS='.+/examples/tpls/HeaderOnlyTpl'" + "Performing Test HAVE_SIMPLECXX___INT64" "Configuring done" "Generating done" + "Build files have been written to: .*ExamplesUnitTests/${testName}" "-- File Trace: PROJECT INCLUDE .*/TribitsExampleProject/Version.cmake" "-- File Trace: REPOSITORY INCLUDE .*/TribitsExampleProject/cmake/CallbackSetupExtraOptions.cmake" diff --git a/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake b/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake index b01fc2116..c53f1ce07 100644 --- a/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake +++ b/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake @@ -42,6 +42,7 @@ include(TribitsProcessPackagesAndDirsLists) include(TribitsAddOptionAndDefine) include(TribitsGeneralMacros) include(TribitsPrintEnabledPackagesLists) +include(TribitsPrintDependencyInfo) include(TribitsPackageDependencies) include(AdvancedOption) @@ -387,8 +388,7 @@ macro(tribits_setup_direct_packages_dependencies_lists_and_lib_required_enable_v foreach(tad1_internalPkgName IN LISTS ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES ) - tribits_setup_direct_package_dependencies_lists_and_lib_required_enable_vars( - ${tad1_internalPkgName}) + tribits_setup_enabled_dependencies_lists_and_enable_vars(${tad1_internalPkgName}) endforeach() endmacro() @@ -398,10 +398,8 @@ endmacro() # macro(tribits_print_direct_packages_dependencies_lists) if (${PROJECT_NAME}_DUMP_PACKAGE_DEPENDENCIES) - message("\nDumping direct dependencies for each package ...") - foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_DEFINED_TPLS - ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES - ) + 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() @@ -759,17 +757,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 @@ -783,17 +775,13 @@ 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 - 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}) @@ -803,14 +791,12 @@ macro(tribits_setup_direct_package_dependencies_lists_and_lib_required_enable_va # 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}) @@ -818,7 +804,6 @@ macro(tribits_setup_direct_package_dependencies_lists_and_lib_required_enable_va 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}) endif() @@ -826,7 +811,6 @@ macro(tribits_setup_direct_package_dependencies_lists_and_lib_required_enable_va # TEST dependencies - set(${packageName}_TEST_DEFINED_DEPENDENCIES "") set(${packageName}_TEST_ENABLED_DEPENDENCIES "") if (${PROJECT_NAME}_ENABLE_${packageName} @@ -839,28 +823,24 @@ macro(tribits_setup_direct_package_dependencies_lists_and_lib_required_enable_va 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() @@ -877,12 +857,13 @@ endmacro() # 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() diff --git a/tribits/core/package_arch/TribitsPrintDependencyInfo.cmake b/tribits/core/package_arch/TribitsPrintDependencyInfo.cmake index 6f86ec103..876d80c18 100644 --- a/tribits/core/package_arch/TribitsPrintDependencyInfo.cmake +++ b/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() @@ -170,8 +170,8 @@ function(tribits_print_package_dependencies packageName) message("") endif() - tribits_print_nonempty_package_defined_deps_list(${packageName} LIB printedVar) - tribits_print_nonempty_package_defined_deps_list(${packageName} TEST printedVar) + 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 @@ -180,9 +180,8 @@ function(tribits_print_package_dependencies packageName) printedVar) endif() - if (NOT printedVar) - message("-- ${packageName}: No dependencies!") + message("-- ${packageName}: No defined dependencies!") endif() endfunction() @@ -193,7 +192,7 @@ endfunction() # # Usage:: # -# tribits_print_nonempty_package_defined_deps_list( +# tribits_print_nonempty_package_deps_list( # ) # # which prints out the list:: @@ -202,10 +201,10 @@ endfunction() # # if it is non-empty. # -function(tribits_print_nonempty_package_defined_deps_list packageName libOrTest - printedListOut +function(tribits_print_nonempty_package_deps_list packageName + libOrTest definedOrEnabled printedListOut ) - set(depsListName ${packageName}_${libOrTest}_DEFINED_DEPENDENCIES) + set(depsListName ${packageName}_${libOrTest}_${definedOrEnabled}_DEPENDENCIES) if (NOT "${${depsListName}}" STREQUAL "") set(lineStr "-- ${depsListName}:") foreach (depPkg IN LISTS ${depsListName}) diff --git a/tribits/core/package_arch/TribitsReadDepsFilesCreateDepsGraph.cmake b/tribits/core/package_arch/TribitsReadDepsFilesCreateDepsGraph.cmake index ae1094ff4..ff59762e8 100644 --- a/tribits/core/package_arch/TribitsReadDepsFilesCreateDepsGraph.cmake +++ b/tribits/core/package_arch/TribitsReadDepsFilesCreateDepsGraph.cmake @@ -38,6 +38,7 @@ # @HEADER include(TribitsPackageDefineDependencies) +include(TribitsPackageDependencies) include(SetDefault) include(DualScopeSet) @@ -486,12 +487,12 @@ macro(tribits_process_package_dependencies_lists packageName) # Fill the backward dependency vars tribits_set_dep_packages(${packageName} LIB REQUIRED PACKAGES) - tribits_set_dep_packages(${packageName} LIB REQUIRED TPLS) 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 REQUIRED TPLS) 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 legacy vars #63 diff --git a/tribits/doc/guides/ReducedMockTrilinosOutput/ExpectedDependencies.txt b/tribits/doc/guides/ReducedMockTrilinosOutput/ExpectedDependencies.txt index 3d636a3b9..d181a874e 100644 --- a/tribits/doc/guides/ReducedMockTrilinosOutput/ExpectedDependencies.txt +++ b/tribits/doc/guides/ReducedMockTrilinosOutput/ExpectedDependencies.txt @@ -42,46 +42,40 @@ Package dependencies information: -- Thyra_LIB_REQUIRED_DEP_PACKAGES: ThyraCoreLibs -- Thyra_LIB_OPTIONAL_DEP_PACKAGES: ThyraGoodStuff ThyraCrazyStuff ThyraEpetra ThyraEpetraExt -Dumping direct dependencies for each package ... +Dumping direct enabled dependencies for each package ... --- MPI_LIB_DEFINED_DEPENDENCIES: +-- MPI: No enabled dependencies! --- BLAS_LIB_DEFINED_DEPENDENCIES: +-- BLAS: No enabled dependencies! --- LAPACK_LIB_DEFINED_DEPENDENCIES: +-- LAPACK_LIB_ENABLED_DEPENDENCIES: BLAS[O] --- Boost_LIB_DEFINED_DEPENDENCIES: +-- Boost: No enabled dependencies! --- UMFPACK_LIB_DEFINED_DEPENDENCIES: +-- UMFPACK: No enabled dependencies! --- AMD_LIB_DEFINED_DEPENDENCIES: +-- AMD: No enabled dependencies! --- PETSC_LIB_DEFINED_DEPENDENCIES: +-- PETSC: No enabled dependencies! --- Teuchos_LIB_ENABLED_DEPENDENCIES: BLAS LAPACK --- Teuchos_LIB_DEFINED_DEPENDENCIES: BLAS LAPACK Boost MPI +-- Teuchos_LIB_ENABLED_DEPENDENCIES: BLAS[R] LAPACK[R] --- RTOp_LIB_ENABLED_DEPENDENCIES: Teuchos --- RTOp_LIB_DEFINED_DEPENDENCIES: Teuchos +-- RTOp_LIB_ENABLED_DEPENDENCIES: Teuchos[R] --- Epetra_LIB_ENABLED_DEPENDENCIES: BLAS LAPACK --- Epetra_LIB_DEFINED_DEPENDENCIES: BLAS LAPACK MPI +-- Epetra_LIB_ENABLED_DEPENDENCIES: BLAS[R] LAPACK[R] --- Triutils_LIB_DEFINED_DEPENDENCIES: Epetra +-- Triutils: No enabled dependencies! --- EpetraExt_LIB_DEFINED_DEPENDENCIES: Teuchos Epetra Triutils UMFPACK AMD PETSC +-- EpetraExt: No enabled dependencies! --- ThyraCoreLibs_LIB_ENABLED_DEPENDENCIES: Teuchos RTOp --- ThyraCoreLibs_LIB_DEFINED_DEPENDENCIES: Teuchos RTOp +-- ThyraCoreLibs_LIB_ENABLED_DEPENDENCIES: Teuchos[R] RTOp[R] --- ThyraGoodStuff_LIB_DEFINED_DEPENDENCIES: ThyraCoreLibs +-- ThyraGoodStuff: No enabled dependencies! --- ThyraCrazyStuff_LIB_DEFINED_DEPENDENCIES: ThyraGoodStuff +-- ThyraCrazyStuff: No enabled dependencies! --- ThyraEpetra_LIB_ENABLED_DEPENDENCIES: Epetra ThyraCoreLibs --- ThyraEpetra_LIB_DEFINED_DEPENDENCIES: Epetra ThyraCoreLibs +-- ThyraEpetra_LIB_ENABLED_DEPENDENCIES: Epetra[R] ThyraCoreLibs[R] --- ThyraEpetraExt_LIB_DEFINED_DEPENDENCIES: ThyraEpetra EpetraExt +-- ThyraEpetraExt: No enabled dependencies! --- Thyra_LIB_ENABLED_DEPENDENCIES: ThyraCoreLibs ThyraEpetra --- Thyra_LIB_DEFINED_DEPENDENCIES: ThyraCoreLibs ThyraGoodStuff ThyraCrazyStuff ThyraEpetra ThyraEpetraExt +-- Thyra_LIB_ENABLED_DEPENDENCIES: ThyraCoreLibs[R] ThyraEpetra[O] diff --git a/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLLAPACKDependencies.cmake b/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLLAPACKDependencies.cmake new file mode 100644 index 000000000..0256dbbfd --- /dev/null +++ b/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLLAPACKDependencies.cmake @@ -0,0 +1,2 @@ +tribits_extpkg_define_dependencies( LAPACK + DEPENDENCIES BLAS) diff --git a/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLParMETISDependencies.cmake b/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLParMETISDependencies.cmake new file mode 100644 index 000000000..d999aca2b --- /dev/null +++ b/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLParMETISDependencies.cmake @@ -0,0 +1,2 @@ +tribits_extpkg_define_dependencies( ParMETIS + DEPENDENCIES METIS) diff --git a/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLSuperLUDependencies.cmake b/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLSuperLUDependencies.cmake new file mode 100644 index 000000000..47a938258 --- /dev/null +++ b/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLSuperLUDependencies.cmake @@ -0,0 +1,2 @@ +tribits_extpkg_define_dependencies( SuperLU + DEPENDENCIES ParMETIS BLAS) diff --git a/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLSuperLUDistDependencies.cmake b/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLSuperLUDistDependencies.cmake new file mode 100644 index 000000000..d0419545d --- /dev/null +++ b/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLSuperLUDistDependencies.cmake @@ -0,0 +1,2 @@ +tribits_extpkg_define_dependencies( SuperLUDist + DEPENDENCIES ParMETIS BLAS) diff --git a/tribits/examples/ReducedMockTrilinos/TPLsList.cmake b/tribits/examples/ReducedMockTrilinos/TPLsList.cmake index 542b88f79..4de9acf2a 100644 --- a/tribits/examples/ReducedMockTrilinos/TPLsList.cmake +++ b/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 From 1576baeb09a43449e915fb92d3e61d924511ad4d Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Wed, 19 Oct 2022 10:53:22 -0600 Subject: [PATCH 05/35] Add some more checks and adjust code for setting _PACKAGE_BUILD_STATUS (#63) Turns out that this var was already being set for external and internal packages. I just added some more printouts and another test for this. (I have no memory of having set this.) --- test/core/DependencyUnitTests/CMakeLists.txt | 37 ++++++++++++++++++- .../TribitsProcessPackagesAndDirsLists.cmake | 18 ++++++--- .../TribitsProcessTplsLists.cmake | 10 +++-- ...itsSystemDataStructuresMacrosFunctions.rst | 1 + tribits/doc/guides/TribitsGuidesBody.rst | 2 + 5 files changed, 57 insertions(+), 11 deletions(-) diff --git a/test/core/DependencyUnitTests/CMakeLists.txt b/test/core/DependencyUnitTests/CMakeLists.txt index 0288b9479..eee01bd77 100644 --- a/test/core/DependencyUnitTests/CMakeLists.txt +++ b/test/core/DependencyUnitTests/CMakeLists.txt @@ -383,13 +383,48 @@ create_reduced_dependency_handling_test_case( "MPI_FINDMOD='.*/ReducedMockTrilinos/../../core/std_tpls/FindTPLMPI.cmake'" "MPI_TESTGROUP='PT'" "MPI_TPLS_LIST_FILE='.*/ReducedMockTrilinos/TPLsList.cmake'" + "MPI_PACKAGE_BUILD_STATUS='EXTERNAL'" "AMD_FINDMOD='cmake/TPLs/FindTPLAMD.cmake'" "AMD_TESTGROUP='EX'" "AMD_TPLS_LIST_FILE='.*/ReducedMockTrilinos/TPLsList.cmake'" + "AMD_PACKAGE_BUILD_STATUS='EXTERNAL'" "PETSC_FINDMOD='.*/ReducedMockTrilinos/../../common_tpls/FindTPLPETSC.cmake'" "PETSC_TESTGROUP='ST'" "PETSC_TPLS_LIST_FILE='.*/ReducedMockTrilinos/TPLsList.cmake'" - ) + "PETSC_PACKAGE_BUILD_STATUS='EXTERNAL'" + "-- Teuchos_SOURCE_DIR='.*/ReducedMockTrilinos/packages/teuchos'" + "-- Teuchos_REL_SOURCE_DIR='packages/teuchos'" + "-- Teuchos_PARENT_PACKAGE=''" + "-- Teuchos_PARENT_REPOSITORY='Trilinos'" + "-- Teuchos_PACKAGE_BUILD_STATUS='INTERNAL'" + "-- RTOp_SOURCE_DIR='.*/ReducedMockTrilinos/packages/rtop'" + "-- RTOp_REL_SOURCE_DIR='packages/rtop'" + "-- RTOp_PARENT_PACKAGE=''" + "-- RTOp_PARENT_REPOSITORY='Trilinos'" + "-- RTOp_PACKAGE_BUILD_STATUS='INTERNAL'" + "-- Epetra_SOURCE_DIR='.*/ReducedMockTrilinos/packages/epetra'" + "-- Epetra_REL_SOURCE_DIR='packages/epetra'" + "-- Epetra_PARENT_PACKAGE=''" + "-- Epetra_PARENT_REPOSITORY='Trilinos'" + "-- Epetra_PACKAGE_BUILD_STATUS='INTERNAL'" + "-- Triutils_SOURCE_DIR='.*/ReducedMockTrilinos/packages/triutils'" + "-- Triutils_REL_SOURCE_DIR='packages/triutils'" + "-- Triutils_PARENT_PACKAGE=''" + "-- Triutils_PARENT_REPOSITORY='Trilinos'" + "-- Triutils_PACKAGE_BUILD_STATUS='INTERNAL'" + "-- EpetraExt_SOURCE_DIR='.*/ReducedMockTrilinos/packages/epetraext'" + "-- EpetraExt_REL_SOURCE_DIR='packages/epetraext'" + "-- EpetraExt_PARENT_PACKAGE=''" + "-- EpetraExt_PARENT_REPOSITORY='Trilinos'" + "-- EpetraExt_PACKAGE_BUILD_STATUS='INTERNAL'" + "-- Thyra_SOURCE_DIR='.*/ReducedMockTrilinos/packages/thyra'" + "-- Thyra_REL_SOURCE_DIR='packages/thyra'" + "-- Thyra_PARENT_PACKAGE=''" + "-- Thyra_PARENT_REPOSITORY='Trilinos'" + "-- Thyra_PACKAGE_BUILD_STATUS='INTERNAL'" + ) + # NOTE: The above test directly checks some low-level variables that are not + # checked in other unit tests. # diff --git a/tribits/core/package_arch/TribitsProcessPackagesAndDirsLists.cmake b/tribits/core/package_arch/TribitsProcessPackagesAndDirsLists.cmake index 4e7116abd..d92bc9f37 100644 --- a/tribits/core/package_arch/TribitsProcessPackagesAndDirsLists.cmake +++ b/tribits/core/package_arch/TribitsProcessPackagesAndDirsLists.cmake @@ -386,12 +386,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. @@ -559,15 +562,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( @@ -581,10 +583,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) diff --git a/tribits/core/package_arch/TribitsProcessTplsLists.cmake b/tribits/core/package_arch/TribitsProcessTplsLists.cmake index 0a9c2ea48..611dcf3f7 100644 --- a/tribits/core/package_arch/TribitsProcessTplsLists.cmake +++ b/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/tribits/core/package_arch/TribitsSystemDataStructuresMacrosFunctions.rst b/tribits/core/package_arch/TribitsSystemDataStructuresMacrosFunctions.rst index cb08dd7f6..a87210537 100644 --- a/tribits/core/package_arch/TribitsSystemDataStructuresMacrosFunctions.rst +++ b/tribits/core/package_arch/TribitsSystemDataStructuresMacrosFunctions.rst @@ -452,6 +452,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:: diff --git a/tribits/doc/guides/TribitsGuidesBody.rst b/tribits/doc/guides/TribitsGuidesBody.rst index f6ab1b1b7..1bac8b79c 100644 --- a/tribits/doc/guides/TribitsGuidesBody.rst +++ b/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 From f59c124579d621d7c576ef9fa9189e5d365912fa Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Wed, 19 Oct 2022 11:27:02 -0600 Subject: [PATCH 06/35] Remove unused var _REVERSE_DEFINED_INTERNAL_TOPLEVEL_PACKAGES (#63) There is no usage for this varaible. Removing it just removes clutter and future possible problems. --- test/core/CMakeLists.txt | 2 +- .../TribitsProcessPackagesAndDirsLists_UnitTests.cmake | 8 +------- .../package_arch/TribitsProcessPackagesAndDirsLists.cmake | 7 ------- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/test/core/CMakeLists.txt b/test/core/CMakeLists.txt index 0f987cc7a..3d32a93ca 100644 --- a/test/core/CMakeLists.txt +++ b/test/core/CMakeLists.txt @@ -75,7 +75,7 @@ tribits_add_advanced_test( TribitsProcessPackagesAndDirsLists_UnitTests -D${PROJECT_NAME}_TRIBITS_DIR=${${PROJECT_NAME}_TRIBITS_DIR} -P "${CMAKE_CURRENT_SOURCE_DIR}/TribitsProcessPackagesAndDirsLists_UnitTests.cmake" PASS_REGULAR_EXPRESSION_ALL - "Final UnitTests Result: num_run = 34" + "Final UnitTests Result: num_run = 31" "Final UnitTests Result: PASSED" ) diff --git a/test/core/TribitsProcessPackagesAndDirsLists_UnitTests.cmake b/test/core/TribitsProcessPackagesAndDirsLists_UnitTests.cmake index ed7b4a5e8..e6519d439 100644 --- a/test/core/TribitsProcessPackagesAndDirsLists_UnitTests.cmake +++ b/test/core/TribitsProcessPackagesAndDirsLists_UnitTests.cmake @@ -80,8 +80,6 @@ function(unittest_basic_package_list_read) "Package0;Package1;Package2") unittest_compare_const( ${PROJECT_NAME}_NUM_DEFINED_INTERNAL_TOPLEVEL_PACKAGES 3 ) unittest_compare_const( ${PROJECT_NAME}_LAST_DEFINED_INTERNAL_TOPLEVEL_PACKAGE_IDX 2 ) - unittest_compare_const( ${PROJECT_NAME}_REVERSE_DEFINED_INTERNAL_TOPLEVEL_PACKAGES - "Package2;Package1;Package0") unittest_compare_const( Package0_SOURCE_DIR ${PROJECT_SOURCE_DIR}/packages/package0 ) unittest_compare_const( Package1_SOURCE_DIR ${PROJECT_SOURCE_DIR}/packages/package1 ) unittest_compare_const( Package2_SOURCE_DIR ${PROJECT_SOURCE_DIR}/packages/package2 ) @@ -123,8 +121,6 @@ function(unittest_basic_package_list_read_abs_pacakge_dir) "Package0;Package1;Package2") unittest_compare_const( ${PROJECT_NAME}_NUM_DEFINED_INTERNAL_TOPLEVEL_PACKAGES 3 ) unittest_compare_const( ${PROJECT_NAME}_LAST_DEFINED_INTERNAL_TOPLEVEL_PACKAGE_IDX 2 ) - unittest_compare_const( ${PROJECT_NAME}_REVERSE_DEFINED_INTERNAL_TOPLEVEL_PACKAGES - "Package2;Package1;Package0") unittest_compare_const( Package0_TESTGROUP PT) unittest_compare_const( Package1_TESTGROUP ST) unittest_compare_const( Package2_TESTGROUP EX) @@ -153,8 +149,6 @@ function(unittest_basic_package_list_read_ps_ss_backward_compatible) "Package0;Package1;Package2") unittest_compare_const( ${PROJECT_NAME}_NUM_DEFINED_INTERNAL_TOPLEVEL_PACKAGES 3 ) unittest_compare_const( ${PROJECT_NAME}_LAST_DEFINED_INTERNAL_TOPLEVEL_PACKAGE_IDX 2 ) - unittest_compare_const( ${PROJECT_NAME}_REVERSE_DEFINED_INTERNAL_TOPLEVEL_PACKAGES - "Package2;Package1;Package0") unittest_compare_const( Package0_TESTGROUP PT) unittest_compare_const( Package1_TESTGROUP ST) unittest_compare_const( Package2_TESTGROUP EX) @@ -236,4 +230,4 @@ unittest_elevate_st_to_pt() unittest_elevate_ss_to_ps_backward_compatible() # Pass in the number of expected tests that must pass! -unittest_final_result(34) +unittest_final_result(31) diff --git a/tribits/core/package_arch/TribitsProcessPackagesAndDirsLists.cmake b/tribits/core/package_arch/TribitsProcessPackagesAndDirsLists.cmake index d92bc9f37..472a0f4ca 100644 --- a/tribits/core/package_arch/TribitsProcessPackagesAndDirsLists.cmake +++ b/tribits/core/package_arch/TribitsProcessPackagesAndDirsLists.cmake @@ -378,7 +378,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 @@ -606,12 +605,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) From c11a64694e65bfb2e0241f6aa0a3255c0e2be99a Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Wed, 19 Oct 2022 16:22:45 -0600 Subject: [PATCH 07/35] WIP: Refactor tribits_sweep_forward_apply_disables(), fix TPL fwd deps (#63) This refactors just the macro tribits_sweep_forward_apply_disables() and the macro it calls to use the new deps lists. But a lot of infrastructure had to be set up to do this and some defects had to be fixed in the new data-structures. This commit includes: * Created new macro tribits_append_legacy_forward_dep_packages() from the existing macro tribits_append_forward_dep_packages() that only updates the legacy lists and the updated macro tribits_append_forward_dep_packages() was refactored to only update the new lists (and just reads `_[LIB|TEST]_DEFINED_DEPENDENCIES`). * Populated `_FORWARD_LIB_DEFINED_DEPENDENCIES` for external packages/TPLs * Reordered `_[LIB|TEST]_DEFINED_DEPENDENCIES` to add defined internal packages first and then defined external packages * Changed so that hard disables of upstream TPLs disable downstream TPLs in addition to disabling downstream internal packages. (Forward disables TPL_ENABLE_=OFF instead of _ENABLE_=OFF. Added tribits/CHANGLOG.md for this change in behavior that might break backward compatibility for some rare cases. Removed enable/disable behavior "TPL disable triggers auto-disables of downstream dependencies" and updated "Package disable triggers auto-disables of downstream dependencies" to handle both external and internal packages.) * Now, messages printed for the disables of downstream packages for disabled required upstream TPLs say "package" instead of "TPL" in the messages "... dependence on disabled package ". (Hopefully that will not break any backwards compatibility for any users who might be grepping for this but it did impact tests that had to be updated.) * Added new module TribitsGetPackageEnableStatus.cmake with new function tribits_get_package_enable_status() that will make refactoring the rest of the code easier and compact it. * Updated local var names in some macros and functions * Added and updated tests for all of these changes Hopefully the rest of the refactorings will go more smoothly now. --- test/core/DependencyUnitTests/CMakeLists.txt | 27 ++-- ...sts_EnableAllPackages_DumpDependencies.txt | 45 +++--- .../MockCTestDriver/CMakeLists.txt | 2 +- tribits/CHANGELOG.md | 14 +- .../TribitsAdjustPackageEnables.cmake | 146 +++++++----------- .../TribitsGetPackageEnableStatus.cmake | 134 ++++++++++++++++ .../TribitsPrintDependencyInfo.cmake | 2 +- .../TribitsReadDepsFilesCreateDepsGraph.cmake | 83 +++++++--- .../ExpectedDependencies.txt | 61 +++++++- tribits/doc/guides/TribitsGuidesBody.rst | 95 +++++------- 10 files changed, 406 insertions(+), 203 deletions(-) create mode 100644 tribits/core/package_arch/TribitsGetPackageEnableStatus.cmake diff --git a/test/core/DependencyUnitTests/CMakeLists.txt b/test/core/DependencyUnitTests/CMakeLists.txt index eee01bd77..2fea69e90 100644 --- a/test/core/DependencyUnitTests/CMakeLists.txt +++ b/test/core/DependencyUnitTests/CMakeLists.txt @@ -365,6 +365,7 @@ create_reduced_dependency_handling_test_case( ARGS -DTrilinos_ENABLE_ALL_PACKAGES:BOOL=ON -DTrilinos_DUMP_PACKAGE_DEPENDENCIES:BOOL=ON + -DTrilinos_DUMP_FORWARD_PACKAGE_DEPENDENCIES:BOOL=ON PASS_REGULAR_EXPRESSION_ALL ${REDUCED_EXPECTED_DEPENDENCIES_REGEX_ARRAY} ${REDUCED_EnableAllPackages_REGEX_ARRAY} @@ -470,8 +471,8 @@ create_reduced_dependency_handling_test_case( -DTrilinos_ENABLE_TESTS=ON -DTPL_ENABLE_AMD=OFF PASS_REGULAR_EXPRESSION_ALL - "-- Setting EpetraExt_ENABLE_TESTS=OFF because EpetraExt has a required test/example dependence on disabled TPL AMD" - "-- Setting EpetraExt_ENABLE_EXAMPLES=OFF because EpetraExt has a required test/example dependence on disabled TPL AMD" + "-- Setting EpetraExt_ENABLE_TESTS=OFF because EpetraExt has a required test/example dependence on disabled package AMD" + "-- Setting EpetraExt_ENABLE_EXAMPLES=OFF because EpetraExt has a required test/example dependence on disabled package AMD" "-- Setting Trilinos_ENABLE_ThyraEpetraExt=ON" "Processing enabled top-level package: Triutils [(]Libs, Tests, Examples[)]" "Processing enabled top-level package: EpetraExt [(]Libs[)]" @@ -753,13 +754,19 @@ create_dependency_handling_test_case( TestTrueFalse ARGS -DTrilinos_ENABLE_ALL_PACKAGES=TRUE -DTrilinos_ENABLE_Zoltan=TRUE -DTrilinos_ENABLE_TEST=TRUE -DTPL_ENABLE_BLAS=FALSE -# -DTrilinos_VERBOSE_CONFIGURE=TRUE + #-DTrilinos_DUMP_PACKAGE_DEPENDENCIES:BOOL=ON + #-DTrilinos_DUMP_FORWARD_PACKAGE_DEPENDENCIES:BOOL=ON + #-DTrilinos_VERBOSE_CONFIGURE=TRUE PASS_REGULAR_EXPRESSION_ALL "Explicitly enabled top-level packages on input .by user.: Zoltan 1" "Explicitly disabled top-level packages on input .by user or by default.: Stokhos 1" "Explicitly disabled external packages/TPLs on input .by user or by default.: MPI BLAS 2" - "Setting Trilinos_ENABLE_Teuchos=OFF because Teuchos has a required library dependence on disabled TPL BLAS" - "Setting Trilinos_ENABLE_TrilinosFramework=ON" + "-- Setting TPL_ENABLE_LAPACK=OFF because LAPACK has a required library dependence on disabled package BLAS" + "-- Setting TPL_ENABLE_SuperLUDist=OFF because SuperLUDist has a required library dependence on disabled package BLAS" + "-- Setting TPL_ENABLE_SuperLU=OFF because SuperLU has a required library dependence on disabled package BLAS" + "-- Setting Trilinos_ENABLE_Teuchos=OFF because Teuchos has a required library dependence on disabled package BLAS" + "-- Setting Trilinos_ENABLE_Epetra=OFF because Epetra has a required library dependence on disabled package BLAS" + "-- Setting Trilinos_ENABLE_TrilinosFramework=ON" "Final set of enabled top-level packages: TrilinosFramework Zoltan Shards 3" "Final set of enabled packages: TrilinosFramework Zoltan Shards 3" "Final set of non-enabled top-level packages: Teuchos RTOp Epetra Triutils Tpetra EpetraExt Stokhos Sacado Thyra Isorropia AztecOO Galeri Amesos Intrepid Ifpack ML Belos Stratimikos RBGen Phalanx Panzer 21" @@ -1038,7 +1045,9 @@ create_dependency_handling_test_case( EnableZoltan_ZoltanEnableParMETIS_TplDisableParMETIS ARGS -DTrilinos_ENABLE_Zoltan=ON -DZoltan_ENABLE_ParMETIS=ON -DTPL_ENABLE_ParMETIS=OFF PASS_REGULAR_EXPRESSION_ALL - "NOTE: Setting Zoltan_ENABLE_ParMETIS=OFF which was ON since TPL_ENABLE_ParMETIS=OFF" + "-- Setting TPL_ENABLE_SuperLUDist=OFF because SuperLUDist has a required library dependence on disabled package ParMETIS" + "-- Setting TPL_ENABLE_SuperLU=OFF because SuperLU has a required library dependence on disabled package ParMETIS" + "-- NOTE: Setting Zoltan_ENABLE_ParMETIS=OFF which was ON because Zoltan has an optional library dependence on disabled package ParMETIS" "Final set of enabled external packages/TPLs: 0" ) @@ -1048,7 +1057,7 @@ create_dependency_handling_test_case( ARGS -DTrilinos_ENABLE_Panzer=ON -DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=OFF PASS_REGULAR_EXPRESSION_ALL - "Setting Trilinos_ENABLE_Panzer=OFF which was 'ON' because Panzer has a required library dependence on disabled TPL MPI!" + "Setting Trilinos_ENABLE_Panzer=OFF which was 'ON' because Panzer has a required library dependence on disabled package MPI!" ) @@ -1068,7 +1077,7 @@ create_dependency_handling_test_case( -DTPL_ENABLE_MPI:BOOL=OFF -DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=OFF PASS_REGULAR_EXPRESSION_ALL - "ERROR: Setting Trilinos_ENABLE_Panzer=OFF which was 'ON' because Panzer has a required library dependence on disabled TPL MPI!" + "ERROR: Setting Trilinos_ENABLE_Panzer=OFF which was 'ON' because Panzer has a required library dependence on disabled package MPI!" "Configuring incomplete, errors occurred!" ) @@ -1080,7 +1089,7 @@ create_dependency_handling_test_case( -DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=OFF -DTrilinos_DISABLE_ENABLED_FORWARD_DEP_PACKAGES=ON PASS_REGULAR_EXPRESSION_ALL - "NOTE: Setting Trilinos_ENABLE_Panzer=OFF which was 'ON' because Panzer has a required library dependence on disabled TPL MPI but Trilinos_DISABLE_ENABLED_FORWARD_DEP_PACKAGES=ON" + "NOTE: Setting Trilinos_ENABLE_Panzer=OFF which was 'ON' because Panzer has a required library dependence on disabled package MPI but Trilinos_DISABLE_ENABLED_FORWARD_DEP_PACKAGES=ON" "Final set of enabled top-level packages: 0" "Final set of non-enabled top-level packages: .+ Panzer .+" ) diff --git a/test/core/DependencyUnitTests/DepTests_EnableAllPackages_DumpDependencies.txt b/test/core/DependencyUnitTests/DepTests_EnableAllPackages_DumpDependencies.txt index 8d216faa0..bcf3ebfbb 100644 --- a/test/core/DependencyUnitTests/DepTests_EnableAllPackages_DumpDependencies.txt +++ b/test/core/DependencyUnitTests/DepTests_EnableAllPackages_DumpDependencies.txt @@ -15,43 +15,50 @@ Package dependencies information: -- Trilinos_DEFINED_PACKAGES: MPI BLAS LAPACK Boost Scotch METIS ParMETIS CppUnit ADOLC ADIC TVMET y12m SuperLUDist SuperLU UMFPACK AMD PETSC MUMPS DUMMY TrilinosFramework Teuchos RTOp Epetra Zoltan Shards Triutils Tpetra EpetraExt Stokhos Sacado ThyraCoreLibs ThyraGoodStuff ThyraCrazyStuff ThyraEpetra ThyraEpetraExt ThyraTpetra Thyra Isorropia AztecOO Galeri Amesos Intrepid Ifpack ML Belos Stratimikos RBGen Phalanx Panzer -- Trilinos_NUM_DEFINED_PACKAGES='49' --- MPI: No defined dependencies! +-- MPI_FORWARD_LIB_DEFINED_DEPENDENCIES: Teuchos[O] Epetra[O] Zoltan[O] ML[O] Panzer[R] +-- MPI_FORWARD_TEST_DEFINED_DEPENDENCIES: TrilinosFramework[O] --- BLAS: No defined dependencies! +-- BLAS_FORWARD_LIB_DEFINED_DEPENDENCIES: LAPACK[R] SuperLUDist[R] SuperLU[R] Teuchos[R] Epetra[R] ML[R] --- LAPACK_LIB_DEFINED_DEPENDENCIES: BLAS[O] +-- LAPACK_LIB_DEFINED_DEPENDENCIES: BLAS[R] +-- LAPACK_FORWARD_LIB_DEFINED_DEPENDENCIES: Teuchos[R] Epetra[R] ML[R] --- Boost: No defined dependencies! +-- Boost_FORWARD_LIB_DEFINED_DEPENDENCIES: Teuchos[O] Phalanx[R] Panzer[R] --- Scotch: No defined dependencies! +-- Scotch_FORWARD_LIB_DEFINED_DEPENDENCIES: Zoltan[O] --- METIS: No defined dependencies! +-- METIS_FORWARD_LIB_DEFINED_DEPENDENCIES: ParMETIS[R] ML[O] +-- METIS_FORWARD_TEST_DEFINED_DEPENDENCIES: ML[O] --- ParMETIS_LIB_DEFINED_DEPENDENCIES: METIS[O] +-- ParMETIS_LIB_DEFINED_DEPENDENCIES: METIS[R] +-- ParMETIS_FORWARD_LIB_DEFINED_DEPENDENCIES: SuperLUDist[R] SuperLU[R] Zoltan[O] Amesos[O] ML[O] +-- ParMETIS_FORWARD_TEST_DEFINED_DEPENDENCIES: ML[O] --- CppUnit: No defined dependencies! +-- CppUnit_FORWARD_TEST_DEFINED_DEPENDENCIES: Sacado[O] --- ADOLC: No defined dependencies! +-- ADOLC_FORWARD_TEST_DEFINED_DEPENDENCIES: Sacado[O] -- ADIC: No defined dependencies! --- TVMET: No defined dependencies! +-- TVMET_FORWARD_TEST_DEFINED_DEPENDENCIES: Phalanx[O] --- y12m: No defined dependencies! +-- y12m_FORWARD_LIB_DEFINED_DEPENDENCIES: AztecOO[O] --- SuperLUDist_LIB_DEFINED_DEPENDENCIES: ParMETIS[O] BLAS[O] +-- SuperLUDist_LIB_DEFINED_DEPENDENCIES: ParMETIS[R] BLAS[R] +-- SuperLUDist_FORWARD_LIB_DEFINED_DEPENDENCIES: Amesos[O] --- SuperLU_LIB_DEFINED_DEPENDENCIES: ParMETIS[O] BLAS[O] +-- SuperLU_LIB_DEFINED_DEPENDENCIES: ParMETIS[R] BLAS[R] +-- SuperLU_FORWARD_LIB_DEFINED_DEPENDENCIES: Amesos[O] --- UMFPACK: No defined dependencies! +-- UMFPACK_FORWARD_LIB_DEFINED_DEPENDENCIES: EpetraExt[O] Amesos[O] --- AMD: No defined dependencies! +-- AMD_FORWARD_LIB_DEFINED_DEPENDENCIES: EpetraExt[O] --- PETSC: No defined dependencies! +-- PETSC_FORWARD_LIB_DEFINED_DEPENDENCIES: EpetraExt[O] ML[O] --- MUMPS: No defined dependencies! +-- MUMPS_FORWARD_LIB_DEFINED_DEPENDENCIES: Amesos[O] --- DUMMY: No defined dependencies! +-- DUMMY_FORWARD_LIB_DEFINED_DEPENDENCIES: RBGen[R] -- TrilinosFramework_TEST_OPTIONAL_DEP_TPLS: MPI @@ -306,7 +313,7 @@ Dumping direct enabled dependencies for each package ... -- BLAS: No enabled dependencies! --- LAPACK_LIB_ENABLED_DEPENDENCIES: BLAS[O] +-- LAPACK_LIB_ENABLED_DEPENDENCIES: BLAS[R] -- Boost: No enabled dependencies! diff --git a/test/ctest_driver/MockCTestDriver/CMakeLists.txt b/test/ctest_driver/MockCTestDriver/CMakeLists.txt index 1543ab821..720f112f2 100644 --- a/test/ctest_driver/MockCTestDriver/CMakeLists.txt +++ b/test/ctest_driver/MockCTestDriver/CMakeLists.txt @@ -230,7 +230,7 @@ create_ctest_dependency_handling_test_case( PASS_REGULAR_EXPRESSION_ALL "Explicitly enabled top-level packages on input .by user.: Teuchos 1" "Explicitly disabled external packages/TPLs on input .by user or by default.: BLAS 1" - "NOTE: Setting Trilinos_ENABLE_Teuchos=OFF which was 'ON' because Teuchos has a required library dependence on disabled TPL BLAS but Trilinos_DISABLE_ENABLED_FORWARD_DEP_PACKAGES=ON!" + "NOTE: Setting Trilinos_ENABLE_Teuchos=OFF which was 'ON' because Teuchos has a required library dependence on disabled package BLAS but Trilinos_DISABLE_ENABLED_FORWARD_DEP_PACKAGES=ON!" "Final set of enabled top-level packages: 0" "Trilinos_NUM_ENABLED_INTERNAL_TOPLEVEL_PACKAGES=0: Exiting the script!" ) diff --git a/tribits/CHANGELOG.md b/tribits/CHANGELOG.md index 438b7dc62..5b1147d33 100644 --- a/tribits/CHANGELOG.md +++ b/tribits/CHANGELOG.md @@ -2,6 +2,18 @@ ChangeLog for TriBITS ---------------------------------------- +## 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`, @@ -35,7 +47,7 @@ ChangeLog for TriBITS 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 +* **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). diff --git a/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake b/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake index c53f1ce07..b47e43ca3 100644 --- a/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake +++ b/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake @@ -44,6 +44,7 @@ include(TribitsGeneralMacros) include(TribitsPrintEnabledPackagesLists) include(TribitsPrintDependencyInfo) include(TribitsPackageDependencies) +include(TribitsGetPackageEnableStatus) include(AdvancedOption) include(AdvancedSet) @@ -147,10 +148,6 @@ macro(tribits_sweep_forward_apply_disables) tribits_get_nondisabled_list( ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES ${PROJECT_NAME} ${PROJECT_NAME}_NOTDISABLED_PACKAGES "") - foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_NOTDISABLED_PACKAGES) - tribits_disable_package_if_tpl_disabled(${tad1_tribitsPkg}) - endforeach() - 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) @@ -159,8 +156,9 @@ macro(tribits_sweep_forward_apply_disables) message("\nDisabling forward required packages and optional intra-package" " support that have a dependency on disabled packages" - " ${PROJECT_NAME}_ENABLE_=OFF ...\n") - foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_DEFINED_INTERNAL_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() @@ -414,31 +412,6 @@ endmacro() ################################################################################ -# Macro that disables a packages if its required upstream TPL is disabled. -# -macro(tribits_disable_package_if_tpl_disabled TRIBITS_PACKAGE) - - 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() - 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() - endforeach() - -endmacro() - - # Macro that disables all of the subpackages of a parent package. # macro(tribits_disable_parents_subpackages PARENT_PACKAGE_NAME) @@ -470,28 +443,27 @@ macro(tribits_disable_parents_subpackages PARENT_PACKAGE_NAME) endmacro() -# Macro that disables all forward packages that depend on the given packages +# Macro that disables forward package that depends on the passed-in package # -macro(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() - - foreach(FWD_DEP_PKG ${${PACKAGE_NAME}_FORWARD_LIB_OPTIONAL_DEP_PACKAGES}) - tribits_private_disable_optional_package_enables(${FWD_DEP_PKG} ${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(FWD_DEP_PKG ${${PACKAGE_NAME}_FORWARD_TEST_REQUIRED_DEP_PACKAGES}) - tribits_private_disable_required_package_enables(${FWD_DEP_PKG} ${PACKAGE_NAME} FALSE) + 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() @@ -979,76 +951,64 @@ function(tribits_private_print_disable_required_package_enable endfunction() +# Only turn off ${fwdDepPkgName} libraries or test/examples if it is currently +# enabled or could be enabled +# macro(tribits_private_disable_required_package_enables - FORWARD_DEP_PACKAGE_NAME PACKAGE_NAME LIBRARY_DEP + fwdDepPkgName packageName libraryDep ) - - # Only turn off FORWARD_DEP_PACKAGE libraries and test/examples if it - # is currently enabled or could be enabled - - 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") - + tribits_get_package_enable_status(${fwdDepPkgName} "" fwdDepPkgEnableVarName) + if (${fwdDepPkgEnableVarName} OR ${fwdDepPkgEnableVarName} STREQUAL "") + if ("${libraryDep}" STREQUAL "TRUE") tribits_private_print_disable_required_package_enable( - ${PACKAGE_NAME} ${PROJECT_NAME}_ENABLE_${FORWARD_DEP_PACKAGE_NAME} - ${FORWARD_DEP_PACKAGE_NAME} "library" ) - - set(${PROJECT_NAME}_ENABLE_${FORWARD_DEP_PACKAGE_NAME} OFF) - + ${packageName} ${fwdDepPkgEnableVarName} + ${fwdDepPkgName} "library" ) + set(${fwdDepPkgEnableVarName} OFF) else() - set(DEP_TYPE_STR "test/example") - - if (${FORWARD_DEP_PACKAGE_NAME}_ENABLE_TESTS - OR "${${FORWARD_DEP_PACKAGE_NAME}_ENABLE_TESTS}" STREQUAL "" + if (${fwdDepPkgName}_ENABLE_TESTS + OR "${${fwdDepPkgName}_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) + ${packageName} ${fwdDepPkgName}_ENABLE_TESTS + ${fwdDepPkgName} "${DEP_TYPE_STR}" ) + set(${fwdDepPkgName}_ENABLE_TESTS OFF) endif() - if (${FORWARD_DEP_PACKAGE_NAME}_ENABLE_EXAMPLES - OR "${${FORWARD_DEP_PACKAGE_NAME}_ENABLE_EXAMPLES}" STREQUAL "" + if (${fwdDepPkgName}_ENABLE_EXAMPLES + OR "${${fwdDepPkgName}_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) + ${packageName} ${fwdDepPkgName}_ENABLE_EXAMPLES + ${fwdDepPkgName} "${DEP_TYPE_STR}" ) + set(${fwdDepPkgName}_ENABLE_EXAMPLES OFF) endif() - endif() - endif() - endmacro() macro(tribits_private_disable_optional_package_enables - FORWARD_DEP_PACKAGE_NAME PACKAGE_NAME + fwdDepPkgName packageName ) - if (${FORWARD_DEP_PACKAGE_NAME}_ENABLE_${PACKAGE_NAME} OR "${${FORWARD_DEP_PACKAGE_NAME}_ENABLE_${PACKAGE_NAME}}" STREQUAL "") + if (${fwdDepPkgName}_ENABLE_${packageName} OR "${${fwdDepPkgName}_ENABLE_${packageName}}" STREQUAL "") # Always disable the conditional enable but only print the message if the package is enabled. - if (${PROJECT_NAME}_ENABLE_${FORWARD_DEP_PACKAGE_NAME}) - if (${FORWARD_DEP_PACKAGE_NAME}_ENABLE_${PACKAGE_NAME}) # is explicitly try already! + if (${PROJECT_NAME}_ENABLE_${fwdDepPkgName}) + if (${fwdDepPkgName}_ENABLE_${packageName}) # 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}") + "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 ${FORWARD_DEP_PACKAGE_NAME}_ENABLE_${PACKAGE_NAME}=OFF" - " because ${FORWARD_DEP_PACKAGE_NAME} has an optional library dependence" - " on disabled package ${PACKAGE_NAME}") + "Setting ${fwdDepPkgName}_ENABLE_${packageName}=OFF" + " because ${fwdDepPkgName} has an optional library dependence" + " on disabled package ${packageName}") endif() endif() - set(${FORWARD_DEP_PACKAGE_NAME}_ENABLE_${PACKAGE_NAME} OFF) + set(${fwdDepPkgName}_ENABLE_${packageName} OFF) endif() endmacro() diff --git a/tribits/core/package_arch/TribitsGetPackageEnableStatus.cmake b/tribits/core/package_arch/TribitsGetPackageEnableStatus.cmake new file mode 100644 index 000000000..3fac736a7 --- /dev/null +++ b/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/tribits/core/package_arch/TribitsPrintDependencyInfo.cmake b/tribits/core/package_arch/TribitsPrintDependencyInfo.cmake index 876d80c18..cbbb8095a 100644 --- a/tribits/core/package_arch/TribitsPrintDependencyInfo.cmake +++ b/tribits/core/package_arch/TribitsPrintDependencyInfo.cmake @@ -211,7 +211,7 @@ function(tribits_print_nonempty_package_deps_list packageName string(APPEND lineStr " ${depPkg}") if (${packageName}_${libOrTest}_DEP_REQUIRED_${depPkg}) string(APPEND lineStr "[R]") - else() + else() string(APPEND lineStr "[O]") endif() endforeach() diff --git a/tribits/core/package_arch/TribitsReadDepsFilesCreateDepsGraph.cmake b/tribits/core/package_arch/TribitsReadDepsFilesCreateDepsGraph.cmake index ff59762e8..ff3ac24f2 100644 --- a/tribits/core/package_arch/TribitsReadDepsFilesCreateDepsGraph.cmake +++ b/tribits/core/package_arch/TribitsReadDepsFilesCreateDepsGraph.cmake @@ -215,6 +215,10 @@ endmacro() # 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() @@ -223,6 +227,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() @@ -495,11 +503,15 @@ macro(tribits_process_package_dependencies_lists packageName) tribits_set_dep_packages(${packageName} TEST REQUIRED TPLS) tribits_set_dep_packages(${packageName} TEST OPTIONAL TPLS) - # Fill forward deps legacy vars #63 - tribits_append_forward_dep_packages(${packageName} LIB REQUIRED) - tribits_append_forward_dep_packages(${packageName} LIB OPTIONAL) - tribits_append_forward_dep_packages(${packageName} TEST REQUIRED) - tribits_append_forward_dep_packages(${packageName} TEST OPTIONAL) + # Fill legacy forward deps lists #63 + tribits_append_forward_dep_packages(${packageName} LIB) + tribits_append_forward_dep_packages(${packageName} TEST) + + # Fill legacy forward deps lists #63 + tribits_append_legacy_forward_dep_packages(${packageName} LIB REQUIRED) + tribits_append_legacy_forward_dep_packages(${packageName} LIB OPTIONAL) + tribits_append_legacy_forward_dep_packages(${packageName} TEST REQUIRED) + tribits_append_legacy_forward_dep_packages(${packageName} TEST OPTIONAL) endmacro() @@ -639,6 +651,42 @@ macro(tribits_set_dep_packages__handle_undefined_pkg packageName depPkg endmacro() +# @MACRO: tribits_append_legacy_forward_dep_packages() +# +# Appends legacy forward/downstream package dependency lists for the upstream +# dependent package list provided. (Remove when finished with #63) +# +macro(tribits_append_legacy_forward_dep_packages packageName libOrTest requiredOrOptional) + + set(legacyInputListType ${libOrTest}_${requiredOrOptional}_DEP_PACKAGES) + + set(legacyDepPkgListName "${packageName}_${legacyInputListType}") + + foreach(depPkg IN LISTS ${legacyDepPkgListName}) + set(legacyFwdDepPkgListName "${depPkg}_FORWARD_${legacyInputListType}") + if (DEFINED ${legacyFwdDepPkgListName}) + list(APPEND ${legacyFwdDepPkgListName} ${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 ${depPkg} has forward dependent package" + " ${packageName}, but that dependency is being ignored because the package" + " ${depPkg} is missing!" + "\n***\n" ) + endif() + endif() + endif() + endforeach() + +endmacro() + + # @MACRO: tribits_append_forward_dep_packages() # # Appends forward/downstream package dependency lists for the upstream @@ -659,29 +707,17 @@ endmacro() # dependencies for a given ```` by the downstream packages that # declare dependencies on it. # -# **__Legacy variables #63:__** -# -# Appends the var:: -# -# _FORWARD_ -# -# for one of the FORWARD vars listed in `Legacy list variables defining the -# package dependencies graph`_. -# # See `Function call tree for constructing package dependency graph`_. # -macro(tribits_append_forward_dep_packages packageName libOrTest requiredOrOptional) - - set(legacyInputListType ${libOrTest}_${requiredOrOptional}_DEP_PACKAGES) +macro(tribits_append_forward_dep_packages packageName libOrTest) - set(legacyDepPkgListName "${packageName}_${legacyInputListType}") + #message("\ntribits_append_forward_dep_packages(${packageName} ${libOrTest})") - foreach(depPkg IN LISTS ${legacyDepPkgListName}) - set(fwdDepPkgListName "${depPkg}_FORWARD_${libOrTest}_DEFINED_DEPENDENCIES") - set(legacyFwdDepPkgListName "${depPkg}_FORWARD_${legacyInputListType}") - if (DEFINED ${legacyFwdDepPkgListName}) + foreach(depPkg IN LISTS ${packageName}_${libOrTest}_DEFINED_DEPENDENCIES) + set(fwdDepPkgListName ${depPkg}_FORWARD_${libOrTest}_DEFINED_DEPENDENCIES) + #print_var(${fwdDepPkgListName}) + if (DEFINED ${fwdDepPkgListName}) list(APPEND ${fwdDepPkgListName} ${packageName}) - list(APPEND ${legacyFwdDepPkgListName} ${packageName}) else() if (${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES IN_LIST ${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_ERROR_VALUES_LIST @@ -698,6 +734,7 @@ macro(tribits_append_forward_dep_packages packageName libOrTest requiredOrOpt endif() endif() endif() + #print_var(${fwdDepPkgListName}) endforeach() endmacro() diff --git a/tribits/doc/guides/ReducedMockTrilinosOutput/ExpectedDependencies.txt b/tribits/doc/guides/ReducedMockTrilinosOutput/ExpectedDependencies.txt index d181a874e..c1464be2f 100644 --- a/tribits/doc/guides/ReducedMockTrilinosOutput/ExpectedDependencies.txt +++ b/tribits/doc/guides/ReducedMockTrilinosOutput/ExpectedDependencies.txt @@ -15,40 +15,99 @@ 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' +-- MPI_FORWARD_LIB_DEFINED_DEPENDENCIES: Teuchos[O] Epetra[O] + +-- BLAS_FORWARD_LIB_DEFINED_DEPENDENCIES: LAPACK[R] Teuchos[R] Epetra[R] + +-- LAPACK_LIB_DEFINED_DEPENDENCIES: BLAS[R] +-- LAPACK_FORWARD_LIB_DEFINED_DEPENDENCIES: Teuchos[R] Epetra[R] + +-- Boost_FORWARD_LIB_DEFINED_DEPENDENCIES: Teuchos[O] + +-- UMFPACK_FORWARD_LIB_DEFINED_DEPENDENCIES: EpetraExt[O] + +-- AMD_FORWARD_LIB_DEFINED_DEPENDENCIES: EpetraExt[O] + +-- PETSC_FORWARD_LIB_DEFINED_DEPENDENCIES: EpetraExt[O] + +-- Teuchos_FORWARD_LIB_REQUIRED_DEP_PACKAGES: RTOp EpetraExt ThyraCoreLibs -- Teuchos_LIB_REQUIRED_DEP_TPLS: BLAS LAPACK -- Teuchos_LIB_OPTIONAL_DEP_TPLS: Boost MPI +-- Teuchos_LIB_DEFINED_DEPENDENCIES: BLAS[R] LAPACK[R] Boost[O] MPI[O] +-- Teuchos_FORWARD_LIB_DEFINED_DEPENDENCIES: RTOp[R] EpetraExt[R] ThyraCoreLibs[R] + -- RTOp_LIB_REQUIRED_DEP_PACKAGES: Teuchos +-- RTOp_FORWARD_LIB_REQUIRED_DEP_PACKAGES: ThyraCoreLibs + +-- RTOp_LIB_DEFINED_DEPENDENCIES: Teuchos[R] +-- RTOp_FORWARD_LIB_DEFINED_DEPENDENCIES: ThyraCoreLibs[R] +-- Epetra_FORWARD_LIB_REQUIRED_DEP_PACKAGES: Triutils EpetraExt ThyraEpetra -- Epetra_LIB_REQUIRED_DEP_TPLS: BLAS LAPACK -- Epetra_LIB_OPTIONAL_DEP_TPLS: MPI +-- Epetra_LIB_DEFINED_DEPENDENCIES: BLAS[R] LAPACK[R] MPI[O] +-- Epetra_FORWARD_LIB_DEFINED_DEPENDENCIES: Triutils[R] EpetraExt[R] ThyraEpetra[R] + -- Triutils_LIB_REQUIRED_DEP_PACKAGES: Epetra +-- Triutils_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: EpetraExt + +-- Triutils_LIB_DEFINED_DEPENDENCIES: Epetra[R] +-- Triutils_FORWARD_LIB_DEFINED_DEPENDENCIES: EpetraExt[O] -- EpetraExt_LIB_REQUIRED_DEP_PACKAGES: Teuchos Epetra -- EpetraExt_LIB_OPTIONAL_DEP_PACKAGES: Triutils +-- EpetraExt_FORWARD_LIB_REQUIRED_DEP_PACKAGES: ThyraEpetraExt -- EpetraExt_LIB_OPTIONAL_DEP_TPLS: UMFPACK AMD PETSC +-- EpetraExt_LIB_DEFINED_DEPENDENCIES: Teuchos[R] Epetra[R] Triutils[O] UMFPACK[O] AMD[O] PETSC[O] +-- EpetraExt_FORWARD_LIB_DEFINED_DEPENDENCIES: ThyraEpetraExt[R] + -- ThyraCoreLibs_LIB_REQUIRED_DEP_PACKAGES: Teuchos RTOp +-- ThyraCoreLibs_FORWARD_LIB_REQUIRED_DEP_PACKAGES: ThyraGoodStuff ThyraEpetra Thyra + +-- ThyraCoreLibs_LIB_DEFINED_DEPENDENCIES: Teuchos[R] RTOp[R] +-- ThyraCoreLibs_FORWARD_LIB_DEFINED_DEPENDENCIES: ThyraGoodStuff[R] ThyraEpetra[R] Thyra[R] -- ThyraGoodStuff_LIB_REQUIRED_DEP_PACKAGES: ThyraCoreLibs +-- ThyraGoodStuff_FORWARD_LIB_REQUIRED_DEP_PACKAGES: ThyraCrazyStuff +-- ThyraGoodStuff_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: Thyra + +-- ThyraGoodStuff_LIB_DEFINED_DEPENDENCIES: ThyraCoreLibs[R] +-- ThyraGoodStuff_FORWARD_LIB_DEFINED_DEPENDENCIES: ThyraCrazyStuff[R] Thyra[O] -- ThyraCrazyStuff_LIB_REQUIRED_DEP_PACKAGES: ThyraGoodStuff +-- ThyraCrazyStuff_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: Thyra + +-- ThyraCrazyStuff_LIB_DEFINED_DEPENDENCIES: ThyraGoodStuff[R] +-- ThyraCrazyStuff_FORWARD_LIB_DEFINED_DEPENDENCIES: Thyra[O] -- ThyraEpetra_LIB_REQUIRED_DEP_PACKAGES: Epetra ThyraCoreLibs +-- ThyraEpetra_FORWARD_LIB_REQUIRED_DEP_PACKAGES: ThyraEpetraExt +-- ThyraEpetra_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: Thyra + +-- ThyraEpetra_LIB_DEFINED_DEPENDENCIES: Epetra[R] ThyraCoreLibs[R] +-- ThyraEpetra_FORWARD_LIB_DEFINED_DEPENDENCIES: ThyraEpetraExt[R] Thyra[O] -- ThyraEpetraExt_LIB_REQUIRED_DEP_PACKAGES: ThyraEpetra EpetraExt +-- ThyraEpetraExt_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: Thyra + +-- ThyraEpetraExt_LIB_DEFINED_DEPENDENCIES: ThyraEpetra[R] EpetraExt[R] +-- ThyraEpetraExt_FORWARD_LIB_DEFINED_DEPENDENCIES: Thyra[O] -- Thyra_LIB_REQUIRED_DEP_PACKAGES: ThyraCoreLibs -- Thyra_LIB_OPTIONAL_DEP_PACKAGES: ThyraGoodStuff ThyraCrazyStuff ThyraEpetra ThyraEpetraExt +-- Thyra_LIB_DEFINED_DEPENDENCIES: ThyraCoreLibs[R] ThyraGoodStuff[O] ThyraCrazyStuff[O] ThyraEpetra[O] ThyraEpetraExt[O] + Dumping direct enabled dependencies for each package ... -- MPI: No enabled dependencies! -- BLAS: No enabled dependencies! --- LAPACK_LIB_ENABLED_DEPENDENCIES: BLAS[O] +-- LAPACK_LIB_ENABLED_DEPENDENCIES: BLAS[R] -- Boost: No enabled dependencies! diff --git a/tribits/doc/guides/TribitsGuidesBody.rst b/tribits/doc/guides/TribitsGuidesBody.rst index 1bac8b79c..876566808 100644 --- a/tribits/doc/guides/TribitsGuidesBody.rst +++ b/tribits/doc/guides/TribitsGuidesBody.rst @@ -2163,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: @@ -3363,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: @@ -3445,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: @@ -3507,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 @@ -3555,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. @@ -3578,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 @@ -3592,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 @@ -3615,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 @@ -3632,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 @@ -3652,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, @@ -3672,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 @@ -3691,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`` @@ -3709,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`` @@ -3728,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 @@ -3743,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 @@ -3757,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 @@ -3770,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 From 68bee4d95e06a1ca51f8fd927174bede47713f63 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Thu, 20 Oct 2022 16:30:02 -0600 Subject: [PATCH 08/35] WIP: Change name from ${PROJECT_NAME}_[REVERSE_]NOTDISABLED_PACKAGES to ${PROJECT_NAME}_[REVERSE_]NOTDISABLED_INTERNAL_PACKAGES (#63) I also moved some code around to be more logical --- .../TribitsAdjustPackageEnables.cmake | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake b/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake index b47e43ca3..a8feb1912 100644 --- a/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake +++ b/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake @@ -136,8 +136,8 @@ endmacro() # # Creates and updates the following variables in the local scope:: # -# ${PROJECT_NAME}_NOTDISABLED_PACKAGES -# ${PROJECT_NAME}_REVERSE_NOTDISABLED_PACKAGES +# ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES +# ${PROJECT_NAME}_REVERSE_NOTDISABLED_INTERNAL_PACKAGES # # See implementation for details. # @@ -145,8 +145,6 @@ macro(tribits_sweep_forward_apply_disables) message("\nDisabling all packages that have a required dependency" " on disabled TPLs and optional package TPL support based on TPL_ENABLE_=OFF ...\n") - tribits_get_nondisabled_list( ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES ${PROJECT_NAME} - ${PROJECT_NAME}_NOTDISABLED_PACKAGES "") message("\nDisabling subpackages for hard disables of parent packages" " due to ${PROJECT_NAME}_ENABLE_=OFF ...\n") @@ -162,13 +160,6 @@ macro(tribits_sweep_forward_apply_disables) tribits_disable_forward_required_dep_packages(${tad1_tribitsPkg}) 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) - endmacro() @@ -176,16 +167,23 @@ endmacro() # # Reads and updates the following variables in the local scope: # -# * ``${PROJECT_NAME}_NOTDISABLED_PACKAGES`` +# * ``${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES`` # * `${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES`_ # # See implementation for details. # macro(tribits_sweep_forward_apply_enables) + tribits_get_nondisabled_list( ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES ${PROJECT_NAME} + ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES "") + + set(${PROJECT_NAME}_REVERSE_NOTDISABLED_INTERNAL_PACKAGES + "${${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES}") + list(REVERSE ${PROJECT_NAME}_REVERSE_NOTDISABLED_INTERNAL_PACKAGES) + message("\nEnabling subpackages for hard enables of parent packages" " due to ${PROJECT_NAME}_ENABLE_=ON ...\n") - foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_NOTDISABLED_PACKAGES) + foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES) tribits_enable_parents_subpackages(${tad1_tribitsPkg}) endforeach() @@ -194,7 +192,7 @@ macro(tribits_sweep_forward_apply_enables) " ${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_PACKAGES) + foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES) tribits_apply_all_package_enables(${tad1_tribitsPkg}) endforeach() endif() @@ -202,13 +200,13 @@ macro(tribits_sweep_forward_apply_enables) 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_PACKAGES) + foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES) tribits_enable_forward_lib_package_enables(${tad1_tribitsPkg}) endforeach() 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_NOTDISABLED_PACKAGES) + foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_REVERSE_NOTDISABLED_INTERNAL_PACKAGES) tribits_enable_forward_test_package_enables(${tad1_tribitsPkg}) endforeach() # NOTE: Above, we want to sweep backward to enable test-dependent packages @@ -218,7 +216,7 @@ macro(tribits_sweep_forward_apply_enables) set(${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES ON) endif() - tribits_get_enabled_list( ${PROJECT_NAME}_NOTDISABLED_PACKAGES ${PROJECT_NAME} + tribits_get_enabled_list( ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES ${PROJECT_NAME} ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES "") endmacro() @@ -290,7 +288,7 @@ macro(tribits_sweep_backward_enable_upstream_packages) " 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) + foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_REVERSE_NOTDISABLED_INTERNAL_PACKAGES) tribits_enable_upstream_packages(${tad1_tribitsPkg}) endforeach() # NOTE: Above, we have to loop through the packages backward to enable all @@ -298,7 +296,7 @@ macro(tribits_sweep_backward_enable_upstream_packages) # 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} + tribits_get_enabled_list( ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES ${PROJECT_NAME} ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES "") message("\nEnabling all optional intra-package enables _ENABLE_" From c59ff9b66d889c140c9ed187a214086f8d7dde13 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Thu, 20 Oct 2022 16:46:42 -0600 Subject: [PATCH 09/35] WIP: Code cleanup (#63) * Rename tribits_set_package_enable_based_on_global_enable() to tribits_set_package_enable_based_on_project_enable() * Remove more debug-only code based on ${PROJECT_NAME}_VERBOSE_CONFIGURE (it is just clutter really) * Simplify some if() logic * Rename some local vars * Remove unused vars * Break up long lines to be within about 90 chars --- .../TribitsAdjustPackageEnables.cmake | 180 ++++++++---------- 1 file changed, 83 insertions(+), 97 deletions(-) diff --git a/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake b/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake index a8feb1912..ab547b7d9 100644 --- a/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake +++ b/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake @@ -114,7 +114,9 @@ endmacro() # 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") + 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}=''") @@ -134,11 +136,6 @@ endmacro() # # Sweep forward and apply all disables in order first. # -# Creates and updates the following variables in the local scope:: -# -# ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES -# ${PROJECT_NAME}_REVERSE_NOTDISABLED_INTERNAL_PACKAGES -# # See implementation for details. # macro(tribits_sweep_forward_apply_disables) @@ -165,7 +162,7 @@ endmacro() # @MACRO: tribits_sweep_forward_apply_enables() # -# Reads and updates the following variables in the local scope: +# Updates the following variables in the local scope: # # * ``${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES`` # * `${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES`_ @@ -174,9 +171,8 @@ endmacro() # macro(tribits_sweep_forward_apply_enables) - tribits_get_nondisabled_list( ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES ${PROJECT_NAME} - ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES "") - + tribits_get_nondisabled_list( ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES + ${PROJECT_NAME} ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES "") set(${PROJECT_NAME}_REVERSE_NOTDISABLED_INTERNAL_PACKAGES "${${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES}") list(REVERSE ${PROJECT_NAME}_REVERSE_NOTDISABLED_INTERNAL_PACKAGES) @@ -190,8 +186,8 @@ macro(tribits_sweep_forward_apply_enables) 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") + " (${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() @@ -206,7 +202,9 @@ macro(tribits_sweep_forward_apply_enables) 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_NOTDISABLED_INTERNAL_PACKAGES) + foreach(tad1_tribitsPkg IN LISTS + ${PROJECT_NAME}_REVERSE_NOTDISABLED_INTERNAL_PACKAGES + ) tribits_enable_forward_test_package_enables(${tad1_tribitsPkg}) endforeach() # NOTE: Above, we want to sweep backward to enable test-dependent packages @@ -216,10 +214,17 @@ macro(tribits_sweep_forward_apply_enables) set(${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES ON) endif() - tribits_get_enabled_list( ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES ${PROJECT_NAME} - ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES "") + tribits_get_enabled_list( ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES + ${PROJECT_NAME} ${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. # @MACRO: tribits_disable_and_enable_tests_and_examples() @@ -230,7 +235,8 @@ endmacro() # macro(tribits_disable_and_enable_tests_and_examples) - message("\nDisabling subpackage tests/examples based on parent package tests/examples disables ...\n") + message("\nDisabling subpackage tests/examples based on parent package" + " tests/examples disables ...\n") foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES ) @@ -419,13 +425,12 @@ macro(tribits_disable_parents_subpackages PARENT_PACKAGE_NAME) ) set(SUBPACKAGE_IDX 0) - foreach(tap2_subPkg IN LISTS ${PARENT_PACKAGE_NAME}_SUBPACKAGES) + foreach(tap2_subPkgName IN LISTS ${PARENT_PACKAGE_NAME}_SUBPACKAGES) - set(SUBPACKAGE_NAME ${tap2_subPkg}) - set(SUBPACKAGE_FULLNAME ${PARENT_PACKAGE_NAME}${tap2_subPkg}) + set(subpkgFullName ${PARENT_PACKAGE_NAME}${tap2_subPkgName}) - 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(ENABLE_BEING_DISABLED_VAR_NAME ${PROJECT_NAME}_ENABLE_${subpkgFullName}) message("-- " "Setting subpackage enable ${ENABLE_BEING_DISABLED_VAR_NAME}=OFF" " because parent package ${PROJECT_NAME}_ENABLE_${PARENT_PACKAGE_NAME}=OFF") @@ -467,36 +472,36 @@ endmacro() # Macro that enables all of the subpackages of a parent package. # -macro(tribits_enable_parents_subpackages PARENT_PACKAGE_NAME) +macro(tribits_enable_parents_subpackages parentPackageName) - if(${PROJECT_NAME}_ENABLE_${PARENT_PACKAGE_NAME}) + if(${PROJECT_NAME}_ENABLE_${parentPackageName}) - set(SUBPACKAGE_IDX 0) - foreach(tap2_subPkg IN LISTS ${PARENT_PACKAGE_NAME}_SUBPACKAGES) + set(subpkgIdx 0) + foreach(tap2_subPkgName IN LISTS ${parentPackageName}_SUBPACKAGES) - set(SUBPACKAGE_NAME ${tap2_subPkg}) - set(SUBPACKAGE_FULLNAME ${PARENT_PACKAGE_NAME}${tap2_subPkg}) + 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() @@ -508,13 +513,13 @@ 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_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() @@ -694,14 +699,14 @@ endmacro() # enables. # macro(tribits_postprocess_package_with_subpackages_enables PACKAGE_NAME) - foreach(tap2_subPkg IN LISTS ${PACKAGE_NAME}_SUBPACKAGES) - set(SUBPACKAGE_FULLNAME ${PACKAGE_NAME}${tap2_subPkg}) - if (${PROJECT_NAME}_ENABLE_${SUBPACKAGE_FULLNAME} + foreach(tap2_subPkgName IN LISTS ${PACKAGE_NAME}_SUBPACKAGES) + set(subpkgFullName ${PACKAGE_NAME}${tap2_subPkgName}) + if (${PROJECT_NAME}_ENABLE_${subpkgFullName} AND NOT ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME} ) message("-- " "Setting ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}=ON" - " because ${PROJECT_NAME}_ENABLE_${SUBPACKAGE_FULLNAME}=ON") + " because ${PROJECT_NAME}_ENABLE_${subpkgFullName}=ON") set(${PROJECT_NAME}_ENABLE_${PACKAGE_NAME} ON) tribits_postprocess_package_with_subpackages_optional_subpackage_enables( ${PACKAGE_NAME}) @@ -1187,14 +1192,14 @@ macro(tribits_postprocess_package_with_subpackages_optional_subpackage_enables PACKAGE_NAME ) foreach(tap3_subPkg IN LISTS ${PACKAGE_NAME}_SUBPACKAGES) - set(SUBPACKAGE_FULLNAME ${PACKAGE_NAME}${tap3_subPkg}) - if (${PROJECT_NAME}_ENABLE_${SUBPACKAGE_FULLNAME} - AND "${${PACKAGE_NAME}_ENABLE_${SUBPACKAGE_FULLNAME}}" STREQUAL "" + set(subpkgFullName ${PACKAGE_NAME}${tap3_subPkg}) + if (${PROJECT_NAME}_ENABLE_${subpkgFullName} + AND "${${PACKAGE_NAME}_ENABLE_${subpkgFullName}}" STREQUAL "" ) message("-- " - "Setting ${PACKAGE_NAME}_ENABLE_${SUBPACKAGE_FULLNAME}=ON" - " because ${PROJECT_NAME}_ENABLE_${SUBPACKAGE_FULLNAME}=ON") - set(${PACKAGE_NAME}_ENABLE_${SUBPACKAGE_FULLNAME} ON) + "Setting ${PACKAGE_NAME}_ENABLE_${subpkgFullName}=ON" + " because ${PROJECT_NAME}_ENABLE_${subpkgFullName}=ON") + set(${PACKAGE_NAME}_ENABLE_${subpkgFullName} ON) endif() endforeach() endmacro() @@ -1207,13 +1212,13 @@ macro(tribits_postprocess_package_with_subpackages_test_example_enables PACKAGE_NAME TESTS_OR_EXAMPLES ) foreach(tap3_subPkg IN LISTS ${PACKAGE_NAME}_SUBPACKAGES) - set(SUBPACKAGE_FULLNAME ${PACKAGE_NAME}${tap3_subPkg}) - if (${SUBPACKAGE_FULLNAME}_ENABLE_${TESTS_OR_EXAMPLES} + set(subpkgFullName ${PACKAGE_NAME}${tap3_subPkg}) + if (${subpkgFullName}_ENABLE_${TESTS_OR_EXAMPLES} AND "${${PACKAGE_NAME}_ENABLE_${TESTS_OR_EXAMPLES}}" STREQUAL "" ) message("-- " "Setting ${PACKAGE_NAME}_ENABLE_${TESTS_OR_EXAMPLES}=ON" - " because ${SUBPACKAGE_FULLNAME}_ENABLE_${TESTS_OR_EXAMPLES}=ON") + " because ${subpkgFullName}_ENABLE_${TESTS_OR_EXAMPLES}=ON") set(${PACKAGE_NAME}_ENABLE_${TESTS_OR_EXAMPLES} ON) endif() endforeach() @@ -1223,58 +1228,39 @@ endmacro() # 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() @@ -1282,14 +1268,14 @@ 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 # -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 ) +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() From 593a9352690fc23ef4c8fddf11c1fde39b6798c5 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Wed, 2 Nov 2022 15:46:32 -0600 Subject: [PATCH 10/35] Add new macro tribit_create_reverse_list() (#63) This will help to tighen up some code as part of #63. --- test/core/CMakeLists.txt | 2 +- .../core/TestingFunctionMacro_UnitTests.cmake | 24 ++++++++- .../core/utils/TribitsCreateReverseList.cmake | 52 +++++++++++++++++++ .../guides/UtilsMacroFunctionDocTemplate.rst | 1 + 4 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 tribits/core/utils/TribitsCreateReverseList.cmake diff --git a/test/core/CMakeLists.txt b/test/core/CMakeLists.txt index 3d32a93ca..b4ccb1e59 100644 --- a/test/core/CMakeLists.txt +++ b/test/core/CMakeLists.txt @@ -49,7 +49,7 @@ tribits_add_advanced_test( TestingFunctionMacro_UnitTests -D${PROJECT_NAME}_TRIBITS_DIR=${${PROJECT_NAME}_TRIBITS_DIR} -P "${CMAKE_CURRENT_SOURCE_DIR}/TestingFunctionMacro_UnitTests.cmake" PASS_REGULAR_EXPRESSION_ALL - "Final UnitTests Result: num_run = 719" + "Final UnitTests Result: num_run = 721" "Final UnitTests Result: PASSED" ) diff --git a/test/core/TestingFunctionMacro_UnitTests.cmake b/test/core/TestingFunctionMacro_UnitTests.cmake index e45aa9483..8261e208e 100644 --- a/test/core/TestingFunctionMacro_UnitTests.cmake +++ b/test/core/TestingFunctionMacro_UnitTests.cmake @@ -65,6 +65,7 @@ include(TribitsTplFindIncludeDirsAndLibraries) include(TribitsReportInvalidTribitsUsage) include(TribitsGitRepoVersionInfo) include(TribitsDeprecatedHelpers) +include(TribitsCreateReverseList) include(UnitTestHelpers) include(GlobalSet) include(GlobalNullSet) @@ -132,6 +133,26 @@ function(unittest_append_string_var) endfunction() +function(unittest_tribit_create_reverse_list) + + message("\n***") + message("*** Testing tribit_create_reverse_list()") + message("***\n") + + message("tribit_create_reverse_list() with empty list") + set(someEmptyList "") + tribit_create_reverse_list(someEmptyList someEmptyList_reversed) + unittest_compare_const(someEmptyList_reversed "") + + + message("tribit_create_reverse_list() with non-empty list") + set(someList a b c d) + tribit_create_reverse_list(someList someList_reversed) + unittest_compare_const(someList_reversed "d;c;b;a") + +endfunction() + + function(unittest_tribits_find_python_interp) message("\n***") @@ -4740,6 +4761,7 @@ message("*** Testing misc TriBITS functions and macros") message("***\n") unittest_append_string_var() +unittest_tribit_create_reverse_list() unittest_tribits_find_python_interp() unittest_tribits_standardize_abs_paths() unittest_tribits_dir_is_basedir() @@ -4813,4 +4835,4 @@ message("*** Determine final result of all unit tests") message("***\n") # Pass in the number of expected tests that must pass! -unittest_final_result(719) +unittest_final_result(721) diff --git a/tribits/core/utils/TribitsCreateReverseList.cmake b/tribits/core/utils/TribitsCreateReverseList.cmake new file mode 100644 index 000000000..5f50d59ad --- /dev/null +++ b/tribits/core/utils/TribitsCreateReverseList.cmake @@ -0,0 +1,52 @@ +# @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: tribit_create_reverse_list() +# +# Create a reverse list var in one shot. +# +# Usage:: +# +# tribit_create_reverse_list( ) +# +macro(tribit_create_reverse_list oldListName newListName) + set(${newListName} ${${oldListName}}) + list(REVERSE ${newListName}) +endmacro() diff --git a/tribits/doc/guides/UtilsMacroFunctionDocTemplate.rst b/tribits/doc/guides/UtilsMacroFunctionDocTemplate.rst index fa59e566a..3d6140dc7 100644 --- a/tribits/doc/guides/UtilsMacroFunctionDocTemplate.rst +++ b/tribits/doc/guides/UtilsMacroFunctionDocTemplate.rst @@ -42,6 +42,7 @@ @FUNCTION: tribits_add_enum_cache_var() + @FUNCTION: tribits_deprecated() + @FUNCTION: tribits_deprecated_command() + +@MACRO: tribit_create_reverse_list() + @FUNCTION: tribits_strip_quotes_from_str() + @FUNCTION: unittest_compare_const() + @FUNCTION: unittest_has_substr_const() + From 2ce0a283b06a95e9cd04fc1458c1beff679e668c Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Thu, 20 Oct 2022 18:18:07 -0600 Subject: [PATCH 11/35] WIP: Refactor tribits_sweep_forward_apply_enables() to new deps vars (#63) --- .../TribitsAdjustPackageEnables.cmake | 46 ++++++------------- 1 file changed, 15 insertions(+), 31 deletions(-) diff --git a/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake b/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake index ab547b7d9..3a5b5c767 100644 --- a/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake +++ b/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake @@ -61,6 +61,7 @@ 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 @@ -173,9 +174,8 @@ macro(tribits_sweep_forward_apply_enables) tribits_get_nondisabled_list( ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES ${PROJECT_NAME} ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES "") - set(${PROJECT_NAME}_REVERSE_NOTDISABLED_INTERNAL_PACKAGES - "${${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES}") - list(REVERSE ${PROJECT_NAME}_REVERSE_NOTDISABLED_INTERNAL_PACKAGES) + tribit_create_reverse_list(${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES + ${PROJECT_NAME}_REVERSE_NOTDISABLED_INTERNAL_PACKAGES) message("\nEnabling subpackages for hard enables of parent packages" " due to ${PROJECT_NAME}_ENABLE_=ON ...\n") @@ -224,7 +224,7 @@ endmacro() # 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. +# then we can change this later. # @MACRO: tribits_disable_and_enable_tests_and_examples() @@ -525,44 +525,28 @@ endmacro() # Macro used to set ${PROJECT_NAME}_ENABLE_${FWD_PACKAGE_NAME)=ON for all +# forward packages that have a required or optional dependency on +# ${packageName} # -macro(tribits_enable_forward_lib_package_enables PACKAGE_NAME) - - assert_defined(${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - if (${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - - foreach(FWD_DEP_PKG ${${PACKAGE_NAME}_FORWARD_LIB_REQUIRED_DEP_PACKAGES}) - tribits_private_enable_forward_package(${FWD_DEP_PKG} ${PACKAGE_NAME}) - endforeach() - - foreach(FWD_DEP_PKG ${${PACKAGE_NAME}_FORWARD_LIB_OPTIONAL_DEP_PACKAGES}) - tribits_private_enable_forward_package(${FWD_DEP_PKG} ${PACKAGE_NAME}) +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 used to set ${PROJECT_NAME}_ENABLE_${FWD_PACKAGE_NAME)=ON for all # optional and required forward test dependencies of the package -# ${PACKAGE_NAME} +# ${packageName} # -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}) +macro(tribits_enable_forward_test_package_enables packageName) + if (${PROJECT_NAME}_ENABLE_${packageName}) + foreach(fwdDepPkgName IN LISTS ${packageName}_FORWARD_TEST_DEFINED_DEPENDENCIES) + tribits_private_enable_forward_package(${fwdDepPkgName} ${packageName}) endforeach() - endif() - endmacro() From 7c49749579c1c2cdfcdea3639a7602e5d4f83033 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Fri, 21 Oct 2022 11:13:07 -0600 Subject: [PATCH 12/35] WIP: Refactor tribits_disable_and_enable_tests_and_examples() to new deps vars (#63) * Rename local vars * Simplifiy/improve if() logic There was no code using the old deps vars. --- .../TribitsAdjustPackageEnables.cmake | 109 +++++++++--------- 1 file changed, 52 insertions(+), 57 deletions(-) diff --git a/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake b/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake index 3a5b5c767..9b1187ebe 100644 --- a/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake +++ b/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake @@ -245,7 +245,7 @@ macro(tribits_disable_and_enable_tests_and_examples) tribits_apply_subpackage_tests_or_examples_disables(${tad1_tribitsPkg} EXAMPLES) endforeach() - if (${PROJECT_NAME}_ENABLE_TESTS OR ${PROJECT_NAME}_ENABLE_EXAMPLES) + 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) @@ -1265,24 +1265,24 @@ macro(tribits_apply_test_example_enables packageName) endmacro() -# Macro to disable ${PARENT_PACKAGE_NAME)_ENABLE_ENABLES by default if -# ${PARENT_PACKAGE_NAME)_ENABLE_TESTS is explicitly disabled. +# Macro to disable ${parentPackageName)_ENABLE_ENABLES by default if +# ${parentPackageName)_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 "" +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" - " ${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES" - "=${${PARENT_PACKAGE_NAME}_ENABLE_TESTS}" + " ${parentPackageName}_ENABLE_EXAMPLES" + "=${${parentPackageName}_ENABLE_TESTS}" " because" - " ${PARENT_PACKAGE_NAME}_ENABLE_TESTS" - "=${${PARENT_PACKAGE_NAME}_ENABLE_TESTS}" ) - set(${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES ${${PARENT_PACKAGE_NAME}_ENABLE_TESTS}) + " ${parentPackageName}_ENABLE_TESTS" + "=${${parentPackageName}_ENABLE_TESTS}" ) + set(${parentPackageName}_ENABLE_EXAMPLES ${${parentPackageName}_ENABLE_TESTS}) endif() endmacro() -# NOTE: Above, the top-level package ${PARENT_PACKAGE_NAME} may not even be +# 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. @@ -1292,20 +1292,20 @@ endmacro() # ${TRIBITS_PARENTPACKAGE)_ENABLE_TESTS or # ${TRIBITS_PARENTPACKAGE)_ENABLE_EXAMPLES # -macro(tribits_apply_subpackage_tests_or_examples_disables PARENT_PACKAGE_NAME - TESTS_OR_EXAMPLES +macro(tribits_apply_subpackage_tests_or_examples_disables parentPackageName + testsOrExamples ) - 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 "") + 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_${TESTS_OR_EXAMPLES}=${${parentPkgEnableVar}}" + " ${fullSpkgName}_ENABLE_${testsOrExamples}=${${parentPkgEnableVar}}" " because parent package" " ${parentPkgEnableVar}=${${parentPkgEnableVar}}") - set(${fullSpkgName}_ENABLE_${TESTS_OR_EXAMPLES} ${${parentPkgEnableVar}}) + set(${fullSpkgName}_ENABLE_${testsOrExamples} ${${parentPkgEnableVar}}) endif() endif() endforeach() @@ -1313,53 +1313,48 @@ macro(tribits_apply_subpackage_tests_or_examples_disables PARENT_PACKAGE_NAME 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 to enable subpackage tests and examples based on parent package tests +# and examples enables # -macro(tribits_apply_subpackage_tests_examples_enables PARENT_PACKAGE_NAME) - if ("${${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES}" STREQUAL "" - AND ${PARENT_PACKAGE_NAME}_ENABLE_TESTS +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" - " ${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES=${${PARENT_PACKAGE_NAME}_ENABLE_TESTS}" + " ${parentPackageName}_ENABLE_EXAMPLES=${${parentPackageName}_ENABLE_TESTS}" " because" - " ${PARENT_PACKAGE_NAME}_ENABLE_TESTS=${${PARENT_PACKAGE_NAME}_ENABLE_TESTS}") - set(${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES ${${PARENT_PACKAGE_NAME}_ENABLE_TESTS}) + " ${parentPackageName}_ENABLE_TESTS=${${parentPackageName}_ENABLE_TESTS}") + set(${parentPackageName}_ENABLE_EXAMPLES ${${parentPackageName}_ENABLE_TESTS}) endif() - foreach(spkg IN LISTS ${PARENT_PACKAGE_NAME}_SUBPACKAGES) - set(fullSpkgName ${PARENT_PACKAGE_NAME}${spkg}) + # 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 (${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() + 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 (${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() + 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_${PARENT_PACKAGE_NAME} my not be TRUE) if only +# (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 subpackage to be enabled if -# ${PARENT_PACKAGE_NAME}_ENABLE_TESTS=ON or just examples i -# f${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES=ON +# and examples for a subpackage to be enabled if the tests and examples for +# the parent package, respectfully, are enabled. macro(tribits_private_enable_forward_package FORWARD_DEP_PACKAGE_NAME PACKAGE_NAME) From 7fbd2c5a80c3841bd255502f1cbe5834b3edbc72 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Fri, 21 Oct 2022 19:38:42 -0600 Subject: [PATCH 13/35] WIP: Refactor tribits_sweep_backward_enable_upstream_packages() to use new deps vars (#63) Also: * Refactored tribits_get_[enabled|disabled|nonenabled|nondisabled]_list() fucntions to operate on both internal and external packages correctly * Add test for catching a missed test case * Add new lists ${PROJECT_NAME}_[REVERSE_]ENABLED_INTERNAL_PACKAGES for one usage * Renamed local vars * Cleaned up some if() logic SQUASH AGAINST: WIP: Refactor tribits_sweep_backward_enable_upstream_packages() to use new deps vars (#63) --- test/core/DependencyUnitTests/CMakeLists.txt | 17 ++ .../TribitsAdjustPackageEnables.cmake | 233 ++++++++---------- .../package_arch/TribitsGeneralMacros.cmake | 147 +++++------ .../package_arch/TribitsGlobalMacros.cmake | 10 +- .../TribitsPrintEnabledPackagesLists.cmake | 23 +- .../TribitsProcessPackagesAndDirsLists.cmake | 33 +-- 6 files changed, 214 insertions(+), 249 deletions(-) diff --git a/test/core/DependencyUnitTests/CMakeLists.txt b/test/core/DependencyUnitTests/CMakeLists.txt index 2fea69e90..8267b41a3 100644 --- a/test/core/DependencyUnitTests/CMakeLists.txt +++ b/test/core/DependencyUnitTests/CMakeLists.txt @@ -786,6 +786,23 @@ create_dependency_handling_test_case( ) +create_dependency_handling_test_case( + EnableEpetra_DisableTriutils_EnableAllForwardPackages + ARGS -DTrilinos_ENABLE_Epetra:BOOL=ON -DTrilinos_ENABLE_Triutils:BOOL=OFF + -DTrilinos_ENABLE_ALL_FORWARD_DEP_PACKAGES:BOOL=ON + PASS_REGULAR_EXPRESSION_ALL + "Disabling forward required packages and optional intra-package support that have a dependency on disabled packages Trilinos_ENABLE_=OFF [(]or TPL_ENABLE_=OFF[)] ..." + "-- Setting Trilinos_ENABLE_AztecOO=OFF because AztecOO has a required library dependence on disabled package Triutils" + "Sweep backward enabling all forward test dependent packages because Trilinos_ENABLE_ALL_FORWARD_DEP_PACKAGES=ON" + "-- Setting Trilinos_ENABLE_Intrepid=ON because Trilinos_ENABLE_Amesos=ON" + FAIL_REGULAR_EXPRESSION + "-- Setting Trilinos_ENABLE_Tpetra=ON because Trilinos_ENABLE_Triutils=ON" + ) + # NOTE: The above test checks that a loop runs to enable needed test + # dependencies that was not being tested in any other test in TriBITS (as + # part of the refactoring for #63). + + create_dependency_handling_test_case( DisableEpetra_DisableTeuchos_EnableAllPackages ARGS -DTrilinos_ENABLE_Epetra:BOOL=OFF -DTrilinos_ENABLE_Teuchos:BOOL=OFF -DTrilinos_ENABLE_ALL_PACKAGES:BOOL=ON diff --git a/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake b/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake index 9b1187ebe..163089cec 100644 --- a/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake +++ b/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake @@ -173,7 +173,7 @@ endmacro() macro(tribits_sweep_forward_apply_enables) tribits_get_nondisabled_list( ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES - ${PROJECT_NAME} ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES "") + ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES "") tribit_create_reverse_list(${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES ${PROJECT_NAME}_REVERSE_NOTDISABLED_INTERNAL_PACKAGES) @@ -200,10 +200,15 @@ macro(tribits_sweep_forward_apply_enables) tribits_enable_forward_lib_package_enables(${tad1_tribitsPkg}) endforeach() + tribits_get_enabled_list( ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES + ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES "") + tribit_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_NOTDISABLED_INTERNAL_PACKAGES + ${PROJECT_NAME}_REVERSE_ENABLED_INTERNAL_PACKAGES ) tribits_enable_forward_test_package_enables(${tad1_tribitsPkg}) endforeach() @@ -215,7 +220,7 @@ macro(tribits_sweep_forward_apply_enables) endif() tribits_get_enabled_list( ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES - ${PROJECT_NAME} ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES "") + ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES "") endmacro() # NOTE: Above, we are sweeping over *all* of the not-disabled packages listed @@ -284,29 +289,29 @@ endmacro() # macro(tribits_sweep_backward_enable_upstream_packages) + set(tap1_extraMsgStr "") if (${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES) - set(tap1_extraMsgStr " (and optional since ${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES=ON)") - else() - set(tap1_extraMsgStr "") + set(tap1_extraMsgStr + " (and optional since ${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES=ON)") endif() - 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") + 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_INTERNAL_PACKAGES) tribits_enable_upstream_packages(${tad1_tribitsPkg}) 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 + # upstream package enables including required packages, and optional + # packages (when ${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES). - tribits_get_enabled_list( ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES ${PROJECT_NAME} + tribits_get_enabled_list( ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES "") - message("\nEnabling all optional intra-package enables _ENABLE_" - " that are not currently disabled if both sets of packages are enabled ...\n") + 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() @@ -524,9 +529,8 @@ macro(tribits_apply_all_package_enables packageName) endmacro() -# Macro used to set ${PROJECT_NAME}_ENABLE_${FWD_PACKAGE_NAME)=ON for all -# forward packages that have a required or optional dependency on -# ${packageName} +# 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}) @@ -537,17 +541,17 @@ macro(tribits_enable_forward_lib_package_enables packageName) endmacro() -# Macro used to set ${PROJECT_NAME}_ENABLE_${FWD_PACKAGE_NAME)=ON for all -# optional and required forward test dependencies of the package -# ${packageName} +# Macro used to set ${PROJECT_NAME}_ENABLE_${FWD_PACKAGE_NAME}=ON for all +# forward required or optional TEST dependency on ${packageName} # macro(tribits_enable_forward_test_package_enables packageName) - if (${PROJECT_NAME}_ENABLE_${packageName}) - foreach(fwdDepPkgName IN LISTS ${packageName}_FORWARD_TEST_DEFINED_DEPENDENCIES) - tribits_private_enable_forward_package(${fwdDepPkgName} ${packageName}) - endforeach() - endif() + 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. # Macro that sets the required TPLs for given package @@ -1058,38 +1062,42 @@ endmacro() # ${PACKAGE_NAME} (i.e. ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME} is assumed to # be TRUE before calling this macro. # -macro(tribits_private_postprocess_optional_package_enable PACKAGE_NAME OPTIONAL_DEP_PACKAGE) +macro(tribits_private_postprocess_optional_package_enable packageName + optDepPkg + ) - if (${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE} AND ${PROJECT_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}) + if (${packageName}_ENABLE_${optDepPkg} AND ${PROJECT_NAME}_ENABLE_${optDepPkg}) message("-- " "NOTE:" - " ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}=${${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}}" + " ${packageName}_ENABLE_${optDepPkg}=${${packageName}_ENABLE_${optDepPkg}}" " 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) + elseif ("${${packageName}_ENABLE_${optDepPkg}}" STREQUAL "") + if (${PROJECT_NAME}_ENABLE_${optDepPkg}) + message("-- " "Setting ${packageName}_ENABLE_${optDepPkg}=ON" + " since ${PROJECT_NAME}_ENABLE_${packageName}=ON AND" + " ${PROJECT_NAME}_ENABLE_${optDepPkg}=ON") + set(${packageName}_ENABLE_${optDepPkg} ON) else() - message("-- " "NOT setting ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}=ON" - " since ${OPTIONAL_DEP_PACKAGE} is NOT enabled at this point!") + message("-- " "NOT setting ${packageName}_ENABLE_${optDepPkg}=ON" + " since ${optDepPkg} 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} + elseif (NOT "${${packageName}_ENABLE_${optDepPkg}}" STREQUAL "" + AND NOT ${packageName}_ENABLE_${optDepPkg} + AND ${PROJECT_NAME}_ENABLE_${optDepPkg} ) - 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!") + message("-- " "NOTE: ${packageName}_ENABLE_${optDepPkg}=" + "${${packageName}_ENABLE_${optDepPkg}} is already set so not enabling even" + " though ${PROJECT_NAME}_ENABLE_${optDepPkg}=" + "${${PROJECT_NAME}_ENABLE_${optDepPkg}} 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}) + string(TOUPPER ${packageName} packageName_UPPER) + string(TOUPPER ${optDepPkg} optDepPkg_UPPER) + set(MACRO_DEFINE_NAME HAVE_${packageName_UPPER}_${optDepPkg_UPPER}) - if(${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}) - set(${MACRO_DEFINE_NAME} ON) + if(${packageName}_ENABLE_${optDepPkg}) + set(${MACRO_DEFINE_NAME} ON) else() - set(${MACRO_DEFINE_NAME} OFF) + set(${MACRO_DEFINE_NAME} OFF) endif() endmacro() @@ -1149,24 +1157,26 @@ endmacro() # Macro that post-processes optional dependencies after all other # dependencies have been worked out # -macro(tribits_postprocess_optional_package_enables PACKAGE_NAME) +macro(tribits_postprocess_optional_package_enables packageName) - assert_defined(${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - if (${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) + if (${PROJECT_NAME}_ENABLE_${packageName}) - foreach(OPTIONAL_DEP_PACKAGE ${${PACKAGE_NAME}_LIB_OPTIONAL_DEP_PACKAGES}) + foreach(depPkg ${${packageName}_LIB_DEFINED_DEPENDENCIES}) tribits_private_postprocess_optional_package_enable( - ${PACKAGE_NAME} ${OPTIONAL_DEP_PACKAGE} ) + ${packageName} ${depPkg} ) endforeach() - foreach(OPTIONAL_DEP_PACKAGE ${${PACKAGE_NAME}_TEST_OPTIONAL_DEP_PACKAGES}) + foreach(depPkg ${${packageName}_TEST_DEFINED_DEPENDENCIES}) tribits_private_postprocess_optional_package_enable( - ${PACKAGE_NAME} ${OPTIONAL_DEP_PACKAGE} ) + ${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}. # Set _ENABLE_=ON if not already enabled for all @@ -1357,75 +1367,47 @@ endmacro() # the parent package, respectfully, are enabled. -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) +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() endmacro() -macro(tribits_private_enable_dep_package PACKAGE_NAME DEP_PACKAGE_NAME - OPTREQ_IN - ) - - assert_defined(${PROJECT_NAME}_ENABLE_${DEP_PACKAGE_NAME}) - - if (${PROJECT_NAME}_ENABLE_${DEP_PACKAGE_NAME}) - +macro(tribits_private_enable_dep_package packageName depPkgName libOrTest) + if (${PROJECT_NAME}_ENABLE_${depPkgName}) #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("-- " "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}) - + elseif (${PROJECT_NAME}_ENABLE_${depPkgName} STREQUAL "") + set(tpedp_enableDepPkg "") + if (${packageName}_${libOrTest}_DEP_REQUIRED_${depPkgName}) + message("-- " "Setting ${PROJECT_NAME}_ENABLE_${depPkgName}=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 ${PROJECT_NAME}_ENABLE_${DEP_PACKAGE_NAME}=ON" - " because ${PACKAGE_NAME}_ENABLE_${DEP_PACKAGE_NAME}=ON") - - set(TRIBITS_PRIVATE_ENABLE_DEP_PACKAGES_ENABLE_PACKAGE ON) - + message("-- " "Setting ${PROJECT_NAME}_ENABLE_${depPkgName}=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(${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) + tribits_implicit_package_enable_is_allowed(${packageName} ${depPkgName} + allowImplicitEnable) + if (allowImplicitEnable) + message("-- " "Setting ${PROJECT_NAME}_ENABLE_${depPkgName}=ON" + " because ${packageName} has an optional dependence on ${depPkgName}") + set(tpedp_enableDepPkg 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) + if (tpedp_enableDepPkg) + set(${PROJECT_NAME}_ENABLE_${depPkgName} ON) endif() - endif() - endmacro() @@ -1455,36 +1437,29 @@ macro(tribits_private_enable_optional_dep_tpl PACKAGE_NAME DEP_TPL_NAME) 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 that enables upstream (required and optional) packages for a given +# package # -macro(tribits_enable_upstream_packages PACKAGE_NAME) +macro(tribits_enable_upstream_packages packageName) - assert_defined(${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - - if (${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - - foreach(DEP_PKG IN LISTS ${PACKAGE_NAME}_LIB_REQUIRED_DEP_PACKAGES) - tribits_private_enable_dep_package(${PACKAGE_NAME} ${DEP_PKG} REQUIRED) - endforeach() - - foreach(DEP_PKG IN LISTS ${PACKAGE_NAME}_LIB_OPTIONAL_DEP_PACKAGES) - tribits_private_enable_dep_package(${PACKAGE_NAME} ${DEP_PKG} OPTIONAL) - endforeach() + if (${PROJECT_NAME}_ENABLE_${packageName}) - foreach(DEP_PKG IN LISTS ${PACKAGE_NAME}_TEST_REQUIRED_DEP_PACKAGES) - tribits_private_enable_dep_package(${PACKAGE_NAME} ${DEP_PKG} REQUIRED) + foreach(depPkg IN LISTS ${packageName}_LIB_DEFINED_DEPENDENCIES) + tribits_private_enable_dep_package(${packageName} ${depPkg} LIB) endforeach() - foreach(DEP_PKG IN LISTS ${PACKAGE_NAME}_TEST_OPTIONAL_DEP_PACKAGES) - tribits_private_enable_dep_package(${PACKAGE_NAME} ${DEP_PKG} OPTIONAL) + 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. # LocalWords: tribits TriBITS foreach endmacro endfunction diff --git a/tribits/core/package_arch/TribitsGeneralMacros.cmake b/tribits/core/package_arch/TribitsGeneralMacros.cmake index f510b40b5..107f976b6 100644 --- a/tribits/core/package_arch/TribitsGeneralMacros.cmake +++ b/tribits/core/package_arch/TribitsGeneralMacros.cmake @@ -43,6 +43,7 @@ include(MessageWrapper) include(TribitsParseArgumentsHelpers) include(TribitsSortListAccordingToMasterList) include(TribitsDeprecatedHelpers) +include(TribitsGetPackageEnableStatus) # Optionally start CMake code configure timing @@ -144,122 +145,94 @@ function(tribits_set_base_repo_dir BASE_DIR REPO_DIR BASE_REPO_DIR_OUT) endfunction() -# Get the list of explicitly enabled entries +# Get the sub-list of explicitly enabled packages # -# These is the list of entries in ${LISTVAR} for which: +# These is the list of entries in ${enableListName} for which evaluate to +# TRUE. # -# if (${ENABLED_PREFIX}_ENABLE_{ENTRY}) -# -# evaluates to true. -# -function(tribits_get_enabled_list LISTVAR ENABLED_PREFIX - ENABLED_LIST_OUT_OUT NUM_ENABLED_OUT_OUT +function(tribits_get_enabled_list enableListName + enabledSublistNameOut numEnabledVarOut ) - 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}) + set(enabledSublist) + foreach(pkgName IN LISTS ${enableListName}) + tribits_get_package_enable_status(${pkgName} enableVal "") + if (enableVal) + list(APPEND enabledSublist ${pkgName}) 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) + list(LENGTH enabledSublist numEnabled) + set(${enabledSublistNameOut} ${enabledSublist} PARENT_SCOPE) + if (numEnabledVarOut) + set(${numEnabledVarOut} ${numEnabled} 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 "" ) -# ) +# Get the sub-list non-disabled packages # -# evaluates to true. +# These are the entries in the list ``${enableListName}`` for which the enable +# is TRUE or empty "". # -function(tribits_get_nondisabled_list LISTVAR ENABLED_PREFIX - NONDISABLED_LIST_OUT_OUT NUM_NONDISABLED_OUT_OUT +function(tribits_get_nondisabled_list enableListName + nondisabledListNameOut numNondisabledVarOut ) - 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}) + 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 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) + list(LENGTH nondisabledList numNondisabled) + set(${nondisabledListNameOut} ${nondisabledList} PARENT_SCOPE) + if (numNondisabledVarOut) + set(${numNondisabledVarOut} ${numNondisabled} PARENT_SCOPE) endif() endfunction() -# Get the list of explicitly disabled entries +# Get the sub-list disabled packages # -# These is the list of entries in ${LISTVAR} for which: +# These are the entries in the list ``${enableListName}`` for which the enable +# evaluates to FALSE and is not empty "". # -# 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 +function(tribits_get_disabled_list enableListName + disabledSublistNameOut numDisabledVarOut ) - 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}) + 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 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) + list(LENGTH disabledSublist numDisabled) + set(${disabledSublistNameOut} ${disabledSublist} PARENT_SCOPE) + if (numDisabledVarOut) + set(${numDisabledVarOut} ${numDisabled} 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}) +# Get the sub-list of non-enabled entries # -# evaluates to true. +# These are the entries in the list ``${enableListName}`` for which the enable +# is not TRUE. # -function(tribits_get_nonenabled_list LISTVAR ENABLED_PREFIX - NONENABLED_LIST_OUT_OUT NUM_NONENABLED_OUT_OUT +function(tribits_get_nonenabled_list enableListName + nonenabledListNameOut numNonenabledVarOut ) - 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}) + 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 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) + list(LENGTH nonenabledList numNonenabled) + set(${nonenabledListNameOut} ${nonenabledList} PARENT_SCOPE) + if (numNonenabledVarOut) + set(${numNonenabledVarOut} ${numNonenabled} PARENT_SCOPE) endif() endfunction() @@ -270,12 +243,12 @@ 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}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES ${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} + tribits_get_enabled_list( ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES ${PROJECT_NAME}_NUM_ENABLED_INTERNAL_PACKAGES) @@ -292,7 +265,7 @@ macro(tribits_set_up_enabled_lists_and_pkg_idx) endforeach() # ${PROJECT_NAME}_ENABLED_TPLS - tribits_get_enabled_list( ${PROJECT_NAME}_DEFINED_TPLS TPL + tribits_get_enabled_list( ${PROJECT_NAME}_DEFINED_TPLS ${PROJECT_NAME}_ENABLED_TPLS ${PROJECT_NAME}_NUM_ENABLED_TPLS) # ${PROJECT_NAME}_REVERSE_ENABLED_TPLS diff --git a/tribits/core/package_arch/TribitsGlobalMacros.cmake b/tribits/core/package_arch/TribitsGlobalMacros.cmake index 331e1823e..87cb8d5c3 100644 --- a/tribits/core/package_arch/TribitsGlobalMacros.cmake +++ b/tribits/core/package_arch/TribitsGlobalMacros.cmake @@ -2316,14 +2316,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_nonenabled_list(tribitsPackageList nonEnabledTribitsPackage "") foreach(TRIBITS_PACKAGE ${nonEnabledTribitsPackage}) @@ -2383,7 +2381,7 @@ 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} + ${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES ENABLED_PACKAGES NUM_ENABLED) #message("ENABLED PACKAGES: ${ENABLED_PACKAGES} ${NUM_ENABLED}") diff --git a/tribits/core/package_arch/TribitsPrintEnabledPackagesLists.cmake b/tribits/core/package_arch/TribitsPrintEnabledPackagesLists.cmake index 547c9a9f6..43971fba2 100644 --- a/tribits/core/package_arch/TribitsPrintEnabledPackagesLists.cmake +++ b/tribits/core/package_arch/TribitsPrintEnabledPackagesLists.cmake @@ -108,7 +108,7 @@ function(tribits_print_internal_package_list_enable_status ) if (ENABLED_FLAG AND NOT INCLUDE_EMPTY) tribits_get_enabled_list( - ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES ${PROJECT_NAME} + ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES internalPackagesEnableStatusList "") elseif (ENABLED_FLAG AND INCLUDE_EMPTY) tribits_get_nondisabled_list( @@ -116,11 +116,11 @@ function(tribits_print_internal_package_list_enable_status internalPackagesEnableStatusList "") elseif (NOT ENABLED_FLAG AND NOT INCLUDE_EMPTY) tribits_get_disabled_list( - ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES ${PROJECT_NAME} + ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES internalPackagesEnableStatusList "") else() # NOT ENABLED_FLAG AND INCLUDE_EMPTY tribits_get_nonenabled_list( - ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES ${PROJECT_NAME} + ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES internalPackagesEnableStatusList "") endif() tribits_print_prefix_string_and_list("${DOCSTRING}" @@ -132,16 +132,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_enabled_list( ${PROJECT_NAME}_DEFINED_TPLS tplsEnableStatusList "") elseif (ENABLED_FLAG AND INCLUDE_EMPTY) - tribits_get_nondisabled_list( ${PROJECT_NAME}_DEFINED_TPLS TPL + tribits_get_nondisabled_list( ${PROJECT_NAME}_DEFINED_TPLS tplsEnableStatusList "") elseif (NOT ENABLED_FLAG AND NOT INCLUDE_EMPTY) - tribits_get_disabled_list( ${PROJECT_NAME}_DEFINED_TPLS TPL + tribits_get_disabled_list( ${PROJECT_NAME}_DEFINED_TPLS tplsEnableStatusList "") else() # NOT ENABLED_FLAG AND INCLUDE_EMPTY - tribits_get_nonenabled_list( ${PROJECT_NAME}_DEFINED_TPLS TPL + tribits_get_nonenabled_list( ${PROJECT_NAME}_DEFINED_TPLS tplsEnableStatusList "") endif() tribits_print_prefix_string_and_list("${DOCSTRING}" "${tplsEnableStatusList}") @@ -155,16 +155,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_enabled_list(${PACKAGES_LIST_VAR} enableStatusList "") elseif (ENABLED_FLAG AND INCLUDE_EMPTY) - tribits_get_nondisabled_list(${PACKAGES_LIST_VAR} ${PROJECT_NAME} - enableStatusList "") + tribits_get_nondisabled_list(${PACKAGES_LIST_VAR} enableStatusList "") elseif (NOT ENABLED_FLAG AND NOT INCLUDE_EMPTY) - tribits_get_disabled_list(${PACKAGES_LIST_VAR} ${PROJECT_NAME} + tribits_get_disabled_list(${PACKAGES_LIST_VAR} enableStatusList "") else() # NOT ENABLED_FLAG AND INCLUDE_EMPTY - tribits_get_nonenabled_list(${PACKAGES_LIST_VAR} ${PROJECT_NAME} + tribits_get_nonenabled_list(${PACKAGES_LIST_VAR} enableStatusList "") endif() tribits_print_prefix_string_and_list("${DOCSTRING}" "${enableStatusList}") diff --git a/tribits/core/package_arch/TribitsProcessPackagesAndDirsLists.cmake b/tribits/core/package_arch/TribitsProcessPackagesAndDirsLists.cmake index 472a0f4ca..dd2e2749b 100644 --- a/tribits/core/package_arch/TribitsProcessPackagesAndDirsLists.cmake +++ b/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() From 99779a69869c9bb3676085719df1b4a91cc1cd36 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Fri, 4 Nov 2022 11:30:55 -0600 Subject: [PATCH 14/35] WIP: Change name from tribits_get_X_list() to tribits_get_sublist_X() (#63) These new names make more sense and they will sort together in the documenation. --- .../TribitsAdjustPackageEnables.cmake | 8 +++---- .../package_arch/TribitsGeneralMacros.cmake | 14 +++++------ .../package_arch/TribitsGlobalMacros.cmake | 4 ++-- .../TribitsPrintEnabledPackagesLists.cmake | 24 +++++++++---------- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake b/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake index 163089cec..f647c7a87 100644 --- a/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake +++ b/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake @@ -172,7 +172,7 @@ endmacro() # macro(tribits_sweep_forward_apply_enables) - tribits_get_nondisabled_list( ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES + tribits_get_sublist_nondisabled( ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES "") tribit_create_reverse_list(${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES ${PROJECT_NAME}_REVERSE_NOTDISABLED_INTERNAL_PACKAGES) @@ -200,7 +200,7 @@ macro(tribits_sweep_forward_apply_enables) tribits_enable_forward_lib_package_enables(${tad1_tribitsPkg}) endforeach() - tribits_get_enabled_list( ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES + tribits_get_sublist_enabled( ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES "") tribit_create_reverse_list(${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES ${PROJECT_NAME}_REVERSE_ENABLED_INTERNAL_PACKAGES) @@ -219,7 +219,7 @@ macro(tribits_sweep_forward_apply_enables) set(${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES ON) endif() - tribits_get_enabled_list( ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES + tribits_get_sublist_enabled( ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES "") endmacro() @@ -306,7 +306,7 @@ macro(tribits_sweep_backward_enable_upstream_packages) # upstream package enables including required packages, and optional # packages (when ${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES). - tribits_get_enabled_list( ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES + tribits_get_sublist_enabled( ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES "") message("\nEnabling all optional intra-package enables" diff --git a/tribits/core/package_arch/TribitsGeneralMacros.cmake b/tribits/core/package_arch/TribitsGeneralMacros.cmake index 107f976b6..ab5681c36 100644 --- a/tribits/core/package_arch/TribitsGeneralMacros.cmake +++ b/tribits/core/package_arch/TribitsGeneralMacros.cmake @@ -150,7 +150,7 @@ endfunction() # These is the list of entries in ${enableListName} for which evaluate to # TRUE. # -function(tribits_get_enabled_list enableListName +function(tribits_get_sublist_enabled enableListName enabledSublistNameOut numEnabledVarOut ) set(enabledSublist) @@ -173,7 +173,7 @@ endfunction() # These are the entries in the list ``${enableListName}`` for which the enable # is TRUE or empty "". # -function(tribits_get_nondisabled_list enableListName +function(tribits_get_sublist_nondisabled enableListName nondisabledListNameOut numNondisabledVarOut ) set(nondisabledList "") @@ -196,7 +196,7 @@ endfunction() # These are the entries in the list ``${enableListName}`` for which the enable # evaluates to FALSE and is not empty "". # -function(tribits_get_disabled_list enableListName +function(tribits_get_sublist_disabled enableListName disabledSublistNameOut numDisabledVarOut ) set(disabledSublist "") @@ -219,7 +219,7 @@ endfunction() # These are the entries in the list ``${enableListName}`` for which the enable # is not TRUE. # -function(tribits_get_nonenabled_list enableListName +function(tribits_get_sublist_nonenabled enableListName nonenabledListNameOut numNonenabledVarOut ) set(nonenabledList "") @@ -242,13 +242,13 @@ endfunction() macro(tribits_set_up_enabled_lists_and_pkg_idx) # ${PROJECT_NAME}_ENABLED_PACKAGES - tribits_get_enabled_list( + 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_enabled_list( ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES + tribits_get_sublist_enabled( ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES ${PROJECT_NAME}_NUM_ENABLED_INTERNAL_PACKAGES) @@ -265,7 +265,7 @@ macro(tribits_set_up_enabled_lists_and_pkg_idx) endforeach() # ${PROJECT_NAME}_ENABLED_TPLS - tribits_get_enabled_list( ${PROJECT_NAME}_DEFINED_TPLS + tribits_get_sublist_enabled( ${PROJECT_NAME}_DEFINED_TPLS ${PROJECT_NAME}_ENABLED_TPLS ${PROJECT_NAME}_NUM_ENABLED_TPLS) # ${PROJECT_NAME}_REVERSE_ENABLED_TPLS diff --git a/tribits/core/package_arch/TribitsGlobalMacros.cmake b/tribits/core/package_arch/TribitsGlobalMacros.cmake index 87cb8d5c3..63dba3298 100644 --- a/tribits/core/package_arch/TribitsGlobalMacros.cmake +++ b/tribits/core/package_arch/TribitsGlobalMacros.cmake @@ -2321,7 +2321,7 @@ macro(tribits_setup_packaging_and_distribution) set(tribitsPackageList ${${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES}) endif() - tribits_get_nonenabled_list(tribitsPackageList nonEnabledTribitsPackage "") + tribits_get_sublist_nonenabled(tribitsPackageList nonEnabledTribitsPackage "") foreach(TRIBITS_PACKAGE ${nonEnabledTribitsPackage}) @@ -2380,7 +2380,7 @@ macro(tribits_setup_packaging_and_distribution) # K.3) Set up install component dependencies - tribits_get_enabled_list( + tribits_get_sublist_enabled( ${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES ENABLED_PACKAGES NUM_ENABLED) #message("ENABLED PACKAGES: ${ENABLED_PACKAGES} ${NUM_ENABLED}") diff --git a/tribits/core/package_arch/TribitsPrintEnabledPackagesLists.cmake b/tribits/core/package_arch/TribitsPrintEnabledPackagesLists.cmake index 43971fba2..3bebe52df 100644 --- a/tribits/core/package_arch/TribitsPrintEnabledPackagesLists.cmake +++ b/tribits/core/package_arch/TribitsPrintEnabledPackagesLists.cmake @@ -107,19 +107,19 @@ function(tribits_print_internal_package_list_enable_status DOCSTRING ENABLED_FLAG INCLUDE_EMPTY ) if (ENABLED_FLAG AND NOT INCLUDE_EMPTY) - tribits_get_enabled_list( + 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( + tribits_get_sublist_disabled( ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES internalPackagesEnableStatusList "") else() # NOT ENABLED_FLAG AND INCLUDE_EMPTY - tribits_get_nonenabled_list( + tribits_get_sublist_nonenabled( ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES internalPackagesEnableStatusList "") endif() @@ -132,16 +132,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 + tribits_get_sublist_enabled( ${PROJECT_NAME}_DEFINED_TPLS tplsEnableStatusList "") elseif (ENABLED_FLAG AND INCLUDE_EMPTY) - tribits_get_nondisabled_list( ${PROJECT_NAME}_DEFINED_TPLS + 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 + tribits_get_sublist_disabled( ${PROJECT_NAME}_DEFINED_TPLS tplsEnableStatusList "") else() # NOT ENABLED_FLAG AND INCLUDE_EMPTY - tribits_get_nonenabled_list( ${PROJECT_NAME}_DEFINED_TPLS + tribits_get_sublist_nonenabled( ${PROJECT_NAME}_DEFINED_TPLS tplsEnableStatusList "") endif() tribits_print_prefix_string_and_list("${DOCSTRING}" "${tplsEnableStatusList}") @@ -155,15 +155,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} + tribits_get_sublist_enabled(${PACKAGES_LIST_VAR} enableStatusList "") elseif (ENABLED_FLAG AND INCLUDE_EMPTY) - tribits_get_nondisabled_list(${PACKAGES_LIST_VAR} enableStatusList "") + tribits_get_sublist_nondisabled(${PACKAGES_LIST_VAR} enableStatusList "") elseif (NOT ENABLED_FLAG AND NOT INCLUDE_EMPTY) - tribits_get_disabled_list(${PACKAGES_LIST_VAR} + tribits_get_sublist_disabled(${PACKAGES_LIST_VAR} enableStatusList "") else() # NOT ENABLED_FLAG AND INCLUDE_EMPTY - tribits_get_nonenabled_list(${PACKAGES_LIST_VAR} + tribits_get_sublist_nonenabled(${PACKAGES_LIST_VAR} enableStatusList "") endif() tribits_print_prefix_string_and_list("${DOCSTRING}" "${enableStatusList}") From 561d8cbfac9d7d3b685b1638cfbfd790e7621c93 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Fri, 4 Nov 2022 16:22:32 -0600 Subject: [PATCH 15/35] WIP: Move tribits_get_sublist_X() functions into new module, add doc entries (#63) --- .../package_arch/TribitsGeneralMacros.cmake | 92 ---------- .../TribitsGetEnabledSublists.cmake | 163 ++++++++++++++++++ .../TribitsPrintEnabledPackagesLists.cmake | 2 + .../TribitsSystemMacroFunctionDocTemplate.rst | 6 +- 4 files changed, 170 insertions(+), 93 deletions(-) create mode 100644 tribits/core/package_arch/TribitsGetEnabledSublists.cmake diff --git a/tribits/core/package_arch/TribitsGeneralMacros.cmake b/tribits/core/package_arch/TribitsGeneralMacros.cmake index ab5681c36..8da82f2b2 100644 --- a/tribits/core/package_arch/TribitsGeneralMacros.cmake +++ b/tribits/core/package_arch/TribitsGeneralMacros.cmake @@ -145,98 +145,6 @@ function(tribits_set_base_repo_dir BASE_DIR REPO_DIR BASE_REPO_DIR_OUT) endfunction() -# Get the sub-list of explicitly enabled packages -# -# These is the list of entries in ${enableListName} for which evaluate to -# TRUE. -# -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() - - -# Get the sub-list non-disabled packages -# -# These are the entries in the list ``${enableListName}`` for which the enable -# is TRUE or empty "". -# -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() - - -# Get the sub-list disabled packages -# -# These are the entries in the list ``${enableListName}`` for which the enable -# evaluates to FALSE and is not empty "". -# -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() - - -# Get the sub-list of non-enabled entries -# -# These are the entries in the list ``${enableListName}`` for which the enable -# is not TRUE. -# -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() - - # Macro that sets up the basic lists of enabled packages and packages. # macro(tribits_set_up_enabled_lists_and_pkg_idx) diff --git a/tribits/core/package_arch/TribitsGetEnabledSublists.cmake b/tribits/core/package_arch/TribitsGetEnabledSublists.cmake new file mode 100644 index 000000000..0444ba3dd --- /dev/null +++ b/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/tribits/core/package_arch/TribitsPrintEnabledPackagesLists.cmake b/tribits/core/package_arch/TribitsPrintEnabledPackagesLists.cmake index 3bebe52df..b49d96372 100644 --- a/tribits/core/package_arch/TribitsPrintEnabledPackagesLists.cmake +++ b/tribits/core/package_arch/TribitsPrintEnabledPackagesLists.cmake @@ -37,6 +37,8 @@ # ************************************************************************ # @HEADER +include(TribitsGetEnabledSublists) + # @FUNCTION: tribits_print_enables_before_adjust_package_enables() # diff --git a/tribits/doc/guides/TribitsSystemMacroFunctionDocTemplate.rst b/tribits/doc/guides/TribitsSystemMacroFunctionDocTemplate.rst index 05867ab5f..a8c9f53d2 100644 --- a/tribits/doc/guides/TribitsSystemMacroFunctionDocTemplate.rst +++ b/tribits/doc/guides/TribitsSystemMacroFunctionDocTemplate.rst @@ -15,6 +15,7 @@ understand the internals of TriBITS. @MACRO: tribits_adjust_package_enables() + @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() + From da71f3c8616f19f22720ecb66b4a89a9d96d8c9d Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Mon, 14 Nov 2022 16:11:30 -0700 Subject: [PATCH 16/35] WIP: Print of optional package enable is overridden by disable (#63) This just makes sense to alert the user of this override. Before, the override was silent. --- test/core/DependencyUnitTests/CMakeLists.txt | 13 +++++++++ .../TribitsAdjustPackageEnables.cmake | 27 +++++++++++++------ 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/test/core/DependencyUnitTests/CMakeLists.txt b/test/core/DependencyUnitTests/CMakeLists.txt index 8267b41a3..595ab5830 100644 --- a/test/core/DependencyUnitTests/CMakeLists.txt +++ b/test/core/DependencyUnitTests/CMakeLists.txt @@ -513,6 +513,19 @@ create_reduced_dependency_handling_test_case( ) +create_reduced_dependency_handling_test_case( + EnableAllPackages_ST_EpetraExtEnableTriutilsOn_EnableTriutilsOff + ARGS + -DTrilinos_ENABLE_ALL_PACKAGES=ON + -DTrilinos_ENABLE_SECONDARY_TESTED_CODE=ON + -DTrilinos_ENABLE_TESTS=ON + -DEpetraExt_ENABLE_Triutils=ON + -DTrilinos_ENABLE_Triutils=OFF + PASS_REGULAR_EXPRESSION_ALL + "-- NOTE: EpetraExt_ENABLE_Triutils=ON but Trilinos_ENABLE_Triutils=OFF is set[.] Setting EpetraExt_ENABLE_Triutils=OFF" + ) + + create_reduced_dependency_handling_test_case( EnableAllPackages_ST_EpetraExtEnableTriutilsOn ARGS diff --git a/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake b/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake index f647c7a87..68b31b3b4 100644 --- a/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake +++ b/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake @@ -979,14 +979,15 @@ macro(tribits_private_disable_required_package_enables endmacro() -macro(tribits_private_disable_optional_package_enables - fwdDepPkgName packageName - ) +macro(tribits_private_disable_optional_package_enables fwdDepPkgName packageName) - if (${fwdDepPkgName}_ENABLE_${packageName} OR "${${fwdDepPkgName}_ENABLE_${packageName}}" STREQUAL "") - # Always disable the conditional enable but only print the message if the package is enabled. + 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 try already! + if (${fwdDepPkgName}_ENABLE_${packageName}) # is explicitly enabled already! message("-- " "NOTE: Setting ${fwdDepPkgName}_ENABLE_${packageName}=OFF" " which was ${${fwdDepPkgName}_ENABLE_${packageName}}" @@ -999,6 +1000,16 @@ macro(tribits_private_disable_optional_package_enables " on disabled package ${packageName}") endif() endif() + if (${fwdDepPkgName}_ENABLE_${packageName} + AND (NOT ${PROJECT_NAME}_ENABLE_${packageName}) + AND (NOT "${${PROJECT_NAME}_ENABLE_${packageName}}" STREQUAL "") + ) + 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() set(${fwdDepPkgName}_ENABLE_${packageName} OFF) endif() @@ -1080,8 +1091,8 @@ macro(tribits_private_postprocess_optional_package_enable packageName 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} + elseif ((NOT "${${packageName}_ENABLE_${optDepPkg}}" STREQUAL "") + AND (NOT ${packageName}_ENABLE_${optDepPkg}) AND ${PROJECT_NAME}_ENABLE_${optDepPkg} ) message("-- " "NOTE: ${packageName}_ENABLE_${optDepPkg}=" From a4c4882bc9227edf20f5170d86fc40b4674d3c78 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Mon, 14 Nov 2022 17:40:55 -0700 Subject: [PATCH 17/35] WIP: Refactor tribits_sweep_backward_enable_upstream_packages() to process TPLs (#63) * Added calls to tribits_get_package_enable_status() to make work for internal and external packages. * The message printed when enabling a TPL with the combined logic is different so the tests had to change. * Fixed logic in tribits_set_up_enabled_only_dependencies() for package's with index '0' that was handled incorrectly. * Had to set ${PROJECT_NAME}_DEFINED_PACKAGES in unit test driver because this is now used in tribits_adjust_package_enables(). * Change name of TPL__ENABLING_PKG to _ENABLING_PKG and set for all packages, not just for packages triggering the enable of required TPLs. (Was needed for info on why a TPL got enabled so a user understands.) * Removed some commented-out debug code. WARNING: This does **not** handle the implicit enable of upstream TPLs correctly. With this current implementation, if a package depends on LAPACK, for example, TriBITS will automatically try to enable BLAS. That is not really the behavior that we want (yet) and breaks backward compatibility. I will fix that in a later commit. (It just so happens that the entire TriBITS test suite passes so that means we are missing a test for this use case.) --- test/core/DependencyUnitTests/CMakeLists.txt | 1 - .../TribitsExampleProject_Tests.cmake | 2 +- test/core/ProcessEnabledTpls/CMakeLists.txt | 16 +++---- .../TribitsAdjustPackageEnablesHelpers.cmake | 4 +- .../TribitsAdjustPackageEnables.cmake | 44 ++++++++++-------- .../TribitsProcessEnabledTpl.cmake | 8 ++-- .../TribitsProcessPackagesAndDirsLists.cmake | 2 +- .../TribitsSetUpEnabledOnlyDependencies.cmake | 7 +-- .../EnableAllPackages.txt | 9 ++-- .../EnableThyraEpetra_EnableTests.txt | 7 +-- .../EnableThyra_EnableTests.txt | 7 +-- ...EnableThyra_EnableTests_EnableBoost_ST.txt | 45 ++++++++++++------- ...nableTests_EnableBoost_ST_RequiredOnly.txt | 42 ++++++++++------- 13 files changed, 109 insertions(+), 85 deletions(-) diff --git a/test/core/DependencyUnitTests/CMakeLists.txt b/test/core/DependencyUnitTests/CMakeLists.txt index 595ab5830..5007ba409 100644 --- a/test/core/DependencyUnitTests/CMakeLists.txt +++ b/test/core/DependencyUnitTests/CMakeLists.txt @@ -1048,7 +1048,6 @@ create_dependency_handling_test_case( ARGS -DTrilinos_ENABLE_ALL_PACKAGES:BOOL=ON -DTPL_ENABLE_Boost:BOOL=ON -DTeuchos_ENABLE_Boost=OFF PASS_REGULAR_EXPRESSION_ALL - "Enabling all optional package TPL support _ENABLE_ not currently disabled for enabled TPLs" "-- NOTE: Teuchos_ENABLE_Boost=OFF is already set so not enabling even though TPL_ENABLE_Boost=ON is set!" ) diff --git a/test/core/ExamplesUnitTests/TribitsExampleProject_Tests.cmake b/test/core/ExamplesUnitTests/TribitsExampleProject_Tests.cmake index 619b15183..8ffad1fb1 100644 --- a/test/core/ExamplesUnitTests/TribitsExampleProject_Tests.cmake +++ b/test/core/ExamplesUnitTests/TribitsExampleProject_Tests.cmake @@ -195,7 +195,7 @@ function(TribitsExampleProject_ALL_ST_NoFortran sharedOrStatic serialOrMpi) "Enabling all packages that are not currently disabled because of TribitsExProj_ENABLE_ALL_PACKAGES=ON " "Setting TribitsExProj_ENABLE_SimpleCxx=ON" "Setting TribitsExProj_ENABLE_WithSubpackages=ON" - "Setting TPL_ENABLE_HeaderOnlyTpl=ON because it is required by the enabled package SimpleCxx" + "Setting TPL_ENABLE_HeaderOnlyTpl=ON because SimpleCxx has a required dependence on HeaderOnlyTpl" "Set cache entries for optional packages/TPLs and tests/examples for packages actually enabled ..." "Dumping direct enabled dependencies for each package ..." diff --git a/test/core/ProcessEnabledTpls/CMakeLists.txt b/test/core/ProcessEnabledTpls/CMakeLists.txt index ba01059f9..a7bb7e0c0 100644 --- a/test/core/ProcessEnabledTpls/CMakeLists.txt +++ b/test/core/ProcessEnabledTpls/CMakeLists.txt @@ -194,7 +194,7 @@ create_process_enabled_tpls_test_case( TPL_NAME HeaderOnlyTpl TPL_FINDMOD ${HeaderOnlyTpl_FINDMOD} INCLUDE_DIRS "/path_does_not_exist" - EXTR_ARGS -DTPL_HeaderOnlyTpl_ENABLING_PKG=SimpleCxx + EXTR_ARGS -DHeaderOnlyTpl_ENABLING_PKG=SimpleCxx PASS_REGULAR_EXPRESSION_ALL "Processing enabled external package/TPL: HeaderOnlyTpl .enabled by SimpleCxx, disable with -DTPL_ENABLE_HeaderOnlyTpl=OFF." "-- Must find at least one header in each of the header sets .HeaderOnlyTpl_stuff.hpp." @@ -450,7 +450,7 @@ create_process_enabled_tpls_test_case( TPL_FINDMOD ${HeadersAndLibsTpl_FINDMOD} INCLUDE_DIRS ${HeadersAndLibsTpl_BASE_DIR}/include LIBRARY_DIRS /path/does/not/exist - EXTR_ARGS -DTPL_HeadersAndLibsTpl_ENABLING_PKG=SomePackage + EXTR_ARGS -DHeadersAndLibsTpl_ENABLING_PKG=SomePackage PASS_REGULAR_EXPRESSION_ALL "Processing enabled external package/TPL: HeadersAndLibsTpl .enabled by SomePackage, disable with -DTPL_ENABLE_HeadersAndLibsTpl=OFF." "-- Must find at least one lib in each of the lib sets .haltpl1[;]haltpl2." @@ -492,7 +492,7 @@ create_process_enabled_tpls_test_case( TPL_FINDMOD ${HeadersAndLibsTpl_FINDMOD} INCLUDE_DIRS ${HeadersAndLibsTpl_BASE_DIR}/include LIBRARY_DIRS /path/does/not/exist - EXTR_ARGS -DTPL_HeadersAndLibsTpl_ENABLING_PKG=SomePackage + EXTR_ARGS -DHeadersAndLibsTpl_ENABLING_PKG=SomePackage -DNOT_MUST_FIND_ALL_LIBS=ON PASS_REGULAR_EXPRESSION_ALL "Processing enabled external package/TPL: HeadersAndLibsTpl .enabled by SomePackage, disable with -DTPL_ENABLE_HeadersAndLibsTpl=OFF." @@ -515,7 +515,7 @@ create_process_enabled_tpls_test_case( INCLUDE_DIRS ${HeadersAndLibsTpl_BASE_DIR}/include LIBRARY_DIRS ${HeadersAndLibsTpl_BASE_DIR}/lib EXTRA_ARGS -DHeadersAndLibsTpl_LIBRARY_NAMES="badlibname" - -DTPL_HeadersAndLibsTpl_ENABLING_PKG=SomePackage + -DHeadersAndLibsTpl_ENABLING_PKG=SomePackage PASS_REGULAR_EXPRESSION_ALL "Processing enabled external package/TPL: HeadersAndLibsTpl .enabled by SomePackage, disable with -DTPL_ENABLE_HeadersAndLibsTpl=OFF." "-- Must find at least one lib in each of the lib sets .badlibname." @@ -538,7 +538,7 @@ create_process_enabled_tpls_test_case( INCLUDE_DIRS ${HeadersAndLibsTpl_BASE_DIR}/include LIBRARY_DIRS ${HeadersAndLibsTpl_BASE_DIR}/lib EXTRA_ARGS -DHeadersAndLibsTpl_LIBRARY_NAMES="badlibname," - -DTPL_HeadersAndLibsTpl_ENABLING_PKG=SomePackage + -DHeadersAndLibsTpl_ENABLING_PKG=SomePackage -DNOT_MUST_FIND_ALL_LIBS=ON PASS_REGULAR_EXPRESSION_ALL "Processing enabled external package/TPL: HeadersAndLibsTpl .enabled by SomePackage, disable with -DTPL_ENABLE_HeadersAndLibsTpl=OFF." @@ -557,7 +557,7 @@ create_process_enabled_tpls_test_case( INCLUDE_DIRS ${HeadersAndLibsTpl_BASE_DIR}/include LIBRARY_DIRS ${HeadersAndLibsTpl_BASE_DIR}/lib EXTRA_ARGS -DHeadersAndLibsTpl_LIBRARY_NAMES="haltpl2,badlibname" - -DTPL_HeadersAndLibsTpl_ENABLING_PKG=SomePackage + -DHeadersAndLibsTpl_ENABLING_PKG=SomePackage PASS_REGULAR_EXPRESSION_ALL "Processing enabled external package/TPL: HeadersAndLibsTpl .enabled by SomePackage, disable with -DTPL_ENABLE_HeadersAndLibsTpl=OFF." "-- Searching for libs in HeadersAndLibsTpl_LIBRARY_DIRS='.+/HeadersAndLibsTpl/lib'" @@ -575,7 +575,7 @@ create_process_enabled_tpls_test_case( INCLUDE_DIRS ${HeadersAndLibsTpl_BASE_DIR}/include LIBRARY_DIRS ${HeadersAndLibsTpl_BASE_DIR}/lib EXTRA_ARGS -DHeadersAndLibsTpl_LIBRARY_NAMES="haltpl2,badlibname" - -DTPL_HeadersAndLibsTpl_ENABLING_PKG=SomePackage + -DHeadersAndLibsTpl_ENABLING_PKG=SomePackage -DNOT_MUST_FIND_ALL_LIBS=ON PASS_REGULAR_EXPRESSION_ALL "Processing enabled external package/TPL: HeadersAndLibsTpl .enabled by SomePackage, disable with -DTPL_ENABLE_HeadersAndLibsTpl=OFF." @@ -595,7 +595,7 @@ create_process_enabled_tpls_test_case( INCLUDE_DIRS ${HeadersAndLibsTpl_BASE_DIR}/include LIBRARY_DIRS ${HeadersAndLibsTpl_BASE_DIR}/lib EXTRA_ARGS -DHeadersAndLibsTpl_LIBRARY_NAMES="haltpl2,badlibname" - -DTPL_HeadersAndLibsTpl_ENABLING_PKG=SomePackage + -DHeadersAndLibsTpl_ENABLING_PKG=SomePackage -DNOT_MUST_FIND_ALL_LIBS=ON -D${MOCK_PROJECT_NAME}_MUST_FIND_ALL_TPL_LIBS=ON PASS_REGULAR_EXPRESSION_ALL diff --git a/test/core/TribitsAdjustPackageEnablesHelpers.cmake b/test/core/TribitsAdjustPackageEnablesHelpers.cmake index 408f8e1cd..df0dadd8c 100644 --- a/test/core/TribitsAdjustPackageEnablesHelpers.cmake +++ b/test/core/TribitsAdjustPackageEnablesHelpers.cmake @@ -60,8 +60,10 @@ macro(unittest_helper_read_and_process_packages) set_default(${PROJECT_NAME}_ENABLE_ALL_PACKAGES OFF) set_default(${PROJECT_NAME}_ENABLE_SECONDARY_TESTED_CODE OFF) set(DO_PROCESS_MPI_ENABLES ON) # Should not be needed but CMake is not working! + set(${PROJECT_NAME}_DEFINED_PACKAGES + ${${PROJECT_NAME}_DEFINED_TPLS} ${${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES}) foreach(tribitsPkg ${${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES}) - global_set(${tribitsPkg}_FULL_ENABLED_DEP_PACKAGES) + global_set(${tribitsPkg}_FULL_ENABLED_DEP_PACKAGES "") endforeach() tribits_print_enables_before_adjust_package_enables() tribits_adjust_package_enables(TRUE) diff --git a/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake b/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake index 68b31b3b4..59fed19fc 100644 --- a/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake +++ b/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake @@ -295,14 +295,19 @@ macro(tribits_sweep_backward_enable_upstream_packages) " (and optional since ${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES=ON)") endif() + tribits_get_sublist_nondisabled( ${PROJECT_NAME}_DEFINED_PACKAGES + ${PROJECT_NAME}_NOTDISABLED_PACKAGES "") + tribit_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_INTERNAL_PACKAGES) + 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 feed into these packages. This has to include *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). @@ -1073,19 +1078,20 @@ endmacro() # ${PACKAGE_NAME} (i.e. ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME} is assumed to # be TRUE before calling this macro. # -macro(tribits_private_postprocess_optional_package_enable packageName - optDepPkg - ) +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) - if (${packageName}_ENABLE_${optDepPkg} AND ${PROJECT_NAME}_ENABLE_${optDepPkg}) + if (${packageName}_ENABLE_${optDepPkg} AND optDepPkgEnable) message("-- " "NOTE:" " ${packageName}_ENABLE_${optDepPkg}=${${packageName}_ENABLE_${optDepPkg}}" " is already set!") elseif ("${${packageName}_ENABLE_${optDepPkg}}" STREQUAL "") - if (${PROJECT_NAME}_ENABLE_${optDepPkg}) + if (optDepPkgEnable) message("-- " "Setting ${packageName}_ENABLE_${optDepPkg}=ON" - " since ${PROJECT_NAME}_ENABLE_${packageName}=ON AND" - " ${PROJECT_NAME}_ENABLE_${optDepPkg}=ON") + " since ${packageEnableVar}=ON AND" + " ${optDepPkgEnableVar}=ON") set(${packageName}_ENABLE_${optDepPkg} ON) else() message("-- " "NOT setting ${packageName}_ENABLE_${optDepPkg}=ON" @@ -1093,12 +1099,12 @@ macro(tribits_private_postprocess_optional_package_enable packageName endif() elseif ((NOT "${${packageName}_ENABLE_${optDepPkg}}" STREQUAL "") AND (NOT ${packageName}_ENABLE_${optDepPkg}) - AND ${PROJECT_NAME}_ENABLE_${optDepPkg} + AND optDepPkgEnable ) message("-- " "NOTE: ${packageName}_ENABLE_${optDepPkg}=" "${${packageName}_ENABLE_${optDepPkg}} is already set so not enabling even" - " though ${PROJECT_NAME}_ENABLE_${optDepPkg}=" - "${${PROJECT_NAME}_ENABLE_${optDepPkg}} is set!") + " though ${optDepPkgEnableVar}=" + "${optDepPkgEnable} is set!") endif() string(TOUPPER ${packageName} packageName_UPPER) @@ -1389,18 +1395,19 @@ endmacro() macro(tribits_private_enable_dep_package packageName depPkgName libOrTest) - if (${PROJECT_NAME}_ENABLE_${depPkgName}) + tribits_get_package_enable_status(${depPkgName} depPkgEnable depPkgEnableVar) + if (depPkgEnable) #message("The package is already enabled so there is nothing to enable!") - elseif (${PROJECT_NAME}_ENABLE_${depPkgName} STREQUAL "") + elseif (${depPkgEnableVar} STREQUAL "") set(tpedp_enableDepPkg "") if (${packageName}_${libOrTest}_DEP_REQUIRED_${depPkgName}) - message("-- " "Setting ${PROJECT_NAME}_ENABLE_${depPkgName}=ON" + 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 ${PROJECT_NAME}_ENABLE_${depPkgName}=ON" + message("-- " "Setting ${depPkgEnableVar}=ON" " because ${packageName}_ENABLE_${depPkgName}=ON") set(tpedp_enableDepPkg ON) elseif (${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES) @@ -1409,14 +1416,15 @@ macro(tribits_private_enable_dep_package packageName depPkgName libOrTest) tribits_implicit_package_enable_is_allowed(${packageName} ${depPkgName} allowImplicitEnable) if (allowImplicitEnable) - message("-- " "Setting ${PROJECT_NAME}_ENABLE_${depPkgName}=ON" + 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(${PROJECT_NAME}_ENABLE_${depPkgName} ON) + set(${depPkgEnableVar} ON) + set(${depPkgName}_ENABLING_PKG ${packageName}) endif() endif() endmacro() diff --git a/tribits/core/package_arch/TribitsProcessEnabledTpl.cmake b/tribits/core/package_arch/TribitsProcessEnabledTpl.cmake index dcdde4ce6..f6925f208 100644 --- a/tribits/core/package_arch/TribitsProcessEnabledTpl.cmake +++ b/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/tribits/core/package_arch/TribitsProcessPackagesAndDirsLists.cmake b/tribits/core/package_arch/TribitsProcessPackagesAndDirsLists.cmake index dd2e2749b..d045fdedf 100644 --- a/tribits/core/package_arch/TribitsProcessPackagesAndDirsLists.cmake +++ b/tribits/core/package_arch/TribitsProcessPackagesAndDirsLists.cmake @@ -339,7 +339,7 @@ endfunction() # it. # function(tribits_implicit_package_enable_is_allowed upstreamPackageName - packageName implictPackageEnableAllowedOut + packageName implictPackageEnableAllowedOut ) if (${packageName}_PACKAGE_BUILD_STATUS STREQUAL "EXTERNAL") diff --git a/tribits/core/package_arch/TribitsSetUpEnabledOnlyDependencies.cmake b/tribits/core/package_arch/TribitsSetUpEnabledOnlyDependencies.cmake index 3ed4f3537..8c11e30f8 100644 --- a/tribits/core/package_arch/TribitsSetUpEnabledOnlyDependencies.cmake +++ b/tribits/core/package_arch/TribitsSetUpEnabledOnlyDependencies.cmake @@ -88,16 +88,12 @@ function(tribits_set_up_enabled_only_dependencies) foreach(tribitsPkg IN LISTS ${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) + 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}) - #print_var(LAST_PKG_IDX) - #print_var(LAST_PKG) endif() endif() endforeach() @@ -112,7 +108,6 @@ function(tribits_set_up_enabled_only_dependencies) endif() - if (GENERATE_EXPORT_DEPENDENCIES) if (lastExportTribitsPackage) diff --git a/tribits/doc/guides/ReducedMockTrilinosOutput/EnableAllPackages.txt b/tribits/doc/guides/ReducedMockTrilinosOutput/EnableAllPackages.txt index 07c2c9d87..da111da02 100644 --- a/tribits/doc/guides/ReducedMockTrilinosOutput/EnableAllPackages.txt +++ b/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/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyraEpetra_EnableTests.txt b/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyraEpetra_EnableTests.txt index 9ad431f62..0d3f79b5c 100644 --- a/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyraEpetra_EnableTests.txt +++ b/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/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests.txt b/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests.txt index 46e1cdc7a..c66d07690 100644 --- a/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests.txt +++ b/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/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests_EnableBoost_ST.txt b/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests_EnableBoost_ST.txt index 00efe417f..3aa2f7a33 100644 --- a/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests_EnableBoost_ST.txt +++ b/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/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests_EnableBoost_ST_RequiredOnly.txt b/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests_EnableBoost_ST_RequiredOnly.txt index 3647d4d81..268535389 100644 --- a/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests_EnableBoost_ST_RequiredOnly.txt +++ b/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 From 2e5cc338f005a575d62ea2f04381b2aec5388825 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Wed, 16 Nov 2022 09:33:37 -0700 Subject: [PATCH 18/35] WIP: Delete many TPL-specific functions/macros (#63) Now that the same code is being used for internal and external packages, we are not even calling this TPL-specific code anymore. --- .../TribitsAdjustPackageEnables.cmake | 233 ------------------ 1 file changed, 233 deletions(-) diff --git a/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake b/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake index 59fed19fc..8f795a1fa 100644 --- a/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake +++ b/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake @@ -85,9 +85,6 @@ macro(tribits_adjust_package_enables) tribits_sweep_forward_apply_enables() tribits_disable_and_enable_tests_and_examples() tribits_sweep_backward_enable_upstream_packages() - tribits_sweep_backward_enable_required_tpls() - # ToDo #63: Merge behavior of the above macro into - # tribits_sweep_backward_enable_upstream_packages() as part of #63. tribits_set_cache_vars_for_current_enabled_packages() tribits_enable_parent_package_for_subpackage_enable() tribits_set_up_enabled_lists_and_pkg_idx() @@ -324,38 +321,6 @@ macro(tribits_sweep_backward_enable_upstream_packages) endmacro() -# @MACRO: tribits_sweep_backward_enable_required_tpls() -# -# Enable the TPLs required by the internal packages that are enabled -# -# See implementation for details. -# -macro(tribits_sweep_backward_enable_required_tpls) - - message("\nEnabling all remaining required TPLs for current set of" - " enabled packages ...\n") - foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES) - tribits_enable_required_tpls(${tad1_tribitsPkg}) - endforeach() - - message("\nEnabling all optional package TPL support" - " _ENABLE_ not currently disabled for" - " enabled TPLs ...\n") - foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES) - tribits_postprocess_optional_tpl_enables(${tad1_tribitsPkg}) - endforeach() - - message("\nEnabling TPLs based on _ENABLE_=ON if TPL is not explicitly disabled ...\n") - foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES) - tribits_enable_optional_tpls(${tad1_tribitsPkg}) - 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. - -endmacro() - - # @MACRO: tribits_set_cache_vars_for_current_enabled_packages() # macro(tribits_set_cache_vars_for_current_enabled_packages) @@ -559,70 +524,6 @@ endmacro() # not only improves performance but it also aids in testing. -# Macro that sets the required TPLs for given package -# -macro(tribits_enable_required_tpls PACKAGE_NAME) - - assert_defined(${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - - if (${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - - foreach(DEP_TPL IN LISTS ${PACKAGE_NAME}_LIB_REQUIRED_DEP_TPLS) - tribits_private_enable_dep_tpl(${PACKAGE_NAME} ${DEP_TPL}) - endforeach() - - foreach(DEP_TPL IN LISTS ${PACKAGE_NAME}_TEST_REQUIRED_DEP_TPLS) - tribits_private_enable_dep_tpl(${PACKAGE_NAME} ${DEP_TPL}) - endforeach() - - endif() - -endmacro() - - -# Post-processes optional package TPL based on if the TPL -# has been enabled or not -# -macro(tribits_postprocess_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() - - endif() - -endmacro() - - -# Macro that enables the optional TPLs for given package -# -macro(tribits_enable_optional_tpls 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 sets cache vars for optional package interdependencies # # This also will set ${PACKAGE_NAME}_ENABLE_TESTS and @@ -880,63 +781,6 @@ function(tribits_private_print_disable endfunction() -macro(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. - - assert_defined(${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - if (${PROJECT_NAME}_ENABLE_${PACKAGE_NAME} - OR ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME} STREQUAL "" - ) - - if ("${LIBRARY_DEP}" STREQUAL "TRUE") - - tribits_private_print_disable( - ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME} ${PACKAGE_NAME} "library" - "TPL" ${TPL_NAME} - ) - - set(${PROJECT_NAME}_ENABLE_${PACKAGE_NAME} OFF) - - else() - - set(DEP_TYPE_STR "test/example") - - 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() - - 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() - - # 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. - - endif() - - endif() - -endmacro() - - function(tribits_private_print_disable_required_package_enable PACKAGE_NAME PACKAGE_ENABLE_SOMETHING_VAR_NAME FORWARD_DEP_PACKAGE_NAME DEP_TYPE_STR @@ -1120,57 +964,6 @@ macro(tribits_private_postprocess_optional_package_enable packageName optDepPk endmacro() -# 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) - - 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) - else() - set(${MACRO_DEFINE_NAME} OFF) - endif() - -endmacro() - - # Macro that post-processes optional dependencies after all other # dependencies have been worked out # @@ -1430,32 +1223,6 @@ macro(tribits_private_enable_dep_package packageName depPkgName libOrTest) 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 upstream (required and optional) packages for a given # package # From f8b319c91023b599895e3d05f4e09cedc0a331c3 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Wed, 16 Nov 2022 13:40:56 -0700 Subject: [PATCH 19/35] Refactor tribits_set_cache_vars_for_current_enabled_packages() to use new deps vars (#63) As part of this: * Removed the macro tribits_private_add_optional_tpl_enable() and just call tribits_private_add_optional_package_enable() for TPL dependencies. (This changes the doc string to say "package" instead of "TPL" but in the new TriBITS a TPL is just an external package so that is okay.) * Changed name of tribits_set_up_optional_package_enables_and_cache_vars() to tribits_setup_optional_package_enables_and_cache_vars() (since "setup" is a legitimate noun). * Renamed some local vars --- .../TribitsAdjustPackageEnables.cmake | 72 +++++-------------- 1 file changed, 18 insertions(+), 54 deletions(-) diff --git a/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake b/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake index 8f795a1fa..5bf7e6be7 100644 --- a/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake +++ b/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake @@ -326,7 +326,7 @@ endmacro() 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_set_up_optional_package_enables_and_cache_vars(${tad1_tribitsPkg}) + tribits_setup_optional_package_enables_and_cache_vars(${tad1_tribitsPkg}) endforeach() endmacro() @@ -529,61 +529,51 @@ 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) +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(SET_AS_CACHE ${${PROJECT_NAME}_ENABLE_${packageName}}) if (SET_AS_CACHE) multiline_set(DOCSTR - "Build tests for the package ${PACKAGE_NAME}. Set to 'ON', 'OFF', or leave empty ''" + "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 ''" + "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 ''" + "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 + 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" "${SET_AS_CACHE}" ) 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" "${SET_AS_CACHE}" ) endforeach() endmacro() @@ -892,32 +882,6 @@ macro(tribits_private_add_optional_package_enable PACKAGE_NAME OPTIONAL_DEP_PAC endmacro() -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." - ) - - set_cache_on_off_empty( ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL} "" - ${DOCSTR} ) - - else() - - if (NOT DEFINED ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL}) - set( ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL} "" ) - endif() - - endif() - -endmacro() - - # 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. From a56e094eef45acf58001f1cc04a1f1095f0f521a Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Wed, 16 Nov 2022 14:04:42 -0700 Subject: [PATCH 20/35] WIP: Refactor tribits_do_final_parent_packages_enables_for_subpackage_enables() to use new deps vars (#63) * Changed name from tribits_enable_parent_package_for_subpackage_enable() to tribits_do_final_parent_packages_enables_for_subpackage_enables() which is more accurate. * Change the name from tribits_postprocess_package_with_subpackages_enables() to tribits_set_parent_package_subpackage_enable_for_enabled_subpackages() which is more accurate. * Changed name from tribits_postprocess_package_with_subpackages_test_example_enables() to tribits_set_parent_package_test_example_enable_for_enabled_subpackages() which is more accurate. * Changed names of some local vars * Improved some comments --- .../TribitsAdjustPackageEnables.cmake | 95 ++++++++++--------- 1 file changed, 50 insertions(+), 45 deletions(-) diff --git a/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake b/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake index 5bf7e6be7..0d92b1fa4 100644 --- a/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake +++ b/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake @@ -86,7 +86,7 @@ macro(tribits_adjust_package_enables) tribits_disable_and_enable_tests_and_examples() tribits_sweep_backward_enable_upstream_packages() tribits_set_cache_vars_for_current_enabled_packages() - tribits_enable_parent_package_for_subpackage_enable() + tribits_do_final_parent_packages_enables_for_subpackage_enables() tribits_set_up_enabled_lists_and_pkg_idx() tribits_setup_direct_packages_dependencies_lists_and_lib_required_enable_vars() tribits_print_direct_packages_dependencies_lists() @@ -331,19 +331,21 @@ macro(tribits_set_cache_vars_for_current_enabled_packages) endmacro() -# @MACRO: tribits_enable_parent_package_for_subpackage_enable() +# @MACRO: tribits_do_final_parent_packages_enables_for_subpackage_enables() # -macro(tribits_enable_parent_package_for_subpackage_enable) +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") + 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_postprocess_package_with_subpackages_enables(${tad1_tribitsPkg}) + 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 doing this last ensures that no downstream - # dependencies will be enabled. + # 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. endmacro() @@ -579,29 +581,32 @@ macro(tribits_setup_optional_package_enables_and_cache_vars packageName) endmacro() -# Macro that post-processes final package enables for packages with subpackage -# enables. +# Macro that enables a the top-level parent package enable if any of its +# subpackages are enabled. # -macro(tribits_postprocess_package_with_subpackages_enables PACKAGE_NAME) - foreach(tap2_subPkgName IN LISTS ${PACKAGE_NAME}_SUBPACKAGES) - set(subpkgFullName ${PACKAGE_NAME}${tap2_subPkgName}) +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_${PACKAGE_NAME} + AND (NOT ${PROJECT_NAME}_ENABLE_${toplevelPackageName}) ) message("-- " - "Setting ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}=ON" + "Setting ${PROJECT_NAME}_ENABLE_${toplevelPackageName}=ON" " because ${PROJECT_NAME}_ENABLE_${subpkgFullName}=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. + 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() @@ -953,41 +958,41 @@ endmacro() # ${packageName}_[LIB|TEST]_DEP_REQUIRED_${depPkg}. -# Set _ENABLE_=ON if not already enabled for all -# subpackages of a parent package. +# Macro that sets ``_ENABLE_=ON`` if not already +# enabled for all enabled subpackages of a parent package. # -macro(tribits_postprocess_package_with_subpackages_optional_subpackage_enables - PACKAGE_NAME +macro(tribits_set_parent_package_subpackage_enable_for_enabled_subpackages + toplevelPackageName ) - foreach(tap3_subPkg IN LISTS ${PACKAGE_NAME}_SUBPACKAGES) - set(subpkgFullName ${PACKAGE_NAME}${tap3_subPkg}) + foreach(tap3_subPkg IN LISTS ${toplevelPackageName}_SUBPACKAGES) + set(subpkgFullName ${toplevelPackageName}${tap3_subPkg}) if (${PROJECT_NAME}_ENABLE_${subpkgFullName} - AND "${${PACKAGE_NAME}_ENABLE_${subpkgFullName}}" STREQUAL "" + AND "${${toplevelPackageName}_ENABLE_${subpkgFullName}}" STREQUAL "" ) message("-- " - "Setting ${PACKAGE_NAME}_ENABLE_${subpkgFullName}=ON" + "Setting ${toplevelPackageName}_ENABLE_${subpkgFullName}=ON" " because ${PROJECT_NAME}_ENABLE_${subpkgFullName}=ON") - set(${PACKAGE_NAME}_ENABLE_${subpkgFullName} ON) + set(${toplevelPackageName}_ENABLE_${subpkgFullName} ON) endif() endforeach() endmacro() -# Set the parent package tests/examples enables if one subpackage is enabled -# and has its tests/examples +# Macro that sets ``_ENABLE_[TESTS|EXAMPLES]=ON`` if subpackage +# is enabled and has its tests/examples are enabled. # -macro(tribits_postprocess_package_with_subpackages_test_example_enables - PACKAGE_NAME TESTS_OR_EXAMPLES +macro(tribits_set_parent_package_test_example_enable_for_enabled_subpackages + toplevelPackageName testOrExamples ) - foreach(tap3_subPkg IN LISTS ${PACKAGE_NAME}_SUBPACKAGES) - set(subpkgFullName ${PACKAGE_NAME}${tap3_subPkg}) - if (${subpkgFullName}_ENABLE_${TESTS_OR_EXAMPLES} - AND "${${PACKAGE_NAME}_ENABLE_${TESTS_OR_EXAMPLES}}" STREQUAL "" + foreach(tap3_subPkg IN LISTS ${toplevelPackageName}_SUBPACKAGES) + set(subpkgFullName ${toplevelPackageName}${tap3_subPkg}) + if (${subpkgFullName}_ENABLE_${testOrExamples} + AND "${${toplevelPackageName}_ENABLE_${testOrExamples}}" STREQUAL "" ) message("-- " - "Setting ${PACKAGE_NAME}_ENABLE_${TESTS_OR_EXAMPLES}=ON" - " because ${subpkgFullName}_ENABLE_${TESTS_OR_EXAMPLES}=ON") - set(${PACKAGE_NAME}_ENABLE_${TESTS_OR_EXAMPLES} ON) + "Setting ${toplevelPackageName}_ENABLE_${testOrExamples}=ON" + " because ${subpkgFullName}_ENABLE_${testOrExamples}=ON") + set(${toplevelPackageName}_ENABLE_${testOrExamples} ON) endif() endforeach() endmacro() From 835c415943d50c75da4b9f18b4b6ad9add8d1a33 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Wed, 16 Nov 2022 14:29:21 -0700 Subject: [PATCH 21/35] WIP: Move tribits_set_up_enabled_lists_and_pkg_idx() into TribitsAdjustPackageEnables.cmake (#63) This macro is every only called from inside of TribitsAdjustPackageEnables.cmake so it should be in there. --- .../TribitsAdjustPackageEnables.cmake | 39 +++++++++++++++++++ .../package_arch/TribitsGeneralMacros.cmake | 39 ------------------- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake b/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake index 0d92b1fa4..667e7a813 100644 --- a/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake +++ b/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake @@ -1217,4 +1217,43 @@ endmacro() # correctly because of this defect. +# 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_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 + 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_sublist_enabled( ${PROJECT_NAME}_DEFINED_TPLS + ${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() + + # LocalWords: tribits TriBITS foreach endmacro endfunction diff --git a/tribits/core/package_arch/TribitsGeneralMacros.cmake b/tribits/core/package_arch/TribitsGeneralMacros.cmake index 8da82f2b2..2f0f292d3 100644 --- a/tribits/core/package_arch/TribitsGeneralMacros.cmake +++ b/tribits/core/package_arch/TribitsGeneralMacros.cmake @@ -145,45 +145,6 @@ function(tribits_set_base_repo_dir BASE_DIR REPO_DIR BASE_REPO_DIR_OUT) 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_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 - 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_sublist_enabled( ${PROJECT_NAME}_DEFINED_TPLS - ${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 From d305a4ae9203bb31f4c5c35dcb60d348f21c74df Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Wed, 16 Nov 2022 14:37:31 -0700 Subject: [PATCH 22/35] Change name to tribits_setup_enabled_lists_and_pkg_idxs(), cleanup (#63) * Removed some vars that were never being used. (We can add then back later if they are ever needed.) * Renamed some local vars --- .../TribitsAdjustPackageEnables.cmake | 25 ++++++------------- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake b/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake index 667e7a813..0bc37b62f 100644 --- a/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake +++ b/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake @@ -87,7 +87,7 @@ macro(tribits_adjust_package_enables) tribits_sweep_backward_enable_upstream_packages() tribits_set_cache_vars_for_current_enabled_packages() tribits_do_final_parent_packages_enables_for_subpackage_enables() - tribits_set_up_enabled_lists_and_pkg_idx() + 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() @@ -1219,7 +1219,7 @@ endmacro() # Macro that sets up the basic lists of enabled packages and packages. # -macro(tribits_set_up_enabled_lists_and_pkg_idx) +macro(tribits_setup_enabled_lists_and_pkg_idxs) # ${PROJECT_NAME}_ENABLED_PACKAGES tribits_get_sublist_enabled( @@ -1233,26 +1233,15 @@ macro(tribits_set_up_enabled_lists_and_pkg_idx) ${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) + unset(${PROJECT_NAME}_REVERSE_ENABLED_INTERNAL_PACKAGES) # Wipe out temp value - # ${PACKAGE_NAME}_PKG_IDX - set(PKG_IDX 0) + # Set ${PACKAGE_NAME}_PKG_IDX for each enabled package + set(pkgIdx 0) foreach(tribitsPackage ${${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES}) - set(${tribitsPackage}_PKG_IDX ${PKG_IDX}) - math(EXPR PKG_IDX "${PKG_IDX} + 1") + set(${tribitsPackage}_PKG_IDX ${pkgIdx}) + math(EXPR pkgIdx "${pkgIdx} + 1") endforeach() - # ${PROJECT_NAME}_ENABLED_TPLS - tribits_get_sublist_enabled( ${PROJECT_NAME}_DEFINED_TPLS - ${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() From 577ca23ba17510ba5f21453831c57f1ad84cc9a4 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Fri, 18 Nov 2022 07:34:45 -0700 Subject: [PATCH 23/35] WIP: Refactor tribits_setup_direct_packages_dependencies_lists_and_lib_required_enable_vars() to use new deps vars (#63) This really compated the code in the macro tribits_setup_enabled_dependencies_lists_and_enable_vars(). Also: * Updated comments * Adjust some if() statment formatting --- .../TribitsAdjustPackageEnables.cmake | 98 ++++++------------- .../TribitsPackageDependencies.cmake | 17 ++-- 2 files changed, 39 insertions(+), 76 deletions(-) diff --git a/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake b/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake index 0bc37b62f..8b1fb8263 100644 --- a/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake +++ b/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake @@ -364,9 +364,7 @@ macro(tribits_setup_direct_packages_dependencies_lists_and_lib_required_enable_v # upstream from ${tad1_externalPkgName} endforeach() - foreach(tad1_internalPkgName IN LISTS - ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES - ) + foreach(tad1_internalPkgName IN LISTS ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES) tribits_setup_enabled_dependencies_lists_and_enable_vars(${tad1_internalPkgName}) endforeach() @@ -641,81 +639,45 @@ endmacro() # macro(tribits_setup_enabled_dependencies_lists_and_enable_vars packageName) - # LIB dependencies + tribits_get_package_enable_status(${packageName} packageEnable packageEnableVar) set(${packageName}_LIB_ENABLED_DEPENDENCIES "") - - foreach(depPkg ${${packageName}_LIB_REQUIRED_DEP_PACKAGES}) - 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}) - 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}) - 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}) - 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_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}) - if (enablePkgAndTestsOrExamples) - list(APPEND ${packageName}_TEST_ENABLED_DEPENDENCIES ${depPkg}) - endif() - endforeach() - - foreach(depPkg ${${packageName}_TEST_OPTIONAL_DEP_PACKAGES}) - if (enablePkgAndTestsOrExamples AND ${packageName}_ENABLE_${depPkg}) - list(APPEND ${packageName}_TEST_ENABLED_DEPENDENCIES ${depPkg}) - endif() - endforeach() - - foreach(depPkg ${${packageName}_TEST_REQUIRED_DEP_TPLS}) - if (enablePkgAndTestsOrExamples) - list(APPEND ${packageName}_TEST_ENABLED_DEPENDENCIES ${depPkg}) - endif() - endforeach() - - foreach(depPkg ${${packageName}_TEST_OPTIONAL_DEP_TPLS}) - 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 diff --git a/tribits/core/package_arch/TribitsPackageDependencies.cmake b/tribits/core/package_arch/TribitsPackageDependencies.cmake index 416b03d7f..0f4a956dd 100644 --- a/tribits/core/package_arch/TribitsPackageDependencies.cmake +++ b/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() From 71377ae4ac999c8f568042f28dca4f333616a874 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Fri, 18 Nov 2022 08:28:12 -0700 Subject: [PATCH 24/35] WIP: tribits_package_set_full_enabled_dep_packages(): Rename local vars (#63) --- .../TribitsSetUpEnabledOnlyDependencies.cmake | 57 +++++++++---------- 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/tribits/core/package_arch/TribitsSetUpEnabledOnlyDependencies.cmake b/tribits/core/package_arch/TribitsSetUpEnabledOnlyDependencies.cmake index 8c11e30f8..4434e220e 100644 --- a/tribits/core/package_arch/TribitsSetUpEnabledOnlyDependencies.cmake +++ b/tribits/core/package_arch/TribitsSetUpEnabledOnlyDependencies.cmake @@ -140,65 +140,62 @@ endfunction() # enabled package ``${PACKAGE_NAME}``, including all of its indirect upstream # internal package dependencies. # -function(tribits_package_set_full_enabled_dep_packages PACKAGE_NAME) +function(tribits_package_set_full_enabled_dep_packages packageName) - set(PACKAGE_FULL_DEPS_LIST "") + set(packageFullDepsList "") - foreach(DEP_PKG IN LISTS ${PACKAGE_NAME}_LIB_REQUIRED_DEP_PACKAGES) - if (${PROJECT_NAME}_ENABLE_${DEP_PKG}) - list(APPEND PACKAGE_FULL_DEPS_LIST ${DEP_PKG}) + foreach(depPkg IN LISTS ${packageName}_LIB_REQUIRED_DEP_PACKAGES) + if (${PROJECT_NAME}_ENABLE_${depPkg}) + list(APPEND packageFullDepsList ${depPkg}) endif() # NOTE: This if() should not be needed but this is a safeguard endforeach() - foreach(DEP_PKG IN LISTS ${PACKAGE_NAME}_LIB_OPTIONAL_DEP_PACKAGES) - if (${PACKAGE_NAME}_ENABLE_${DEP_PKG}) - list(APPEND PACKAGE_FULL_DEPS_LIST ${DEP_PKG}) + foreach(depPkg IN LISTS ${packageName}_LIB_OPTIONAL_DEP_PACKAGES) + if (${packageName}_ENABLE_${depPkg}) + list(APPEND packageFullDepsList ${depPkg}) endif() endforeach() - if(PACKAGE_FULL_DEPS_LIST) - list(REMOVE_DUPLICATES PACKAGE_FULL_DEPS_LIST) + if(packageFullDepsList) + list(REMOVE_DUPLICATES packageFullDepsList) - foreach(DEP_PACKAGE IN LISTS PACKAGE_FULL_DEPS_LIST) - list(APPEND PACKAGE_FULL_DEPS_LIST ${${DEP_PACKAGE}_FULL_ENABLED_DEP_PACKAGES}) + foreach(DEP_PACKAGE IN LISTS packageFullDepsList) + list(APPEND packageFullDepsList ${${DEP_PACKAGE}_FULL_ENABLED_DEP_PACKAGES}) endforeach() - list(REMOVE_DUPLICATES PACKAGE_FULL_DEPS_LIST) + list(REMOVE_DUPLICATES packageFullDepsList) endif() - set(ORDERED_PACKAGE_FULL_DEPS_LIST "") + set(orderedPackageFullDepsList "") - foreach(DEP_PACKAGE IN LISTS PACKAGE_FULL_DEPS_LIST) + foreach(depPkg IN LISTS packageFullDepsList) - #print_var(${DEP_PACKAGE}_PKG_IDX) - set(DEP_PACKAGE_VALUE ${${DEP_PACKAGE}_PKG_IDX}) + set(depPkgIdx ${${depPkg}_PKG_IDX}) - set(SORTED_INDEX 0) - set(INSERTED_DEP_PACKAGE FALSE) + set(sortedIndex 0) + set(insertedDepPkg FALSE) - foreach(SORTED_PACKAGE IN LISTS ORDERED_PACKAGE_FULL_DEPS_LIST) + foreach(sortedPackage IN LISTS orderedPackageFullDepsList) - #print_var(${SORTED_PACKAGE}_PKG_IDX) - set(SORTED_PACKAGE_VALUE ${${SORTED_PACKAGE}_PKG_IDX}) + set(sortedPackageIdx ${${sortedPackage}_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) + if (${depPkgIdx} GREATER ${sortedPackageIdx}) + list(INSERT orderedPackageFullDepsList ${sortedIndex} ${depPkg}) + set(insertedDepPkg TRUE) break() endif() - math(EXPR SORTED_INDEX ${SORTED_INDEX}+1) + math(EXPR sortedIndex ${sortedIndex}+1) endforeach() - if(NOT INSERTED_DEP_PACKAGE) - list(APPEND ORDERED_PACKAGE_FULL_DEPS_LIST ${DEP_PACKAGE}) + if(NOT insertedDepPkg) + list(APPEND orderedPackageFullDepsList ${depPkg}) endif() endforeach() - global_set(${PACKAGE_NAME}_FULL_ENABLED_DEP_PACKAGES - ${ORDERED_PACKAGE_FULL_DEPS_LIST}) + global_set(${packageName}_FULL_ENABLED_DEP_PACKAGES ${orderedPackageFullDepsList}) endfunction() From 71602744e237a6a091146bc51654bff946486680 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Fri, 18 Nov 2022 08:55:48 -0700 Subject: [PATCH 25/35] WIP: Factor out tribits_package_build_unsorted_full_enabled_dep_packages() (#63) --- .../TribitsSetUpEnabledOnlyDependencies.cmake | 69 ++++++++++++------- 1 file changed, 44 insertions(+), 25 deletions(-) diff --git a/tribits/core/package_arch/TribitsSetUpEnabledOnlyDependencies.cmake b/tribits/core/package_arch/TribitsSetUpEnabledOnlyDependencies.cmake index 4434e220e..c5610d0ab 100644 --- a/tribits/core/package_arch/TribitsSetUpEnabledOnlyDependencies.cmake +++ b/tribits/core/package_arch/TribitsSetUpEnabledOnlyDependencies.cmake @@ -140,32 +140,14 @@ endfunction() # enabled package ``${PACKAGE_NAME}``, including all of its indirect upstream # internal package dependencies. # +# NOTE: The complexity of this function is O(^2). 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) - set(packageFullDepsList "") - - foreach(depPkg IN LISTS ${packageName}_LIB_REQUIRED_DEP_PACKAGES) - if (${PROJECT_NAME}_ENABLE_${depPkg}) - list(APPEND packageFullDepsList ${depPkg}) - endif() - # NOTE: This if() should not be needed but this is a safeguard - endforeach() - - foreach(depPkg IN LISTS ${packageName}_LIB_OPTIONAL_DEP_PACKAGES) - if (${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() + tribits_package_build_unsorted_full_enabled_dep_packages(${packageName} + packageFullDepsList) set(orderedPackageFullDepsList "") @@ -178,7 +160,7 @@ function(tribits_package_set_full_enabled_dep_packages packageName) foreach(sortedPackage IN LISTS orderedPackageFullDepsList) - set(sortedPackageIdx ${${sortedPackage}_PKG_IDX}) + set(sortedPackageIdx ${${sortedPackage}_PKG_IDX}) if (${depPkgIdx} GREATER ${sortedPackageIdx}) list(INSERT orderedPackageFullDepsList ${sortedIndex} ${depPkg}) @@ -199,3 +181,40 @@ function(tribits_package_set_full_enabled_dep_packages packageName) 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_REQUIRED_DEP_PACKAGES) + if (${PROJECT_NAME}_ENABLE_${depPkg}) + list(APPEND packageFullDepsList ${depPkg}) + endif() + # NOTE: This if() should not be needed but this is a safeguard + endforeach() + + foreach(depPkg IN LISTS ${packageName}_LIB_OPTIONAL_DEP_PACKAGES) + if (${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() \ No newline at end of file From db8a25cfde680e60266447510d5ab8c18abead54 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Fri, 18 Nov 2022 16:20:42 -0700 Subject: [PATCH 26/35] WIP: Factor out tribits_package_sort_full_enabled_dep_packages() (#63) --- .../TribitsSetUpEnabledOnlyDependencies.cmake | 73 +++++++++++-------- 1 file changed, 44 insertions(+), 29 deletions(-) diff --git a/tribits/core/package_arch/TribitsSetUpEnabledOnlyDependencies.cmake b/tribits/core/package_arch/TribitsSetUpEnabledOnlyDependencies.cmake index c5610d0ab..4f426f02f 100644 --- a/tribits/core/package_arch/TribitsSetUpEnabledOnlyDependencies.cmake +++ b/tribits/core/package_arch/TribitsSetUpEnabledOnlyDependencies.cmake @@ -149,34 +149,8 @@ function(tribits_package_set_full_enabled_dep_packages packageName) tribits_package_build_unsorted_full_enabled_dep_packages(${packageName} packageFullDepsList) - set(orderedPackageFullDepsList "") - - foreach(depPkg IN LISTS packageFullDepsList) - - 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() + tribits_package_sort_full_enabled_dep_packages(packageFullDepsList + orderedPackageFullDepsList) global_set(${packageName}_FULL_ENABLED_DEP_PACKAGES ${orderedPackageFullDepsList}) @@ -217,4 +191,45 @@ function(tribits_package_build_unsorted_full_enabled_dep_packages packageName set(${packageFullDepsListOut} ${packageFullDepsList} PARENT_SCOPE) -endfunction() \ No newline at end of file +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() From dcd61617474df47b6a494d4d1c0e1a91d6230306 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Tue, 22 Nov 2022 09:54:32 -0700 Subject: [PATCH 27/35] WIP: Refactor tribits_package_build_unsorted_full_enabled_dep_packages() to use new deps vars (#63) I also did: * Updated some documentation * Renamed some local vars --- test/core/DependencyUnitTests/CMakeLists.txt | 4 ++ .../TribitsSetUpEnabledOnlyDependencies.cmake | 40 ++++++++++--------- .../ExpectedDependencies.txt | 9 +++++ 3 files changed, 34 insertions(+), 19 deletions(-) diff --git a/test/core/DependencyUnitTests/CMakeLists.txt b/test/core/DependencyUnitTests/CMakeLists.txt index 5007ba409..24faa9f79 100644 --- a/test/core/DependencyUnitTests/CMakeLists.txt +++ b/test/core/DependencyUnitTests/CMakeLists.txt @@ -366,6 +366,7 @@ create_reduced_dependency_handling_test_case( -DTrilinos_ENABLE_ALL_PACKAGES:BOOL=ON -DTrilinos_DUMP_PACKAGE_DEPENDENCIES:BOOL=ON -DTrilinos_DUMP_FORWARD_PACKAGE_DEPENDENCIES:BOOL=ON + -DTrilinos_GENERATE_EXPORT_FILE_DEPENDENCIES:BOOL=ON PASS_REGULAR_EXPRESSION_ALL ${REDUCED_EXPECTED_DEPENDENCIES_REGEX_ARRAY} ${REDUCED_EnableAllPackages_REGEX_ARRAY} @@ -374,6 +375,9 @@ create_reduced_dependency_handling_test_case( "Final set of non-enabled top-level packages: Triutils EpetraExt 2" "Final set of non-enabled packages: Triutils EpetraExt ThyraGoodStuff ThyraCrazyStuff ThyraEpetraExt 5" ) +# NOTE: Above test may be the only test that generates and checks the full +# list of upstream internal package dependencies +# _FULL_ENABLED_DEP_PACKAGES. create_reduced_dependency_handling_test_case( EnableAllPackages_VerboseConfigure diff --git a/tribits/core/package_arch/TribitsSetUpEnabledOnlyDependencies.cmake b/tribits/core/package_arch/TribitsSetUpEnabledOnlyDependencies.cmake index 4f426f02f..9e5900114 100644 --- a/tribits/core/package_arch/TribitsSetUpEnabledOnlyDependencies.cmake +++ b/tribits/core/package_arch/TribitsSetUpEnabledOnlyDependencies.cmake @@ -119,10 +119,10 @@ function(tribits_set_up_enabled_only_dependencies) foreach(tribitsPackage IN LISTS ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES) tribits_package_set_full_enabled_dep_packages(${tribitsPackage}) if (${PROJECT_NAME}_DUMP_PACKAGE_DEPENDENCIES) - set(PRINTED_VAR FALSE) + set(printedVar FALSE) print_nonempty_var_with_spaces(${tribitsPackage}_FULL_ENABLED_DEP_PACKAGES - PRINTED_VAR) - if (NOT PRINTED_VAR) + printedVar) + if (NOT printedVar) message("-- ${tribitsPackage}: No library dependencies!") endif() endif() @@ -136,13 +136,20 @@ function(tribits_set_up_enabled_only_dependencies) endfunction() -# Function that sets up the full package dependencies for the given internal -# enabled package ``${PACKAGE_NAME}``, including all of its indirect upstream -# internal package dependencies. +# Function that sets up the full package dependencies for the given *internal* +# enabled package ``${packageName}``, including all of its indirect upstream +# *internal* package dependencies. # -# NOTE: The complexity of this function is O(^2). That is why it -# would be good to get rid of this function at some point (or refactor it to -# have a better complexity). +# 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) @@ -165,16 +172,11 @@ function(tribits_package_build_unsorted_full_enabled_dep_packages packageName ) set(packageFullDepsList "") - - foreach(depPkg IN LISTS ${packageName}_LIB_REQUIRED_DEP_PACKAGES) - if (${PROJECT_NAME}_ENABLE_${depPkg}) - list(APPEND packageFullDepsList ${depPkg}) - endif() - # NOTE: This if() should not be needed but this is a safeguard - endforeach() - - foreach(depPkg IN LISTS ${packageName}_LIB_OPTIONAL_DEP_PACKAGES) - if (${packageName}_ENABLE_${depPkg}) + 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() diff --git a/tribits/doc/guides/ReducedMockTrilinosOutput/ExpectedDependencies.txt b/tribits/doc/guides/ReducedMockTrilinosOutput/ExpectedDependencies.txt index c1464be2f..31dc0d7ab 100644 --- a/tribits/doc/guides/ReducedMockTrilinosOutput/ExpectedDependencies.txt +++ b/tribits/doc/guides/ReducedMockTrilinosOutput/ExpectedDependencies.txt @@ -138,3 +138,12 @@ Dumping direct enabled dependencies for each package ... -- 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 From a9cd4da2a260b747435067b6aea64aa637934fb5 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Tue, 22 Nov 2022 10:13:11 -0700 Subject: [PATCH 28/35] WIP: Update setting of CPACK_COMPONENT__DEPENDS to use new deps vars (#63) This is not really updated correctly because it include exteranl dependencies as well but this does not break any TriBITS packages and I am not sure who is using component-based installs with TriBITS projects. This can be fixed correctly once I determine that it is needed and we can develop a test for this. --- .../package_arch/TribitsGlobalMacros.cmake | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tribits/core/package_arch/TribitsGlobalMacros.cmake b/tribits/core/package_arch/TribitsGlobalMacros.cmake index 63dba3298..283d81af7 100644 --- a/tribits/core/package_arch/TribitsGlobalMacros.cmake +++ b/tribits/core/package_arch/TribitsGlobalMacros.cmake @@ -2382,16 +2382,16 @@ macro(tribits_setup_packaging_and_distribution) tribits_get_sublist_enabled( ${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES - 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}) + 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 From 31eb57953458012e8a737ff515f6c55f44388ae8 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Tue, 22 Nov 2022 10:17:10 -0700 Subject: [PATCH 29/35] WIP: Remove function tribits_gather_enabled_items() (#63) It seems there is no more need of this function as it is not used anywhere in TriBITS. And this is a trivial function which is really just a single loop. --- .../package_arch/TribitsGeneralMacros.cmake | 34 ------------------- 1 file changed, 34 deletions(-) diff --git a/tribits/core/package_arch/TribitsGeneralMacros.cmake b/tribits/core/package_arch/TribitsGeneralMacros.cmake index 2f0f292d3..0dc079655 100644 --- a/tribits/core/package_arch/TribitsGeneralMacros.cmake +++ b/tribits/core/package_arch/TribitsGeneralMacros.cmake @@ -186,40 +186,6 @@ macro(tribits_set_ss_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 From 432a316772438178e408f0c333a3e3285fab35d2 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Tue, 22 Nov 2022 14:23:27 -0700 Subject: [PATCH 30/35] WIP: Reorder functions in clean code ordering (#63) Otherwise, I just updated a few comments. But the code is unchanged. --- .../TribitsWriteXmlDependenciesFiles.cmake | 191 +++++++++--------- 1 file changed, 95 insertions(+), 96 deletions(-) diff --git a/tribits/ci_support/TribitsWriteXmlDependenciesFiles.cmake b/tribits/ci_support/TribitsWriteXmlDependenciesFiles.cmake index 4050ba3e5..5b10d966b 100644 --- a/tribits/ci_support/TribitsWriteXmlDependenciesFiles.cmake +++ b/tribits/ci_support/TribitsWriteXmlDependenciesFiles.cmake @@ -38,61 +38,80 @@ # @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) - - if (NOT DEPS) - - list(APPEND LOC_XML - " <${LIST_TYPE}/>\n" ) - - else() - - set(VALUE_STR "") +################################################################################ +# 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. +################################################################################ - 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() + #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() + endif() - list(APPEND LOC_XML - " <${LIST_TYPE} value=\"${VALUE_STR}\"/>\n" ) + #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} ) + 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}) + 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 (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) @@ -145,65 +164,45 @@ function(tribits_dump_deps_xml_file) 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 PACKAGE_NAME LIST_TYPE + XML_VAR + ) - tribits_config_code_start_timer(WRITE_DEPENDENCY_FILES_TIME_START_SECONDS) + set(LOC_XML "${${XML_VAR}}") - #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() - endif() + set(DEPS_VAR ${PACKAGE_NAME}_${LIST_TYPE}) + assert_defined(DEPS_VAR) + set(DEPS ${${DEPS_VAR}}) - #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} ) - endif() + #print_var(PACKAGE_NAME) + #print_var(DEPS) + + 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() + + set(VALUE_STR "${VALUE_STR}${DEP}") + + endforeach() + + list(APPEND LOC_XML + " <${LIST_TYPE} value=\"${VALUE_STR}\"/>\n" ) - #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}) - 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") + if (LOC_XML) + set(${XML_VAR} "${LOC_XML}" PARENT_SCOPE) endif() -endmacro() +endfunction() From a7d4c496debfe7cc5faeb98de36b1365165825d9 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Tue, 22 Nov 2022 15:38:13 -0700 Subject: [PATCH 31/35] WIP: Cleanup before more refactorig (#63) * Make fit in < 90 char columns (mostly) * Rename local vars * Make dependency on ctest_driver/dump-cdash-deps-xml-file.py script optional --- .../TribitsWriteXmlDependenciesFiles.cmake | 133 ++++++++---------- 1 file changed, 62 insertions(+), 71 deletions(-) diff --git a/tribits/ci_support/TribitsWriteXmlDependenciesFiles.cmake b/tribits/ci_support/TribitsWriteXmlDependenciesFiles.cmake index 5b10d966b..657cd2a56 100644 --- a/tribits/ci_support/TribitsWriteXmlDependenciesFiles.cmake +++ b/tribits/ci_support/TribitsWriteXmlDependenciesFiles.cmake @@ -58,49 +58,59 @@ macro(tribits_write_xml_dependency_files) tribits_config_code_start_timer(WRITE_DEPENDENCY_FILES_TIME_START_SECONDS) - #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} ..." ) + message("Dumping the XML dependencies file" + " ${${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE} ..." ) tribits_dump_deps_xml_file() 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} ..." ) + 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} - ${${PROJECT_NAME}_TRIBITS_DIR}/${TRIBITS_CI_SUPPORT_DIR}/dump-package-dep-table.py + ${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() - #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}) + 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} ..." ) - 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} ) + 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 (${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE - OR ${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE - OR ${PROJECT_NAME}_CDASH_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") @@ -114,95 +124,76 @@ endmacro() # 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_DEP_PACKAGES depsXml) + tribits_write_deps_to_xml_string(${tribitsPackage} LIB_OPTIONAL_DEP_PACKAGES depsXml) + tribits_write_deps_to_xml_string(${tribitsPackage} TEST_REQUIRED_DEP_PACKAGES depsXml) + tribits_write_deps_to_xml_string(${tribitsPackage} TEST_OPTIONAL_DEP_PACKAGES depsXml) + tribits_write_deps_to_xml_string(${tribitsPackage} LIB_REQUIRED_DEP_TPLS depsXml) + tribits_write_deps_to_xml_string(${tribitsPackage} LIB_OPTIONAL_DEP_TPLS depsXml) + tribits_write_deps_to_xml_string(${tribitsPackage} TEST_REQUIRED_DEP_TPLS depsXml) + tribits_write_deps_to_xml_string(${tribitsPackage} TEST_OPTIONAL_DEP_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() -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) +function(tribits_write_deps_to_xml_string packageName listType xmlVarInOut) - if (NOT DEPS) + set(localXml "${${xmlVarInOut}}") - list(APPEND LOC_XML - " <${LIST_TYPE}/>\n" ) + set(packageDepsVar ${packageName}_${listType}) + set(packageDeps ${${packageDepsVar}}) + if (NOT packageDeps) + list(APPEND localXml + " <${listType}/>\n" ) else() - - set(VALUE_STR "") - - foreach(DEP ${DEPS}) - - if(VALUE_STR) - set(VALUE_STR "${VALUE_STR},") + set(depsListStr "") + foreach(depPkg IN LISTS packageDeps) + if(depsListStr) + string(APPEND depsListStr ",") endif() - - set(VALUE_STR "${VALUE_STR}${DEP}") - + string(APPEND depsListStr "${depPkg}") endforeach() - - list(APPEND LOC_XML - " <${LIST_TYPE} value=\"${VALUE_STR}\"/>\n" ) - + list(APPEND localXml + " <${listType} value=\"${depsListStr}\"/>\n" ) endif() - if (LOC_XML) - set(${XML_VAR} "${LOC_XML}" PARENT_SCOPE) + if (localXml) + set(${xmlVarInOut} "${localXml}" PARENT_SCOPE) endif() endfunction() From 6255e059fb4bbfe3451c328d6b0ed209254546c9 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Wed, 23 Nov 2022 08:31:27 -0700 Subject: [PATCH 32/35] WIP: Refactor tribits_dump_deps_xml_file() to use new deps files * Factored out function tribits_get_legacy_package_deps_sublist() * Factored out function tribits_append_dep_to_xml_string() --- .../TribitsWriteXmlDependenciesFiles.cmake | 87 +++++++++++++++---- 1 file changed, 70 insertions(+), 17 deletions(-) diff --git a/tribits/ci_support/TribitsWriteXmlDependenciesFiles.cmake b/tribits/ci_support/TribitsWriteXmlDependenciesFiles.cmake index 657cd2a56..b59f047ac 100644 --- a/tribits/ci_support/TribitsWriteXmlDependenciesFiles.cmake +++ b/tribits/ci_support/TribitsWriteXmlDependenciesFiles.cmake @@ -137,14 +137,14 @@ function(tribits_dump_deps_xml_file) list(APPEND depsXml " \n") - tribits_write_deps_to_xml_string(${tribitsPackage} LIB_REQUIRED_DEP_PACKAGES depsXml) - tribits_write_deps_to_xml_string(${tribitsPackage} LIB_OPTIONAL_DEP_PACKAGES depsXml) - tribits_write_deps_to_xml_string(${tribitsPackage} TEST_REQUIRED_DEP_PACKAGES depsXml) - tribits_write_deps_to_xml_string(${tribitsPackage} TEST_OPTIONAL_DEP_PACKAGES depsXml) - tribits_write_deps_to_xml_string(${tribitsPackage} LIB_REQUIRED_DEP_TPLS depsXml) - tribits_write_deps_to_xml_string(${tribitsPackage} LIB_OPTIONAL_DEP_TPLS depsXml) - tribits_write_deps_to_xml_string(${tribitsPackage} TEST_REQUIRED_DEP_TPLS depsXml) - tribits_write_deps_to_xml_string(${tribitsPackage} TEST_OPTIONAL_DEP_TPLS depsXml) + 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) list(APPEND depsXml " \n" @@ -170,23 +170,26 @@ function(tribits_dump_deps_xml_file) endfunction() -function(tribits_write_deps_to_xml_string packageName listType xmlVarInOut) +function(tribits_write_deps_to_xml_string packageName libOrTest requiredOrOptional + packagesOrTpls xmlVarInOut + ) set(localXml "${${xmlVarInOut}}") - set(packageDepsVar ${packageName}_${listType}) - set(packageDeps ${${packageDepsVar}}) + set(listType ${libOrTest}_${requiredOrOptional}_DEP_${packagesOrTpls}) + message("") + print_var(listType) - if (NOT packageDeps) + 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 packageDeps) - if(depsListStr) - string(APPEND depsListStr ",") - endif() - string(APPEND depsListStr "${depPkg}") + foreach(depPkg IN LISTS legacyPackageDepsList) + tribits_append_dep_to_xml_string(${depPkg} depsListStr) endforeach() list(APPEND localXml " <${listType} value=\"${depsListStr}\"/>\n" ) @@ -197,3 +200,53 @@ function(tribits_write_deps_to_xml_string packageName listType xmlVarInOut) endif() 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() + + 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() + + 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() From 8473b6fdf04f73cd3baf84d1e268e395b195b3d2 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Wed, 23 Nov 2022 09:35:57 -0700 Subject: [PATCH 33/35] WIP: Remove legacy package deps lists (#63) * Removed code * Removed tests * Removed documentation NOTE: These separate list vars are maintained in several places to maintain backward compatibility but none of the key internal logic uses these. NOTE: To find this I ran a recursive grep using the regex: (LIB|TEST|[$][{][a-zA-Z_]+[}])_(OPTIONAL|REQUIRED|[$][{][a-zA-Z_]+[}])_DEP_(PACKAGES|TPLS|[$][{][a-zA-Z_]+[}]) --- ...sts_EnableAllPackages_DumpDependencies.txt | 140 ------------------ .../TribitsExampleProject_Tests.cmake | 21 --- .../TribitsPrintDependencyInfo.cmake | 23 --- ...adAllProjectDepsFilesCreateDepsGraph.cmake | 1 - .../TribitsReadDepsFilesCreateDepsGraph.cmake | 107 ++----------- ...itsSystemDataStructuresMacrosFunctions.rst | 100 +------------ .../build_ref/TribitsBuildReferenceBody.rst | 16 +- .../ExpectedDependencies.txt | 39 ----- 8 files changed, 21 insertions(+), 426 deletions(-) diff --git a/test/core/DependencyUnitTests/DepTests_EnableAllPackages_DumpDependencies.txt b/test/core/DependencyUnitTests/DepTests_EnableAllPackages_DumpDependencies.txt index bcf3ebfbb..a98ec6847 100644 --- a/test/core/DependencyUnitTests/DepTests_EnableAllPackages_DumpDependencies.txt +++ b/test/core/DependencyUnitTests/DepTests_EnableAllPackages_DumpDependencies.txt @@ -60,250 +60,110 @@ Package dependencies information: -- DUMMY_FORWARD_LIB_DEFINED_DEPENDENCIES: RBGen[R] --- TrilinosFramework_TEST_OPTIONAL_DEP_TPLS: MPI - -- TrilinosFramework_TEST_DEFINED_DEPENDENCIES: MPI[O] --- Teuchos_FORWARD_LIB_REQUIRED_DEP_PACKAGES: RTOp Tpetra EpetraExt Stokhos ThyraCoreLibs Isorropia Galeri Amesos Intrepid Ifpack Belos RBGen Phalanx Panzer --- Teuchos_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: Sacado AztecOO ML --- Teuchos_FORWARD_TEST_OPTIONAL_DEP_PACKAGES: Shards --- Teuchos_LIB_REQUIRED_DEP_TPLS: BLAS LAPACK --- Teuchos_LIB_OPTIONAL_DEP_TPLS: Boost MPI - -- Teuchos_LIB_DEFINED_DEPENDENCIES: BLAS[R] LAPACK[R] Boost[O] MPI[O] -- Teuchos_FORWARD_LIB_DEFINED_DEPENDENCIES: RTOp[R] Tpetra[R] EpetraExt[R] Stokhos[R] Sacado[O] ThyraCoreLibs[R] Isorropia[R] AztecOO[O] Galeri[R] Amesos[R] Intrepid[R] Ifpack[R] ML[O] Belos[R] RBGen[R] Phalanx[R] Panzer[R] -- Teuchos_FORWARD_TEST_DEFINED_DEPENDENCIES: Shards[O] --- RTOp_LIB_REQUIRED_DEP_PACKAGES: Teuchos --- RTOp_FORWARD_LIB_REQUIRED_DEP_PACKAGES: ThyraCoreLibs - -- RTOp_LIB_DEFINED_DEPENDENCIES: Teuchos[R] -- RTOp_FORWARD_LIB_DEFINED_DEPENDENCIES: ThyraCoreLibs[R] --- Epetra_FORWARD_LIB_REQUIRED_DEP_PACKAGES: Triutils EpetraExt ThyraEpetra Isorropia AztecOO Galeri Amesos Ifpack Belos Panzer --- Epetra_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: Sacado ML RBGen --- Epetra_FORWARD_TEST_OPTIONAL_DEP_PACKAGES: Intrepid Phalanx --- Epetra_LIB_REQUIRED_DEP_TPLS: BLAS LAPACK --- Epetra_LIB_OPTIONAL_DEP_TPLS: MPI - -- Epetra_LIB_DEFINED_DEPENDENCIES: BLAS[R] LAPACK[R] MPI[O] -- Epetra_FORWARD_LIB_DEFINED_DEPENDENCIES: Triutils[R] EpetraExt[R] Sacado[O] ThyraEpetra[R] Isorropia[R] AztecOO[R] Galeri[R] Amesos[R] Ifpack[R] ML[O] Belos[R] RBGen[O] Panzer[R] -- Epetra_FORWARD_TEST_DEFINED_DEPENDENCIES: Intrepid[O] Phalanx[O] --- Zoltan_FORWARD_LIB_REQUIRED_DEP_PACKAGES: Isorropia --- Zoltan_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: EpetraExt ML --- Zoltan_LIB_OPTIONAL_DEP_TPLS: MPI ParMETIS Scotch - -- Zoltan_LIB_DEFINED_DEPENDENCIES: MPI[O] ParMETIS[O] Scotch[O] -- Zoltan_FORWARD_LIB_DEFINED_DEPENDENCIES: EpetraExt[O] Isorropia[R] ML[O] --- Shards_TEST_OPTIONAL_DEP_PACKAGES: Teuchos --- Shards_FORWARD_LIB_REQUIRED_DEP_PACKAGES: Intrepid Phalanx - -- Shards_TEST_DEFINED_DEPENDENCIES: Teuchos[O] -- Shards_FORWARD_LIB_DEFINED_DEPENDENCIES: Intrepid[R] Phalanx[R] --- Triutils_LIB_REQUIRED_DEP_PACKAGES: Epetra --- Triutils_FORWARD_LIB_REQUIRED_DEP_PACKAGES: AztecOO --- Triutils_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: EpetraExt --- Triutils_FORWARD_TEST_OPTIONAL_DEP_PACKAGES: Tpetra Amesos Belos Stratimikos - -- Triutils_LIB_DEFINED_DEPENDENCIES: Epetra[R] -- Triutils_FORWARD_LIB_DEFINED_DEPENDENCIES: EpetraExt[O] AztecOO[R] -- Triutils_FORWARD_TEST_DEFINED_DEPENDENCIES: Tpetra[O] Amesos[O] Belos[O] Stratimikos[O] --- Tpetra_LIB_REQUIRED_DEP_PACKAGES: Teuchos --- Tpetra_TEST_OPTIONAL_DEP_PACKAGES: Triutils --- Tpetra_FORWARD_LIB_REQUIRED_DEP_PACKAGES: ThyraTpetra Panzer --- Tpetra_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: Belos - -- Tpetra_LIB_DEFINED_DEPENDENCIES: Teuchos[R] -- Tpetra_TEST_DEFINED_DEPENDENCIES: Triutils[O] -- Tpetra_FORWARD_LIB_DEFINED_DEPENDENCIES: ThyraTpetra[R] Belos[O] Panzer[R] --- EpetraExt_LIB_REQUIRED_DEP_PACKAGES: Teuchos Epetra --- EpetraExt_LIB_OPTIONAL_DEP_PACKAGES: Triutils Zoltan --- EpetraExt_FORWARD_LIB_REQUIRED_DEP_PACKAGES: ThyraEpetraExt Panzer --- EpetraExt_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: Sacado Isorropia Galeri Amesos ML RBGen --- EpetraExt_FORWARD_TEST_OPTIONAL_DEP_PACKAGES: Intrepid Belos --- EpetraExt_LIB_OPTIONAL_DEP_TPLS: UMFPACK AMD PETSC - -- EpetraExt_LIB_DEFINED_DEPENDENCIES: Teuchos[R] Epetra[R] Triutils[O] Zoltan[O] UMFPACK[O] AMD[O] PETSC[O] -- EpetraExt_FORWARD_LIB_DEFINED_DEPENDENCIES: Sacado[O] ThyraEpetraExt[R] Isorropia[O] Galeri[O] Amesos[O] ML[O] RBGen[O] Panzer[R] -- EpetraExt_FORWARD_TEST_DEFINED_DEPENDENCIES: Intrepid[O] Belos[O] --- Stokhos_LIB_REQUIRED_DEP_PACKAGES: Teuchos --- Stokhos_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: Sacado Panzer - -- Stokhos_LIB_DEFINED_DEPENDENCIES: Teuchos[R] -- Stokhos_FORWARD_LIB_DEFINED_DEPENDENCIES: Sacado[O] Panzer[O] --- Sacado_LIB_OPTIONAL_DEP_PACKAGES: Teuchos Stokhos Epetra EpetraExt --- Sacado_FORWARD_LIB_REQUIRED_DEP_PACKAGES: Phalanx Panzer --- Sacado_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: Intrepid --- Sacado_TEST_OPTIONAL_DEP_TPLS: ADOLC CppUnit - -- Sacado_LIB_DEFINED_DEPENDENCIES: Teuchos[O] Stokhos[O] Epetra[O] EpetraExt[O] -- Sacado_TEST_DEFINED_DEPENDENCIES: ADOLC[O] CppUnit[O] -- Sacado_FORWARD_LIB_DEFINED_DEPENDENCIES: Intrepid[O] Phalanx[R] Panzer[R] --- ThyraCoreLibs_LIB_REQUIRED_DEP_PACKAGES: Teuchos RTOp --- ThyraCoreLibs_FORWARD_LIB_REQUIRED_DEP_PACKAGES: ThyraGoodStuff ThyraEpetra ThyraTpetra Thyra Stratimikos - -- ThyraCoreLibs_LIB_DEFINED_DEPENDENCIES: Teuchos[R] RTOp[R] -- ThyraCoreLibs_FORWARD_LIB_DEFINED_DEPENDENCIES: ThyraGoodStuff[R] ThyraEpetra[R] ThyraTpetra[R] Thyra[R] Stratimikos[R] --- ThyraGoodStuff_LIB_REQUIRED_DEP_PACKAGES: ThyraCoreLibs --- ThyraGoodStuff_FORWARD_LIB_REQUIRED_DEP_PACKAGES: ThyraCrazyStuff --- ThyraGoodStuff_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: Thyra - -- ThyraGoodStuff_LIB_DEFINED_DEPENDENCIES: ThyraCoreLibs[R] -- ThyraGoodStuff_FORWARD_LIB_DEFINED_DEPENDENCIES: ThyraCrazyStuff[R] Thyra[O] --- ThyraCrazyStuff_LIB_REQUIRED_DEP_PACKAGES: ThyraGoodStuff --- ThyraCrazyStuff_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: Thyra - -- ThyraCrazyStuff_LIB_DEFINED_DEPENDENCIES: ThyraGoodStuff[R] -- ThyraCrazyStuff_FORWARD_LIB_DEFINED_DEPENDENCIES: Thyra[O] --- ThyraEpetra_LIB_REQUIRED_DEP_PACKAGES: Epetra ThyraCoreLibs --- ThyraEpetra_FORWARD_LIB_REQUIRED_DEP_PACKAGES: ThyraEpetraExt --- ThyraEpetra_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: Thyra - -- ThyraEpetra_LIB_DEFINED_DEPENDENCIES: Epetra[R] ThyraCoreLibs[R] -- ThyraEpetra_FORWARD_LIB_DEFINED_DEPENDENCIES: ThyraEpetraExt[R] Thyra[O] --- ThyraEpetraExt_LIB_REQUIRED_DEP_PACKAGES: ThyraEpetra EpetraExt --- ThyraEpetraExt_FORWARD_LIB_REQUIRED_DEP_PACKAGES: Stratimikos --- ThyraEpetraExt_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: Thyra - -- ThyraEpetraExt_LIB_DEFINED_DEPENDENCIES: ThyraEpetra[R] EpetraExt[R] -- ThyraEpetraExt_FORWARD_LIB_DEFINED_DEPENDENCIES: Thyra[O] Stratimikos[R] --- ThyraTpetra_LIB_REQUIRED_DEP_PACKAGES: Tpetra ThyraCoreLibs --- ThyraTpetra_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: Thyra - -- ThyraTpetra_LIB_DEFINED_DEPENDENCIES: Tpetra[R] ThyraCoreLibs[R] -- ThyraTpetra_FORWARD_LIB_DEFINED_DEPENDENCIES: Thyra[O] --- Thyra_LIB_REQUIRED_DEP_PACKAGES: ThyraCoreLibs --- Thyra_LIB_OPTIONAL_DEP_PACKAGES: ThyraGoodStuff ThyraCrazyStuff ThyraEpetra ThyraEpetraExt ThyraTpetra --- Thyra_FORWARD_LIB_REQUIRED_DEP_PACKAGES: Panzer - -- Thyra_LIB_DEFINED_DEPENDENCIES: ThyraCoreLibs[R] ThyraGoodStuff[O] ThyraCrazyStuff[O] ThyraEpetra[O] ThyraEpetraExt[O] ThyraTpetra[O] -- Thyra_FORWARD_LIB_DEFINED_DEPENDENCIES: Panzer[R] --- Isorropia_LIB_REQUIRED_DEP_PACKAGES: Teuchos Epetra Zoltan --- Isorropia_LIB_OPTIONAL_DEP_PACKAGES: EpetraExt --- Isorropia_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: ML - -- Isorropia_LIB_DEFINED_DEPENDENCIES: Teuchos[R] Epetra[R] Zoltan[R] EpetraExt[O] -- Isorropia_FORWARD_LIB_DEFINED_DEPENDENCIES: ML[O] --- AztecOO_LIB_REQUIRED_DEP_PACKAGES: Epetra Triutils --- AztecOO_LIB_OPTIONAL_DEP_PACKAGES: Teuchos --- AztecOO_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: Ifpack ML Stratimikos --- AztecOO_LIB_OPTIONAL_DEP_TPLS: y12m - -- AztecOO_LIB_DEFINED_DEPENDENCIES: Epetra[R] Triutils[R] Teuchos[O] y12m[O] -- AztecOO_FORWARD_LIB_DEFINED_DEPENDENCIES: Ifpack[O] ML[O] Stratimikos[O] --- Galeri_LIB_REQUIRED_DEP_PACKAGES: Teuchos Epetra --- Galeri_LIB_OPTIONAL_DEP_PACKAGES: EpetraExt --- Galeri_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: ML --- Galeri_FORWARD_TEST_OPTIONAL_DEP_PACKAGES: Amesos Ifpack - -- Galeri_LIB_DEFINED_DEPENDENCIES: Teuchos[R] Epetra[R] EpetraExt[O] -- Galeri_FORWARD_LIB_DEFINED_DEPENDENCIES: ML[O] -- Galeri_FORWARD_TEST_DEFINED_DEPENDENCIES: Amesos[O] Ifpack[O] --- Amesos_LIB_REQUIRED_DEP_PACKAGES: Teuchos Epetra --- Amesos_LIB_OPTIONAL_DEP_PACKAGES: EpetraExt --- Amesos_TEST_OPTIONAL_DEP_PACKAGES: Triutils Galeri --- Amesos_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: Ifpack ML Stratimikos --- Amesos_FORWARD_TEST_OPTIONAL_DEP_PACKAGES: Intrepid --- Amesos_LIB_OPTIONAL_DEP_TPLS: SuperLUDist ParMETIS UMFPACK SuperLU MUMPS - -- Amesos_LIB_DEFINED_DEPENDENCIES: Teuchos[R] Epetra[R] EpetraExt[O] SuperLUDist[O] ParMETIS[O] UMFPACK[O] SuperLU[O] MUMPS[O] -- Amesos_TEST_DEFINED_DEPENDENCIES: Triutils[O] Galeri[O] -- Amesos_FORWARD_LIB_DEFINED_DEPENDENCIES: Ifpack[O] ML[O] Stratimikos[O] -- Amesos_FORWARD_TEST_DEFINED_DEPENDENCIES: Intrepid[O] --- Intrepid_LIB_REQUIRED_DEP_PACKAGES: Teuchos Shards --- Intrepid_LIB_OPTIONAL_DEP_PACKAGES: Sacado --- Intrepid_TEST_OPTIONAL_DEP_PACKAGES: Epetra EpetraExt Amesos --- Intrepid_FORWARD_LIB_REQUIRED_DEP_PACKAGES: Panzer --- Intrepid_FORWARD_TEST_OPTIONAL_DEP_PACKAGES: Phalanx - -- Intrepid_LIB_DEFINED_DEPENDENCIES: Teuchos[R] Shards[R] Sacado[O] -- Intrepid_TEST_DEFINED_DEPENDENCIES: Epetra[O] EpetraExt[O] Amesos[O] -- Intrepid_FORWARD_LIB_DEFINED_DEPENDENCIES: Panzer[R] -- Intrepid_FORWARD_TEST_DEFINED_DEPENDENCIES: Phalanx[O] --- Ifpack_LIB_REQUIRED_DEP_PACKAGES: Teuchos Epetra --- Ifpack_LIB_OPTIONAL_DEP_PACKAGES: Amesos AztecOO --- Ifpack_TEST_OPTIONAL_DEP_PACKAGES: Galeri --- Ifpack_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: ML Stratimikos --- Ifpack_FORWARD_TEST_OPTIONAL_DEP_PACKAGES: Belos Phalanx - -- Ifpack_LIB_DEFINED_DEPENDENCIES: Teuchos[R] Epetra[R] Amesos[O] AztecOO[O] -- Ifpack_TEST_DEFINED_DEPENDENCIES: Galeri[O] -- Ifpack_FORWARD_LIB_DEFINED_DEPENDENCIES: ML[O] Stratimikos[O] -- Ifpack_FORWARD_TEST_DEFINED_DEPENDENCIES: Belos[O] Phalanx[O] --- ML_LIB_OPTIONAL_DEP_PACKAGES: Teuchos Epetra Zoltan Galeri Amesos Ifpack AztecOO EpetraExt Isorropia --- ML_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: Stratimikos --- ML_FORWARD_TEST_OPTIONAL_DEP_PACKAGES: Belos --- ML_LIB_REQUIRED_DEP_TPLS: BLAS LAPACK --- ML_LIB_OPTIONAL_DEP_TPLS: MPI METIS ParMETIS PETSC --- ML_TEST_OPTIONAL_DEP_TPLS: METIS ParMETIS - -- ML_LIB_DEFINED_DEPENDENCIES: Teuchos[O] Epetra[O] Zoltan[O] Galeri[O] Amesos[O] Ifpack[O] AztecOO[O] EpetraExt[O] Isorropia[O] BLAS[R] LAPACK[R] MPI[O] METIS[O] ParMETIS[O] PETSC[O] -- ML_TEST_DEFINED_DEPENDENCIES: METIS[O] ParMETIS[O] -- ML_FORWARD_LIB_DEFINED_DEPENDENCIES: Stratimikos[O] -- ML_FORWARD_TEST_DEFINED_DEPENDENCIES: Belos[O] --- Belos_LIB_REQUIRED_DEP_PACKAGES: Teuchos Epetra --- Belos_LIB_OPTIONAL_DEP_PACKAGES: Tpetra --- Belos_TEST_OPTIONAL_DEP_PACKAGES: Triutils EpetraExt Ifpack ML --- Belos_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: Stratimikos --- Belos_FORWARD_TEST_OPTIONAL_DEP_PACKAGES: Phalanx - -- Belos_LIB_DEFINED_DEPENDENCIES: Teuchos[R] Epetra[R] Tpetra[O] -- Belos_TEST_DEFINED_DEPENDENCIES: Triutils[O] EpetraExt[O] Ifpack[O] ML[O] -- Belos_FORWARD_LIB_DEFINED_DEPENDENCIES: Stratimikos[O] -- Belos_FORWARD_TEST_DEFINED_DEPENDENCIES: Phalanx[O] --- Stratimikos_LIB_REQUIRED_DEP_PACKAGES: ThyraEpetraExt ThyraCoreLibs --- Stratimikos_LIB_OPTIONAL_DEP_PACKAGES: Amesos AztecOO Belos Ifpack ML --- Stratimikos_TEST_OPTIONAL_DEP_PACKAGES: Triutils --- Stratimikos_FORWARD_TEST_OPTIONAL_DEP_PACKAGES: Panzer - -- Stratimikos_LIB_DEFINED_DEPENDENCIES: ThyraEpetraExt[R] ThyraCoreLibs[R] Amesos[O] AztecOO[O] Belos[O] Ifpack[O] ML[O] -- Stratimikos_TEST_DEFINED_DEPENDENCIES: Triutils[O] -- Stratimikos_FORWARD_TEST_DEFINED_DEPENDENCIES: Panzer[O] --- RBGen_LIB_REQUIRED_DEP_PACKAGES: Teuchos --- RBGen_LIB_OPTIONAL_DEP_PACKAGES: Epetra EpetraExt --- RBGen_LIB_REQUIRED_DEP_TPLS: DUMMY - -- RBGen_LIB_DEFINED_DEPENDENCIES: Teuchos[R] Epetra[O] EpetraExt[O] DUMMY[R] --- Phalanx_LIB_REQUIRED_DEP_PACKAGES: Teuchos Shards Sacado --- Phalanx_TEST_OPTIONAL_DEP_PACKAGES: Belos Epetra Ifpack Intrepid --- Phalanx_FORWARD_LIB_REQUIRED_DEP_PACKAGES: Panzer --- Phalanx_LIB_REQUIRED_DEP_TPLS: Boost --- Phalanx_TEST_OPTIONAL_DEP_TPLS: TVMET - -- Phalanx_LIB_DEFINED_DEPENDENCIES: Teuchos[R] Shards[R] Sacado[R] Boost[R] -- Phalanx_TEST_DEFINED_DEPENDENCIES: Belos[O] Epetra[O] Ifpack[O] Intrepid[O] TVMET[O] -- Phalanx_FORWARD_LIB_DEFINED_DEPENDENCIES: Panzer[R] --- Panzer_LIB_REQUIRED_DEP_PACKAGES: Teuchos Sacado Phalanx Intrepid Thyra Tpetra Epetra EpetraExt --- Panzer_LIB_OPTIONAL_DEP_PACKAGES: Stokhos --- Panzer_TEST_OPTIONAL_DEP_PACKAGES: Stratimikos --- Panzer_LIB_REQUIRED_DEP_TPLS: MPI Boost - -- Panzer_LIB_DEFINED_DEPENDENCIES: Teuchos[R] Sacado[R] Phalanx[R] Intrepid[R] Thyra[R] Tpetra[R] Epetra[R] EpetraExt[R] Stokhos[O] MPI[R] Boost[R] -- Panzer_TEST_DEFINED_DEPENDENCIES: Stratimikos[O] diff --git a/test/core/ExamplesUnitTests/TribitsExampleProject_Tests.cmake b/test/core/ExamplesUnitTests/TribitsExampleProject_Tests.cmake index 8ffad1fb1..4ffd1da1c 100644 --- a/test/core/ExamplesUnitTests/TribitsExampleProject_Tests.cmake +++ b/test/core/ExamplesUnitTests/TribitsExampleProject_Tests.cmake @@ -150,37 +150,16 @@ function(TribitsExampleProject_ALL_ST_NoFortran sharedOrStatic serialOrMpi) "-- TribitsExProj_DEFINED_INTERNAL_TOPLEVEL_PACKAGES: SimpleCxx MixedLang WithSubpackages WrapExternal" "-- TribitsExProj_DEFINED_INTERNAL_PACKAGES: SimpleCxx MixedLang WithSubpackagesA WithSubpackagesB WithSubpackagesC WithSubpackages WrapExternal" - "-- SimpleCxx_FORWARD_LIB_REQUIRED_DEP_PACKAGES: WithSubpackagesA WithSubpackagesB" - "-- SimpleCxx_LIB_REQUIRED_DEP_TPLS: HeaderOnlyTpl" - "-- SimpleCxx_LIB_OPTIONAL_DEP_TPLS: SimpleTpl MPI" "-- SimpleCxx_LIB_DEFINED_DEPENDENCIES: HeaderOnlyTpl.R. SimpleTpl.O. MPI.O." "-- SimpleCxx_FORWARD_LIB_DEFINED_DEPENDENCIES: WithSubpackagesA.R. WithSubpackagesB.R." - "-- MixedLang_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: WrapExternal" - "-- MixedLang_FORWARD_TEST_OPTIONAL_DEP_PACKAGES: WithSubpackagesB" "-- MixedLang_FORWARD_LIB_DEFINED_DEPENDENCIES: WrapExternal.O." "-- MixedLang_FORWARD_TEST_DEFINED_DEPENDENCIES: WithSubpackagesB.O." - "-- WithSubpackagesA_LIB_REQUIRED_DEP_PACKAGES: SimpleCxx" - "-- WithSubpackagesA_FORWARD_LIB_REQUIRED_DEP_PACKAGES: WithSubpackagesC WithSubpackages WrapExternal" - "-- WithSubpackagesA_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: WithSubpackagesB" "-- WithSubpackagesA_LIB_DEFINED_DEPENDENCIES: SimpleCxx.R." "-- WithSubpackagesA_FORWARD_LIB_DEFINED_DEPENDENCIES: WithSubpackagesB.O. WithSubpackagesC.R. WithSubpackages.R. WrapExternal.R." - "-- WithSubpackagesB_LIB_REQUIRED_DEP_PACKAGES: SimpleCxx" - "-- WithSubpackagesB_LIB_OPTIONAL_DEP_PACKAGES: WithSubpackagesA" - "-- WithSubpackagesB_TEST_OPTIONAL_DEP_PACKAGES: MixedLang" - "-- WithSubpackagesB_FORWARD_LIB_REQUIRED_DEP_PACKAGES: WithSubpackagesC" - "-- WithSubpackagesB_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: WithSubpackages" "-- WithSubpackagesB_LIB_DEFINED_DEPENDENCIES: SimpleCxx.R. WithSubpackagesA.O." "-- WithSubpackagesB_TEST_DEFINED_DEPENDENCIES: MixedLang.O." "-- WithSubpackagesB_FORWARD_LIB_DEFINED_DEPENDENCIES: WithSubpackagesC.R. WithSubpackages.O." - "-- WithSubpackagesC_LIB_REQUIRED_DEP_PACKAGES: WithSubpackagesA WithSubpackagesB" - "-- WithSubpackagesC_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: WithSubpackages" - "-- WithSubpackagesC_LIB_DEFINED_DEPENDENCIES: WithSubpackagesA.R. WithSubpackagesB.R." - "-- WithSubpackagesC_FORWARD_LIB_DEFINED_DEPENDENCIES: WithSubpackages.O." - "-- WithSubpackages_LIB_REQUIRED_DEP_PACKAGES: WithSubpackagesA" - "-- WithSubpackages_LIB_OPTIONAL_DEP_PACKAGES: WithSubpackagesB WithSubpackagesC" "-- WithSubpackages_LIB_DEFINED_DEPENDENCIES: WithSubpackagesA.R. WithSubpackagesB.O. WithSubpackagesC.O." - "-- WrapExternal_LIB_REQUIRED_DEP_PACKAGES: WithSubpackagesA" - "-- WrapExternal_LIB_OPTIONAL_DEP_PACKAGES: MixedLang" "-- WrapExternal_LIB_DEFINED_DEPENDENCIES: WithSubpackagesA.R. MixedLang.O." "Setting up export dependencies for all enabled packages ..." diff --git a/tribits/core/package_arch/TribitsPrintDependencyInfo.cmake b/tribits/core/package_arch/TribitsPrintDependencyInfo.cmake index cbbb8095a..2b96e2f74 100644 --- a/tribits/core/package_arch/TribitsPrintDependencyInfo.cmake +++ b/tribits/core/package_arch/TribitsPrintDependencyInfo.cmake @@ -141,29 +141,6 @@ function(tribits_print_package_dependencies packageName) set(printedVar "") - # Print legacy deps vars #63 - - print_nonempty_var_with_spaces(${packageName}_LIB_REQUIRED_DEP_PACKAGES printedVar) - print_nonempty_var_with_spaces(${packageName}_LIB_OPTIONAL_DEP_PACKAGES printedVar) - print_nonempty_var_with_spaces(${packageName}_TEST_REQUIRED_DEP_PACKAGES printedVar) - print_nonempty_var_with_spaces(${packageName}_TEST_OPTIONAL_DEP_PACKAGES printedVar) - - if (${PROJECT_NAME}_DUMP_FORWARD_PACKAGE_DEPENDENCIES) - print_nonempty_var_with_spaces(${packageName}_FORWARD_LIB_REQUIRED_DEP_PACKAGES - printedVar) - print_nonempty_var_with_spaces(${packageName}_FORWARD_LIB_OPTIONAL_DEP_PACKAGES - printedVar) - print_nonempty_var_with_spaces(${packageName}_FORWARD_TEST_REQUIRED_DEP_PACKAGES - printedVar) - print_nonempty_var_with_spaces(${packageName}_FORWARD_TEST_OPTIONAL_DEP_PACKAGES - printedVar) - endif() - - print_nonempty_var_with_spaces(${packageName}_LIB_REQUIRED_DEP_TPLS printedVar) - print_nonempty_var_with_spaces(${packageName}_LIB_OPTIONAL_DEP_TPLS printedVar) - print_nonempty_var_with_spaces(${packageName}_TEST_REQUIRED_DEP_TPLS printedVar) - print_nonempty_var_with_spaces(${packageName}_TEST_OPTIONAL_DEP_TPLS printedVar) - # Print deps vars if (printedVar) diff --git a/tribits/core/package_arch/TribitsReadAllProjectDepsFilesCreateDepsGraph.cmake b/tribits/core/package_arch/TribitsReadAllProjectDepsFilesCreateDepsGraph.cmake index 85a18092d..2b71d8288 100644 --- a/tribits/core/package_arch/TribitsReadAllProjectDepsFilesCreateDepsGraph.cmake +++ b/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`_ diff --git a/tribits/core/package_arch/TribitsReadDepsFilesCreateDepsGraph.cmake b/tribits/core/package_arch/TribitsReadDepsFilesCreateDepsGraph.cmake index ff3ac24f2..cb3a7c547 100644 --- a/tribits/core/package_arch/TribitsReadDepsFilesCreateDepsGraph.cmake +++ b/tribits/core/package_arch/TribitsReadDepsFilesCreateDepsGraph.cmake @@ -65,10 +65,10 @@ 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`_. # @@ -171,10 +171,10 @@ 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`_. # @@ -244,21 +244,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: # @@ -353,15 +340,6 @@ endmacro() # # See `Function call tree for constructing package dependency graph`_. # -# **__Legacy variables #63:__** -# -# It also sets to empty the forward dependency list vars:: -# -# _FORWARD_ -# -# for each of the forward/downstream in `Legacy list variables defining the -# package dependencies graph`_. -# macro(tribits_prep_to_read_dependencies PACKAGE_NAME_IN) # Initial vars that must be set in the Dependencies.cmake file @@ -381,12 +359,6 @@ macro(tribits_prep_to_read_dependencies PACKAGE_NAME_IN) set(${PACKAGE_NAME_IN}_FORWARD_LIB_DEFINED_DEPENDENCIES "") set(${PACKAGE_NAME_IN}_FORWARD_TEST_DEFINED_DEPENDENCIES "") - # Initialize 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 "") - endmacro() @@ -482,10 +454,6 @@ endmacro() # in `tribits_prep_to_read_dependencies()`_.) # # See `Function call tree for constructing package dependency graph`_. -# -# **__Legacy varibles #63__** -# -# Sets `Legacy list variables defining the package dependencies graph`_. # macro(tribits_process_package_dependencies_lists packageName) @@ -503,16 +471,10 @@ macro(tribits_process_package_dependencies_lists packageName) tribits_set_dep_packages(${packageName} TEST REQUIRED TPLS) tribits_set_dep_packages(${packageName} TEST OPTIONAL TPLS) - # Fill legacy forward deps lists #63 + # Fill forward deps lists #63 tribits_append_forward_dep_packages(${packageName} LIB) tribits_append_forward_dep_packages(${packageName} TEST) - # Fill legacy forward deps lists #63 - tribits_append_legacy_forward_dep_packages(${packageName} LIB REQUIRED) - tribits_append_legacy_forward_dep_packages(${packageName} LIB OPTIONAL) - tribits_append_legacy_forward_dep_packages(${packageName} TEST REQUIRED) - tribits_append_legacy_forward_dep_packages(${packageName} TEST OPTIONAL) - endmacro() @@ -544,11 +506,6 @@ endmacro() # `tribits_abort_on_missing_package()`_ or allow to be missing and disable # this package if this is a required dependency). # -# **__ Legacy variables #63:__** -# -# Set the backward/upstream dependency variables defined `Legacy list -# variables defining the package dependencies graph`_. -# # See `Function call tree for constructing package dependency graph`_. # macro(tribits_set_dep_packages packageName testOrLib requiredOrOptional pkgsOrTpls) @@ -556,8 +513,6 @@ macro(tribits_set_dep_packages packageName testOrLib requiredOrOptional pkgs set(inputListType ${testOrLib}_${requiredOrOptional}_DEP_${pkgsOrTpls}) set(packageEnableVar ${PROJECT_NAME}_ENABLE_${packageName}) - set(legacyPackageDepsList "") # Legacy var #63 - foreach(depPkg IN LISTS ${inputListType}) if (${depPkg} STREQUAL ${packageName}) tribits_abort_on_self_dep("${packageName}" "${inputListType}") @@ -573,16 +528,12 @@ macro(tribits_set_dep_packages packageName testOrLib requiredOrOptional pkgs message(FATAL_ERROR "Invalid value for requiredOrOptional='${requiredOrOptional}'!") endif() - list(APPEND legacyPackageDepsList ${depPkg}) else() tribits_set_dep_packages__handle_undefined_pkg(${packageName} ${depPkg} ${requiredOrOptional} ${pkgsOrTpls} ${packageEnableVar}) endif() endforeach() - # legacy var #63 - global_set(${packageName}_${inputListType} ${legacyPackageDepsList}) - endmacro() @@ -651,42 +602,6 @@ macro(tribits_set_dep_packages__handle_undefined_pkg packageName depPkg endmacro() -# @MACRO: tribits_append_legacy_forward_dep_packages() -# -# Appends legacy forward/downstream package dependency lists for the upstream -# dependent package list provided. (Remove when finished with #63) -# -macro(tribits_append_legacy_forward_dep_packages packageName libOrTest requiredOrOptional) - - set(legacyInputListType ${libOrTest}_${requiredOrOptional}_DEP_PACKAGES) - - set(legacyDepPkgListName "${packageName}_${legacyInputListType}") - - foreach(depPkg IN LISTS ${legacyDepPkgListName}) - set(legacyFwdDepPkgListName "${depPkg}_FORWARD_${legacyInputListType}") - if (DEFINED ${legacyFwdDepPkgListName}) - list(APPEND ${legacyFwdDepPkgListName} ${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 ${depPkg} has forward dependent package" - " ${packageName}, but that dependency is being ignored because the package" - " ${depPkg} is missing!" - "\n***\n" ) - endif() - endif() - endif() - endforeach() - -endmacro() - - # @MACRO: tribits_append_forward_dep_packages() # # Appends forward/downstream package dependency lists for the upstream diff --git a/tribits/core/package_arch/TribitsSystemDataStructuresMacrosFunctions.rst b/tribits/core/package_arch/TribitsSystemDataStructuresMacrosFunctions.rst index a87210537..f4661403f 100644 --- a/tribits/core/package_arch/TribitsSystemDataStructuresMacrosFunctions.rst +++ b/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: @@ -523,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/tribits/doc/build_ref/TribitsBuildReferenceBody.rst b/tribits/doc/build_ref/TribitsBuildReferenceBody.rst index c681430e0..f71863a55 100644 --- a/tribits/doc/build_ref/TribitsBuildReferenceBody.rst +++ b/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:: diff --git a/tribits/doc/guides/ReducedMockTrilinosOutput/ExpectedDependencies.txt b/tribits/doc/guides/ReducedMockTrilinosOutput/ExpectedDependencies.txt index 31dc0d7ab..51dbaaa44 100644 --- a/tribits/doc/guides/ReducedMockTrilinosOutput/ExpectedDependencies.txt +++ b/tribits/doc/guides/ReducedMockTrilinosOutput/ExpectedDependencies.txt @@ -30,75 +30,36 @@ Package dependencies information: -- PETSC_FORWARD_LIB_DEFINED_DEPENDENCIES: EpetraExt[O] --- Teuchos_FORWARD_LIB_REQUIRED_DEP_PACKAGES: RTOp EpetraExt ThyraCoreLibs --- Teuchos_LIB_REQUIRED_DEP_TPLS: BLAS LAPACK --- Teuchos_LIB_OPTIONAL_DEP_TPLS: Boost MPI - -- Teuchos_LIB_DEFINED_DEPENDENCIES: BLAS[R] LAPACK[R] Boost[O] MPI[O] -- Teuchos_FORWARD_LIB_DEFINED_DEPENDENCIES: RTOp[R] EpetraExt[R] ThyraCoreLibs[R] --- RTOp_LIB_REQUIRED_DEP_PACKAGES: Teuchos --- RTOp_FORWARD_LIB_REQUIRED_DEP_PACKAGES: ThyraCoreLibs - -- RTOp_LIB_DEFINED_DEPENDENCIES: Teuchos[R] -- RTOp_FORWARD_LIB_DEFINED_DEPENDENCIES: ThyraCoreLibs[R] --- Epetra_FORWARD_LIB_REQUIRED_DEP_PACKAGES: Triutils EpetraExt ThyraEpetra --- Epetra_LIB_REQUIRED_DEP_TPLS: BLAS LAPACK --- Epetra_LIB_OPTIONAL_DEP_TPLS: MPI - -- Epetra_LIB_DEFINED_DEPENDENCIES: BLAS[R] LAPACK[R] MPI[O] -- Epetra_FORWARD_LIB_DEFINED_DEPENDENCIES: Triutils[R] EpetraExt[R] ThyraEpetra[R] --- Triutils_LIB_REQUIRED_DEP_PACKAGES: Epetra --- Triutils_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: EpetraExt - -- Triutils_LIB_DEFINED_DEPENDENCIES: Epetra[R] -- Triutils_FORWARD_LIB_DEFINED_DEPENDENCIES: EpetraExt[O] --- EpetraExt_LIB_REQUIRED_DEP_PACKAGES: Teuchos Epetra --- EpetraExt_LIB_OPTIONAL_DEP_PACKAGES: Triutils --- EpetraExt_FORWARD_LIB_REQUIRED_DEP_PACKAGES: ThyraEpetraExt --- EpetraExt_LIB_OPTIONAL_DEP_TPLS: UMFPACK AMD PETSC - -- EpetraExt_LIB_DEFINED_DEPENDENCIES: Teuchos[R] Epetra[R] Triutils[O] UMFPACK[O] AMD[O] PETSC[O] -- EpetraExt_FORWARD_LIB_DEFINED_DEPENDENCIES: ThyraEpetraExt[R] --- ThyraCoreLibs_LIB_REQUIRED_DEP_PACKAGES: Teuchos RTOp --- ThyraCoreLibs_FORWARD_LIB_REQUIRED_DEP_PACKAGES: ThyraGoodStuff ThyraEpetra Thyra - -- ThyraCoreLibs_LIB_DEFINED_DEPENDENCIES: Teuchos[R] RTOp[R] -- ThyraCoreLibs_FORWARD_LIB_DEFINED_DEPENDENCIES: ThyraGoodStuff[R] ThyraEpetra[R] Thyra[R] --- ThyraGoodStuff_LIB_REQUIRED_DEP_PACKAGES: ThyraCoreLibs --- ThyraGoodStuff_FORWARD_LIB_REQUIRED_DEP_PACKAGES: ThyraCrazyStuff --- ThyraGoodStuff_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: Thyra - -- ThyraGoodStuff_LIB_DEFINED_DEPENDENCIES: ThyraCoreLibs[R] -- ThyraGoodStuff_FORWARD_LIB_DEFINED_DEPENDENCIES: ThyraCrazyStuff[R] Thyra[O] --- ThyraCrazyStuff_LIB_REQUIRED_DEP_PACKAGES: ThyraGoodStuff --- ThyraCrazyStuff_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: Thyra - -- ThyraCrazyStuff_LIB_DEFINED_DEPENDENCIES: ThyraGoodStuff[R] -- ThyraCrazyStuff_FORWARD_LIB_DEFINED_DEPENDENCIES: Thyra[O] --- ThyraEpetra_LIB_REQUIRED_DEP_PACKAGES: Epetra ThyraCoreLibs --- ThyraEpetra_FORWARD_LIB_REQUIRED_DEP_PACKAGES: ThyraEpetraExt --- ThyraEpetra_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: Thyra - -- ThyraEpetra_LIB_DEFINED_DEPENDENCIES: Epetra[R] ThyraCoreLibs[R] -- ThyraEpetra_FORWARD_LIB_DEFINED_DEPENDENCIES: ThyraEpetraExt[R] Thyra[O] --- ThyraEpetraExt_LIB_REQUIRED_DEP_PACKAGES: ThyraEpetra EpetraExt --- ThyraEpetraExt_FORWARD_LIB_OPTIONAL_DEP_PACKAGES: Thyra - -- ThyraEpetraExt_LIB_DEFINED_DEPENDENCIES: ThyraEpetra[R] EpetraExt[R] -- ThyraEpetraExt_FORWARD_LIB_DEFINED_DEPENDENCIES: Thyra[O] --- Thyra_LIB_REQUIRED_DEP_PACKAGES: ThyraCoreLibs --- Thyra_LIB_OPTIONAL_DEP_PACKAGES: ThyraGoodStuff ThyraCrazyStuff ThyraEpetra ThyraEpetraExt - -- Thyra_LIB_DEFINED_DEPENDENCIES: ThyraCoreLibs[R] ThyraGoodStuff[O] ThyraCrazyStuff[O] ThyraEpetra[O] ThyraEpetraExt[O] Dumping direct enabled dependencies for each package ... From 7a39177a44f9271f7461be49274352056fed4819 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Wed, 7 Dec 2022 10:09:34 -0700 Subject: [PATCH 34/35] WIP: Add test for implicit TPL enable (#63) There was no test in TriBITS that was testing that upstream TPLs don't get enabled by default (yet). Amazingly, the test IndirectTplDependency_NoImplicitEnableBLAS passes! I had expected it to fail giving the implementation I used in the refactoring. In a later refactoring, I think we should make it so that TPLs upstream from an enabled TPL should automatically be enabled (perhaps as determined by a configure-time option). --- test/core/DependencyUnitTests/CMakeLists.txt | 49 +++++++++++++++++++ .../DependsOnLAPACK/PackagesList.cmake | 3 ++ .../extraRepos/DependsOnLAPACK/TPLsList.cmake | 1 + .../DependsOnLAPACK/cmake/Dependencies.cmake | 3 ++ 4 files changed, 56 insertions(+) create mode 100644 tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/PackagesList.cmake create mode 100644 tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/TPLsList.cmake create mode 100644 tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/cmake/Dependencies.cmake diff --git a/test/core/DependencyUnitTests/CMakeLists.txt b/test/core/DependencyUnitTests/CMakeLists.txt index 24faa9f79..c1c46860f 100644 --- a/test/core/DependencyUnitTests/CMakeLists.txt +++ b/test/core/DependencyUnitTests/CMakeLists.txt @@ -555,6 +555,55 @@ create_reduced_dependency_handling_test_case( ) +# +# Test implicit TPL dependencies +# + + +create_reduced_dependency_handling_test_case( + IndirectTplDependency_NoImplicitEnableBLAS + ARGS + -DTrilinos_EXTRA_REPOSITORIES=extraRepos/DependsOnLAPACK + -DTrilinos_ENABLE_DependsOnLAPACK=ON + -DTrilinos_DUMP_PACKAGE_DEPENDENCIES:BOOL=ON + -DTrilinos_DUMP_FORWARD_PACKAGE_DEPENDENCIES:BOOL=ON + PASS_REGULAR_EXPRESSION_ALL + "-- BLAS_FORWARD_LIB_DEFINED_DEPENDENCIES: LAPACK.R." + "-- LAPACK_LIB_DEFINED_DEPENDENCIES: BLAS.R." + "Explicitly enabled external packages/TPLs on input [(]by user[)]: 0" + "Explicitly disabled external packages/TPLs on input [(]by user or by default[)]: 0" + "-- Setting TPL_ENABLE_LAPACK=ON because DependsOnLAPACK has a required dependence on LAPACK" + "-- Setting DependsOnLAPACK_ENABLE_LAPACK=ON since Trilinos_ENABLE_DependsOnLAPACK=ON AND TPL_ENABLE_LAPACK=ON" + "Final set of enabled packages: DependsOnLAPACK 1" + "Final set of enabled external packages/TPLs: LAPACK 1" + "Final set of non-enabled external packages/TPLs: .* BLAS .*" + "-- LAPACK: No enabled dependencies" + "-- DependsOnLAPACK_LIB_ENABLED_DEPENDENCIES: LAPACK.R." + ) + + +create_reduced_dependency_handling_test_case( + IndirectTplDependency_ExplicitEnableBLAS + ARGS + -DTrilinos_EXTRA_REPOSITORIES=extraRepos/DependsOnLAPACK + -DTrilinos_ENABLE_DependsOnLAPACK=ON + -DTPL_ENABLE_BLAS=ON + -DTrilinos_DUMP_PACKAGE_DEPENDENCIES:BOOL=ON + -DTrilinos_DUMP_FORWARD_PACKAGE_DEPENDENCIES:BOOL=ON + PASS_REGULAR_EXPRESSION_ALL + "Explicitly enabled external packages/TPLs on input [(]by user[)]: BLAS 1" + "Explicitly disabled external packages/TPLs on input [(]by user or by default[)]: 0" + "-- Setting TPL_ENABLE_LAPACK=ON because DependsOnLAPACK has a required dependence on LAPACK" + "-- Setting DependsOnLAPACK_ENABLE_LAPACK=ON since Trilinos_ENABLE_DependsOnLAPACK=ON AND TPL_ENABLE_LAPACK=ON" + "Final set of enabled packages: DependsOnLAPACK 1" + "Final set of enabled external packages/TPLs: BLAS LAPACK 2" + "Processing enabled external package/TPL: BLAS [(]enabled explicitly, disable with -DTPL_ENABLE_BLAS=OFF[)]" + "Processing enabled external package/TPL: LAPACK [(]enabled by DependsOnLAPACK, disable with -DTPL_ENABLE_LAPACK=OFF[)]" + "-- LAPACK_LIB_ENABLED_DEPENDENCIES: BLAS.R." + "-- DependsOnLAPACK_LIB_ENABLED_DEPENDENCIES: LAPACK.R." + ) + + ##################################################################### # # Unit tests for dependency handling for full set of packages diff --git a/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/PackagesList.cmake b/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/PackagesList.cmake new file mode 100644 index 000000000..41002b843 --- /dev/null +++ b/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/PackagesList.cmake @@ -0,0 +1,3 @@ +tribits_repository_define_packages( + DependsOnLAPACK . PT + ) diff --git a/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/TPLsList.cmake b/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/TPLsList.cmake new file mode 100644 index 000000000..e85baf197 --- /dev/null +++ b/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/TPLsList.cmake @@ -0,0 +1 @@ +tribits_repository_define_tpls() diff --git a/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/cmake/Dependencies.cmake b/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/cmake/Dependencies.cmake new file mode 100644 index 000000000..3f688dcd4 --- /dev/null +++ b/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/cmake/Dependencies.cmake @@ -0,0 +1,3 @@ +tribits_package_define_dependencies( + LIB_REQUIRED_TPLS LAPACK + ) From a83361a2406d3656c2eff205a5d53b1ca5eb45af Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Wed, 7 Dec 2022 15:52:39 -0700 Subject: [PATCH 35/35] WIP: Remove some commented out print_var() and message() lines (#63) Just cleaning up some for files I touched. --- .../TribitsReadDepsFilesCreateDepsGraph.cmake | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/tribits/core/package_arch/TribitsReadDepsFilesCreateDepsGraph.cmake b/tribits/core/package_arch/TribitsReadDepsFilesCreateDepsGraph.cmake index cb3a7c547..9ec045e00 100644 --- a/tribits/core/package_arch/TribitsReadDepsFilesCreateDepsGraph.cmake +++ b/tribits/core/package_arch/TribitsReadDepsFilesCreateDepsGraph.cmake @@ -99,13 +99,8 @@ macro(tribits_process_all_repository_deps_setup_files) 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}") @@ -626,11 +621,8 @@ endmacro() # macro(tribits_append_forward_dep_packages packageName libOrTest) - #message("\ntribits_append_forward_dep_packages(${packageName} ${libOrTest})") - foreach(depPkg IN LISTS ${packageName}_${libOrTest}_DEFINED_DEPENDENCIES) set(fwdDepPkgListName ${depPkg}_FORWARD_${libOrTest}_DEFINED_DEPENDENCIES) - #print_var(${fwdDepPkgListName}) if (DEFINED ${fwdDepPkgListName}) list(APPEND ${fwdDepPkgListName} ${packageName}) else() @@ -649,7 +641,6 @@ macro(tribits_append_forward_dep_packages packageName libOrTest) endif() endif() endif() - #print_var(${fwdDepPkgListName}) endforeach() endmacro() @@ -675,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 @@ -902,10 +892,6 @@ endmacro() # 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 IN LISTS ${PACKAGE_NAME}_SUBPACKAGES) list(GET ${PACKAGE_NAME}_SUBPACKAGE_DIRS ${SUBPACKAGE_IDX} SUBPACKAGE_DIR) @@ -934,8 +920,6 @@ 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}) #