Piro: Config-time error if NOX not enabled
Created by: mhoemmen
@trilinos/nox
I ran the check-in test script as follows:
${TRILINOS_PATH}/checkin-test.py \
--disable-packages=FEI,PyTrilinos,Moertel,STK,SEACAS,ThreadPool,OptiPack,ShyLU,Rythmos,NOX
--ctest-timeout=180
--configure --make --make-options="-j2" --enable-packages=TpetraCore --enable-all-packages=off
With the MPI_DEBUG build, I got the following configuration-time error:
CMake Error at cmake/tribits/core/utils/AssertDefined.cmake:79 (MESSAGE): Error, the variable NOX_ENABLE_Epetra is not defined! Call Stack (most recent call first): packages/piro/CMakeLists.txt:27 (ASSERT_DEFINED)
CMake Error at packages/piro/CMakeLists.txt:29 (MESSAGE): Piro configuration error: Enabling Epetra in Piro also requires that Epetra be enabled in NOX (-DNOX_ENABLE_Epetra:BOOL=ON)
Here is my "final set of enabled packages":
Gtest Kokkos Teuchos RTOp Sacado Epetra Zoltan Shards Triutils Tpetra EpetraExt Thyra Xpetra Isorropia AztecOO Galeri Amesos Pamgen Zoltan2 Ifpack ML Belos Amesos2 Anasazi Ifpack2 Stratimikos Teko Intrepid Intrepid2 Phalanx MueLu Stokhos ROL Piro Panzer TrilinosCouplings Pike 37
I checked Trilinos/packages/piro/cmake/Dependencies.cmake, and noticed that NOX is only an optional dependency of Piro. However, it looks like Piro expects NOX always to be enabled, because line 27 of piro/CMakeLists.txt does an ASSERT_DEFINED(NOX_ENABLE_Epetra). If NOX is not enabled, this variable won't be defined.
Suggested fixes:
- Make NOX a required dependency of Piro
- Replace line 27 of piro/CMakeLists.txt with the following:
IF (${PACKAGE_NAME}_ENABLE_NOX)
IF (${PACKAGE_NAME}_ENABLE_Epetra AND NOT NOX_ENABLE_Epetra)
MESSAGE (FATAL_ERROR "Piro configuration error: Enabling Epetra in Piro also requires that Epetra be enabled in NOX (-DNOX_ENABLE_Epetra:BOOL=ON)")
ENDIF ()
ENDIF ()