Repository: spack/spack

Issue:
trilinos@13.0.1: cmake: MiniTensor has required library dependence on disabled TPL Boost!
Building `trilinos@13.0.1 +amesos +amesos2 +anasazi +aztec +belos +epetra +epetraext +ifpack +ifpack2 +intrepid +intrepid2 +isorropia +kokkos +ml +minitensor +muelu +nox +piro +phalanx +rol +rythmos +sacado +stk +shards +shylu +stokhos +stratimikos +teko +tempus +tpetra +trilinoscouplings +zoltan +zoltan2 +superlu-dist gotype=long` fails at CMake stage using:
* `spack@develop` (889ece85ed4d9305a5b47863ee9579d67ff6a1b2 from `Tue Jul 20 14:58:54 2021 +0200`)

Concrete spec: [trilinos.spec.yaml.txt](https://github.com/spack/spack/files/6849636/trilinos.spec.yaml.txt)
Build log: [trilinos-build-out.txt](https://github.com/spack/spack/files/6849637/trilinos-build-out.txt)

```
$> spack spec -y trilinos@13.0.1 +amesos +amesos2 +anasazi +aztec +belos +epetra +epetraext +ifpack +ifpack2 +intrepid +intrepid2 +isorropia +kokkos +ml +minitensor +muelu +nox +piro +phalanx +rol +rythmos +sacado +stk +shards +shylu +stokhos +stratimikos +teko +tempus +tpetra +trilinoscouplings +zoltan +zoltan2 +superlu-dist gotype=long > trilinos.spec.yaml

$> spack install -f ./trilinos.spec.yaml
...
==> Installing trilinos-13.0.1-hfaiyfk6yp75dp5rn2rsttetd7vffhg5
==> No binary for trilinos-13.0.1-hfaiyfk6yp75dp5rn2rsttetd7vffhg5 found: installing from source
==> Using cached archive: /spack/var/spack/cache/_source-cache/git//trilinos/Trilinos.git/4796b92fb0644ba8c531dd9953e7a4878b05c62d.tar.gz
==> Warning: Fetching from mirror without a checksum!
  This package is normally checked out from a version control system, but it has been archived on a spack mirror.  This means we cannot know a checksum for the tarball in advance. Be sure that your connection to this mirror is secure!
==> Using cached archive: /spack/var/spack/cache/_source-cache/archive/de/dee6c55fe38eb7f6367e1896d6bc7483f6f9ab8fa252503050cc0c68c6340610
==> Applied patch https://github.com/trilinos/Trilinos/commit/b17f20a0b91e0b9fc5b1b0af3c8a34e2a4874f3f.patch
==> trilinos: Executing phase: 'cmake'
==> Error: ProcessError: Command exited with status 1:
    'cmake' '-G' 'Unix Makefiles' '-DCMAKE_INSTALL_PREFIX:STRING=/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/trilinos-13.0.1-hfaiyfk6yp75dp5rn2rsttetd7vffhg5' '-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo' '-DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=OFF' '-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON' '-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=OFF' '-DCMAKE_INSTALL_RPATH:STRING=/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/trilinos-13.0.1-hfaiyfk6yp75dp5rn2rsttetd7vffhg5/lib;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/trilinos-13.0.1-hfaiyfk6yp75dp5rn2rsttetd7vffhg5/lib64;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/boost-1.76.0-66kmjl2lzzzfxhhr2ie2u4zh2h2hsxuk/lib;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/bzip2-1.0.8-j4lizuhei23oecjerikbis2dnjuqmid3/lib;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/zlib-1.2.11-hmubt3qr3rxmeglrozk6niu22dbj35um/lib;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/hwloc-2.5.0-tfes2jnsgnzp6isgs5abmil7zbcvixlo/lib;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/libpciaccess-0.16-blkltfzvmruoq2tbziedih645giymoyw/lib;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/libxml2-2.9.10-vjxonguiez2vpfx67ayys642x7ulij5e/lib;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/libiconv-1.16-hy5gawjxbzl4pidjanrq63cohte5tdgi/lib;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/xz-5.2.5-f36wjxobn76y42xanvr6fls5cvrsk6ab/lib;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/ncurses-6.2-dzigaap74ovnjdwytseci4qjryl3ra5h/lib;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/metis-5.1.0-zugqjspwvouwu44fqq3ln5qh6udwwcpj/lib;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/openblas-0.3.17-6ahqtwl6x6yvln5pbcbhqfdrgta47a5t/lib;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/openmpi-4.1.1-cy6al3wo4nip4tkz6gsppz7fymounm2f/lib;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/libevent-2.1.12-3duejofjis6fmhylvuhwwqfd72la765i/lib;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/openssl-1.1.1k-2babbffrjjrhaaggdkbqtnflafeljay3/lib;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/numactl-2.0.14-uu3ogctwgfm3vvrdcr4ixhgb5vij53qn/lib;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/parmetis-4.0.3-id73rrrjydigpeikhv6t7ua6kpt3ewnf/lib;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/superlu-dist-6.4.0-crw7hrkn5uhftymnbqmcso2ufrd3ql73/lib' '-DCMAKE_PREFIX_PATH:STRING=/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/superlu-dist-6.4.0-crw7hrkn5uhftymnbqmcso2ufrd3ql73;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/parmetis-4.0.3-id73rrrjydigpeikhv6t7ua6kpt3ewnf;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/openmpi-4.1.1-cy6al3wo4nip4tkz6gsppz7fymounm2f;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/numactl-2.0.14-uu3ogctwgfm3vvrdcr4ixhgb5vij53qn;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/libevent-2.1.12-3duejofjis6fmhylvuhwwqfd72la765i;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/openblas-0.3.17-6ahqtwl6x6yvln5pbcbhqfdrgta47a5t;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/metis-5.1.0-zugqjspwvouwu44fqq3ln5qh6udwwcpj;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/hwloc-2.5.0-tfes2jnsgnzp6isgs5abmil7zbcvixlo;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/libxml2-2.9.10-vjxonguiez2vpfx67ayys642x7ulij5e;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/xz-5.2.5-f36wjxobn76y42xanvr6fls5cvrsk6ab;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/libpciaccess-0.16-blkltfzvmruoq2tbziedih645giymoyw;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/cmake-3.20.5-ye3coguvnmhufrllweessz2ldl6wxbha;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/openssl-1.1.1k-2babbffrjjrhaaggdkbqtnflafeljay3;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/ncurses-6.2-dzigaap74ovnjdwytseci4qjryl3ra5h;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/boost-1.76.0-66kmjl2lzzzfxhhr2ie2u4zh2h2hsxuk;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/zlib-1.2.11-hmubt3qr3rxmeglrozk6niu22dbj35um;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/bzip2-1.0.8-j4lizuhei23oecjerikbis2dnjuqmid3;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/libiconv-1.16-hy5gawjxbzl4pidjanrq63cohte5tdgi' '-DTrilinos_VERBOSE_CONFIGURE:BOOL=OFF' '-DTrilinos_ENABLE_TESTS:BOOL=OFF' '-DTrilinos_ENABLE_EXAMPLES:BOOL=OFF' '-DTrilinos_ENABLE_CXX11:BOOL=ON' '-DCMAKE_CXX_STANDARD:STRING=11' '-DBUILD_SHARED_LIBS:BOOL=ON' '-DTrilinos_ENABLE_DEBUG:BOOL=OFF' '-DTPL_ENABLE_MPI:BOOL=ON' '-DCMAKE_C_COMPILER:STRING=/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/openmpi-4.1.1-cy6al3wo4nip4tkz6gsppz7fymounm2f/bin/mpicc' '-DCMAKE_CXX_COMPILER:STRING=/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/openmpi-4.1.1-cy6al3wo4nip4tkz6gsppz7fymounm2f/bin/mpic++' '-DCMAKE_Fortran_COMPILER:STRING=/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/openmpi-4.1.1-cy6al3wo4nip4tkz6gsppz7fymounm2f/bin/mpif90' '-DMPI_BASE_DIR:STRING=/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/openmpi-4.1.1-cy6al3wo4nip4tkz6gsppz7fymounm2f' '-DTrilinos_ENABLE_Amesos:BOOL=ON' '-DTrilinos_ENABLE_Amesos2:BOOL=ON' '-DTrilinos_ENABLE_Anasazi:BOOL=ON' '-DTrilinos_ENABLE_AztecOO:BOOL=ON' '-DTrilinos_ENABLE_Belos:BOOL=ON' '-DTrilinos_ENABLE_Epetra:BOOL=ON' '-DTrilinos_ENABLE_EpetraExt:BOOL=ON' '-DTrilinos_ENABLE_Ifpack:BOOL=ON' '-DTrilinos_ENABLE_Ifpack2:BOOL=ON' '-DTrilinos_ENABLE_Intrepid:BOOL=ON' '-DTrilinos_ENABLE_Intrepid2:BOOL=ON' '-DTrilinos_ENABLE_Isorropia:BOOL=ON' '-DTrilinos_ENABLE_Kokkos:BOOL=ON' '-DTrilinos_ENABLE_MiniTensor:BOOL=ON' '-DTrilinos_ENABLE_Mesquite:BOOL=OFF' '-DTrilinos_ENABLE_ML:BOOL=ON' '-DTrilinos_ENABLE_MueLu:BOOL=ON' '-DTrilinos_ENABLE_NOX:BOOL=ON' '-DTrilinos_ENABLE_Piro:BOOL=ON' '-DTrilinos_ENABLE_Phalanx:BOOL=ON' '-DTrilinos_ENABLE_PyTrilinos:BOOL=OFF' '-DTrilinos_ENABLE_ROL:BOOL=ON' '-DTrilinos_ENABLE_Rythmos:BOOL=ON' '-DTrilinos_ENABLE_Sacado:BOOL=ON' '-DTrilinos_ENABLE_SCOREC:BOOL=OFF' '-DTrilinos_ENABLE_Shards:BOOL=ON' '-DTrilinos_ENABLE_ShyLU:BOOL=ON' '-DTrilinos_ENABLE_STK:BOOL=ON' '-DTrilinos_ENABLE_Stokhos:BOOL=ON' '-DTrilinos_ENABLE_Stratimikos:BOOL=ON' '-DTrilinos_ENABLE_Teko:BOOL=ON' '-DTrilinos_ENABLE_Tempus:BOOL=ON' '-DTrilinos_ENABLE_Tpetra:BOOL=ON' '-DTrilinos_ENABLE_TrilinosCouplings:BOOL=ON' '-DTrilinos_ENABLE_Zoltan:BOOL=ON' '-DTrilinos_ENABLE_Zoltan2:BOOL=ON' '-DEpetraExt_BUILD_BTF:BOOL=OFF' '-DEpetraExt_BUILD_EXPERIMENTAL:BOOL=OFF' '-DEpetraExt_BUILD_GRAPH_REORDERINGS:BOOL=OFF' '-DAmesos2_ENABLE_Basker:BOOL=OFF' '-DTrilinos_ENABLE_SEACASExodus:BOOL=OFF' '-DTrilinos_ENABLE_SEACASIoss:BOOL=OFF' '-DTrilinos_ENABLE_SEACASChaco:BOOL=OFF' '-DTrilinos_ENABLE_SEACASNemslice:BOOL=OFF' '-DTrilinos_ENABLE_Thyra:BOOL=ON' '-DTrilinos_ENABLE_ThyraEpetraAdapters:BOOL=ON' '-DTrilinos_ENABLE_ThyraEpetraExtAdapters:BOOL=ON' '-DTrilinos_ENABLE_ThyraTpetraAdapters:BOOL=ON' '-DTPL_ENABLE_BLAS:BOOL=ON' '-DBLAS_LIBRARY_NAMES:STRING=openblas' '-DBLAS_LIBRARY_DIRS:STRING=/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/openblas-0.3.17-6ahqtwl6x6yvln5pbcbhqfdrgta47a5t/lib' '-DTPL_ENABLE_LAPACK:BOOL=ON' '-DLAPACK_LIBRARY_NAMES:STRING=openblas' '-DLAPACK_LIBRARY_DIRS:STRING=/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/openblas-0.3.17-6ahqtwl6x6yvln5pbcbhqfdrgta47a5t/lib' '-DTPL_ENABLE_Matio:BOOL=OFF' '-DTPL_ENABLE_Netcdf:BOOL=OFF' '-DTPL_ENABLE_HYPRE:BOOL=OFF' '-DTPL_ENABLE_Boost:BOOL=OFF' '-DTPL_ENABLE_HDF5:BOOL=OFF' '-DTPL_ENABLE_Cholmod:BOOL=OFF' '-DTPL_ENABLE_UMFPACK:BOOL=OFF' '-DTPL_ENABLE_METIS:BOOL=ON' '-DMETIS_LIBRARY_DIRS:STRING=/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/metis-5.1.0-zugqjspwvouwu44fqq3ln5qh6udwwcpj/lib' '-DMETIS_LIBRARY_NAMES:STRING=metis' '-DTPL_METIS_INCLUDE_DIRS:STRING=/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/metis-5.1.0-zugqjspwvouwu44fqq3ln5qh6udwwcpj/include' '-DTPL_ENABLE_ParMETIS:BOOL=ON' '-DParMETIS_LIBRARY_DIRS:STRING=/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/parmetis-4.0.3-id73rrrjydigpeikhv6t7ua6kpt3ewnf/lib;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/metis-5.1.0-zugqjspwvouwu44fqq3ln5qh6udwwcpj/lib' '-DParMETIS_LIBRARY_NAMES:STRING=parmetis;metis' '-DTPL_ParMETIS_INCLUDE_DIRS:STRING=/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/parmetis-4.0.3-id73rrrjydigpeikhv6t7ua6kpt3ewnf/include;/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/metis-5.1.0-zugqjspwvouwu44fqq3ln5qh6udwwcpj/include' '-DTPL_ENABLE_MUMPS:BOOL=OFF' '-DTPL_ENABLE_SCALAPACK:BOOL=OFF' '-DTPL_ENABLE_SuperLUDist:BOOL=ON' '-DKokkosTSQR_ENABLE_Complex:BOOL=OFF' '-DTPL_ENABLE_SuperLUDist:BOOL=ON' '-DSuperLUDist_LIBRARY_DIRS:STRING=/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/superlu-dist-6.4.0-crw7hrkn5uhftymnbqmcso2ufrd3ql73/lib' '-DSuperLUDist_INCLUDE_DIRS:STRING=/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/superlu-dist-6.4.0-crw7hrkn5uhftymnbqmcso2ufrd3ql73/include' '-DHAVE_SUPERLUDIST_LUSTRUCTINIT_2ARG:BOOL=ON' '-DTPL_ENABLE_SuperLU:BOOL=OFF' '-DTPL_ENABLE_STRUMPACK:BOOL=OFF' '-DTPL_ENABLE_Pnetcdf:BOOL=OFF' '-DTPL_ENABLE_Zlib:BOOL=OFF' '-DTPL_ENABLE_CGNS:BOOL=OFF' '-DTPL_ENABLE_ADIOS2:BOOL=OFF' '-DTPL_ENABLE_HWLOC:BOOL=ON' '-DKokkos_ARCH_SKX:BOOL=ON' '-DTPL_ENABLE_CUDA:BOOL=OFF' '-DTrilinos_ENABLE_OpenMP:BOOL=OFF' '-DTrilinos_ENABLE_Fortran:BOOL=ON' '-DTrilinos_EXTRA_LINK_FLAGS:STRING=-L/usr/lib/gcc/x86_64-linux-gnu/9/ -lgfortran' '-DTrilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON' '-DTeuchos_ENABLE_COMPLEX:BOOL=OFF' '-DTeuchos_ENABLE_FLOAT:BOOL=OFF' '-DTpetra_INST_DOUBLE:BOOL=ON' '-DTpetra_INST_COMPLEX_DOUBLE:BOOL=OFF' '-DTpetra_INST_COMPLEX_FLOAT:BOOL=OFF' '-DTpetra_INST_FLOAT:BOOL=OFF' '-DTpetra_INST_SERIAL:BOOL=ON' '-DTpetra_INST_INT_INT:BOOL=OFF' '-DTpetra_INST_INT_LONG:BOOL=ON' '-DTpetra_INST_INT_LONG_LONG:BOOL=OFF' '-DCMAKE_INSTALL_NAME_DIR:STRING=/spack/opt/spack/linux-ubuntu20.04-cascadelake/gcc-9.3.0/trilinos-13.0.1-hfaiyfk6yp75dp5rn2rsttetd7vffhg5/lib' '-DCMAKE_CXX_FLAGS:STRING=' '-DTrilinos_ENABLE_Pike:BOOL=OFF' '/tmp/root/spack-stage/spack-stage-trilinos-13.0.1-hfaiyfk6yp75dp5rn2rsttetd7vffhg5/spack-src'

1 error found in build log:
     45    Explicitly enabled TPLs on input (by user):  HWLOC MPI BLAS LAPACK METIS ParMETIS SuperLUDist DLlib 8
     46
     47    Explicitly disabled TPLs on input (by user or by default):  CUDA Boost Zlib HDF5 CGNS Pnetcdf Netcdf ADIOS2 SuperLU Cholmod UMFPACK HYPRE SCALAPACK MUMPS
           Matio 15
     48
     49    Disabling all packages that have a required dependency on disabled TPLs and optional package TPL support based on TPL_ENABLE_<TPL>=OFF ...
     50
  >> 51    CMake Error at cmake/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake:1098 (MESSAGE):
     52       ***
     53       *** ERROR: Setting Trilinos_ENABLE_MiniTensor=OFF which was 'ON' because MiniTensor has a required library dependence on disabled TPL Boost!
     54       ***
     55
     56    Call Stack (most recent call first):
     57      cmake/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake:1134 (TRIBITS_PRIVATE_PRINT_DISABLE)

See build log for details:
  /tmp/root/spack-stage/spack-stage-trilinos-13.0.1-hfaiyfk6yp75dp5rn2rsttetd7vffhg5/spack-build-out.txt
```

@sethrj only in case you know what this is about


Discussion:
Yes, I thought I corrected this in https://github.com/spack/spack/pull/24820/commits/b99e237979c421a5df48e612bfd1ecdb6ad9d088 , which then concretized correctly...
Crap, I see the problem, I put `depends_on('boost')` rather than `conflicts('+boost')`, so it's specifying the command-line switch to disable boost but including the dependency in the tree. I'll fix this, sorry.

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py
--- a/var/spack/repos/builtin/packages/trilinos/package.py
+++ b/var/spack/repos/builtin/packages/trilinos/package.py
@@ -337,6 +337,9 @@ class Trilinos(CMakePackage, CudaPackage):
     conflicts('cxxstd=14', when='+wrapper ^cuda@6.5.14:8.0.61')
     conflicts('cxxstd=17', when='+wrapper ^cuda@6.5.14:10.2.89')
 
+    # Boost requires minitensor
+    conflicts('~boost', when='+minitensor')
+
     # SCOREC requires shards, stk, and zoltan
     conflicts('+scorec', when='~mpi')
     conflicts('+scorec', when='~shards')
@@ -375,7 +378,6 @@ class Trilinos(CMakePackage, CudaPackage):
     depends_on('parmetis', when='+scorec')
     depends_on('cgns', when='+cgns')
     depends_on('adios2', when='+adios2')
-    depends_on('boost', when='+minitensor')
     # Trilinos' Tribits config system is limited which makes it very tricky to
     # link Amesos with static MUMPS, see
     # https://trilinos.org/docs/dev/packages/amesos2/doc/html/classAmesos2_1_1MUMPS.html


Test patch: