Skip to content

Fix case for optional missing component (#2689)

James Willenbring requested to merge tribits_github_snapshot into develop

Created by: bartlettroscoe

My last commit (for #2689) broke the use case where an optional component (TriBITS package) is missing (i.e. was not enabled). This broke the SPARC use case where it looks for TriKota but TriKota can be missing.

I added tests for that use case and strengthened the existing test (in TriBITS).

I also made the indentation consistent (two spaces).

How was this tested?

I added strong unit tests to TriBITS itself for this use case and I tested against SPARC itself. See details below.

Detailed testing against SPARC (Click to expand)



Looks like the changes I made in TriBITS commit TriBITSPub/TriBITS@3b02ce8:

3b02ce8 "Make usage of <Package>Config.cmake robust when there are broken packages (trilinos/Trilinos#2689)"
Author: Roscoe A. Bartlett <>
Date:   Thu Apr 18 17:36:32 2019 -0600 (4 days ago)

M       test/core/ExamplesUnitTests/DummyPackageClientCMakeLists.txt
M       test/core/ExamplesUnitTests/RunDummyPackageClientBulid.cmake
M       test/ctest_driver/TribitsExampleProject/CMakeLists.txt
M       tribits/core/installation/
M       tribits/core/package_arch/TribitsWriteClientExportFiles.cmake

actually broke the usage of TrilinosConfig.cmake by SPARC. The error message shown here shows:

CMake Warning at /projects/atdm_devops/trilinos_installs/2019-04-22/cee-rhel6_intel-17.0.1_intelmpi-5.1.2_serial_static_opt/lib/cmake/Trilinos/TrilinosConfig.cmake:140 (MESSAGE):
  Component "TriKota" NOT found.
Call Stack (most recent call first):
  CMakeLists.txt:192 (find_package)
  CMakeLists.txt:256 (find_package_Trilinos)

CMake Error at /projects/atdm_devops/trilinos_installs/2019-04-22/cee-rhel6_intel-17.0.1_intelmpi-5.1.2_serial_static_opt/lib/cmake/Trilinos/TrilinosConfig.cmake:219 (INCLUDE):
  INCLUDE could not find load file:

Call Stack (most recent call first):
  CMakeLists.txt:192 (find_package)
  CMakeLists.txt:256 (find_package_Trilinos)

The problem is the code at the bottom of the file TrilinosConfig.cmake:

## Load configurations for enabled packages in components list

The problem is that it unconditionally includes the files for all of the requested components. In the case fo SPARC, they request more components than they actually need (TriKota in this case). Turns out that the <Package>Config.cmake files were already being included in the code earlier in this file so we don't even need this loop.

I tested ripping that code out of the installed file:

  • /projects/atdm_devops/trilinos_installs/2019-04-23/cee-rhel6_clang-5.0.1_openmpi-1.10.2_serial_static_opt/lib/cmake/Trilinos/TrilinosConfig.cmake

and SPARC built and tested just fine:

$ env \
    ATDM_TRIL_SPARC_BUILDS_LIST=cee-rhel6_clang-5.0.1_openmpi-1.10.2_serial_static_opt \
    ATDM_TRIL_SPARC_ATDM_USE_INSTALL_DIR=/projects/atdm_devops/trilinos_installs/2019-04-23 \

Running the builds:

./sparc-tril-dev-scripts/ \
   cee-rhel6_clang-5.0.1_openmpi-1.10.2_serial_static_opt "" ""

real    23m24.309s
user    191m33.039s
sys     5m59.603s


100% tests passed, 0 tests failed out of 280

So this confirms that you don't need this last loop. (I should have seen that from my earlier edit of this file.)

So I need to extend the TriBITS test suite to cover the SPARC use case (i.e. asking for components that never even got enabled). I also want to make this work a little smoother too.

Merge request reports