Skip to content

Commit d125c32

Browse files
committed
everything up to installation permissions
1 parent d35706a commit d125c32

3 files changed

Lines changed: 66 additions & 92 deletions

File tree

outputs/config/2.externals.out

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
$ spack spec hdf5%clang
2-
- hdf5@1.14.5%clang@14.0.0-gfortran cppflags=-g ~cxx~fortran~hl~ipo~java~map~mpi+shared~szip~threadsafe+tools api=default build_system=cmake build_type=Release generator=make arch=linux-ubuntu22.04-x86_64_v3
3-
- ^cmake@3.30.5%clang@14.0.0-gfortran cppflags=-g ~doc+ncurses+ownlibs~qtgui build_system=generic build_type=Release patches=dbc3892 arch=linux-ubuntu22.04-x86_64_v3
4-
[e] ^curl@7.81.0%gcc@11.4.0~gssapi~ldap~libidn2~librtmp~libssh~libssh2+nghttp2 build_system=autotools libs=shared,static tls=openssl arch=linux-ubuntu22.04-x86_64_v3
5-
- ^ncurses@6.5%clang@14.0.0-gfortran cppflags=-g ~symlinks+termlib abi=none build_system=autotools patches=7a351bc arch=linux-ubuntu22.04-x86_64_v3
6-
[e] ^glibc@2.35%clang@14.0.0-gfortran cppflags=-g build_system=autotools arch=linux-ubuntu22.04-x86_64_v3
7-
- ^gmake@4.4.1%clang@14.0.0-gfortran cppflags=-g ~guile build_system=generic arch=linux-ubuntu22.04-x86_64_v3
8-
- ^pkgconf@2.2.0%clang@14.0.0-gfortran cppflags=-g build_system=autotools arch=linux-ubuntu22.04-x86_64_v3
9-
- ^zlib-ng@2.2.1%clang@14.0.0-gfortran cppflags=-g +compat+new_strategies+opt+pic+shared build_system=autotools arch=linux-ubuntu22.04-x86_64_v3
1+
$ spack spec hdf5
2+
- hdf5@1.14.6~cxx~fortran~hl~ipo~java~map~mpi+shared~szip~threadsafe+tools api=default build_system=cmake build_type=Release generator=make arch=linux-ubuntu22.04-x86_64 %c=gcc@11.4.0
3+
- ^cmake@3.31.8~doc+ncurses+ownlibs~qtgui build_system=generic build_type=Release arch=linux-ubuntu22.04-x86_64 %c,cxx=clang@14.0.0
4+
[e] ^curl@7.81.0~gssapi~ldap~libidn2~librtmp~libssh~libssh2+nghttp2 build_system=autotools libs:=shared,static tls:=openssl arch=linux-ubuntu22.04-x86_64
5+
[e] ^llvm@14.0.0+clang~cuda~flang+gold+libomptarget~libomptarget_debug~link_llvm_dylib~lld~lldb+llvm_dylib+lua~mlir+polly~python~split_dwarf~z3 build_system=cmake build_type=Release compiler-rt=runtime generator=ninja libcxx=runtime libunwind=runtime openmp=runtime patches:=1f42874,25bc503,6379168,8248141,b216cff,cb8e645 shlib_symbol_version=none targets:=all version_suffix=none arch=linux-ubuntu22.04-x86_64
6+
- ^ncurses@6.5-20250705~symlinks+termlib abi=none build_system=autotools patches:=7a351bc arch=linux-ubuntu22.04-x86_64 %c,cxx=clang@14.0.0
7+
- ^compiler-wrapper@1.0 build_system=generic arch=linux-ubuntu22.04-x86_64
8+
[e] ^gcc@11.4.0~binutils+bootstrap~graphite~nvptx~piclibs~profiled~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran' arch=linux-ubuntu22.04-x86_64
9+
- ^gcc-runtime@11.4.0 build_system=generic arch=linux-ubuntu22.04-x86_64
10+
[e] ^glibc@2.35 build_system=autotools arch=linux-ubuntu22.04-x86_64
11+
- ^gmake@4.4.1~guile build_system=generic arch=linux-ubuntu22.04-x86_64 %c=clang@14.0.0
12+
- ^pkgconf@2.5.1 build_system=autotools arch=linux-ubuntu22.04-x86_64 %c=clang@14.0.0
13+
- ^zlib-ng@2.2.4+compat+new_strategies+opt+pic+shared build_system=autotools arch=linux-ubuntu22.04-x86_64 %c,cxx=clang@14.0.0

outputs/config/3.prefs.out

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
11
$ spack spec hdf5
2-
Input spec
3-
--------------------------------
4-
- hdf5
5-
6-
Concretized
7-
--------------------------------
8-
- hdf5@1.14.3%clang@14.0.0-gfortran cppflags="-g" ~cxx~fortran~hl~ipo~java~map~mpi+shared~szip~threadsafe+tools api=default build_system=cmake build_type=Release generator=make arch=linux-ubuntu22.04-x86_64_v3
9-
- ^cmake@3.27.7%clang@14.0.0-gfortran cppflags="-g" ~doc+ncurses+ownlibs build_system=generic build_type=Release arch=linux-ubuntu22.04-x86_64_v3
10-
- ^curl@8.4.0%clang@14.0.0-gfortran cppflags="-g" ~gssapi~ldap~libidn2~librtmp~libssh~libssh2+nghttp2 build_system=autotools libs=shared,static tls=openssl arch=linux-ubuntu22.04-x86_64_v3
11-
- ^nghttp2@1.57.0%clang@14.0.0-gfortran cppflags="-g" build_system=autotools arch=linux-ubuntu22.04-x86_64_v3
12-
- ^openssl@3.1.3%clang@14.0.0-gfortran cppflags="-g" ~docs+shared build_system=generic certs=mozilla arch=linux-ubuntu22.04-x86_64_v3
13-
- ^ca-certificates-mozilla@2023-05-30%clang@14.0.0-gfortran cppflags="-g" build_system=generic arch=linux-ubuntu22.04-x86_64_v3
14-
- ^perl@5.38.0%clang@14.0.0-gfortran cppflags="-g" +cpanm+opcode+open+shared+threads build_system=generic patches=714e4d1 arch=linux-ubuntu22.04-x86_64_v3
15-
- ^berkeley-db@18.1.40%clang@14.0.0-gfortran cppflags="-g" +cxx~docs+stl build_system=autotools patches=26090f4,b231fcc arch=linux-ubuntu22.04-x86_64_v3
16-
- ^bzip2@1.0.8%clang@14.0.0-gfortran cppflags="-g" ~debug~pic+shared build_system=generic arch=linux-ubuntu22.04-x86_64_v3
17-
- ^diffutils@3.9%clang@14.0.0-gfortran cppflags="-g" build_system=autotools arch=linux-ubuntu22.04-x86_64_v3
18-
- ^libiconv@1.17%clang@14.0.0-gfortran cppflags="-g" build_system=autotools libs=shared,static arch=linux-ubuntu22.04-x86_64_v3
19-
- ^gdbm@1.23%clang@14.0.0-gfortran cppflags="-g" build_system=autotools arch=linux-ubuntu22.04-x86_64_v3
20-
- ^readline@8.2%clang@14.0.0-gfortran cppflags="-g" build_system=autotools patches=bbf97f1 arch=linux-ubuntu22.04-x86_64_v3
21-
- ^ncurses@6.4%clang@14.0.0-gfortran cppflags="-g" ~symlinks+termlib abi=none build_system=autotools arch=linux-ubuntu22.04-x86_64_v3
22-
- ^gmake@4.4.1%clang@14.0.0-gfortran cppflags="-g" ~guile build_system=generic arch=linux-ubuntu22.04-x86_64_v3
23-
- ^pkgconf@1.9.5%clang@14.0.0-gfortran cppflags="-g" build_system=autotools arch=linux-ubuntu22.04-x86_64_v3
24-
- ^zlib-ng@2.1.4%clang@14.0.0-gfortran cppflags="-g" +compat+opt build_system=autotools arch=linux-ubuntu22.04-x86_64_v3
2+
- hdf5@1.14.6~cxx~fortran~hl~ipo~java~map~mpi+shared~szip~threadsafe+tools api=default build_system=cmake build_type=Release generator=make arch=linux-ubuntu22.04-x86_64 %c=clang@14.0.0
3+
- ^cmake@3.31.8~doc+ncurses+ownlibs~qtgui build_system=generic build_type=Release arch=linux-ubuntu22.04-x86_64 %c,cxx=clang@14.0.0
4+
- ^curl@8.11.1~gssapi~ldap~libidn2~librtmp~libssh~libssh2+nghttp2 build_system=autotools libs:=shared,static tls:=openssl arch=linux-ubuntu22.04-x86_64 %c,cxx=clang@14.0.0
5+
- ^nghttp2@1.65.0 build_system=autotools arch=linux-ubuntu22.04-x86_64 %c,cxx=clang@14.0.0
6+
- ^diffutils@3.10 build_system=autotools arch=linux-ubuntu22.04-x86_64 %c=clang@14.0.0
7+
- ^libiconv@1.18 build_system=autotools libs:=shared,static arch=linux-ubuntu22.04-x86_64 %c=clang@14.0.0
8+
- ^openssl@3.4.1~docs+shared build_system=generic certs=mozilla arch=linux-ubuntu22.04-x86_64 %c,cxx=clang@14.0.0
9+
- ^ca-certificates-mozilla@2025-05-20 build_system=generic arch=linux-ubuntu22.04-x86_64
10+
- ^perl@5.42.0+cpanm+opcode+open+shared+threads build_system=generic arch=linux-ubuntu22.04-x86_64 %c=clang@14.0.0
11+
- ^berkeley-db@18.1.40+cxx~docs+stl build_system=autotools patches:=26090f4,b231fcc arch=linux-ubuntu22.04-x86_64 %c,cxx=clang@14.0.0
12+
- ^bzip2@1.0.8~debug~pic+shared build_system=generic arch=linux-ubuntu22.04-x86_64 %c=clang@14.0.0
13+
- ^gdbm@1.23 build_system=autotools arch=linux-ubuntu22.04-x86_64 %c=clang@14.0.0
14+
- ^readline@8.3 build_system=autotools patches:=21f0a03 arch=linux-ubuntu22.04-x86_64 %c=clang@14.0.0
15+
- ^ncurses@6.5-20250705~symlinks+termlib abi=none build_system=autotools patches:=7a351bc arch=linux-ubuntu22.04-x86_64 %c,cxx=clang@14.0.0
16+
- ^compiler-wrapper@1.0 build_system=generic arch=linux-ubuntu22.04-x86_64
17+
[e] ^glibc@2.35 build_system=autotools arch=linux-ubuntu22.04-x86_64
18+
- ^gmake@4.4.1~guile build_system=generic arch=linux-ubuntu22.04-x86_64 %c=clang@14.0.0
19+
[e] ^llvm@14.0.0+clang~cuda~flang+gold+libomptarget~libomptarget_debug~link_llvm_dylib~lld~lldb+llvm_dylib+lua~mlir+polly~python~split_dwarf~z3 build_system=cmake build_type=Release compiler-rt=runtime generator=ninja libcxx=runtime libunwind=runtime openmp=runtime patches:=1f42874,25bc503,6379168,8248141,b216cff,cb8e645 shlib_symbol_version=none targets:=all version_suffix=none arch=linux-ubuntu22.04-x86_64
20+
- ^pkgconf@2.5.1 build_system=autotools arch=linux-ubuntu22.04-x86_64 %c=clang@14.0.0
21+
- ^zlib-ng@2.2.4+compat+new_strategies+opt+pic+shared build_system=autotools arch=linux-ubuntu22.04-x86_64 %c,cxx=clang@14.0.0

tutorial_configuration.rst

Lines changed: 33 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -444,17 +444,20 @@ Variant preferences
444444

445445
As we've seen throughout this tutorial, HDF5 builds with MPI enabled by default in Spack.
446446
If we were working on a project that would routinely need serial HDF5, that might get annoying quickly, having to type ``hdf5~mpi`` all the time.
447-
Instead, we'll update our preferences for HDF5.
447+
Instead, we'll update our config to force disable it:
448448

449449
.. code-block:: yaml
450-
:emphasize-lines: 9-10
450+
:emphasize-lines: 12-13
451451
452452
spack:
453453
specs: []
454454
view: true
455+
concretizer:
456+
unify: true
455457
packages:
456458
all:
457-
compiler: [clang, gcc, intel, pgi, xl, nag, fj]
459+
require:
460+
- one_of: ["%llvm", "%gcc"]
458461
providers:
459462
mpi: [mpich, openmpi]
460463
hdf5:
@@ -465,7 +468,7 @@ Now hdf5 will concretize without an MPI dependency by default.
465468

466469
.. literalinclude:: outputs/config/3.prefs.out
467470
:language: console
468-
:emphasize-lines: 8
471+
:emphasize-lines: 2
469472

470473

471474
In general, every attribute that we can set for all packages we can set separately for an individual package.
@@ -482,14 +485,17 @@ On these systems, we have a pre-installed curl.
482485
Let's tell Spack about this package and where it can be found:
483486

484487
.. code-block:: yaml
485-
:emphasize-lines: 11-14
488+
:emphasize-lines: 14-17
486489
487490
spack:
488491
specs: []
489492
view: true
493+
concretizer:
494+
unify: true
490495
packages:
491496
all:
492-
compiler: [clang, gcc, intel, pgi, xl, nag, fj]
497+
require:
498+
- one_of: ["%llvm", "%gcc"]
493499
providers:
494500
mpi: [mpich, openmpi]
495501
hdf5:
@@ -498,49 +504,15 @@ Let's tell Spack about this package and where it can be found:
498504
externals:
499505
- spec: curl@7.81.0 %gcc@11.4.0
500506
prefix: /usr
507+
buildable: false
501508
502509
503510
Here, we've told Spack that Curl 7.81.0 is installed on our system.
504511
We've also told it the installation prefix where Curl can be found.
505512
We don't know exactly which variants it was built with, but that's okay.
506-
507-
.. literalinclude:: outputs/config/0.externals.out
508-
:language: console
509-
510-
511-
You'll notice that Spack is now using the external Curl installation, but the compiler used to build Curl is now overriding our compiler preference of clang.
512-
If we explicitly specify Clang:
513-
514-
.. literalinclude:: outputs/config/1.externals.out
515-
:language: console
516-
517-
Spack concretizes to both HDF5 and Curl being built with Clang.
518-
This has a side-effect of rebuilding Curl.
519-
If we want to force Spack to use the system Curl, we have two choices.
520-
We can either specify it on the command line, or we can tell Spack that it's not allowed to build its own Curl.
521-
We'll go with the latter.
522-
523-
.. code-block:: yaml
524-
:emphasize-lines: 15
525-
526-
spack:
527-
specs: []
528-
view: true
529-
packages:
530-
all:
531-
compiler: [clang, gcc, intel, pgi, xl, nag, fj]
532-
providers:
533-
mpi: [mpich, openmpi]
534-
hdf5:
535-
require: ~mpi
536-
curl:
537-
externals:
538-
- spec: curl@5.34.0 %gcc@11.4.0
539-
prefix: /usr
540-
buildable: false
541-
542-
543-
Now Spack will be forced to choose the external Curl.
513+
Finally, we set `buildable: false` to require that Spack not try to
514+
build its own.
515+
.. The weighting/preferences dont work quite the same so I skipped right to buildable:false
544516
545517
.. literalinclude:: outputs/config/2.externals.out
546518
:language: console
@@ -560,14 +532,17 @@ To express that we don't want any other MPI installed, we can use the virtual ``
560532
While we're editing the ``spack.yaml`` file, make sure to configure HDF5 to be able to build with MPI again:
561533

562534
.. code-block:: yaml
563-
:emphasize-lines: 14-19
535+
:emphasize-lines: 19-24
564536
565537
spack:
566538
specs: []
567539
view: true
540+
concretizer:
541+
unify: true
568542
packages:
569543
all:
570-
compiler: [clang, gcc, intel, pgi, xl, nag, fj]
544+
require:
545+
- one_of: ["%llvm", "%gcc"]
571546
providers:
572547
mpi: [mpich, openmpi]
573548
curl:
@@ -582,27 +557,25 @@ While we're editing the ``spack.yaml`` file, make sure to configure HDF5 to be a
582557
mpi:
583558
buildable: false
584559
585-
Now that we have configured Spack not to build any possible provider for MPI, we can try again.
560+
.. 3.externals.out has mpich
561+
.. The concretization result is strange and enables some qt stuff that makes it huge
586562
587-
.. literalinclude:: outputs/config/3.externals.out
588-
:language: console
589-
:emphasize-lines: 15
590-
591-
Notice that we still haven't build ``hdf5`` with our external ``mpich``.
563+
If you run this as-is, you'll notice Spack still hasn't built ``hdf5`` with our external ``mpich``.
592564
The concretizer has instead turned off ``mpi`` support in ``hdf5``.
593565
To debug this, we will force Spack to use ``hdf5+mpi``.
594566

595567
.. code-block:: console
596568
597-
$ spack spec hdf5%clang+mpi
598-
==> Error: concretization failed for the following reasons:
599-
600-
1. hdf5: '+mpi' conflicts with '^mpich@4.0:4.0.3'
601-
2. hdf5: '+mpi' conflicts with '^mpich@4.0:4.0.3'
602-
required because conflict applies to spec ^mpich@4.0:4.0.3
603-
required because hdf5%clang+mpi requested from CLI
569+
$ spack spec hdf5+mpi
570+
==> Error: failed to concretize `hdf5+mpi` for the following reasons:
571+
1. cannot satisfy a requirement for package 'mpich'.
572+
2. hdf5: '+mpi' conflicts with '^mpich@4.0:4.0.3'
573+
3. hdf5: '+mpi' conflicts with '^mpich@4.0:4.0.3'
604574
required because conflict is triggered when +mpi
605-
required because hdf5%clang+mpi requested from CLI
575+
required because hdf5+mpi requested explicitly
576+
required because conflict constraint ^mpich@4.0:4.0.3
577+
required because mpich available as external when satisfying mpich@=4.0+hydra device=ch4 netmod=ofi
578+
required because hdf5+mpi requested explicitly
606579
607580
In this case, we cannot use the external mpich.
608581
The version is incompatible with ``hdf5``.

0 commit comments

Comments
 (0)