Having a compiler set in a depends_on directive enforces that compiler by default only on that node, while the preferred compiler is used for other nodes.
Steps to reproduce the issue
Modify hdf5 with this diff:
--- a/var/spack/repos/builtin/packages/hdf5/package.py
+++ b/var/spack/repos/builtin/packages/hdf5/package.py
@@ -83,7 +83,7 @@ class Hdf5(AutotoolsPackage):
if sys.platform != 'darwin':
depends_on('numactl', when='+mpi+fortran')
depends_on('szip', when='+szip')
- depends_on('[email protected]:')
+ depends_on('[email protected]: %[email protected]')
# There are several officially unsupported combinations of the features:
# 1. Thread safety is not guaranteed via high-level C-API but in some cases
then try the following:
$ spack compiler list
==> Available compilers
-- clang ubuntu18.04-x86_64 -------------------------------------
[email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
-- gcc ubuntu18.04-x86_64 ---------------------------------------
[email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
$ spack solve hdf5~mpi
==> Best of 0 answers.
==> Optimization: [0, 2, -11, 0, 0, 0, -3, 1, 0, 1, -1, 0]
[email protected]%[email protected]~cxx~debug~fortran~hl~java~mpi+pic+shared~szip~threadsafe api=v18 arch=linux-ubuntu18.04-x86_64
^[email protected]%[email protected]+optimize+pic+shared arch=linux-ubuntu18.04-x86_64
Error Message
No error message, but one would expect to see by default:
$ spack solve hdf5~mpi
==> Best of 0 answers.
==> Optimization: [0, 2, -11, 0, 0, 0, -3, 1, 0, 1, -1, 0]
[email protected]%[email protected]~cxx~debug~fortran~hl~java~mpi+pic+shared~szip~threadsafe api=v18 arch=linux-ubuntu18.04-x86_64
^[email protected]%[email protected]+optimize+pic+shared arch=linux-ubuntu18.04-x86_64
Information on your system
- Spack: 0.16.0-70-44665cb4e6
- Python: 3.8.6
- Platform: linux-ubuntu18.04-broadwell
- Concretizer: clingo
Additional information
It may seem silly to enforce a compiler in a depends_on directive, but this is what happens under the hood when a spec containing a compiler specification is concretized together with others in an environment. For instance:
spack:
view: false
concretization: together
config:
concretizer: clingo
specs:
- hdf5%[email protected] ^zlib
behaves differently if concretization: separately is used.
Having a compiler set in a
depends_ondirective enforces that compiler by default only on that node, while the preferred compiler is used for other nodes.Steps to reproduce the issue
Modify
hdf5with this diff:then try the following:
Error Message
No error message, but one would expect to see by default:
Information on your system
Additional information
It may seem silly to enforce a compiler in a depends_on directive, but this is what happens under the hood when a spec containing a compiler specification is concretized together with others in an environment. For instance:
behaves differently if
concretization: separatelyis used.spack debug reportand reported the version of Spack/Python/Platform