Commit graph

1018 commits

Author SHA1 Message Date
Zack Galbreath
8ee3073350
More updates for GitLab CI memory requests (#42425)
* gitlab: remove requests for unreferenced packages

The packages removed in this commit are not built by any of
our current GitLab CI stacks.

* gitlab: update memory requests for "huge" packages

* gitlab: reduce memory requests for overprovisioned packages

* gitlab: more memory for py-torch (again)

* gitlab: update memory but keep CPU the same
2024-02-12 16:41:56 -06:00
kwryankrattiger
13050a9fb3
CI: Add ability to enable and disable stacks (#42255)
It is useful to enable/disable stacks in order to handle turning
specific stacks on/off based on runner availability, stack stability,
testing requirements, etc.

The disabled stack list takes precedence over the enable stack list. The
assumption is that stacks that are disabled are so due to some
functionality missing or broken for that stack.

The enable stack list implicitly disables all stacks not listed in the
enable list.
2024-02-08 15:26:32 -06:00
kwryankrattiger
d227da5554
CI: Call timing script in after_script (#42166)
The main script body is over-written for power. Putting thet timing
aggregation in the after script allows it to be called on all of the
current pipelines.
2024-02-02 12:02:46 -06:00
Tamara Dahlgren
2fc0d05a55
Environments: Add support for including views (#42250)
* Environments: Add support for including views (take 2)

* schema type hint fixes
2024-02-01 10:07:16 +09:00
kwryankrattiger
1f11b3844a
CI: Add OIDC capability for deprecated CI (#42371)
This "breaks" the deprecated schema by allowing unknown attributes
to the attributes section of the job types. The breaking change here is
that deprecated stacks will no longer ignore attributes that are unknown
but rather assume the new CI schema behavior of injecting them into the
generated CI configuration. This change is required to secure
authentication in Spack CI.
2024-01-31 15:05:57 +01:00
Rocco Meli
e129a6f47a
Add +dlaf variant to cp2k in CI (#42346) 2024-01-31 11:54:45 +01:00
Harmen Stoppels
d983ac35fe
ci: bump ghcr.io/spack/linux-ubuntu22.04-x86_64_v2 tag (#42357) 2024-01-31 09:59:03 +01:00
Peter Scheibel
e63d8e6163
"spack logs": print log files for packages (either partially built or installed) (#42202) 2024-01-30 10:42:00 +01:00
Zack Galbreath
f03ae39fd1
Update GitLab memory requests (#42351)
* gitlab: remove commented-out duplicate entries

* gitlab: reclassify some packages from "huge" to "large"

Our observed max memory usage for these packages is as follows:

hipblas: 7.7G
qt: 6.6G
visit: 9.7G

All of these should fit within a "large" request (currently 12G).

* gitlab: remove pango from list of huge packages

This package is not currently built by any of our CI stacks.

* gitlab: update requests for high memory packages

Refine resource requests for memory-intensive packages based on
max memory usage data.
2024-01-29 19:28:58 +00:00
Dan LaManna
58b2201710
Stop passing manual AWS credentials to jobs (#42096) 2024-01-26 10:25:37 -07:00
Massimiliano Culpo
e77128dfa2
Run config audits in CI, add a new audit to detect wrongly named external specs (#42289) 2024-01-26 10:21:43 +01:00
eugeneswalker
4c7a1f541c
e4s oneapi: use ghcr spack registry for runner image (#42267) 2024-01-26 02:02:58 +00:00
eugeneswalker
3f47cc8d00
e4s neoverse-v2: use ghcr.io/spack image registry (#42268) 2024-01-25 13:45:29 -08:00
eugeneswalker
266bbad8cd
e4s: add gromacs (#42266) 2024-01-25 11:48:25 -08:00
Massimiliano Culpo
66813460c0
Add syntactic sugar for "strong preferences" and "conflicts" (#41832)
Currently requirements allow to express "strong preferences" and "conflicts" from
configuration using a convoluted syntax:
```yaml
packages:
  zlib-ng:
    require:
    # conflict on %clang
    - one_of: ["%clang", "@:"]
    # Strong preference for +shared
    - any_of: ["+shared", "@:"]
```
This PR adds syntactic sugar so that the same can be written as:
```yaml
packages:
  zlib-ng:
    conflict:
    - "%clang"
    prefer:
    - "+shared"
```
Preferences written in this way are "stronger" that the ones documented at:
- https://spack.readthedocs.io/en/latest/packages_yaml.html#package-preferences
2024-01-22 13:18:00 -08:00
eugeneswalker
58997f7f9a
e4s ci: use latest intel/hpckit 2024 based image (#41437)
* e4s ci: use latest intel/hpckit 2024 based image

* use latest container image: ecpe4s/ubuntu22.04-runner-amd64-oneapi-2024.0.0:2023.12.01

* comment out failing specs

* update to use patched container

* remove generalized package preference for intel-oneapi-mkl@2023

* change packages commented out
2024-01-20 20:17:44 -08:00
eugeneswalker
104a2b5e11
e4s ci: switch to neoverse_v2 target (#42115) 2024-01-20 16:28:29 -08:00
Massimiliano Culpo
203d682d87
spack graph: env aware (#42093) 2024-01-18 10:11:41 +01:00
Peter Scheibel
7b27591321
New command: spack config change (#41147)
Like `spack change` for specs in environments, this can e.g. replace `examplespec+debug` with `examplespec~debug` in a `require:` section.

Example behavior for a config like:

```
packages:
  foo:
    require:
    - spec: +debug
```

* `spack config change packages:foo:require:~debug` replaces `+debug` with `~debug`
* `spack config change packages:foo:require:@1.1` adds a requirement to the list
* `spack config change packages:bar:require:~debug` adds a requirement
2024-01-18 00:21:17 -08:00
eugeneswalker
5f58a4c079
add e4s aarch64 (#42066) 2024-01-14 14:26:51 -08:00
Victor Brunini
2c6be31bde
modules: Truncate configure options comment in tcl modules to 8192 ch… (#42054) 2024-01-11 22:05:56 -07:00
Owen Solberg
4022f083d5
Containerize: accommodate nested or pre-existing spack-env paths (#41558)
The current `mkdir {{ paths.environment }}` will generate an error if:
* `{{ paths.environment }}` already exists, or
* `{{ paths.environment }}` is nested in non-existing dirs.

Adding `-p` to the command will make this robust to both possibilities.

Set noclobber bash option when writing manifest.
2024-01-11 18:47:10 +01:00
psakievich
12963529af
Add --create to spack env activate (#40896)
Add `--create` option to `env activate` to allow users to create and activate in one command.


---------

Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
Co-authored-by: psakievich <psakievich@users.noreply.github.com>
2024-01-10 16:57:45 -07:00
Jordan Galby
73dae78ab3
Fix setup-env when going back and forth between instances (#40924)
* setup-env: Fix back and forth between two instances

* setup-env.csh: Fix SPACK_ROOT when switch to a different instance

i.e. Always look for the current SPACK_ROOT

* setup-env: Update comments
2024-01-05 11:31:32 -06:00
Massimiliano Culpo
c1af62783a
Gitlab pipelines: check load avg also before running script (#41962) 2024-01-05 17:31:59 +01:00
Todd Gamblin
533adaaa6d
spack list: add --namesapce / --repo option (#41948)
This adds options to `spack list` that allow you to list only packages from specific
repositories/namespaces, e.g.:

```console
spack list -r builtin
```

only lists packages from the `builtin` repo, while:

```console
spack list -r myrepo -r myrepo2
```

would list packages from `myrepo` and `myrepo2`, but not from `builtin`. Note that you
can use the same argument multiple times.

You can use either `-r` / `--repo` or `-N` / `--namespace`. `-N` is there to match the
corresponding option on `spack find`.

- [x] add `-r` / `--repo` / `-N` / `--namespace` argument
- [x] add test
2024-01-04 12:35:42 -08:00
Alec Scott
8f48bf7195
rust: add v1.75.0 & v1.74.0, merge related variants into +dev, add rust-analyzer (#41903)
* Add rust-analyzer as variant to rust build

* Expose cargo module only when +cargo

* rust: add v1.74.0 and v1.75.0 and remove variants in favor of +dev

* [@spackbot] updating style on behalf of alecbcs

* Fix variant typo

---------

Co-authored-by: alecbcs <alecbcs@users.noreply.github.com>
2024-01-04 11:08:20 -08:00
Todd Gamblin
3118647802
Update copyright year to 2024 (#41919)
It was time to run `spack license update-copyright-year` again.
2024-01-02 09:21:30 +01:00
kwryankrattiger
a1e86781bd
CI: Fix timing search paths to ignore bootstrap (#41893) 2023-12-28 20:43:12 -08:00
kwryankrattiger
d52fda6015
CI: Fix timing search paths to ignore bootstrap (#40677) 2023-12-28 16:24:37 -08:00
Todd Gamblin
24d12c632c
spack gc: add options for environments and build dependencies (#41731)
This adds a few options to `spack gc`.

One to give you a little more control over dependencies:

* `-b` / `--keep-build-dependencies`: By default, `spack gc` considers build dependencies to be "no longer needed" once their dependents are installed. With this option, we'll keep build dependencies of needed installations as well.

And two more to make working with environments easier:

* `-E` / `--except-any-environment`: Garbage collect anything NOT needed by an environment. `spack gc -E` and `spack gc -bE` are now easy ways to get rid of everytihng not used by some environment.

* `-e` / `--except-environment` `ENV`: Instead of considering all environments, garbage collect everything not needed by a *specific* environment. Note that you can use this with `-E` to add directory environments to the list of considered envs, e.g.:

      spack gc -E -e /path/to/direnv1 -e /path/to/direnv2 #...

- [x] rework `unused_specs()` method on DB to add options for roots and deptypes
- [x] add `all_hashes()` method on DB
- [x] rework `spack gc` command to add 3 more options
- [x] tests
2023-12-26 14:52:10 -08:00
Harmen Stoppels
7cb873fb87
Revert "CI: Disable downloading artifacts from upstream jobs (#41432)" (#41843)
This reverts commit a43156a861.
2023-12-23 00:21:19 +01:00
Harmen Stoppels
8371bb4e19 gcc-runtime: add separate package for gcc runtime libs
The gcc-runtime package adds a separate node for gcc's dynamic runtime
libraries.

This should help with:

1. binary caches where rpaths for compiler support libs cannot be
   relocated because the compiler is missing on the target system
2. creating "minimal" container images

The package is versioned like `gcc` (in principle it could be
unversioned, but Spack doesn't always guarantee not mixing compilers)
2023-12-21 12:22:58 -08:00
Harmen Stoppels
e7f897f959
ci: use "strong preference" idiom for compilers (#41806)
to avoid duplication of conflicts / requirements in config
2023-12-21 12:50:35 +01:00
Harmen Stoppels
16e27ba4a6
spack buildcache push --tag: create container image with multiple roots (#41077)
This PR adds a flag `--tag/-t` to `buildcache push`, which you can use like

```
$ spack mirror add my-oci-registry oci://example.com/hello/world
$ spack -e my_env buildcache push --base-image ubuntu:22.04 --tag my_custom_tag my-oci-registry
```

and lets users ship a full, installed environment as a minimal container image where each image layer is one Spack package, on top of a base image of choice. The image can then be used as

```
$ docker run -it --rm example.com/hello/world:my_custom_tag
```

Apart from environments, users can also pick arbitrary installed spec from their database, for instance:

```
$ spack buildcache push --base-image ubuntu:22.04 --tag some_specs my-oci-registry gcc@12 cmake
$ docker run -it --rm example.com/hello/world:some_specs
```

It has many advantages over `spack containerize`:

1. No external tools required (`docker`, `buildah`, ...)
2. Creates images from locally installed Spack packages (No need to rebuild inside `docker build`, where troubleshooting build failures is notoriously hard)
3. No need for multistage builds (Spack just tarballs existing installations of runtime deps)
4. Reduced storage size / composability: when pushing multiple environments with common specs, container image layers are shared.
5. Automatic build cache: later `spack install` of the env elsewhere speeds up since the containerized environment is a build cache
2023-12-20 11:31:41 +01:00
Peter Scheibel
5d50ad3941
"spack diff": add ignore option for dependencies (#41711)
* add trim function to `Spec` and `--ignore` option to 'spack diff'

Allows user to compare two specs while ignoring the sub-DAG of a particular dependency, e.g.

spack diff --ignore=mpi --ignore=zlib trilinos/abcdef trilinos/fedcba

to focus on differences closer to the root of the software stack
2023-12-19 16:37:44 -08:00
kwryankrattiger
a43156a861
CI: Disable downloading artifacts from upstream jobs (#41432)
* CI: Disable downloading artifacts from upstream jobs

* CI: Default .base-jobs are `when:manual`
2023-12-19 15:53:28 -07:00
Harmen Stoppels
4f8b856145
e4s: add julia (#41768) 2023-12-19 18:17:54 +01:00
Massimiliano Culpo
2ef8d09fc7
spack config get/blame: with no args, show entire config
This PR changes the default behavior of `spack config get` and `spack config blame`
to print a flattened version of the entire spack configuration, including any active 
environment, if the commands are invoked with no section arguments.

The new behavior is used in Gitlab CI to help debug CI configuration, but it can also
be useful when asking for more information in issues, or when simply debugging Spack.
2023-12-19 01:26:53 -08:00
Peter Scheibel
14c7bfe9ce
spack develop: convert to config (#35273)
Convert the 'develop' section of an environment to a dedicated configuration section.
This means for example that instead of having to define `develop` specs in the
`spack.yaml`, the environment can `include:` another `develop.yaml` configuration
which specifies which specs should be developed in the environment.

This change is not expected to be disruptive given that existing environment `spack.yaml`
files will conform to the new schema.

(Update 11/28/2023) I have implemented the `develop`/`undevelop` commands in terms
of more-generic modification functions added to the `config` module: `change_or_add`
and `update_all`. It is assumed that the semantics added here (described in 11/18 update)
would be desirable to extend to other config update actions (e.g. adding compilers, 
changing package requirements, adding mirrors).

(Update 11/18/2023) I have updated this such that `spack develop`, and
`spack undevelop` to potentially modify all writable scopes, like 
https://github.com/spack/spack/pull/41147. https://github.com/spack/spack/pull/35307
will be useful for modifying included scopes, but generally speaking specifying a 
`--scope` will not be required for `spack develop`: `spack develop` will add new 
develop specs to whatever scope already has develop specs defined, or to the
highest-priority writable scope (which should be the env scope).

TODOs:

- [x] If you `spack undevelop` a package which is mentioned at multiple layers of
      configuration, then currently this would only modify one of them. That's not
      technically a new issue (has always existed for configuration modification), but
      may be confusing to users when presented via an interface other than `spack config set`
- [x] Need to add (or confirm) the ability to modify individual config files by providing
      a path (rather than using a scope identifier as a key to retrieve associated config).
- [x] `spack develop` adds new develop specs to the scope that defines them
      (potentially skipping higher priority scopes to e.g. augment included scope files)

---------

Co-authored-by: scheibelp <scheibelp@users.noreply.github.com>
Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
2023-12-18 00:47:53 -08:00
Harmen Stoppels
8c29e90fa9
Build cache: make signed/unsigned a mirror property (#41507)
* Add `signed` property to mirror config

* make unsigned a tri-state: true/false overrides mirror config, none takes mirror config

* test commands

* Document this

* add a test
2023-12-11 15:14:59 -06:00
Jordan Galby
bb03ce7281
Do not use depfile in bootstrap (#41458)
- we don't have a fallback if make is not installed
- we assume file system locking works
- we don't verify that make is gnu make (bootstrapping fails on FreeBSD as a result)
- there are some weird race conditions in writing spack.yaml on concurrent spack install
- the view is updated after every package install instead of post environment install.
2023-12-07 10:09:49 +00:00
Harmen Stoppels
3cefd73fcc
spack buildcache check: use same interface as push (#41378) 2023-12-05 12:44:50 +01:00
Adam J. Stewart
ab50aa61db
py-keras: add v3.0.0 (#41356)
* py-keras: add v3.0.0

* Older keras actually requires protobuf

* Correct url_for_version

* Capitalization is important

* Keep pil and pydot deps
2023-12-01 18:23:58 +00:00
Tom Scogland
dd607d11d5
developer tools stack try 2 (#40921)
* developer tools stack try 2

This version is actually in use locally and has largely stabilized, at
least on x86.  Some packages are still a challenge on ppc64le, but maybe
worth keeping this working as a set.

* add packages, try to get container with newer gcc

* remove reuse: true

* try to get cmake to build on medium, 25 minutes is too long

* add lsd package and add to dev tools stack

* clean up fzf dependency and sorting

* Update share/spack/gitlab/cloud_pipelines/stacks/developer_tools/spack.yaml

* cuda: add 12.3.0 (#40827)

* Switch to dashes

* yet more underscores

---------

Co-authored-by: Paul R. C. Kent <kentpr@ornl.gov>
2023-11-30 18:32:21 +00:00
Luc Berger
450f938056
kokkos: add v4.2.00 (#41203)
* Kokkos: adding version 4.2.00 to the package
* Kokkos: adding AMD GPU arch
* kokkos@4.2.00 +sycl: patch numeric traits unit test

---------

Co-authored-by: eugeneswalker <eugenesunsetwalker@gmail.com>
Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
2023-11-29 22:47:15 +00:00
eugeneswalker
430b2dff5c
e4s ci: disable gpu test stack (#41296) 2023-11-28 18:02:00 +01:00
Alec Scott
18efd808da
GoPackage: add new build system for Go packages (#41164)
Co-authored-by: Tom Scogland <scogland1@llnl.gov>
Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2023-11-28 10:33:46 +01:00
Alec Scott
c482534c1d
CargoPackage: add new build system for Cargo packages (#41192)
Co-authored-by: Tom Scogland <scogland1@llnl.gov>
2023-11-27 20:15:16 +00:00
Andrey Perestoronin
3d744e7c95
intel-oneapi 2024.0.0: added new version to packages (#41135)
* oneapi 2024.0.0 release

* oneapi v2 directory support and some cleanups

* sycl abi change requires 2024 compilers for packages that use sycl

---------

Co-authored-by: Robert Cohn <robert.s.cohn@intel.com>
2023-11-27 13:13:04 -05:00
eugeneswalker
2870b6002c
e4s oneapi stack: turn on +sycl: ginkgo, heffte, petsc, upcxx, warpx (#41157)
* e4s oneapi stack: turn on +sycl: ginkgo, heffte, petsc, upcxx, warpx

* comment out warpx; build fails; add note
2023-11-18 22:21:20 -08:00
Massimiliano Culpo
2ac128a3ad
Add papyrus to the list of broken tests (#40923)
* Disable papyrus in the neoverse v1 pipeline
   See https://gitlab.spack.io/spack/spack/-/jobs/8983875
   The job is hanging on tests for 6 hrs.
* Add papyrus to broken tests instead of removing it
2023-11-14 07:37:29 -08:00
Greg Becker
13abfb7013
spack deconcretize command (#38803)
We have two ways to concretize now:
* `spack concretize` concretizes only the root specs that are not concrete in the environment.
* `spack concretize -f` eliminates all cached concretization data and reconcretizes the *entire* environment.

This PR adds `spack deconcretize`, which eliminates cached concretization data for a spec.  This allows
users greater control over what is preserved from their `spack.lock` file and what is reused when not
using `spack concretize -f`.  If you want to update a spec installed in your environment, you can call
`spack deconcretize` on it, and that spec and any relevant dependents will be removed from the lock file.

`spack concretize` has two options:
* `--root`: limits deconcretized specs to *specific* roots in the environment. You can use this to
  deconcretize exactly one root in a `unify: false` environment.  i.e., if `foo` root is a dependent
  of `bar`, both roots, `spack deconcretize bar` will *not* deconcretize `foo`.
* `--all`: deconcretize *all* specs that match the input spec. By default `spack deconcretize`
  will complain about multiple matches, like `spack uninstall`.
2023-11-10 14:55:35 -08:00
Todd Gamblin
f0ced1af42
info: rework spack info command to display variants better (#40998)
This changes variant display to use a much more legible format, and to use screen space
much better (particularly on narrow terminals). It also adds color the variant display
to match other parts of `spack info`.

Descriptions and variant value lists that were frequently squished into a tiny column
before now have closer to the full terminal width.

This change also preserves any whitespace formatting present in `package.py`, so package
maintainers can make easer-to-read descriptions of variant values if they want. For
example, `gasnet` has had a nice description of the `conduits` variant for a while, but
it was wrapped and made illegible by `spack info`. That is now fixed and the original
newlines are kept.

Conditional variants are grouped by their when clauses by default, but if you do not
like the grouping, you can display all the variants in order with `--variants-by-name`.
I'm not sure when people will prefer this, but it makes it easier to tell that a
particular variant is/isn't there. I do think grouping by `when` is the better default.
2023-11-10 12:31:28 +01:00
eugeneswalker
383ec19a0c
Revert "Deactivate Cray sles, due to unavailable runner (#40291)" (#40910)
This reverts commit 4b06862a7f.
2023-11-09 12:24:18 -08:00
Massimiliano Culpo
afc693645a
tcl: filter compiler wrappers to avoid pointing to Spack (#40946) 2023-11-08 19:38:41 +01:00
Greg Becker
0b344e0fd3
tutorial stack: update for changes to the basics section for SC23 (#40942) 2023-11-07 23:46:57 -08:00
Harmen Stoppels
c1f134e2a0
tutorial: use lmod@8.7.18 because @8.7.19: has bugs (#40939) 2023-11-07 23:04:45 +01:00
Harmen Stoppels
3a5c1eb5f3
tutorial pipeline: force gcc@12.3.0 (#40937) 2023-11-07 20:53:44 +01:00
Harmen Stoppels
4ce80b95f3
spack compiler find --[no]-mixed-toolchain (#40902)
Currently there's some hacky logic in the AppleClang compiler that makes
it also accept `gfortran` as a fortran compiler if `flang` is not found.

This is guarded by `if sys.platform` checks s.t. it only applies to
Darwin.

But on Linux the feature of detecting mixed toolchains is highly
requested too, cause it's rather annoying to run into a failed build of
`openblas` after dozens of minutes of compiling its dependencies, just
because clang doesn't have a fortran compiler.

In particular in CI where the system compilers may change during system
updates, it's typically impossible to fix compilers in a hand-written
compilers.yaml config file: the config will almost certainly be outdated
sooner or later, and maintaining one config file per target machine and
writing logic to select the correct config is rather undesirable too.

---

This PR introduces a flag `spack compiler find --mixed-toolchain` that
fills out missing `fc` and `f77` entries in `clang` / `apple-clang` by
picking the best matching `gcc`.

It is enabled by default on macOS, but not on Linux, matching current
behavior of `spack compiler find`.

The "best matching gcc" logic and compiler path updates are identical to
how compiler path dictionaries are currently flattened "horizontally"
(per compiler id). This just adds logic to do the same "vertically"
(across different compiler ids).

So, with this change on Ubuntu 22.04:

```
$ spack compiler find --mixed-toolchain
==> Added 6 new compilers to /home/harmen/.spack/linux/compilers.yaml
    gcc@13.1.0  gcc@12.3.0  gcc@11.4.0  gcc@10.5.0  clang@16.0.0  clang@15.0.7
==> Compilers are defined in the following files:
    /home/harmen/.spack/linux/compilers.yaml

```

you finally get:

```
compilers:
- compiler:
    spec: clang@=15.0.7
    paths:
      cc: /usr/bin/clang
      cxx: /usr/bin/clang++
      f77: /usr/bin/gfortran
      fc: /usr/bin/gfortran
    flags: {}
    operating_system: ubuntu23.04
    target: x86_64
    modules: []
    environment: {}
    extra_rpaths: []
- compiler:
    spec: clang@=16.0.0
    paths:
      cc: /usr/bin/clang-16
      cxx: /usr/bin/clang++-16
      f77: /usr/bin/gfortran
      fc: /usr/bin/gfortran
    flags: {}
    operating_system: ubuntu23.04
    target: x86_64
    modules: []
    environment: {}
    extra_rpaths: []
```

The "best gcc" is automatically default system gcc, since it has no
suffixes / prefixes.
2023-11-06 15:17:31 -08:00
Harmen Stoppels
3c641c8509
spack env activate: create & activate default environment without args (#40756)
This PR implements the concept of "default environment", which doesn't have to be
created explicitly. The aim is to lower the barrier for adopting environments.

To (create and) activate the default environment, run

```
$ spack env activate
```

This mimics the behavior of

```
$ cd
```

which brings you to your home directory.

This is not a breaking change, since `spack env activate` without arguments
currently errors. It is similar to the already existing `spack env activate --temp`
command which always creates an env in a temporary directory, the difference
is that the default environment is a managed / named environment named `default`.

The name `default` is not a reserved name, it's just that `spack env activate`
creates it for you if you don't have it already.

With this change, you can get started with environments faster:

```
$ spack env activate [--prompt]
$ spack install --add x y z
```

instead of

```
$ spack env create default
==> Created environment 'default in /Users/harmenstoppels/spack/var/spack/environments/default
==> You can activate this environment with:
==>   spack env activate default
$ spack env activate [--prompt] default 
$ spack install --add x y z
```

Notice that Spack supports switching (but not stacking) environments, so the
parallel with `cd` is pretty clear:

```
$ spack env activate named_env
$ spack env status
==> In environment named_env
$ spack env activate
$ spack env status
==> In environment default
```
2023-11-05 22:53:26 -08:00
Todd Gamblin
f6b23b4653
bugfix: compress aliases for first command in completion (#40890)
This completes to `spack concretize`:

```
spack conc<tab>
```

but this still gets hung up on the difference between `concretize` and `concretise`:

```
spack -e . conc<tab>
```

We were checking `"$COMP_CWORD" = 1`, which tracks the word on the command line
including any flags and their args, but we should track `"$COMP_CWORD_NO_FLAGS" = 1` to
figure out if the arg we're completing is the first real command.
2023-11-05 10:15:37 +00:00
Tamara Dahlgren
c9dfb9b0fd
Environments: Add support for including definitions files (#33960)
This PR adds support for including separate definitions from `spack.yaml`.

Supporting the inclusion of files with definitions enables user to make
curated/standardized collections of packages that can re-used by others.
2023-11-05 00:47:06 -07:00
Massimiliano Culpo
f51dad976e
hdf5-vol-async: better specify dependency condition (#40882) 2023-11-04 20:31:52 +01:00
eugeneswalker
fd22d109a6
sundials +sycl: add cxxflags=-fsycl via flag_handler (#40845) 2023-11-04 08:55:19 -05:00
eugeneswalker
d4a1618e07
tau: update 2.33 hash, add syscall variant (#40851)
Co-authored-by: wspear <wjspear@gmail.com>
2023-11-03 07:58:00 +01:00
Harmen Stoppels
8b0ab67de4
depfile: deal with empty / non-concrete env (#40816) 2023-11-02 16:04:35 +01:00
Harmen Stoppels
343ed8a3fa
force color in subshell if not SPACK_COLOR (#40782) 2023-10-31 22:27:00 +01:00
Harmen Stoppels
6933e1c3cb
ci: bump tutorial image and toolchain (#40795) 2023-10-31 12:58:33 +01:00
Harmen Stoppels
160bfd881d
tutorial: replace zlib -> gmake to avoid deprecated versions (#40769) 2023-10-31 10:04:53 +01:00
Harmen Stoppels
b1b8500eba
ci: print colored specs in concretization progress (#40711) 2023-10-30 15:29:27 +01:00
eugeneswalker
ed7274a4d0
e4s ci stacks: add exago specs (#40712)
* e4s ci: add exago +cuda, +rocm builds

* exago: rename 5-18-2022-snapshot to snapshot.5-18-2022

* disable exago +rocm for non-external rocm ci install

* note that hiop +rocm fails to find hip libraries when they are spack-installed
2023-10-27 11:15:11 -07:00
Harmen Stoppels
195f965076
OCI buildcache (#38358)
Credits to @ChristianKniep for advocating the idea of OCI image layers
being identical to spack buildcache tarballs.

With this you can configure an OCI registry as a buildcache:

```console 
$ spack mirror add my_registry oci://user/image # Dockerhub

$ spack mirror add my_registry oci://ghcr.io/haampie/spack-test # GHCR

$ spack mirror set --push --oci-username ... --oci-password ... my_registry  # set login credentials
```

which should result in this config:

```yaml
mirrors:
  my_registry:
    url: oci://ghcr.io/haampie/spack-test
    push:
      access_pair: [<username>, <password>]
```

It can be used like any other registry

```
spack buildcache push my_registry [specs...]
```

It will upload the Spack tarballs in parallel, as well as manifest + config
files s.t. the binaries are compatible with `docker pull` or `skopeo copy`.

In fact, a base image can be added to get a _runnable_ image:

```console
$ spack buildcache push --base-image ubuntu:23.04 my_registry python
Pushed ... as [image]:python-3.11.2-65txfcpqbmpawclvtasuog4yzmxwaoia.spack

$ docker run --rm -it [image]:python-3.11.2-65txfcpqbmpawclvtasuog4yzmxwaoia.spack
```

which should really be a game changer for sharing binaries.

Further, all content-addressable blobs that are downloaded and verified
will be cached in Spack's download cache. This should make repeated
`push` commands faster, as well as `push` followed by a separate
`update-index` command.

An end to end example of how to use this in Github Actions is here:

**https://github.com/haampie/spack-oci-buildcache-example**


TODO:

- [x] Generate environment modifications in config so PATH is set up
- [x] Enrich config with Spack's `spec` json (this is allowed in the OCI specification)
- [x] When ^ is done, add logic to create an index in say `<image>:index` by fetching all config files (using OCI distribution discovery API)
- [x] Add logic to use object storage in an OCI registry in `spack install`.
- [x] Make the user pick the base image for generated OCI images.
- [x] Update buildcache install logic to deal with absolute paths in tarballs
- [x] Merge with `spack buildcache` command
- [x] Merge #37441 (included here)
- [x] Merge #39077 (included here)
- [x] #39187 + #39285
- [x] #39341
- [x] Not a blocker: #35737 fixes correctness run env for the generated container images

NOTE:

1. `oci://` is unfortunately taken, so it's being abused in this PR to mean "oci type mirror". `skopeo` uses `docker://` which I'd like to avoid, given that classical docker v1 registries are not supported.
2. this is currently `https`-only, given that basic auth is used to login. I _could_ be convinced to allow http, but I'd prefer not to, given that for a `spack buildcache push` command multiple domains can be involved (auth server, source of base image, destination registry). Right now, no urllib http handler is added, so redirects to https and auth servers with http urls will simply result in a hard failure.

CAVEATS:

1. Signing is not implemented in this PR. `gpg --clearsign` is not the nicest solution, since (a) the spec.json is merged into the image config, which must be valid json, and (b) it would be better to sign the manifest (referencing both config/spec file and tarball) using more conventional image signing tools
2. `spack.binary_distribution.push` is not yet implemented for the OCI buildcache, only `spack buildcache push` is. This is because I'd like to always push images + deps to the registry, so that it's `docker pull`-able, whereas in `spack ci` we really wanna push an individual package without its deps to say `pr-xyz`, while its deps reside in some `develop` buildcache.
3. The `push -j ...` flag only works for OCI buildcache, not for others
2023-10-27 15:30:04 +02:00
Harmen Stoppels
51275df0b1
ci: spack compiler find should list extra config scopes (#40727)
otherwise it detected pre-configured compilers in an potentially different way.
2023-10-27 09:43:01 +02:00
Xavier Delaruelle
751b64cbcd
modules: no --delim option if separator is colon character (#39010)
Update Tcl modulefile template to simplify generated `append-path`,
`prepend-path` and `remove-path` commands and improve their readability.

If path element delimiter is colon character, do not set the `--delim`
option as it is the default delimiter value.
2023-10-26 15:55:49 +02:00
Harmen Stoppels
1c8073c21f
spack checksum: show long flags in usage output (#40407) 2023-10-26 14:48:35 +02:00
Harmen Stoppels
c0a4be156c
ci: don't put compilers in config (#40700)
* ci: don't register detectable compilers

Cause they go out of sync...

* remove intel compiler, it can be detected too

* Do not run spack compiler find since compilers are registered in concretize job already

* trilinos: work around +stokhos +cuda +superlu-dist bug due to EMPTY macro
2023-10-25 11:55:04 -07:00
Harmen Stoppels
0c30418732
ci: darwin aarch64 use apple-clang-15 tag (#40706) 2023-10-25 17:35:47 +02:00
Vicente Bolea
d0982115b3
Adios2: add kokkos variant (#40623)
* adios2: update variants and dependencies

* adios2: add kokkos rocm|cuda|sycl variant

* e4s oneapi ci stack: add adios2 +sycl

* e4s ci stack: add adios2 +rocm

* [@spackbot] updating style on behalf of vicentebolea

* Apply suggestions from code review

* adios2: fixed cuda variant

* update ecp-data-vis-sdk

* Update share/spack/gitlab/cloud_pipelines/stacks/e4s-power/spack.yaml

---------

Co-authored-by: eugeneswalker <eugenesunsetwalker@gmail.com>
Co-authored-by: vicentebolea <vicentebolea@users.noreply.github.com>
2023-10-23 13:01:57 -07:00
Harmen Stoppels
27a0425e5d
concretize separately: show concretization time per spec as they concretize when verbose (#40634) 2023-10-20 17:09:19 +02:00
Harmen Stoppels
4bade7ef96
gromacs +cp2k: build in CI (#40494)
* gromacs +cp2k: build in CI

* libxsmm: x86 only

* attempt to fix dbcsr + new mpich

* use c11 standard

* gromacs: does not depend on dbcsr

* cp2k: build with cmake in CI, s.t. dbcsr is a separate package

* cp2k: cmake patches for config files and C/C++ std

* cp2k: remove unnecessary constraints due to patch
2023-10-20 16:20:20 +02:00
Harmen Stoppels
72b36ac144
Improve setup build / run / test environment (#35737)
This adds a `SetupContext` class which is responsible for setting
package.py module globals, and computing the changes to environment
variables for the build, test or run context.

The class uses `effective_deptypes` which takes a list of specs (e.g. single
item of a spec to build, or a list of environment roots) and a context
(build, run, test), and outputs a flat list of specs that affect the
environment together with a flag in what way they do so. This list is
topologically ordered from root to leaf, so that one can be assured that
dependents override variables set by dependencies, not the other way
around.

This is used to replace the logic in `modifications_from_dependencies`,
which has several issues: missing calls to `setup_run_environment`, and
the order in which operations are applied.

Further, it should improve performance a bit in certain cases, since
`effective_deptypes` run in O(v + e) time, whereas `spack env activate`
currently can take up to O(v^2 + e) time due to loops over roots. Each
edge in the DAG is visited once by calling `effective_deptypes` with
`env.concrete_roots()`.

By marking and propagating flags through the DAG, this commit also fixes
a bug where Spack wouldn't call `setup_run_environment` for runtime
dependencies of link dependencies. And this PR ensures that Spack
correctly sets up the runtime environment of direct build dependencies.

Regarding test dependencies: in a build context they are are build-time
test deps, whereas in a test context they are install-time test deps.
Since there are no means to distinguish the build/install type test deps,
they're both.

Further changes:

- all `package.py` module globals are guaranteed to be set before any of the
  `setup_(dependent)_(run|build)_env` functions is called
- traversal order during setup: first the group of externals, then the group
  of non-externals, with specs in each group traversed topological (dependencies
  are setup before dependents)
- modules: only ever call `setup_dependent_run_environment` of *direct* link/run
   type deps
- the marker in `set_module_variables_for_package` is dropped, since we should
  call the method once per spec. This allows us to set only a cheap subset of
  globals on the module: for example it's not necessary to compute the expensive
  `cmake_args` and w/e if the spec under consideration is not the root node to be
  built.
- `spack load`'s `--only` is deprecated (it has no effect now), and `spack load x`
  now means: do everything that's required for `x` to work at runtime, which
  requires runtime deps to be setup -- just like `spack env activate`.
- `spack load` no longer loads build deps (of build deps) ...
- `spack env activate` on partially installed or broken environments: this is all
  or nothing now. If some spec errors during setup of its runtime env, you'll only
  get the unconditional variables + a warning that says the runtime changes for
  specs couldn't be applied.
- Remove traversal in upward direction from `setup_dependent_*` in packages.
  Upward traversal may iterate to specs that aren't children of the roots
  (e.g. zlib / python have hundreds of dependents, only a small fraction is
  reachable from the roots. Packages should only modify the direct dependent
  they receive as an argument)
2023-10-19 20:44:05 +02:00
Scott Wittenburg
46c1a8e4c6
gitlab ci: Rework how mirrors are configured (#39939)
Improve how mirrors are used in gitlab ci, where we have until now thought
of them as only a string.

By configuring ci mirrors ahead of time using the proposed mirror templates,
and by taking advantage of the expressiveness that spack now has for mirrors,
this PR will allow us to easily switch the protocol/url we use for fetching
binary dependencies.

This change also deprecates some gitlab functionality and marks it for
removal in Spack 0.23:

    - arguments to "spack ci generate":
        * --buildcache-destination
        * --copy-to
    - gitlab configuration options:
        * enable-artifacts-buildcache
        * temporary-storage-url-prefix
2023-10-19 11:04:59 -05:00
Harmen Stoppels
681639985a
ci: remove incorrect compilers.yaml (#40610) 2023-10-19 16:11:42 +02:00
Harmen Stoppels
294e659ae8
AutotoolsPackage / MakefilePackage: add gmake build dependency (#40380) 2023-10-18 19:56:54 +02:00
Harmen Stoppels
bd165ebc4d
Support spack env activate --with-view <name> <env> (#40549)
Currently `spack env activate --with-view` exists, but is a no-op.

So, it is not too much of a breaking change to make this redundant flag
accept a value `spack env activate --with-view <name>` which activates
a particular view by name.

The view name is stored in `SPACK_ENV_VIEW`.

This also fixes an issue where deactivating a view that was activated
with `--without-view` possibly removes entries from PATH, since now we
keep track of whether the default view was "enabled" or not.
2023-10-17 15:40:48 +02:00
Massimiliano Culpo
3935e047c6
Remove deprecated "extra_instructions" option for containers (#40365) 2023-10-12 12:12:15 +02:00
Massimiliano Culpo
861bb4d35a
Update bootstrap buildcache to support Python 3.12 (#40404)
* Add support for Python 3.12
* Use optimized build of clingo
2023-10-11 19:03:17 +02:00
eugeneswalker
37df8bfc73
e4s arm stack: duplicate and target neoverse v1 (#40369)
* e4s arm stack: duplicate and target both neoverse n1, v1

* remove neoverse_n1 target until issue #40397 is resolved
2023-10-10 14:32:51 -07:00
Alex Richert
7a358c9005
Change 'exit' to 'return' in setup-env.sh (#36137)
* Change 'exit' to 'return' in `setup-env.sh` to avoid losing shell in some cases when sourcing twice.
2023-10-06 16:19:19 -07:00
Massimiliano Culpo
e20c05fcdf
Make "minimal" the default duplicate strategy (#39621)
* Allow branching out of the "generic build" unification set

For cases like the one in https://github.com/spack/spack/pull/39661
we need to relax rules on unification sets.

The issue is that, right now, nodes in the "generic build" unification
set are unified together with their build dependencies. This was done
out of caution to avoid the risk of circular dependencies, which would
ultimately cause a very slow solve.

For build-tools like Cython, however, the build dependencies is masked
by a long chain of "build, run" dependencies that belong in the
"generic build" unification space.

To allow splitting on cases like this, we relax the rule disallowing
branching out of the "generic build" unification set.

* Fix issue with pure build virtual dependencies

Pure build virtual dependencies were not accounted properly in the
list of possible virtuals. This caused some facts connecting virtuals
to the corresponding providers to not be emitted, and in the end
lead to unsat problems.

* Fixed a few issues in packages

py-gevent: restore dependency on py-cython@3
jsoncpp: fix typo in build dependency
ecp-data-vis-sdk: update spack.yaml and cmake recipe
py-statsmodels: add v0.13.5

* Make dependency on "blt" of type "build"
2023-10-06 10:24:21 +02:00
eugeneswalker
e0e6ff5a68
Revert "cray rhel: disable due to runner issues (#40324)" (#40335)
This reverts commit bf7f54449b.
2023-10-05 10:32:52 -07:00
Harmen Stoppels
bf7f54449b
cray rhel: disable due to runner issues (#40324) 2023-10-05 08:45:33 +02:00
Scott Wittenburg
7bf6780de2
ci: pull E4S images from github instead of dockerhub (#40307) 2023-10-04 09:55:06 +02:00
eugeneswalker
91178d40f3
e4s arm: disable bricks due to target=aarch64 not being respected (#40308) 2023-10-04 09:51:14 +02:00
eugeneswalker
8746c75db0
e4s ci stacks: sync with e4s-23.08 (#40263)
* e4s amd64 gcc ci stack: sync with e4s-23.08

* e4s amd64 oneapi ci stack: sync with e4s-23.08

* e4s ppc64 gcc ci stack: sync with e4s-23.08

* add new ci stack: e4s amd64 gcc w/ external rocm

* add new ci stack: e4s arm gcc ci

* updates

* py-scipy: -fvisibility issue is resolved in 2023.1.0: #39464

* paraview oneapi fails

* comment out pkgs that fail to build on power

* fix arm stack name

* fix cabana +cuda specification

* comment out failing spces

* visit fails build on arm

* comment out slepc arm builds due to make issue

* comment out failing dealii arm builds
2023-10-03 08:12:51 -07:00
Massimiliano Culpo
4b06862a7f
Deactivate Cray sles, due to unavailable runner (#40291)
This reverts commit 0274091204.
2023-10-03 11:06:36 +02:00
G-Ragghianti
1b75651af6
Implemented +sycl for slate (#39927)
* Implemented +sycl for slate

* style

* style

* add slate +sycl to ci

* slate +sycl: explicitly specify +mpi

* comment out slate+sycl+mpi in e4s oneapi stack

* removing requirement of intel-oneapi-mpi

* Added slate+sycl to e4s oneapi stack

* Removing obsolete comment

---------

Co-authored-by: eugeneswalker <eugenesunsetwalker@gmail.com>
2023-10-02 07:35:00 -07:00
eugeneswalker
2d509dc3eb
py-scipy: -fvisibility issue is resolved in 2023.1.0: (#39464)
* py-scipy: -fvisibility issue is resolved in 2023.1.0:

* e4s oneapi ci: add py-scipy
2023-10-01 17:29:21 +00:00
eugeneswalker
68dbd25f5f
e4s cray sles ci: expand spec list (#40162)
* e4s cray sles stack: expand spec list

* remove unnecessary packages:trilinos:one_of
2023-09-30 21:32:33 -07:00