Compare commits

...

1071 Commits

Author SHA1 Message Date
eugeneswalker
80412b23ae tau: add v2.31 (#27342) 2021-11-11 09:53:44 -08:00
Dan Bonachea
e82c808f54 upcxx: Update the UPC++ package to 2021.9.0 (#26996)
* upcxx: Update the UPC++ package to 2021.9.0

* Add the new release, and a missing older one.

* Remove the spack package cruft for supporting the obsolete build system that
  was present in older versions that are no longer supported.

* General cleanups.

Support for library versions older than 2020.3.0 is officially retired,
for two reasons:

1. Releases prior to 2020.3.0 had a required dependency on Python 2,
   which is [officially EOL](https://www.python.org/doc/sunset-python-2/)
   as of Jan 1 2020, and is no longer considered secure.
2. (Most importantly) The UPC++ development team is unable/unwilling to
   support releases more than two years old.  UPC++ provides robust
   backwards-compatibility to earlier releases of UPC++ v1.0, with very
   rare well-documented/well-motivated exceptions.  Users are strongly
   encouraged to update to a current version of UPC++.

NOTE: Most of the lines changed in this commit are simply re-indentation,
and thus might be best reviewed in a diff that ignores whitespace.

* upcxx: Detect Cray XC more explicitly

This change is necessary to prevent false matches occuring on new Cray Shasta
systems, which do not use the aries network but were incorrectly being treated
as a Cray XC + aries platform.

UPC++ has not yet deployed official native support for Cray Shasta, but this
change is sufficient to allow building the portable backends there.
2021-11-11 09:53:39 -08:00
Todd Gamblin
285548588f Update CHANGELOG.md for 0.17.0 2021-11-05 17:22:32 -07:00
Todd Gamblin
0e3d0516e6 bump version number to 0.17.0 2021-11-05 17:11:37 -07:00
Ben Darwin
12429bda35 py-itk: fix dependencies (#27164) 2021-11-05 16:26:18 -05:00
Seth R. Johnson
c5be548046 New package: GNDS (#27176)
Adds a new package for the AMPX/SCALE implementation of the GNDS
interface,
https://www.oecd.org/publications/specifications-for-the-generalised-nuclear-database-structure-gnds-94d5e451-en.htm
.
2021-11-05 14:04:47 -06:00
Bernhard Kaindl
d9d1319442 qt: replace conflicts('%gcc@11:', when='@5.9:5.14') with -include limits (#27241)
Noting that missing numeric_limits was the cause of the compile issues
with gcc-11, I tested adding -include limits fixing @5.9:5.14%gcc@11.
Therefore, we can replace the conflicts('%gcc@11:', when='@5.9:5.14').

Co-authored-by: Bernhard Kaindl <bernhard.kaindl@ait.ac.at>
2021-11-05 14:06:31 -04:00
Theofilos Manitaras
549bd70449 py-mpi4py: Add newer versions (#27239)
* py-mpi4py: Add newer versions

* Address PR comments
2021-11-05 11:07:44 -06:00
Axel Huebl
4f692e4d9f openPMD-api: 0.14.3 (#27211)
Add the latest release.
2021-11-05 10:53:03 -06:00
Massimiliano Culpo
0feb5ec70a Prevent additional properties to be in the answer set when reusing specs (#27240)
* Prevent additional properties to be in the answer set when reusing specs

fixes #27237

The mechanism to reuse concrete specs relies on imposing
the set of constraints stemming from the concrete spec
being reused.

We also need to prevent that other constraints get added
to this set.
2021-11-05 10:52:44 -06:00
Peter Brady
178e15c39d ctags uses custom autogen.sh script (#27229) 2021-11-05 09:46:09 -07:00
Sinan
0b4b731479 package/py-zarr_add_v2.10.2 (#27212)
* package/py-zarr_add_v2.10.2

* improve python dep version constraints

Co-authored-by: sbulut <sbulut@3vgeomatics.com>
2021-11-05 09:23:41 -05:00
Bernhard Kaindl
91c7c24260 hdf5: Skip racy test cases(which loop endless on many cores) (#27068) 2021-11-05 09:59:45 -04:00
Seth R. Johnson
42d8e9eeb5 trilinos: explicitly use variants instead of spec for TPLs (#27221)
Fixes https://github.com/spack/spack/pull/27188#issuecomment-961212214
2021-11-05 09:07:33 -04:00
Manuela Kuhn
d2c26fef46 r-readr: add 2.0.2 (#27177) 2021-11-05 06:34:40 -06:00
Mikhail Titov
d7ae9414c2 exaworks: swift-t package (#27234) 2021-11-05 10:46:35 +01:00
Carlos Bederián
b06198f1d4 gmsh: add dependency on gl and glu providers when +fltk (#27169) 2021-11-05 10:45:53 +01:00
Harmen Stoppels
8bb5ed8464 make version docs reflect reality (#27149)
* make version docs reflect reality

* typo and make things

* 2.6 -> 2.7 in example
2021-11-05 09:39:31 +00:00
Massimiliano Culpo
e93a2db8b7 hpx: simplify instrumentation_args function (#27226) 2021-11-05 02:34:40 -06:00
Todd Gamblin
e13e697067 commands: spack load --list alias for spack find --loaded (#27184)
See #25249 and https://github.com/spack/spack/pull/27159#issuecomment-958163679.
This adds `spack load --list` as an alias for `spack find --loaded`.  The new command is
not as powerful as `spack find --loaded`, as you can't combine it with all the queries or
formats that `spack find` provides.  However, it is more intuitively located in the command
structure in that it appears in the output of `spack load --help`.

The idea here is that people can use `spack load --list`  for simple stuff but fall back to
`spack find --loaded` if they need more.

- add help to `spack load --list` that references `spack find`
- factor some parts of `spack find` out to be called from `spack load`
- add shell tests
- update docs

Co-authored-by: Peter Josef Scheibel <scheibel1@llnl.gov>
Co-authored-by: Richarda Butler <39577672+RikkiButler20@users.noreply.github.com>
2021-11-05 00:58:29 -07:00
Simon Frasch
bfbf9deb74 spfft: add version 1.0.5 (#27223) 2021-11-05 01:52:37 -06:00
Simon Frasch
6bae3cd6bb spla: add version 1.5.2 (#27222) 2021-11-05 08:45:34 +01:00
Todd Gamblin
8e76244266 docs for experimental --reuse argument to spack install
Add docs for `--reuse`, along with a warning that it will likely be
removed and refactored.
2021-11-05 00:15:47 -07:00
Gregory Becker
5efa76a033 error message for reusing multiple hashes for package 2021-11-05 00:15:47 -07:00
Todd Gamblin
ac1e05fe1b concretizer: add error messages and simplify asp.py 2021-11-05 00:15:47 -07:00
Massimiliano Culpo
0186f0f955 Fix logic program for multi-valued variants
Reformulate variant rules so that we minimize both

1. The number of non-default values being used
2. The number of default values not-being used

This is crucial for MV variants where we may have
more than one default value
2021-11-05 00:15:47 -07:00
Todd Gamblin
e0c3d074c0 bugfix: handle hashes that only exist in input specs
In our tests, we use concrete specs generated from mock packages,
which *only* occur as inputs to the solver. This fixes two problems:

1. We weren't previously adding facts to encode the necessary
   `depends_on()` relationships, and specs were unsatisfiable on
   reachability.

2. Our hash lookup for reconstructing the DAG does not
   consider that a hash may have come from the inputs.
2021-11-05 00:15:47 -07:00
Todd Gamblin
a4a2ed3c34 concretizer: exempt already-installed specs from compiler and variant rules
Concrete specs that are already installed or that come from a buildcache
may have compilers and variant settings that we do not recognize, but that
shouldn't prevent reuse (at least not until we have a more detailed compiler
model).

- [x] make sure compiler and variant consistency rules only apply to
      built specs
- [x] don't validate concrete specs on input, either -- they're concrete
      and we shouldn't apply today's rules to yesterday's build
2021-11-05 00:15:47 -07:00
Todd Gamblin
49ed41b028 spack diff: more flexible tests, restore transitive diff with spec_clauses
In switching to hash facts for concrete specs, we lost the transitive facts
from dependencies. This was fine for solves, because they were implied by
the imposed constraints from every hash. However, for `spack diff`, we want
to see what the hashes mean, so we need another mode for `spec_clauses()` to
show that.

This adds a `expand_hashes` argument to `spec_clauses()` that allows us to
output *both* the hashes and their implications on dependencies. We use
this mode in `spack diff`.
2021-11-05 00:15:47 -07:00
Massimiliano Culpo
3e3e84ba30 Add a missing definition in the logic program 2021-11-05 00:15:47 -07:00
Massimiliano Culpo
be2cf16b67 Add buildcache to reusable specs 2021-11-05 00:15:47 -07:00
Massimiliano Culpo
31dfad9c16 spack install: add --reuse argument 2021-11-05 00:15:47 -07:00
Massimiliano Culpo
e2744fafa1 spack concretize: add --reuse argument 2021-11-05 00:15:47 -07:00
Massimiliano Culpo
290f57c779 spack spec: add --reuse argument 2021-11-05 00:15:47 -07:00
Todd Gamblin
652fa663b5 concretizer: get rid of last maximize directive in concretize.lp
- [x] Get rid of forgotten maximize directive.
- [x] Simplify variant handling
- [x] Fix bug in treatment of defaults on externals (don't count
      non-default variants on externals against them)
2021-11-05 00:15:47 -07:00
Massimiliano Culpo
da57b8775f Update command completion 2021-11-05 00:15:47 -07:00
Massimiliano Culpo
0d74a4f46e Trim dependencies on externals 2021-11-05 00:15:47 -07:00
Massimiliano Culpo
0b80035eaa Fix a unit test to match the new OS semantics
CNL, debian6 and Suse are not compatible
2021-11-05 00:15:47 -07:00
Massimiliano Culpo
4d25fc0068 ASP-based solve: if an OS is set, respect the value 2021-11-05 00:15:47 -07:00
Massimiliano Culpo
6e297b9ba1 Fix a type in "variant_not_default" rule 2021-11-05 00:15:47 -07:00
Todd Gamblin
ace4586bf8 concretizer: rework spack solve output to handle reuse better 2021-11-05 00:15:47 -07:00
Todd Gamblin
c537785f6f spec: ensure_valid_variants() should not validate concrete specs
Variants in concrete specs are "always" correct -- or at least we assume
them to be b/c they were concretized before. Their variants need not match
the current version of the package.
2021-11-05 00:15:47 -07:00
Todd Gamblin
b60a95cd5d concretizer: unify handling of single- and multi-valued variants
Multi-valued variants previously maximized default values to handle
cases where the default contained two values, e.g.:

    variant("foo", default="bar,baz")

This is because previously we were minimizing non-default values, and
`foo=bar`, `foo=baz`, and `foo=bar,baz` all had the same score, as
none of them had any "non-default" values.

This commit changes the approach and considers a non-default value
to be either a value set to something not default *or* the absence
of a default value from the set value.  This allows multi- and
single-valued variants to be handled the same way, with the same
minimization criterion.  It alse means that the "best" value for every
optimization criterion is now zero, which allows us to make useful
assumptions about the optimization criteria.
2021-11-05 00:15:47 -07:00
Todd Gamblin
b88da9d73d concretizer: reuse installs, but assign default values for new builds
Minimizing builds is tricky. We want a minimizing criterion because
we want to reuse the avaialble installs, but we also want things that
have to be built to stick to *default preferences* from the package
and from the user. We therefore treat built specs differently and
apply a different set of optimization criteria to them. Spack's *first*
priority is to reuse what it can, but if it builds something, the built
specs will respect defaults and preferences.

This is implemented by bumping the priority of optimization criteria
for built specs -- so that they take precedence over the otherwise
topmost-priority criterion to reuse what is installed.

The scheme relies on all of our optimization criteria being minimizations.
That is, we need the case where all specs are reused to be better than
any built spec could be. Basically, if nothing is built, all the build
criteria are zero (the best possible) and the number of built packages
dominates. If something *has* to be built, it must be strictly worse
than full reuse, because:

  1. it increases the number of built specs
  2. it must have either zero or some positive number for all criteria

Our optimziation criteria effectively sum into two buckets at once to
accomplish this. We use a `build_priority()` number to shift the
priority of optimization criteria for built specs higher.
2021-11-05 00:15:47 -07:00
Todd Gamblin
cfb60ab9e1 tests: make spack diff test more lenient
The constraints in the `spack diff` test were very specific and assumed
a lot about the structure of what was being diffed. Relax them a bit to
make them more resilient to changes.
2021-11-05 00:15:47 -07:00
Todd Gamblin
9eb94be6dd concretizer: only minimize builds when --reuse is enabled.
Make the first minimization conditional on whether `--reuse` is enabled in the solve.
If `--reuse` is not enabled, there will be nothing in the set to minimize and the
objective function (for this criterion) will be 0 for every answer set.
2021-11-05 00:15:47 -07:00
Todd Gamblin
40b914503e concretizer: adjust integrity constraints to only apply to builds.
Many of the integrity constraints in the concretizer are there to restrict how solves are done, but
they ignore that past solves may have had different initial conditions. For example, for things
we're building, we want the allowed variants to be restricted to those currently in Spack packages,
but if we are reusing a concrete spec, we need to be flexible about names that may have existed in
old packages.

Similarly, restrictions around compatibility of OS's, compiler versions, compiler OS support, etc.
are really only about what is supported by the *current* set of compilers/build tools known to
Spack, not about what we may get from concrete specs.

- [x] restrict certain integrity constraints to only apply to packages that we need to build, and
      omit concrete specs from consideration.
2021-11-05 00:15:47 -07:00
Todd Gamblin
2c142f9dd4 concretizer: rework operating system semantics for installed packages
The OS logic in the concretizer is still the way it was in the first version.
Defaults are implemented in a fairly inflexible way using straight logic. Most
of the other sections have been reworked to leave these kinds of decisions to
optimization. This commit does that for OS's as well.

As with targets, we optimize for target matches. We also try to optimize for
OS matches between nodes. Additionally, this commit adds the notion of
"OS compatibility" where we allow for builds to depend on binaries for certain
other OS's. e.g, for macos, a bigsur build can depend on an already installed
(concrete) catalina build. One cool thing about this is that we can declare
additional compatible OS's later, e.g. CentOS and RHEL.
2021-11-05 00:15:47 -07:00
Todd Gamblin
9c70d51a4f concretizer: impose() for concrete specs should use body facts.
The concretizer doesn't get a say in whether constraints from
concrete specs are imposed, so use body facts for them.
2021-11-05 00:15:47 -07:00
Todd Gamblin
3866b3e7d3 include installed hashes in solve and optimize for reuse 2021-11-05 00:15:47 -07:00
Todd Gamblin
7abe4ab309 rename checked_spec_clauses() to spec_clauses() 2021-11-05 00:15:47 -07:00
Todd Gamblin
ad5d632eeb add --reuse option to spack solve 2021-11-05 00:15:47 -07:00
Sinan
288176326c new package: librttopo (#27182)
Co-authored-by: sbulut <sbulut@3vgeomatics.com>
Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
2021-11-04 21:01:42 -06:00
Alec Scott
82b45d112f [New Package] Add Restic v0.12.1 (#27208)
Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
2021-11-04 17:12:34 -07:00
Massimiliano Culpo
839057e98d Rename the temporary scope for bootstrap buildcache (#27231)
If we don't rename Spack will fail with:
```
ImportError: cannot bootstrap the "clingo" Python module from spec "clingo-bootstrap@spack+python %gcc target=x86_64" due to the following failures:
    'spack-install' raised ValueError: Invalid config scope: 'bootstrap'.  Must be one of odict_keys(['_builtin', 'defaults', 'defaults/cray', 'bootstrap/cray', 'disable_modules', 'overrides-0'])
    Please run `spack -d spec zlib` for more verbose error messages
```
in case bootstrapping from binaries fails and we are
falling back to bootstrapping from sources.
2021-11-04 16:17:00 -07:00
Ben Darwin
f2a42ac4c6 c3d: add new package (#27155) 2021-11-04 15:38:28 -07:00
Tamara Dahlgren
080f1872b8 Add the spack tutorial environment as a cloud pipeline stack (#27137) 2021-11-04 15:14:46 -07:00
Jerome Soumagne
c25a4ecfc2 libfabric: add 1.13.2 (#27202) 2021-11-04 15:04:40 -07:00
Massimiliano Culpo
79f754a968 Sort arguments lexicographically in command's help (#27196) 2021-11-04 12:41:58 -07:00
downloadico
084ce46107 exciting: add "oxygen" version, multiple fixes (#27217)
ensure that none of ^intel-mkl, ^intel-mpi, and ^mkl are used, unless
the compiler is intel.
Fix bad logic in the src/src_xs/m_makespectrum.f90 file in the oxygen version.
Add the -fallow-argument-mismatch for gcc >= 10.
2021-11-04 12:24:27 -07:00
Cameron Smith
7542d8adc8 omega-h: add support for stand-alone testing (#26931)
Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
2021-11-04 12:02:02 -07:00
Joe Schoonover
4cc2adcbc3 Add new versions for HOHQMesh and switch to tar-ball releases (#27194)
Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
2021-11-04 11:54:02 -07:00
Jon Rood
ed3d459a83 Add RelWithDebInfo to protobuf build_type list. (#27220) 2021-11-04 10:16:44 -07:00
Andre Merzky
f6ed8b6150 Feature/exaworks spack (#27216)
* add exaworks spack meta package

* add maintainer

* switch to `BundlePackage`

* flake8

* another flake8 fix

* remove incorrect dependency
2021-11-04 06:07:45 -06:00
Massimiliano Culpo
1dcabdbc8d mfem, hpx: fix recipes after conditional variants (#27215) 2021-11-04 03:52:38 -06:00
Seth R. Johnson
503576c017 kokkos: refactor defines to use helper functions (#27189) 2021-11-04 09:31:29 +01:00
Erik Schnetter
6a7b07c60b ssht: New version 1.5.1 (#27173) 2021-11-03 22:10:56 -06:00
Cameron Stanavige
7102e295b9 scr: 3.0rc2 release, variants and deps updates (#27178)
* scr: 3.0rc2 release, variants and deps updates

This adds 3.0rc2 release for end users to aid in testing scr for
upcoming 3.0 release.

Included in this change:
- Require most recent component versions for this release
- Add a variant for PDSH as it is now an optional dependency with
this release
- Add bbapi and datawarp (dw) variants
- bbapi_fallback variant now requires bbapi variant with latest
release
- Add variants to enable/disable examples and tests
- Add shared variant and current conflicts with ~shared
- Update cmake_args to account for added variants where needed

Additional updates:
- Add maintainers
- Use lists and for loops to clean up repetitive code involving all
components
- Use self.define and self.define_from_variant to clean up cmake_args
- Use consistent quoting throughout package

* Un-deprecate v2 and legacy

* Use new conditional variants
2021-11-03 20:06:02 -07:00
Erik Schnetter
b9cdaa5429 simulationio package: add variants asdf, hdf5, rnpl, silo (#27172)
Define new variants asdf, hdf5, rnpl, silo to allow disabling or
enabling dependencies.
2021-11-03 18:07:35 -07:00
Erik Schnetter
0d30799bef hwloc: New version 2.6.0 (#27170) 2021-11-03 15:45:38 -07:00
Erik Schnetter
4045ab45de mpitrampoline: New version 2.2.0 (#27171) 2021-11-03 15:42:14 -07:00
Erik Schnetter
91a6e38404 shtools: disable libtool, add 4.9.1, fix --test=root (#27014)
The Makefile expects the "other" libtool, not the GNU libtool we have in Spack.
Closes https://github.com/spack/spack/issues/26993
Co-authored-by: Bernhard Kaindl <bernhardkaindl7@gmail.com>
2021-11-03 23:33:52 +01:00
Thomas Helfer
c0a81399bf tfel and mgis: add new versions and fix tests (#27011)
Co-authored-by: Bernhard Kaindl <bernhardkaindl7@gmail.com>
2021-11-03 23:24:28 +01:00
Andrew W Elble
7b3e02471b new package: telegraf (#27201) 2021-11-03 15:00:33 -07:00
David Boehme
47babb2518 Add Caliper v2.7.0 (#27197) 2021-11-03 13:22:43 -06:00
Seth R. Johnson
12a0738030 trilinos: mark conflicts in @:13.1+tpetra^cuda@11 (#27188)
* trilinos: fix @13.0.1+tpetra^cuda@11
* Mark CUDA conflict with old versions and always define TPL
* trilinos: patch doesn't build so just mark as conflict
2021-11-03 12:38:03 -06:00
Axel Huebl
e5a9beed28 WarpX: 21.11 (#27158)
Update `warpx` & `py-warpx` to the latest release, `21.11`.
2021-11-03 11:18:23 -07:00
Kyle Gerheiser
25f1aad1c8 nemsio package: add version 2.5.4; add option to build without MPI (#27030)
Version 2.5.4 adds an option which allows Nemsio to be built without MPI
2021-11-03 10:18:17 -07:00
Manuela Kuhn
09eb79b571 r-reprex: add 2.0.1 (#27174) 2021-11-03 12:05:28 -05:00
Satish Balay
346f3652c6 petsc, py-petsc4py: add versions 3.16.1 (#27152) 2021-11-03 10:52:35 -05:00
Manuela Kuhn
78b1512966 py-datalad: add 0.15.3 (#27193) 2021-11-03 09:49:46 -06:00
iarspider
dede8c9d6b New version: py-jupyterlab-pygments 0.1.2 (#27186) 2021-11-03 10:27:55 -05:00
Manuela Kuhn
8e4d5a0922 sip: fix python_include_dir (#26953) 2021-11-03 10:27:04 -05:00
Manuela Kuhn
5c13c5892b py-nibetaseries: add new package (#27187) 2021-11-03 10:26:30 -05:00
Greg Becker
67cd92e6a3 Allow conditional variants (#24858)
A common question from users has been how to model variants 
that are new in new versions of a package, or variants that are 
dependent on other variants. Our stock answer so far has been
an unsatisfying combination of "just have it do nothing in the old
version" and "tell Spack it conflicts".

This PR enables conditional variants, on any spec condition. The 
syntax is straightforward, and matches that of previous features.
2021-11-03 08:11:31 +01:00
Massimiliano Culpo
78c08fccd5 Bootstrap GnuPG (#24003)
* GnuPG: allow bootstrapping from buildcache and sources

* Add a test to bootstrap GnuPG from binaries

* Disable bootstrapping in tests

* Add e2e test to bootstrap GnuPG from sources on Ubuntu

* Add e2e test to bootstrap GnuPG on macOS
2021-11-02 23:15:24 -07:00
Richarda Butler
1a3747b2b3 Update docs how to display loaded modules (#27159)
* Update spack load docs
2021-11-02 22:12:08 -07:00
dependabot[bot]
a382a6c0e2 build(deps): bump actions/checkout from 2.3.5 to 2.4.0 (#27179)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2.3.5 to 2.4.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](1e204e9a92...ec3a7ce113)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-03 02:52:28 +00:00
Manuela Kuhn
61ded65888 r-dtplyr: add new package (#27112) 2021-11-03 00:24:21 +00:00
Dan Lipsa
f1fb816d93 Add build editions for catalyst builds. (#22676)
* Add build editions for catalyst builds.

* Fix style.

* Build edition works only for 5.8:
2021-11-02 17:36:53 -04:00
kwryankrattiger
f1afd5ff27 Add and propagate CUDA variants for DAV SDK (#26476) 2021-11-02 17:31:50 -04:00
Satish Balay
c9f8dd93f3 trilinos: new version 13.2.0 (#27106)
* trilinos: add @13.2.0, and switch default to cxxstd=14

* trilinos: fix python dependency when using +ifpack or +ifpack2

* trilinos: add conflict for ~epetra +ml when @13.2.0:

* trilinos: keep 13.0.1 as the preferred version

* Update var/spack/repos/builtin/packages/trilinos/package.py

Co-authored-by: Seth R. Johnson <johnsonsr@ornl.gov>

* update

Co-authored-by: Seth R. Johnson <johnsonsr@ornl.gov>
2021-11-02 13:07:42 -06:00
Greg Becker
b3711c0d9d Improved error messages from clingo (#26719)
This PR adds error message sentinels to the clingo solve, attached to each of the rules that could fail a solve. The unsat core is then restricted to these messages, which makes the minimization problem tractable. Errors that can only be generated by a bug in the logic program or generating code are prefaced with "Internal error" to make clear to users that something has gone wrong on the Spack side of things.

* minimize unsat cores manually

* only errors messages are choices/assumptions for performance

* pre-check for unreachable nodes

* update tests for new error message

* make clingo concretization errors show up in cdash reports fully

* clingo: make import of clingo.ast parsing routines robust to clingo version

Older `clingo` has `parse_string`; newer `clingo` has `parse_files`.  Make the
code work wtih both.

* make AST access functions backward-compatible with clingo 5.4.0

Clingo AST API has changed since 5.4.0; make some functions to help us
handle both versions of the AST.

Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
2021-11-02 10:55:50 -07:00
Manuela Kuhn
3187689862 r-googlesheets4: add new package (#27114) 2021-11-02 11:46:48 -06:00
Manuela Kuhn
00b6927c65 r-dbplyr: add 2.1.1 (#27111) 2021-11-02 17:35:56 +00:00
Manuela Kuhn
9dc790bbe2 r-haven: add 2.4.3 (#27115) 2021-11-02 17:07:55 +00:00
Manuela Kuhn
ae76692c2e r-lubridate: add 1.8.0 (#27117) 2021-11-02 16:55:27 +00:00
iarspider
fa63bebf36 New versions of py-jupyter-server; fix tests (#27153)
* New versions of py-jupyter-server; fix tests

* Update package.py
2021-11-02 10:37:53 -06:00
Tom Payerle
eee4522103 trilinos: Additional fix for linking C code when built with PyTrilinos (#19834)
This removes `-lpytrilinos` from Makefile.export.Trilinos so that C code
trying to link against a Trilinos built with PyTrilinos does not fail
due to undefined references to python routines (libpytrilinos is only
used when importing PyTrilinos in python, in which case those references
are already defined by Python).

There was already a bit of code to do something similar for C codes
importing Trilinos via a CMake mechanism, this extends that to a basic
Makefile mechanism as well.  This patch also updates the comments to
remove a stale link discussing this issue, and replacing with links to
the some Trilinos issue reports related to the matter.
2021-11-02 12:31:10 -04:00
Manuela Kuhn
b8a44870a4 r-vroom: add new package (#27118) 2021-11-02 11:28:43 -05:00
Manuela Kuhn
426033bc5b r-brms: add 2.16.1 (#27148) 2021-11-02 11:21:54 -05:00
Manuela Kuhn
c2a7f8c608 r-rvest: add 1.0.2 (#27147) 2021-11-02 11:21:09 -05:00
Manuela Kuhn
429a60c703 r-callr: add 3.7.0 (#27146) 2021-11-02 11:19:09 -05:00
Manuela Kuhn
23f8a7331e r-forcats: add 0.5.1 (#27113) 2021-11-02 11:17:22 -05:00
Manuela Kuhn
6e2de9e41f r-processx-3.5.2 (#27119) 2021-11-02 11:13:13 -05:00
Seth R. Johnson
9cfecec002 relocate: do not change library id to use rpaths on package install (#27139)
After #26608 I got a report about missing rpaths when building a
downstream package independently using a spack-installed toolchain
(@tmdelellis). This occurred because the spack-installed libraries were
being linked into the downstream app, but the rpaths were not being
manually added. Prior to #26608 autotools-installed libs would retain
their hard-coded path and would thus propagate their link information
into the downstream library on mac.

We could solve this problem *if* the mac linker (ld) respected
`LD_RUN_PATH` like it does on GNU systems, i.e. adding `rpath` entries
to each item in the environment variable. However on mac we would have
to manually add rpaths either using spack's compiler wrapper scripts or
manually (e.g. using `CMAKE_BUILD_RPATH` and pointing to the libraries of
all the autotools-installed spack libraries).

The easier and safer thing to do for now is to simply stop changing the
dylib IDs.
2021-11-02 17:04:29 +01:00
Manuela Kuhn
34b2742817 r-hms: add 1.1.1 (#27116) 2021-11-02 11:03:52 -05:00
Manuela Kuhn
9d124bdac6 r-crayon: add 1.4.1 (#27110) 2021-11-02 10:49:56 -05:00
Manuela Kuhn
507f7a94d9 r-broom: add 0.7.9 and 0.7.10 (#27109) 2021-11-02 10:48:32 -05:00
Sinan
5fdf6e5f68 package/qgis_revert_incorrect_constraint (#27140)
* package/qgis_revert_incorrect_constraint

* fix bug

* also update dependency constraints

* also update python version constraints

Co-authored-by: sbulut <sbulut@3vgeomatics.com>
2021-11-02 10:43:29 -05:00
iarspider
669954a71d New version: py-isort 5.9.3 (#27144) 2021-11-02 10:42:34 -05:00
iarspider
6f44bf01e0 New version: py-jupyter-console 6.4.0; download sources from pip (#27150) 2021-11-02 10:37:37 -05:00
Joseph Wang
372fc78e98 yoda: add zlib as a dependency (#26454)
Co-authored-by: Bernhard Kaindl <43588962+bernhardkaindl@users.noreply.github.com>
Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2021-11-02 12:37:23 +01:00
Cameron Smith
ca30940868 pumi: support build/install time and stand-alone testing (#26832) 2021-11-02 12:18:46 +01:00
Bernhard Kaindl
5a4d03060b gtk packages: fix dependencies (#26960)
gconf depends on gettext and libintl (dep: intltool)
glibmm, gtkmm, libcanberra and cups need pkgconfig
glibmm needs libsigc++ < 2.9x(which are 3.x pre-releases)
libsigc++@:2.9 depends on m4 for the build

Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2021-11-02 10:39:25 +00:00
Chien-Chang Feng
bf411c7c55 pgplot: add intel compiler support and add more driver (#26761) 2021-11-02 11:30:28 +01:00
Massimiliano Culpo
3f3048e157 Fix GitHub Action's container build (#27143)
#26538 introduced a typo that causes the Docker image
build to fail.
2021-11-02 04:02:04 -06:00
Jean Luca Bez
85bdf4f74e h5bench: update maintainers and versions (#27083) 2021-11-02 10:52:36 +01:00
Glenn Johnson
cf50905ee9 modifications to docbook-xml (#27131)
- added more versions in case packages request a specific version of
  docbook-xml
- added a "current" alias to handle when packages use that
2021-11-02 10:50:07 +01:00
Glenn Johnson
f972863712 fsl: new version, updated constraints and patches (#27129)
- add version 6.0.5
- add patch to allow fsl to use newer gcc versions
- add patch to allow fsl to use newer cuda versions
- remove constraints on gcc and cuda versions
- add filters to prevent using system headers and libraries
- clean up the installed tree
2021-11-02 10:49:22 +01:00
Michael Kuhn
1e26e25bc8 spack arch: add --generic argument (#27061)
The `--generic` argument allows printing the best generic target for the
current machine. This can be quite handy when wanting to find the
generic architecture to use when building a shared software stack for
multiple machines.
2021-11-02 10:19:23 +01:00
Tamara Dahlgren
9d3d7c68fb Add tag filters to spack test list (#26842) 2021-11-02 10:00:21 +01:00
dependabot[bot]
94e0bf0112 build(deps): bump actions/checkout from 2.3.4 to 2.3.5 (#27135)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2.3.4 to 2.3.5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](5a4ac9002d...1e204e9a92)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-02 08:55:28 +01:00
iarspider
80807e6dd4 Add missing dependency to py-setuptools-scm (#27132) 2021-11-01 20:04:43 -06:00
Weiqun Zhang
840c9b7b4a amrex: add new release 21.11 (#27126) 2021-11-02 02:49:03 +01:00
Vicente Bolea
6a5ea3db99 vtkm: add v1.7.0-rc1 (#26882) 2021-11-02 02:42:10 +01:00
Manuela Kuhn
78a073218f r-tzdb: add new package (#27105) 2021-11-01 17:10:13 -05:00
Manuela Kuhn
881b2dcf05 r-rcpp: add 1.0.7 (#27088) 2021-11-01 17:09:18 -05:00
eugeneswalker
8bc01ff63c py-pylint needs pip for build (#27123)
* py-pylint: needs py-pip for build

* alphabetize py- dependencies

* add comment pointing to issue

* fix style
2021-11-01 21:50:36 +00:00
Andre Merzky
e0a929ba60 New package: exaworks (#27054) 2021-11-01 14:15:41 -07:00
Tamara Dahlgren
d4cecd9ab2 feature: add "spack tags" command (#26136)
This PR adds a "spack tags" command to output package tags or 
(available) packages with those tags. It also ensures each package
is listed in the tag cache ONLY ONCE per tag.
2021-11-01 20:40:29 +00:00
Chuck Atkins
b56f464c29 GCC 11 fixes (#27122)
* adios2: Fix compile errors for gcc 11

* unifyfs: Suppress bogus warnings for gcc 11

* conduit: Fix compile errors for gcc 11
2021-11-01 14:31:39 -06:00
Harmen Stoppels
6845307384 Pin actions to a commit sha instead of tag (#26538) 2021-11-01 10:44:03 -07:00
Bernhard Kaindl
02aa1d5d48 intel-gpu-tools: add v1.20 (#26588)
Add version 1.20, fix including the glib-2.0 header files
and add missing dependencies: libunwind and kmod.
2021-11-01 17:35:14 +01:00
Bernhard Kaindl
8ca411c749 glib: skip tests which we cannot make pass (#26693)
glib has a few tests which have external dependencies or
try to access the X server. We cannot run those.

Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2021-11-01 17:33:35 +01:00
Jon Rood
888de27210 kokkos-nvcc-wrapper: add HPE MPT to MPI environment variables (#27069) 2021-11-01 17:31:33 +01:00
Chuck Atkins
15d407c674 ci: Enable more packages in the DVSDK CI pipeline (#27025)
* ci: Enable more packages in the DVSDK CI pipeline

* doxygen: Add conflicts for gcc bugs

* dray: Add version constraints for api breakage with newer deps
2021-11-01 08:54:50 -07:00
Satish Balay
a1eb5596ec kokkos-kernels: add variant 'shared' (#27097)
* kokkos-kernels: add variant 'shared'

* Update var/spack/repos/builtin/packages/kokkos-kernels/package.py
2021-11-01 11:45:26 -04:00
iarspider
6c4f891b8f New version: py-typing-extensions 3.10.0.2 (#27120) 2021-11-01 10:04:18 -05:00
iarspider
99ee9a826a New version: py-beautifulsoup4 4.10.0 (#27121) 2021-11-01 10:02:57 -05:00
iarspider
8dcbd2ee6f alpgen: fix cms recipe (#26812) 2021-11-01 15:13:25 +01:00
Mahendra Paipuri
be0df5c47a ucx:add rocm variant (#26992)
Co-authored-by: mahendrapaipuri <mahendra.paipuri@inria.fr>
2021-11-01 15:05:56 +01:00
Ben Boeckel
80ba7040f8 python: detect Python from custom Xcode installations (#27023) 2021-11-01 07:55:15 -05:00
Hans Pabst
9094d6bb68 Updated LIBXSMM. (#27108) 2021-11-01 04:34:52 -06:00
Kenny Shen
3253faf01e cpp-argparse: new package (#27107) 2021-11-01 10:54:25 +01:00
Massimiliano Culpo
d73b1b9742 Fix caching of spack.repo.all_package_names() (#26991)
fixes #24522
2021-11-01 02:16:30 -06:00
Manuela Kuhn
b87678c2dd r-tidyr: add 1.1.4 (#27099) 2021-10-31 21:44:33 -05:00
Manuela Kuhn
8b8e7bd8e9 r-cpp11: add 0.4.0 (#27103) 2021-10-31 21:42:52 -05:00
Manuela Kuhn
200a1079d3 r-curl: add 4.3.2 (#27102) 2021-10-31 21:42:25 -05:00
Manuela Kuhn
3cd8381eb2 r-tidyselect: add 1.1.1 (#27101) 2021-10-31 21:41:16 -05:00
Manuela Kuhn
6b76b76d26 r-data-table: add 1.14.2 (#27100) 2021-10-31 21:40:36 -05:00
Manuela Kuhn
3406e8e632 r-dplyr: add 1.0.7 (#27098) 2021-10-31 21:40:07 -05:00
Manuela Kuhn
f363864f7f r-posterior: add new package (#27093) 2021-10-31 21:39:04 -05:00
Manuela Kuhn
543e5480a1 r-googledrive: add new package (#27095) 2021-10-31 21:37:26 -05:00
Manuela Kuhn
f8be56c941 r-withr: add 2.4.2 (#27094) 2021-10-31 21:35:41 -05:00
Manuela Kuhn
b6f6bbe371 r-nlme: add 3.1-153 (#27092) 2021-10-31 21:34:11 -05:00
Manuela Kuhn
ec8dc1830b r-bayesplot-1.8.1 (#27091) 2021-10-31 21:31:29 -05:00
Manuela Kuhn
86d2ab5240 r-mgcv: add 1.8-38 (#27090) 2021-10-31 21:30:34 -05:00
Manuela Kuhn
885e4d50e8 r-matrix: add 1.3-4 (#27089) 2021-10-31 21:29:54 -05:00
Manuela Kuhn
9397ca0a9f r-tibble: add 3.1.5 (#27087) 2021-10-31 21:25:19 -05:00
Manuela Kuhn
2b3207073d r-matrixstats: add 0.61.0 (#27086) 2021-10-31 21:23:10 -05:00
Manuela Kuhn
75a6d50fdc r-ids: add new package (#27104) 2021-10-31 21:21:54 -05:00
Bernhard Kaindl
6344d163b3 qt: @5.8:5.14.2 don't build with gcc@11, fix build of 5.6.3 (#27072)
5.14.2 fails with %gcc@11 with Error: 'numeric_limits' is not a class template
5.8.0 has multiple compile failures as well: Extend the conflict to those too.
- Fix also the confgigure of @5.6.3 (tested with %gcc@11)
2021-10-31 21:22:15 -04:00
Sinan
6c1f952bda package/qgis: fix runtime issue, improve package file, add new versions (#27084)
* package/qgis: fix runtime issue, improve package file, add new versions

* replace conflict with depends_on

* tidy up

Co-authored-by: sbulut <sbulut@3vgeomatics.com>
2021-10-31 18:24:44 -05:00
iarspider
f45ef21e37 New versions of py-gitpython: 3.1.13 - 3.1.24 (#27052)
* New versions of py-gitpython

* Update package.py
2021-10-30 11:19:51 -05:00
iarspider
30573f5e5c New versions: py-gitdb 4.0.7, 4.0.8, 4.0.9 (#27051)
* New versions: py-gitdb 4.0.7, 4.0.8, 4.0.9

* Update var/spack/repos/builtin/packages/py-gitdb/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Update package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-10-30 11:19:22 -05:00
iarspider
4262a66f5e New versions of py-google-auth and py-google-auth-oauthlib (#27056)
* New versions of py-google-auth and py-google-auth-oauthlib

* Update var/spack/repos/builtin/packages/py-google-auth/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-10-30 11:18:48 -05:00
iarspider
bdfb281a35 New version: py-deprecation 2.1.0 (#27001)
* New version: py-deprecation 2.1.0

* Update package.py
2021-10-30 07:25:31 -06:00
iarspider
0ef0a27ea0 New version: py-html5lib 1.1 (#27059)
* New verion: py-html5lib 1.1

* Update var/spack/repos/builtin/packages/py-html5lib/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Update var/spack/repos/builtin/packages/py-html5lib/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Update package.py

* Update package.py

* Update package.py

* Update package.py

* Update var/spack/repos/builtin/packages/py-html5lib/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Update var/spack/repos/builtin/packages/py-html5lib/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-10-30 06:10:32 -06:00
Glenn Johnson
15e5508fcf r-vctrs: Fix checksums after setting url to CRAN (#27080)
This package had its url set to a github url and was then changed to a
CRAN url. The checksums need to change as a result.
2021-10-30 09:51:20 +02:00
Vasileios Karakasis
b1c4c1b6ca Add more ReFrame versions (#27082) 2021-10-30 09:17:30 +02:00
Jon Rood
c19a4e12c7 trilinos: Avoid Intel compiler segfaults in Trilinos with STK (#27073) 2021-10-29 22:03:46 -04:00
Kyle Gerheiser
c19514e540 w3emc package: add versions 2.9.2 and 2.7.3 (#27031) 2021-10-29 16:39:45 -07:00
Manuela Kuhn
657b9204ca New package: r-distributional (#27048) 2021-10-29 16:37:59 -07:00
Adam J. Stewart
1aaa7bd089 GDAL package: add version 3.3.3 (#27071) 2021-10-29 16:21:28 -07:00
iarspider
9448864c0e New versions: ipython 7.27.0 and 7.28.0 (#27066)
* New versions: ipython 7.27.0 and 7.28.0

* Changes from MR (1/2)

* Fix dep name (2/2)
2021-10-29 17:13:44 -06:00
Scott Wittenburg
f2a36bdf14 pipelines: llvm kills the xlarge, use huge (#27079) 2021-10-29 22:01:35 +00:00
Peter Scheibel
7eddf3ae9b For Spack commands that fail but don't throw exceptions, we were discarding the return code (#27077) 2021-10-29 14:14:41 -07:00
iarspider
b9e63c9f42 New version: py-importlib-resources 5.3.0 (#27064)
* New version: py-importlib-resources 5.3.0

* Update var/spack/repos/builtin/packages/py-importlib-resources/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-10-29 15:07:59 -06:00
Jen Herting
c38d3044fa New package: py-pypulse (#27026)
* python package py-pypulse created - per Andy

* URL fixed

* [py-pypulse]

- removed duplicate dependency
- updated copyright

* [py-pypulse] added version 0.1.1

* [py-pypulse] depends on setuptools

* [py-pypulse] url -> pypi

* [py-pypulse] simplified python dependency

Co-authored-by: Alex C Leute <aclrc@sporcsubmit.rc.rit.edu>
2021-10-29 14:58:58 -06:00
iarspider
ec23ce4176 New version: py-immutables 0.16 (#27060)
* New version: py-immutables 0.16

* Changes from review
2021-10-29 14:53:12 -06:00
Bernhard Kaindl
9a1626e54a py-slurm-pipeline: Add 4.0.4, Fix base.py: import six for @:3 (#26968)
* py-slurm-pipeline: Add 4.0.4, Fix base.py: import six for @:3

Before 4.0.0, slurm_pipeline/base.py has: `from six import string_types`

* Added depends_on('py-pytest@6.2.2:', type='build') as requested by Adam

* remove comment requested to be removed
2021-10-29 14:52:57 -06:00
Jon Rood
91408ef6ad trilinos: add MPICH and HPE MPT MPI environment variables (#27070) 2021-10-29 14:05:10 -06:00
genric
749640faf9 py-ipyparallel: add 7.1.0 (#26984) 2021-10-29 14:10:36 -05:00
Simon Pintarelli
494ba67704 sirius: add mpi datatypes patch for recent cray mpich (#27065) 2021-10-29 12:31:56 -06:00
Baptiste Jonglez
b8bc030a3c py-torch: Add a breakpad variant, disable it for ppc64 and ppc64le (#26990) 2021-10-29 13:00:48 -05:00
Massimiliano Culpo
3eb52b48b8 config add: infer type based on JSON schema validation errors (#27035)
- [x] Allow dding enumerated types and types whose default value is forbidden by the schema
- [x] Add a test for using enumerated types in the tests for `spack config add`
- [x] Make `config add` tests use the `mutable_config` fixture so they do not
      affect other tests

Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
2021-10-29 18:44:49 +02:00
Manuela Kuhn
20b7485cd4 r-cli: add 3.0.1 (#27047) 2021-10-29 10:57:14 -05:00
Manuela Kuhn
d36b045e2d r-afex: add 1.0-1 (#27032) 2021-10-29 10:55:46 -05:00
Thomas Madlener
874f06e29c curl: fix mbedtls versions and certs config (#26877)
Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2021-10-29 08:55:48 -06:00
Jon Rood
962d06441e m4: set times of m4.texi to fix build on Summit GPFS (#26994)
Co-authored-by: Bernhard Kaindl <bernhardkaindl7@gmail.com>
2021-10-29 16:05:41 +02:00
Bernhard Kaindl
fd10e54409 libssh2: skip the testsuite when docker is not installed (#26962)
The build-time testsuite which would be run when building
with tests needs docker. Check that it exists before
attempting to execute the tests.

Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2021-10-29 07:04:40 -06:00
Harmen Stoppels
49034abd76 Fix exit codes posix shell wrapper (#27012)
* Correct exit code in sh wrapper

* Fix tests

* SC2069
2021-10-29 08:10:22 +00:00
Harmen Stoppels
f610b506cd elfio: add minimum version requirements to cmake (#27033) 2021-10-29 09:28:19 +02:00
Axel Huebl
5a7496eb82 WarpX & HiPACE++: Constrain FFTW for No-MPI (#27043)
Contrain FFTW for no-MPI to simplify builds and logic to handle.
2021-10-29 09:19:23 +02:00
Valentin Churavy
7a6a232730 add Julia 1.7.0-rc2 (#27016) 2021-10-29 08:24:38 +02:00
Manuela Kuhn
4031ea5e03 r-gargle: add new (#27046) 2021-10-29 05:19:50 +00:00
Manuela Kuhn
852e14a655 r-openssl: add 1.4.5 (#27045) 2021-10-29 04:17:35 +00:00
Manuela Kuhn
5b2d9ae0b0 r-car: add 3.0-11 (#27044) 2021-10-29 04:14:06 +00:00
Manuela Kuhn
dc3b818192 r-future: add 1.22.1 (#27041) 2021-10-29 03:58:00 +00:00
Manuela Kuhn
5c1874c387 r-pillar: add 1.6.4 (#27040) 2021-10-29 03:47:42 +00:00
Manuela Kuhn
fcf6a46aeb r-digest: add 0.6.28 (#27039) 2021-10-29 03:00:10 +00:00
Manuela Kuhn
180bb5003c r-farver: add 2.1.0 (#27038) 2021-10-29 02:46:55 +00:00
Manuela Kuhn
2e880c5513 r-ggplot2: add 3.3.5 (#27037) 2021-10-29 02:36:49 +00:00
Manuela Kuhn
71412f547d r-generics: add 0.1.1 (#27034) 2021-10-29 01:44:13 +00:00
Harmen Stoppels
574395af93 Fix exit codes in fish (#27028) 2021-10-29 01:10:31 +00:00
Manuela Kuhn
c04b2fa26a r-rappdirs: add 0.3.3 (#26989) 2021-10-28 17:55:38 -05:00
Manuela Kuhn
19c77f11b6 r-emmeans: add 1.7.0 (#26987) 2021-10-28 17:54:24 -05:00
Manuela Kuhn
1f4ada6b22 r-fansi: add 0.5.0 (#26986) 2021-10-28 17:51:45 -05:00
Manuela Kuhn
4ff87ea04f r-lifecycle: add 1.0.1 (#26975) 2021-10-28 17:42:56 -05:00
Manuela Kuhn
d5520a264b r-parallelly: add 1.28.1 (#26974) 2021-10-28 17:40:58 -05:00
Manuela Kuhn
999044033b r-vctrs: add 0.3.8 (#26966) 2021-10-28 17:39:09 -05:00
Todd Gamblin
233dabbd4f bugfix: config edit should work with a malformed spack.yaml
If you don't format `spack.yaml` correctly, `spack config edit` still fails and
you have to edit your `spack.yaml` manually.

- [x] Add some code to `_main()` to defer `ConfigFormatError` when loading the
  environment, until we know what command is being run.

- [x] Make `spack config edit` use `SPACK_ENV` instead of the config scope
  object to find `spack.yaml`, so it can work even if the environment is bad.

Co-authored-by: scheibelp <scheibel1@llnl.gov>
2021-10-28 15:37:44 -07:00
Todd Gamblin
374e3465c5 bugfix: spack config get <section> in environments
`spack config get <section>` was erroneously returning just the `spack.yaml`
for the environment.

It should return the combined configuration for that section (including
anything from `spack.yaml`), even in an environment.

- [x] reorder conditions in `cmd/config.py` to fix
2021-10-28 15:37:44 -07:00
Todd Gamblin
2bd513d659 config: ensure that options like --debug are set first
`spack --debug config edit` was not working properly -- it would not do show a
stack trace for configuration errors.

- [x] Rework `_main()` and add some notes for maintainers on where things need
      to go for configuration to work properly.
- [x] Move config setup to *after* command-line parsing is done.

Co-authored-by: scheibelp <scheibel1@llnl.gov>
2021-10-28 15:37:44 -07:00
Todd Gamblin
56ad721eb5 errors: Rework error handling in main()
`main()` has grown, and in some cases code that can generate errors has gotten
outside the top-level try/catch in there. This means that simple errors like
config issues give you large stack traces, which shouldn't happen without
`--debug`.

- [x] Split `main()` into `main()` for the top-level error handling and
      `_main()` with all logic.
2021-10-28 15:37:44 -07:00
Manuela Kuhn
732be7dec6 r-ellipsis: add 0.3.2 (#26965) 2021-10-28 17:36:10 -05:00
Manuela Kuhn
895bd75762 r-rlang: add 0.4.12 (#26963) 2021-10-28 17:34:06 -05:00
Manuela Kuhn
dd1eb7ea18 r-mvtnorm: add 1.1-3 (#26957) 2021-10-28 17:31:43 -05:00
Manuela Kuhn
494dc0bd13 r-lme4: add 1.1-27.1 (#26955)
* r-lme4: add 1.1-27.1

* Use cran instead of explicit url
2021-10-28 17:30:21 -05:00
Manuela Kuhn
4b2564a2d6 llvm: fix gcc11 build for @11 (#27013) 2021-10-28 16:07:56 -06:00
iarspider
eb2d44a57b New versions of py-flake8 and py-pyflakes (#27008)
* New versions of py-flake8 and py-pyflakes

* Changes from review
2021-10-28 21:56:28 +00:00
Todd Gamblin
a1216138f6 config: fix SPACK_DISABLE_LOCAL_CONFIG, remove $user_config_path (#27022)
There were some loose ends left in ##26735 that cause errors when
using `SPACK_DISABLE_LOCAL_CONFIG`.

- [x] Fix hard-coded `~/.spack` references in `install_test.py` and `monitor.py`

Also, if `SPACK_DISABLE_LOCAL_CONFIG` is used, there is the issue that
`$user_config_path`, when used in configuration files, makes no sense,
because there is no user config scope.

Since we already have `$user_cache_path` in configuration files, and since there
really shouldn't be *any* data stored in a configuration scope (which is what
you'd configure in `config.yaml`/`bootstrap.yaml`/etc., this just removes
`$user_config_path`.

There will *always* be a `$user_cache_path`, as Spack needs to write files, but
we shouldn't rely on the existence of a particular configuration scope in the
Spack code, as scopes are configurable, both in number and location.

- [x] Remove `$user_config_path` substitution.
- [x] Fix reference to `$user_config_path` in `etc/spack/deaults/bootstrap.yaml`
      to refer to `$user_cache_path`, which is where it was intended to be.
2021-10-28 21:33:44 +00:00
Daryl W. Grunau
d0e177e711 depend on libevent when +pmix (#27020)
Co-authored-by: Daryl W. Grunau <dwg@lanl.gov>
2021-10-28 23:19:19 +02:00
Phil Carns
7fd1d2b03f mochi-margo: add version 0.9.6 (#26951) 2021-10-28 23:11:30 +02:00
Valentin Churavy
7f8b0d4820 add MPItrampoline 2.0.0 (#27019) 2021-10-28 22:20:38 +02:00
iarspider
612639534a New version: py-distro 1.6.0 (#27003) 2021-10-28 14:38:36 -05:00
iarspider
f512bb1dc1 New versions: docutils 0.17, 0.17.1, 0.18 (#27005) 2021-10-28 13:53:02 -05:00
Harmen Stoppels
6d030ba137 Deactivate previous env before activating new one (#25409)
* Deactivate previous env before activating new one

Currently on develop you can run `spack env activate` multiple times to switch
between environments, but they leave traces, even though Spack only supports
one active environment at a time.

Currently:

```console
$ spack env create a
$ spack env create b
$ spack env activate -p a
[a] $ spack env activate -p b
[b] [a] $ spack env activate -p b
[a] [b] [a] $ spack env activate -p a
[a] [b] [c] $ echo $MANPATH | tr ":" "\n"
/path/to/environments/a/.spack-env/view/share/man
/path/to/environments/a/.spack-env/view/man
/path/to/environments/b/.spack-env/view/share/man
/path/to/environments/b/.spack-env/view/man
```

This PR fixes that:

```console
$ spack env activate -p a
[a] $ spack env activate -p b
[b] $ spack env activate -p a
[a] $ echo $MANPATH | tr ":" "\n"
/path/to/environments/a/.spack-env/view/share/man
/path/to/environments/a/.spack-env/view/man
```
2021-10-28 11:39:25 -07:00
Tom Scogland
87e456d59c spack setup-env.sh: make zsh loading async compatible, and ~10x faster (in some cases) (#26120)
Currently spack is a bit of a bad actor as a zsh plugin, and it was my
fault.  The autoload and compinit should really be handled by the user,
as was made abundantly clear when I found spack was doing completion
initialization for *all* of my plugins due to a deferred setup that was
getting messed up by it.

Making this conditional took spack load time from 1.5 seconds (with
module loading disabled) to 0.029 seconds. I can actually afford to load
spack by default with this change in.

Hopefully someday we'll do proper zsh completion support, but for now
this helps a lot.

* use zsh hist expansion in place of dirname
* only run (bash)compinit if compdef/complete missing
* add zsh compiled files to .gitignore
* move changes to .in file, because spack
2021-10-28 11:32:59 -07:00
iarspider
5faa457a35 New version: py-fasteners 0.16.3 (#27006) 2021-10-28 13:15:50 -05:00
Harmen Stoppels
8ca3a0fdf8 Remove failing macOS test (#27009) 2021-10-28 09:30:51 -07:00
Brent Huisman
63fcb0331b Add Pybind11 v2.8 (#26867)
* Add Pybind11 v2.8

* Add Python dependency

* Update package.py

* Added Pybind v2.8.1
2021-10-28 16:14:49 +00:00
Robert Blackwell
8fd94e3114 YamlFilesystemView: improve file removal performance via batching (#24355)
* Drastically improve YamlFilesystemView file removal via batching

The `remove_file` routine has to check if the file is owned by multiple packages, so it doesn't
remove necessary files. This is done by the `get_all_specs` routine, which walks the entire
package tree. With large numbers of packages on shared file systems, this can take seconds
per file tree traversal, which adds up extremely quickly. For example, a single deactivate
of a largish python package in our software stack on GPFS took approximately 40 minutes.

This patch simply replaces `remove_file` with a batch `remove_files` routine. This routine
removes a list of files rather than a single file, requiring only one traversal per batch. In
practice this means a package can be removed in seconds time, rather than potentially hours,
essentially a ~100x speedup (ignoring initial deactivation logic, which takes about 3 minutes
in our test setup).
2021-10-28 07:39:16 -07:00
Harmen Stoppels
c13f915735 cmake: add v3.21.4, v3.20.6 (#27004) 2021-10-28 13:59:46 +00:00
Cameron Stanavige
afbc67fdd8 dtcmp & lwgrp: add shared variant (#26999) 2021-10-28 15:00:54 +02:00
Michael Kuhn
e9f3ef785d Fix sbang hook for non-writable files (#27007)
* Fix sbang hook for non-writable files

PR #26793 seems to have broken the sbang hook for files with missing
write permissions. Installing perl now breaks with the following error:
```
==> [2021-10-28-12:09:26.832759] Error: PermissionError: [Errno 13] Permission denied: '$SPACK/opt/spack/linux-fedora34-zen2/gcc-11.2.1/perl-5.34.0-afuweplnhphcojcowsc2mb5ngncmczk4/bin/cpanm'
```

Temporarily add write permissions to the original file so it can be
overwritten with the patched one.

And test that file permissions are preserved in sbang even for non-writable files

Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2021-10-28 14:49:23 +02:00
Erik Schnetter
7c886bcac1 nsimd: add v3.0.1, determine SIMD variant automatically by default (#26850) 2021-10-28 14:38:48 +02:00
Paul Ferrell
4ee37c37de buildcaches: fix directory link relocation (#26948)
When relocating a binary distribution, Spack only checks files to see
if they are a link that needs to be relocated. Directories can be
such links as well, however, and need to undergo the same checks
and potential relocation.
2021-10-28 14:34:31 +02:00
Seth R. Johnson
890095e876 llvm: use cmake helper functions (#26988)
* llvm: use cmake helper functipack stns

* llvm: review feedback
2021-10-27 20:26:22 +00:00
iarspider
7416df692a New versions: py-cffi 1.15.0, 1.14.6 (#26979)
* New versions: py-cffi 1.15.0, 1.14.6

* Changes from review
2021-10-27 15:01:15 -05:00
iarspider
dd0770fd64 New versions of py-cachetools (#26976)
* New versions of py-cachetools

* Changes from review
2021-10-27 15:00:48 -05:00
iarspider
704c94429b New version: py-bottle@0.12.19 (#26973)
* New version: py-bottle@0.12.19

* Changes from review
2021-10-27 15:00:19 -05:00
Mark W. Krentel
21d909784c hpcviewer: add support for macosx, add version 2021.10 (#26823) 2021-10-27 19:51:14 +00:00
Kyle Gerheiser
e35eacf87b Add w3emc version 2.9.1 (#26880) 2021-10-27 12:05:06 -06:00
iarspider
dc40405fd6 New version: py-contextlib2 21.6.0 (#26985) 2021-10-27 11:08:25 -06:00
Massimiliano Culpo
3d5444fdd8 Remove documentation tests from GitHub Actions (#26981)
We moved documentation tests to readthedocs since a while,
so remove the one on GitHub.
2021-10-27 19:02:52 +02:00
iarspider
80d4a83636 New versions: py-boken@2.3.3, 2.4.0, 2.4.1 (#26972) 2021-10-27 11:59:42 -05:00
iarspider
39f46b1c3b New version: py-certifi 2021.10.8 (#26978) 2021-10-27 11:54:37 -05:00
H. Joe Lee
1fcc9c6552 hdf5-vol-log: add new package (#26956) 2021-10-27 16:48:44 +00:00
iarspider
1842785eae New version: py-commonmark 0.9.1 (#26983) 2021-10-27 11:47:28 -05:00
Mosè Giordano
acb8ab338d fftw: add v3.3.10 (#26982) 2021-10-27 15:29:53 +00:00
Bernhard Kaindl
d1803af957 fontconfig: add v2.13.94 and fix test with dash (#26961)
Fix install --test=root with /bin/sh -> dash: A test uses
SIGINT SIGTERM SIGABRT EXIT for trap -> use signal numbers
2021-10-27 16:20:57 +02:00
Bernhard Kaindl
f4431851ab perl-extutils-installpaths: depend on perl-extutils-config (#26969) 2021-10-27 16:02:14 +02:00
Pieter Ghysels
1f728ab4ce strumpack: add v6.1.0, remove unused variants (#26971) 2021-10-27 15:58:54 +02:00
Valentin Volkl
9fa20b8a39 recola: fix compilation (#26634)
* recola: fix compilation

* Update var/spack/repos/builtin/packages/recola-sm/package.py

Co-authored-by: Seth R. Johnson <johnsonsr@ornl.gov>

* flake8

* fixes

* fix typo

* fix typo

Co-authored-by: Seth R. Johnson <johnsonsr@ornl.gov>
2021-10-27 07:19:35 -06:00
Todd Gamblin
4f124bc9e7 tests: speed up spack list tests (#26958)
`spack list` tests are not using mock packages for some reason, and many
are marked as potentially slow. This isn't really necessary; we don't need
6,000 packages to test the command.

- [x] update tests to use `mock_packages` fixture
- [x] remove `maybeslow` annotations
2021-10-27 05:10:39 -06:00
Harmen Stoppels
e04b172eb0 Allow non-UTF-8 encoding in sbang hook (#26793)
Currently Spack reads full files containing shebangs to memory as
strings, meaning Spack would have to guess their encoding. Currently
Spack has a fixed guess of UTF-8.

This is unnecessary, since e.g. the Linux kernel does not assume an
encoding on paths at all, it's just bytes and some delimiters on the
byte level.

This commit does the following:

1. Shebangs are treated as bytes, so that e.g. latin1 encoded files do
not throw UnicodeEncoding errors, and adds a test for this.
2. No more bytes than necessary are read to memory, we only have to read
until the first newline, and from there on we an copy the file byte by
bytes instead of decoding and re-encoding text.
3. We cap the number of bytes read to 4096, if no newline is found
before that, we don't attempt to patch it.
4. Add support for luajit too.

This should make Spack both more efficient and usable for non-UTF8
files.
2021-10-27 02:59:10 -07:00
Harmen Stoppels
2fd87046cd Fix assumption v.concrete => isinstance(v, Version) (#26537)
* Add test
* Only extend with Git version when using Version
* xfail v.concrete test
2021-10-27 02:58:04 -07:00
Harmen Stoppels
ae6e83b1d5 config: overrides for caches and system and user scopes (#26735)
Spack's `system` and `user` scopes provide ways for administrators and
users to set global defaults for all Spack instances, but for use cases
where one wants a clean Spack installation, these scopes can be undesirable.
For example, users may want to opt out of global system configuration, or
they may want to ignore their own home directory settings when running in
a continuous integration environment.

Spack also, by default, keeps various caches and user data in `~/.spack`,
but users may want to override these locations.

Spack provides three environment variables that allow you to override or
opt out of configuration locations:

 * `SPACK_USER_CONFIG_PATH`: Override the path to use for the
   `user` (`~/.spack`) scope.

 * `SPACK_SYSTEM_CONFIG_PATH`: Override the path to use for the
   `system` (`/etc/spack`) scope.

 * `SPACK_DISABLE_LOCAL_CONFIG`: set this environment variable to completely
   disable *both* the system and user configuration directories. Spack will
   only consider its own defaults and `site` configuration locations.

And one that allows you to move the default cache location:

 * `SPACK_USER_CACHE_PATH`: Override the default path to use for user data
   (misc_cache, tests, reports, etc.)

With these settings, if you want to isolate Spack in a CI environment, you can do this:

   export SPACK_DISABLE_LOCAL_CONFIG=true
   export SPACK_USER_CACHE_PATH=/tmp/spack

This is a stop-gap approach until we have figured out how to deal with
the system and user config scopes more generally, as there are plans to
potentially / eventually get rid of them.

**User config**

Spack is a bit of a pain when you have:

- a shared $HOME folder across different systems.
- multiple Spack versions on the same system.

**System config**

- On shared systems with a versioned programming environment / toolkit,
  system administrators want to provide config for each version (e.g.
  21.09, 21.10) of the programming environment, and the user Spack
  instance should be able to pick this up without a steep learning
  curve.
- On shared systems the user should be able to opt out of the
  hard-coded config scope in /etc/spack, since it may be incompatible
  with their particular instance. Currently Spack can only opt out of all
  config scopes through overrides with `"config:":`, `"packages:":`, but that
  also drops the defaults config, which would have to be repeated, which
  is undesirable, especially the lengthy packages.yaml.

An example use case is: having config in this folder:

```
/path/to/programming/environment/{version}/{compilers,packages}.yaml
```

and have `module load spack-system-config` set the variable

```
SPACK_SYSTEM_CONFIG_PATH=/path/to/programming/environment/{version}
```

where the user no longer has to worry about what `{version}` they are
on.

**Continuous integration**

Finally, there is the use case of continuous integration, which may
clone an arbitrary Spack version, which optimally should not pick up
system or user config from the previous run (like may happen in
classical bare metal non-containerized filesystem side effect ridden
jenkins pipelines). In fact this is very similar to how spack itself
tries to avoid picking up system dependencies during builds...

**But environments solve this?**

- You could do `include`s in environment files to get similar behavior
  to the spack_system_config_path example, but environments require you
  to:
  1) require paths to individual config files, not directories.
  2) fail if the listed config file does not exist
- They allow you to override config scopes, but this is generally too
  rigurous, as it requires you to repeat the default config, in
  particular packages.yaml, and just defies the point of layered config.

Co-authored-by: Tom Scogland <tscogland@llnl.gov>
Co-authored-by: Tim Fuller <tjfulle@sandia.gov>
Co-authored-by: Steve Leak <sleak@lbl.gov>
Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
2021-10-26 18:08:25 -07:00
Ye Luo
7dc94b6683 Build OpenMP in LLVM via LLVM_ENABLE_RUNTIMES. (#26870) 2021-10-26 17:43:28 -06:00
Hao Lyu
02bea6d2d2 fix bug when there is version id in the path of compiler (#26916) 2021-10-26 14:12:58 -07:00
Greg Becker
9a637bbd09 modules: allow user to remove arch dir (#24156)
* allow no arch-dir modules

* add tests for modules with no arch

* document arch-specific module roots
2021-10-26 13:26:09 -07:00
Mark W. Krentel
444e156685 hpctoolkit: add version 2021.10.15 (#26881) 2021-10-26 13:15:09 -07:00
Richarda Butler
bc616a60b7 Py-Libensemble: Add E4S testsuite stand alone test (#26270) 2021-10-26 13:11:53 -07:00
Miroslav Stoyanov
ad03981468 fix the spack test dir (#26816) 2021-10-26 13:07:04 -07:00
Sreenivasa Murthy Kolam
5ee2ab314c ROCm packages: add RelWithDebInfo build_type (#26888)
Also set default build_type to Release for many ROCm packages.
2021-10-26 12:18:38 -07:00
Greg Becker
a8a08f66ad modules: configurable module defaults (#24367)
Any spec satisfying a default will be symlinked to `default`

If multiple specs have modulefiles in the same directory and satisfy
configured module defaults, then whichever was written last will be
default.
2021-10-26 19:34:06 +02:00
Kyle Gerheiser
dee75a4945 upp: Add version 10.0.10 (#26946) 2021-10-26 19:26:34 +02:00
Seth R. Johnson
aacdd5614e htop: add new URL and versions (#26928) 2021-10-26 19:14:06 +02:00
Ben Morgan
a2e5a28892 virtest: prevent out-of-order build/test (#26944)
Use of `-R` flag to CTest command causes "empty-14" test to run,
by matching "empty", before the empty-14 target is built.

Patch CTest command in buildscript to match name exactly.
2021-10-26 18:55:54 +02:00
Asher Mancinelli
94a9733822 hiop: update constraints and add new version (#26905)
* Update hiop package dependencies

* Use single quotes to shrink diff

* add hiop 0.5.1

* apply flake8

* Apply formatting suggestions
2021-10-26 11:43:03 -04:00
iarspider
fb1f3b1a1c Add checksum for py-argon2-cffi 21.1.0 and update python dependency (#26894)
* Add checksum for py-argon2-cffi 21.1.0 and update python dependency

* Update package.py
2021-10-26 09:32:11 -06:00
iarspider
d673e634d0 New versions: py-bleach 4.0.0 and 4.1.0 (#26947) 2021-10-26 09:23:10 -06:00
iarspider
1f1f121e8f New version: py-beniget 0.4.1 (#26945) 2021-10-26 09:02:03 -06:00
Wouter Deconinck
ba2a03e1da geant4: depends_on vecgeom@1.1.8:1.1 range (#26917)
* [geant4] depends_on vecgeom@1.1.8:1.1 range

While previous versions were unclear, the [geant4.10.7 release notes](https://geant4-data.web.cern.ch/ReleaseNotes/ReleaseNotes4.10.7.html) indicate that vecgeom@1.1.8 is a minimum required version, not an exact required version ("Set VecGeom-1.1.8 as minimum required version for optional build with VecGeom."). This will allow some more freedom on the concretizer solutions while allowing geant4 to take advantage of bugfixes and improvements in vecgeom.

* [vecgeom] new version 1.1.17
2021-10-26 10:31:37 -04:00
Seth R. Johnson
dad68e41e0 freetype: explicitly specify dependencies (#26942)
Freetype picked up 'brotli' from homebrew, causing issues downstream.
2021-10-26 04:07:48 -06:00
eugeneswalker
1ae38037ef tau: add version 2.30.2 (#26941) 2021-10-26 05:36:29 -04:00
Chuck Atkins
80d8c93452 unifyfs: Remove the hdf5 variant (examples only) (#26932)
UnifyFS doesn't actually use HDF5 for anything.  Enabling it only enables
a few examples to be built so it's not actually a dependency of the package.
2021-10-26 09:42:52 +02:00
Seth R. Johnson
bdcbc4cefe qt package: versions @:5.13 don't build with gcc@11: (#26922) 2021-10-25 18:20:54 -07:00
Ronak Buch
1d53810d77 charmpp: add version 7.0.0 (#26940) 2021-10-25 18:16:37 -07:00
Adam J. Stewart
4a8c53472d py-kornia: add version 0.6.1 (#26939) 2021-10-25 18:15:57 -07:00
Adam J. Stewart
b05df2cdc7 py-shapely: add version 1.8.0 (#26937) 2021-10-25 18:15:22 -07:00
Adam J. Stewart
92cef8d7ad py-scikit-learn: add version 1.0.1 (#26934) 2021-10-25 18:14:17 -07:00
Adam J. Stewart
912c6ff6e8 PyTorch/torchvision: add version 1.10.0/0.11.1 (#26889)
* For py-torch: Also update dependencies: many version constraints
  with an upper bound of @1.9 are now open (e.g. `@1.8.0:1.9` is
  converted to `@1.8.0:`).
* For py-torchvision: Also add 0.11.0 and update ^pil constraint
  to avoid building with 8.3.0
2021-10-25 15:26:12 -07:00
iarspider
cdcdd71b41 Add new versions of py-autopep8 and py-pycodestyle (#26924)
* Add new versions of py-autopep8 (1.5.7, 1.6.0) and py-pycodestyle (2.7.0, 2.8.0)

* Update package.py

* Restore old versions
2021-10-25 22:08:52 +00:00
Daniel Arndt
e221617386 deal.II package: Update CMake variable for >=9.3.0 (#26909) 2021-10-25 15:00:40 -07:00
Massimiliano Culpo
6063600a7b containerize: pin the Spack version used in a container (#21910)
This PR permits to specify the `url` and `ref` of the Spack instance used in a container recipe simply by expanding the YAML schema as outlined in #20442:
```yaml
container:
  images:
    os: amazonlinux:2
    spack:
      ref: develop
      resolve_sha: true
```
The `resolve_sha` option, if true, verifies the `ref` by cloning the Spack repository in a temporary directory and transforming any tag or branch name to a commit sha. When this new ability is leveraged an additional "bootstrap" stage is added, which builds an image with Spack setup and ready to install software. The Spack repository to be used can be customized with the `url` keyword under `spack`.

Modifications:
- [x] Permit to pin the version of Spack, either by branch or tag or sha
- [x] Added a few new OSes (centos:8, amazonlinux:2, ubuntu:20.04, alpine:3, cuda:11.2.1)
- [x] Permit to print the bootstrap image as a standalone
- [x] Add documentation on the new part of the schema
- [x] Add unit tests for different use cases
2021-10-25 13:09:27 -07:00
iarspider
ff65e6352f py-avro: new version 1.10.2 (#26927)
* Add checksum for py-avro@1.10.2

* Update package.py
2021-10-25 11:45:33 -05:00
Olli Lupton
06c983d38f cuda: add 11.4.1, 11.4.2, 11.5.0. (#26892)
* cuda: add 11.4.1, 11.4.2, 11.5.0.

Note that the curses dependency from cuda-gdb was dropped in 11.4.0.

* Update clang/gcc constraints.

* Address review, assume clang 12 is OK from 11.4.1 onwards.

* superlu-dist@7.1.0 conflicts with cuda@11.5.0.

* Update var/spack/repos/builtin/packages/superlu-dist/package.py

Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>

Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2021-10-25 09:05:21 -07:00
iarspider
b0752bf1b3 Add checksum for py-atomicwrites@1.4.0 (#26923) 2021-10-25 10:54:04 -05:00
Kendra Long!
c9847766e4 draco: new version 7_12_0 (#26907)
* Add draco-7_12_0 to package file

* Update hash to zip version
2021-10-25 11:35:38 -04:00
Kelly (KT) Thompson
86a9c703db eospac: new default version 6.5.0 (#26723)
* [pkg][new version] Provide eospac@6.5.0 and mark it as default.

* Merge in changes found in #21629

* Mark all alpha/beta versions as deprecated.

- Addresses @sethrj's recommendation
- Also add a note indicated why these versions are marked this way.
2021-10-25 11:10:46 -04:00
Harmen Stoppels
276e637522 Reduce verbosity of module files warning
1. Currently it prints not just the spec name, but the dependencies +
their variants + their compilers + their architectures + ...
2. It's clear from the context what spec the message applies to, so,
let's not print the spec at all.
2021-10-25 17:07:56 +02:00
Olivier Cessenat
b51e0b363e silo: new release 4.11 (#26876) 2021-10-25 08:13:54 -06:00
Manuela Kuhn
e9740a9978 py-nipype: add 1.7.0 (#26883) 2021-10-25 06:55:50 -06:00
Harmen Stoppels
cc8d8cc9cb Return early in do_fetch when there is no code or a package is external (#26926)
Co-authored-by: Ryan Krattiger <ryan.krattiger@kitware.com>
2021-10-25 13:51:23 +02:00
Todd Gamblin
de8e795563 virtuals: simplify virtual handling
These three rules in `concretize.lp` are overly complex:

```prolog
:- not provider(Package, Virtual),
   provides_virtual(Package, Virtual),
   virtual_node(Virtual).
```

```prolog
  :- provides_virtual(Package, V1), provides_virtual(Package, V2), V1 != V2,
     provider(Package, V1), not provider(Package, V2),
     virtual_node(V1), virtual_node(V2).
```

```prolog
provider(Package, Virtual) :- root(Package), provides_virtual(Package, Virtual).
```

and they can be simplified to just:

```prolog
provider(Package, Virtual) :- node(Package), provides_virtual(Package, Virtual).
```

- [x] simplify virtual rules to just one implication
- [x] rename `provides_virtual` to `virtual_condition_holds`
2021-10-25 09:11:04 +02:00
Massimiliano Culpo
6d69d23aa5 Add a unit test to prevent regression 2021-10-25 09:11:04 +02:00
Massimiliano Culpo
dd4d7bae1d ASP-based solver: a package eligible to provide a virtual must provide it
fixes #26866

This semantics fits with the way Spack currently treats providers of
virtual dependencies. It needs to be revisited when #15569 is reworked
with a new syntax.
2021-10-25 09:11:04 +02:00
Miguel Dias Costa
1e90160d68 berkeleygw: force openmp propagation on some providers of blas / ffw-api (#26918) 2021-10-25 07:42:05 +02:00
Michael Kuhn
dfcd5d4c81 hyperfine: new package (#26901) 2021-10-24 20:47:56 -04:00
Satish Balay
e3b7eb418f Add new math solver versions (#26903)
* tasmanian: add @7.7
* butterflypack: add @2.0.0
* pflotran: add @3.0.2
* alquimia: add @1.0.9
* superlu-dist: add @7.1.1
2021-10-24 20:45:44 -04:00
Michael Kuhn
fb5d4d9397 meson: add 0.60.0 (#26921) 2021-10-24 20:35:11 -04:00
Scott Wittenburg
2003fa1b35 Mark flaky test_ci_rebuild as xfail (#26911) 2021-10-24 22:46:26 +02:00
Michael Kuhn
b481b5114a Fix pkg-config dependencies (#26912)
pkg-config and pkgconf are implementations of the pkgconfig provider.
2021-10-24 20:39:50 +02:00
Michael Kuhn
d7148a74a0 glib: add 2.70.0 (#26915) 2021-10-24 20:39:30 +02:00
Seth R. Johnson
c255e91bba gcc: support alternate mechanism for providing GCC rpaths (#26590)
* gcc: support runtime ability to not install spack rpaths

Fixes #26582 .

* gcc: Fix malformed specs file and add docs

The updated docs point out that the spack-modified GCC does *not*
follow the usual behavior of LD_RUN_PATH!

* gcc: fix bad rpath on macOS

This bug has been around since the beginning of the GCC package file:
the rpath command it generates for macOS writes a single (invalid)
rpath entry.

* gcc: only write rpaths for directories with shared libraries

The original lib64+lib was just a hack for "in case either has one" but
it's easy to tell whether either has libraries that can be directly
referenced.
2021-10-24 13:46:52 -04:00
Michael Kuhn
5a38165674 python: add 3.9.7, 3.8.12, 3.7.12 and 3.6.15 (#26914) 2021-10-24 11:43:39 -06:00
Morten Kristensen
9e11e62bca py-vermin: add latest version 1.3.1 (#26920)
* py-vermin: add latest version 1.3.1

* Exclude line from Vermin since version is already being checked for

Vermin 1.3.1 finds that `encoding` kwarg of builtin `open()` requires Python 3+.
2021-10-24 16:49:05 +00:00
Mark Grondona
7fee7a7ce1 flux-core, -sched: update to latest versions, fix czmq build error (#26840)
* flux-core: fix compile error with czmq_containers
* Fix build with clang and gcc-11
Co-authored-by: Bernhard Kaindl <bernhardkaindl7@gmail.com>
2021-10-23 17:37:44 +02:00
Jen Herting
7380161ea6 [py-emcee] added versions 3.0.2 and 3.1.1 (#26910)
* [py-emcee] added version 3.0.2

* [py-emcee] added version 3.1.1
2021-10-22 17:52:45 -06:00
eugeneswalker
0baec34dd7 E4S amd64 CI: add parsec (#26906) 2021-10-22 15:02:47 -06:00
Wouter Deconinck
d04b6e0fb5 acts: fix misspelled variant in depends_on (#26904)
Correct variant is plural `unit_tests`.
2021-10-22 12:19:51 -06:00
Harmen Stoppels
336c60c618 Document backport in py (#26897) 2021-10-22 19:14:35 +02:00
iarspider
0beb2e1ab2 Update py-aiohttp to 3.7.4 and py-chartdet to 4.0 (#26893)
* Update py-aiohttp to 3.7.4 and py-chartdet to 4.0

* Changes from review

* Update package.py

* Update var/spack/repos/builtin/packages/py-chardet/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-10-22 16:36:56 +00:00
iarspider
aa2bcbdc12 Use pypi for astroid; add versions 2.7.3 and 2.8.3; update dependencies (#26900)
* Use pypi for astroid; add versions 2.7.3 and 2.8.3; update dependencies

* py-six is not required for recent versions
2021-10-22 16:21:22 +00:00
Wouter Deconinck
d5880f3e7e acts: add v14.0.0, v14.1.0 added "python" and "analysis" variants (#26657) 2021-10-22 17:43:35 +02:00
Robert Cimrman
2d41d6fc9e py-sfepy: fix version 2021.3 tar.gz hash (#26890) 2021-10-22 10:23:58 -05:00
iarspider
8349a8ac60 Add py-asn1crypto@1.4.0 (#26895) 2021-10-22 10:22:30 -05:00
Manuela Kuhn
edc7341625 py-jupyterlab: add 3.1.18 and 3.2.1 (#26896) 2021-10-22 10:21:00 -05:00
Harmen Stoppels
609a42d63b Shorten long shebangs only if the execute permission is set (#26899)
The OS should only interpret shebangs, if a file is executable. 

Thus, there should be no need to modify files where no execute bit is set. 

This solves issues that are e.g. encountered while packaging software as 
COVISE (https://github.com/hlrs-vis/covise), which includes example data
in Tecplot format. The sbang post-install hook is applied to every installed
file that starts with the two characters #!, but this fails on the binary Tecplot
files, as they happen to start with #!TDV. Decoding them with UTF-8 fails 
and an exception is thrown during post_install.

Co-authored-by: Martin Aumüller <aumuell@reserv.at>
2021-10-22 16:55:19 +02:00
Harmen Stoppels
d274769761 Backport #186 from py-py to fix macOS failures (#26653)
Backports the relevant bits of 0f77b6e66f
2021-10-22 13:52:46 +02:00
Harmen Stoppels
7cec6476c7 Remove hard-coded repository in centos6 unit test (#26885)
This makes it easier to run tests in a fork.
2021-10-22 10:24:03 +02:00
Doug Jacobsen
d1d0021647 Add GCS Bucket Mirrors (#26382)
This commit contains changes to support Google Cloud Storage 
buckets as mirrors, meant for hosting Spack build-caches. This 
feature is beneficial for folks that are running infrastructure on 
Google Cloud Platform. On public cloud systems, resources are
ephemeral and in many cases, installing compilers, MPI flavors,
and user packages from scratch takes up considerable time.

Giving users the ability to host a Spack mirror that can store build
caches in GCS buckets offers a clean solution for reducing
application rebuilds for Google Cloud infrastructure.

Co-authored-by: Joe Schoonover <joe@fluidnumerics.com>
2021-10-22 06:22:38 +02:00
Miroslav Stoyanov
d024faf044 heffte: new version with rocm (#26878) 2021-10-22 01:12:46 +00:00
Cameron Stanavige
8b8bec2179 scr/veloc: component releases (#26716)
* scr/veloc: component releases

Update the ECP-VeloC component packages in preparation for an
upcoming scr@3.0rc2 release.

All
- Add new release versions
- Add new `shared` variant for all components
- Add zlib link dependency to packages that were missing it
- Add maintainers
- Use self.define and self.define_from_variant to clean up cmake_args

axl
- Add independent vendor async support variants

rankstr
- Update older version sha that fails checksum on install

* Fix scr build error

Lock dependencies for scr@3.0rc1 to the versions released at the same
time.
2021-10-21 18:05:59 -07:00
Frank Willmore
a707bf345d Add vacuumms package (#26838) 2021-10-21 17:12:08 -07:00
Robert Cimrman
9b28f99dd2 py-sfepy: add v2021.3 (#26865) 2021-10-21 23:50:38 +00:00
Manuela Kuhn
dbe1060420 py-neurokit2: add 0.1.4.1 (#26871)
* py-neurokit2: add 0.1.4.1

* Update var/spack/repos/builtin/packages/py-neurokit2/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-10-21 21:03:04 +00:00
eugeneswalker
3720d06e26 update E4S CI environments in preparation for 21.11 release (#26826)
* update E4S CI environments in preparation for 21.11 release

* e4s ci env: use clingo
2021-10-21 07:06:02 -07:00
Alexander Jaust
3176c6d860 [py-pyprecice] add v2.3.0.1 and fix hash of v2.2.1.1 (#26846) 2021-10-21 08:36:24 -05:00
Harmen Stoppels
3fa0654d0b Make 'spack location -e' print the current env, and 'spack cd -e' go to the current env (#26654) 2021-10-21 13:19:48 +02:00
Eric Brugger
7f4bf2b2e1 vtk: make use of system GLEW dependent on osmesa being disabled. (#26764) 2021-10-21 09:53:13 +02:00
Vanessasaurus
3fe1785d33 libabigail: support source install (#26807)
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2021-10-21 09:22:22 +02:00
Wouter Deconinck
b65937e193 kassiopeia: add v3.8.0; new variants log4cxx, boost (#26841) 2021-10-21 07:44:57 +02:00
Alexander Jaust
97d244eb95 Make superlu-dist@7.1.0 request CMake 3.18.1 or newer (#26849) 2021-10-21 07:43:30 +02:00
Edward Hartnett
88591536c8 bacio: add v2.5.0 (#26851) 2021-10-21 07:41:47 +02:00
RichardABunt
f78e5383cc arm-forge: add v21.1 (#26852) 2021-10-21 07:41:06 +02:00
downloadico
34d4091dbc tramonto: add new package (#26858) 2021-10-21 07:18:33 +02:00
Stephen Hudson
afd4a72937 libEnsemble: add v0.8.0 (#26864) 2021-10-21 07:14:31 +02:00
Adam J. Stewart
342f89e277 py-numpy: add v1.21.3 (#26860) 2021-10-21 07:13:43 +02:00
Luc Berger
fc7178da17 Kokkos Kernels: updating maintainers and releases (#26855)
Adding the latests releases of Kokkos Kernels and the official maintainers for the package.
2021-10-20 12:19:56 -07:00
iarspider
594325ae09 Add py-sniffio version 1.2.0 and fix dependencies (#26847)
* Add py-sniffio version 1.2.0 and fix dependencies

* Changes from review
2021-10-20 16:30:26 +00:00
iarspider
fcff01aaaf Update py-anyio to 3.3.4 (#26821)
* Update py-anyio to 3.3.4

* Changes from PR
2021-10-20 10:36:45 -05:00
Manuela Kuhn
b9c633d086 py-bids-validator: add 1.8.4 (#26844) 2021-10-20 10:33:27 -05:00
kwryankrattiger
45bea7cef7 Update ECP dav helper for propagating variants (#26175) 2021-10-20 11:22:07 -04:00
Martin Aumüller
029b47ad72 embree: add checksums for 3.12.2 & 3.13.1 (#26675)
Includes fix for for dependency ispc: fix build if cc -m32 is not possible
Co-authored-by: Bernhard Kaindl <bernhardkaindl7@gmail.com>
2021-10-20 16:41:18 +02:00
Tamara Dahlgren
cc8b6ca69f Add --preferred and --latest tospack checksum (#25830) 2021-10-20 13:38:55 +00:00
Adam J. Stewart
f184900b1a damask: fix maintainer GitHub handle (#26829) 2021-10-20 14:57:13 +02:00
Wouter Deconinck
abc8cfe8fa cppgsl: branch master is now main (#26834) 2021-10-20 14:56:01 +02:00
Massimiliano Culpo
56209cb114 Reduce verbosity of error messages when concretizing environments (#26843)
With this commit stacktraces of subprocesses are shown only if debug mode is active
2021-10-20 11:30:07 +00:00
Alexander Jaust
26b58701bc Fix typo in repositories.rst (#26845) 2021-10-20 11:11:17 +00:00
Wouter Deconinck
42a6e1fcee root: prepend dependent_spec.prefix.include to ROOT_INCLUDE_PATH (#26379)
Spack is not populating CPATH anymore (e3f97b37e6 (diff-259adc895c0b2e8fca42ffb99d8051eec0712c868d12d8da255d32f1663acdc7)), and downstream packages ([gaudi](1aa7758dbb/var/spack/repos/builtin/packages/gaudi/package.py (L116))) have alrady started to include this in their package.py files. Instead of propagating this to all downstream packages, it tries to address the issue at the source.
2021-10-20 09:15:14 +02:00
Massimiliano Culpo
1983d6d9d0 Pipelines: pin importlib-metadata and setuptools-scm versions (#26831)
This will hopefully be a hotfix for the issue with pipelines
in #26813 and #26820
2021-10-19 16:09:40 -07:00
Chris White
b7d94ebc4f allow camp to use blt package (#26765) 2021-10-19 16:09:15 -07:00
Harmen Stoppels
1b634f05e0 A single process pool is not something to boast about (#26837) 2021-10-19 23:04:52 +00:00
Greg Becker
7dc0ca4ee6 cray architecture detection for zen3/milan (#26827)
* Update cray architecture detection for milan

Update the cray architecture module table with x86-milan -> zen3
Make cray architecture more robust to back off from frontend
architecture to a recent ancestor if necessary. This should make
future cray updates less paingful for users.

Co-authored-by: Gregory Becker <becker33.llnl.gov>
Co-authored-by: Todd Gamblin <gamblin2@llnl.gov>
2021-10-19 21:39:50 +00:00
Kai Germaschewski
501fa6767b adios2: fix unresolved symbols in 2.6.0 when built with gcc10 (#23871) 2021-10-19 21:09:07 +00:00
Harmen Stoppels
e7c7f44bb6 Reduce verbosity of threaded concretization (#26822)
1. Don't use 16 digits of precision for the seconds, round to 2 digits after the comma
2. Don't print if we don't concretize (i.e. `spack concretize` without `-f` doesn't have to tell me it did nothing in `0.00` seconds)
2021-10-19 18:33:17 +00:00
iarspider
bc99d8a2fd Update py-zipp (#26819)
* Update py-zipp

* Fix typo
2021-10-19 13:29:32 -05:00
Garth N. Wells
2bfff5338f py-fenics-ffcx: dependency updates (#26783)
* Update py-fenics-ffcx dependencies

* Relax some version numbering

* Remove stray colon
2021-10-19 13:28:20 -05:00
iarspider
a678a66683 py-setuptools-scm: make py-tomli dependency an open range (#26820) 2021-10-19 16:08:56 +00:00
Massimiliano Culpo
4c082a5357 Relax os constraints in e4s pipelines (#26547) 2021-10-19 10:51:37 -05:00
Massimiliano Culpo
2d45a9d617 Speed-up environment concretization on linux with a process pool (#26264)
* Speed-up environment concretization with a process pool

We can exploit the fact that the environment is concretized
separately and use a pool of processes to concretize it.

* Add module spack.util.parallel

Module includes `pool` and `parallel_map` abstractions,
along with implementation details for both.

* Add a new hash type to pass specs across processes

* Add tty msg with concretization time
2021-10-19 10:09:34 -05:00
Ryan Mast
64a323b22d spdlog: add v1.9.0, v1.9.1 and v1.9.2 (#26777) 2021-10-19 16:55:36 +02:00
Ryan Mast
f7666f0074 asio: Add versions up to 1.20.0 (#26778) 2021-10-19 16:54:55 +02:00
Ryan Mast
b72723d5d9 cli11: added v2.1.1, v2.1.0 (#26780) 2021-10-19 16:54:33 +02:00
Ryan Mast
65d344b2f8 cli11: disable building the examples (#26781) 2021-10-19 16:53:45 +02:00
Adam J. Stewart
9afc5ba198 py-pandas: add v1.3.4 (#26788) 2021-10-19 16:50:42 +02:00
Christopher Kotfila
ad35251860 Fix trigger and child links in pipeline docs (#26814) 2021-10-19 14:44:36 +00:00
Paul
9eaccf3bbf Add Go 1.17.2 and 1.16.9 (#26794) 2021-10-19 16:30:59 +02:00
Mark Grondona
bb1833bc8c flux: update maintainer of flux-core, flux-sched (#26800) 2021-10-19 16:30:33 +02:00
Robert Pavel
c66aa858c2 Made Legion Dependency on Gasnet Tarball Explicit (#26805)
Made legion dependency on a gasnet tarball explicit so as to take
advantage of spack mirrors for the purpose of deploying on machines with
firewalls
2021-10-19 16:28:43 +02:00
Erik Schnetter
4fc8ed10cb nsimd: add v3.0 (#26806) 2021-10-19 16:27:29 +02:00
Adam J. Stewart
0de8c65a2d Libtiff: improve compression support (#26809) 2021-10-19 16:17:37 +02:00
genric
42fb34e903 py-xarray: add v0.18.2 (#26811) 2021-10-19 16:15:56 +02:00
iarspider
d6fc914a9b Update py-importlib-metadata and py-setuptools-scm (#26813) 2021-10-19 16:08:53 +02:00
Massimiliano Culpo
79c92062a8 Gitlab pipelines: use images from the Spack organization (#26796) 2021-10-19 14:38:39 +02:00
Scott Wittenburg
95538de731 Speed up pipeline generation (#26622)
- [x] Stage already concretized specs instead of abstract ones
- [x] Reduce number of network calls by reading naughty list up front
2021-10-18 20:58:02 -07:00
Miguel Dias Costa
d41ddb8a9c new package: berkeleygw (#21455) 2021-10-18 18:17:58 -07:00
Harmen Stoppels
2b54132b9a cosma: add new versions and improve package (#24136)
* cosma: add new versions and improve package

* Move method below depends_on's
2021-10-18 18:06:14 -07:00
Todd Gamblin
c5ca0db27f patches: make re-applied patches idempotent (#26784)
We use POSIX `patch` to apply patches to files when building, but
`patch` by default prompts the user when it looks like a patch
has already been applied. This means that:

1. If a patch lands in upstream and we don't disable it
   in a package, the build will start failing.
2. `spack develop` builds (which keep the stage around) will
   fail the second time you try to use them.

To avoid that, we can run `patch` with `-N` (also called
`--forward`, but the long option is not in POSIX). `-N` causes
`patch` to just ignore patches that have already been applied.
This *almost* makes `patch` idempotent, except that it returns 1
when it detects already applied patches with `-N`, so we have to
look at the output of the command to see if it's safe to ignore
the error.

- [x] Remove non-POSIX `-s` option from `patch` call
- [x] Add `-N` option to `patch`
- [x] Ignore error status when `patch` returns 1 due to `-N`
- [x] Add tests for applying a patch twice and applying a bad patch
- [x] Tweak `spack.util.executable` so that it saves the error that
      *would have been* raised with `fail_on_error=True`. This lets
      us easily re-raise it.

Co-authored-by: Greg Becker <becker33@llnl.gov>
2021-10-18 23:11:42 +00:00
Mickaël Schoentgen
a118e799ae httpie: add v2.6.0 (#26791)
Signed-off-by: Mickaël Schoentgen <contact@tiger-222.fr>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-10-18 21:21:08 +00:00
Seth R. Johnson
bf42d3d49b file and python dependents: add missing dependencies (#26785)
* py-magic: delete redundant package

This package is actually named py-python-magic (since the project itself
is "python-magic").

* New package: libmagic

* Py-python-magic: add required runtime dependency on libmagic and new version

* Py-filemagic: add required runtime dependency

* py-magic: restore and mark as redundant

This reverts commit 4cab7fb69e.

* file: add implicit dependencies and static variant

Replaces redundant libmagic that I added. Compression headers were previously
being picked up from the system.

* Fix py-python-magic dependency

* Update python version requirements
2021-10-18 21:11:16 +00:00
Miroslav Stoyanov
e0ff44a056 tasmanian: add smoke test (#26763) 2021-10-18 16:09:46 -04:00
Seth R. Johnson
c48b733773 Make macOS installed libraries more relocatable (#26608)
* relocate: call install_name_tool less

* zstd: fix race condition

Multiple times on my mac, trying to install in parallel led to failures
from multiple tasks trying to simultaneously create `$PREFIX/lib`.

* PackageMeta: simplify callback flush

* Relocate: use spack.platforms instead of platform

* Relocate: code improvements

* fix zstd

* Automatically fix rpaths for packages on macOS

* Only change library IDs when the path is already in the rpath

This restores the hardcoded library path for GCC.

* Delete nonexistent rpaths and add more testing

* Relocate: Allow @executable_path and @loader_path
2021-10-18 13:34:16 -04:00
Shahzeb Siddiqui
3c013b5be6 docutils > 0.17 issue with rendering list items in sphinx (#26355)
* downgrade_docutils_version

* invalid version

* Update requirements.txt

* Improve spelling and shorten the reference link

* Update spack.yaml

* update version requirement

* update version to maximum of 0.16

Co-authored-by: bernhardkaindl <43588962+bernhardkaindl@users.noreply.github.com>
2021-10-18 16:55:46 +00:00
Harmen Stoppels
30e8dd95b5 Remove unused exist_errors in installer.py (#26650) 2021-10-18 15:53:51 +02:00
Harmen Stoppels
1e5f7b3542 Don't print error output in the test whether gpgconf works (#26682) 2021-10-18 15:52:53 +02:00
Sreenivasa Murthy Kolam
1156c7d0a9 allow multiple values for tensile_architecture and expand the gpu list for rocm-4.3.1 (#26745) 2021-10-18 08:48:07 +02:00
Xavier Delaruelle
cab17c4ac3 environment-modules: add version 5.0.1 (#26786) 2021-10-18 08:46:57 +02:00
Harmen Stoppels
33ef7d57c1 Revert 19736 because conflicts are avoided by clingo by default (#26721) 2021-10-18 08:41:35 +02:00
Valentin Volkl
9c7e71df34 py-jupytext: add new package (#26732)
* py-jupytext: add new package

* Apply suggestions from code review

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* update jupytext dependencies

* Apply suggestions from code review

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* py-jupytext: remove py-jupyerlab dependency

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-10-17 18:51:42 -05:00
Morten Kristensen
03f84fb440 py-vermin: add latest version 1.3.0 (#26787) 2021-10-17 11:46:53 -05:00
Valentin Volkl
d496568ff9 py-gevent: add version 1.5 (#26731)
* py-gevent: add version 1.5

* py-gevent: update dependencies for v1.5.0

* Apply suggestions from code review

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Update var/spack/repos/builtin/packages/py-gevent/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-10-17 11:07:11 -05:00
Sam Reeve
ba62b691a6 Add ECP tags for CoPA and related packages (#26739)
* Add ECP tags for CoPA (and related) packages

* Update CoPA maintainers
2021-10-17 10:00:28 -04:00
Ryan Mast
b794b5bd4d nlohmann-json: update to version 3.10.4 (#26779) 2021-10-17 09:56:20 -04:00
Bernhard Kaindl
64143f970e [Fix for the GitLab CI] phist: prefer @1.9.5 (1.9.6 is not compatible w/ mpich%gcc:9) (#26773)
* phist: Prefer 1.9.5 (1.9.6 uses mpi_f08, but not available in CI)

* phist: remove dupe of 1.9.5, missing preferred=True

Also, for 1.9.6, patch the (most, one does not work) tests to use
2021-10-16 11:18:07 -07:00
Scot Halverson
b2f059e547 Update GASNet package.py to include version 2021.9.0 (#26736) 2021-10-15 21:15:32 +02:00
Mosè Giordano
2cf7d43e62 libblastrampoline: add v3.1.0 (#26769)
Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2021-10-15 18:17:26 +00:00
Brice Videau
0bc1bffe50 Fix ruby dependent extensions. (#26729)
* Fix ruby dependent extensions.

* Added Kerilk as maintainer.
2021-10-15 16:59:32 +00:00
Axel Huebl
33da53e325 GCC: Conflict for <12 for M1 (#26318)
aarch64/M1 is only a supported build combination for GCC in
the planned GCC 12+ release.
2021-10-15 12:30:09 -04:00
Mickaël Schoentgen
6686db42ad py-charset-normalizer: add v2.0.7 (#26756)
Signed-off-by: Mickaël Schoentgen <contact@tiger-222.fr>
2021-10-15 15:58:09 +00:00
Manuela Kuhn
ec67bec22a py-rdflib: add 6.0.2 (#26757) 2021-10-15 10:35:59 -05:00
Manuela Kuhn
2a5a576667 py-ipykernel: add 6.4.1 and fix deps (#26758) 2021-10-15 10:34:51 -05:00
Manuela Kuhn
5dc8094f84 py-setuptools: add 58.2.0 (#26759) 2021-10-15 10:31:52 -05:00
Manuela Kuhn
012b4f479f py-jupyter-client: add 6.1.12 (#26760) 2021-10-15 10:30:50 -05:00
Harmen Stoppels
f8e4aa7d70 Revert "Don't run lsb_release on linux (#26707)" (#26754)
This reverts commit fcac95b065.
2021-10-15 09:34:04 +00:00
Harmen Stoppels
e0fbf09239 EnvironmentModifications: allow disabling stack tracing (#26706)
Currently Spack keeps track of the origin in the code of any
modification to the environment variables. This is very slow 
and enabled unconditionally even in code paths where the 
origin of the modification is never queried.

The only place where we inspect the origins of environment 
modifications is before we start a build, If there's an override 
of the type `e.set(...)` after incremental changes like 
`e.append_path(..)`, which is a "suspicious" change.

This is very rare though.

If an override like this ever happens, it might mean a package is
broken. If that leads to build errors, we can just ask the user to run
`spack -d install ...` and check the warnings issued by Spack to find
the origins of the problem.
2021-10-15 10:00:44 +02:00
Vanessasaurus
842e56efb8 libabigail: add v2.0 (#26753)
Signed-off-by: vsoch <vsoch@users.noreply.github.com>

Co-authored-by: vsoch <vsoch@users.noreply.github.com>
2021-10-15 07:53:29 +02:00
Joseph Wang
0749d94ad3 Disable parallel builds in groff and gosam-contrib (#26730)
Work around to #26726 and #26714
2021-10-15 07:20:18 +02:00
Cameron Rutherford
2bc0ea70ed HiOp: add v0.5.0 + small changes in dependencies (#26744) 2021-10-15 07:09:09 +02:00
kwryankrattiger
bf5ef3b6b9 paraview: add adios2 variant (#26728) 2021-10-15 07:07:04 +02:00
Timothy Brown
7ccdae5233 Removing NCEP Post (ncep-post). (#26749)
UPP and ncep-post are the same package, so this PR 
removes the duplication. 

ncep-post was originally named after the upstream repo
that now changed its name to UPP.
2021-10-15 07:04:14 +02:00
Eric Brugger
ea453db674 vtk: modify conflict between osmesa and qt (#26752) 2021-10-15 06:58:43 +02:00
Tamara Dahlgren
41d375f6a4 Stand-alone tests: disallow re-using an alias (#25881)
It can be frustrating to successfully run `spack test run --alias <name>` only to find you cannot get the results because you already use `<name>` in some previous stand-alone test execution.  This PR prevents that from happening.
2021-10-14 15:08:00 -07:00
Tamara Dahlgren
beb8a36792 Remove extra tag assignments (#26692) 2021-10-14 14:50:09 -07:00
Manuela Kuhn
28ebe2f495 py-datalad: add 0.15.2 (#26750) 2021-10-14 21:44:52 +00:00
Harmen Stoppels
4acda0839b cp2k: use variant propagation trick for virtuals (#26737) 2021-10-14 23:11:22 +02:00
Massimiliano Culpo
eded8f48dc ASP-based solver: add a rule for version uniqueness in virtual packages (#26740)
fixes #26718

A virtual package may or may not have a version, but it
never has more than one. Previously we were missing a rule
for that.
2021-10-14 23:06:41 +02:00
Christoph Junghans
d9d0ceb726 add py-pyh5md and update py-espressopp (#26746)
* add  py-pyh5md and update py-espressopp

* Update package.py
2021-10-14 19:17:02 +00:00
Bernhard Kaindl
6ca4d554cd libfive: Add all variants, +qt needs qt@5.15.2:+opengl (#26629)
Refresh of deps to fix the build and add variants from CMakeLists.txt
2021-10-14 11:42:01 -07:00
Mosè Giordano
74c6b7d8c1 sombrero: add version 2021-08-16 (#26741) 2021-10-14 19:41:50 +02:00
Bernhard Kaindl
95030a97b6 vc: Enable the testsuite, excluding tests failing on Zen2 (#26699)
This fixes running the testsuite, it adds the package virtest for it.
2021-10-14 09:02:31 -07:00
Miroslav Stoyanov
b64a7fe1ff switch to the smoke testing included in heffte (#26720) 2021-10-14 08:58:29 -07:00
iarspider
160371f879 alpgen: new package (#26713)
Co-authored-by: Bernhard Kaindl <43588962+bernhardkaindl@users.noreply.github.com>
2021-10-14 16:58:09 +02:00
Thomas Madlener
49354140be edm4hep: new version, fix tests (depends on catch2) (#26679) 2021-10-14 14:04:45 +00:00
Thomas Madlener
25704ae8e6 podio: new version and fix python unittest env (#26649) 2021-10-14 13:54:02 +00:00
Bernhard Kaindl
a61853816f phist: Fix build of 1.9.6, fix build- and install-tests (#26727)
Primary fix:

Due to a typo in a version range, overlapping PR merges resulted
in a build failure of the latest version:
Don't attempt to remove a non-existing file for version 1.9.6.

Secondary fixes:

update_tpetra_gotypes.patch was mentioned twice, and the version
range has to exclude @1.4.2, to which it cannot be applied.

Add depend_on() py-pytest, py-numpy and pkgconfig with type='test'

@:1.9.0 fail with 'Rank mismatch with gfortran@10:, add a conflicts().

raise InstallError('~mpi not possible with kernel_lib=builtin!')
when applicable.

Fixes for spack install --test=root phist:

mpiexec -n12 puts a lot of stress on a pod and gets stuck in a loop
very often: Reduce the mpiexec procs and the number of threads.

Remove @run_after('build') @on_package_attributes(run_tests=True):
from 'def check()': fixes it from getting called twice

The build script of 'make test_install' for the installcheck expects
the examples to be copied to self.stage.path: Provide them.
2021-10-14 08:14:25 -04:00
AMD Toolchain Support
8c1399ff7c LAMMPS: update recipe for %aocc (#26710)
* updating the recipe for betterment

* addressing the suggesions received from reviewers

* adding package helper macros

Co-authored-by: mohan002 <mohbabul@amd.com>
2021-10-14 12:03:15 +00:00
Eric Brugger
2bc97f62fd Qt: Qt fixes for a Cray AMD system. (#26722)
* Qt fixes for a Cray AMD system.

* Update to latest changes.
2021-10-14 07:41:26 -04:00
Massimiliano Culpo
949094544e Constrain abstract specs rather than concatenating strings in the "when" context manager (#26700)
Using the Spec.constrain method doesn't work since it might
trigger a repository lookup which could break our directives
and triggers a circular import error.

To fix that we introduce a function to merge abstract anonymous
specs, based only on package names, which does not perform any
lookup in the repository.
2021-10-14 12:33:10 +02:00
Bernhard Kaindl
2c3ea68dd1 openslide: Fix missing dependencies: gdk-pixbuf and perl-alien-libxml2 (#26620)
Add missing pkgconfig to openslide and its dep perl-alien-libxml2.

Fix shared-mime-info to be a runtime dependency of gdk-pixbuf,
Otherwise, configure cannot detect use gdk-pixbuf without error.
2021-10-13 19:07:27 -05:00
Bernhard Kaindl
99200f91b7 r-imager: add depends_on('r+X') and bump version (#26697) 2021-10-13 19:02:54 -05:00
Satish Balay
36bd69021d dealii: @9.3.1 has build errors with boost@1.77.0 - so add dependency on boost@1.76.0 [or lower] (#26709) 2021-10-14 01:30:53 +02:00
Harmen Stoppels
fcac95b065 Don't run lsb_release on linux (#26707)
Running `lsb_release` on Linux takes about 50ms because it is written in
Python. We do not use the output, so this change makes use not call it.
2021-10-14 01:27:24 +02:00
Manuela Kuhn
0227fc3ddc py-mne: add full variant (#26702) 2021-10-13 16:59:46 -05:00
Keita Iwabuchi
7c8c29a231 metall: add version 0.17 (#26694)
Co-authored-by: Bernhard Kaindl <43588962+bernhardkaindl@users.noreply.github.com>
2021-10-13 22:10:16 +02:00
Bernhard Kaindl
5782cb6083 magics: Add v4.9.3 to fix build with gcc@11, skip broken testcase (#26695)
To build with gcc-11, v4.9.3 is needed, conflict added for older revs.
2021-10-13 12:14:37 -07:00
Bernhard Kaindl
f4a132256a qgis: fix build of LTS release with proj>7 (#26696)
Co-authored-by: Sinan <sbulutw@gmail.com>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-10-13 20:42:18 +02:00
David Beckingsale
2864212ae3 Add camp 0.3.0 and 0.2.3 (#26717) 2021-10-13 18:41:35 +00:00
Bernhard Kaindl
87663c6796 vapor: Fix the build and update: Use correct deps and find numpy incdir (#26630)
vapor needs proj@:7 and gives a list of tested dependency versions.
Make it find the numpy include path and add version 3.5.0 as well
2021-10-13 13:25:18 -04:00
Bernhard Kaindl
14a929a651 sfcgal: build fails with cgal@:4.6, works with cgal@4.7: (#26642)
Use depends_on('cgal@4.7: +core') to fix the build
2021-10-13 11:47:09 -05:00
Bernhard Kaindl
bcd1272253 wireshark: Fix install race and skip network capture tests (#26698)
The network capture tests can't pass when built as normal user.
2021-10-13 12:39:19 -04:00
Todd Kordenbrock
6125117b5d SEACAS: add a Faodel variant (#26583)
* SEACAS: add a Faodel variant

* Use safer CMake and variant packages instead of directly adding parameters
Add a "+faodel ~mpi" dependency to balance "+faodel +mpi"
2021-10-13 12:39:11 -04:00
Satish Balay
37278c9fa0 superlu-dist add version 7.1.0 (#26708) 2021-10-13 11:34:43 -05:00
Patrick Gartung
047c95aa8d buildcache: do one less tar file extraction
The buildcache is now extracted in a temporary folder within the current store,
moved to its final place and relocated. 

"spack clean -s" has been extended to also clean the temporary extraction directory.

Add hardlinks with absolute paths for libraries in the corge, garply and quux packages
to detect incorrect handling of hardlinks in tests.
2021-10-13 17:38:29 +02:00
haralmha
e6b76578d2 Add version 4.12.0 (#26532) 2021-10-13 14:07:48 +00:00
iarspider
81c272fcb7 photos-f: new package (Fortran version) (#26703) 2021-10-13 15:56:11 +02:00
Jose E. Roman
c47eb7217e slepc: set up SLEPC_DIR for dependent packages (#26701) 2021-10-13 15:51:08 +02:00
Jen Herting
8ad608a756 py-convokit: new package (#26236)
Co-authored-by: Sid Pendelberry <sid@rit.edu>
2021-10-13 15:50:07 +02:00
Joseph Wang
252784ccf5 cppgsl: disable tests on gcc11 (#26593) 2021-10-13 09:36:45 -04:00
Bernhard Kaindl
b771c4ea01 phist: Fix build: ppc64_sse.patch only applies to 1.9.4 (#26704)
ppc64_sse.patch can only be applied to 1.9.4:
* Older releases don't have the patched file
* All newer releases carry the change of the patch already.
2021-10-13 09:20:50 -04:00
Francis Kloss
53461b7b04 salome-medcoupling: new package (with dependencies) (#25785)
Adds new packages for using MEDCoupling from SALOME platform
2021-10-13 13:50:37 +02:00
Joe Schoonover
4d58661d08 feq-parse: add version 1.1.0 and update maintainer (#26060) 2021-10-13 00:20:21 +00:00
Valentin Volkl
81d157b05e garfieldpp: update dependencies, add variant (#25816) 2021-10-13 02:13:50 +02:00
Jen Herting
0f9080738f [py-spacy] added version 2.3.7 (#25999) 2021-10-12 23:57:04 +00:00
Scott McMillan
b937aa205b Fix Amber patch target specification (#26687)
Co-authored-by: Scott McMillan <smcmillan@nvidia.com>
2021-10-13 00:15:05 +02:00
Jose E. Roman
31b0fe21a2 py-slepc4py: add missing depends_on() (#26688) 2021-10-13 00:09:19 +02:00
Bernhard Kaindl
e7bfaeea52 libical: Add missing deps: pkgconfig, glib and libxml2 (#26618)
Libical needs pkgconfig, glib and libxml2 to build.
2021-10-12 23:22:49 +02:00
Harmen Stoppels
1ed695dca7 Improve error messages for bootstrap download failures (#26599) 2021-10-12 22:11:07 +02:00
Bernhard Kaindl
b6ad9848d2 babelflow, parallelmergetree: fix build with gcc11 (#26681)
gcc-11 does not include the <limits> and <algorithm> as side effect
of including other header, at least not as often as earlier gcc did.
2021-10-12 21:45:00 +02:00
Stephen Herbein
8d04c8d23c flux-core, flux-sched: add 0.29.0, 0.18.0 and cleanup env vars (#26391)
Problem: Flux expects the `FLUX_PMI_LIBRARY_PATH` to point directly at
the `libpmi.so` installed by Flux.  When the env var is unset,
prepending to it results in this behavior.  In the rare case that the
env var is already set, then the spack `libpmi.so` gets prepended with a
`:`, which Flux then attempts to interpret as a single path.

Solution: don't prepend to the path, instead set the path to point to
the `libpmi.so` (which will be undone when Flux is unloaded).

* flux-core: remove deprecated environment variables

The earliest checksummed version in this package is 0.15.0. As of
0.12.0, wreck (and its associated paths) no longer exist in Flux. As of
0.13.0, the `FLUX_RCX_PATH` variables are no longer used. So clean up
these env vars from the `setup_run_environment`.
2021-10-12 21:39:43 +02:00
Adam J. Stewart
47554e1e2f GMT: add conflict for GCC 11 (#26684) 2021-10-12 17:56:17 +00:00
Bernhard Kaindl
862ce517ce gromacs: @2018:2020: add #include <limits> for newer %gcc builds (#26678)
gromacs@2018:2020.6 is fixed to build with gcc@11.2.0
by adding #include <limits> to a few header files.

Thanks to Maciej Wójcik <w8jcik@gmail.com> for testing versions.
2021-10-12 11:39:09 -06:00
Alexander Jaust
50a2316a15 Add missing spack command in basic usage tutorial (#26646)
The `find` command was missing for the examples forcing colorized output. Without this (or another suitable) command, spack produces output that is not using any color. Thus, without the `find` command one does not see any difference between forced colorized and non-colorized output.
2021-10-12 19:23:53 +02:00
Mark W. Krentel
2edfccf61d binutils: fix parallel make for version 2.36 (#26611)
There was a bug in 2.36.* of missing Makefile dependencies.  The
previous workaround was to require 2.36 to be built serially.  This is
now fixed upstream in 2.37 and this PR adds the patch to restore
parallel make to 2.36.
2021-10-12 19:01:46 +02:00
Veselin Dobrev
e2a64bb483 mfem: patch @4.3.0 to support hypre up to v2.23.0 (#26640) 2021-10-12 18:29:56 +02:00
Manuela Kuhn
ff66c237c0 py-niworkflows: add new package (#26639)
* py-niworkflows: add new package

* Update var/spack/repos/builtin/packages/py-niworkflows/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* remove unnecessary comment

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-10-12 11:22:44 -05:00
Manuela Kuhn
f8910c7859 py-nistats: add new package (#26662)
* py-nistats: add new package

* Update var/spack/repos/builtin/packages/py-nistats/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* remove `conflicts`

* remove test dependencies

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-10-12 11:22:00 -05:00
Harmen Stoppels
e168320bb1 spack: Add package (#25979)
* Make python 2 use 'from __future__ import absolute_import' to allow import spack.pkgkit

* Add Spack

* Improve ranges
2021-10-12 11:39:39 -04:00
Sergei Shudler
f58f5f8a0d babelflow, parallelmergetree: add the current versions (#26660) 2021-10-12 17:36:13 +02:00
Vanessasaurus
ce7eebfc1f allowing spack monitor to handle redirect (#26666)
when deployed on kubernetes, the server sends back permanent redirect responses.
This is elegantly handled by the requests library, but not urllib that we have
to use here, so I have to manually handle it by parsing the exception to
get the Location header, and then retrying the request there.

Signed-off-by: vsoch <vsoch@users.noreply.github.com>
2021-10-12 17:29:22 +02:00
Jonas Thies
f66ae104bf phist: force MPI compiler wrappers (#26312)
* packages/phist, re #26002: force phist to use MPI compiler wrappers (copied from trilinos package)

* packages/phist re #26002, use cmake-provded FindMPI module only

* packages/phist source code formatting

* packages/phist: set MPI_HOME rather than MPI_BASE_DIR, thanks @sethri.

* phist: delete own FindMPI.cmake for older versions (rather than patching it away)

* packages/phist: remove blank line

* phist: adjust sorting of imports

* phist: change order of imports
2021-10-12 11:11:00 -04:00
Joseph Wang
1e382d6d20 madgraph5amc: Add changes fixing bugs shown by gcc10 (#26643) 2021-10-12 15:55:48 +02:00
Martin Aumüller
6f8f37ffb1 ispc: update development branch name and limit to llvm@12 (#26676)
1.16 and 1.16.1 are not compatible with LLVM 13
2021-10-12 14:31:24 +02:00
Massimiliano Culpo
551120ee0b ASP-based solver: decrease the priority of multi-valued variant optimization for root (#26677)
The ASP-based solver maximizes the number of values in multi-valued
variants (if other higher order constraints are met), to avoid cases
where only a subset of the values that have been specified on the
command line or imposed by another constraint are selected.

Here we swap the priority of this optimization target with the
selection of the default providers, to avoid unexpected results
like the one in #26598
2021-10-12 14:15:48 +02:00
Harmen Stoppels
c2bf585d17 Fix potentially broken shutil.rmtree in tests (#26665)
Seems like https://bugs.python.org/issue29699 is relevant. Better to
just ignore errors when removing them tmpdir. The OS will remove it
anyways.

Errors are happening randomly from tests that are using this fixture.
2021-10-12 14:01:52 +02:00
Martin Diehl
66b32b337f damask{,-grid,-mesh}: add @3.0.0-alpha5 (#26570) 2021-10-12 13:22:09 +02:00
Maciej Wójcik
4b2cbd3aea gromacs: Add Gromacs 2020.6 and Plumed 2.7.2 (#26663) 2021-10-12 13:01:10 +02:00
Bernhard Kaindl
cb06f91df7 boost: Fix build of 1.53:1.54 with glibc>=2.17 (#26659)
Fix missing declaration of uintptr_t with glibc>=2.17 in 1.53:1.54
See: https://bugs.gentoo.org/482372
2021-10-12 10:59:36 +02:00
Harmen Stoppels
0c0831861c Avoid quadratic complexity in log parser (#26568)
TL;DR: there are matching groups trying to match 1 or more occurrences of
something. We don't use the matching group. Therefore it's sufficient to test
for 1 occurrence. This reduce quadratic complexity to linear time.

---

When parsing logs of an mpich build, I'm getting a 4 minute (!!) wait
with 16 threads for regexes to run:

```
In [1]: %time p.parse("mpich.log")
Wall time: 4min 14s
```

That's really unacceptably slow... 

After some digging, it seems a few regexes tend to have `O(n^2)` scaling
where `n` is the string / log line length. I don't think they *necessarily*
should scale like that, but it seems that way. The common pattern is this

```
([^:]+): error
```

which matches `: error` literally, and then one or more non-colons before that. So
for a log line like this:

```
abcdefghijklmnopqrstuvwxyz: error etc etc
```

Any of these are potential group matches when using `search` in Python:

```
abcdefghijklmnopqrstuvwxyz
 bcdefghijklmnopqrstuvwxyz
  cdefghijklmnopqrstuvwxyz
                         ⋮
                        yz
                         z
```

but clearly the capture group should return the longest match.

My hypothesis is that Python has a very bad implementation of `search`
that somehow considers all of these, even though it can be implemented
in linear time by scanning for `: error` first, and then greedily expanding
the longest possible `[^:]+` match to the left. If Python indeed considers
all possible matches, then with `n` matches of length `1 .. n` you
see the `O(n^2)` slowness (i verified this by replacing + with {1,k}
and doubling `k`, it doubles the execution time indeed).

This PR fixes this by removing the `+`, so effectively changing the 
O(n^2) into a O(n) worst case.

The reason we are fine with dropping `+` is that we don't use the
capture group anywhere, so, we just ensure `:: error` is not a match
but `x: error` is.

After going from O(n^2) to O(n), the 15MB mpich build log is parsed
in `1.288s`, so about 200x faster.

Just to be sure I've also updated `^CMake Error.*:` to `^CMake Error`,
so that it does not match with all the possible `:`'s in the line.
Another option is to use `.*?` there to make it quit scanning as soon as
possible, but what line that starts with `CMake Error` that does not have
a colon is really a false positive...
2021-10-12 00:05:11 -07:00
Manuela Kuhn
580a20c243 py-templateflow: add 0.4.2 (#26471)
* py-templateflow: add 0.4.2

* py-templateflow: fix python dependency for 0.4.2

* py-templateflow: remove wheel dependency for older versions
2021-10-11 21:37:50 -05:00
Manuela Kuhn
eb486371b2 py-pysurfer: add new package (#26638) 2021-10-11 21:36:43 -05:00
Manuela Kuhn
0da892f2dd py-pandas: fix installation and tests for versions @:0.25 (#26668) 2021-10-12 00:44:32 +00:00
Daniele Cesarini
a36a5ab624 fleur: new package (#26631) 2021-10-12 02:31:23 +02:00
Todd Kordenbrock
af2ecf87d4 Faodel: Update for the v1.2108.1 release (#26516) 2021-10-11 23:17:42 +00:00
Valentin Volkl
a0b9face0d frontier-client: add missing openssl dependency (#26636) 2021-10-12 01:02:12 +02:00
Kevin Pedretti
0b62974160 openblas: fix build on riscv64 (#26565)
OpenBLAS now has support for the riscv64 architecture. This commit
extends the spack openblas package.py to handle building on riscv64.
2021-10-12 00:55:45 +02:00
Alan Sill
833f1de24a bcl2fastq2: add boost@1.55 as default boost dependency (#26655)
When PR #26659 is merged, boost version boost@1.54.0 will be available for build too.

Co-authored-by: Bernhard Kaindl <43588962+bernhardkaindl@users.noreply.github.com>
2021-10-11 22:21:17 +00:00
Bernhard Kaindl
4eb176b070 motif package: fix linking the simple_app demo program (#26574) 2021-10-11 15:00:42 -07:00
Desmond Orton
95e63e0c29 New Package Qualimap:2.2.1 (#26615)
Co-authored-by: Bernhard Kaindl <43588962+bernhardkaindl@users.noreply.github.com>
2021-10-11 19:28:34 +00:00
Derek Ryan Strong
2644a15ff9 GNU parallel package: add version 20210922 (#26591) 2021-10-11 12:08:06 -07:00
Marie Houillon
c7785b74be openCARP packages: add version 8.1 (#26602) 2021-10-11 12:07:05 -07:00
Bernhard Kaindl
260f4ca190 mapserver: Add missing deps: giflib and postgresql (#26619) 2021-10-11 12:04:18 -07:00
Michael Kuhn
d1f3279607 installer: Support showing status information in terminal title (#16259)
Installing packages with a lot of dependencies does not have an easy way
of judging the current progress (apart from running `spack spec -I pkg`
in another terminal). This change allows Spack to update the terminal's
title with status information, including its current progress as well as
information about the current and total number of packages.
2021-10-11 17:54:59 +02:00
Seth R. Johnson
8f62039d45 llvm: add conflict for newer apple-clang versions (#26633) 2021-10-11 17:49:23 +02:00
Bernhard Kaindl
2e9512fe8b mesa: gallium fails with llvm@13: use 'llvm@6:12', add mesa@21.2.3 (#26627)
The software rasterizer of Mesa's Gallium3D(even @21.2.3) fails to
build with llvm@13.0.0, use: depends_on('llvm@6:12', when='+llvm')
2021-10-11 17:34:33 +02:00
Matthew Archer
e034930775 kahip: update build system to cmake for v3.11, retain scons for older versions (#25645)
* kahip: update to cmake for v3.11, retain scons for older versions

* kahip: update build system to cmake for v3.11, retain SCons for older versions

* address PR comments and add maintainer

* address PR comments - correct version to 2.10, add deprecated and url, and remove scons version
2021-10-11 10:20:43 -05:00
Daniele Cesarini
79aba5942a Update of siesta libs (#26489) 2021-10-11 09:09:39 -05:00
iarspider
78200b6b41 Add new versions of kiwisolver (#26597) 2021-10-11 09:09:01 -05:00
Harmen Stoppels
89220bc0e1 Only install env modifications in <prefix>/.spack (#24081)
- Do not store the full list of environment variables in
  <prefix>/.spack/spack-build-env.txt because it may contain user secrets.

- Only store environment variable modifications upon installation.

- Variables like PATH may still contain user and system paths to make
  spack-build-env.txt sourceable. Variables containing paths are
  modified through prepending/appending, and if we don't apply these
  to the current environment variable, we end up with statements like
  `export PATH=/path/to/spack/bin` with system paths missing, meaning
  no system binaries are in the path, which is a bad user experience.

- Do write the full environment to spack-build-env.txt in the staging dir,
  but ensure it is readonly for the current user, to make it a bit safer
  on shared systems.
2021-10-11 09:07:45 -05:00
Harmen Stoppels
c0c9ab113e Add spack env activate --temp (#25388)
Creates an environment in a temporary directory and activates it, which
is useful for a quick ephemeral environment:

```
$ spack env activate -p --temp
[spack-1a203lyg] $ spack add zlib
==> Adding zlib to environment /tmp/spack-1a203lyg
==> Updating view at /tmp/spack-1a203lyg/.spack-env/view
```
2021-10-11 06:56:03 -04:00
Harmen Stoppels
f28b08bf02 Remove unused --dependencies flag (#25731) 2021-10-11 10:16:11 +02:00
iarspider
ad75f74334 New package: py-cppy (required for py-kiwisolver) (#26645) 2021-10-10 17:14:20 -05:00
Manuela Kuhn
4e1fdfeb18 py-nilearn: add 0.4.2 and 0.6.2 (#26635) 2021-10-09 19:14:13 -05:00
Manuela Kuhn
7f46b9a669 py-pyvistaqt: add new package (#26637) 2021-10-09 21:00:00 +00:00
Michael Kuhn
5deb8a05c4 environment-modules: fix build (#26632)
PR #25904 moved the `--with-tcl` option to only older versions. However,
without this option, the build breaks:
```
checking for Tcl configuration... configure: error: Can't find Tcl configuration definitions. Use --with-tcl to specify a directory containing tclConfig.sh
```
2021-10-09 12:43:54 -05:00
Bernhard Kaindl
9194ca1e2f idna: Add versions 2.9 for sierrapy #23768 and 3.2(current) (#26616)
py-sierrapy was merged accidentally and pins its versions to exact
numbers. Add 2.9 as the version for sierrapy and the current 3.2
2021-10-09 11:31:11 -05:00
Joseph Wang
e6cc92554d py-awkward: add py-yaml as depends (#26626) 2021-10-09 17:35:22 +02:00
Joseph Wang
03ab5dee31 evtgen: fix pythia typo (#26625) 2021-10-09 16:11:58 +02:00
Bernhard Kaindl
93df47f4d5 librsvg: fix build when does not use -pthread for linking (#26592)
librsvg uses pthread_atfork() but does not use -pthread on Ubuntu 18.04 %gcc@8
2021-10-09 13:10:13 +02:00
Derek Ryan Strong
4b5cc8e3bd Add R 4.1.1 (#26589) 2021-10-08 20:02:03 -05:00
Derek Ryan Strong
e89d4b730a Add Julia 1.6.3 (#26624) 2021-10-09 00:58:19 +00:00
Massimiliano Culpo
2386630e10 Remove DB reindex during a read operation (#26601)
The DB should be what is trusted for certain operations.
If it is not present when read we should assume the
corresponding store is empty, rather than trying a
write operation during a read.

* Add a unit test
* Document what needs to be there in tests
2021-10-08 22:35:23 +00:00
Bernhard Kaindl
21ce23816e py-twisted,py-storm: dep on zope.interface, bump storm version (#26610)
* py-twisted,py-storm: dep on zope.interface, bump storm version

py-twisted and py-storm's import tests need zope.interface.
py-storm: Use pypi and add version 0.25. It didn't change reqs.
zope.infterface@4.5.0 imports removed Feature: Use setuptools@:45

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* py-storm: all deps updated with type=('build', 'run')

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-10-08 21:20:39 +00:00
psakievich
8ebb705871 Trilinos: update for CUDA and Nalu-Wind (#26614) 2021-10-08 21:08:54 +00:00
Bernhard Kaindl
7e8f2e0c11 py-hypothesis: Add variants django, dumpy, pandas and fix import tests (#26604) 2021-10-08 21:00:47 +00:00
Manuela Kuhn
654268b065 py-bcrypt, py-bleach, py-decorator, py-pygdal: fix python dependency (#26596)
* py-bcrypt, py-bleach, py-decorator, py-pygdal: fix python dependency

* Update var/spack/repos/builtin/packages/py-bleach/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-10-08 15:56:22 -05:00
Bernhard Kaindl
6d0d8d021a py-pymatgen: fix build of old versions, bump version to 2021.3.9 (#26249)
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-10-08 19:54:40 +00:00
Bernhard Kaindl
f1f614ee9f py-anytree: Add dep py-six@1.9.0 as required by setup.py (#26603)
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-10-08 19:36:12 +00:00
Manuela Kuhn
88c33686fd py-matplotlib: fix 3.4.3 (#26586)
* py-matplotlib: fix 3.4.3

* Update var/spack/repos/builtin/packages/py-matplotlib/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-10-08 13:52:10 -05:00
Bernhard Kaindl
de86726483 py-traceback2: Fix depends_on: add six and py-linecache2 (#26607) 2021-10-08 13:35:36 -05:00
Bernhard Kaindl
a95c1dd615 py-keras-preprocessing: Add missing deps: six@1.9.0: and numpy@1.9.1: (#26605)
* py-keras-preprocessing: Add missing deps: six@1.9.0: and numpy@1.9.1:

Add deps: pip download --no-binary :all: keras-preprocessing==1.1.2
Collecting numpy>=1.9.1
  Installing build dependencies: started
Collecting six>=1.9.0

* Update var/spack/repos/builtin/packages/py-keras-preprocessing/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-10-08 13:34:25 -05:00
Harmen Stoppels
7d89a95028 Fix leaky spack.binary_distribution.binary_index in tests (#26609)
* Fix issues with leaky binary index across tests

* More rigorous binary_index reset as now other tests are failing :(
2021-10-08 13:41:47 -04:00
Manuela Kuhn
32b35e1a78 py-neurora: add new package (#26479) 2021-10-08 13:39:45 +00:00
Tamara Dahlgren
7f2611a960 Allow Version('') and map it to the empty tuple (#25953) 2021-10-08 10:36:54 +02:00
Rodrigo Ceccato de Freitas
169d0a5649 cling: add missing CMake dependency (#26577) 2021-10-08 09:28:37 +02:00
Adam J. Stewart
f390289629 More strict ReadTheDocs tests (#26580) 2021-10-08 09:27:17 +02:00
Daniel G Travieso
10de12c7d0 add hash field to spec on find --json and assert in test its there (#26443)
Co-authored-by: Daniel Travieso <daniel@dgtravieso.com>
2021-10-07 23:50:05 -07:00
Bernhard Kaindl
449a5832c8 llvm: llvm@13+libcxx needs a very recent C++ compiler (#26584)
libc++-13 does not support %gcc@:10, see:
https://bugs.llvm.org/show_bug.cgi?id=51359#c1

https://libcxx.llvm.org/#platform-and-compiler-support says:
- GCC    11     - latest stable release per GCC’s release page
- Clang: 11, 12 - latest two stable releases per LLVM’s release page
- AppleClang 12 - latest stable release per Xcode’s release page
2021-10-08 00:25:51 +00:00
Pedro Demarchi Gomes
28529f9eaf re2 pic support (#26513) 2021-10-08 01:01:40 +02:00
Oliver Perks
da31c7e894 Updatepackage/minigmg (#26467)
* MiniGMG, add support for optimised flags + SIMDe implementation of AVX instrinsics

* Add .gitlab-ci.yml

* NVHPC fast

* remove CI

* Syntax fix
2021-10-07 14:49:14 -05:00
Paul Ferrell
0b9914e2f5 Fix for license symlinking issue. (#26576)
When a symlink to a license file exists but is broken, the license symlink post-install hook fails
because os.path.exists() checks the existence of the target not the symlink itself.
os.path.lexists() is the proper function to use.
2021-10-07 19:18:35 +00:00
Seth R. Johnson
9853fd50e2 itk: use CMakePackage helpers (#26572) 2021-10-07 10:49:51 -05:00
Scott Wittenburg
0561af1975 Pipelines: retry service job on system errors (#26508)
Retry rebuild-index, cleanup, and no-op jobs automatically if they fail
due to infrastructure-related problems.
2021-10-07 08:59:51 -06:00
Kevin Huck
b33a0923e1 apex: support profiling/tracing HIP applications (#26569)
libz is added for compressing google trace events output.
2021-10-07 16:22:40 +02:00
Harmen Stoppels
05834e7c9d Memoize the result of spack.platforms.host() (#26573) 2021-10-07 14:04:05 +02:00
Olivier Cessenat
20ee786d09 visit: add an external find function (determine_version) (#25817)
* visit: add an external find function (determine_version)

* visit: correct too long comment line

* visit: forgot to set executables

* visit: external find uses signgle dash version

* visit: found as external asking visit version
2021-10-07 10:19:58 +00:00
Manuela Kuhn
653d5e1590 py-mayavi: add 4.7.3 (#26566) 2021-10-06 19:15:34 -05:00
Tyler Funnell
60909f7250 fish: adding version 3.3.1 (#26488)
* fish: adding version 3.3.1

* adding maintainer

* Update var/spack/repos/builtin/packages/fish/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-10-06 20:42:45 +00:00
Manuela Kuhn
b787065bdb py-scikit-image: add 0.18.3 and fix dependencies (#26406) 2021-10-06 15:30:27 -05:00
Jen Herting
3945e2ad93 New package: py-clean-text (#26511)
* [py-clean-text] created template

* [py-clean-text]

- added description
- added dependencies
- removed fixmes
2021-10-06 19:44:33 +00:00
Tamara Dahlgren
affd2236e6 Provide more info in SbangPathError to aid CI debugging (#26316) 2021-10-06 21:03:33 +02:00
Kevin Pedretti
cb5b28392e Patch from upstream needed to build numactl on riscv64. (#26541)
The most recent release of numactl (2.0.14) fails to build on riscv64
because of a missing "-latomic". This patch from upstream resolves this
issue. It can be dropped once the next version of numactl is released.
2021-10-06 11:50:21 -07:00
Rodrigo Ceccato de Freitas
b1f7b39a06 ucx: fix typo in config description (#26564) 2021-10-06 18:44:22 +00:00
Manuela Kuhn
770c4fd0b2 py-nipype: add 1.4.2 (#26472) 2021-10-06 20:35:42 +02:00
Massimiliano Culpo
98ee00b977 Restore the correct computation of stores in environments (#26560)
Environments push/pop scopes upon activation. If some lazily
evaluated value depending on the current configuration was
computed and cached before the scopes are pushed / popped
there will be an inconsistency in the current state.

This PR fixes the issue for stores, but it would be better
to move away from global state.
2021-10-06 11:32:26 -07:00
Jose E. Roman
fdf76ecb51 New release slepc4py 3.16.0 (#26468) 2021-10-06 11:18:53 -07:00
Manuela Kuhn
9a75f44846 py-svgutils: add 0.3.1 (#26470) 2021-10-06 11:15:36 -07:00
haralmha
6ce4d26c25 Add 1.4.2 (#26475) 2021-10-06 11:13:55 -07:00
haralmha
8fc04984ba Add 1.9.3 (#26483) 2021-10-06 11:10:58 -07:00
haralmha
cfde432b19 Add 1.1.1 (#26484) 2021-10-06 11:10:05 -07:00
haralmha
ae9428df84 Add 14.16.1 (#26485) 2021-10-06 11:09:06 -07:00
haralmha
533705f4e3 Add 1.0.2 (#26486) 2021-10-06 10:50:28 -07:00
haralmha
2b6d7cc74c Add 4.2.0 (#26498) 2021-10-06 10:35:04 -07:00
g-mathias
9978353057 New package: intel oneapi advisor (#26535)
Co-authored-by: lu64bag3 <gerald.mathias@lrz.de>
2021-10-06 10:28:55 -07:00
Massimiliano Culpo
319ae9254e Remove the spack.architecture module (#25986)
The `spack.architecture` module contains an `Arch` class that is very similar to `spack.spec.ArchSpec` but points to platform, operating system and target objects rather than "names". There's a TODO in the class since 2016:

abb0f6e27c/lib/spack/spack/architecture.py (L70-L75)

and this PR basically addresses that. Since there are just a few places where the `Arch` class was used, here we query the relevant platform objects where they are needed directly from `spack.platforms`. This permits to clean the code from vestigial logic.

Modifications:
- [x] Remove the `spack.architecture` module and replace its use by `spack.platforms`
- [x] Remove unneeded tests
2021-10-06 10:28:12 -07:00
g-mathias
232086c6af new package: intel oneapi inspector (#26549)
Co-authored-by: lu64bag3 <gerald.mathias@lrz.de>
2021-10-06 10:25:18 -07:00
Danny McClanahan
e2e8e5c1e2 use conflicts() instead of referring to SpecError in mesa (#26562)
* mesa: use conflicts() instead of referring to SpecError
2021-10-06 10:07:42 -07:00
Paul R. C. Kent
fefe624141 llvm: new version 13.0.0 (#26563) 2021-10-06 16:53:49 +00:00
Alec Scott
4732c722e7 Add v1.56.2 to Rclone (#26556) 2021-10-06 09:53:34 -07:00
Alec Scott
97407795f6 Add v5.3.0 to Superlu (#26558) 2021-10-06 09:50:12 -07:00
haralmha
fe723b2ad8 py-jupyter-client: add 6.1.12 (#26503) 2021-10-06 09:21:10 -04:00
haralmha
d27bb7984a py-ptyprocess: add 0.7.0 (#26504) 2021-10-06 09:20:30 -04:00
haralmha
a59d6be99b py-setuptools: add 57.1.0 (#26505) 2021-10-06 09:19:49 -04:00
haralmha
ceb962fe17 py-six: add 1.16.0 (#26506) 2021-10-06 09:18:55 -04:00
Manuela Kuhn
11bdd18b1f py-matplotlib: fix qhull dependency (#26553) 2021-10-06 09:18:11 -04:00
Jen Herting
b92fd08028 py-ftfy: added version 6.0.3 (#26509) 2021-10-06 08:51:15 -04:00
Jen Herting
bc152fc6c4 New package: py-emoji (#26510)
* [py-emoji] created template

* [py-emoji]

- removed fixmes
- added homepage
- added description
- added dependencies
2021-10-06 08:50:24 -04:00
Frédéric Simonis
51f77f8af1 precice: add version 2.3.0 (#26551) 2021-10-06 08:44:59 -04:00
haralmha
8366f87cbf gnuplot: add version 5.4.2 (#26529) 2021-10-06 08:41:49 -04:00
haralmha
ab5962e997 hadoop: add version 2.7.5 (#26530) 2021-10-06 08:41:28 -04:00
haralmha
943f1e7a3a Add 7.6.3 (#26502) 2021-10-06 14:04:48 +02:00
Ivan Maidanski
1d258151f3 bdw-gc: add v8.0.6 (#26545) 2021-10-06 07:24:51 -04:00
haralmha
2cdfa33677 Add 6.0.2 (#26501) 2021-10-06 13:19:29 +02:00
haralmha
199bd9f8f8 py-decorator: Add version 5.0.9 and 5.10. (#26500)
Co-authored-by: Bernhard Kaindl <bernhardkaindl7@gmail.com>
2021-10-06 02:24:47 +00:00
haralmha
0c02f6c36d py-hepdata-validator: Add version 0.2.3 and 0.3.0 (#26496)
Co-authored-by: Bernhard Kaindl <bernhardkaindl7@gmail.com>
2021-10-06 02:15:06 +00:00
haralmha
c97c135f1d py-heapdict: Add version 1.0.0 (#26495)
Co-authored-by: Bernhard Kaindl <bernhardkaindl7@gmail.com>
2021-10-06 01:16:18 +00:00
haralmha
d07c366408 Add 1.28.1 (#26494)
py-grpcio: Add version 1.28.1
2021-10-06 02:27:55 +02:00
haralmha
df93becc99 Add 2021.4.1 (#26493)
py-distributed: Add version 2021.4.1
2021-10-06 02:26:05 +02:00
haralmha
5e9497e05a Add 0.7.1 (#26492)
py-defusedxml: add version 0.7.1
2021-10-06 02:25:04 +02:00
haralmha
2e28281f1a py-bleach: Add version 3.3.1 (#26490)
Co-authored-by: Bernhard Kaindl <bernhardkaindl7@gmail.com>
2021-10-06 00:18:09 +00:00
haralmha
e8b9074300 py-dask: add version 2021.4.1 (#26491) 2021-10-06 02:17:52 +02:00
haralmha
eafa0ff085 py-pygdal: Add versions 3.3.0.10 and 3.3.2.10 (#26528)
Co-authored-by: Bernhard Kaindl <bernhardkaindl7@gmail.com>
2021-10-05 23:57:59 +00:00
haralmha
b20e7317ab py-backcall: Add version 0.2.0 (#26487) 2021-10-06 01:55:27 +02:00
haralmha
2773178897 Add versions 3.1.6, 3.1.7 and 3.2.0 (#26527) 2021-10-06 01:48:18 +02:00
Bernhard Kaindl
e39866f443 h5utils: Fix build and add new version (#26133)
@1.12.1+png depends_on libpng@:1.5.0 because it needs the old API

Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
2021-10-05 23:13:02 +00:00
Massimiliano Culpo
d7fc17d5db Set explicitly write permission for packages (#26539) 2021-10-05 23:12:25 +00:00
Olivier Cessenat
cc6508ec09 vtk: gui support for vtk 9 added (#25636) 2021-10-05 22:54:39 +00:00
haralmha
3157a97743 Add version 3.16.1 (#26534) 2021-10-06 00:27:17 +02:00
haralmha
aac7e28ea0 dd4hep: Add version 01-18 (#26525)
* Add 01-18

* Keep master on top and change version name format
2021-10-05 17:37:31 -04:00
Kevin Pedretti
47607dcac5 Use gnuconfig package for config file replacement for RISC-V. (#26364)
* Use gnuconfig package for config file replacement for RISC-V.

This extends the changes in #26035 to handle RISC-V. Before this change,
many packages fail to configure on riscv64 due to config.guess being too
old to know about RISC-V. This is seen out of the box when clingo fails
to build from source due to pkgconfig failing to configure, throwing
error: "configure: error: cannot guess build type; you must specify one".

* Add riscv64 architecture

* Update vendored archspec from upstream project.
These archspec updates include changes needed to support riscv64.

* Update archspec's __init__.py to reflect the commit hash of archspec being used.
2021-10-05 19:22:55 +00:00
Harmen Stoppels
d998ea1bd4 Move shell aware env into spack.environment.shell (#25608)
Cherry-picked from #25564 so this is standalone.

With this PR we can activate an environment in Spack itself, without computing changes to environment variables only necessary for "shell aware" env activation.

1. Activating an environment:
    
    ```python
    spack.environment.activate(Environment(xyz)) -> None
    ```
    this basically just sets `_active_environment` and modifies some config scopes.

2. Activating an environment **and** getting environment variable modifications for the shell:

    ```python
    spack.environment.shell.activate(Environment(xyz)) -> EnvironmentModifications
    ```

This should make it easier/faster to do unit tests and scripting with spack, without the cli interface.
2021-10-05 18:25:43 +00:00
haralmha
713bbdbe7c postgresql: Add versions 14.0 and 12.2 (#26499) 2021-10-05 13:34:46 +02:00
haralmha
789beaffb7 doxygen: Add versions 1.9.2 and 1.8.18 (#26497) 2021-10-05 12:49:48 +02:00
Ricardo Jesus
4ee74c01e3 meme: Fix compilation with arm and nvhpc compilers (#24883)
* Fix compilation with `arm` and `nvhpc` compilers

* Update package.py
2021-10-05 05:55:12 -04:00
Jonas Thies
7f2fd50d20 phist: add a patch for the case +host arch=ppc64le (#26216) 2021-10-05 08:33:41 +00:00
Guilherme Perrotta
7ea9c75494 py-flatbuffers: add new package (#26444)
Python port of the "flatbuffers" package
2021-10-05 10:10:43 +02:00
Ivan Maidanski
1a651f1dca libatomic_ops: add v7.6.12 (#26512) 2021-10-05 10:08:57 +02:00
Manuela Kuhn
4e6f2ede0a py-rsatoolbox: add new package (#26514) 2021-10-05 10:07:03 +02:00
Axel Huebl
e1fb77496c WarpX: 21.10 (#26507) 2021-10-05 10:01:26 +02:00
David Gardner
85de527668 sundials: Add 5.8.0 and sycl variant (#26524) 2021-10-05 10:00:11 +02:00
Heiko Bauke
f6a4f6bda7 mpl: add new package (#26522) 2021-10-05 09:59:14 +02:00
Mihael Hategan
95846ad443 py-parsl: new package (see https://parsl-project.org/) (#26360) 2021-10-05 09:53:02 +02:00
Massimiliano Culpo
337b54fab0 Isolate bootstrap configuration from user configuration (#26071)
* Isolate bootstrap configuration from user configuration

* Search for build dependencies automatically if bootstrapping from sources

The bootstrapping logic will search for build dependencies
automatically if bootstrapping anything form sources. Any
external spec, if found, is written in a scope that is specific
to bootstrapping.

* Don't clean the bootstrap store with "spack clean -a"

* Copy bootstrap.yaml and config.yaml in the bootstrap area
2021-10-05 09:16:09 +02:00
Seth R. Johnson
3cf426df99 zstd: fix install name on macOS (#26518)
Reverting from CMake to Make install caused
`-install_path=/usr/local/lib/libzstd.1.dylib` to be hardcoded into the
zstd. Now we explicitly pass the PREFIX into the build command so that
the correct spack install path is saved.

Fixes #26438 and also the ROOT install issue I had :)
2021-10-05 02:03:48 +00:00
Nisarg Patel
b5673d70de molden: fix build with gcc@10: (#25803) 2021-10-05 01:36:20 +00:00
Todd Gamblin
84c878b66a cc: make error messages more clear
- [x] Our wrapper error messages are sometimes hard to differentiate from other build
      output, so prefix all errors from `die()` with '[spack cc] ERROR:'

- [x] The error we raise when running, say, `fc` without a Fortran compiler was not
      clear enough. Clarify the message and the comment.
2021-10-04 18:30:19 -07:00
Todd Gamblin
052b2e1b08 cc: convert compiler wrapper to posix shell
This converts everything in cc to POSIX sh, except for the parts currently
handled with bash arrays. Tests are still passing.

This version tries to be as straightforward as possible. Specifically, most conversions
are kept simple -- convert ifs to ifs, handle indirect expansion the way we do in
`setup-env.sh`, only mess with the logic in `cc`, and don't mess with the python code at
all.

The big refactor is for arrays. We can't rely on bash's nice arrays and be ignorant of
separators anymore. So:

1. To avoid complicated separator logic, there are three types of lists. They are:

    * `$lsep`-separated lists, which end with `_list`. `lsep` is customizable, but we
      picked `^G` (alarm bell) for `$lsep` because it's ASCII and it's unlikely that it
      would actually appear in any arguments. If we need to get fancier (and I will lose
      faith in the world if we do) then we could consider XON or XOFF.
    * `:`-separated directory lists, which end with `_dirs`, `_DIRS`, `PATH`, or `PATHS`
    * Whitespace-separated lists (like flags), which can have any other name.

    Whitespace and colon-separated lists come with the territory with PATHs from env
    vars and lists of flags. `^G` separated lists are what we use for most internal
    variables, b/c it's more likely to work.

2. To avoid subshells, use a bunch of functions that do dirty `eval` stuff instead. This
   adds 3 functions to deal with lists:

    * `append LISTNAME ELEMENT [SEP]` will put `ELEMENT` at the end of the list called
      `LISTNAME`. You can optionally say what separator you expect to use. Note that we
      are taking advantage of everything being global and passing lists by name.

    * `prepend LISTNAME ELEMENT [SEP]` like append, but puts `ELEMENT` at the start of
      `LISTNAME`

    * `extend LISTNAME1 LISTNAME2 [PREFIX]` appends everything in LISTNAME2 to
       LISTNAME1, and optionally prepends `PREFIX` to every element (this is useful for
       things like `-I`, `-isystem `, etc.

    * `preextend LISTNAME1 LISTNAME2 [PREFIX]` prepends everything in LISTNAME2 to
       LISTNAME1 in order, and optionally prepends `PREFIX` to every element.

The routines determine the separator for each argument by its name, so we don't have to
pass around separators everywhere. Amazingly, as long as you do not expand variables'
values within an `eval` environment, you can do all this and still preserve quoting.
When iterating over lists, the user of this API still has to set and unset `IFS`
properly.

We ended up having to ignore shellcheck SC2034 (unused variable), because using evals
all over the place means that shellcheck doesn't notice that our list variables are
actually used.

So far this is looking pretty good. I took the most complex unit test I could find
(which runs a sample link line) and ran the same command line 200 times in a shell
script.  Times are roughly as follows:

For this invocation:

```console
$ bash -c 'time (for i in `seq 1 200`; do ~/test_cc.sh > /dev/null; done)'
```

I get the following performance numbers (the listed shells are what I put in `cc`'s
shebang):

**Original**
* Old version of `cc` with arrays and `bash v3.2.57` (macOS builtin): `4.462s` (`.022s` / call)
* Old version of `cc` with arrays and `bash v5.1.8` (Homebrew): `3.267s` (`.016s` / call)

**Using many subshells (#26408)**
*  with `bash v3.2.57`: `25.302s` (`.127s` / call)
*  with `bash v5.1.8`: `27.801s` (`.139s` / call)
*  with `dash`: `15.302s` (`.077s` / call)

This version didn't seem to work with zsh.

**This PR (no subshells)**
*  with `bash v3.2.57`: `4.973s` (`.025s` / call)
*  with `bash v5.1.8`: `4.984s` (`.025s` / call)
*  with `zsh`: `2.995s` (`.015s` / call)
*  with `dash`: `1.890s` (`.0095s` / call)

Dash, with the new posix design, is easily the winner.

So there are several interesting things to note here:

1. Running the posix version in `bash` is slower than using `bash` arrays. That is to be
   expected because it's doing a bunch of string processing where it likely did not have
   to before, at least in `bash`.

2. `zsh`, at least on macOS, is significantly faster than the ancient `bash` they ship
   with the system. Using `zsh` with the new version also makes the posix wrappers
   faster than `develop`. So it's worth preferring `zsh` if we have it. I suppose we
   should also try this with newer `bash` on Linux.

3. `bash v5.1.8` seems to be significantly faster than the old system `bash v3.2.57` for
   arrays. For straight POSIX stuff, it's a little slower. It did not seem to matter
   whether `--posix` was used.

4. `dash` is way faster than `bash` or `zsh`, so the real payoff just comes from being
   able to use it. I am not sure if that is mostly startup time, but it's significant.
   `dash` is ~2.4x faster than the original `bash` with arrays.

So, doing a lot of string stuff is slower than arrays, but converting to posix seems
worth it to be able to exploit `dash`.

- [x] Convert all but array-related portions to sh
- [x] Fix basic shellcheck issues.
- [x] Convert arrays to use a few convenience functions: `append` and `extend`
- [x] Get `cc` tests passing.
- [x] Add `cc` tests where needed passing.
- [x] Benchmarking.

Co-authored-by: Tom Scogland <scogland1@llnl.gov>
Co-authored-by: Danny McClanahan <1305167+cosmicexplorer@users.noreply.github.com>
2021-10-04 18:30:19 -07:00
Todd Gamblin
472638f025 .gitignore needs to be below env and ENV for case-insensitive FS 2021-10-04 18:30:19 -07:00
haralmha
8d0025b8af Add 5.2.0 (#26481) 2021-10-04 19:37:34 -05:00
Martin Pokorny
32f8dad0e2 log4cxx: new version and fix for c++11 (#26480)
* Add version 0.12.1

* Add variant to build with C++11 standard

build with c++11 standard requires boost threads, and needs explicit setting of
CMAKE_CXX_STANDARD
2021-10-05 00:34:03 +00:00
KoyamaSohei
c426386f46 intel-tbb: install pkgconfig file (#23977)
* intel-tbb: install pkgconfig file

* intel-tbb: install pkgconfig file when @:2021.2.0

* intel-tbb: add blank line

* intel-tbb: fix library name to refer

* intel-tbb: fix library name to refer again

* intel-tbb: use self.prefix.lib.pkgconfig
2021-10-04 21:38:31 +00:00
Tamara Dahlgren
5a9e5ddb3d Stand-alone tests: distinguish NO-TESTS from PASSED (#25880)
Co-authored-by: Seth R. Johnson <johnsonsr@ornl.gov>
2021-10-04 19:57:08 +00:00
snehring
675bdada49 esys-particle: add new package esys-particle (#25338)
* esys-particle: add new package esys-particle

* esys-particle: requested changes

* esys-particle: placating isort
2021-10-04 19:41:31 +00:00
Daniel Ahlin
c59223effe gcc: apply nvcc patch to more versions (#24295)
Apply to all known affected versions (10.1.0 to 10.3.0 and 11.1.0)
2021-10-04 21:02:57 +02:00
haralmha
6a6bc3ecbb git: new version 2.29.2 (#26478) 2021-10-04 18:23:38 +00:00
iarspider
b88c80bb1b Add new pythia8 variants and fix url_for_version (#26280)
* Add new pythia8 variants
Add proper description to the existing ones

* Flake-8

* Flake-8

* Style

* Fix Pythia8 recipe

* Fix typo in variant description

* Update package.py
2021-10-04 12:52:51 -05:00
haralmha
b9e8d2d648 cppgsl: new version 3.1.0 (#26477) 2021-10-04 13:25:44 -04:00
Manuela Kuhn
377c781d7e py-scikit-learn: add 0.19.2 and 0.22.2.post1 (#26473) 2021-10-04 18:48:26 +02:00
snehring
9a8712f4cb masurca: Fix build with glibc-2.32+ (#26173)
remove sysctl.h which is not used by the build
2021-10-04 17:59:01 +02:00
Pedro Demarchi Gomes
90fa50d9df Avoid replacing symlinked spack.yaml when concretizing an environment (#26428) 2021-10-04 14:59:03 +00:00
Pedro Demarchi Gomes
4ae71b0297 use umpire version 5.0.1:5 (#26451) 2021-10-04 16:32:47 +02:00
Vicente Bolea
572791006d paraview: add v5.10.0-RC1 release (#26291) 2021-10-04 09:32:03 -04:00
mcuma
fa528c96e6 octave: add support for MKL (#25952) 2021-10-04 14:57:57 +02:00
iarspider
4f1c195bf9 grpc: update recipe (#25261)
1) forward `+shared` to re2
2) add `cxxstd` variant
3) use "more idiomatic" way of setting CMake options
2021-10-04 14:53:17 +02:00
Andreas Baumbach
35dd474473 Improve an error message in stage.py (#23737) 2021-10-04 14:47:14 +02:00
Tiziano Müller
2ca58e91d6 cp2k: bugfix for intel oneapi (#26143) 2021-10-04 14:41:49 +02:00
Oliver Perks
ad98e88173 arm: added download and better detection (#25460) 2021-10-04 14:35:20 +02:00
Harmen Stoppels
e557730c96 gnupg: Add version 1 (#23798)
From the gnupg.org website:

> GnuPG 1.4 is the old, single binary version which still support the
> unsafe PGP-2 keys. However, it lacks many modern features and will
> receive only important updates.

I'm starting to appreciate gpg1 more, because it is relocatable (gng2
has hard-coded paths to gpg-agent and other tools) and it does not
require gpg-agent at all.
2021-10-04 08:29:41 -04:00
iarspider
50b1b654c9 evtgen: fix mac build and version 2.0.0 with pythia >= 8.304. (#25933) 2021-10-04 14:06:49 +02:00
Manuela Kuhn
e9accaaca1 py-duecredit: add v0.6.5 (#26465) 2021-10-04 14:01:12 +02:00
Manuela Kuhn
68648b3ff5 py-nibabel: add v2.4.1 (#26462) 2021-10-04 14:00:49 +02:00
Valentin Volkl
e4d5bcf916 podio: remove build_type variant (provided by base package class already) (#26463) 2021-10-04 14:00:20 +02:00
Bernhard Kaindl
3fff338844 freebayes: Fix running the testsuite and add pkgconfig (#26440)
freebayes needs the tools of the vcflib it includes to run tests
2021-10-04 14:00:08 +02:00
Nikolay Simakov
225927c1c3 graph500: added option -fcommon for gcc@10.2 (#25367)
* graph500: added option -fcommon for gcc@10.2:, otherwise failed to build with "multiple definition of `column'"

* graph500: moved setting cflag to flag_handler
2021-10-04 13:42:33 +02:00
iarspider
bf9cf87d9b libunwind: add variants (#26099) 2021-10-04 13:04:39 +02:00
Manuela Kuhn
f1839c6aae py-pybids: add v0.9.5 (#26461) 2021-10-04 10:35:06 +00:00
Harmen Stoppels
d84d7f0599 Disable tests on hip for cmake 3.21 (#26460) 2021-10-04 10:20:07 +00:00
Manuela Kuhn
e2ee3066cf py-mne: add new package (#26446) 2021-10-04 09:56:58 +00:00
Manuela Kuhn
1f451924b1 py-sphinxcontrib-napoleon: add new package (#26457) 2021-10-04 09:52:56 +00:00
Manuela Kuhn
8bcbead42b py-templateflow: add new package (#26458) 2021-10-04 09:47:37 +00:00
Dylan Simon
9926799aeb Fix NonVirtualInHierarchyError message format (#26008) 2021-10-04 10:38:09 +02:00
Seth R. Johnson
205b414162 hdf5: allow implicit functions on apple-clang (#26409)
Work around issues in older hdf5 build and overzealous build flags:
```
 >> 1420    /var/folders/j4/fznvdyhx4875h6fhkqjn2kdr4jvyqd/T/9te/spack-stage/spack-stage-hdf5-1.10.4-feyl6tz6hpx5kl7m33avpuacwje2ubul/spack-src/src/H5Odeprec.c:141:8: error: implicit decl
             aration of function 'H5CX_set_apl' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
```
2021-10-04 10:19:56 +02:00
Seth R. Johnson
5d431087ab python: correctly disable ~tkinter when @3.8 (#26365)
The older patch does not apply so the build ends up failing:
```
     1539    In file included from /private/var/folders/fy/x2xtwh1n7fn0_0q2kk29xkv9vvmbqb/T/s3j/spack-stage/spack-stage-python-3.8.11
             -6jyb6sxztfs6fw26xdbc3ktmbtut3ypr/spack-src/Modules/_tkinter.c:48:
  >> 1540    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/tk.h:86:11: f
             atal error: 'X11/Xlib.h' file not found
     1541    #       include <X11/Xlib.h>
     1542                    ^~~~~~~~~~~~
     1543    1 error generated.
```
2021-10-04 10:18:23 +02:00
iarspider
7104b8599e Update byacc (#25837)
Co-authored-by: Bernhard Kaindl <43588962+bernhardkaindl@users.noreply.github.com>
2021-10-04 09:55:20 +02:00
G-Ragghianti
7009724f0d papi: new variants rocm and rocm_smi (#26214) 2021-10-04 09:53:17 +02:00
Manuela Kuhn
81abbb41bc git-annex: add 8.20210804 for amd64 (#26449) 2021-10-04 09:50:05 +02:00
Manuela Kuhn
d0da7c8440 py-pockets: add new package (#26452) 2021-10-04 09:43:10 +02:00
Massimiliano Culpo
69abc4d860 Build ppc64le docker images (#26442)
* Update archspec
* Add ppc64le to docker images
2021-10-04 09:34:53 +02:00
Massimiliano Culpo
e91815de7c Update Spec.full_hash docstring (#26456)
The docstring is outdated since #21735
when the build hash has been included
in the full hash.
2021-10-04 07:33:22 +00:00
Garth N. Wells
baa50c6679 FEniCSx: fix CMake root directory and dependency versions (#26445) 2021-10-04 09:20:53 +02:00
Manuela Kuhn
44d7218038 py-seaborn: add v0.11.2 (#26447) 2021-10-04 09:17:38 +02:00
Manuela Kuhn
9e0aabdef3 py-transforms3d: add new package (#26448) 2021-10-04 09:17:04 +02:00
Joseph Wang
91598912f7 ocaml: add v4.13.1 (#26453)
This is needed in order to make it work with glibc-2.34
2021-10-04 08:47:30 +02:00
Daniel Arndt
862bcc5059 ArborX: Explicitly set path to Kokkos (#26347)
* Explicitly set path to Kokkos for ArborX testing

* Improve formatting

* Update var/spack/repos/builtin/packages/arborx/package.py

Co-authored-by: Seth R. Johnson <johnsonsr@ornl.gov>

* Remove blank line

Co-authored-by: Seth R. Johnson <johnsonsr@ornl.gov>
2021-10-03 23:04:52 -04:00
Hector
2f6590ddd1 source-highlight: add gcc11 patch (#26412) 2021-10-03 16:07:39 +00:00
Lorién López Villellas
c0b383b3e1 PICSAR: added support for GCC >10.0 and arm compiler (#24927)
* -fallow-argument-mismatch flag added when compiling with GCC to avoid a compilation error when using a GCC version > 10.0.

Co-authored-by: Haz99 <jsalamerosanz@gmail.com>

* Filtered every occurrence of "!$OMP SIMD SAFELEN(LVEC2)" when compiling with nvhcp to avoid a compilation error.

Co-authored-by: Haz99 <jsalamerosanz@gmail.com>

* Line with more than 80 characters split into multiple lines.

Co-authored-by: Haz99 <jsalamerosanz@gmail.com>
2021-10-03 10:11:04 -04:00
Jordan Galby
0d6a2381b2 Fix JSONDecodeError when using compiler modules (#25624)
When using modules for compiler (and/or external package), if a
package's `setup_[dependent_]build_environment` sets `PYTHONHOME`, it
can influence the python subprocess executed to gather module
information.

The error seen was:

```
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
```

But the actual hidden error happened in the `python -c 'import
json...'` subprocess, which made it return an empty string as json:

```
ModuleNotFoundError: No module named 'encodings'
```

This fix uses `python -E` to ignore `PYTHONHOME` and
`PYTHONPATH`. Should be safe here because the python subprocess code
only use packages built-in python.

The python subprocess in `environment.py` was also patched to be safe
and consistent.
2021-10-03 16:10:33 +02:00
Harmen Stoppels
b9e72557e8 Remove .99 from version ranges (#26422)
In most cases, .99 can be omitted thanks to #26402 .
2021-10-03 09:09:02 -04:00
Tim Moon
2de116d285 DiHydrogen: Specify required NVSHMEM variants (#26384) 2021-10-03 08:30:27 -04:00
Bernhard Kaindl
f6ce95bfcb chombo: several build fixes: csh, space regex and install (#26424)
See description of the the PR for details on the changes.
2021-10-03 14:28:28 +02:00
Harmen Stoppels
e53bd0eba8 bison: new versions 3.8:3.8.2 (#26439) 2021-10-03 07:57:03 -04:00
Takahiro Ueda
d603f4519d form: use version tarballs, fix and enable gmp and zlib variants (#26425)
Co-authored-by: Bernhard Kaindl <43588962+bernhardkaindl@users.noreply.github.com>
Co-authored-by: iarspider <iarspider@gmail.com>
2021-10-03 08:45:33 +00:00
Michael Kuhn
d4b3724557 meson: add 0.59.2 (#26430) 2021-10-03 10:41:08 +02:00
Michael Kuhn
abce326ea3 openblas: add 0.3.18 (#26429) 2021-10-03 10:38:48 +02:00
Manuela Kuhn
4c1285b1c2 py-svgutils: new package (#26437) 2021-10-03 02:38:36 +02:00
Marc Fehling
34a1e4d8b6 p4est: bump/update to 2.8 (#26081) 2021-10-03 01:56:03 +02:00
Manuela Kuhn
ee568cb6a4 py-packaging: bump version to 21.0 (#26436) 2021-10-02 23:31:24 +00:00
Manuela Kuhn
0db072dc4a py-attrs: bump version to 21.2.0 (#26435) 2021-10-02 23:23:02 +00:00
Manuela Kuhn
6a188b2b13 py-nitransforms: new package (#26434) 2021-10-03 01:06:13 +02:00
Wouter Deconinck
846428a661 podio: add supported CMAKE_BUILD_TYPE values (#26432) 2021-10-03 00:38:36 +02:00
Manuela Kuhn
aee1d44edf py-pybids: bump version to 0.13.2 (#26433) 2021-10-03 00:36:02 +02:00
Sreenivasa Murthy Kolam
f1c83b00d4 atmi: replace /usr/bin/rsync with depends_on rsync (#26353) 2021-10-03 00:32:46 +02:00
Manuela Kuhn
8dcd568769 py-ipyvtk-simple: new package (#26431) 2021-10-02 23:18:08 +02:00
Josh Bowden
aaf35fd520 damaris: bump version to 1.5.0, add variant examples (#26220) 2021-10-02 23:06:17 +02:00
Manuela Kuhn
bc6edc7baf py-ipycanvas: new package (#26426) 2021-10-02 22:30:09 +02:00
Olivier Cessenat
2ce3be3a27 fltk: new version 1.3.7, new variant xft (#26423) 2021-10-02 16:27:38 -04:00
Manuela Kuhn
b65360f721 py-ipyevents: add new package (#26427) 2021-10-02 22:23:09 +02:00
Robert Romero
57803887e8 cddlib: use github URLs and bump version (#26315)
Co-authored-by: Bernhard Kaindl <bernhardkaindl7@gmail.com>
2021-10-02 19:50:32 +00:00
Weiqun Zhang
43e08af7b2 amrex: bump version to 21.10 (#26416) 2021-10-02 18:25:50 +02:00
Massimiliano Culpo
0e469fc01e clingo-bootstrap: add a variant for static libstdc++ (#26421) 2021-10-02 14:53:24 +02:00
Mihael Hategan
b3d3ce1c37 py-pytest-random-order: new package - plugin for py-pytest. (#26413) 2021-10-02 12:38:09 +02:00
Rob Falgout
d9f25f223f Add hypre release 2.23.0 (#26418) 2021-10-02 09:52:50 +02:00
Howard Pritchard
3575c14a6a ucx: add version 1.11.2 (#26417)
Signed-off-by: Howard Pritchard <howardp@lanl.gov>
2021-10-02 09:49:48 +02:00
Wouter Deconinck
314f5fdb97 New versions: geant4@10.7.2, geant4-data@10.7.2 (#25449)
* [geant4] new version 10.7.2

* [geant4-data] new version 10.7.2
2021-10-01 17:08:15 -07:00
Mihael Hategan
d8f23c0f6d Added py-typeguard package. (#26411)
Co-authored-by: Bernhard Kaindl <bernhardkaindl7@gmail.com>
2021-10-01 23:58:39 +00:00
Harmen Stoppels
d0e49ae4bb Simplify setup_package in build environment (#26070)
* Remove redundant preserve environment code in build environment

* Remove fix for a bug in a module

See https://github.com/spack/spack/issues/3153#issuecomment-280460041,
this shouldn't be part of core spack.

* Don't module unload cray-libsci on all platforms
2021-10-01 19:41:30 -04:00
Cory Bloor
b6169c213d Fix error message when test throws AttributeError (#25895)
Narrow the scope of the try/except block, to avoid a misleading
error message if fn() throws an AttributeError.
2021-10-01 19:40:24 -04:00
Mihael Hategan
d19105f761 Added py-sqlalchemy-stubs package. (#26414)
Co-authored-by: Bernhard Kaindl <bernhardkaindl7@gmail.com>
2021-10-01 21:50:55 +00:00
bernhardkaindl
9893718f78 axel(download manager): fix build, bump version (#26140) 2021-10-01 23:48:33 +02:00
Seth R. Johnson
2f630226e7 trilinos: add conflict and enable gtest for developers (#26150) 2021-10-01 15:53:16 -04:00
Harmen Stoppels
50feaae81c Allow non-empty ranges 1.1.0:1.1 (#26402) 2021-10-01 12:23:26 -07:00
Chris Richardson
bce269df13 Fenicsx update dependency and build for main branch (#25864)
* Updates to make it work again for main
* Use property

Co-authored-by: Chris <cnr12@cam.ac.uk>
2021-10-01 12:05:19 -07:00
Harmen Stoppels
18760de972 Spack install: handle failed restore of backup (#25647)
Spack has logic to preserve an installation prefix when it is being
overwritten: if the new install fails, the old files are restored.
This PR adds error handling for when this backup restoration fails
(i.e. the new install fails, and then some unexpected error prevents
restoration from the backup).
2021-10-01 11:40:48 -07:00
Olivier Cessenat
df590bb6ee hypre: add version 2.22.1; add fortran variant; becomes AutotoolsPackage (#25781) 2021-10-01 11:31:24 -07:00
bernhardkaindl
da171bd561 uftrace(dynamic function graph tracer): bump version (#26224) 2021-10-01 18:28:25 +00:00
Luciano Zago
f878f769a2 gh: add new package (#26405) 2021-10-01 17:58:47 +00:00
bernhardkaindl
ffb6597808 xrootd: Add current version 5.3.1 and restrict to openssl@1 (#26303) 2021-10-01 17:50:35 +00:00
Piotr Luszczek
f75ad02ba2 Add new package: ffte (#26340) 2021-10-01 17:27:38 +00:00
Scott Wittenburg
9f09156923 Retry pipeline generation jobs in certain cases 2021-10-01 10:12:37 -07:00
Scott Wittenburg
d11156f361 Add DAG scheduling to child pipelines 2021-10-01 10:12:37 -07:00
Scott Wittenburg
4637c51c7f Service jobs do not need an active environment 2021-10-01 10:12:37 -07:00
Scott Wittenburg
d233c20725 Activate concrete env dir in all service jobs 2021-10-01 10:12:37 -07:00
Scott Wittenburg
5f527075bf Use same image to build e4s as to generate it 2021-10-01 10:12:37 -07:00
Scott Wittenburg
f6fcfd2acc Use same image to build dvsdk as to generate it 2021-10-01 10:12:37 -07:00
Scott Wittenburg
ae092915ac Use default runner image for radiuss 2021-10-01 10:12:37 -07:00
Victor
98466f9b12 Add pmix variant to openmpi package (#26342)
Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2021-10-01 18:43:55 +02:00
Manuela Kuhn
0735419592 py-traitsui: add v7.2.1 (#26392) 2021-10-01 15:57:21 +00:00
Daniel Arndt
7293913e1c DataTransferKit: add v3.1-rc3 (#26269) 2021-10-01 17:33:09 +02:00
Seth R. Johnson
f2ef34638d graphviz: macOS patch not needed on newer version (#26292)
The autoconf file was updated in 2.49.0 but is still needed in older
versions.
2021-10-01 17:30:23 +02:00
bernhardkaindl
6aff4831e3 cmor: bump version and depend on the specific libuuid packages needed by version. (#26149) 2021-10-01 17:29:39 +02:00
Georgiana Mania
7d77f36f83 eigen: add v3.4.0 (#26296) 2021-10-01 17:24:58 +02:00
haralmha
9c8041b8e4 hoppet: add new package (#26297)
Co-authored-by: Harald Minde Hansen <hahansen@office.dyndns.cern.ch>
2021-10-01 17:24:17 +02:00
Manuela Kuhn
eff5bd4005 py-coverage: add v5.5 (#26407) 2021-10-01 15:14:41 +00:00
Axel Huebl
177fe731b1 llvm-openmp: 12.0.1 (#26320)
Add the latest LLVM OpenMP release.
This one compiles for aarch64/M1 on mac.
2021-10-01 17:06:12 +02:00
bernhardkaindl
6b96486d42 py-gsutil: add v5.2 (#26337) 2021-10-01 17:03:54 +02:00
Daniel Arndt
f168d264d1 ArborX: add v1.1 (#26344) 2021-10-01 17:02:05 +02:00
Michael Kuhn
12dc01318e otf: Explicitly disable MPI and ZOIDFS (#26346)
Otherwise, global installations of MPI could be picked up by OTF.
2021-10-01 17:01:31 +02:00
bernhardkaindl
ad8b8b3377 damask-grid, damask-mesh: fix spack install --test=root (#26350) 2021-10-01 16:59:31 +02:00
Edgar Leon
4078c5e537 mpibind: add v0.7.0 and new flux variant (#26359) 2021-10-01 16:56:22 +02:00
Adam Moody
60aa97b25f LWGRP: add v1.0.4 DTCMP: add v1.1.2 and v1.1.3 (#26362) 2021-10-01 16:42:10 +02:00
Satish Balay
6362b3014a petsc,py-petsc4py add versions 3.15.5, 3.16.0 (#26375) 2021-10-01 16:37:28 +02:00
Christoph Conrads
07e91e8afa med: work around "could not find TARGET hdf5" error (#25312)
Fixes #24671, fixes #26051
2021-10-01 10:27:22 -04:00
Ryan Mast
c3c28d510f ns-3-dev: add v3.31, v3.32, v3.33, and v3.34 (#26383) 2021-10-01 16:15:39 +02:00
Pieter Ghysels
d765b4b53d STRUMPACK: add v6.0.0 (#26386)
Co-authored-by: Bernhard Kaindl <bernhardkaindl7@gmail.com>
2021-10-01 16:12:41 +02:00
Manuela Kuhn
66866e45f2 py-pyface: add v7.3.0 (#26389) 2021-10-01 16:07:27 +02:00
Manuela Kuhn
ef202cbd37 py-ipywidgets: add 7.6.5 and get sources from pypi (#26393) 2021-10-01 16:06:25 +02:00
Mihael Hategan
e9609b62c6 Python Globus SDK (globus.org): add new package (#26395) 2021-10-01 16:05:49 +02:00
bernhardkaindl
da7666a967 py-pyside: restrict version of dependency on v1.2.2 (#26396)
Restrict @:1.2.2 to older sphinx versions to not fail the build
2021-10-01 16:04:36 +02:00
Manuela Kuhn
627c7007ef py-pyvista: add new package (#26398) 2021-10-01 16:00:30 +02:00
Anna Masalskaya
8fc770608d Add oneAPI packages from 2021.4 release (#26401) 2021-10-01 15:58:32 +02:00
Jose E. Roman
91f668a695 SLEPc: add v3.16 (#26403) 2021-10-01 15:55:42 +02:00
Manuela Kuhn
f775e81fca py-fury: add new package (#26404) 2021-10-01 15:53:50 +02:00
Harmen Stoppels
5b9f60f9bb bootstrapping: improve error messages (#26399) 2021-10-01 13:00:14 +02:00
bernhardkaindl
6ca42f0199 boost: @1.77.0: need updated python_jam.patch for +python (#26363)
One hunk changed and the new patch is refreshed using quilt.
2021-10-01 11:09:32 +02:00
Tamara Dahlgren
2d1ebbe0a2 Add info command tests to increase coverage (#26127) 2021-09-30 22:13:45 -04:00
Tamara Dahlgren
3feab42203 py-setuptools-rust: remove checksum url workaround (#25843) 2021-09-30 22:13:26 -04:00
Tamara Dahlgren
7aedeca764 Replace spec-related install_test asserts with exceptions; added unit tests (#25982) 2021-09-30 22:05:06 -04:00
Manuela Kuhn
c58cd83e38 py-shiboken2: add new package (#26390) 2021-10-01 01:19:41 +00:00
Manuela Kuhn
032ce20171 vtk: fix install path to lib (#26387) 2021-10-01 02:52:09 +02:00
Paul Spencer
046ed47b1f New package: slurm-drmaa (#25424)
Co-authored-by: Bernhard Kaindl <bernhardkaindl7@gmail.com>
2021-10-01 00:07:03 +00:00
Manuela Kuhn
c076aeb192 py-jupyterlab: add new package (#26357) 2021-10-01 01:33:28 +02:00
Massimiliano Culpo
74d36076c2 ArchSpec: minor cleanup of a few methods (#26376)
* Remove vestigial code to be compatible with Spack v0.9.X
* ArchSpec: reworked __repr__ to be more adherent to common Python idioms
* ArchSpec: simplified __init__.py and copy()
2021-09-30 16:03:39 -07:00
Robert Underwood
a75c86f178 GDB: Fix for GMP and Python (#26366)
closes  #26354 and #26358

Previously we did not pass paths for GDB or GMP and ./configure would
get confused about which one to pull from.  Be more specific.

Built with all variants enabled and fixed the fixable versions and variants:
@:8.1 were fixable by limiting python versions for these to @:3.6.
7.10.1 and 7.11(.1) were fixable to build with glibc-2.25 and newer
using two long patches.
gdb 7.8 and 7.9 weren't fixable as there is no backport if the fix
to build these with glibc-2.25 and newer:
http://lists.busybox.net/pipermail/buildroot/2017-March/188055.html

Co-authored-by: Bernhard Kaindl <bernhardkaindl7@gmail.com>
2021-09-30 22:40:35 +00:00
Massimiliano Culpo
8ade8a77dd Build container images on Github Actions and push to multiple registries (#26247)
Modifications:
- Modify the workflow to build container images without pushing when the workflow file itself is modified
- Strip the leading ghcr.io/spack/ from env.container env.versioned to prepare pushing to multiple registries
- Fixed CentOS 7 and Amazon Linux builds
- Login and push to Docker Hub as well as Github Action
- Add a badge to README.md with the status of docker images
2021-09-30 23:34:47 +02:00
Jen Herting
7bda430de0 [py-tabulate] added version 0.8.9 (#25974) 2021-09-30 23:02:14 +02:00
Cory Bloor
4238318de2 rocsolver: Tighten rocsolver package dependencies (#25917)
- Specify CMake minimum version more precisely
- Ensure rocBLAS is available at build time
- Limit workaround for missing rocblas include path
  to the only affected version (4.1.0)
- Make hip a build and link dependency
- Remove hip's link dependencies

Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2021-09-30 22:57:28 +02:00
Robert Underwood
7694c58736 sz: fix for external python sitelib (#26067)
fixes #25973
2021-09-30 11:52:20 -07:00
bernhardkaindl
af54f7b15b gromacs-chain-coordinate: Fix calling the test suite (#26367) 2021-09-30 18:18:03 +02:00
Harmen Stoppels
1aa7758dbb match .spack literal, not as a regex (#26374) 2021-09-30 14:54:57 +00:00
Harmen Stoppels
727dcef2f4 Disable __skip_rocmclang again (#26187)
CMake 3.21.3 disables the broken hipcc-as-rocmclang detection again.

From the release notes:

> The AMD ROCm Platform hipcc compiler was identifed by CMake 3.21.0
> through 3.21.2 as a distinct compiler with id ROCMClang. This has been
> removed because it caused regressions. Instead:
> * hipcc may no longer be used as a HIP compiler because it interferes
>   with flags CMake needs to pass to Clang. Use Clang directly.
> * hipcc may once again be used as a CXX compiler, and is treated as
>   whatever compiler it selects underneath, as CMake 3.20 and below
>   did.
2021-09-30 16:01:17 +02:00
Harmen Stoppels
4dee7d2b22 Add a conflict for patchelf to catch errors earlier in bootstrapping (#26373) 2021-09-30 15:18:56 +02:00
Harmen Stoppels
525aa11827 Bump version from v0.16.2 to v0.16.3 (#26372) 2021-09-30 11:54:48 +00:00
Olivier Cessenat
9e70fc630e dos2unix: new version 7.4.2 and enforce link with gettext (#26371) 2021-09-30 12:04:32 +02:00
Harmen Stoppels
b96d836a72 Move gnuconfig under the spack org (#26370) 2021-09-30 11:30:29 +02:00
Diego Alvarez
56eddf2e3c Added OpenJDK 17, 11 for Darwin, and set preferred to 11 (#26368) 2021-09-30 11:29:36 +02:00
Maciej Wójcik
7c3b2c1aa8 gromacs-chain-coordinate: new package (#25426) 2021-09-30 04:12:37 +02:00
Shahzeb Siddiqui
ef9967c7f4 Add e4s tags (#23382)
Add 'e4s' tags for all packages according to https://github.com/E4S-Project/e4s/blob/master/E4S_Products.md
2021-09-29 17:57:52 -07:00
acastanedam
02f356159b linux-pam: include more official (recent) releases (#26065) 2021-09-29 20:51:39 -04:00
David Beckingsale
d31830eaf5 Move new CUDA conflicts inside when('~allow-unsupported-compilers') block (#26132)
* Move new CUDA conflicts inside when('~allow-unsupported-compilers') block

Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
2021-09-30 00:22:26 +00:00
Valentin Volkl
2ea1bf84ec py-snappy: add patch to fix dependencies (#26352)
* py-snappy: add patch to fix dependencies

* Update var/spack/repos/builtin/packages/py-snappy/req.patch

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-09-29 15:50:42 -05:00
Manuela Kuhn
0a7804f52e py-jupyterlab: add 3.0.14, 3.0.18 and 3.1.14 (#26339) 2021-09-29 14:34:18 -05:00
Valentin Volkl
805d59d47f geos: fix patch versions (#26351) 2021-09-29 18:32:37 +00:00
Manuela Kuhn
10638ea449 py-jupyter-packaging: add 0.7.12 and 0.10.6 (#26338)
* py-jupyter-packaging: add 0.7.12 and 0.10.6

* Update var/spack/repos/builtin/packages/py-jupyter-packaging/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Update var/spack/repos/builtin/packages/py-jupyter-packaging/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-09-29 18:31:32 +00:00
Howard Pritchard
6d613bded0 cray-mvapich2: add a package to support (#26273)
The format of the HPE/Cray supplied module for cray-mvapich2 on HPE apollo systems is
very different from the cray-mpich module supplied on Cray EX and XE
systems.

Recent changes to the cray-mpich package -

https://github.com/spack/spack/pull/23470

broke support for cray-mvapich2 and relies now on the structure of the
cray-mpich module to work properly.

Rather than try to support two very different vendor mpich modules
using the same spack package, just add another one specialized for
the cray-mvapich2 module.

Signed-off-by: Howard Pritchard <hppritcha@gmail.com>
2021-09-29 20:12:13 +02:00
Martin Diehl
f32feeee45 new package(s): DAMASK (damask, damask-grid, damask-mesh) (#25692) 2021-09-29 19:57:01 +02:00
Manuela Kuhn
c75e84e9f3 py-qtpy: add 1.11.2 (#26343) 2021-09-29 11:19:23 -05:00
Harmen Stoppels
7fdb879308 ca-certificates-mozilla for openssl & curl (#26263)
1. Changes the variant of openssl to `certs=mozilla/system/none` so that
   users can pick whether they want Spack or system certs, or if they
   don't want certs at all.
2. Keeps the default behavior of openssl to use certs=systems.
3. Changes the curl configuration to not guess the ca path during
   config, but rather fall back to whatever the tls provider is
   configured with. If we don't do this, curl will still pick up system
   certs if it finds them.

As a minor fix, it also adds the build dep `pkgconfig` to curl, since
that's being used during the configure phase to get openssl compilation
flags.
2021-09-29 09:05:58 -07:00
iarspider
24263c9e92 New package: py-async-lru (#26328) 2021-09-29 18:05:36 +02:00
Manuela Kuhn
7cd3af5d52 py-mffpy: add new package (#26345) 2021-09-29 17:59:50 +02:00
bernhardkaindl
4a31f0fb0f py-mock: fix depends of @:2.0.0 and bump version (#26336)
* py-mock: fix depends of `@:2.0.0` and bump version

fixes the build of `py-gsutil`, it depends on `'py-mock@:2.0.0'`.

* Update var/spack/repos/builtin/packages/py-mock/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Update var/spack/repos/builtin/packages/py-mock/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Apply the other requested changes

* Add requested change: Add the python@3.6 for newer versions

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-09-29 15:39:57 +00:00
Greg Sjaardema
5132cfcc63 seacas: new release and fixes for metis/parmetis (#26310)
* seacas: new release and fixes for metis/parmetis

* Update to add sha256 checksum for latest seacas release

* Updated the documentation strings with new applications

* Fixed the metis/parmetis variants and logic depending on whether mpi
  is enabled/disabled. (There is still a zoltan issue I need to fix,
  but this will at least allow seacas to be built without
  metis/parmetis or with +mpi+parmetis.  The ~mpi+metis still needs
  work elsewhere.)

* Enable cpup, slice, zellij in +applications
2021-09-29 16:53:49 +02:00
Harmen Stoppels
9d39a1bf42 Un-unset TERM and DISPLAY (#26326)
For interactive `spack build-env`'s this is undesired behavior
2021-09-29 16:28:32 +02:00
bernhardkaindl
11278dd55a py-monotonic: bump version to 1.6 (#26335)
Fixes `spack solve py-gsutil`: It depends on 'py-monotonic@1.4:'
2021-09-29 09:19:47 -05:00
Pat Riehecky
e45979d39a Added OpenJDK 16.0.2 (#26322) 2021-09-29 14:19:38 +00:00
MichaelLaufer
ed54d6c926 py-netcdf4: adds parallel IO support (#26178) 2021-09-29 08:21:16 -05:00
iarspider
634b0b25c4 Add new package: py-backports-entry-points-selectable (#26329) 2021-09-29 15:09:27 +02:00
Manuela Kuhn
ac29b70d18 py-dipy: add new package (#26331) 2021-09-29 15:05:34 +02:00
Manuela Kuhn
e01947effc py-imageio-ffmpeg: add 0.4.5, fix installation and import (#26330) 2021-09-29 14:56:16 +02:00
Manuela Kuhn
78dbac69e9 py-pyqt5-sip: add new package (#26325) 2021-09-29 14:52:29 +02:00
bernhardkaindl
80c8978691 krb5: bump version and limit depends_on('openssl') to @1 (#26332)
krb5 uses an openssl RSA API which is deprecated in OpenSSL@3.0.0
with an const/non-const mismatch.
2021-09-29 11:24:08 +00:00
Manuela Kuhn
ab6b531e10 py-argcomplete: add 1.12.3 (#26228) 2021-09-29 13:10:03 +02:00
Olli Lupton
cffa1e7f6c Add ccache 4.4.2. (#26327) 2021-09-29 09:41:28 +00:00
Axel Huebl
c5410bd333 FFTW: NEON SIMD is float-only (#26321)
Fix on Apple Mac M1 (aarch64):
```
configure: error: NEON requires single precision
```
2021-09-29 02:40:45 +00:00
Ben Darwin
c578882bb2 itk: add version 5.2.1 (#26307) 2021-09-28 18:15:42 -07:00
Greg Sjaardema
a550416a1f netcdf-c: Update for 4.8.1 and new download site (#26309)
NetCDF-4.8.1 has been released.

    As discussed in https://github.com/Unidata/netcdf-c/issues/2110
    (netcdf-c-4.8.1.tar.gz not on ftp site... #2110), the canonical
    download site for netCDF releases has been changed and the previous
    ftp site is no longer available.

    This PR updates the `url` to point to the new recommended download
    site and updates the sha256 checksums for the new tar files.
2021-09-28 17:21:28 -07:00
Gregory Lee
82d857dced qhull deprecated libqhull.so in 2020.2 (#26304) 2021-09-28 16:54:30 -07:00
Manuela Kuhn
32b5669e8d py-pytz: add 2021.1 (#26289) 2021-09-28 18:07:28 +00:00
iarspider
a2c16356a1 dire: Fix depends for new pythia version scheme (#26294)
Pythia version numbering was changed in #26255 from xyyy to x.yyy
2021-09-28 18:05:52 +02:00
Edward Hartnett
4f4984e313 wrf-io: added NOAA software maintainers, added openmp variant (#26113) 2021-09-28 08:55:09 -07:00
Tamara Dahlgren
5ace5ca7a4 Post 26211 rebase updates (#26246) 2021-09-28 08:53:59 -07:00
Manuela Kuhn
519f75b865 py-scooby: add new package (#26284) 2021-09-28 17:51:37 +02:00
Diego Alvarez
023d9e3b4c Added OpenJDK 11.0.12_7 (#26299) 2021-09-28 17:47:45 +02:00
iarspider
9810a80c6d Update nlohmann-json to 3.10.2 (#26260)
* Update nlohmann-json

* fix testsuite

Co-authored-by: Bernhard Kaindl <bernhardkaindl7@gmail.com>
2021-09-28 08:45:34 -07:00
Harmen Stoppels
6c33047514 Squashfs is a makefilepackage (#26300) 2021-09-28 17:45:16 +02:00
bernhardkaindl
3c5a4157b0 py-anuga: add git main version to support build with python@3.5: (#26248)
* py-anuga: add git main version to support build with python@3.5:

py-anuga's main branch has been converted to Python-3 recently.

* py-triangle: use pypi, py-anuga: Fixed depends and test suite works now
2021-09-28 10:37:09 -05:00
bernhardkaindl
d00c9b47f2 py-tomopy: version bump and master, add new deps, make runtest pass (#26252)
Current py-tomopy has many features and dependencies, add them.
2021-09-28 10:33:29 -05:00
Manuela Kuhn
79808f92ae py-numba: add 0.54.0 and restrict old dependencies (#26281)
* py-numba: add 0.54.0 and restrict old dependencies

* Update var/spack/repos/builtin/packages/py-numba/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-09-28 10:32:44 -05:00
Manuela Kuhn
0f5c63b0c3 py-xlrd: add 2.0.1 (#26282) 2021-09-28 10:31:45 -05:00
Manuela Kuhn
b8dd8b07f9 py-appdirs: add 1.4.4 (#26298) 2021-09-28 10:26:23 -05:00
Diego Alvarez
f65a50d9f9 Update Nextflow (#26042) 2021-09-28 07:15:17 -04:00
Harmen Stoppels
4ce9c839ac Add OpenSSL 3 (#26097)
* OpenSSL 3.0.0

* Remove openssl constraint in e4s to test 3.0.0

* Restrict openssl

* Restrict openssl to @:1 in unifyfs

* Revert "Remove openssl constraint in e4s to test 3.0.0"

This reverts commit 0f0355609771764280ab1b6a523c80843a4f85d6.

* Prefer 1.x
2021-09-28 10:36:55 +02:00
Massimiliano Culpo
aa8727f6f9 Move detection logic in its own package (#26119)
The logic to perform detection of already installed
packages has been extracted from cmd/external.py
and put into the spack.detection package.

In this way it can be reused programmatically for
other purposes, like bootstrapping.

The new implementation accounts for cases where the
executables are placed in a subdirectory within <prefix>/bin
2021-09-28 09:05:49 +02:00
bernhardkaindl
499d39f211 libp11: Fix build and add new version (#26135)
The build needs `pkgconfig` and `openssl`, `m4` is already added by `autoconf`.
Also add the current version of `libp11` to the list of versions.

Co-authored-by: Bernhard Kaindl <bernhard.kaindl@ait.ac.at>
2021-09-28 04:01:08 +02:00
Manuela Kuhn
cd8e85d802 py-dataclasses: add 0.8 (#26283) 2021-09-27 20:18:07 -05:00
Manuela Kuhn
c1cfbc5536 py-meshio: add 5.0.1 and 4.4.6 (#26285) 2021-09-27 20:17:22 -05:00
Manuela Kuhn
87b23cc9cd py-deprecated: add 1.2.13 and get sources from pypi (#26286) 2021-09-27 20:15:35 -05:00
Harmen Stoppels
87450f3688 Use gnuconfig package for config file replacement (#26035)
* Use gnuconfig package for config file replacement

Currently the autotools build system tries to pick up config.sub and
config.guess files from the system (in /usr/share) on arm and power.
This is introduces an implicit system dependency which we can avoid by
distributing config.guess and config.sub files in a separate package,
such as the new `gnuconfig` package which is very lightweight/text only
(unlike automake where we previously pulled these files from as a
backup). This PR adds `gnuconfig` as an unconditional build dependency
for arm and power archs.

In case the user needs a system version of config.sub and config.guess,
they are free to mark `gnuconfig` as an external package with the prefix
pointing to the directory containing the config files:

```yaml
    gnuconfig:
      externals:
      - spec: gnuconfig@master
        prefix: /tmp/tmp.ooBlkyAKdw/lol
      buildable: false
```

Apart from that, this PR gives some better instructions for users when
replacing config files goes wrong.

* Mock needs this package too now, because autotools adds a depends_on

* Add documentation

* Make patch_config_files a prop, fix the docs, add integrations tests

* Make macOS happy
2021-09-27 18:38:14 -04:00
Tamara Dahlgren
c0da0d83ff qhull: use secure github URLS instead of www.qhull.org downloads (#26211) 2021-09-27 14:50:43 -07:00
Manuela Kuhn
9b7a8f69fb py-python-picard: add new package (#26268) 2021-09-27 23:39:30 +02:00
Brian Van Essen
acc8673e1a Updated versions for cuDNN and NVSHMEM (#26272) 2021-09-27 13:54:15 -07:00
Adam J. Stewart
5c1e133d23 py-torchvision: add v0.10.1 (#26267) 2021-09-27 13:35:53 -07:00
Manuela Kuhn
1ad8c0d67d py-llvmlite: add 0.37.0 (#26278) 2021-09-27 13:33:28 -07:00
Manuela Kuhn
044e2def4f py-datalad: move datalad wtf test over from py-datalad-metalad (#26274)
* py-datalad: move datalad wtf test over from py-datalad-metalad

* Update var/spack/repos/builtin/packages/py-datalad/package.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-09-27 15:24:48 -05:00
Manuela Kuhn
44355a4f18 py-numexpr: add 2.7.3 (#26279) 2021-09-27 20:13:59 +00:00
Manuela Kuhn
6b94d7e6a3 py-tqdm: add 4.62.3 (#26277) 2021-09-27 19:55:22 +00:00
Manuela Kuhn
441c602d2d py-nilearn: add 0.8.1 (#26276) 2021-09-27 14:50:13 -05:00
Thomas Madlener
285df128a1 [openloops][vbfnlo] Fix recipes and updated dependencies (#24461)
* [vbfnlo] Add doc variant to toggle building of docs

* [openloops] Add scons to dependencies

Make sure that the build_processes does not accidentally pick up a
non-suitable scons version from the underlying system

* [openloops] Set OLPYTHON to make sure the right scons is picked

* [openloops] Fix Flake8 style complaints
2021-09-27 11:40:33 -07:00
Richarda Butler
c68536e9d3 MPICH: Add E4S testsuite stand alone test (#25634) 2021-09-27 11:36:53 -07:00
Ben Darwin
c07af15946 mrtrix3: add version 3.0.3 (#25943) 2021-09-27 11:33:42 -07:00
iarspider
e256d02963 Update highfive (#26262)
* Add new versions of highfive
* Fix CMake option name
2021-09-27 11:24:37 -07:00
Marie Houillon
87c7a7e103 New packages for openCARP (#25909)
Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
2021-09-27 11:21:43 -07:00
Melven Roehrig-Zoellner
6b2192ef96 source-highlight: allow to build the git master branch (#25947)
Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
2021-09-27 11:16:55 -07:00
Miroslav Stoyanov
5130f43eb3 added workaround for rocm/cmake bug in tasmanian (#25949) 2021-09-27 11:14:21 -07:00
Edward Hartnett
c592e17d49 added package g2c from NOAAs NCEPLIBS project (#26190)
Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
2021-09-27 11:03:54 -07:00
Olivier Cessenat
27c0b4a0f7 sundials package: @:5.7.0 requires hypre@:2.22.0 (#25903)
sundials@:5.7.0 fails to build with hypre@2.22.1
2021-09-27 10:58:54 -07:00
Steven Smith
ee63cfe0fd New Package: EcoSLIM (#25975)
Co-authored-by: Steven Smith <Steven Smith>
Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
2021-09-27 10:38:53 -07:00
psakievich
df9d1dd1cb Correct path comparisons for fs view (#25891)
* Fix path comparisons in copy views

* Get correct permissions

* Set group id though os

Co-authored-by: Philip Sakievich <psakiev@sanida.gov>
2021-09-27 09:51:38 -07:00
jacorvar
33957f2745 add mantainer to bedops (#26141) 2021-09-27 16:23:50 +00:00
bernhardkaindl
0cc80f5118 spindle: It seems it needs mpi.h to compile, adding depends on mpi. (#26151)
Workaround this compile error for gcc by adding -Wno-narrowing for it:
spindle_logd.cc:65:76: error: narrowing conversion of '255' from 'int' to 'char'
spindle_logd.cc:65:76: error: narrowing conversion of '223' from 'int' to 'char'
spindle_logd.cc:65:76: error: narrowing conversion of '191' from 'int' to 'char'

spindle 0.8.1 wants to compile tests with mpi.h, newer versions need mpicc,
thus add: depends_on("mpi"). Spindle supports the --no-mpi to disable MPI.
2021-09-27 08:58:47 -07:00
Edward Hartnett
ffedc3637c added NOAAs UPP package (#26198) 2021-09-27 08:56:05 -07:00
Adam J. Stewart
4d3becdfd9 py-torch: add v1.9.1 (#26159) 2021-09-27 09:30:47 -05:00
bernhardkaindl
4a130b9185 perl: Fix test case bug perl#15544: Don't fail with PATH >1000 chars (#26245)
Fix the perl test case bug Perl/perl5#15544
Variable PATH longer than 1000 characters (as is usual with spack) fails a perl test case
The fix is: Don't test PATH in testcase perlbug.t
Fixes `spack install --test=all` for specs triggering a build and test of perl!
2021-09-27 15:18:36 +02:00
Manuela Kuhn
2acfe55b74 exempi: fix expat dependency (#26221)
* exempi: fix expat dependency and fix test with --test=root

Co-authored-by: Bernhard Kaindl <bernhardkaindl7@gmail.com>
2021-09-27 14:52:23 +02:00
iarspider
8710353336 pythia8: update to v8.306, change url, set environment variables for dependents (#26255) 2021-09-27 09:05:51 +00:00
Jen Herting
514d04c8f1 New package: r-klar (#25390) 2021-09-27 02:53:03 +00:00
Jen Herting
87e91178a6 New package: r-questionr (#25395) 2021-09-26 21:35:24 -05:00
Manuela Kuhn
e90534d45e py-python-gitlab: add 2.10.1 (#26229) 2021-09-27 01:24:05 +02:00
Wouter Deconinck
caa33b7b05 [acts] eigen is not only a build dependency (#26257)
The ActsConfig.cmake includes a `find_dependency(Eigen3)` line. Requiring depends_on type='build' does not expose eigen to dependents during their build.

Ref: https://github.com/acts-project/acts/blob/v13.0.0/cmake/ActsConfig.cmake.in#L59
2021-09-27 01:23:44 +02:00
lorddavidiii
8fa6597d43 cfitsio: add version 4.0.0 (#26218) 2021-09-27 01:18:09 +02:00
Seth R. Johnson
7e2fc45354 trilinos: default gotype=long_long (#26253)
"Long long" is the default type when building trilinos on its own, and
many downstream packages (both in and out of spack) rely on it. E4S
already sets this explicitly to long_long.
2021-09-26 16:51:23 +02:00
Desmond Orton
3e7cee27d7 masurca: add versions up to v4.0.5 (#26171)
Co-authored-by: las_djorton <las_djorton@babybuild.las.iastate.edu>
2021-09-26 15:53:59 +02:00
Wouter Deconinck
798ef2bdb0 vtk: depends_on freetype @:2.10.2 through @:9.0.1 only (#26180)
The issues in https://gitlab.kitware.com/vtk/vtk/-/issues/18033 were fixed in:
- dae1718d50
- 31e8e4ebeb

These fixes are in vtk@9.0.2 https://github.com/Kitware/VTK/releases/tag/v9.0.2 and beyond.
2021-09-26 15:52:51 +02:00
Brian Van Essen
cc658c5f1e lbann: add support for building with the ONNX C++ library (#26130) 2021-09-26 15:50:09 +02:00
Valentin Volkl
1f972f90c8 podio, edm4hep: fix tests (#26116)
Co-authored-by: Seth R. Johnson <johnsonsr@ornl.gov>
2021-09-26 15:49:10 +02:00
Brian Van Essen
123c105771 onnx: fix python version in environments (#26131)
When using the ONNX package inside of an environment that specifies a
python3 executable, it will attempt to use a system installed
version.  This can lead to a failure where the system python and the
environment python don't agree and the system python ends up with an
invalid environment.  Forces ONNX to use the same version of python as
the rest of the spec.

Co-authored-by: Greg Becker <becker33@llnl.gov>
2021-09-26 15:48:45 +02:00
Brian Van Essen
b909560ed5 Added CMake command to export compiler directories to support emacs LSP mode. (#26118) 2021-09-26 15:47:46 +02:00
Paul Spencer
0e6e9c23a1 libsignal-protocol-c: new package (#26121)
Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
2021-09-26 15:47:15 +02:00
Hadrien G
a99d8463ac diffutils: Add v3.8, fixes an incompatibility with newer glibc (#26237) 2021-09-26 12:30:16 +02:00
Harmen Stoppels
e76462da38 Compiler conflict in umpire as a range (#26161) 2021-09-26 12:28:30 +02:00
Harmen Stoppels
fbda52d1b0 Curl 7.79.0 (#26075) 2021-09-26 12:28:05 +02:00
Manuela Kuhn
ab85961e73 py-datalad-hirni: add new package (#26227) 2021-09-26 09:20:36 +00:00
Nikolay Simakov
72cabcf454 enzo: build extra tools, add optimization variant (#25401)
* added inits and rings tools to be built
* added opt variant
2021-09-26 10:59:06 +02:00
iarspider
344b37730b jemalloc: add more variants (#26144) 2021-09-26 10:56:27 +02:00
bernhardkaindl
5967a10432 candle-benchmarks: depend_on()s: Fix obsoleted and renamed variants (#26250)
Fix solving/concretizing candle-benchmarks:
py-theano: The requested variant +gpu us now named +cuda
opencv: The requested variants +python and +zlib are now fixed deps
2021-09-26 10:37:01 +02:00
bernhardkaindl
6ccda81368 log_parser.py: Find failed test case messages in error logs (#25694)
- Match failed autotest tests show the word "FAILED" near the end
- Match "FAIL: ", "FATAL: ", "failed ", "Failed test" of other suites
- autotest "   ok"$ means the test passed, independend of text before.
- autoconf messages showing missing tools are fatal later, show them.
2021-09-26 10:35:04 +02:00
bernhardkaindl
34415f6878 swiftsim: Fix build with version bump and depends_on('gsl') (#26166)
swiftsim-0.7.0 didn't build because of a configure script issue and
more. Fix the build by a version bump and adding `depends_on('gsl')`.
2021-09-26 10:32:44 +02:00
bernhardkaindl
a947680e37 dropwatch: make check starts a daemon which does not stop: Skip it (#26164)
dropwatch is a network packet drop checker and it's make check starts
a daemon which does not terminate.

- Skip this test to not block builds.
- Add depends_on('pkgconfig', type='build')
  It is needed in case the host does not have pkg-config installed.
- Remove the depends_on('m4', type='build'):
  The depends_on('autoconf', type='build') pulls m4 as it needs it.
2021-09-26 10:32:04 +02:00
bernhardkaindl
2154786b61 dnstop: needs ncurses and it forgot to add -ltinfo (#26163)
dnstop misses a depends('ncurses') and it needs
to link with libtinfo from ncurses as well.
2021-09-26 10:30:42 +02:00
bernhardkaindl
9a64a229a0 xfwp: Fix build using: env.append_flags('CPPFLAGS', '-D_GNU_SOURCE') (#26157)
Without -D_GNU_SOURCE, the build of xfwp has many compilation errors.
Example: io.c:1039:7: error: implicit declaration of function 'swab'
2021-09-26 10:29:43 +02:00
bernhardkaindl
7189a69c70 rivet: Fix of build and tests on Ubuntu 18.04 w/ version bump (#26152)
When using Ubuntu's gcc-8.4.0 on Ubuntu 18.04 to compile rivet-3.1.3,
compilation errors related to UnstableParticles(), "UFS" show up.

Compilation with this compiler is fixed in rivet-3.1.4, adding it.

Adding type='link' to the depends on 'hepmc' and 'hepmc' fixes
the tests to find libHepMC.so.4 in `spack install --tests=all`

Co-authored-by: Valentin Volkl <valentin.volkl@cern.ch>
2021-09-26 10:29:08 +02:00
bernhardkaindl
fee0831b63 acct: skip installcheck: fails checking if all progs have --help (#26093)
Checks if all programs support --help and --version but not all do.
2021-09-26 10:26:21 +02:00
bernhardkaindl
919a893c08 mountpointattr: Fix checksum of 1.1.1 and fix build(patch is only for 1.1) (#26087) 2021-09-26 10:25:50 +02:00
bernhardkaindl
91ce8354a2 cairo: pass tests: devs wrote that other people shouldn't attempt them (#26086)
The cairo test suite is huge, has many backends and the README states
that running and attempting to pass it is not a goal for normal users,
it has so many dependencies into the system, including fonts, that
passing it is not a goal realistically in reach soon:
Skip it, it takes far too long to be practical.
2021-09-26 10:25:26 +02:00
bernhardkaindl
c411779c51 libfuse: Fix build when meson doesn't get host's udev pkg (#26147)
Despite the patch disabling installation of rules, meson's setup
stage looks up the udev package to get `/lib/udev/rules.d`, but as
spack has no `systemd/udev` package, it would fail to build.

Fix such builds by passing `-Dudevrulesdir` and bump version to 3.10.5
2021-09-26 10:24:30 +02:00
Manuela Kuhn
17857083b0 py-datalad-container: add new package (#26222) 2021-09-26 10:18:17 +02:00
Manuela Kuhn
dbbc2879e5 py-datalad-neuroimaging: add new package (#26223) 2021-09-26 10:17:22 +02:00
Manuela Kuhn
d627026910 py-datalad-webapp: add new package (#26226) 2021-09-26 09:50:01 +02:00
Manuela Kuhn
3b323d6c90 py-datalad-metalad: add new package (#26225)
Added py-nose for import and a simple installtest from appveyor.yml

Co-authored-by: Bernhard Kaindl <bernhardkaindl7@gmail.com>
2021-09-26 07:44:18 +00:00
bernhardkaindl
7ca657aef6 libidl builds using flex and bison: Add them as build-depends (#26183) 2021-09-26 09:40:18 +02:00
Jen Herting
27e6032f73 New package: py-gpyopt (#26232)
Co-authored-by: Sid Pendelberry <sid@rit.edu>
Co-authored-by: Bernhard Kaindl <bernhardkaindl7@gmail.com>
2021-09-26 07:34:18 +00:00
Adam J. Stewart
76ca57bb2f py-scikit-learn: add v1.0 (#26243) 2021-09-26 08:33:58 +02:00
Jen Herting
56858eb34e first build of py-doe2 a fork of py-doe (#26235)
Co-authored-by: Sid Pendelberry <sid@rit.edu>
2021-09-26 08:12:40 +02:00
Carlos Bederián
b4b3b256bc ucx: use bfd instead of lld with %aocc (#26254) 2021-09-26 04:47:07 +02:00
Jen Herting
3c14d130ca New package: r-styler (#25399) 2021-09-25 20:50:22 +00:00
Sreenivasa Murthy Kolam
b56e1d1f6d limit the amd_target_sram_ecc to rocm-3.9.0-4.0.0 (#26240) 2021-09-25 19:18:44 +00:00
Sam Reeve
b2376db632 cabana: add 0.4 and new dependency variants (#25847)
Co-authored-by: Seth R. Johnson <johnsonsr@ornl.gov>
Co-authored-by: Christoph Junghans <junghans@votca.org>
2021-09-25 12:04:24 -06:00
Glenn Johnson
d8dc1f2c80 new package: dicom3tools (#25700) 2021-09-25 08:43:17 -06:00
Jen Herting
348cebfb8f py-sobol-seq: new package (#26234)
Co-authored-by: Sid Pendelberry <sid@rit.edu>
2021-09-25 14:39:36 +02:00
Jen Herting
3f7d6763e0 New package: py-pydoe (#26233)
Co-authored-by: Sid Pendelberry <sid@rit.edu>
2021-09-25 14:34:35 +02:00
bernhardkaindl
ff511e090a autotools doc PR: No depends_on('m4') with depends_on('autoconf') (#26101)
* autotoolspackage.rst: No depends_on('m4') with depends_on('autoconf')
  - Remove `m4` from the example depends_on() lines for the autoreconf phase.
  - Change the branch used as example from develop to master as it is
    far more common in the packages of spack's builtin repo.
- Fix the wrong info that libtoolize and aclocal are run explicitly
  in the autoreconf phase by default. autoreconf calls these internally
  as needed, thus autotools.py also does not call them directly.
- Add that autoreconf() also adds -I<aclocal-prefix>/share/aclocal.
- Add an example how to set autoreconf_extra_args.
- Add an example of a custom autoreconf phase for running autogen.sh.

Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2021-09-25 10:15:03 +02:00
Alec Scott
ef7cf83ea5 Add Go v1.17.1 (#26128) 2021-09-25 01:22:34 -06:00
acastanedam
b67cfc0fd1 gpi-2: improve GPI-2 installation (#25808)
Based on the original script of R. Mijakovic further improvements of
GPI-2 installation, in particular different official versions,
configuration setups and even testing. Importantly, the non-autotools
way of installation for older versions is also considered, which is
relevant for some packages using GPI-2.

Co-authored-by: Arcesio Castaneda Medina <arcesio.castaneda.medina@itwm.fraunhofer.de>
2021-09-25 00:58:46 -06:00
bernhardkaindl
e3dc586064 xload: fix build by disabling gettext and add v1.1.3 (#26142)
xload failed with unresolved referenced to libintl functions:
Disabled it's use of gettext calls and added the last "new" version.

Co-authored-by: Bernhard Kaindl <bernhard.kaindl@ait.ac.at>
2021-09-25 00:58:32 -06:00
AMD Toolchain Support
ed13addf3b Cloverleaf: adding AOCC support (#26148)
Co-authored-by: Mohan Babu <mohbabul@amd.com>
2021-09-25 00:49:43 -06:00
Adam J. Stewart
b8e21f2b0b GDAL: fix build of Java bindings (#26244) 2021-09-25 00:01:45 -06:00
Manuela Kuhn
7e67652983 py-datalad: add 0.15.1 (#26230) 2021-09-24 23:40:48 -06:00
kwryankrattiger
a9cb31ab49 Enable cinema variant in ecp-data-vis-sdk (#26176) 2021-09-25 07:18:34 +02:00
Filippo Spiga
c725ca83ce nvhpc: add v21.9 (#26217) 2021-09-25 07:15:22 +02:00
bernhardkaindl
2eddc60baa tauola: Fix build: The current build wants lhapdf headers by default (#26154)
The hand-written `configure` script of this package does not handle
--without-<feature> at all. The source wants to use `lhapdf` headers
even if support of lhapdf is not indicated using `--with-lhapdf`.

Enable the variant `lhapdf` by default: It fixes the build of the
current package and provides the TauSpinner feature as well.
2021-09-24 20:16:59 -06:00
bernhardkaindl
13d313d3ad scallop: Fix build by bumping the version to 0.10.5 (#26162)
build of 0.10.3 fails with CoinPragma.hpp: No such file or directory
2021-09-24 18:11:06 -06:00
Olivier Cessenat
8ed7f65bc8 pigz: new version 2.6 (#26066) 2021-09-24 17:17:08 -06:00
bernhardkaindl
742bd1f149 nix: bump version, add new depends and make installcheck pass (#26179)
The current version of `nix` has some more features and has more
dependencies. The installcheck is quite involved but passes now.
2021-09-24 17:08:10 -06:00
bernhardkaindl
8d70f94aae cgdcbxd: Fix build: Use DESTDIR=self.prefix to not write to /etc (#26145)
Fix the build for normal non-root/non-system-user builds, as we cannot
know that we'd have to uninstall these files even if installed as root.
Also add `pkgconfig` and remove not explicitly needed `depends_on('m4')`
2021-09-24 16:32:09 -06:00
luker
ab90cd8fc4 Tau rocm fix (#26134)
* update the Tau package to use the correct ROCm dependencies and prefixes

    1st:
    When the rocm variant is selected, tau defaults to look for rocm in /opt/rocm
    which is not guarenteed to be the correct location -- this has been fixed
    to provide the prefix for hsa-rocr-dev (which is now a dependency when +rocm is
    selected).

    2nd:
    the rocprofiler dependency package was not specified correctly, it should
    be called rocprofiler-dev, also rocprofiler-dev is a dependency when
    +rocprofiler is selected.

added roctracer support
2021-09-24 16:29:04 -06:00
bernhardkaindl
cdcecda9d0 sst-dumpi: Correct the wrong checksum of the current version (#26181)
Correct the sha256 of the current version as shown by `spack checksum`
2021-09-24 14:17:16 -06:00
bernhardkaindl
adc7fee12e w3m: Fix build by disabling RAND_egd and japanese messages (#26168)
w3m's build fails with `undefined reference to `RAND_egd'` which
is an deprecated insecure feature and from building japanese messages.

Disabling both makes the build of `w3m` work.
2021-09-24 13:26:14 -06:00
bernhardkaindl
12252f1ca4 iproute2: add v5.10.0 and v5.11.0, add missing deps (#26182)
iproute2 needs libmnl and builds using flex and bison: Add them.
2021-09-24 12:37:52 -06:00
bernhardkaindl
7efb18b502 nginx: Bump version for OpenSSL@3 and restrict @:1.21.2 to openssl@:1 (#26156) 2021-09-24 12:16:51 -06:00
bernhardkaindl
45c84a2b04 xdriinfo: uses glXGetProcAddressARB, add: depends_on('gl') (#26184) 2021-09-24 12:08:07 -06:00
Edward Hartnett
2c9dfcabf8 added NOAA package prod_util (#26197) 2021-09-24 11:44:09 -06:00
Edward Hartnett
1a0e1597c8 nemsio: Add v2.5.3, which includes dependency change, and maintainers (#26188) 2021-09-24 11:41:15 -06:00
Adam J. Stewart
9a17dc0001 py-torchvision: rename master -> main (#26160) 2021-09-24 11:32:23 -06:00
Robert Cohn
3a48f5f931 intel-oneapi-mpi/mkl packages: add ilp64 support (#26045) 2021-09-24 10:32:06 -07:00
Edward Hartnett
73913a5d51 added GFDL FMS package (#26191) 2021-09-24 11:14:16 -06:00
Scott Wittenburg
45b70d9798 Pipelines: Disable ppc builds until we have resources or make it smaller (#26238) 2021-09-24 08:24:36 -07:00
bernhardkaindl
cdbb586a93 autotools.py/autoreconf: Show the depends_on()s to add to the package (#26115)
This commit shows a template for cut-and-paste into the package to fix it:

```py
==> fast-global-file-status: Executing phase: 'autoreconf'
==> Error: RuntimeError: Cannot generate configure: missing dependencies autoconf, automake, libtool.

Please add the following lines to the package:

    depends_on('autoconf', type='build', when='@master')
    depends_on('automake', type='build', when='@master')
    depends_on('libtool', type='build', when='@master')

Update the version (when='@master') as needed.
```
    
Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2021-09-24 09:17:07 -06:00
bernhardkaindl
bcf708098d kmod: Add the missing depends on m4 and pkgconfig (#26137)
The build needs pkgconfig and lzma, m4 is already added by autoconf.

Disable generation of kmod manpages as spack does not have xsltproc yet.

Co-authored-by: Bernhard Kaindl <bernhard.kaindl@ait.ac.at>
2021-09-24 08:02:09 -06:00
Edward Hartnett
71378bcf39 landsfcutil: new package (#26193) 2021-09-24 13:48:58 +02:00
Wouter Deconinck
f68b2ea73a acts: add v13.0.0 (#26196) 2021-09-24 13:47:25 +02:00
Edward Hartnett
2d8f06bfa0 ufs-utils: added NOAA maintainers (#26201) 2021-09-24 13:07:18 +02:00
Harmen Stoppels
87e1ed0ef1 Bump cmake 3.21.3 (#26186) 2021-09-24 04:13:52 -06:00
Troy Redfearn
ef6013da9c Added new versions and deprecated vulnerable versions (#26206) 2021-09-24 03:37:44 -06:00
Tamara Dahlgren
c348daf4dc Add 'radiuss' tags to RADIUSS packages (#26212) 2021-09-24 03:20:14 -06:00
Edward Hartnett
21eaf31291 g2tmpl: added NOAA maintainers (#26192) 2021-09-24 02:35:02 -06:00
Edward Hartnett
6d2ce0535f added NOAA package grib-util (#26200)
* added NOAA package grib-util
2021-09-24 02:17:07 -06:00
Ben Bergen
2e4528c55c Added mising '+' for kokkos (#26202) 2021-09-24 02:14:25 -06:00
Edward Hartnett
6f8c9edefc added NOAA ncio package (#26194) 2021-09-24 02:14:11 -06:00
Edward Hartnett
d532f5b40c added NOAA package nemsiogfs (#26195) 2021-09-24 02:08:06 -06:00
Wouter Deconinck
fb2e764f50 assimp: depends_on zlib (#26199)
Assimp searches for zlib (or builds its own version). When it searches, it can find a system install that is not provided by spack. Ref: d286aadbdf/CMakeLists.txt (L451)
2021-09-24 02:05:06 -06:00
Andrew-Dunning-NNL
7bb5dd7a14 gradle: add new versions through 7.2 (#26203) 2021-09-24 02:02:17 -06:00
iarspider
1299c714c4 gosamcontrib: add libs variants (#26030) 2021-09-24 10:00:02 +02:00
Ryan Mast
2bcdb33666 helics: Add versions 2.8.0, 3.0.0, and 3.0.1 (#26046) 2021-09-24 01:52:52 -06:00
Harmen Stoppels
a6bb3a66ea Remove centos:6 image references (#26095)
This was EOL November 30th, 2020. I believe the "builds" are failing on
develop because of it.
2021-09-24 09:47:49 +02:00
Wouter Deconinck
117ea5a239 opencascade: add v7.5.3; added VTK INCLUDE cmake flag (#26209) 2021-09-24 09:27:07 +02:00
Massimiliano Culpo
03c203effa Use Leap instead of Tumbleweed for e2e bootstrapping test (#26205)
Tumbleweed has been broken for a couple of days. The attempt
to fix it in #26170 didn't really work. Let's try to move to
a more stable release series for OpenSuse.
2021-09-24 01:22:40 -06:00
Mikhail Titov
ba452f7645 radical cybertools: add v1.8.0 (#26215) 2021-09-24 09:22:02 +02:00
Edward Hartnett
54ea7caf3f g2: add maintainers and version 3.4.5 (#26105)
* added new release, added noaa software maintainers to maintainer list

* updated comment

* removed trailing whitespace
2021-09-24 00:17:07 -06:00
kjrstory
bdab4c9f1f fontconfig: add dependency python (#25960) 2021-09-23 23:26:05 -06:00
iarspider
72c22696ac gperftools package: add variants (#26032)
* Make libunwind optional
* Add support for sized_delete and debugalloc

Co-authored-by: Seth R. Johnson <johnsonsr@ornl.gov>
Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2021-09-23 22:40:28 -06:00
Thomas Kluyver
fdc9cb0adb h5py: new version 3.4 (#25935)
No changes to dependencies or supported Python versions.

https://docs.h5py.org/en/stable/whatsnew/3.4.html
2021-09-23 12:12:33 -06:00
bernhardkaindl
ea459993db python: Fix regression in python-2.7.17+-distutils-C++.patch (#25821) 2021-09-23 07:38:58 -05:00
Christoph Conrads
45c6fe2b94 SQLite: make variants discoverable (#25885)
Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2021-09-23 09:54:02 +02:00
Harmen Stoppels
56a81ec81c Pin opensuse image in bootstrap tests (#26170)
Currently zypper in opensuse containers throws 'not permitted'

Temporarily fix the digest until they fixed their upstream package manager issues
2021-09-23 08:03:43 +02:00
Gregory Becker
1195ac02e5 Merge tag 'v0.16.3' into develop 2021-09-22 16:25:40 -07:00
Brian Van Essen
fa92482675 dihydrogen package: add missing dependency (#25896) 2021-09-22 12:03:15 -07:00
Edward Hartnett
76ad001c56 added NOAA software maintainers to maintainer list (#26112) 2021-09-22 07:24:16 -04:00
bernhardkaindl
4ccd2e8ff0 pango: Fix build: restore autotools-based versions (#26084)
Fix the build of pango and it's 20 dependents: Only provide the versions which
support the build using autotools (conversion to MesonPackage didn't progress)
This only restores the list of versions of August 10, before the build broke.
2021-09-22 05:13:49 -06:00
Alec Scott
2b6a8ccf29 Add Rclone v1.56.1 (#26124) 2021-09-22 04:07:48 -06:00
albestro
7613511718 add conflict (#26028) 2021-09-22 12:07:19 +02:00
Alec Scott
ed3aa9633d Add Picard v2.26.2 (#26125) 2021-09-22 04:04:44 -06:00
kjrstory
24ca007448 su2: add version 7.0.4-7.2.0 (#25956) 2021-09-22 01:07:44 -06:00
Alec Scott
86ddcd0e2d Add Slepc v3.15.2 (#26123) 2021-09-21 23:13:51 -06:00
Edward Hartnett
5097a41675 gfsio: add NOAA software maintainers (#26106)
* added NOAA software maintainers to maintainer list

* added comment about NCEPLIBS
2021-09-21 19:20:47 -06:00
Harmen Stoppels
3b55c2e715 Bump version and update changelog 2021-09-21 16:58:41 -07:00
Harmen Stoppels
7caa844d49 Fix style tests 2021-09-21 16:58:41 -07:00
Harmen Stoppels
4cd6381ed5 Remove centos:6 image references
This was EOL November 30th, 2020. I believe the "builds" are failing on
develop because of it.
2021-09-21 16:58:41 -07:00
Massimiliano Culpo
aebc8f6ce5 docker: remove boto3 from CentOS 6 since it requires and updated pip (#24813) 2021-09-21 16:58:41 -07:00
Massimiliano Culpo
073c92d526 docker: Fix CentOS 6 build on Docker Hub (#24804)
This change make yum usable again on CentOS 6
2021-09-21 16:58:41 -07:00
Greg Becker
0e85d7011e Ensure all roots of an installed environment are marked explicit in db (#24277) 2021-09-21 16:58:41 -07:00
Todd Gamblin
77e633efa1 locks: only open lockfiles once instead of for every lock held (#24794)
This adds lockfile tracking to Spack's lock mechanism, so that we ensure that there
is only one open file descriptor per inode.

The `fcntl` locks that Spack uses are associated with an inode and a process.
This is convenient, because if a process exits, it releases its locks.
Unfortunately, this also means that if you close a file, *all* locks associated
with that file's inode are released, regardless of whether the process has any
other open file descriptors on it.

Because of this, we need to track open lock files so that we only close them when
a process no longer needs them.  We do this by tracking each lockfile by its
inode and process id.  This has several nice properties:

1. Tracking by pid ensures that, if we fork, we don't inadvertently track the parent
   process's lockfiles. `fcntl` locks are not inherited across forks, so we'll
   just track new lockfiles in the child.
2. Tracking by inode ensures that referencs are counted per inode, and that we don't
   inadvertently close a file whose inode still has open locks.
3. Tracking by both pid and inode ensures that we only open lockfiles the minimum
   number of times necessary for the locks we have.

Note: as mentioned elsewhere, these locks aren't thread safe -- they're designed to
work in Python and assume the GIL.

Tasks:
- [x] Introduce an `OpenFileTracker` class to track open file descriptors by inode.
- [x] Reference-count open file descriptors and only close them if they're no longer
      needed (this avoids inadvertently releasing locks that should not be released).
2021-09-21 16:58:41 -07:00
Todd Gamblin
2ae92ebdbb Use AWS CloudFront for source mirror (#23978)
Spack's source mirror was previously in a plain old S3 bucket. That will still
work, but we can do better. This switches to AWS's CloudFront CDN for hosting
the mirror.

CloudFront is 16x faster (or more) than the old bucket.

- [x] change mirror to https://mirror.spack.io
2021-09-21 16:58:41 -07:00
Harmen Stoppels
7f29dd238f Cray: fix extracting paths from module files (#23472)
Co-authored-by: Tiziano Müller <tm@dev-zero.ch>
2021-09-21 16:58:41 -07:00
Adam J. Stewart
0f486080b3 Fix use of quotes in Python build system (#22279) 2021-09-21 16:58:41 -07:00
Michael Kuhn
6b0c775448 clang/llvm: fix version detection (#19978)
This PR fixes two problems with clang/llvm's version detection. clang's
version output looks like this:

```
clang version 11.0.0
Target: x86_64-unknown-linux-gnu
```

This caused clang's version to be misdetected as:

```
clang@11.0.0
Target:
```

This resulted in errors when trying to actually use it as a compiler.

When using `spack external find`, we couldn't determine the compiler
version, resulting in errors like this:

```
==> Warning: "llvm@11.0.0+clang+lld+lldb" has been detected on the system but will not be added to packages.yaml [reason=c compiler not found for llvm@11.0.0+clang+lld+lldb]
```

Changing the regex to only match until the end of the line fixes these
problems.

Fixes: #19473
2021-09-21 16:58:41 -07:00
Adam J. Stewart
9120856c01 Fix fetching for Python 3.9.6 (#24686)
When using Python 3.9.6, Spack is no longer able to fetch anything. Commands like `spack fetch` and `spack install` all break.

Python 3.9.6 includes a [new change](https://github.com/python/cpython/pull/25853/files#diff-b3712475a413ec972134c0260c8f1eb1deefb66184f740ef00c37b4487ef873eR462) that means that `scheme` must be a string, it cannot be None. The solution is to use an empty string like the method default.

Fixes #24644. Also see https://github.com/Homebrew/homebrew-core/pull/80175 where this issue was discovered by CI. Thanks @branchvincent for reporting such a serious issue before any actual users encountered it!

Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
2021-09-21 16:58:41 -07:00
Edward Hartnett
90d953d3f6 w3emc: add NOAA software maintainers (#26110) 2021-09-21 17:54:19 -06:00
Tiziano Müller
d34b2638c7 boost: fix for @1.77.0%intel (#25965)
Add patch for build script from boost repo.
2021-09-21 16:07:25 -07:00
bernhardkaindl
979c355c99 spack/build_environment.py: Clean MAKEFLAGS, DISPLAY and TERM (#26092)
clean_environment(): Unset three more environment variables:

MAKEFLAGS: Affects make, can eg indirectly inhibit enabling parallel build
DISPLAY: Tests of GUI widget libraries might try to connect to an X server
TERM: Could make testsuites attempt to color their output
2021-09-22 00:23:10 +02:00
Edward Hartnett
92f199d57b added NOAA software maintainers to the maintainers list (#26102) 2021-09-21 16:16:49 -06:00
Edward Hartnett
fd716ce0c5 sfcio: add NOAA software maintainers (#26108)
* added NOAA software maintainers to maintainer list

* added comment about NCEPLIBS project
2021-09-21 15:28:37 -06:00
Edward Hartnett
d865caa7f7 ip2: add NOAA software maintainers and deprecation note (#26107)
* added NOAA software maintainers to maintainer list, added comment about library being deprecated

* deleted trailing whitespace
2021-09-21 14:49:13 -06:00
bernhardkaindl
981551b47f libtool: fix running the unit-tests with spack install --test root (#25707)
Besides adding autoconf and automake as needed for tests of 2.4.6,
skip Fortran test cases when Fortran compilers are not provided.
2021-09-21 14:18:29 -06:00
Tamara Dahlgren
c3cb863b82 Feature: Add deprecated versions section to spack info output (#25972) 2021-09-21 11:49:36 -07:00
AMD Toolchain Support
8de77bb304 Fix for - Installation issue: amdlibflame #25878 (#25987)
* Fix for - Installation issue: amdlibflame #25878

* Updated with python+pythoncmd - Symlink 'python3' executable to 'python'
2021-09-21 11:15:23 -07:00
Edward Hartnett
a8977f828e w3nco: add NOAA software maintainers (#26111) 2021-09-21 12:08:43 -06:00
Jonas Thies
6c487f4c6d packages/phist new version 1.9.5 (#26114) 2021-09-21 11:57:22 -06:00
Edward Hartnett
24500d4115 added noaa software maintainers to maintainer list (#26103) 2021-09-21 09:58:53 -07:00
iarspider
2741037c69 Fix FORM recipe (#26104) 2021-09-21 09:57:40 -07:00
Edward Hartnett
d278837316 sigio: add NOAA software maintainers (#26109) 2021-09-21 10:39:05 -06:00
bernhardkaindl
22cfc19bcb ddd,debuild,flux-sched: add missing dependencies (#26090) 2021-09-21 18:08:11 +02:00
Melven Roehrig-Zoellner
c24413a530 petsc: fix for enabling openmp (#25942)
* petsc: fix for enabling openmp

* petsc: shorten comment (style guidelines)

* petsc: move flag to make code more clear
2021-09-21 07:13:35 -06:00
natshineman
544b3f447d mvapich2-gdr: add v2.3.6 (#26076)
Co-authored-by: Nick Contini <contini.26@buckeyemail.osu.edu>
2021-09-21 06:19:56 -06:00
Gregory Lee
05ca19d9d7 fgfs: fix missing autotools depends_on (#26005)
* added build deps for fgfs

* added build deps when building master branch
2021-09-21 07:40:59 -04:00
Harmen Stoppels
a326713826 py-abcpy: new package (#25713) 2021-09-21 13:10:16 +02:00
bernhardkaindl
1b95c97bb3 ccfits: add v2.6 (#26089)
ccfits@2.5 doesn't compile on Ubuntu 18.04: Update to version 2.6.
2021-09-21 04:43:48 -06:00
bernhardkaindl
c6a33c28de Fix deps of diffmark,faiss,fgsl,fipcheck,nbdkit,ncbi-magicblast,xcb-util-cursor (#26091)
Fix missing type='build' deps for cpio, m4, pkg-config and python in
diffmark, faiss, fgsl, fipcheck, nbdkit, ncbi-magicblast and xcb-util-cursor
2021-09-21 04:16:43 -06:00
Harmen Stoppels
58663692a4 Rename 'variant_name' to 'variant' and document it in autotools build system (#26064) 2021-09-21 11:27:41 +02:00
Christoph Junghans
45ba4d94bd votca-* packages: add version 2021.2 (#26058) 2021-09-20 16:14:19 -07:00
Adam J. Stewart
3e3b7b1394 New package: py-torchgeo (#26059) 2021-09-20 16:12:55 -07:00
Jordan Ogas
d0fd9e6d5f charliecloud package: add version 0.25 (#26073) 2021-09-20 16:08:41 -07:00
adityakavalur
88880c5369 Include newer versions of UCX (#26072) 2021-09-20 23:41:26 +02:00
Danny McClanahan
aa7e354a3a patch serf and scons to use #!/usr/bin/env python3 (#26062) 2021-09-20 22:12:30 +02:00
iarspider
f3d2f62468 Add variants to FORM recipe (#25963) 2021-09-20 13:53:54 -06:00
Edward Hartnett
65f285831e added NOAA maintainers to ip package (#26055) 2021-09-20 11:36:03 -06:00
Olivier Cessenat
0197b364a2 mfem and petsc: alter hypre dependencies (#25902)
Hypre latest version 2.22.1 breaks MFEM and PETSc.
2021-09-20 09:51:29 -07:00
Edward Hartnett
96eefea9a3 added NOAA software team to maintainers list (#26056) 2021-09-20 09:01:53 -06:00
Olivier Cessenat
1ea58e0cb9 p7zip: resolve gcc 10 conflict (#25676)
Fix credit: Eric Brugger
2021-09-20 07:43:07 -04:00
Tamara Dahlgren
c6f9e9baf6 strumpack: Update stand-alone test to use stage directory (#25751) 2021-09-20 07:36:58 -04:00
kjrstory
430caaf5f6 paraview: patch for version 5.9.1 with gcc 11.1.0 (#25887)
* paraview: patch for version 5.9.1 with gcc 11.1.0

* Fix : blank line contains whitespace
2021-09-20 07:31:54 -04:00
Robert Underwood
6476e0cf02 gdb: new version v11.1 (#25920) 2021-09-20 07:30:37 -04:00
Jen Herting
acd4186a88 New packages: py-imgaug (#25894)
* updates from sid

* [py-imgaug] url -> pypi

* [py-imgaug] added version 0.4.0 and fixed up dependencies

* [py-imgaug] updated copyright

Co-authored-by: Andrew Elble <aweits@rit.edu>
2021-09-20 07:29:43 -04:00
iarspider
ca8d16c9d1 Allow setting variant name in AutotoolsPackage._activate_or_not (#26054) 2021-09-20 10:54:24 +02:00
jacorvar
d20fa421ca Fix R version (#26061)
R version should be `3.0.0` instead of `3.00`.
2021-09-20 10:47:40 +02:00
Edward Hartnett
8fceaf4a33 added NOAA software team to maintainers list (#26057) 2021-09-19 19:02:02 -06:00
Vanessasaurus
534bad0ff7 updating OmegaH to 9.34.1 (#26015) 2021-09-19 08:55:54 -06:00
Todd Gamblin
4f8b643404 Create SECURITY.md 2021-09-19 06:43:14 -07:00
Vanessasaurus
c2f42a6f09 updating kokkos to 3.4.01 (#26013) 2021-09-19 06:10:55 -06:00
Vanessasaurus
148c7aeb06 updating singularity to 3.8.3 (#26020)
Signed-off-by: vsoch <vsoch@users.noreply.github.com>

Co-authored-by: vsoch <vsoch@users.noreply.github.com>
2021-09-19 04:20:15 -06:00
jacorvar
4f79a83dd1 Fix R version (#26047)
R version should be `3.0.0`, in contrast to `3.00`.
2021-09-19 12:14:14 +02:00
Alec Scott
2d4d51eb5e Add v1.6.0 to Benchmark (#25996) 2021-09-18 20:59:02 -06:00
Cameron Smith
b14d6d217e omegah: add version 9.34.1 (#25828) 2021-09-18 19:58:44 -06:00
Alec Scott
5b400a69b7 Add v0.935 to Angsd (#25995) 2021-09-18 18:46:55 -06:00
Adam J. Stewart
c0839b14d5 Python: use platform-specific site packages dir (#25998) 2021-09-19 00:37:50 +00:00
Seth R. Johnson
6ff5795342 cmake: allow gcc on macOS for newer versions (#25994) 2021-09-18 17:34:43 -06:00
Michele Martone
60f0d0ac20 librsb: add v1.2.0.10 (#26044) 2021-09-18 17:43:41 -04:00
Axel Huebl
8f3482b2ce FFTW: Fix OpenMP Build on macOS (#26039) 2021-09-18 15:13:47 -06:00
Vanessasaurus
fc79a5da17 updating siesta to 4.0.2 (#26021) 2021-09-18 08:05:02 -06:00
Vanessasaurus
1880db8457 updating universal ctags to 5.2.0.xxxx (#26024) 2021-09-18 07:13:55 -06:00
Vanessasaurus
6538727fb3 updating sparsehash to 2.0.4 (#26023) 2021-09-18 06:52:59 -06:00
Vanessasaurus
f5275fecc5 updating htslib to 1.13 (#26012) 2021-09-18 06:26:00 -06:00
Vanessasaurus
d499309433 updating nco to 5.0.1 (#26014) 2021-09-18 06:23:05 -06:00
Vanessasaurus
c5e2662dea updating graphviz to 2.49.0 (#26011) 2021-09-18 06:19:56 -06:00
Vanessasaurus
7b0a505795 updating veloc to 1.5 and cleaning up spacing (#26025) 2021-09-18 06:10:56 -06:00
Vanessasaurus
e8b86b7ec6 updating cloc to 1.9.0 (#26009) 2021-09-18 05:44:04 -06:00
Vanessasaurus
608a0b1f8f updating poppler (#26016) 2021-09-18 05:10:56 -06:00
Vanessasaurus
abd11cf042 updating raxml to 8.2.12 (#26018) 2021-09-18 04:58:50 -06:00
Vanessasaurus
8ad910d8f1 updating protobuf (Gooooogle!) to 3.18.0 (#26017) 2021-09-18 04:40:49 -06:00
Vanessasaurus
d5c985b888 updating samtools to 1.13 (#26019) 2021-09-18 04:16:51 -06:00
Vanessasaurus
f0443d0327 updating spades to 3.15.3 (#26022) 2021-09-18 03:46:50 -06:00
Vanessasaurus
9af1858bff updating gatk to 4.2.2.0 (#26010) 2021-09-18 10:07:28 +02:00
David Beckingsale
fa3265ea51 Convert RAJA, CHAI and Umpire to CachedCMakePackages (#25788)
* Switch Umpire to CMakeCachedPackage
* Fix missing import
* Correct tests option in Umpire
* Switch RAJA to CachedCMakePackage
* Convert CHAI to CachedCMakePackage
* Corrections in RAJA
* Patches in Umpire & RAJA for BLT target export
* Fixup style
* Fixup incorrect use of cmake_cache_string
2021-09-17 21:29:41 -07:00
Chris White
79ac572f21 update tutorial version of hdf5 (#25368) 2021-09-17 17:34:56 -07:00
Massimiliano Culpo
b847bb72f0 Bootstrap should search for compilers after switching config scopes (#26029)
fixes #25992

Currently the bootstrapping process may need a compiler.

When bootstrapping from sources the need is obvious, while
when bootstrapping from binaries it's currently needed in
case patchelf is not on the system (since it will be then
bootstrapped from sources).

Before this PR we were searching for compilers as the
first operation, in case they were not declared in
the configuration. This fails in case we start
bootstrapping from within an environment.

The fix is to defer the search until we have swapped
configuration.
2021-09-17 18:28:48 -06:00
Harmen Stoppels
4d36c40cfb Bump reframe (#25970) 2021-09-17 14:23:05 -06:00
Olli Lupton
ae9adba900 Add ccache v4.4.1. (#25957) 2021-09-17 13:37:58 -06:00
Cyrus Harrison
bd415ec841 improve ascent package to use stages and cmake base (#25720)
* improve ascent package to use stages and cmake base

* style

* more style
2021-09-17 10:37:16 -07:00
iarspider
7e7de25aba fmt: add variant for shared library (#25969) 2021-09-17 08:04:55 -06:00
eugeneswalker
730720d50a variant build: openmp_ref should be openmp (#26006) 2021-09-17 06:38:00 -06:00
iarspider
8e486c1e57 gosam: new version 2.1.1 (#25985) 2021-09-17 06:10:41 -06:00
Kurt Sansom
be8e52fbbe GCC: patch for gcc 10.3.0 ICE when using nvcc (#25980)
* fix: patch for gcc 10.3.0 ICE when using nvcc

* fix: use URL reference instead

* fix: add missing sha256sum
2021-09-16 18:43:56 -06:00
Edward Hartnett
f8fae997d3 added package.py for GPTL (#25993) 2021-09-16 17:11:05 -06:00
Massimiliano Culpo
71a3173a32 Filter UserWarning out of test output (#26001) 2021-09-16 14:56:00 -06:00
Miroslav Stoyanov
e027cecff2 workaround a cmake/rocm bug in heffte (#25948) 2021-09-16 13:26:07 -06:00
Alec Scott
bb29c5d674 Add v7.0.2 to Admixtools (#25997) 2021-09-16 12:08:15 -06:00
G-Ragghianti
c4e26ac7c8 Fix for problem with cmake@3.21 (#25989) 2021-09-16 11:52:59 -06:00
AMD Toolchain Support
cf81046bb1 New package: ROMS (#25990)
Co-authored-by: Mohan Babu <mohbabul@amd.com>
2021-09-16 10:34:45 -07:00
Michael Kuhn
2d34acf29e cc: Use parameter expansion instead of basename (#24509)
While debugging #24508, I noticed that we call `basename` in `cc`. The
same can be achieved by using Bash's parameter expansion, saving one
external process per call.

Parameter expansion cannot replace basename for directories in some
cases, but is guaranteed to work for executables.
2021-09-16 16:25:49 +00:00
Michael Kuhn
d73fe19d93 Recommend Git's manyFiles feature (#25977)
Git 2.24 introduced a feature flag for repositories with many files, see:
https://github.blog/2019-11-03-highlights-from-git-2-24/#feature-macros

Since Spack's Git repository contains roughly 8,500 files, it can be
worthwhile to enable this, especially on slow file systems such as NFS:
```
$ hyperfine --warmup 3 'cd spack-default; git status' 'cd spack-manyfiles; git status'
Benchmark #1: cd spack-default; git status
  Time (mean ± σ):      3.388 s ±  0.095 s    [User: 256.2 ms, System: 625.8 ms]
  Range (min … max):    3.168 s …  3.535 s    10 runs

Benchmark #2: cd spack-manyfiles; git status
  Time (mean ± σ):     168.7 ms ±  10.9 ms    [User: 98.6 ms, System: 126.1 ms]
  Range (min … max):   144.8 ms … 188.0 ms    19 runs

Summary
  'cd spack-manyfiles; git status' ran
   20.09 ± 1.42 times faster than 'cd spack-default; git status'
```
2021-09-16 09:41:10 -06:00
Harmen Stoppels
5b211c90f5 Bump sirius 7.2.x (#25939) 2021-09-16 15:00:58 +02:00
Massimiliano Culpo
fa6366a7df Add a deprecation warning when using the old concretizer (#25966) 2021-09-16 13:25:24 +02:00
Mikael Simberg
b09ad2cc8c Update HPX package (#25775)
* Add support for C++20 to HPX package

* Enable unity builds in HPX package when available

* Add support for HIP/ROCm to HPX package

* Rearrange and update required versions for HPX package

* Add C++20 option to asio package
2021-09-16 13:24:17 +02:00
Harmen Stoppels
ccfdac8402 Improve bootstrapping docs a hair (#25962) 2021-09-16 07:02:31 -04:00
Harmen Stoppels
abb0f6e27c Fix NameError in foreground/background test (#25967) 2021-09-16 10:39:07 +02:00
Harmen Stoppels
3fe9b34362 Inform the user about bootstrapping (#25964) 2021-09-16 09:28:24 +02:00
jacorvar
c0122242ee bedops: Fix checksum for 2.4.40 (#25958)
Fixes #25951
2021-09-15 16:17:40 -07:00
Adam J. Stewart
0015f700b7 py-pybind11: use PythonPackage install method (#25650) 2021-09-15 11:57:33 -07:00
dependabot[bot]
5d23638fdc build(deps): bump codecov/codecov-action from 2.0.3 to 2.1.0 (#25925)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2.0.3 to 2.1.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v2.0.3...v2.1.0)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-15 16:02:05 +02:00
Tamara Dahlgren
f0b4afe7db Raise exception when 1+ stand-alone tests fail (#25857) 2021-09-15 08:04:59 -04:00
Ben Corbett
75497537a4 Added LvArray 0.2.2 (#25950) 2021-09-15 01:44:07 -06:00
Massimiliano Culpo
c52426ea7a Make clingo the default solver (#25502)
Modifications:
- [x] Change `defaults/config.yaml`
- [x] Add a fix for bootstrapping patchelf from sources if `compilers.yaml` is empty
- [x] Make `SPACK_TEST_SOLVER=clingo` the default for unit-tests
- [x] Fix package failures in the e4s pipeline

Caveats:
1. CentOS 6 still uses the original concretizer as it can't connect to the buildcache due to issues with `ssl` (bootstrapping from sources requires a C++14 capable compiler)
1. I had to update the image tag for GitlabCI in e699f14.  
1. libtool v2.4.2 has been deprecated and other packages received some update
2021-09-14 22:44:16 -07:00
Adam J. Stewart
0d0d438c11 Add a __reduce__ method to Environment (#25678)
* Add a __reduce__ method to Environment
* Add unit test
* Convert Path to str
2021-09-14 22:37:36 -07:00
Vanessasaurus
ef5ad4eb34 Adding ability to compare git references to spack install (#24639)
This will allow a user to (from anywhere a Spec is parsed including both name and version) refer to a git commit in lieu of 
a package version, and be able to make comparisons with releases in the history based on commits (or with other commits). We do this by way of:

 - Adding a property, is_commit, to a version, meaning I can always check if a version is a commit and then change some action.
 - Adding an attribute to the Version object which can lookup commits from a git repo and find the last known version before that commit, and the distance
 - Construct new Version comparators, which are tuples. For normal versions, they are unchanged. For commits with a previous version x.y.z, d commits away, the comparator is (x, y, z, '', d). For commits with no previous version, the comparator is ('', d) where d is the distance from the first commit in the repo.
 - Metadata on git commits is cached in the misc_cache, for quick lookup later.
 - Git repos are cached as bare repos in `~/.spack/git_repos`
 - In both caches, git repo urls are turned into file paths within the cache

If a commit cannot be found in the cached git repo, we fetch from the repo. If a commit is found in the cached metadata, we do not recompare to newly downloaded tags (assuming repo structure does not change). The cached metadata may be thrown out by using the `spack clean -m` option if you know the repo structure has changed in a way that invalidates existing entries. Future work will include automatic updates.

# Finding previous versions
Spack will search the repo for any tags that match the string of a version given by the `version` directive. Spack will also search for any tags that match `v + string` for any version string. Beyond that, Spack will search for tags that match a SEMVER regex (i.e., tags of the form x.y.z) and interpret those tags as valid versions as well. Future work will increase the breadth of tags understood by Spack

For each tag, Spack queries git to determine whether the tag is an ancestor of the commit in question or not. Spack then sorts the tags that are ancestors of the commit by commit-distance in the repo, and takes the nearest ancestor. The version represented by that tag is listed as the previous version for the commit.

Not all commits will find a previous version, depending on the package workflow. Future work may enable more tangential relationships between commits and versions to be discovered, but many commits in real world git repos require human knowledge to associate with a most recent previous version. Future work will also allow packages to specify commit/tag/version relationships manually for such situations.

# Version comparisons.
The empty string is a valid component of a Spack version tuple, and is in fact the lowest-valued component. It cannot be generated as part of any valid version. These two characteristics make it perfect for delineating previous versions from distances. For any version x.y.z, (x, y, z, '', _) will be less than any "real" version beginning x.y.z. This ensures that no distance from a release will cause the commit to be interpreted as "greater than" a version which is not an ancestor of it.

Signed-off-by: vsoch <vsoch@users.noreply.github.com>

Co-authored-by: vsoch <vsoch@users.noreply.github.com>
Co-authored-by: Gregory Becker <becker33@llnl.gov>
Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
2021-09-14 22:12:34 -07:00
David Beckingsale
c3bc3e61aa gcc: apply backported fixes to v4.9.3 (#25945) 2021-09-15 07:10:04 +02:00
Satish Balay
148071ac8a dealii: add version 9.3.1 (#25915) 2021-09-14 15:26:08 -06:00
Scott Wittenburg
bf7c12b4df Pipelines: (Re)enable E4S on Power stack (#25921)
Pipelines: (Re)enable E4S on Power stack
2021-09-14 14:55:50 -06:00
Weston Ortiz
56c375743a Add missing mumps TPL commands (#25940) 2021-09-14 20:26:37 +01:00
Vanessasaurus
c6edfa3f31 Update spack monitor to support new spec (#25928)
This PR coincides with tiny changes to spack to support spack monitor using the new spec
the corresponding spack monitor PR is at https://github.com/spack/spack-monitor/pull/31.
Since there are no changes to the database we can actually update the current server
fairly easily, so either someone can test locally or we can just update and then
test from that (and update as needed).

Signed-off-by: vsoch <vsoch@users.noreply.github.com>

Co-authored-by: vsoch <vsoch@users.noreply.github.com>
2021-09-14 08:02:04 -06:00
Harmen Stoppels
fc96c49b0b Add py-pot with patch (#25712) 2021-09-14 15:55:02 +02:00
Harmen Stoppels
ce790a89f2 reframe: set PYTHONPATH at runtime (#25842) 2021-09-14 15:54:14 +02:00
Valentin Volkl
1b633e1ca4 ocaml: add patch for clang@11: (#25886) 2021-09-14 09:34:57 +02:00
Ben Darwin
2ac9dc76c4 dcmtk: add v3.6.4, v3.6.5, v3.6.6 (#25923) 2021-09-14 09:22:48 +02:00
Weston Ortiz
d7c5aa46fe trilinos: variant for libx11 (#25823) 2021-09-14 08:53:53 +02:00
Edward Hartnett
f6eb16982a added new version of parallelio library (#25916) 2021-09-13 18:22:54 -06:00
David Beckingsale
be1c4bc563 Rename camp 'main' version (#25918) 2021-09-13 16:55:55 -06:00
Timothy Brown
998de97091 ESMF, NEMSIO and UFS-UTILS changes. (#25846)
* ESMF and NEMSIO changes.

- Updating ESMF to set the COMM correctly when using Intel oneapi.
- Explicitly setting the CMake MPI Fortran compiler for NEMSIO.

* Update UFS utils CMake to use MPI_<lang>_COMPILER.
2021-09-13 16:13:43 -06:00
Greg Becker
dad69e7d7c Fix environment reading from lockfile to trust written hashes (#25879)
#22845 revealed a long-standing bug that had never been triggered before, because the
hashing algorithm had been stable for multiple years while the bug was in production. The
bug was that when reading a concretized environment, Spack did not properly read in the
build hashes associated with the specs in the environment. Those hashes were recomputed
(and as long as we didn't change the algorithm, were recomputed identically). Spack's
policy, though, is never to recompute a hash. Once something is installed, we respect its
metadata hash forever -- even if internally Spack changes the hashing method. Put
differently, once something is concretized, it has a concrete hash, and that's it -- forever.

When we changed the hashing algorithm for performance in #22845 we exposed the bug.
This PR fixes the bug at its source, but properly reading in the cached build hash attributes
associated with the specs. I've also renamed some variables in the Environment class
methods to make a mistake of this sort more difficult to make in the future.

* ensure environment build hashes are never recomputed
* add comment clarifying reattachment of env build hashes
* bump lockfile version and include specfile version in env meta
* Fix unit-test for v1 to v2 conversion

Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2021-09-13 15:25:48 -06:00
Massimiliano Culpo
c699e907fc Update command to setup tutorial (#24488) 2021-06-23 19:38:36 -05:00
1589 changed files with 33096 additions and 8508 deletions

View File

@@ -19,7 +19,7 @@ on:
jobs:
fedora-sources:
fedora-clingo-sources:
runs-on: ubuntu-latest
container: "fedora:latest"
steps:
@@ -29,7 +29,7 @@ jobs:
bzip2 curl file gcc-c++ gcc gcc-gfortran git gnupg2 gzip \
make patch unzip which xz python3 python3-devel tree \
cmake bison bison-devel libstdc++-static
- uses: actions/checkout@v2
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # @v2
- name: Setup repo and non-root user
run: |
git --version
@@ -46,7 +46,7 @@ jobs:
spack -d solve zlib
tree ~/.spack/bootstrap/store/
ubuntu-sources:
ubuntu-clingo-sources:
runs-on: ubuntu-latest
container: "ubuntu:latest"
steps:
@@ -59,7 +59,7 @@ jobs:
bzip2 curl file g++ gcc gfortran git gnupg2 gzip \
make patch unzip xz-utils python3 python3-dev tree \
cmake bison
- uses: actions/checkout@v2
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # @v2
- name: Setup repo and non-root user
run: |
git --version
@@ -76,9 +76,9 @@ jobs:
spack -d solve zlib
tree ~/.spack/bootstrap/store/
opensuse-sources:
opensuse-clingo-sources:
runs-on: ubuntu-latest
container: "opensuse/tumbleweed:latest"
container: "opensuse/leap:latest"
steps:
- name: Install dependencies
run: |
@@ -87,7 +87,7 @@ jobs:
bzip2 curl file gcc-c++ gcc gcc-fortran tar git gpg2 gzip \
make patch unzip which xz python3 python3-devel tree \
cmake bison
- uses: actions/checkout@v2
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # @v2
- name: Setup repo and non-root user
run: |
git --version
@@ -101,13 +101,13 @@ jobs:
spack -d solve zlib
tree ~/.spack/bootstrap/store/
macos-sources:
macos-clingo-sources:
runs-on: macos-latest
steps:
- name: Install dependencies
run: |
brew install cmake bison@2.7 tree
- uses: actions/checkout@v2
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # @v2
- name: Bootstrap clingo
run: |
source share/spack/setup-env.sh
@@ -126,8 +126,8 @@ jobs:
- name: Install dependencies
run: |
brew install tree
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # @v2
- uses: actions/setup-python@dc73133d4da04e56a135ae2246682783cc7c7cb6 # @v2
with:
python-version: ${{ matrix.python-version }}
- name: Bootstrap clingo
@@ -137,15 +137,14 @@ jobs:
spack -d solve zlib
tree ~/.spack/bootstrap/store/
ubuntu-clingo-binaries:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['2.7', '3.5', '3.6', '3.7', '3.8', '3.9']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # @v2
- uses: actions/setup-python@dc73133d4da04e56a135ae2246682783cc7c7cb6 # @v2
with:
python-version: ${{ matrix.python-version }}
- name: Setup repo and non-root user
@@ -159,3 +158,94 @@ jobs:
spack bootstrap untrust spack-install
spack -d solve zlib
tree ~/.spack/bootstrap/store/
ubuntu-gnupg-binaries:
runs-on: ubuntu-latest
container: "ubuntu:latest"
steps:
- name: Install dependencies
env:
DEBIAN_FRONTEND: noninteractive
run: |
apt-get update -y && apt-get upgrade -y
apt-get install -y \
bzip2 curl file g++ gcc patchelf gfortran git gzip \
make patch unzip xz-utils python3 python3-dev tree
- uses: actions/checkout@v2
- name: Setup repo and non-root user
run: |
git --version
git fetch --unshallow
. .github/workflows/setup_git.sh
useradd -m spack-test
chown -R spack-test .
- name: Bootstrap GnuPG
shell: runuser -u spack-test -- bash {0}
run: |
source share/spack/setup-env.sh
spack bootstrap untrust spack-install
spack -d gpg list
tree ~/.spack/bootstrap/store/
ubuntu-gnupg-sources:
runs-on: ubuntu-latest
container: "ubuntu:latest"
steps:
- name: Install dependencies
env:
DEBIAN_FRONTEND: noninteractive
run: |
apt-get update -y && apt-get upgrade -y
apt-get install -y \
bzip2 curl file g++ gcc patchelf gfortran git gzip \
make patch unzip xz-utils python3 python3-dev tree \
gawk
- uses: actions/checkout@v2
- name: Setup repo and non-root user
run: |
git --version
git fetch --unshallow
. .github/workflows/setup_git.sh
useradd -m spack-test
chown -R spack-test .
- name: Bootstrap GnuPG
shell: runuser -u spack-test -- bash {0}
run: |
source share/spack/setup-env.sh
spack solve zlib
spack bootstrap untrust github-actions
spack -d gpg list
tree ~/.spack/bootstrap/store/
macos-gnupg-binaries:
runs-on: macos-latest
steps:
- name: Install dependencies
run: |
brew install tree
# Remove GnuPG since we want to bootstrap it
sudo rm -rf /usr/local/bin/gpg
- uses: actions/checkout@v2
- name: Bootstrap GnuPG
run: |
source share/spack/setup-env.sh
spack bootstrap untrust spack-install
spack -d gpg list
tree ~/.spack/bootstrap/store/
macos-gnupg-sources:
runs-on: macos-latest
steps:
- name: Install dependencies
run: |
brew install gawk tree
# Remove GnuPG since we want to bootstrap it
sudo rm -rf /usr/local/bin/gpg
- uses: actions/checkout@v2
- name: Bootstrap GnuPG
run: |
source share/spack/setup-env.sh
spack solve zlib
spack bootstrap untrust github-actions
spack -d gpg list
tree ~/.spack/bootstrap/store/

View File

@@ -1,15 +1,26 @@
name: Build & Deploy Docker Containers
name: Containers
on:
# This Workflow can be triggered manually
workflow_dispatch:
# Build new Spack develop containers nightly.
schedule:
- cron: '34 0 * * *'
# Run on pull requests that modify this file
pull_request:
branches:
- develop
paths:
- '.github/workflows/build-containers.yml'
# Let's also build & tag Spack containers on releases.
release:
types: [published]
jobs:
deploy-images:
runs-on: ubuntu-latest
runs-on: ubuntu-latest
permissions:
packages: write
strategy:
# Even if one container fails to build we still want the others
# to continue their builds.
@@ -17,19 +28,19 @@ jobs:
# A matrix of Dockerfile paths, associated tags, and which architectures
# they support.
matrix:
dockerfile: [[amazon-linux, amazonlinux-2.dockerfile, 'linux/amd64,linux/arm64'],
[centos7, centos-7.dockerfile, 'linux/amd64,linux/arm64'],
[leap15, leap-15.dockerfile, 'linux/amd64,linux/arm64'],
[ubuntu-xenial, ubuntu-1604.dockerfile, 'linux/amd64,linux/arm64'],
[ubuntu-bionic, ubuntu-1804.dockerfile, 'linux/amd64,linux/arm64']]
dockerfile: [[amazon-linux, amazonlinux-2.dockerfile, 'linux/amd64,linux/arm64'],
[centos7, centos-7.dockerfile, 'linux/amd64,linux/arm64,linux/ppc64le'],
[leap15, leap-15.dockerfile, 'linux/amd64,linux/arm64,linux/ppc64le'],
[ubuntu-xenial, ubuntu-1604.dockerfile, 'linux/amd64,linux/arm64,linux/ppc64le'],
[ubuntu-bionic, ubuntu-1804.dockerfile, 'linux/amd64,linux/arm64,linux/ppc64le']]
name: Build ${{ matrix.dockerfile[0] }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # @v2
- name: Set Container Tag Normal (Nightly)
run: |
container="ghcr.io/spack/${{ matrix.dockerfile[0]}}:latest"
container="${{ matrix.dockerfile[0] }}:latest"
echo "container=${container}" >> $GITHUB_ENV
echo "versioned=${container}" >> $GITHUB_ENV
@@ -37,7 +48,7 @@ jobs:
- name: Set Container Tag on Release
if: github.event_name == 'release'
run: |
versioned="ghcr.io/spack/${{matrix.dockerfile[0]}}:${GITHUB_REF##*/}"
versioned="${{matrix.dockerfile[0]}}:${GITHUB_REF##*/}"
echo "versioned=${versioned}" >> $GITHUB_ENV
- name: Check ${{ matrix.dockerfile[1] }} Exists
@@ -48,25 +59,33 @@ jobs:
exit 1;
fi
- name: Set up QEMU
uses: docker/setup-qemu-action@27d0a4f181a40b142cce983c5393082c365d1480 # @v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@94ab11c41e45d028884a99163086648e898eed25 # @v1
- name: Log in to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 # @v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Log in to DockerHub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 # @v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build & Deploy ${{ matrix.dockerfile[1] }}
uses: docker/build-push-action@v2
uses: docker/build-push-action@a66e35b9cbcf4ad0ea91ffcaf7bbad63ad9e0229 # @v2
with:
file: share/spack/docker/${{matrix.dockerfile[1]}}
platforms: ${{ matrix.dockerfile[2] }}
push: true
push: ${{ github.event_name != 'pull_request' }}
tags: |
${{ env.container }}
${{ env.versioned }}
spack/${{ env.container }}
spack/${{ env.versioned }}
ghcr.io/spack/${{ env.container }}
ghcr.io/spack/${{ env.versioned }}

View File

@@ -24,8 +24,8 @@ jobs:
name: gcc with clang
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # @v2
- uses: actions/setup-python@dc73133d4da04e56a135ae2246682783cc7c7cb6 # @v2
with:
python-version: 3.9
- name: spack install
@@ -39,8 +39,8 @@ jobs:
runs-on: macos-latest
timeout-minutes: 700
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # @v2
- uses: actions/setup-python@dc73133d4da04e56a135ae2246682783cc7c7cb6 # @v2
with:
python-version: 3.9
- name: spack install
@@ -52,8 +52,8 @@ jobs:
name: scipy, mpl, pd
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # @v2
- uses: actions/setup-python@dc73133d4da04e56a135ae2246682783cc7c7cb6 # @v2
with:
python-version: 3.9
- name: spack install
@@ -62,17 +62,3 @@ jobs:
spack install -v --fail-fast py-scipy %apple-clang
spack install -v --fail-fast py-matplotlib %apple-clang
spack install -v --fail-fast py-pandas %apple-clang
install_mpi4py_clang:
name: mpi4py, petsc4py
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: spack install
run: |
. .github/workflows/install_spack.sh
spack install -v --fail-fast py-mpi4py %apple-clang
spack install -v --fail-fast py-petsc4py %apple-clang

View File

@@ -15,8 +15,8 @@ jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # @v2
- uses: actions/setup-python@dc73133d4da04e56a135ae2246682783cc7c7cb6 # @v2
with:
python-version: 3.9
- name: Install Python Packages
@@ -31,10 +31,10 @@ jobs:
style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # @v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
- uses: actions/setup-python@dc73133d4da04e56a135ae2246682783cc7c7cb6 # @v2
with:
python-version: 3.9
- name: Install Python packages
@@ -48,26 +48,6 @@ jobs:
- name: Run style tests
run: |
share/spack/qa/run-style-tests
# Build the documentation
documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install System packages
run: |
sudo apt-get -y update
sudo apt-get install -y coreutils ninja-build graphviz
- name: Install Python packages
run: |
pip install --upgrade pip six setuptools
pip install --upgrade -r lib/spack/docs/requirements.txt
- name: Build documentation
run: |
share/spack/qa/run-doc-tests
# Check which files have been updated by the PR
changes:
runs-on: ubuntu-latest
@@ -77,12 +57,12 @@ jobs:
packages: ${{ steps.filter.outputs.packages }}
with_coverage: ${{ steps.coverage.outputs.with_coverage }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # @v2
if: ${{ github.event_name == 'push' }}
with:
fetch-depth: 0
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v2
- uses: dorny/paths-filter@b2feaf19c27470162a626bd6fa8438ae5b263721
id: filter
with:
# See https://github.com/dorny/paths-filter/issues/56 for the syntax used below
@@ -112,17 +92,17 @@ jobs:
# Run unit tests with different configurations on linux
unittests:
needs: [ validate, style, documentation, changes ]
needs: [ validate, style, changes ]
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9]
concretizer: ['original', 'clingo']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # @v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
- uses: actions/setup-python@dc73133d4da04e56a135ae2246682783cc7c7cb6 # @v2
with:
python-version: ${{ matrix.python-version }}
- name: Install System packages
@@ -171,19 +151,19 @@ jobs:
SPACK_TEST_SOLVER: ${{ matrix.concretizer }}
run: |
share/spack/qa/run-unit-tests
- uses: codecov/codecov-action@v2.0.3
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # @v2.1.0
if: ${{ needs.changes.outputs.with_coverage == 'true' }}
with:
flags: unittests,linux,${{ matrix.concretizer }}
# Test shell integration
shell:
needs: [ validate, style, documentation, changes ]
needs: [ validate, style, changes ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # @v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
- uses: actions/setup-python@dc73133d4da04e56a135ae2246682783cc7c7cb6 # @v2
with:
python-version: 3.9
- name: Install System packages
@@ -209,13 +189,13 @@ jobs:
COVERAGE: true
run: |
share/spack/qa/run-shell-tests
- uses: codecov/codecov-action@v2.0.3
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # @v2.1.0
if: ${{ needs.changes.outputs.with_coverage == 'true' }}
with:
flags: shelltests,linux
# Test for Python2.6 run on Centos 6
centos6:
needs: [ validate, style, documentation, changes ]
needs: [ validate, style, changes ]
runs-on: ubuntu-latest
container: spack/github-actions:centos6
steps:
@@ -225,28 +205,30 @@ jobs:
if: ${{ needs.changes.outputs.with_coverage == 'true' }}
env:
HOME: /home/spack-test
SPACK_TEST_SOLVER: original
run: |
whoami && echo $HOME && cd $HOME
git clone https://github.com/spack/spack.git && cd spack
git fetch origin ${{ github.ref }}:test-branch
git clone "${{ github.server_url }}/${{ github.repository }}.git" && cd spack
git fetch origin "${{ github.ref }}:test-branch"
git checkout test-branch
share/spack/qa/run-unit-tests
bin/spack unit-test -x
- name: Run unit tests (only package tests)
if: ${{ needs.changes.outputs.with_coverage == 'false' }}
env:
HOME: /home/spack-test
ONLY_PACKAGES: true
SPACK_TEST_SOLVER: original
run: |
whoami && echo $HOME && cd $HOME
git clone https://github.com/spack/spack.git && cd spack
git fetch origin ${{ github.ref }}:test-branch
git clone "${{ github.server_url }}/${{ github.repository }}.git" && cd spack
git fetch origin "${{ github.ref }}:test-branch"
git checkout test-branch
share/spack/qa/run-unit-tests
bin/spack unit-test -x -m "not maybeslow" -k "package_sanity"
# Test RHEL8 UBI with platform Python. This job is run
# only on PRs modifying core Spack
rhel8-platform-python:
needs: [ validate, style, documentation, changes ]
needs: [ validate, style, changes ]
runs-on: ubuntu-latest
if: ${{ needs.changes.outputs.with_coverage == 'true' }}
container: registry.access.redhat.com/ubi8/ubi
@@ -256,7 +238,7 @@ jobs:
dnf install -y \
bzip2 curl file gcc-c++ gcc gcc-gfortran git gnupg2 gzip \
make patch tcl unzip which xz
- uses: actions/checkout@v2
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # @v2
- name: Setup repo and non-root user
run: |
git --version
@@ -268,16 +250,17 @@ jobs:
shell: runuser -u spack-test -- bash {0}
run: |
source share/spack/setup-env.sh
spack -d solve zlib
spack unit-test -k 'not cvs and not svn and not hg' -x --verbose
# Test for the clingo based solver (using clingo-cffi)
clingo-cffi:
needs: [ validate, style, documentation, changes ]
needs: [ validate, style, changes ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # @v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
- uses: actions/setup-python@dc73133d4da04e56a135ae2246682783cc7c7cb6 # @v2
with:
python-version: 3.9
- name: Install System packages
@@ -311,22 +294,22 @@ jobs:
SPACK_TEST_SOLVER: clingo
run: |
share/spack/qa/run-unit-tests
- uses: codecov/codecov-action@v2.0.3
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # @v2.1.0
if: ${{ needs.changes.outputs.with_coverage == 'true' }}
with:
flags: unittests,linux,clingo
# Run unit tests on MacOS
build:
needs: [ validate, style, documentation, changes ]
needs: [ validate, style, changes ]
runs-on: macos-latest
strategy:
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # @v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
- uses: actions/setup-python@dc73133d4da04e56a135ae2246682783cc7c7cb6 # @v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Python packages
@@ -357,7 +340,7 @@ jobs:
echo "ONLY PACKAGE RECIPES CHANGED [skipping coverage]"
$(which spack) unit-test -x -m "not maybeslow" -k "package_sanity"
fi
- uses: codecov/codecov-action@v2.0.3
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # @v2.1.0
if: ${{ needs.changes.outputs.with_coverage == 'true' }}
with:
files: ./coverage.xml

5
.gitignore vendored
View File

@@ -132,11 +132,11 @@ celerybeat.pid
.env
.venv
env/
!/lib/spack/env
venv/
ENV/
env.bak/
venv.bak/
!/lib/spack/env
# Spyder project settings
.spyderproject
@@ -210,6 +210,9 @@ tramp
/eshell/history
/eshell/lastdir
# zsh byte-compiled files
*.zwc
# elpa packages
/elpa/

View File

@@ -2,6 +2,7 @@ version: 2
sphinx:
configuration: lib/spack/docs/conf.py
fail_on_warning: true
python:
version: 3.7

View File

@@ -1,3 +1,187 @@
# v0.17.0 (2021-11-05)
`v0.17.0` is a major feature release.
## Major features in this release
1. **New concretizer is now default**
The new concretizer introduced as an experimental feature in `v0.16.0`
is now the default (#25502). The new concretizer is based on the
[clingo](https://github.com/potassco/clingo) logic programming system,
and it enables us to do much higher quality and faster dependency solving
The old concretizer is still available via the `concretizer: original`
setting, but it is deprecated and will be removed in `v0.18.0`.
2. **Binary Bootstrapping**
To make it easier to use the new concretizer and binary packages,
Spack now bootstraps `clingo` and `GnuPG` from public binaries. If it
is not able to bootstrap them from binaries, it installs them from
source code. With these changes, you should still be able to clone Spack
and start using it almost immediately. (#21446, #22354, #22489, #22606,
#22720, #22720, #23677, #23946, #24003, #25138, #25607, #25964, #26029,
#26399, #26599).
3. **Reuse existing packages (experimental)**
The most wanted feature from our
[2020 user survey](https://spack.io/spack-user-survey-2020/) and
the most wanted Spack feature of all time (#25310). `spack install`,
`spack spec`, and `spack concretize` now have a `--reuse` option, which
causes Spack to minimize the number of rebuilds it does. The `--reuse`
option will try to find existing installations and binary packages locally
and in registered mirrors, and will prefer to use them over building new
versions. This will allow users to build from source *far* less than in
prior versions of Spack. This feature will continue to be improved, with
configuration options and better CLI expected in `v0.17.1`. It will become
the *default* concretization mode in `v0.18.0`.
4. **Better error messages**
We have improved the error messages generated by the new concretizer by
using *unsatisfiable cores*. Spack will now print a summary of the types
of constraints that were violated to make a spec unsatisfiable (#26719).
5. **Conditional variants**
Variants can now have a `when="<spec>"` clause, allowing them to be
conditional based on the version or other attributes of a package (#24858).
6. **Git commit versions**
In an environment and on the command-line, you can now provide a full,
40-character git commit as a version for any package with a top-level
`git` URL. e.g., `spack install hdf5@45bb27f58240a8da7ebb4efc821a1a964d7712a8`.
Spack will compare the commit to tags in the git repository to understand
what versions it is ahead of or behind.
7. **Override local config and cache directories**
You can now set `SPACK_DISABLE_LOCAL_CONFIG` to disable the `~/.spack` and
`/etc/spack` configuration scopes. `SPACK_USER_CACHE_PATH` allows you to
move caches out of `~/.spack`, as well (#27022, #26735). This addresses
common problems where users could not isolate CI environments from local
configuration.
8. **Improvements to Spack Containerize**
For added reproducibility, you can now pin the Spack version used by
`spack containerize` (#21910). The container build will only build
with the Spack version pinned at build recipe creation instead of the
latest Spack version.
9. **New commands for dealing with tags**
The `spack tags` command allows you to list tags on packages (#26136), and you
can list tests and filter tags with `spack test list` (#26842).
## Other new features of note
* Copy and relocate environment views as stand-alone installations (#24832)
* `spack diff` command can diff two installed specs (#22283, #25169)
* `spack -c <config>` can set one-off config parameters on CLI (#22251)
* `spack load --list` is an alias for `spack find --loaded` (#27184)
* `spack gpg` can export private key with `--secret` (#22557)
* `spack style` automatically bootstraps dependencies (#24819)
* `spack style --fix` automatically invokes `isort` (#24071)
* build dependencies can be installed from build caches with `--include-build-deps` (#19955)
* `spack audit` command for checking package constraints (#23053)
* Spack can now fetch from `CVS` repositories (yep, really) (#23212)
* `spack monitor` lets you upload analysis about installations to a
[spack monitor server](https://github.com/spack/spack-monitor) (#23804, #24321,
#23777, #25928))
* `spack python --path` shows which `python` Spack is using (#22006)
* `spack env activate --temp` can create temporary environments (#25388)
* `--preferred` and `--latest` options for `spack checksum` (#25830)
* `cc` is now pure posix and runs on Alpine (#26259)
* `SPACK_PYTHON` environment variable sets which `python` spack uses (#21222)
* `SPACK_SKIP_MODULES` lets you source `setup-env.sh` faster if you don't need modules (#24545)
## Major internal refactors
* `spec.yaml` files are now `spec.json`, yielding a large speed improvement (#22845)
* Splicing allows Spack specs to store mixed build provenance (#20262)
* More extensive hooks API for installations (#21930)
* New internal API for getting the active environment (#25439)
## Performance Improvements
* Parallelize separate concretization in environments; Previously 55 min E4S solve
now takes 2.5 min (#26264)
* Drastically improve YamlFilesystemView file removal performance via batching (#24355)
* Speed up spec comparison (#21618)
* Speed up environment activation (#25633)
## Archspec improvements
* support for new generic `x86_64_v2`, `x86_64_v3`, `x86_64_v4` targets
(see [archspec#31](https://github.com/archspec/archspec-json/pull/31))
* `spack arch --generic` lets you get the best generic architecture for
your node (#27061)
* added support for aocc (#20124), `arm` compiler on `graviton2` (#24904)
and on `a64fx` (#24524),
## Infrastructure, buildcaches, and services
* Add support for GCS Bucket Mirrors (#26382)
* Add `spackbot` to help package maintainers with notifications. See
[spack.github.io/spackbot](https://spack.github.io/spackbot/)
* Reproducible pipeline builds with `spack ci rebuild` (#22887)
* Removed redundant concretizations from GitLab pipeline generation (#26622)
* Spack CI no longer generates jobs for unbuilt specs (#20435)
* Every pull request pipeline has its own buildcache (#25529)
* `--no-add` installs only specified specs and only if already present in… (#22657)
* Add environment-aware `spack buildcache sync` command (#25470)
* Binary cache installation speedups and improvements (#19690, #20768)
## Deprecations and Removals
* `spack setup` was deprecated in v0.16.0, and has now been removed.
Use `spack develop` and `spack dev-build`.
* Remove unused `--dependencies` flag from `spack load` (#25731)
* Remove stubs for `spack module [refresh|find|rm|loads]`, all of which
were deprecated in 2018.
## Notable Bugfixes
* Deactivate previous env before activating new one (#25409)
* Many fixes to error codes from `spack install` (#21319, #27012, #25314)
* config add: infer type based on JSON schema validation errors (#27035)
* `spack config edit` now works even if `spack.yaml` is broken (#24689)
## Packages
* Allow non-empty version ranges like `1.1.0:1.1` (#26402)
* Remove `.99`'s from many version ranges (#26422)
* Python: use platform-specific site packages dir (#25998)
* `CachedCMakePackage` for using *.cmake initial config files (#19316)
* `lua-lang` allows swapping `lua` and `luajit` (#22492)
* Better support for `ld.gold` and `ld.lld` (#25626)
* build times are now stored as metadata in `$prefix/.spack` (#21179)
* post-install tests can be reused in smoke tests (#20298)
* Packages can use `pypi` attribute to infer `homepage`/`url`/`list_url` (#17587)
* Use gnuconfig package for `config.guess` file replacement (#26035)
* patches: make re-applied patches idempotent (#26784)
## Spack community stats
* 5969 total packages, 920 new since `v0.16.0`
* 358 new Python packages, 175 new R packages
* 513 people contributed to this release
* 490 committers to packages
* 105 committers to core
* Lots of GPU updates:
* ~77 CUDA-related commits
* ~66 AMD-related updates
* ~27 OneAPI-related commits
* 30 commits from AMD toolchain support
* `spack test` usage in packages is increasing
* 1669 packages with tests (mostly generic python tests)
* 93 packages with their own tests
# v0.16.3 (2021-09-21)
* clang/llvm: fix version detection (#19978)
* Fix use of quotes in Python build system (#22279)
* Cray: fix extracting paths from module files (#23472)
* Use AWS CloudFront for source mirror (#23978)
* Ensure all roots of an installed environment are marked explicit in db (#24277)
* Fix fetching for Python 3.8 and 3.9 (#24686)
* locks: only open lockfiles once instead of for every lock held (#24794)
* Remove the EOL centos:6 docker image
# v0.16.2 (2021-05-22)
* Major performance improvement for `spack load` and other commands. (#23661)

View File

@@ -4,6 +4,7 @@
[![Bootstrapping](https://github.com/spack/spack/actions/workflows/bootstrap.yml/badge.svg)](https://github.com/spack/spack/actions/workflows/bootstrap.yml)
[![macOS Builds (nightly)](https://github.com/spack/spack/workflows/macOS%20builds%20nightly/badge.svg?branch=develop)](https://github.com/spack/spack/actions?query=workflow%3A%22macOS+builds+nightly%22)
[![codecov](https://codecov.io/gh/spack/spack/branch/develop/graph/badge.svg)](https://codecov.io/gh/spack/spack)
[![Containers](https://github.com/spack/spack/actions/workflows/build-containers.yml/badge.svg)](https://github.com/spack/spack/actions/workflows/build-containers.yml)
[![Read the Docs](https://readthedocs.org/projects/spack/badge/?version=latest)](https://spack.readthedocs.io)
[![Slack](https://slack.spack.io/badge.svg)](https://slack.spack.io)
@@ -26,7 +27,7 @@ for examples and highlights.
To install spack and your first package, make sure you have Python.
Then:
$ git clone https://github.com/spack/spack.git
$ git clone -c feature.manyFiles=true https://github.com/spack/spack.git
$ cd spack/bin
$ ./spack install zlib

24
SECURITY.md Normal file
View File

@@ -0,0 +1,24 @@
# Security Policy
## Supported Versions
We provide security updates for the following releases.
For more on Spack's release structure, see
[`README.md`](https://github.com/spack/spack#releases).
| Version | Supported |
| ------- | ------------------ |
| develop | :white_check_mark: |
| 0.16.x | :white_check_mark: |
## Reporting a Vulnerability
To report a vulnerability or other security
issue, email maintainers@spack.io.
You can expect to hear back within two days.
If your security issue is accepted, we will do
our best to release a fix within a week. If
fixing the issue will take longer than this,
we will discuss timeline options with you.

View File

@@ -4,7 +4,7 @@ bootstrap:
enable: true
# Root directory for bootstrapping work. The software bootstrapped
# by Spack is installed in a "store" subfolder of this root directory
root: ~/.spack/bootstrap
root: $user_cache_path/bootstrap
# Methods that can be used to bootstrap software. Each method may or
# may not be able to bootstrap all of the software that Spack needs,
# depending on its type.
@@ -29,4 +29,4 @@ bootstrap:
# By default we trust bootstrapping from sources and from binaries
# produced on Github via the workflow
github-actions: true
spack-install: true
spack-install: true

View File

@@ -42,8 +42,8 @@ config:
# (i.e., ``$TMP` or ``$TMPDIR``).
#
# Another option that prevents conflicts and potential permission issues is
# to specify `~/.spack/stage`, which ensures each user builds in their home
# directory.
# to specify `$user_cache_path/stage`, which ensures each user builds in their
# home directory.
#
# A more traditional path uses the value of `$spack/var/spack/stage`, which
# builds directly inside Spack's instance without staging them in a
@@ -60,13 +60,13 @@ config:
# identifies Spack staging to avoid accidentally wiping out non-Spack work.
build_stage:
- $tempdir/$user/spack-stage
- ~/.spack/stage
- $user_cache_path/stage
# - $spack/var/spack/stage
# Directory in which to run tests and store test results.
# Tests will be stored in directories named by date/time and package
# name/hash.
test_stage: ~/.spack/test
test_stage: $user_cache_path/test
# Cache directory for already downloaded source tarballs and archived
# repositories. This can be purged with `spack clean --downloads`.
@@ -75,7 +75,7 @@ config:
# Cache directory for miscellaneous files, like the package index.
# This can be purged with `spack clean --misc-cache`
misc_cache: ~/.spack/cache
misc_cache: $user_cache_path/cache
# Timeout in seconds used for downloading sources etc. This only applies
@@ -134,7 +134,7 @@ config:
# enabling locks.
locks: true
# The default url fetch method to use.
# The default url fetch method to use.
# If set to 'curl', Spack will require curl on the user's system
# If set to 'urllib', Spack will use python built-in libs to fetch
url_fetch_method: urllib
@@ -160,11 +160,10 @@ config:
# sufficiently for many specs.
#
# 'clingo': Uses a logic solver under the hood to solve DAGs with full
# backtracking and optimization for user preferences.
# backtracking and optimization for user preferences. Spack will
# try to bootstrap the logic solver, if not already available.
#
# 'clingo' currently requires the clingo ASP solver to be installed and
# built with python bindings. 'original' is built in.
concretizer: original
concretizer: clingo
# How long to wait to lock the Spack installation database. This lock is used
@@ -191,3 +190,8 @@ config:
# Set to 'false' to allow installation on filesystems that doesn't allow setgid bit
# manipulation by unprivileged user (e.g. AFS)
allow_sgid: true
# Whether to set the terminal title to display status information during
# building and installing packages. This gives information about Spack's
# current progress as well as the current and total number of packages.
terminal_title: false

View File

@@ -31,13 +31,13 @@ colorized output with a flag
.. code-block:: console
$ spack --color always | less -R
$ spack --color always find | less -R
or an environment variable
.. code-block:: console
$ SPACK_COLOR=always spack | less -R
$ SPACK_COLOR=always spack find | less -R
--------------------------
Listing available packages
@@ -188,6 +188,34 @@ configuration a **spec**. In the commands above, ``mpileaks`` and
``mpileaks@3.0.4`` are both valid *specs*. We'll talk more about how
you can use them to customize an installation in :ref:`sec-specs`.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Reusing installed dependencies
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. warning::
The ``--reuse`` option described here is experimental, and it will
likely be replaced with a different option and configuration settings
in the next Spack release.
By default, when you run ``spack install``, Spack tries to build a new
version of the package you asked for, along with updated versions of
its dependencies. This gets you the latest versions and configurations,
but it can result in unwanted rebuilds if you update Spack frequently.
If you want Spack to try hard to reuse existing installations as dependencies,
you can add the ``--reuse`` option:
.. code-block:: console
$ spack install --reuse mpich
This will not do anything if ``mpich`` is already installed. If ``mpich``
is not installed, but dependencies like ``hwloc`` and ``libfabric`` are,
the ``mpich`` will be build with the installed versions, if possible.
You can use the :ref:`spack spec -I <cmd-spack-spec>` command to see what
will be reused and what will be built before you install.
.. _cmd-spack-uninstall:
^^^^^^^^^^^^^^^^^^^
@@ -868,8 +896,9 @@ your path:
These commands will add appropriate directories to your ``PATH``,
``MANPATH``, ``CPATH``, and ``LD_LIBRARY_PATH`` according to the
:ref:`prefix inspections <customize-env-modifications>` defined in your
modules configuration. When you no longer want to use a package, you
can type unload or unuse similarly:
modules configuration.
When you no longer want to use a package, you can type unload or
unuse similarly:
.. code-block:: console
@@ -910,6 +939,22 @@ first ``libelf`` above, you would run:
$ spack load /qmm4kso
To see which packages that you have loaded to your enviornment you would
use ``spack find --loaded``.
.. code-block:: console
$ spack find --loaded
==> 2 installed packages
-- linux-debian7 / gcc@4.4.7 ------------------------------------
libelf@0.8.13
-- linux-debian7 / intel@15.0.0 ---------------------------------
libelf@0.8.13
You can also use ``spack load --list`` to get the same output, but it
does not have the full set of query options that ``spack find`` offers.
We'll learn more about Spack's spec syntax in the next section.
@@ -1649,6 +1694,7 @@ and it will be added to the ``PYTHONPATH`` in your current shell:
Now ``import numpy`` will succeed for as long as you keep your current
session open.
The loaded packages can be checked using ``spack find --loaded``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Loading Extensions via Modules

View File

@@ -112,20 +112,44 @@ phase runs:
.. code-block:: console
$ libtoolize
$ aclocal
$ autoreconf --install --verbose --force
$ autoreconf --install --verbose --force -I <aclocal-prefix>/share/aclocal
All you need to do is add a few Autotools dependencies to the package.
Most stable releases will come with a ``configure`` script, but if you
check out a commit from the ``develop`` branch, you would want to add:
In case you need to add more arguments, override ``autoreconf_extra_args``
in your ``package.py`` on class scope like this:
.. code-block:: python
depends_on('autoconf', type='build', when='@develop')
depends_on('automake', type='build', when='@develop')
depends_on('libtool', type='build', when='@develop')
depends_on('m4', type='build', when='@develop')
autoreconf_extra_args = ["-Im4"]
All you need to do is add a few Autotools dependencies to the package.
Most stable releases will come with a ``configure`` script, but if you
check out a commit from the ``master`` branch, you would want to add:
.. code-block:: python
depends_on('autoconf', type='build', when='@master')
depends_on('automake', type='build', when='@master')
depends_on('libtool', type='build', when='@master')
It is typically redundant to list the ``m4`` macro processor package as a
dependency, since ``autoconf`` already depends on it.
"""""""""""""""""""""""""""""""
Using a custom autoreconf phase
"""""""""""""""""""""""""""""""
In some cases, it might be needed to replace the default implementation
of the autoreconf phase with one running a script interpreter. In this
example, the ``bash`` shell is used to run the ``autogen.sh`` script.
.. code-block:: python
def autoreconf(self, spec, prefix):
which('bash')('autogen.sh')
"""""""""""""""""""""""""""""""""""""""
patching configure or Makefile.in files
"""""""""""""""""""""""""""""""""""""""
In some cases, developers might need to distribute a patch that modifies
one of the files used to generate ``configure`` or ``Makefile.in``.
@@ -135,6 +159,57 @@ create a new patch that directly modifies ``configure``. That way,
Spack can use the secondary patch and additional build system
dependencies aren't necessary.
""""""""""""""""""""""""""""
Old Autotools helper scripts
""""""""""""""""""""""""""""
Autotools based tarballs come with helper scripts such as ``config.sub`` and
``config.guess``. It is the responsibility of the developers to keep these files
up to date so that they run on every platform, but for very old software
releases this is impossible. In these cases Spack can help to replace these
files with newer ones, without having to add the heavy dependency on
``automake``.
Automatic helper script replacement is currently enabled by default on
``ppc64le`` and ``aarch64``, as these are the known cases where old scripts fail.
On these targets, ``AutotoolsPackage`` adds a build dependency on ``gnuconfig``,
which is a very light-weight package with newer versions of the helper files.
Spack then tries to run all the helper scripts it can find in the release, and
replaces them on failure with the helper scripts from ``gnuconfig``.
To opt out of this feature, use the following setting:
.. code-block:: python
patch_config_files = False
To enable it conditionally on different architectures, define a property and
make the package depend on ``gnuconfig`` as a build dependency:
.. code-block
depends_on('gnuconfig', when='@1.0:')
@property
def patch_config_files(self):
return self.spec.satisfies("@1.0:")
.. note::
On some exotic architectures it is necessary to use system provided
``config.sub`` and ``config.guess`` files. In this case, the most
transparent solution is to mark the ``gnuconfig`` package as external and
non-buildable, with a prefix set to the directory containing the files:
.. code-block:: yaml
gnuconfig:
buildable: false
externals:
- spec: gnuconfig@master
prefix: /usr/share/configure_files/
""""""""""""""""
force_autoreconf
""""""""""""""""
@@ -324,8 +399,29 @@ options:
--with-libfabric=</path/to/libfabric>
"""""""""""""""""""""""
The ``variant`` keyword
"""""""""""""""""""""""
When Spack variants and configure flags do not correspond one-to-one, the
``variant`` keyword can be passed to ``with_or_without`` and
``enable_or_disable``. For example:
.. code-block:: python
variant('debug_tools', default=False)
config_args += self.enable_or_disable('debug-tools', variant='debug_tools')
Or when one variant controls multiple flags:
.. code-block:: python
variant('debug_tools', default=False)
config_args += self.with_or_without('memchecker', variant='debug_tools')
config_args += self.with_or_without('profiler', variant='debug_tools')
""""""""""""""""""""
activation overrides
Activation overrides
""""""""""""""""""""
Finally, the behavior of either ``with_or_without`` or

View File

@@ -336,7 +336,7 @@ This would be translated to:
.. code-block:: python
extends('python')
depends_on('python@3.5:3.999', type=('build', 'run'))
depends_on('python@3.5:3', type=('build', 'run'))
Many ``setup.py`` or ``setup.cfg`` files also contain information like::
@@ -568,7 +568,7 @@ check the ``METADATA`` file for lines like::
Lines that use ``Requires-Dist`` are similar to ``install_requires``.
Lines that use ``Provides-Extra`` are similar to ``extra_requires``,
and you can add a variant for those dependencies. The ``~=1.11.0``
syntax is equivalent to ``1.11.0:1.11.999``.
syntax is equivalent to ``1.11.0:1.11``.
""""""""""
setuptools

View File

@@ -259,3 +259,16 @@ and ld.so will ONLY search for dependencies in the ``RUNPATH`` of
the loading object.
DO NOT MIX the two options within the same install tree.
----------------------
``terminal_title``
----------------------
By setting this option to ``true``, Spack will update the terminal's title to
provide information about its current progress as well as the current and
total package numbers.
To work properly, this requires your terminal to reset its title after
Spack has finished its work, otherwise Spack's status information will
remain in the terminal's title indefinitely. Most terminals should already
be set up this way and clear Spack's status information.

View File

@@ -402,12 +402,15 @@ Spack-specific variables
Spack understands several special variables. These are:
* ``$env``: name of the currently active :ref:`environment <environments>`
* ``$spack``: path to the prefix of this Spack installation
* ``$tempdir``: default system temporary directory (as specified in
Python's `tempfile.tempdir
<https://docs.python.org/2/library/tempfile.html#tempfile.tempdir>`_
variable.
* ``$user``: name of the current user
* ``$user_cache_path``: user cache directory (``~/.spack`` unless
:ref:`overridden <local-config-overrides>`)
Note that, as with shell variables, you can write these as ``$varname``
or with braces to distinguish the variable from surrounding characters:
@@ -562,3 +565,39 @@ built in and are not overridden by a configuration file. The
command line. ``dirty`` and ``install_tree`` come from the custom
scopes ``./my-scope`` and ``./my-scope-2``, and all other configuration
options come from the default configuration files that ship with Spack.
.. _local-config-overrides:
------------------------------
Overriding Local Configuration
------------------------------
Spack's ``system`` and ``user`` scopes provide ways for administrators and users to set
global defaults for all Spack instances, but for use cases where one wants a clean Spack
installation, these scopes can be undesirable. For example, users may want to opt out of
global system configuration, or they may want to ignore their own home directory
settings when running in a continuous integration environment.
Spack also, by default, keeps various caches and user data in ``~/.spack``, but
users may want to override these locations.
Spack provides three environment variables that allow you to override or opt out of
configuration locations:
* ``SPACK_USER_CONFIG_PATH``: Override the path to use for the
``user`` scope (``~/.spack`` by default).
* ``SPACK_SYSTEM_CONFIG_PATH``: Override the path to use for the
``system`` scope (``/etc/spack`` by default).
* ``SPACK_DISABLE_LOCAL_CONFIG``: set this environment variable to completely disable
**both** the system and user configuration directories. Spack will only consider its
own defaults and ``site`` configuration locations.
And one that allows you to move the default cache location:
* ``SPACK_USER_CACHE_PATH``: Override the default path to use for user data
(misc_cache, tests, reports, etc.)
With these settings, if you want to isolate Spack in a CI environment, you can do this::
export SPACK_DISABLE_LOCAL_CONFIG=true
export SPACK_USER_CACHE_PATH=/tmp/spack

View File

@@ -126,9 +126,6 @@ are currently supported are summarized in the table below:
* - Ubuntu 18.04
- ``ubuntu:18.04``
- ``spack/ubuntu-bionic``
* - CentOS 6
- ``centos:6``
- ``spack/centos6``
* - CentOS 7
- ``centos:7``
- ``spack/centos7``
@@ -200,7 +197,7 @@ Setting Base Images
The ``images`` subsection is used to select both the image where
Spack builds the software and the image where the built software
is installed. This attribute can be set in two different ways and
is installed. This attribute can be set in different ways and
which one to use depends on the use case at hand.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -260,10 +257,54 @@ software is respectively built and installed:
ENTRYPOINT ["/bin/bash", "--rcfile", "/etc/profile", "-l"]
This method of selecting base images is the simplest of the two, and we advise
This is the simplest available method of selecting base images, and we advise
to use it whenever possible. There are cases though where using Spack official
images is not enough to fit production needs. In these situations users can manually
select which base image to start from in the recipe, as we'll see next.
images is not enough to fit production needs. In these situations users can
extend the recipe to start with the bootstrapping of Spack at a certain pinned
version or manually select which base image to start from in the recipe,
as we'll see next.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Use a Bootstrap Stage for Spack
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
In some cases users may want to pin the commit sha that is used for Spack, to ensure later
reproducibility, or start from a fork of the official Spack repository to try a bugfix or
a feature in the early stage of development. This is possible by being just a little more
verbose when specifying information about Spack in the ``spack.yaml`` file:
.. code-block:: yaml
images:
os: amazonlinux:2
spack:
# URL of the Spack repository to be used in the container image
url: <to-use-a-fork>
# Either a commit sha, a branch name or a tag
ref: <sha/tag/branch>
# If true turn a branch name or a tag into the corresponding commit
# sha at the time of recipe generation
resolve_sha: <true/false>
``url`` specifies the URL from which to clone Spack and defaults to https://github.com/spack/spack.
The ``ref`` attribute can be either a commit sha, a branch name or a tag. The default value in
this case is to use the ``develop`` branch, but it may change in the future to point to the latest stable
release. Finally ``resolve_sha`` transform branch names or tags into the corresponding commit
shas at the time of recipe generation, to allow for a greater reproducibility of the results
at a later time.
The list of operating systems that can be used to bootstrap Spack can be
obtained with:
.. command-output:: spack containerize --list-os
.. note::
The ``resolve_sha`` option uses ``git rev-parse`` under the hood and thus it requires
to checkout the corresponding Spack repository in a temporary folder before generating
the recipe. Recipe generation may take longer when this option is set to true because
of this additional step.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Use Custom Images Provided by Users
@@ -415,6 +456,18 @@ to customize the generation of container recipes:
- Version of Spack use in the ``build`` stage
- Valid tags for ``base:image``
- Yes, if using constrained selection of base images
* - ``images:spack:url``
- Repository from which Spack is cloned
- Any fork of Spack
- No
* - ``images:spack:ref``
- Reference for the checkout of Spack
- Either a commit sha, a branch name or a tag
- No
* - ``images:spack:resolve_sha``
- Resolve branches and tags in ``spack.yaml`` to commits in the generated recipe
- True or False (default: False)
- No
* - ``images:build``
- Image to be used in the ``build`` stage
- Any valid container image

View File

@@ -338,15 +338,6 @@ Once all of the dependencies are installed, you can try building the documentati
If you see any warning or error messages, you will have to correct those before
your PR is accepted.
.. note::
There is also a ``run-doc-tests`` script in ``share/spack/qa``. The only
difference between running this script and running ``make`` by hand is that
the script will exit immediately if it encounters an error or warning. This
is necessary for CI. If you made a lot of documentation changes, it is
much quicker to run ``make`` by hand so that you can see all of the warnings
at once.
If you are editing the documentation, you should obviously be running the
documentation tests. But even if you are simply adding a new package, your
changes could cause the documentation tests to fail:

View File

@@ -210,15 +210,6 @@ Spec-related modules
but compilers aren't fully integrated with the build process
yet.
:mod:`spack.architecture`
:func:`architecture.default_arch <spack.architecture.default_arch>` is used
to determine the host architecture while building.
.. warning::
Not yet implemented. Should eventually have architecture
descriptions for cross-compiling.
^^^^^^^^^^^^^^^^^
Build environment
^^^^^^^^^^^^^^^^^

View File

@@ -35,7 +35,7 @@ Getting Spack is easy. You can clone it from the `github repository
.. code-block:: console
$ git clone https://github.com/spack/spack.git
$ git clone -c feature.manyFiles=true https://github.com/spack/spack.git
This will create a directory called ``spack``.
@@ -88,74 +88,71 @@ the environment.
Bootstrapping clingo
^^^^^^^^^^^^^^^^^^^^
Spack supports using ``clingo`` as an external solver to compute which software
needs to be installed. The default configuration allows Spack to install
``clingo`` from a public buildcache, created by a Github Action workflow. In this
case the bootstrapping procedure is transparent to the user, except for a
slightly long waiting time on the first concretization of a spec:
Spack uses ``clingo`` under the hood to resolve optimal versions and variants of
dependencies when installing a package. Since ``clingo`` itself is a binary,
Spack has to install it on initial use, which is called bootstrapping.
Spack provides two ways of bootstrapping ``clingo``: from pre-built binaries
(default), or from sources. The fastest way to get started is to bootstrap from
pre-built binaries.
.. note::
When bootstrapping from pre-built binaries, Spack currently requires
``patchelf`` on Linux and ``otool`` on macOS. If ``patchelf`` is not in the
``PATH``, Spack will build it from sources, and a C++ compiler is required.
The first time you concretize a spec, Spack will bootstrap in the background:
.. code-block:: console
$ spack find -b
==> Showing internal bootstrap store at "/home/spack/.spack/bootstrap/store"
==> 0 installed packages
$ time spack spec zlib
Input spec
--------------------------------
zlib
$ time spack solve zlib
==> Best of 2 considered solutions.
==> Optimization Criteria:
Priority Criterion Value
1 deprecated versions used 0
2 version weight 0
3 number of non-default variants (roots) 0
4 multi-valued variants 0
5 preferred providers for roots 0
6 number of non-default variants (non-roots) 0
7 preferred providers (non-roots) 0
8 compiler mismatches 0
9 version badness 0
10 count of non-root multi-valued variants 0
11 non-preferred compilers 0
12 target mismatches 0
13 non-preferred targets 0
Concretized
--------------------------------
zlib@1.2.11%gcc@7.5.0+optimize+pic+shared arch=linux-ubuntu18.04-zen
zlib@1.2.11%gcc@11.1.0+optimize+pic+shared arch=linux-ubuntu18.04-broadwell
real 0m30,618s
user 0m27,278s
sys 0m1,549s
real 0m20.023s
user 0m18.351s
sys 0m0.784s
After this command you'll see that ``clingo`` has been installed for Spack's own use:
.. code-block:: console
$ spack find -b
==> Showing internal bootstrap store at "/home/spack/.spack/bootstrap/store"
==> 2 installed packages
==> Showing internal bootstrap store at "/root/.spack/bootstrap/store"
==> 3 installed packages
-- linux-rhel5-x86_64 / gcc@9.3.0 -------------------------------
clingo-bootstrap@spack python@3.6
-- linux-ubuntu18.04-zen / gcc@7.5.0 ----------------------------
patchelf@0.13
Subsequent calls to the concretizer will then be much faster:
.. code-block:: console
$ time spack solve zlib
$ time spack spec zlib
[ ... ]
real 0m1,222s
user 0m1,146s
sys 0m0,059s
real 0m0.490s
user 0m0.431s
sys 0m0.041s
If for security or for other reasons you don't want to or can't install precompiled
binaries, Spack can fall-back to bootstrap ``clingo`` from source files. To forbid
Spack from retrieving binaries from the bootstrapping buildcache, the following
command must be given:
If for security concerns you cannot bootstrap ``clingo`` from pre-built
binaries, you have to mark this bootstrapping method as untrusted. This makes
Spack fall back to bootstrapping from sources:
.. code-block:: console
$ spack bootstrap untrust github-actions
==> "github-actions" is now untrusted and will not be used for bootstrapping
since an "untrusted" way of bootstrapping software will not be considered
by Spack. You can verify the new settings are effective with:
You can verify that the new settings are effective with:
.. code-block:: console
@@ -181,33 +178,25 @@ by Spack. You can verify the new settings are effective with:
Description:
Specs built from sources by Spack. May take a long time.
When bootstrapping from sources, Spack requires a compiler with support
for C++14 (GCC on ``linux``, Apple Clang on ``darwin``) and static C++
standard libraries on ``linux``. Spack will build the required software
on the first request to concretize a spec:
.. note::
When bootstrapping from sources, Spack requires a full install of Python
including header files (e.g. ``python3-dev`` on Debian), and a compiler
with support for C++14 (GCC on Linux, Apple Clang on macOS) and static C++
standard libraries on Linux.
Spack will build the required software on the first request to concretize a spec:
.. code-block:: console
$ spack solve zlib
$ spack spec zlib
[+] /usr (external bison-3.0.4-wu5pgjchxzemk5ya2l3ddqug2d7jv6eb)
[+] /usr (external cmake-3.19.4-a4kmcfzxxy45mzku4ipmj5kdiiz5a57b)
[+] /usr (external python-3.6.9-x4fou4iqqlh5ydwddx3pvfcwznfrqztv)
==> Installing re2c-1.2.1-e3x6nxtk3ahgd63ykgy44mpuva6jhtdt
[ ... ]
==> Optimization: [0, 0, 0, 0, 0, 1, 0, 0, 0]
zlib@1.2.11%gcc@10.1.0+optimize+pic+shared arch=linux-ubuntu18.04-broadwell
.. tip::
If you want to speed-up bootstrapping ``clingo`` from sources, you may try to
search for ``cmake`` and ``bison`` on your system:
.. code-block:: console
$ spack external find cmake bison
==> The following specs have been detected on this system and added to /home/spack/.spack/packages.yaml
bison@3.0.4 cmake@3.19.4
"""""""""""""""""""
The Bootstrap Store
"""""""""""""""""""

View File

@@ -39,7 +39,7 @@ package:
.. code-block:: console
$ git clone https://github.com/spack/spack.git
$ git clone -c feature.manyFiles=true https://github.com/spack/spack.git
$ cd spack/bin
$ ./spack install libelf

View File

@@ -213,6 +213,18 @@ location). The set ``my_custom_lmod_modules`` will install its lmod
modules to ``/path/to/install/custom/lmod/modules`` (and still install
its tcl modules, if any, to the default location).
By default, an architecture-specific directory is added to the root
directory. A module set may override that behavior by setting the
``arch_folder`` config value to ``False``.
.. code-block:: yaml
modules:
default:
roots:
tcl: /path/to/install/tcl/modules
arch_folder: false
Obviously, having multiple module sets install modules to the default
location could be confusing to users of your modules. In the next
section, we will discuss enabling and disabling module types (module
@@ -449,6 +461,36 @@ that are already in the LMod hierarchy.
For hierarchies that are deeper than three layers ``lmod spider`` may have some issues.
See `this discussion on the LMod project <https://github.com/TACC/Lmod/issues/114>`_.
""""""""""""""""""""""
Select default modules
""""""""""""""""""""""
By default, when multiple modules of the same name share a directory,
the highest version number will be the default module. This behavior
of the ``module`` command can be overridden with a symlink named
``default`` to the desired default module. If you wish to configure
default modules with Spack, add a ``defaults`` key to your modules
configuration:
.. code-block:: yaml
modules:
my-module-set:
tcl:
defaults:
- gcc@10.2.1
- hdf5@1.2.10+mpi+hl%gcc
These defaults may be arbitrarily specific. For any package that
satisfies a default, Spack will generate the module file in the
appropriate path, and will generate a default symlink to the module
file as well.
.. warning::
If Spack is configured to generate multiple default packages in the
same directory, the last modulefile to be generated will be the
default module.
.. _customize-env-modifications:
"""""""""""""""""""""""""""""""""""

View File

@@ -695,20 +695,23 @@ example, ``py-sphinx-rtd-theme@0.1.10a0``. In this case, numbers are
always considered to be "newer" than letters. This is for consistency
with `RPM <https://bugzilla.redhat.com/show_bug.cgi?id=50977>`_.
Spack versions may also be arbitrary non-numeric strings; any string
here will suffice; for example, ``@develop``, ``@master``, ``@local``.
Versions are compared as follows. First, a version string is split into
multiple fields based on delimiters such as ``.``, ``-`` etc. Then
matching fields are compared using the rules below:
Spack versions may also be arbitrary non-numeric strings, for example
``@develop``, ``@master``, ``@local``.
#. The following develop-like strings are greater (newer) than all
numbers and are ordered as ``develop > main > master > head > trunk``.
The order on versions is defined as follows. A version string is split
into a list of components based on delimiters such as ``.``, ``-`` etc.
Lists are then ordered lexicographically, where components are ordered
as follows:
#. Numbers are all less than the chosen develop-like strings above,
and are sorted numerically.
#. The following special strings are considered larger than any other
numeric or non-numeric version component, and satisfy the following
order between themselves: ``develop > main > master > head > trunk``.
#. All other non-numeric versions are less than numeric versions, and
are sorted alphabetically.
#. Numbers are ordered numerically, are less than special strings, and
larger than other non-numeric components.
#. All other non-numeric components are less than numeric components,
and are ordered alphabetically.
The logic behind this sort order is two-fold:
@@ -729,7 +732,7 @@ Version selection
When concretizing, many versions might match a user-supplied spec.
For example, the spec ``python`` matches all available versions of the
package ``python``. Similarly, ``python@3:`` matches all versions of
Python3. Given a set of versions that match a spec, Spack
Python 3 and above. Given a set of versions that match a spec, Spack
concretization uses the following priorities to decide which one to
use:
@@ -1419,6 +1422,60 @@ other similar operations:
).with_default('auto').with_non_feature_values('auto'),
)
^^^^^^^^^^^^^^^^^^^^
Conditional Variants
^^^^^^^^^^^^^^^^^^^^
The variant directive accepts a ``when`` clause. The variant will only
be present on specs that otherwise satisfy the spec listed as the
``when`` clause. For example, the following class has a variant
``bar`` when it is at version 2.0 or higher.
.. code-block:: python
class Foo(Package):
...
variant('bar', default=False, when='@2.0:', description='help message')
The ``when`` clause follows the same syntax and accepts the same
values as the ``when`` argument of
:py:func:`spack.directives.depends_on`
^^^^^^^^^^^^^^^^^^^
Overriding Variants
^^^^^^^^^^^^^^^^^^^
Packages may override variants for several reasons, most often to
change the default from a variant defined in a parent class or to
change the conditions under which a variant is present on the spec.
When a variant is defined multiple times, whether in the same package
file or in a subclass and a superclass, the last definition is used
for all attributes **except** for the ``when`` clauses. The ``when``
clauses are accumulated through all invocations, and the variant is
present on the spec if any of the accumulated conditions are
satisfied.
For example, consider the following package:
.. code-block:: python
class Foo(Package):
...
variant('bar', default=False, when='@1.0', description='help1')
variant('bar', default=True, when='platform=darwin', description='help2')
...
This package ``foo`` has a variant ``bar`` when the spec satisfies
either ``@1.0`` or ``platform=darwin``, but not for other platforms at
other versions. The default for this variant, when it is present, is
always ``True``, regardless of which condition of the variant is
satisfied. This allows packages to override variants in packages or
build system classes from which they inherit, by modifying the variant
values without modifying the ``when`` clause. It also allows a package
to implement ``or`` semantics for a variant ``when`` clause by
duplicating the variant definition.
------------------------------------
Resources (expanding extra tarballs)
------------------------------------
@@ -2063,7 +2120,7 @@ Version ranges
^^^^^^^^^^^^^^
Although some packages require a specific version for their dependencies,
most can be built with a range of version. For example, if you are
most can be built with a range of versions. For example, if you are
writing a package for a legacy Python module that only works with Python
2.4 through 2.6, this would look like:
@@ -2072,9 +2129,9 @@ writing a package for a legacy Python module that only works with Python
depends_on('python@2.4:2.6')
Version ranges in Spack are *inclusive*, so ``2.4:2.6`` means any version
greater than or equal to ``2.4`` and up to and including ``2.6``. If you
want to specify that a package works with any version of Python 3, this
would look like:
greater than or equal to ``2.4`` and up to and including any ``2.6.x``. If
you want to specify that a package works with any version of Python 3 (or
higher), this would look like:
.. code-block:: python
@@ -2085,29 +2142,30 @@ requires Python 2, you can similarly leave out the lower bound:
.. code-block:: python
depends_on('python@:2.9')
depends_on('python@:2')
Notice that we didn't use ``@:3``. Version ranges are *inclusive*, so
``@:3`` means "up to and including 3".
``@:3`` means "up to and including any 3.x version".
What if a package can only be built with Python 2.6? You might be
What if a package can only be built with Python 2.7? You might be
inclined to use:
.. code-block:: python
depends_on('python@2.6')
depends_on('python@2.7')
However, this would be wrong. Spack assumes that all version constraints
are absolute, so it would try to install Python at exactly ``2.6``. The
correct way to specify this would be:
are exact, so it would try to install Python not at ``2.7.18``, but
exactly at ``2.7``, which is a non-existent version. The correct way to
specify this would be:
.. code-block:: python
depends_on('python@2.6.0:2.6.999')
depends_on('python@2.7.0:2.7')
A spec can contain multiple version ranges separated by commas.
For example, if you need Boost 1.59.0 or newer, but there are known
issues with 1.64.0, 1.65.0, and 1.66.0, you can say:
A spec can contain a version list of ranges and individual versions
separated by commas. For example, if you need Boost 1.59.0 or newer,
but there are known issues with 1.64.0, 1.65.0, and 1.66.0, you can say:
.. code-block:: python
@@ -2824,7 +2882,7 @@ is equivalent to:
depends_on('elpa+openmp', when='+openmp+elpa')
Constraints from nested context managers are also added together, but they are rarely
Constraints from nested context managers are also combined together, but they are rarely
needed or recommended.
.. _install-method:

View File

@@ -48,9 +48,9 @@ or Amazon Elastic Kubernetes Service (`EKS <https://aws.amazon.com/eks>`_), thou
topics are outside the scope of this document.
Spack's pipelines are now making use of the
`trigger <https://docs.gitlab.com/12.9/ee/ci/yaml/README.html#trigger>`_ syntax to run
`trigger <https://docs.gitlab.com/ee/ci/yaml/#trigger>`_ syntax to run
dynamically generated
`child pipelines <https://docs.gitlab.com/12.9/ee/ci/parent_child_pipelines.html>`_.
`child pipelines <https://docs.gitlab.com/ee/ci/pipelines/parent_child_pipelines.html>`_.
Note that the use of dynamic child pipelines requires running Gitlab version
``>= 12.9``.

View File

@@ -335,7 +335,7 @@ merged YAML from all configuration files, use ``spack config get repos``:
- ~/myrepo
- $spack/var/spack/repos/builtin
mNote that, unlike ``spack repo list``, this does not include the
Note that, unlike ``spack repo list``, this does not include the
namespace, which is read from each repo's ``repo.yaml``.
^^^^^^^^^^^^^^^^^^^^^

View File

@@ -5,3 +5,6 @@ sphinx>=3.4,!=4.1.2
sphinxcontrib-programoutput
sphinx-rtd-theme
python-levenshtein
# Restrict to docutils <0.17 to workaround a list rendering issue in sphinx.
# https://stackoverflow.com/questions/67542699
docutils <0.17

View File

@@ -17,6 +17,7 @@ spack:
# Sphinx
- "py-sphinx@3.4:4.1.1,4.1.3:"
- py-sphinxcontrib-programoutput
- py-docutils@:0.16
- py-sphinx-rtd-theme
# VCS
- git

View File

@@ -15,3 +15,4 @@ gnupg2, , , Sign/Verify Buildcaches
git, , , Manage Software Repositories
svn, , Optional, Manage Software Repositories
hg, , Optional, Manage Software Repositories
Python header files, , Optional (e.g. ``python3-dev`` on Debian), Bootstrapping from sources
1 Name Supported Versions Notes Requirement Reason
15 git Manage Software Repositories
16 svn Optional Manage Software Repositories
17 hg Optional Manage Software Repositories
18 Python header files Optional (e.g. ``python3-dev`` on Debian) Bootstrapping from sources

574
lib/spack/env/cc vendored
View File

@@ -1,4 +1,5 @@
#!/bin/bash
#!/bin/sh
# shellcheck disable=SC2034 # evals in this script fool shellcheck
#
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
@@ -20,25 +21,33 @@
# -Wl,-rpath arguments for dependency /lib directories.
#
# Reset IFS to the default: whitespace-separated lists. When we use
# other separators, we set and reset it.
unset IFS
# Separator for lists whose names end with `_list`.
# We pick the alarm bell character, which is highly unlikely to
# conflict with anything. This is a literal bell character (which
# we have to use since POSIX sh does not convert escape sequences
# like '\a' outside of the format argument of `printf`).
# NOTE: Depending on your editor this may look empty, but it is not.
readonly lsep=''
# This is an array of environment variables that need to be set before
# the script runs. They are set by routines in spack.build_environment
# as part of the package installation process.
parameters=(
SPACK_ENV_PATH
SPACK_DEBUG_LOG_DIR
SPACK_DEBUG_LOG_ID
SPACK_COMPILER_SPEC
SPACK_CC_RPATH_ARG
SPACK_CXX_RPATH_ARG
SPACK_F77_RPATH_ARG
SPACK_FC_RPATH_ARG
SPACK_TARGET_ARGS
SPACK_DTAGS_TO_ADD
SPACK_DTAGS_TO_STRIP
SPACK_LINKER_ARG
SPACK_SHORT_SPEC
SPACK_SYSTEM_DIRS
)
readonly params="\
SPACK_ENV_PATH
SPACK_DEBUG_LOG_DIR
SPACK_DEBUG_LOG_ID
SPACK_COMPILER_SPEC
SPACK_CC_RPATH_ARG
SPACK_CXX_RPATH_ARG
SPACK_F77_RPATH_ARG
SPACK_FC_RPATH_ARG
SPACK_LINKER_ARG
SPACK_SHORT_SPEC
SPACK_SYSTEM_DIRS"
# Optional parameters that aren't required to be set
@@ -58,60 +67,157 @@ parameters=(
# Test command is used to unit test the compiler script.
# SPACK_TEST_COMMAND
# die()
# Prints a message and exits with error 1.
function die {
echo "$@"
# die MESSAGE
# Print a message and exit with error code 1.
die() {
echo "[spack cc] ERROR: $*"
exit 1
}
# read input parameters into proper bash arrays.
# SYSTEM_DIRS is delimited by :
IFS=':' read -ra SPACK_SYSTEM_DIRS <<< "${SPACK_SYSTEM_DIRS}"
# empty VARNAME
# Return whether the variable VARNAME is unset or set to the empty string.
empty() {
eval "test -z \"\${$1}\""
}
# SPACK_<LANG>FLAGS and SPACK_LDLIBS are split by ' '
IFS=' ' read -ra SPACK_FFLAGS <<< "$SPACK_FFLAGS"
IFS=' ' read -ra SPACK_CPPFLAGS <<< "$SPACK_CPPFLAGS"
IFS=' ' read -ra SPACK_CFLAGS <<< "$SPACK_CFLAGS"
IFS=' ' read -ra SPACK_CXXFLAGS <<< "$SPACK_CXXFLAGS"
IFS=' ' read -ra SPACK_LDFLAGS <<< "$SPACK_LDFLAGS"
IFS=' ' read -ra SPACK_LDLIBS <<< "$SPACK_LDLIBS"
# setsep LISTNAME
# Set the global variable 'sep' to the separator for a list with name LISTNAME.
# There are three types of lists:
# 1. regular lists end with _list and are separated by $lsep
# 2. directory lists end with _dirs/_DIRS/PATH(S) and are separated by ':'
# 3. any other list is assumed to be separated by spaces: " "
setsep() {
case "$1" in
*_dirs|*_DIRS|*PATH|*PATHS)
sep=':'
;;
*_list)
sep="$lsep"
;;
*)
sep=" "
;;
esac
}
# prepend LISTNAME ELEMENT [SEP]
#
# Prepend ELEMENT to the list stored in the variable LISTNAME,
# assuming the list is separated by SEP.
# Handles empty lists and single-element lists.
prepend() {
varname="$1"
elt="$2"
if empty "$varname"; then
eval "$varname=\"\${elt}\""
else
# Get the appropriate separator for the list we're appending to.
setsep "$varname"
eval "$varname=\"\${elt}${sep}\${$varname}\""
fi
}
# append LISTNAME ELEMENT [SEP]
#
# Append ELEMENT to the list stored in the variable LISTNAME,
# assuming the list is separated by SEP.
# Handles empty lists and single-element lists.
append() {
varname="$1"
elt="$2"
if empty "$varname"; then
eval "$varname=\"\${elt}\""
else
# Get the appropriate separator for the list we're appending to.
setsep "$varname"
eval "$varname=\"\${$varname}${sep}\${elt}\""
fi
}
# extend LISTNAME1 LISTNAME2 [PREFIX]
#
# Append the elements stored in the variable LISTNAME2
# to the list stored in LISTNAME1.
# If PREFIX is provided, prepend it to each element.
extend() {
# Figure out the appropriate IFS for the list we're reading.
setsep "$2"
if [ "$sep" != " " ]; then
IFS="$sep"
fi
eval "for elt in \${$2}; do append $1 \"$3\${elt}\"; done"
unset IFS
}
# preextend LISTNAME1 LISTNAME2 [PREFIX]
#
# Prepend the elements stored in the list at LISTNAME2
# to the list at LISTNAME1, preserving order.
# If PREFIX is provided, prepend it to each element.
preextend() {
# Figure out the appropriate IFS for the list we're reading.
setsep "$2"
if [ "$sep" != " " ]; then
IFS="$sep"
fi
# first, reverse the list to prepend
_reversed_list=""
eval "for elt in \${$2}; do prepend _reversed_list \"$3\${elt}\"; done"
# prepend reversed list to preextend in order
IFS="${lsep}"
for elt in $_reversed_list; do prepend "$1" "$3${elt}"; done
unset IFS
}
# system_dir PATH
# test whether a path is a system directory
function system_dir {
system_dir() {
IFS=':' # SPACK_SYSTEM_DIRS is colon-separated
path="$1"
for sd in "${SPACK_SYSTEM_DIRS[@]}"; do
if [ "${path}" == "${sd}" ] || [ "${path}" == "${sd}/" ]; then
for sd in $SPACK_SYSTEM_DIRS; do
if [ "${path}" = "${sd}" ] || [ "${path}" = "${sd}/" ]; then
# success if path starts with a system prefix
unset IFS
return 0
fi
done
unset IFS
return 1 # fail if path starts no system prefix
}
for param in "${parameters[@]}"; do
if [[ -z ${!param+x} ]]; then
# Fail with a clear message if the input contains any bell characters.
if eval "[ \"\${*#*${lsep}}\" != \"\$*\" ]"; then
die "Compiler command line contains our separator ('${lsep}'). Cannot parse."
fi
# ensure required variables are set
for param in $params; do
if eval "test -z \"\${${param}:-}\""; then
die "Spack compiler must be run from Spack! Input '$param' is missing."
fi
done
# Check if optional parameters are defined
# If we aren't asking for debug flags, don't add them
if [[ -z ${SPACK_ADD_DEBUG_FLAGS+x} ]]; then
if [ -z "${SPACK_ADD_DEBUG_FLAGS:-}" ]; then
SPACK_ADD_DEBUG_FLAGS="false"
fi
# SPACK_ADD_DEBUG_FLAGS must be true/false/custom
is_valid="false"
for param in "true" "false" "custom"; do
if [ "$param" == "$SPACK_ADD_DEBUG_FLAGS" ]; then
if [ "$param" = "$SPACK_ADD_DEBUG_FLAGS" ]; then
is_valid="true"
fi
done
# Exit with error if we are given an incorrect value
if [ "$is_valid" == "false" ]; then
die "SPACK_ADD_DEBUG_FLAGS, if defined, must be one of 'true' 'false' or 'custom'"
if [ "$is_valid" = "false" ]; then
die "SPACK_ADD_DEBUG_FLAGS, if defined, must be one of 'true', 'false', or 'custom'."
fi
# Figure out the type of compiler, the language, and the mode so that
@@ -128,7 +234,7 @@ fi
# ld link
# ccld compile & link
command=$(basename "$0")
command="${0##*/}"
comp="CC"
case "$command" in
cpp)
@@ -174,7 +280,7 @@ esac
# If any of the arguments below are present, then the mode is vcheck.
# In vcheck mode, nothing is added in terms of extra search paths or
# libraries.
if [[ -z $mode ]] || [[ $mode == ld ]]; then
if [ -z "$mode" ] || [ "$mode" = ld ]; then
for arg in "$@"; do
case $arg in
-v|-V|--version|-dumpversion)
@@ -186,16 +292,16 @@ if [[ -z $mode ]] || [[ $mode == ld ]]; then
fi
# Finish setting up the mode.
if [[ -z $mode ]]; then
if [ -z "$mode" ]; then
mode=ccld
for arg in "$@"; do
if [[ $arg == -E ]]; then
if [ "$arg" = "-E" ]; then
mode=cpp
break
elif [[ $arg == -S ]]; then
elif [ "$arg" = "-S" ]; then
mode=as
break
elif [[ $arg == -c ]]; then
elif [ "$arg" = "-c" ]; then
mode=cc
break
fi
@@ -222,42 +328,46 @@ dtags_to_strip="${SPACK_DTAGS_TO_STRIP}"
linker_arg="${SPACK_LINKER_ARG}"
# Set up rpath variable according to language.
eval rpath=\$SPACK_${comp}_RPATH_ARG
rpath="ERROR: RPATH ARG WAS NOT SET"
eval "rpath=\${SPACK_${comp}_RPATH_ARG:?${rpath}}"
# Dump the mode and exit if the command is dump-mode.
if [[ $SPACK_TEST_COMMAND == dump-mode ]]; then
if [ "$SPACK_TEST_COMMAND" = "dump-mode" ]; then
echo "$mode"
exit
fi
# Check that at least one of the real commands was actually selected,
# otherwise we don't know what to execute.
if [[ -z $command ]]; then
die "ERROR: Compiler '$SPACK_COMPILER_SPEC' does not support compiling $language programs."
# If, say, SPACK_CC is set but SPACK_FC is not, we want to know. Compilers do not
# *have* to set up Fortran executables, so we need to tell the user when a build is
# about to attempt to use them unsuccessfully.
if [ -z "$command" ]; then
die "Compiler '$SPACK_COMPILER_SPEC' does not have a $language compiler configured."
fi
#
# Filter '.' and Spack environment directories out of PATH so that
# this script doesn't just call itself
#
IFS=':' read -ra env_path <<< "$PATH"
IFS=':' read -ra spack_env_dirs <<< "$SPACK_ENV_PATH"
spack_env_dirs+=("" ".")
export PATH=""
for dir in "${env_path[@]}"; do
new_dirs=""
IFS=':'
for dir in $PATH; do
addpath=true
for env_dir in "${spack_env_dirs[@]}"; do
if [[ "${dir%%/}" == "$env_dir" ]]; then
addpath=false
break
fi
for spack_env_dir in $SPACK_ENV_PATH; do
case "${dir%%/}" in
"$spack_env_dir"|'.'|'')
addpath=false
break
;;
esac
done
if $addpath; then
export PATH="${PATH:+$PATH:}$dir"
if [ $addpath = true ]; then
append new_dirs "$dir"
fi
done
unset IFS
export PATH="$new_dirs"
if [[ $mode == vcheck ]]; then
if [ "$mode" = vcheck ]; then
exec "${command}" "$@"
fi
@@ -265,16 +375,20 @@ fi
# It doesn't work with -rpath.
# This variable controls whether they are added.
add_rpaths=true
if [[ ($mode == ld || $mode == ccld) && "$SPACK_SHORT_SPEC" =~ "darwin" ]];
then
for arg in "$@"; do
if [[ ($arg == -r && $mode == ld) ||
($arg == -r && $mode == ccld) ||
($arg == -Wl,-r && $mode == ccld) ]]; then
add_rpaths=false
break
fi
done
if [ "$mode" = ld ] || [ "$mode" = ccld ]; then
if [ "${SPACK_SHORT_SPEC#*darwin}" != "${SPACK_SHORT_SPEC}" ]; then
for arg in "$@"; do
if [ "$arg" = "-r" ]; then
if [ "$mode" = ld ] || [ "$mode" = ccld ]; then
add_rpaths=false
break
fi
elif [ "$arg" = "-Wl,-r" ] && [ "$mode" = ccld ]; then
add_rpaths=false
break
fi
done
fi
fi
# Save original command for debug logging
@@ -297,17 +411,22 @@ input_command="$*"
# The libs variable is initialized here for completeness, and it is also
# used later to inject flags supplied via `ldlibs` on the command
# line. These come into the wrappers via SPACK_LDLIBS.
#
includes=()
libdirs=()
rpaths=()
system_includes=()
system_libdirs=()
system_rpaths=()
libs=()
other_args=()
isystem_system_includes=()
isystem_includes=()
# The loop below breaks up the command line into these lists of components.
# The lists are all bell-separated to be as flexible as possible, as their
# contents may come from the command line, from ' '-separated lists,
# ':'-separated lists, etc.
include_dirs_list=""
lib_dirs_list=""
rpath_dirs_list=""
system_include_dirs_list=""
system_lib_dirs_list=""
system_rpath_dirs_list=""
isystem_system_include_dirs_list=""
isystem_include_dirs_list=""
libs_list=""
other_args_list=""
while [ $# -ne 0 ]; do
@@ -327,32 +446,32 @@ while [ $# -ne 0 ]; do
isystem_was_used=true
if [ -z "$arg" ]; then shift; arg="$1"; fi
if system_dir "$arg"; then
isystem_system_includes+=("$arg")
append isystem_system_include_dirs_list "$arg"
else
isystem_includes+=("$arg")
append isystem_include_dirs_list "$arg"
fi
;;
-I*)
arg="${1#-I}"
if [ -z "$arg" ]; then shift; arg="$1"; fi
if system_dir "$arg"; then
system_includes+=("$arg")
append system_include_dirs_list "$arg"
else
includes+=("$arg")
append include_dirs_list "$arg"
fi
;;
-L*)
arg="${1#-L}"
if [ -z "$arg" ]; then shift; arg="$1"; fi
if system_dir "$arg"; then
system_libdirs+=("$arg")
append system_lib_dirs_list "$arg"
else
libdirs+=("$arg")
append lib_dirs_list "$arg"
fi
;;
-l*)
# -loopopt=0 is generated erroneously in autoconf <= 2.69,
# and passed by ifx to the linker, which confuses it with a
# and passed by ifx to the linker, which confuses it with a
# library. Filter it out.
# TODO: generalize filtering of args with an env var, so that
# TODO: we do not have to special case this here.
@@ -363,66 +482,76 @@ while [ $# -ne 0 ]; do
fi
arg="${1#-l}"
if [ -z "$arg" ]; then shift; arg="$1"; fi
other_args+=("-l$arg")
append other_args_list "-l$arg"
;;
-Wl,*)
arg="${1#-Wl,}"
if [ -z "$arg" ]; then shift; arg="$1"; fi
if [[ "$arg" = -rpath=* ]]; then
rp="${arg#-rpath=}"
elif [[ "$arg" = --rpath=* ]]; then
rp="${arg#--rpath=}"
elif [[ "$arg" = -rpath,* ]]; then
rp="${arg#-rpath,}"
elif [[ "$arg" = --rpath,* ]]; then
rp="${arg#--rpath,}"
elif [[ "$arg" =~ ^-?-rpath$ ]]; then
shift; arg="$1"
if [[ "$arg" != -Wl,* ]]; then
die "-Wl,-rpath was not followed by -Wl,*"
fi
rp="${arg#-Wl,}"
elif [[ "$arg" = "$dtags_to_strip" ]] ; then
: # We want to remove explicitly this flag
else
other_args+=("-Wl,$arg")
fi
case "$arg" in
-rpath=*) rp="${arg#-rpath=}" ;;
--rpath=*) rp="${arg#--rpath=}" ;;
-rpath,*) rp="${arg#-rpath,}" ;;
--rpath,*) rp="${arg#--rpath,}" ;;
-rpath|--rpath)
shift; arg="$1"
case "$arg" in
-Wl,*)
rp="${arg#-Wl,}"
;;
*)
die "-Wl,-rpath was not followed by -Wl,*"
;;
esac
;;
"$dtags_to_strip")
: # We want to remove explicitly this flag
;;
*)
append other_args_list "-Wl,$arg"
;;
esac
;;
-Xlinker,*)
arg="${1#-Xlinker,}"
if [ -z "$arg" ]; then shift; arg="$1"; fi
if [[ "$arg" = -rpath=* ]]; then
rp="${arg#-rpath=}"
elif [[ "$arg" = --rpath=* ]]; then
rp="${arg#--rpath=}"
elif [[ "$arg" = -rpath ]] || [[ "$arg" = --rpath ]]; then
shift; arg="$1"
if [[ "$arg" != -Xlinker,* ]]; then
die "-Xlinker,-rpath was not followed by -Xlinker,*"
fi
rp="${arg#-Xlinker,}"
else
other_args+=("-Xlinker,$arg")
fi
case "$arg" in
-rpath=*) rp="${arg#-rpath=}" ;;
--rpath=*) rp="${arg#--rpath=}" ;;
-rpath|--rpath)
shift; arg="$1"
case "$arg" in
-Xlinker,*)
rp="${arg#-Xlinker,}"
;;
*)
die "-Xlinker,-rpath was not followed by -Xlinker,*"
;;
esac
;;
*)
append other_args_list "-Xlinker,$arg"
;;
esac
;;
-Xlinker)
if [[ "$2" == "-rpath" ]]; then
if [[ "$3" != "-Xlinker" ]]; then
if [ "$2" = "-rpath" ]; then
if [ "$3" != "-Xlinker" ]; then
die "-Xlinker,-rpath was not followed by -Xlinker,*"
fi
shift 3;
rp="$1"
elif [[ "$2" = "$dtags_to_strip" ]] ; then
elif [ "$2" = "$dtags_to_strip" ]; then
shift # We want to remove explicitly this flag
else
other_args+=("$1")
append other_args_list "$1"
fi
;;
*)
if [[ "$1" = "$dtags_to_strip" ]] ; then
if [ "$1" = "$dtags_to_strip" ]; then
: # We want to remove explicitly this flag
else
other_args+=("$1")
append other_args_list "$1"
fi
;;
esac
@@ -430,9 +559,9 @@ while [ $# -ne 0 ]; do
# test rpaths against system directories in one place.
if [ -n "$rp" ]; then
if system_dir "$rp"; then
system_rpaths+=("$rp")
append system_rpath_dirs_list "$rp"
else
rpaths+=("$rp")
append rpath_dirs_list "$rp"
fi
fi
shift
@@ -445,16 +574,15 @@ done
# See the gmake manual on implicit rules for details:
# https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html
#
flags=()
flags_list=""
# Add debug flags
if [ "${SPACK_ADD_DEBUG_FLAGS}" == "true" ]; then
flags=("${flags[@]}" "${debug_flags}")
if [ "${SPACK_ADD_DEBUG_FLAGS}" = "true" ]; then
extend flags_list debug_flags
# If a custom flag is requested, derive from environment
elif [ "$SPACK_ADD_DEBUG_FLAGS" == "custom" ]; then
IFS=' ' read -ra SPACK_DEBUG_FLAGS <<< "$SPACK_DEBUG_FLAGS"
flags=("${flags[@]}" "${SPACK_DEBUG_FLAGS[@]}")
elif [ "$SPACK_ADD_DEBUG_FLAGS" = "custom" ]; then
extend flags_list SPACK_DEBUG_FLAGS
fi
# Fortran flags come before CPPFLAGS
@@ -462,7 +590,8 @@ case "$mode" in
cc|ccld)
case $lang_flags in
F)
flags=("${flags[@]}" "${SPACK_FFLAGS[@]}") ;;
extend flags_list SPACK_FFLAGS
;;
esac
;;
esac
@@ -470,7 +599,8 @@ esac
# C preprocessor flags come before any C/CXX flags
case "$mode" in
cpp|as|cc|ccld)
flags=("${flags[@]}" "${SPACK_CPPFLAGS[@]}") ;;
extend flags_list SPACK_CPPFLAGS
;;
esac
@@ -479,67 +609,67 @@ case "$mode" in
cc|ccld)
case $lang_flags in
C)
flags=("${flags[@]}" "${SPACK_CFLAGS[@]}") ;;
extend flags_list SPACK_CFLAGS
;;
CXX)
flags=("${flags[@]}" "${SPACK_CXXFLAGS[@]}") ;;
extend flags_list SPACK_CXXFLAGS
;;
esac
flags=(${SPACK_TARGET_ARGS[@]} "${flags[@]}")
# prepend target args
preextend flags_list SPACK_TARGET_ARGS
;;
esac
# Linker flags
case "$mode" in
ld|ccld)
flags=("${flags[@]}" "${SPACK_LDFLAGS[@]}") ;;
extend flags_list SPACK_LDFLAGS
;;
esac
# On macOS insert headerpad_max_install_names linker flag
if [[ ($mode == ld || $mode == ccld) && "$SPACK_SHORT_SPEC" =~ "darwin" ]];
then
case "$mode" in
ld)
flags=("${flags[@]}" -headerpad_max_install_names) ;;
ccld)
flags=("${flags[@]}" "-Wl,-headerpad_max_install_names") ;;
esac
if [ "$mode" = ld ] || [ "$mode" = ccld ]; then
if [ "${SPACK_SHORT_SPEC#*darwin}" != "${SPACK_SHORT_SPEC}" ]; then
case "$mode" in
ld)
append flags_list "-headerpad_max_install_names" ;;
ccld)
append flags_list "-Wl,-headerpad_max_install_names" ;;
esac
fi
fi
IFS=':' read -ra rpath_dirs <<< "$SPACK_RPATH_DIRS"
if [[ $mode == ccld || $mode == ld ]]; then
if [[ "$add_rpaths" != "false" ]] ; then
if [ "$mode" = ccld ] || [ "$mode" = ld ]; then
if [ "$add_rpaths" != "false" ]; then
# Append RPATH directories. Note that in the case of the
# top-level package these directories may not exist yet. For dependencies
# it is assumed that paths have already been confirmed.
rpaths=("${rpaths[@]}" "${rpath_dirs[@]}")
extend rpath_dirs_list SPACK_RPATH_DIRS
fi
fi
IFS=':' read -ra link_dirs <<< "$SPACK_LINK_DIRS"
if [[ $mode == ccld || $mode == ld ]]; then
libdirs=("${libdirs[@]}" "${link_dirs[@]}")
if [ "$mode" = ccld ] || [ "$mode" = ld ]; then
extend lib_dirs_list SPACK_LINK_DIRS
fi
# add RPATHs if we're in in any linking mode
case "$mode" in
ld|ccld)
# Set extra RPATHs
IFS=':' read -ra extra_rpaths <<< "$SPACK_COMPILER_EXTRA_RPATHS"
libdirs+=("${extra_rpaths[@]}")
if [[ "$add_rpaths" != "false" ]] ; then
rpaths+=("${extra_rpaths[@]}")
extend lib_dirs_list SPACK_COMPILER_EXTRA_RPATHS
if [ "$add_rpaths" != "false" ]; then
extend rpath_dirs_list SPACK_COMPILER_EXTRA_RPATHS
fi
# Set implicit RPATHs
IFS=':' read -ra implicit_rpaths <<< "$SPACK_COMPILER_IMPLICIT_RPATHS"
if [[ "$add_rpaths" != "false" ]] ; then
rpaths+=("${implicit_rpaths[@]}")
if [ "$add_rpaths" != "false" ]; then
extend rpath_dirs_list SPACK_COMPILER_IMPLICIT_RPATHS
fi
# Add SPACK_LDLIBS to args
for lib in "${SPACK_LDLIBS[@]}"; do
libs+=("${lib#-l}")
for lib in $SPACK_LDLIBS; do
append libs_list "${lib#-l}"
done
;;
esac
@@ -547,63 +677,62 @@ esac
#
# Finally, reassemble the command line.
#
# Includes and system includes first
args=()
# flags assembled earlier
args+=("${flags[@]}")
args_list="$flags_list"
# Insert include directories just prior to any system include directories
# NOTE: adding ${lsep} to the prefix here turns every added element into two
extend args_list include_dirs_list "-I"
extend args_list isystem_include_dirs_list "-isystem${lsep}"
for dir in "${includes[@]}"; do args+=("-I$dir"); done
for dir in "${isystem_includes[@]}"; do args+=("-isystem" "$dir"); done
case "$mode" in
cpp|cc|as|ccld)
if [ "$isystem_was_used" = "true" ]; then
extend args_list SPACK_INCLUDE_DIRS "-isystem${lsep}"
else
extend args_list SPACK_INCLUDE_DIRS "-I"
fi
;;
esac
IFS=':' read -ra spack_include_dirs <<< "$SPACK_INCLUDE_DIRS"
if [[ $mode == cpp || $mode == cc || $mode == as || $mode == ccld ]]; then
if [[ "$isystem_was_used" == "true" ]] ; then
for dir in "${spack_include_dirs[@]}"; do args+=("-isystem" "$dir"); done
else
for dir in "${spack_include_dirs[@]}"; do args+=("-I$dir"); done
fi
fi
for dir in "${system_includes[@]}"; do args+=("-I$dir"); done
for dir in "${isystem_system_includes[@]}"; do args+=("-isystem" "$dir"); done
extend args_list system_include_dirs_list -I
extend args_list isystem_system_include_dirs_list "-isystem${lsep}"
# Library search paths
for dir in "${libdirs[@]}"; do args+=("-L$dir"); done
for dir in "${system_libdirs[@]}"; do args+=("-L$dir"); done
extend args_list lib_dirs_list "-L"
extend args_list system_lib_dirs_list "-L"
# RPATHs arguments
case "$mode" in
ccld)
if [ -n "$dtags_to_add" ] ; then args+=("$linker_arg$dtags_to_add") ; fi
for dir in "${rpaths[@]}"; do args+=("$rpath$dir"); done
for dir in "${system_rpaths[@]}"; do args+=("$rpath$dir"); done
if [ -n "$dtags_to_add" ] ; then
append args_list "$linker_arg$dtags_to_add"
fi
extend args_list rpath_dirs_list "$rpath"
extend args_list system_rpath_dirs_list "$rpath"
;;
ld)
if [ -n "$dtags_to_add" ] ; then args+=("$dtags_to_add") ; fi
for dir in "${rpaths[@]}"; do args+=("-rpath" "$dir"); done
for dir in "${system_rpaths[@]}"; do args+=("-rpath" "$dir"); done
if [ -n "$dtags_to_add" ] ; then
append args_list "$dtags_to_add"
fi
extend args_list rpath_dirs_list "-rpath${lsep}"
extend args_list system_rpath_dirs_list "-rpath${lsep}"
;;
esac
# Other arguments from the input command
args+=("${other_args[@]}")
extend args_list other_args_list
# Inject SPACK_LDLIBS, if supplied
for lib in "${libs[@]}"; do
args+=("-l$lib");
done
extend args_list libs_list "-l"
full_command=("$command" "${args[@]}")
full_command_list="$command"
extend full_command_list args_list
# prepend the ccache binary if we're using ccache
if [ -n "$SPACK_CCACHE_BINARY" ]; then
case "$lang_flags" in
C|CXX) # ccache only supports C languages
full_command=("${SPACK_CCACHE_BINARY}" "${full_command[@]}")
prepend full_command_list "${SPACK_CCACHE_BINARY}"
# workaround for stage being a temp folder
# see #3761#issuecomment-294352232
export CCACHE_NOHASHDIR=yes
@@ -612,25 +741,36 @@ if [ -n "$SPACK_CCACHE_BINARY" ]; then
fi
# dump the full command if the caller supplies SPACK_TEST_COMMAND=dump-args
if [[ $SPACK_TEST_COMMAND == dump-args ]]; then
IFS="
" && echo "${full_command[*]}"
exit
elif [[ $SPACK_TEST_COMMAND =~ dump-env-* ]]; then
var=${SPACK_TEST_COMMAND#dump-env-}
echo "$0: $var: ${!var}"
elif [[ -n $SPACK_TEST_COMMAND ]]; then
die "ERROR: Unknown test command"
if [ -n "${SPACK_TEST_COMMAND=}" ]; then
case "$SPACK_TEST_COMMAND" in
dump-args)
IFS="$lsep"
for arg in $full_command_list; do
echo "$arg"
done
unset IFS
exit
;;
dump-env-*)
var=${SPACK_TEST_COMMAND#dump-env-}
eval "printf '%s\n' \"\$0: \$var: \$$var\""
;;
*)
die "Unknown test command: '$SPACK_TEST_COMMAND'"
;;
esac
fi
#
# Write the input and output commands to debug logs if it's asked for.
#
if [[ $SPACK_DEBUG == TRUE ]]; then
if [ "$SPACK_DEBUG" = TRUE ]; then
input_log="$SPACK_DEBUG_LOG_DIR/spack-cc-$SPACK_DEBUG_LOG_ID.in.log"
output_log="$SPACK_DEBUG_LOG_DIR/spack-cc-$SPACK_DEBUG_LOG_ID.out.log"
echo "[$mode] $command $input_command" >> "$input_log"
echo "[$mode] ${full_command[*]}" >> "$output_log"
echo "[$mode] ${full_command_list}" >> "$output_log"
fi
exec "${full_command[@]}"
# Execute the full command, preserving spaces with IFS set
# to the alarm bell separator.
IFS="$lsep"; exec $full_command_list

View File

@@ -11,7 +11,7 @@
* Homepage: https://pypi.python.org/pypi/archspec
* Usage: Labeling, comparison and detection of microarchitectures
* Version: 0.1.2 (commit 4dbf253daf37e4a008e4beb6489f347b4a35aed4)
* Version: 0.1.2 (commit 85757b6666422fca86aa882a769bf78b0f992f54)
argparse
--------
@@ -88,6 +88,8 @@
* Usage: Needed by pytest. Library with cross-python path,
ini-parsing, io, code, and log facilities.
* Version: 1.4.34 (last version supporting Python 2.6)
* Note: This packages has been modified:
* https://github.com/pytest-dev/py/pull/186 was backported
pytest
------

View File

@@ -49,6 +49,19 @@ $ tox
congratulations :)
```
## Citing Archspec
If you are referencing `archspec` in a publication, please cite the following
paper:
* Massimiliano Culpo, Gregory Becker, Carlos Eduardo Arango Gutierrez, Kenneth
Hoste, and Todd Gamblin.
[**`archspec`: A library for detecting, labeling, and reasoning about
microarchitectures**](https://tgamblin.github.io/pubs/archspec-canopie-hpc-2020.pdf).
In *2nd International Workshop on Containers and New Orchestration Paradigms
for Isolated Environments in HPC (CANOPIE-HPC'20)*, Online Event, November
12, 2020.
## License
Archspec is distributed under the terms of both the MIT license and the

View File

@@ -206,11 +206,26 @@ def host():
# Get a list of possible candidates for this micro-architecture
candidates = compatible_microarchitectures(info)
# Sorting criteria for candidates
def sorting_fn(item):
return len(item.ancestors), len(item.features)
# Get the best generic micro-architecture
generic_candidates = [c for c in candidates if c.vendor == "generic"]
best_generic = max(generic_candidates, key=sorting_fn)
# Filter the candidates to be descendant of the best generic candidate.
# This is to avoid that the lack of a niche feature that can be disabled
# from e.g. BIOS prevents detection of a reasonably performant architecture
candidates = [c for c in candidates if c > best_generic]
# If we don't have candidates, return the best generic micro-architecture
if not candidates:
return best_generic
# Reverse sort of the depth for the inheritance tree among only targets we
# can use. This gets the newest target we satisfy.
return sorted(
candidates, key=lambda t: (len(t.ancestors), len(t.features)), reverse=True
)[0]
return max(candidates, key=sorting_fn)
def compatibility_check(architecture_family):
@@ -245,7 +260,13 @@ def compatibility_check_for_power(info, target):
"""Compatibility check for PPC64 and PPC64LE architectures."""
basename = platform.machine()
generation_match = re.search(r"POWER(\d+)", info.get("cpu", ""))
generation = int(generation_match.group(1))
try:
generation = int(generation_match.group(1))
except AttributeError:
# There might be no match under emulated environments. For instance
# emulating a ppc64le with QEMU and Docker still reports the host
# /proc/cpuinfo and not a Power
generation = 0
# We can use a target if it descends from our machine type and our
# generation (9 for POWER9, etc) is at least its generation.
@@ -285,3 +306,22 @@ def compatibility_check_for_aarch64(info, target):
and (target.vendor == vendor or target.vendor == "generic")
and target.features.issubset(features)
)
@compatibility_check(architecture_family="riscv64")
def compatibility_check_for_riscv64(info, target):
"""Compatibility check for riscv64 architectures."""
basename = "riscv64"
uarch = info.get("uarch")
# sifive unmatched board
if uarch == "sifive,u74-mc":
uarch = "u74mc"
# catch-all for unknown uarchs
else:
uarch = "riscv64"
arch_root = TARGETS[basename]
return (target == arch_root or arch_root in target.ancestors) and (
target == uarch or target.vendor == "generic"
)

View File

@@ -173,6 +173,12 @@ def family(self):
return roots.pop()
@property
def generic(self):
"""Returns the best generic architecture that is compatible with self"""
generics = [x for x in [self] + self.ancestors if x.vendor == "generic"]
return max(generics, key=lambda x: len(x.ancestors))
def to_dict(self, return_list_of_items=False):
"""Returns a dictionary representation of this object.

View File

@@ -2017,6 +2017,44 @@
"features": [],
"compilers": {
}
},
"riscv64": {
"from": [],
"vendor": "generic",
"features": [],
"compilers": {
"gcc": [
{
"versions": "7.1:",
"flags" : "-march=rv64gc"
}
],
"clang": [
{
"versions": "9.0:",
"flags" : "-march=rv64gc"
}
]
}
},
"u74mc": {
"from": ["riscv64"],
"vendor": "SiFive",
"features": [],
"compilers": {
"gcc": [
{
"versions": "10.2:",
"flags" : "-march=rv64gc -mtune=sifive-7-series"
}
],
"clang" : [
{
"versions": "12.0:",
"flags" : "-march=rv64gc -mtune=sifive-7-series"
}
]
}
}
},
"feature_aliases": {

View File

@@ -77,52 +77,18 @@
from six import StringIO
from six import string_types
class prefilter(object):
"""Make regular expressions faster with a simple prefiltering predicate.
Some regular expressions seem to be much more costly than others. In
most cases, we can evaluate a simple precondition, e.g.::
lambda x: "error" in x
to avoid evaluating expensive regexes on all lines in a file. This
can reduce parse time for large files by orders of magnitude when
evaluating lots of expressions.
A ``prefilter`` object is designed to act like a regex,, but
``search`` and ``match`` check the precondition before bothering to
evaluate the regular expression.
Note that ``match`` and ``search`` just return ``True`` and ``False``
at the moment. Make them return a ``MatchObject`` or ``None`` if it
becomes necessary.
"""
def __init__(self, precondition, *patterns):
self.patterns = [re.compile(p) for p in patterns]
self.pre = precondition
self.pattern = "\n ".join(
('MERGED:',) + patterns)
def search(self, text):
return self.pre(text) and any(p.search(text) for p in self.patterns)
def match(self, text):
return self.pre(text) and any(p.match(text) for p in self.patterns)
_error_matches = [
prefilter(
lambda x: any(s in x for s in (
'Error:', 'error', 'undefined reference', 'multiply defined')),
"([^:]+): error[ \\t]*[0-9]+[ \\t]*:",
"([^:]+): (Error:|error|undefined reference|multiply defined)",
"([^ :]+) ?: (error|fatal error|catastrophic error)",
"([^:]+)\\(([^\\)]+)\\) ?: (error|fatal error|catastrophic error)"),
"^FAILED",
"^FAIL: ",
"^FATAL: ",
"^failed ",
"FAILED",
"Failed test",
"^[Bb]us [Ee]rror",
"^[Ss]egmentation [Vv]iolation",
"^[Ss]egmentation [Ff]ault",
":.*[Pp]ermission [Dd]enied",
"[^ :]:[0-9]+: [^ \\t]",
"[^:]: error[ \\t]*[0-9]+[ \\t]*:",
"^Error ([0-9]+):",
"^Fatal",
"^[Ee]rror: ",
@@ -132,6 +98,9 @@ def match(self, text):
"^cc[^C]*CC: ERROR File = ([^,]+), Line = ([0-9]+)",
"^ld([^:])*:([ \\t])*ERROR([^:])*:",
"^ild:([ \\t])*\\(undefined symbol\\)",
"[^ :] : (error|fatal error|catastrophic error)",
"[^:]: (Error:|error|undefined reference|multiply defined)",
"[^:]\\([^\\)]+\\) ?: (error|fatal error|catastrophic error)",
"^fatal error C[0-9]+:",
": syntax error ",
"^collect2: ld returned 1 exit status",
@@ -140,7 +109,7 @@ def match(self, text):
"^Unresolved:",
"Undefined symbol",
"^Undefined[ \\t]+first referenced",
"^CMake Error.*:",
"^CMake Error",
":[ \\t]cannot find",
":[ \\t]can't find",
": \\*\\*\\* No rule to make target [`'].*\\'. Stop",
@@ -154,6 +123,7 @@ def match(self, text):
"ld: 0706-006 Cannot find or open library file: -l ",
"ild: \\(argument error\\) can't find library argument ::",
"^could not be found and will not be loaded.",
"^WARNING: '.*' is missing on your system",
"s:616 string too big",
"make: Fatal error: ",
"ld: 0711-993 Error occurred while writing to the output file:",
@@ -175,44 +145,40 @@ def match(self, text):
"instantiated from ",
"candidates are:",
": warning",
": WARNING",
": \\(Warning\\)",
": note",
" ok",
"Note:",
"makefile:",
"Makefile:",
":[ \\t]+Where:",
"([^ :]+):([0-9]+): Warning",
"[^ :]:[0-9]+: Warning",
"------ Build started: .* ------",
]
#: Regexes to match file/line numbers in error/warning messages
_warning_matches = [
prefilter(
lambda x: 'warning' in x,
"([^ :]+):([0-9]+): warning:",
"([^:]+): warning ([0-9]+):",
"([^:]+): warning[ \\t]*[0-9]+[ \\t]*:",
"([^ :]+) : warning",
"([^:]+): warning"),
prefilter(
lambda x: 'note:' in x,
"^([^ :]+):([0-9]+): note:"),
prefilter(
lambda x: any(s in x for s in ('Warning', 'Warnung')),
"^(Warning|Warnung) ([0-9]+):",
"^(Warning|Warnung)[ :]",
"^cxx: Warning:",
"([^ :]+):([0-9]+): (Warning|Warnung)",
"^CMake Warning.*:"),
"file: .* has no symbols",
"[^ :]:[0-9]+: warning:",
"[^ :]:[0-9]+: note:",
"^cc[^C]*CC: WARNING File = ([^,]+), Line = ([0-9]+)",
"^ld([^:])*:([ \\t])*WARNING([^:])*:",
"[^:]: warning [0-9]+:",
"^\"[^\"]+\", line [0-9]+: [Ww](arning|arnung)",
"[^:]: warning[ \\t]*[0-9]+[ \\t]*:",
"^(Warning|Warnung) ([0-9]+):",
"^(Warning|Warnung)[ :]",
"WARNING: ",
"[^ :] : warning",
"[^:]: warning",
"\", line [0-9]+\\.[0-9]+: [0-9]+-[0-9]+ \\([WI]\\)",
"^cxx: Warning:",
"file: .* has no symbols",
"[^ :]:[0-9]+: (Warning|Warnung)",
"\\([0-9]*\\): remark #[0-9]*",
"\".*\", line [0-9]+: remark\\([0-9]*\\):",
"cc-[0-9]* CC: REMARK File = .*, Line = [0-9]*",
"^CMake Warning",
"^\\[WARNING\\]",
]
@@ -343,8 +309,7 @@ def _profile_match(matches, exceptions, line, match_times, exc_times):
def _parse(lines, offset, profile):
def compile(regex_array):
return [regex if isinstance(regex, prefilter) else re.compile(regex)
for regex in regex_array]
return [re.compile(regex) for regex in regex_array]
error_matches = compile(_error_matches)
error_exceptions = compile(_error_exceptions)

View File

@@ -10,7 +10,7 @@
from py._path.common import iswin32, fspath
from stat import S_ISLNK, S_ISDIR, S_ISREG
from os.path import abspath, normcase, normpath, isabs, exists, isdir, isfile, islink, dirname
from os.path import abspath, normpath, isabs, exists, isdir, isfile, islink, dirname
if sys.version_info > (3,0):
def map_as_list(func, iter):
@@ -801,10 +801,10 @@ def make_numbered_dir(cls, prefix='session-', rootdir=None, keep=3,
if rootdir is None:
rootdir = cls.get_temproot()
nprefix = normcase(prefix)
nprefix = prefix.lower()
def parse_num(path):
""" parse the number out of a path (if it matches the prefix) """
nbasename = normcase(path.basename)
nbasename = path.basename.lower()
if nbasename.startswith(nprefix):
try:
return int(nbasename[len(nprefix):])

View File

@@ -656,6 +656,12 @@ def working_dir(dirname, **kwargs):
os.chdir(orig_dir)
class CouldNotRestoreDirectoryBackup(RuntimeError):
def __init__(self, inner_exception, outer_exception):
self.inner_exception = inner_exception
self.outer_exception = outer_exception
@contextmanager
def replace_directory_transaction(directory_name, tmp_root=None):
"""Moves a directory to a temporary space. If the operations executed
@@ -683,29 +689,33 @@ def replace_directory_transaction(directory_name, tmp_root=None):
assert os.path.isabs(tmp_root)
tmp_dir = tempfile.mkdtemp(dir=tmp_root)
tty.debug('TEMPORARY DIRECTORY CREATED [{0}]'.format(tmp_dir))
tty.debug('Temporary directory created [{0}]'.format(tmp_dir))
shutil.move(src=directory_name, dst=tmp_dir)
tty.debug('DIRECTORY MOVED [src={0}, dest={1}]'.format(
directory_name, tmp_dir
))
tty.debug('Directory moved [src={0}, dest={1}]'.format(directory_name, tmp_dir))
try:
yield tmp_dir
except (Exception, KeyboardInterrupt, SystemExit):
# Delete what was there, before copying back the original content
if os.path.exists(directory_name):
shutil.rmtree(directory_name)
shutil.move(
src=os.path.join(tmp_dir, directory_basename),
dst=os.path.dirname(directory_name)
)
tty.debug('DIRECTORY RECOVERED [{0}]'.format(directory_name))
except (Exception, KeyboardInterrupt, SystemExit) as inner_exception:
# Try to recover the original directory, if this fails, raise a
# composite exception.
try:
# Delete what was there, before copying back the original content
if os.path.exists(directory_name):
shutil.rmtree(directory_name)
shutil.move(
src=os.path.join(tmp_dir, directory_basename),
dst=os.path.dirname(directory_name)
)
except Exception as outer_exception:
raise CouldNotRestoreDirectoryBackup(inner_exception, outer_exception)
tty.debug('Directory recovered [{0}]'.format(directory_name))
raise
else:
# Otherwise delete the temporary directory
shutil.rmtree(tmp_dir)
tty.debug('TEMPORARY DIRECTORY DELETED [{0}]'.format(tmp_dir))
shutil.rmtree(tmp_dir, ignore_errors=True)
tty.debug('Temporary directory deleted [{0}]'.format(tmp_dir))
def hash_directory(directory, ignore=[]):
@@ -1845,3 +1855,18 @@ def keep_modification_time(*filenames):
for f, mtime in mtimes.items():
if os.path.exists(f):
os.utime(f, (os.path.getatime(f), mtime))
@contextmanager
def temporary_dir(*args, **kwargs):
"""Create a temporary directory and cd's into it. Delete the directory
on exit.
Takes the same arguments as tempfile.mkdtemp()
"""
tmp_dir = tempfile.mkdtemp(*args, **kwargs)
try:
with working_dir(tmp_dir):
yield tmp_dir
finally:
remove_directory_contents(tmp_dir)

View File

@@ -33,7 +33,7 @@
# Use this to strip escape sequences
_escape = re.compile(r'\x1b[^m]*m|\x1b\[?1034h')
_escape = re.compile(r'\x1b[^m]*m|\x1b\[?1034h|\x1b\][0-9]+;[^\x07]*\x07')
# control characters for enabling/disabling echo
#
@@ -323,7 +323,7 @@ def unwrap(self):
if sys.version_info < (3,):
self.file = open(self.file_like, 'w')
else:
self.file = open(self.file_like, 'w', encoding='utf-8')
self.file = open(self.file_like, 'w', encoding='utf-8') # novm
else:
self.file = StringIO()
return self.file

View File

@@ -4,7 +4,7 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
#: major, minor, patch version for Spack, in a tuple
spack_version_info = (0, 16, 2)
spack_version_info = (0, 17, 0)
#: String containing Spack version joined with .'s
spack_version = '.'.join(str(v) for v in spack_version_info)

View File

@@ -10,6 +10,8 @@
import os
import llnl.util.tty as tty
from spack.util.environment import EnvironmentModifications
from .analyzer_base import AnalyzerBase
@@ -43,6 +45,7 @@ def _read_environment_file(self, filename):
to remove path prefixes specific to user systems.
"""
if not os.path.exists(filename):
tty.warn("No environment file available")
return
mods = EnvironmentModifications.from_sourcing_file(filename)

View File

@@ -1,242 +0,0 @@
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""Aggregate the target processor, the operating system and the target
platform into an architecture object.
On a multiple architecture machine, the architecture spec field can be set to
build a package against any target and operating system that is present on the
platform. On Cray platforms or any other architecture that has different front
and back end environments, the operating system will determine the method of
compiler detection.
There are two different types of compiler detection:
1. Through the $PATH env variable (front-end detection)
2. Through the module system. (back-end detection)
Depending on which operating system is specified, the compiler will be detected
using one of those methods.
For platforms such as linux and darwin, the operating system is autodetected.
The command line syntax for specifying an architecture is as follows:
target=<Target name> os=<OperatingSystem name>
If the user wishes to use the defaults, either target or os can be left out of
the command line and Spack will concretize using the default. These defaults
are set in the 'platforms/' directory which contains the different subclasses
for platforms. If the machine has multiple architectures, the user can
also enter frontend, or fe or backend or be. These settings will concretize
to their respective frontend and backend targets and operating systems.
Platforms are an abstract class that are extended by subclasses. If the user
wants to add a new type of platform (such as cray_xe), they can create a
subclass and set all the class attributes such as priority, front_target,
back_target, front_os, back_os. Platforms also contain a priority class
attribute. A lower number signifies higher priority. These numbers are
arbitrarily set and can be changed though often there isn't much need unless a
new platform is added and the user wants that to be detected first.
Targets are created inside the platform subclasses. Most architecture
(like linux, and darwin) will have only one target family (x86_64) but in the case of
Cray machines, there is both a frontend and backend processor. The user can
specify which targets are present on front-end and back-end architecture
Depending on the platform, operating systems are either autodetected or are
set. The user can set the frontend and backend operating setting by the class
attributes front_os and back_os. The operating system as described earlier,
will be responsible for compiler detection.
"""
import contextlib
import archspec.cpu
import llnl.util.lang as lang
import spack.compiler
import spack.compilers
import spack.config
import spack.operating_systems
import spack.platforms
import spack.spec
import spack.target
import spack.util.spack_yaml as syaml
import spack.version
@lang.lazy_lexicographic_ordering
class Arch(object):
"""Architecture is now a class to help with setting attributes.
TODO: refactor so that we don't need this class.
"""
def __init__(self, plat=None, os=None, target=None):
self.platform = plat
if plat and os:
os = self.platform.operating_system(os)
self.os = os
if plat and target:
target = self.platform.target(target)
self.target = target
# Hooks for parser to use when platform is set after target or os
self.target_string = None
self.os_string = None
@property
def concrete(self):
return all(
(self.platform is not None,
isinstance(self.platform, spack.platforms.Platform),
self.os is not None,
isinstance(self.os, spack.operating_systems.OperatingSystem),
self.target is not None, isinstance(self.target, spack.target.Target))
)
def __str__(self):
if self.platform or self.os or self.target:
if self.platform.name == 'darwin':
os_name = self.os.name if self.os else "None"
else:
os_name = str(self.os)
return (str(self.platform) + "-" +
os_name + "-" + str(self.target))
else:
return ''
def __contains__(self, string):
return string in str(self)
# TODO: make this unnecessary: don't include an empty arch on *every* spec.
def __nonzero__(self):
return (self.platform is not None or
self.os is not None or
self.target is not None)
__bool__ = __nonzero__
def _cmp_iter(self):
if isinstance(self.platform, spack.platforms.Platform):
yield self.platform.name
else:
yield self.platform
if isinstance(self.os, spack.operating_systems.OperatingSystem):
yield self.os.name
else:
yield self.os
if isinstance(self.target, spack.target.Target):
yield self.target.microarchitecture
else:
yield self.target
def to_dict(self):
str_or_none = lambda v: str(v) if v else None
d = syaml.syaml_dict([
('platform', str_or_none(self.platform)),
('platform_os', str_or_none(self.os)),
('target', self.target.to_dict_or_value())])
return syaml.syaml_dict([('arch', d)])
def to_spec(self):
"""Convert this Arch to an anonymous Spec with architecture defined."""
spec = spack.spec.Spec()
spec.architecture = spack.spec.ArchSpec(str(self))
return spec
@staticmethod
def from_dict(d):
spec = spack.spec.ArchSpec.from_dict(d)
return arch_for_spec(spec)
def arch_for_spec(arch_spec):
"""Transforms the given architecture spec into an architecture object."""
arch_spec = spack.spec.ArchSpec(arch_spec)
assert arch_spec.concrete
arch_plat = spack.platforms.by_name(arch_spec.platform)
if not (arch_plat.operating_system(arch_spec.os) and
arch_plat.target(arch_spec.target)):
sys_type = str(default_arch())
msg = ("Can't recreate arch for spec {0} on current arch {1}; "
"spec architecture is too different")
raise ValueError(msg.format(arch_spec, sys_type))
return Arch(arch_plat, arch_spec.os, arch_spec.target)
@lang.memoized
def _platform():
return spack.platforms.host()
#: The "real" platform of the host running Spack. This should not be changed
#: by any method and is here as a convenient way to refer to the host platform.
real_platform = _platform
#: The current platform used by Spack. May be swapped by the use_platform
#: context manager.
platform = _platform
@lang.memoized
def default_arch():
"""Default ``Arch`` object for this machine"""
return Arch(platform(), 'default_os', 'default_target')
@lang.memoized
def compatible_sys_types():
"""Return a list of all the platform-os-target tuples compatible
with the current host.
"""
current_host = archspec.cpu.host()
compatible_targets = [current_host] + current_host.ancestors
compatible_archs = [
str(Arch(platform(), 'default_os', target)) for target in compatible_targets
]
return compatible_archs
class _PickleableCallable(object):
"""Class used to pickle a callable that may substitute either
_platform or _all_platforms. Lambda or nested functions are
not pickleable.
"""
def __init__(self, return_value):
self.return_value = return_value
def __call__(self):
return self.return_value
@contextlib.contextmanager
def use_platform(new_platform):
global platform
msg = '"{0}" must be an instance of Platform'
assert isinstance(new_platform, spack.platforms.Platform), msg.format(new_platform)
original_platform_fn = platform
try:
platform = _PickleableCallable(new_platform)
# Clear configuration and compiler caches
spack.config.config.clear_caches()
spack.compilers._cache_config_files = []
yield new_platform
finally:
platform = original_platform_fn
# Clear configuration and compiler caches
spack.config.config.clear_caches()
spack.compilers._cache_config_files = []

View File

@@ -4,11 +4,9 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import codecs
import glob
import hashlib
import json
import os
import re
import shutil
import sys
import tarfile
@@ -47,6 +45,25 @@
_build_cache_keys_relative_path = '_pgp'
class FetchCacheError(Exception):
"""Error thrown when fetching the cache failed, usually a composite error list."""
def __init__(self, errors):
if not isinstance(errors, list):
raise TypeError("Expected a list of errors")
self.errors = errors
if len(errors) > 1:
msg = " Error {0}: {1}: {2}"
self.message = "Multiple errors during fetching:\n"
self.message += "\n".join((
msg.format(i + 1, err.__class__.__name__, str(err))
for (i, err) in enumerate(errors)
))
else:
err = errors[0]
self.message = "{0}: {1}".format(err.__class__.__name__, str(err))
super(FetchCacheError, self).__init__(self.message)
class BinaryCacheIndex(object):
"""
The BinaryCacheIndex tracks what specs are available on (usually remote)
@@ -224,11 +241,16 @@ def find_built_spec(self, spec):
]
"""
self.regenerate_spec_cache()
return self.find_by_hash(spec.dag_hash())
find_hash = spec.dag_hash()
def find_by_hash(self, find_hash):
"""Same as find_built_spec but uses the hash of a spec.
Args:
find_hash (str): hash of the spec to search
"""
if find_hash not in self._mirrors_for_spec:
return None
return self._mirrors_for_spec[find_hash]
def update_spec(self, spec, found_list):
@@ -293,14 +315,22 @@ def update(self):
# Otherwise the concrete spec cache should not need to be updated at
# all.
fetch_errors = []
all_methods_failed = True
for cached_mirror_url in self._local_index_cache:
cache_entry = self._local_index_cache[cached_mirror_url]
cached_index_hash = cache_entry['index_hash']
cached_index_path = cache_entry['index_path']
if cached_mirror_url in configured_mirror_urls:
# May need to fetch the index and update the local caches
needs_regen = self._fetch_and_cache_index(
cached_mirror_url, expect_hash=cached_index_hash)
try:
needs_regen = self._fetch_and_cache_index(
cached_mirror_url, expect_hash=cached_index_hash)
all_methods_failed = False
except FetchCacheError as fetch_error:
needs_regen = False
fetch_errors.extend(fetch_error.errors)
# The need to regenerate implies a need to clear as well.
spec_cache_clear_needed |= needs_regen
spec_cache_regenerate_needed |= needs_regen
@@ -327,7 +357,12 @@ def update(self):
for mirror_url in configured_mirror_urls:
if mirror_url not in self._local_index_cache:
# Need to fetch the index and update the local caches
needs_regen = self._fetch_and_cache_index(mirror_url)
try:
needs_regen = self._fetch_and_cache_index(mirror_url)
all_methods_failed = False
except FetchCacheError as fetch_error:
fetch_errors.extend(fetch_error.errors)
needs_regen = False
# Generally speaking, a new mirror wouldn't imply the need to
# clear the spec cache, so leave it as is.
if needs_regen:
@@ -335,7 +370,9 @@ def update(self):
self._write_local_index_cache()
if spec_cache_regenerate_needed:
if all_methods_failed:
raise FetchCacheError(fetch_errors)
elif spec_cache_regenerate_needed:
self.regenerate_spec_cache(clear_existing=spec_cache_clear_needed)
def _fetch_and_cache_index(self, mirror_url, expect_hash=None):
@@ -354,6 +391,8 @@ def _fetch_and_cache_index(self, mirror_url, expect_hash=None):
True if this function thinks the concrete spec cache,
``_mirrors_for_spec``, should be regenerated. Returns False
otherwise.
Throws:
FetchCacheError: a composite exception.
"""
index_fetch_url = url_util.join(
mirror_url, _build_cache_relative_path, 'index.json')
@@ -363,14 +402,19 @@ def _fetch_and_cache_index(self, mirror_url, expect_hash=None):
old_cache_key = None
fetched_hash = None
errors = []
# Fetch the hash first so we can check if we actually need to fetch
# the index itself.
try:
_, _, fs = web_util.read_from_url(hash_fetch_url)
fetched_hash = codecs.getreader('utf-8')(fs).read()
except (URLError, web_util.SpackWebError) as url_err:
tty.debug('Unable to read index hash {0}'.format(
hash_fetch_url), url_err, 1)
errors.append(
RuntimeError("Unable to read index hash {0} due to {1}: {2}".format(
hash_fetch_url, url_err.__class__.__name__, str(url_err)
))
)
# The only case where we'll skip attempting to fetch the buildcache
# index from the mirror is when we already have a hash for this
@@ -397,24 +441,23 @@ def _fetch_and_cache_index(self, mirror_url, expect_hash=None):
_, _, fs = web_util.read_from_url(index_fetch_url)
index_object_str = codecs.getreader('utf-8')(fs).read()
except (URLError, web_util.SpackWebError) as url_err:
tty.debug('Unable to read index {0}'.format(index_fetch_url),
url_err, 1)
# We failed to fetch the index, even though we decided it was
# necessary. However, regenerating the spec cache won't produce
# anything different than what it has already, so return False.
return False
errors.append(
RuntimeError("Unable to read index {0} due to {1}: {2}".format(
index_fetch_url, url_err.__class__.__name__, str(url_err)
))
)
raise FetchCacheError(errors)
locally_computed_hash = compute_hash(index_object_str)
if fetched_hash is not None and locally_computed_hash != fetched_hash:
msg_tmpl = ('Computed hash ({0}) did not match remote ({1}), '
'indicating error in index transmission')
tty.error(msg_tmpl.format(locally_computed_hash, expect_hash))
msg = ('Computed hash ({0}) did not match remote ({1}), '
'indicating error in index transmission').format(
locally_computed_hash, expect_hash)
errors.append(RuntimeError(msg))
# We somehow got an index that doesn't match the remote one, maybe
# the next time we try we'll be successful. Regardless, we're not
# updating our index cache with this, so don't regenerate the spec
# cache either.
return False
# the next time we try we'll be successful.
raise FetchCacheError(errors)
url_hash = compute_hash(mirror_url)
@@ -570,6 +613,16 @@ def get_buildfile_manifest(spec):
# Used by make_package_relative to determine binaries to change.
for root, dirs, files in os.walk(spec.prefix, topdown=True):
dirs[:] = [d for d in dirs if d not in blacklist]
# Directories may need to be relocated too.
for directory in dirs:
dir_path_name = os.path.join(root, directory)
rel_path_name = os.path.relpath(dir_path_name, spec.prefix)
if os.path.islink(dir_path_name):
link = os.readlink(dir_path_name)
if os.path.isabs(link) and link.startswith(spack.store.layout.root):
data['link_to_relocate'].append(rel_path_name)
for filename in files:
path_name = os.path.join(root, filename)
m_type, m_subtype = relocate.mime_type(path_name)
@@ -1388,42 +1441,30 @@ def extract_tarball(spec, filename, allow_root=False, unsigned=False,
buildinfo = spec_dict.get('buildinfo', {})
old_relative_prefix = buildinfo.get('relative_prefix', new_relative_prefix)
rel = buildinfo.get('relative_rpaths')
# if the original relative prefix and new relative prefix differ the
# directory layout has changed and the buildcache cannot be installed
# if it was created with relative rpaths
info = 'old relative prefix %s\nnew relative prefix %s\nrelative rpaths %s'
tty.debug(info %
(old_relative_prefix, new_relative_prefix, rel))
# if (old_relative_prefix != new_relative_prefix and (rel)):
# shutil.rmtree(tmpdir)
# msg = "Package tarball was created from an install "
# msg += "prefix with a different directory layout. "
# msg += "It cannot be relocated because it "
# msg += "uses relative rpaths."
# raise NewLayoutException(msg)
# extract the tarball in a temp directory
# Extract the tarball into the store root, presumably on the same filesystem.
# The directory created is the base directory name of the old prefix.
# Moving the old prefix name to the new prefix location should preserve
# hard links and symbolic links.
extract_tmp = os.path.join(spack.store.layout.root, '.tmp')
mkdirp(extract_tmp)
extracted_dir = os.path.join(extract_tmp,
old_relative_prefix.split(os.path.sep)[-1])
with closing(tarfile.open(tarfile_path, 'r')) as tar:
tar.extractall(path=tmpdir)
# get the parent directory of the file .spack/binary_distribution
# this should the directory unpacked from the tarball whose
# name is unknown because the prefix naming is unknown
bindist_file = glob.glob('%s/*/.spack/binary_distribution' % tmpdir)[0]
workdir = re.sub('/.spack/binary_distribution$', '', bindist_file)
tty.debug('workdir %s' % workdir)
# install_tree copies hardlinks
# create a temporary tarfile from prefix and exract it to workdir
# tarfile preserves hardlinks
temp_tarfile_name = tarball_name(spec, '.tar')
temp_tarfile_path = os.path.join(tmpdir, temp_tarfile_name)
with closing(tarfile.open(temp_tarfile_path, 'w')) as tar:
tar.add(name='%s' % workdir,
arcname='.')
with closing(tarfile.open(temp_tarfile_path, 'r')) as tar:
tar.extractall(spec.prefix)
os.remove(temp_tarfile_path)
# cleanup
try:
tar.extractall(path=extract_tmp)
except Exception as e:
shutil.rmtree(extracted_dir)
raise e
try:
shutil.move(extracted_dir, spec.prefix)
except Exception as e:
shutil.rmtree(extracted_dir)
raise e
os.remove(tarfile_path)
os.remove(specfile_path)
@@ -1559,6 +1600,9 @@ def update_cache_and_get_specs():
possible, so this method will also attempt to initialize and update the
local index cache (essentially a no-op if it has been done already and
nothing has changed on the configured mirrors.)
Throws:
FetchCacheError
"""
binary_index.update()
return binary_index.get_all_built_specs()

View File

@@ -6,6 +6,7 @@
import contextlib
import fnmatch
import functools
import json
import os
import os.path
@@ -23,9 +24,9 @@
import llnl.util.filesystem as fs
import llnl.util.tty as tty
import spack.architecture
import spack.binary_distribution
import spack.config
import spack.detection
import spack.environment
import spack.main
import spack.modules
@@ -34,11 +35,14 @@
import spack.repo
import spack.spec
import spack.store
import spack.user_environment as uenv
import spack.user_environment
import spack.util.executable
import spack.util.path
from spack.util.environment import EnvironmentModifications
#: "spack buildcache" command, initialized lazily
_buildcache_cmd = None
#: Map a bootstrapper type to the corresponding class
_bootstrap_methods = {}
@@ -64,10 +68,10 @@ def _try_import_from_store(module, abstract_spec_str):
module: Python module to be imported
abstract_spec_str: abstract spec that may provide the module
"""
bincache_platform = spack.architecture.real_platform()
bincache_platform = spack.platforms.real_host()
if str(bincache_platform) == 'cray':
bincache_platform = spack.platforms.linux.Linux()
with spack.architecture.use_platform(bincache_platform):
with spack.platforms.use_platform(bincache_platform):
abstract_spec_str = str(spack.spec.Spec(abstract_spec_str))
# We have to run as part of this python interpreter
@@ -171,6 +175,34 @@ def _fix_ext_suffix(candidate_spec):
os.symlink(abs_path, link_name)
def _executables_in_store(executables, abstract_spec_str):
"""Return True if at least one of the executables can be retrieved from
a spec in store, False otherwise.
The different executables must provide the same functionality and are
"alternate" to each other, i.e. the function will exit True on the first
executable found.
Args:
executables: list of executables to be searched
abstract_spec_str: abstract spec that may provide the executable
"""
executables_str = ', '.join(executables)
msg = "[BOOTSTRAP EXECUTABLES {0}] Try installed specs with query '{1}'"
tty.debug(msg.format(executables_str, abstract_spec_str))
installed_specs = spack.store.db.query(abstract_spec_str, installed=True)
if installed_specs:
for concrete_spec in installed_specs:
bin_dir = concrete_spec.prefix.bin
# IF we have a "bin" directory and it contains
# the executables we are looking for
if (os.path.exists(bin_dir) and os.path.isdir(bin_dir) and
spack.util.executable.which_string(*executables, path=bin_dir)):
spack.util.environment.path_put_first('PATH', [bin_dir])
return True
return False
@_bootstrapper(type='buildcache')
class _BuildcacheBootstrapper(object):
"""Install the software needed during bootstrapping from a buildcache."""
@@ -178,87 +210,140 @@ def __init__(self, conf):
self.name = conf['name']
self.url = conf['info']['url']
def try_import(self, module, abstract_spec_str):
if _try_import_from_store(module, abstract_spec_str):
return True
@staticmethod
def _spec_and_platform(abstract_spec_str):
"""Return the spec object and platform we need to use when
querying the buildcache.
Args:
abstract_spec_str: abstract spec string we are looking for
"""
# This import is local since it is needed only on Cray
import spack.platforms.linux
# Try to install from an unsigned binary cache
abstract_spec = spack.spec.Spec(
abstract_spec_str + ' ^' + spec_for_current_python()
)
abstract_spec = spack.spec.Spec(abstract_spec_str)
# On Cray we want to use Linux binaries if available from mirrors
bincache_platform = spack.architecture.real_platform()
bincache_platform = spack.platforms.real_host()
if str(bincache_platform) == 'cray':
bincache_platform = spack.platforms.Linux()
with spack.architecture.use_platform(bincache_platform):
abstract_spec = spack.spec.Spec(
abstract_spec_str + ' ^' + spec_for_current_python()
)
with spack.platforms.use_platform(bincache_platform):
abstract_spec = spack.spec.Spec(abstract_spec_str)
return abstract_spec, bincache_platform
# Read information on verified clingo binaries
json_filename = '{0}.json'.format(module)
def _read_metadata(self, package_name):
"""Return metadata about the given package."""
json_filename = '{0}.json'.format(package_name)
json_path = os.path.join(
spack.paths.share_path, 'bootstrap', self.name, json_filename
)
with open(json_path) as f:
data = json.load(f)
return data
buildcache = spack.main.SpackCommand('buildcache')
def _install_by_hash(self, pkg_hash, pkg_sha256, index, bincache_platform):
global _buildcache_cmd
if _buildcache_cmd is None:
_buildcache_cmd = spack.main.SpackCommand('buildcache')
index_spec = next(x for x in index if x.dag_hash() == pkg_hash)
# Reconstruct the compiler that we need to use for bootstrapping
compiler_entry = {
"modules": [],
"operating_system": str(index_spec.os),
"paths": {
"cc": "/dev/null",
"cxx": "/dev/null",
"f77": "/dev/null",
"fc": "/dev/null"
},
"spec": str(index_spec.compiler),
"target": str(index_spec.target.family)
}
with spack.platforms.use_platform(bincache_platform):
with spack.config.override(
'compilers', [{'compiler': compiler_entry}]
):
spec_str = '/' + pkg_hash
install_args = [
'install',
'--sha256', pkg_sha256,
'--only-root',
'-a', '-u', '-o', '-f', spec_str
]
_buildcache_cmd(*install_args, fail_on_error=False)
def _install_and_test(
self, abstract_spec, bincache_platform, bincache_data, test_fn
):
# Ensure we see only the buildcache being used to bootstrap
mirror_scope = spack.config.InternalConfigScope(
'bootstrap', {'mirrors:': {self.name: self.url}}
)
with spack.config.override(mirror_scope):
with spack.config.override(self.mirror_scope):
# This index is currently needed to get the compiler used to build some
# specs that wwe know by dag hash.
# specs that we know by dag hash.
spack.binary_distribution.binary_index.regenerate_spec_cache()
index = spack.binary_distribution.update_cache_and_get_specs()
for item in data['verified']:
if not index:
raise RuntimeError("The binary index is empty")
for item in bincache_data['verified']:
candidate_spec = item['spec']
python_spec = item['python']
# This will be None for things that don't depend on python
python_spec = item.get('python', None)
# Skip specs which are not compatible
if not abstract_spec.satisfies(candidate_spec):
continue
if python_spec not in abstract_spec:
if python_spec is not None and python_spec not in abstract_spec:
continue
for pkg_name, pkg_hash, pkg_sha256 in item['binaries']:
msg = ('[BOOTSTRAP MODULE {0}] Try installing "{1}" from binary '
'cache at "{2}"')
tty.debug(msg.format(module, pkg_name, self.url))
index_spec = next(x for x in index if x.dag_hash() == pkg_hash)
# Reconstruct the compiler that we need to use for bootstrapping
compiler_entry = {
"modules": [],
"operating_system": str(index_spec.os),
"paths": {
"cc": "/dev/null",
"cxx": "/dev/null",
"f77": "/dev/null",
"fc": "/dev/null"
},
"spec": str(index_spec.compiler),
"target": str(index_spec.target.family)
}
with spack.architecture.use_platform(bincache_platform):
with spack.config.override(
'compilers', [{'compiler': compiler_entry}]
):
spec_str = '/' + pkg_hash
install_args = [
'install',
'--sha256', pkg_sha256,
'-a', '-u', '-o', '-f', spec_str
]
buildcache(*install_args, fail_on_error=False)
# TODO: undo installations that didn't complete?
# TODO: undo installations that didn't complete?
self._install_by_hash(
pkg_hash, pkg_sha256, index, bincache_platform
)
if _try_import_from_store(module, abstract_spec_str):
if test_fn():
return True
return False
@property
def mirror_scope(self):
return spack.config.InternalConfigScope(
'bootstrap_buildcache', {'mirrors:': {self.name: self.url}}
)
def try_import(self, module, abstract_spec_str):
test_fn = functools.partial(_try_import_from_store, module, abstract_spec_str)
if test_fn():
return True
tty.info("Bootstrapping {0} from pre-built binaries".format(module))
abstract_spec, bincache_platform = self._spec_and_platform(
abstract_spec_str + ' ^' + spec_for_current_python()
)
data = self._read_metadata(module)
return self._install_and_test(
abstract_spec, bincache_platform, data, test_fn
)
def try_search_path(self, executables, abstract_spec_str):
test_fn = functools.partial(
_executables_in_store, executables, abstract_spec_str
)
if test_fn():
return True
abstract_spec, bincache_platform = self._spec_and_platform(
abstract_spec_str
)
tty.info("Bootstrapping {0} from pre-built binaries".format(abstract_spec.name))
data = self._read_metadata(abstract_spec.name)
return self._install_and_test(
abstract_spec, bincache_platform, data, test_fn
)
@_bootstrapper(type='install')
class _SourceBootstrapper(object):
@@ -271,10 +356,16 @@ def try_import(module, abstract_spec_str):
if _try_import_from_store(module, abstract_spec_str):
return True
tty.info("Bootstrapping {0} from sources".format(module))
# If we compile code from sources detecting a few build tools
# might reduce compilation time by a fair amount
_add_externals_if_missing()
# Try to build and install from sources
with spack_python_interpreter():
# Add hint to use frontend operating system on Cray
if str(spack.architecture.platform()) == 'cray':
if str(spack.platforms.host()) == 'cray':
abstract_spec_str += ' os=fe'
concrete_spec = spack.spec.Spec(
@@ -283,7 +374,7 @@ def try_import(module, abstract_spec_str):
if module == 'clingo':
# TODO: remove when the old concretizer is deprecated
concrete_spec._old_concretize()
concrete_spec._old_concretize(deprecation_warning=False)
else:
concrete_spec.concretize()
@@ -291,10 +382,30 @@ def try_import(module, abstract_spec_str):
tty.debug(msg.format(module, abstract_spec_str))
# Install the spec that should make the module importable
concrete_spec.package.do_install()
concrete_spec.package.do_install(fail_fast=True)
return _try_import_from_store(module, abstract_spec_str=abstract_spec_str)
def try_search_path(self, executables, abstract_spec_str):
if _executables_in_store(executables, abstract_spec_str):
return True
# If we compile code from sources detecting a few build tools
# might reduce compilation time by a fair amount
_add_externals_if_missing()
# Add hint to use frontend operating system on Cray
if str(spack.platforms.host()) == 'cray':
abstract_spec_str += ' os=fe'
concrete_spec = spack.spec.Spec(abstract_spec_str)
concrete_spec.concretize()
msg = "[BOOTSTRAP GnuPG] Try installing '{0}' from sources"
tty.debug(msg.format(abstract_spec_str))
concrete_spec.package.do_install()
return _executables_in_store(executables, abstract_spec_str)
def _make_bootstrapper(conf):
"""Return a bootstrap object built according to the
@@ -374,6 +485,9 @@ def ensure_module_importable_or_raise(module, abstract_spec=None):
abstract_spec = abstract_spec or module
source_configs = spack.config.get('bootstrap:sources', [])
errors = {}
for current_config in source_configs:
if not _source_is_trusted(current_config):
msg = ('[BOOTSTRAP MODULE {0}] Skipping source "{1}" since it is '
@@ -388,14 +502,59 @@ def ensure_module_importable_or_raise(module, abstract_spec=None):
except Exception as e:
msg = '[BOOTSTRAP MODULE {0}] Unexpected error "{1}"'
tty.debug(msg.format(module, str(e)))
errors[current_config['name']] = e
# We couldn't import in any way, so raise an import error
msg = 'cannot bootstrap the "{0}" Python module'.format(module)
if abstract_spec:
msg += ' from spec "{0}"'.format(abstract_spec)
msg += ' due to the following failures:\n'
for method in errors:
err = errors[method]
msg += " '{0}' raised {1}: {2}\n".format(
method, err.__class__.__name__, str(err))
msg += ' Please run `spack -d spec zlib` for more verbose error messages'
raise ImportError(msg)
def ensure_executables_in_path_or_raise(executables, abstract_spec):
"""Ensure that some executables are in path or raise.
Args:
executables (list): list of executables to be searched in the PATH,
in order. The function exits on the first one found.
abstract_spec (str): abstract spec that provides the executables
Raises:
RuntimeError: if the executables cannot be ensured to be in PATH
"""
if spack.util.executable.which_string(*executables):
return
executables_str = ', '.join(executables)
source_configs = spack.config.get('bootstrap:sources', [])
for current_config in source_configs:
if not _source_is_trusted(current_config):
msg = ('[BOOTSTRAP EXECUTABLES {0}] Skipping source "{1}" since it is '
'not trusted').format(executables_str, current_config['name'])
tty.debug(msg)
continue
b = _make_bootstrapper(current_config)
try:
if b.try_search_path(executables, abstract_spec):
return
except Exception as e:
msg = '[BOOTSTRAP EXECUTABLES {0}] Unexpected error "{1}"'
tty.debug(msg.format(executables_str, str(e)))
# We couldn't import in any way, so raise an import error
msg = 'cannot bootstrap any of the {0} executables'.format(executables_str)
if abstract_spec:
msg += ' from spec "{0}"'.format(abstract_spec)
raise RuntimeError(msg)
def _python_import(module):
try:
__import__(module)
@@ -433,7 +592,9 @@ def get_executable(exe, spec=None, install=False):
ret = spack.util.executable.Executable(exe_path[0])
envmod = EnvironmentModifications()
for dep in ispec.traverse(root=True, order='post'):
envmod.extend(uenv.environment_modifications_for_spec(dep))
envmod.extend(
spack.user_environment.environment_modifications_for_spec(dep)
)
ret.add_default_envmod(envmod)
return ret
else:
@@ -462,7 +623,9 @@ def _raise_error(executable, exe_spec):
ret = spack.util.executable.Executable(exe_path[0])
envmod = EnvironmentModifications()
for dep in spec.traverse(root=True, order='post'):
envmod.extend(uenv.environment_modifications_for_spec(dep))
envmod.extend(
spack.user_environment.environment_modifications_for_spec(dep)
)
ret.add_default_envmod(envmod)
return ret
@@ -474,8 +637,12 @@ def _bootstrap_config_scopes():
config_scopes = [
spack.config.InternalConfigScope('_builtin', spack.config.config_defaults)
]
for name, path in spack.config.configuration_paths:
platform = spack.architecture.platform().name
configuration_paths = (
spack.config.configuration_defaults_path,
('bootstrap', _config_path())
)
for name, path in configuration_paths:
platform = spack.platforms.host().name
platform_scope = spack.config.ConfigScope(
'/'.join([name, platform]), os.path.join(path, platform)
)
@@ -487,22 +654,64 @@ def _bootstrap_config_scopes():
return config_scopes
def _add_compilers_if_missing():
arch = spack.spec.ArchSpec.frontend_arch()
if not spack.compilers.compilers_for_arch(arch):
new_compilers = spack.compilers.find_new_compilers()
if new_compilers:
spack.compilers.add_compilers_to_config(new_compilers, init_config=False)
def _add_externals_if_missing():
search_list = [
# clingo
spack.repo.path.get('cmake'),
spack.repo.path.get('bison'),
# GnuPG
spack.repo.path.get('gawk')
]
detected_packages = spack.detection.by_executable(search_list)
spack.detection.update_configuration(detected_packages, scope='bootstrap')
@contextlib.contextmanager
def ensure_bootstrap_configuration():
bootstrap_store_path = store_path()
with spack.environment.deactivate_environment():
with spack.architecture.use_platform(spack.architecture.real_platform()):
user_configuration = _read_and_sanitize_configuration()
with spack.environment.no_active_environment():
with spack.platforms.use_platform(spack.platforms.real_host()):
with spack.repo.use_repositories(spack.paths.packages_path):
with spack.store.use_store(bootstrap_store_path):
# Default configuration scopes excluding command line
# and builtin but accounting for platform specific scopes
config_scopes = _bootstrap_config_scopes()
with spack.config.use_configuration(*config_scopes):
# We may need to compile code from sources, so ensure we have
# compilers for the current platform before switching parts.
_add_compilers_if_missing()
spack.config.set('bootstrap', user_configuration['bootstrap'])
spack.config.set('config', user_configuration['config'])
with spack.modules.disable_modules():
with spack_python_interpreter():
yield
def _read_and_sanitize_configuration():
"""Read the user configuration that needs to be reused for bootstrapping
and remove the entries that should not be copied over.
"""
# Read the "config" section but pop the install tree (the entry will not be
# considered due to the use_store context manager, so it will be confusing
# to have it in the configuration).
config_yaml = spack.config.get('config')
config_yaml.pop('install_tree', None)
user_configuration = {
'bootstrap': spack.config.get('bootstrap'),
'config': config_yaml
}
return user_configuration
def store_path():
"""Path to the store used for bootstrapped software"""
enabled = spack.config.get('bootstrap:enable', True)
@@ -511,37 +720,69 @@ def store_path():
'Use "spack bootstrap enable" to enable it')
raise RuntimeError(msg)
bootstrap_root_path = spack.config.get(
'bootstrap:root', spack.paths.user_bootstrap_path
return _store_path()
def _root_path():
"""Root of all the bootstrap related folders"""
return spack.config.get(
'bootstrap:root', spack.paths.default_user_bootstrap_path
)
bootstrap_store_path = spack.util.path.canonicalize_path(
def _store_path():
bootstrap_root_path = _root_path()
return spack.util.path.canonicalize_path(
os.path.join(bootstrap_root_path, 'store')
)
return bootstrap_store_path
def clingo_root_spec():
# Construct the root spec that will be used to bootstrap clingo
spec_str = 'clingo-bootstrap@spack+python'
def _config_path():
bootstrap_root_path = _root_path()
return spack.util.path.canonicalize_path(
os.path.join(bootstrap_root_path, 'config')
)
def _root_spec(spec_str):
"""Add a proper compiler and target to a spec used during bootstrapping.
Args:
spec_str (str): spec to be bootstrapped. Must be without compiler and target.
"""
# Add a proper compiler hint to the root spec. We use GCC for
# everything but MacOS.
if str(spack.architecture.platform()) == 'darwin':
if str(spack.platforms.host()) == 'darwin':
spec_str += ' %apple-clang'
else:
spec_str += ' %gcc'
# Add the generic target
generic_target = archspec.cpu.host().family
spec_str += ' target={0}'.format(str(generic_target))
tty.debug('[BOOTSTRAP ROOT SPEC] clingo: {0}'.format(spec_str))
target = archspec.cpu.host().family
spec_str += ' target={0}'.format(target)
tty.debug('[BOOTSTRAP ROOT SPEC] {0}'.format(spec_str))
return spec_str
def clingo_root_spec():
"""Return the root spec used to bootstrap clingo"""
return _root_spec('clingo-bootstrap@spack+python')
def ensure_clingo_importable_or_raise():
"""Ensure that the clingo module is available for import."""
ensure_module_importable_or_raise(
module='clingo', abstract_spec=clingo_root_spec()
)
def gnupg_root_spec():
"""Return the root spec used to bootstrap GnuPG"""
return _root_spec('gnupg@2.3:')
def ensure_gpg_in_path_or_raise():
"""Ensure gpg or gpg2 are in the PATH or raise."""
ensure_executables_in_path_or_raise(
executables=['gpg2', 'gpg'], abstract_spec=gnupg_root_spec(),
)

View File

@@ -49,7 +49,6 @@
from llnl.util.tty.color import cescape, colorize
from llnl.util.tty.log import MultiProcessFd
import spack.architecture as arch
import spack.build_systems.cmake
import spack.build_systems.meson
import spack.config
@@ -57,6 +56,7 @@
import spack.main
import spack.package
import spack.paths
import spack.platforms
import spack.repo
import spack.schema.environment
import spack.store
@@ -72,7 +72,6 @@
get_path,
inspect_path,
is_system_path,
preserve_environment,
system_dirs,
validate,
)
@@ -148,6 +147,14 @@ def __call__(self, *args, **kwargs):
return super(MakeExecutable, self).__call__(*args, **kwargs)
def _on_cray():
host_platform = spack.platforms.host()
host_os = host_platform.operating_system('default_os')
on_cray = str(host_platform) == 'cray'
using_cnl = re.match(r'cnl\d+', str(host_os))
return on_cray, using_cnl
def clean_environment():
# Stuff in here sanitizes the build environment to eliminate
# anything the user has set that may interfere. We apply it immediately
@@ -171,6 +178,9 @@ def clean_environment():
env.unset('CMAKE_PREFIX_PATH')
# Affects GNU make, can e.g. indirectly inhibit enabling parallel build
env.unset('MAKEFLAGS')
# Avoid that libraries of build dependencies get hijacked.
env.unset('LD_PRELOAD')
env.unset('DYLD_INSERT_LIBRARIES')
@@ -179,9 +189,7 @@ def clean_environment():
# interference with Spack dependencies.
# CNL requires these variables to be set (or at least some of them,
# depending on the CNL version).
hostarch = arch.Arch(arch.platform(), 'default_os', 'default_target')
on_cray = str(hostarch.platform) == 'cray'
using_cnl = re.match(r'cnl\d+', str(hostarch.os))
on_cray, using_cnl = _on_cray()
if on_cray and not using_cnl:
env.unset('CRAY_LD_LIBRARY_PATH')
for varname in os.environ.keys():
@@ -224,7 +232,7 @@ def clean_environment():
if '/macports/' in p:
env.remove_path('PATH', p)
env.apply_modifications()
return env
def set_compiler_environment_variables(pkg, env):
@@ -757,79 +765,77 @@ def setup_package(pkg, dirty, context='build'):
set_module_variables_for_package(pkg)
env = EnvironmentModifications()
if not dirty:
clean_environment()
# Keep track of env changes from packages separately, since we want to
# issue warnings when packages make "suspicious" modifications.
env_base = EnvironmentModifications() if dirty else clean_environment()
env_mods = EnvironmentModifications()
# setup compilers for build contexts
need_compiler = context == 'build' or (context == 'test' and
pkg.test_requires_compiler)
if need_compiler:
set_compiler_environment_variables(pkg, env)
set_wrapper_variables(pkg, env)
set_compiler_environment_variables(pkg, env_mods)
set_wrapper_variables(pkg, env_mods)
env.extend(modifications_from_dependencies(
env_mods.extend(modifications_from_dependencies(
pkg.spec, context, custom_mods_only=False))
# architecture specific setup
pkg.architecture.platform.setup_platform_environment(pkg, env)
platform = spack.platforms.by_name(pkg.spec.architecture.platform)
target = platform.target(pkg.spec.architecture.target)
platform.setup_platform_environment(pkg, env_mods)
if context == 'build':
pkg.setup_build_environment(env)
pkg.setup_build_environment(env_mods)
if (not dirty) and (not env.is_unset('CPATH')):
if (not dirty) and (not env_mods.is_unset('CPATH')):
tty.debug("A dependency has updated CPATH, this may lead pkg-"
"config to assume that the package is part of the system"
" includes and omit it when invoked with '--cflags'.")
elif context == 'test':
env.extend(
env_mods.extend(
inspect_path(
pkg.spec.prefix,
spack.user_environment.prefix_inspections(pkg.spec.platform),
exclude=is_system_path
)
)
pkg.setup_run_environment(env)
env.prepend_path('PATH', '.')
pkg.setup_run_environment(env_mods)
env_mods.prepend_path('PATH', '.')
# Loading modules, in particular if they are meant to be used outside
# of Spack, can change environment variables that are relevant to the
# build of packages. To avoid a polluted environment, preserve the
# value of a few, selected, environment variables
# With the current ordering of environment modifications, this is strictly
# unnecessary. Modules affecting these variables will be overwritten anyway
with preserve_environment('CC', 'CXX', 'FC', 'F77'):
# All module loads that otherwise would belong in previous
# functions have to occur after the env object has its
# modifications applied. Otherwise the environment modifications
# could undo module changes, such as unsetting LD_LIBRARY_PATH
# after a module changes it.
if need_compiler:
for mod in pkg.compiler.modules:
# Fixes issue https://github.com/spack/spack/issues/3153
if os.environ.get("CRAY_CPU_TARGET") == "mic-knl":
load_module("cce")
load_module(mod)
# First apply the clean environment changes
env_base.apply_modifications()
# kludge to handle cray libsci being automatically loaded by PrgEnv
# modules on cray platform. Module unload does no damage when
# unnecessary
# Load modules on an already clean environment, just before applying Spack's
# own environment modifications. This ensures Spack controls CC/CXX/... variables.
if need_compiler:
for mod in pkg.compiler.modules:
load_module(mod)
# kludge to handle cray libsci being automatically loaded by PrgEnv
# modules on cray platform. Module unload does no damage when
# unnecessary
on_cray, _ = _on_cray()
if on_cray:
module('unload', 'cray-libsci')
if pkg.architecture.target.module_name:
load_module(pkg.architecture.target.module_name)
if target.module_name:
load_module(target.module_name)
load_external_modules(pkg)
load_external_modules(pkg)
implicit_rpaths = pkg.compiler.implicit_rpaths()
if implicit_rpaths:
env.set('SPACK_COMPILER_IMPLICIT_RPATHS',
':'.join(implicit_rpaths))
env_mods.set('SPACK_COMPILER_IMPLICIT_RPATHS',
':'.join(implicit_rpaths))
# Make sure nothing's strange about the Spack environment.
validate(env, tty.warn)
env.apply_modifications()
validate(env_mods, tty.warn)
env_mods.apply_modifications()
# Return all env modifications we controlled (excluding module related ones)
env_base.extend(env_mods)
return env_base
def _make_runnable(pkg, env):
@@ -1017,8 +1023,8 @@ def _setup_pkg_and_run(serialized_pkg, function, kwargs, child_pipe,
if not kwargs.get('fake', False):
kwargs['unmodified_env'] = os.environ.copy()
setup_package(pkg, dirty=kwargs.get('dirty', False),
context=context)
kwargs['env_modifications'] = setup_package(
pkg, dirty=kwargs.get('dirty', False), context=context)
return_value = function(pkg, kwargs)
child_pipe.send(return_value)

View File

@@ -3,7 +3,6 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import inspect
import itertools
import os
import os.path
import stat
@@ -14,6 +13,8 @@
import llnl.util.tty as tty
from llnl.util.filesystem import force_remove, working_dir
from spack.build_environment import InstallError
from spack.directives import depends_on
from spack.package import PackageBase, run_after, run_before
from spack.util.executable import Executable
@@ -54,9 +55,24 @@ class AutotoolsPackage(PackageBase):
#: This attribute is used in UI queries that need to know the build
#: system base class
build_system_class = 'AutotoolsPackage'
#: Whether or not to update ``config.guess`` and ``config.sub`` on old
#: architectures
patch_config_files = True
@property
def patch_config_files(self):
"""
Whether or not to update old ``config.guess`` and ``config.sub`` files
distributed with the tarball. This currently only applies to
``ppc64le:``, ``aarch64:``, and ``riscv64`` target architectures. The
substitutes are taken from the ``gnuconfig`` package, which is
automatically added as a build dependency for these architectures. In
case system versions of these config files are required, the
``gnuconfig`` package can be marked external with a prefix pointing to
the directory containing the system ``config.guess`` and ``config.sub``
files.
"""
return (self.spec.satisfies('target=ppc64le:')
or self.spec.satisfies('target=aarch64:')
or self.spec.satisfies('target=riscv64:'))
#: Whether or not to update ``libtool``
#: (currently only for Arm/Clang/Fujitsu compilers)
patch_libtool = True
@@ -83,6 +99,10 @@ class AutotoolsPackage(PackageBase):
#: after the installation. If True instead it installs them.
install_libtool_archives = False
depends_on('gnuconfig', type='build', when='target=ppc64le:')
depends_on('gnuconfig', type='build', when='target=aarch64:')
depends_on('gnuconfig', type='build', when='target=riscv64:')
@property
def _removed_la_files_log(self):
"""File containing the list of remove libtool archives"""
@@ -104,12 +124,10 @@ def _do_patch_config_files(self):
"""Some packages ship with older config.guess/config.sub files and
need to have these updated when installed on a newer architecture.
In particular, config.guess fails for PPC64LE for version prior
to a 2013-06-10 build date (automake 1.13.4) and for ARM (aarch64).
to a 2013-06-10 build date (automake 1.13.4) and for ARM (aarch64) and
RISC-V (riscv64).
"""
if not self.patch_config_files or (
not self.spec.satisfies('target=ppc64le:') and
not self.spec.satisfies('target=aarch64:')
):
if not self.patch_config_files:
return
# TODO: Expand this to select the 'config.sub'-compatible architecture
@@ -119,6 +137,8 @@ def _do_patch_config_files(self):
config_arch = 'ppc64le'
elif self.spec.satisfies('target=aarch64:'):
config_arch = 'aarch64'
elif self.spec.satisfies('target=riscv64:'):
config_arch = 'riscv64'
else:
config_arch = 'local'
@@ -138,39 +158,69 @@ def runs_ok(script_abs_path):
return True
# Compute the list of files that needs to be patched
search_dir = self.stage.path
to_be_patched = fs.find(
search_dir, files=['config.sub', 'config.guess'], recursive=True
)
# Get the list of files that needs to be patched
to_be_patched = fs.find(self.stage.path, files=['config.sub', 'config.guess'])
to_be_patched = [f for f in to_be_patched if not runs_ok(f)]
# If there are no files to be patched, return early
if not to_be_patched:
return
# Directories where to search for files to be copied
# over the failing ones
good_file_dirs = ['/usr/share']
if 'automake' in self.spec:
good_file_dirs.insert(0, self.spec['automake'].prefix)
# Otherwise, require `gnuconfig` to be a build dependency
self._require_build_deps(
pkgs=['gnuconfig'],
spec=self.spec,
err="Cannot patch config files")
# List of files to be found in the directories above
# Get the config files we need to patch (config.sub / config.guess).
to_be_found = list(set(os.path.basename(f) for f in to_be_patched))
gnuconfig = self.spec['gnuconfig']
gnuconfig_dir = gnuconfig.prefix
# An external gnuconfig may not not have a prefix.
if gnuconfig_dir is None:
raise InstallError("Spack could not find substitutes for GNU config "
"files because no prefix is available for the "
"`gnuconfig` package. Make sure you set a prefix "
"path instead of modules for external `gnuconfig`.")
candidates = fs.find(gnuconfig_dir, files=to_be_found, recursive=False)
# For external packages the user may have specified an incorrect prefix.
# otherwise the installation is just corrupt.
if not candidates:
msg = ("Spack could not find `config.guess` and `config.sub` "
"files in the `gnuconfig` prefix `{0}`. This means the "
"`gnuconfig` package is broken").format(gnuconfig_dir)
if gnuconfig.external:
msg += (" or the `gnuconfig` package prefix is misconfigured as"
" an external package")
raise InstallError(msg)
# Filter working substitutes
candidates = [f for f in candidates if runs_ok(f)]
substitutes = {}
for directory in good_file_dirs:
candidates = fs.find(directory, files=to_be_found, recursive=True)
candidates = [f for f in candidates if runs_ok(f)]
for name, good_files in itertools.groupby(
candidates, key=os.path.basename
):
substitutes[name] = next(good_files)
to_be_found.remove(name)
for candidate in candidates:
config_file = os.path.basename(candidate)
substitutes[config_file] = candidate
to_be_found.remove(config_file)
# Check that we found everything we needed
if to_be_found:
msg = 'Failed to find suitable substitutes for {0}'
raise RuntimeError(msg.format(', '.join(to_be_found)))
msg = """\
Spack could not find working replacements for the following autotools config
files: {0}.
To resolve this problem, please try the following:
1. Try to rebuild with `patch_config_files = False` in the package `{1}`, to
rule out that Spack tries to replace config files not used by the build.
2. Verify that the `gnuconfig` package is up-to-date.
3. On some systems you need to use system-provided `config.guess` and `config.sub`
files. In this case, mark `gnuconfig` as an non-buildable external package,
and set the prefix to the directory containing the `config.guess` and
`config.sub` files.
"""
raise InstallError(msg.format(', '.join(to_be_found), self.name))
# Copy the good files over the bad ones
for abs_path in to_be_patched:
@@ -252,17 +302,41 @@ def delete_configure_to_force_update(self):
if self.force_autoreconf:
force_remove(self.configure_abs_path)
def _require_build_deps(self, pkgs, spec, err):
"""Require `pkgs` to be direct build dependencies of `spec`. Raises a
RuntimeError with a helpful error messages when any dep is missing."""
build_deps = [d.name for d in spec.dependencies(deptype='build')]
missing_deps = [x for x in pkgs if x not in build_deps]
if not missing_deps:
return
# Raise an exception on missing deps.
msg = ("{0}: missing dependencies: {1}.\n\nPlease add "
"the following lines to the package:\n\n"
.format(err, ", ".join(missing_deps)))
for dep in missing_deps:
msg += (" depends_on('{0}', type='build', when='@{1}')\n"
.format(dep, spec.version))
msg += "\nUpdate the version (when='@{0}') as needed.".format(spec.version)
raise RuntimeError(msg)
def autoreconf(self, spec, prefix):
"""Not needed usually, configure should be already there"""
# If configure exists nothing needs to be done
if os.path.exists(self.configure_abs_path):
return
# Else try to regenerate it
autotools = ['m4', 'autoconf', 'automake', 'libtool']
missing = [x for x in autotools if x not in spec]
if missing:
msg = 'Cannot generate configure: missing dependencies {0}'
raise RuntimeError(msg.format(missing))
# Else try to regenerate it, which reuquires a few build dependencies
self._require_build_deps(
pkgs=['autoconf', 'automake', 'libtool'],
spec=spec,
err="Cannot generate configure")
tty.msg('Configure script not found: trying to generate it')
tty.warn('*********************************************************')
tty.warn('* If the default procedure fails, consider implementing *')
@@ -373,14 +447,15 @@ def _activate_or_not(
name,
activation_word,
deactivation_word,
activation_value=None
activation_value=None,
variant=None
):
"""This function contains the current implementation details of
:meth:`~spack.build_systems.autotools.AutotoolsPackage.with_or_without` and
:meth:`~spack.build_systems.autotools.AutotoolsPackage.enable_or_disable`.
Args:
name (str): name of the variant that is being processed
name (str): name of the option that is being activated or not
activation_word (str): the default activation word ('with' in the
case of ``with_or_without``)
deactivation_word (str): the default deactivation word ('without'
@@ -392,6 +467,8 @@ def _activate_or_not(
The special value 'prefix' can also be assigned and will return
``spec[name].prefix`` as activation parameter.
variant (str): name of the variant that is being processed
(if different from option name)
Examples:
@@ -401,6 +478,7 @@ def _activate_or_not(
variant('foo', values=('x', 'y'), description='')
variant('bar', default=True, description='')
variant('ba_z', default=True, description='')
calling this function like:
@@ -410,12 +488,13 @@ def _activate_or_not(
'foo', 'with', 'without', activation_value='prefix'
)
_activate_or_not('bar', 'with', 'without')
_activate_or_not('ba-z', 'with', 'without', variant='ba_z')
will generate the following configuration options:
.. code-block:: console
--with-x=<prefix-to-x> --without-y --with-bar
--with-x=<prefix-to-x> --without-y --with-bar --with-ba-z
for ``<spec-name> foo=x +bar``
@@ -432,32 +511,37 @@ def _activate_or_not(
if activation_value == 'prefix':
activation_value = lambda x: spec[x].prefix
variant = variant or name
# Defensively look that the name passed as argument is among
# variants
if name not in self.variants:
if variant not in self.variants:
msg = '"{0}" is not a variant of "{1}"'
raise KeyError(msg.format(name, self.name))
raise KeyError(msg.format(variant, self.name))
# Create a list of pairs. Each pair includes a configuration
# option and whether or not that option is activated
if set(self.variants[name].values) == set((True, False)):
variant_desc, _ = self.variants[variant]
if set(variant_desc.values) == set((True, False)):
# BoolValuedVariant carry information about a single option.
# Nonetheless, for uniformity of treatment we'll package them
# in an iterable of one element.
condition = '+{name}'.format(name=name)
condition = '+{name}'.format(name=variant)
options = [(name, condition in spec)]
else:
condition = '{name}={value}'
condition = '{variant}={value}'
# "feature_values" is used to track values which correspond to
# features which can be enabled or disabled as understood by the
# package's build system. It excludes values which have special
# meanings and do not correspond to features (e.g. "none")
feature_values = getattr(
self.variants[name].values, 'feature_values', None
) or self.variants[name].values
variant_desc.values, 'feature_values', None
) or variant_desc.values
options = [
(value, condition.format(name=name, value=value) in spec)
(value,
condition.format(variant=variant,
value=value) in spec)
for value in feature_values
]
@@ -485,7 +569,7 @@ def _default_generator(is_activated):
args.append(line_generator(activated))
return args
def with_or_without(self, name, activation_value=None):
def with_or_without(self, name, activation_value=None, variant=None):
"""Inspects a variant and returns the arguments that activate
or deactivate the selected feature(s) for the configure options.
@@ -511,9 +595,10 @@ def with_or_without(self, name, activation_value=None):
Returns:
list of arguments to configure
"""
return self._activate_or_not(name, 'with', 'without', activation_value)
return self._activate_or_not(name, 'with', 'without', activation_value,
variant)
def enable_or_disable(self, name, activation_value=None):
def enable_or_disable(self, name, activation_value=None, variant=None):
"""Same as
:meth:`~spack.build_systems.autotools.AutotoolsPackage.with_or_without`
but substitute ``with`` with ``enable`` and ``without`` with ``disable``.
@@ -531,7 +616,7 @@ def enable_or_disable(self, name, activation_value=None):
list of arguments to configure
"""
return self._activate_or_not(
name, 'enable', 'disable', activation_value
name, 'enable', 'disable', activation_value, variant
)
run_after('install')(PackageBase._run_default_install_time_test_callbacks)
@@ -561,3 +646,6 @@ def remove_libtool_archives(self):
fs.mkdirp(os.path.dirname(self._removed_la_files_log))
with open(self._removed_la_files_log, mode='w') as f:
f.write('\n'.join(libtool_files))
# On macOS, force rpaths for shared library IDs and remove duplicate rpaths
run_after('install')(PackageBase.apply_macos_rpath_fixups)

View File

@@ -5,7 +5,6 @@
import spack.variant
from spack.directives import conflicts, depends_on, variant
from spack.multimethod import when
from spack.package import PackageBase
@@ -13,7 +12,7 @@ class CudaPackage(PackageBase):
"""Auxiliary class which contains CUDA variant, dependencies and conflicts
and is meant to unify and facilitate its usage.
Maintainers: ax3l, Rombur
Maintainers: ax3l, Rombur, davidbeckingsale
"""
# https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#gpu-feature-list
@@ -86,6 +85,9 @@ def cuda_flags(arch_list):
# apply to platform=darwin. We currently do not provide conflicts for
# platform=darwin with %apple-clang.
# Linux x86_64 compiler conflicts from here:
# https://gist.github.com/ax3l/9489132
# GCC
# According to
# https://github.com/spack/spack/pull/25054#issuecomment-886531664
@@ -102,88 +104,87 @@ def cuda_flags(arch_list):
# This implies that the last one in the list has to be updated at
# each release of a new cuda minor version.
conflicts('%gcc@10:', when='+cuda ^cuda@:11.0')
conflicts('%gcc@11:', when='+cuda ^cuda@:11.4')
conflicts('%gcc@11:', when='+cuda ^cuda@:11.4.0')
conflicts('%gcc@12:', when='+cuda ^cuda@:11.5.0')
conflicts('%clang@12:', when='+cuda ^cuda@:11.4.0')
conflicts('%clang@13:', when='+cuda ^cuda@:11.5.0')
# https://gist.github.com/ax3l/9489132#gistcomment-3860114
conflicts('%gcc@10', when='+cuda ^cuda@:11.4.0')
conflicts('%gcc@5:', when='+cuda ^cuda@:7.5 target=x86_64:')
conflicts('%gcc@6:', when='+cuda ^cuda@:8 target=x86_64:')
conflicts('%gcc@7:', when='+cuda ^cuda@:9.1 target=x86_64:')
conflicts('%gcc@8:', when='+cuda ^cuda@:10.0.130 target=x86_64:')
conflicts('%gcc@9:', when='+cuda ^cuda@:10.2.89 target=x86_64:')
conflicts('%pgi@:14.8', when='+cuda ^cuda@:7.0.27 target=x86_64:')
conflicts('%pgi@:15.3,15.5:', when='+cuda ^cuda@7.5 target=x86_64:')
conflicts('%pgi@:16.2,16.0:16.3', when='+cuda ^cuda@8 target=x86_64:')
conflicts('%pgi@:15,18:', when='+cuda ^cuda@9.0:9.1 target=x86_64:')
conflicts('%pgi@:16,19:', when='+cuda ^cuda@9.2.88:10 target=x86_64:')
conflicts('%pgi@:17,20:', when='+cuda ^cuda@10.1.105:10.2.89 target=x86_64:')
conflicts('%pgi@:17,21:', when='+cuda ^cuda@11.0.2:11.1.0 target=x86_64:')
conflicts('%clang@:3.4', when='+cuda ^cuda@:7.5 target=x86_64:')
conflicts('%clang@:3.7,4:', when='+cuda ^cuda@8.0:9.0 target=x86_64:')
conflicts('%clang@:3.7,4.1:', when='+cuda ^cuda@9.1 target=x86_64:')
conflicts('%clang@:3.7,5.1:', when='+cuda ^cuda@9.2 target=x86_64:')
conflicts('%clang@:3.7,6.1:', when='+cuda ^cuda@10.0.130 target=x86_64:')
conflicts('%clang@:3.7,7.1:', when='+cuda ^cuda@10.1.105 target=x86_64:')
conflicts('%clang@:3.7,8.1:',
when='+cuda ^cuda@10.1.105:10.1.243 target=x86_64:')
conflicts('%clang@:3.2,9:', when='+cuda ^cuda@10.2.89 target=x86_64:')
conflicts('%clang@:5', when='+cuda ^cuda@11.0.2: target=x86_64:')
conflicts('%clang@10:', when='+cuda ^cuda@:11.0.3 target=x86_64:')
conflicts('%clang@11:', when='+cuda ^cuda@:11.1.0 target=x86_64:')
# Linux x86_64 compiler conflicts from here:
# https://gist.github.com/ax3l/9489132
with when('~allow-unsupported-compilers'):
conflicts('%gcc@5:', when='+cuda ^cuda@:7.5 target=x86_64:')
conflicts('%gcc@6:', when='+cuda ^cuda@:8 target=x86_64:')
conflicts('%gcc@7:', when='+cuda ^cuda@:9.1 target=x86_64:')
conflicts('%gcc@8:', when='+cuda ^cuda@:10.0.130 target=x86_64:')
conflicts('%gcc@9:', when='+cuda ^cuda@:10.2.89 target=x86_64:')
conflicts('%pgi@:14.8', when='+cuda ^cuda@:7.0.27 target=x86_64:')
conflicts('%pgi@:15.3,15.5:', when='+cuda ^cuda@7.5 target=x86_64:')
conflicts('%pgi@:16.2,16.0:16.3', when='+cuda ^cuda@8 target=x86_64:')
conflicts('%pgi@:15,18:', when='+cuda ^cuda@9.0:9.1 target=x86_64:')
conflicts('%pgi@:16,19:', when='+cuda ^cuda@9.2.88:10 target=x86_64:')
conflicts('%pgi@:17,20:', when='+cuda ^cuda@10.1.105:10.2.89 target=x86_64:')
conflicts('%pgi@:17,21:', when='+cuda ^cuda@11.0.2:11.1.0 target=x86_64:')
conflicts('%clang@:3.4', when='+cuda ^cuda@:7.5 target=x86_64:')
conflicts('%clang@:3.7,4:', when='+cuda ^cuda@8.0:9.0 target=x86_64:')
conflicts('%clang@:3.7,4.1:', when='+cuda ^cuda@9.1 target=x86_64:')
conflicts('%clang@:3.7,5.1:', when='+cuda ^cuda@9.2 target=x86_64:')
conflicts('%clang@:3.7,6.1:', when='+cuda ^cuda@10.0.130 target=x86_64:')
conflicts('%clang@:3.7,7.1:', when='+cuda ^cuda@10.1.105 target=x86_64:')
conflicts('%clang@:3.7,8.1:',
when='+cuda ^cuda@10.1.105:10.1.243 target=x86_64:')
conflicts('%clang@:3.2,9:', when='+cuda ^cuda@10.2.89 target=x86_64:')
conflicts('%clang@:5', when='+cuda ^cuda@11.0.2: target=x86_64:')
conflicts('%clang@10:', when='+cuda ^cuda@:11.0.3 target=x86_64:')
conflicts('%clang@11:', when='+cuda ^cuda@:11.1.0 target=x86_64:')
# x86_64 vs. ppc64le differ according to NVidia docs
# Linux ppc64le compiler conflicts from Table from the docs below:
# https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html
# https://docs.nvidia.com/cuda/archive/9.2/cuda-installation-guide-linux/index.html
# https://docs.nvidia.com/cuda/archive/9.1/cuda-installation-guide-linux/index.html
# https://docs.nvidia.com/cuda/archive/9.0/cuda-installation-guide-linux/index.html
# https://docs.nvidia.com/cuda/archive/8.0/cuda-installation-guide-linux/index.html
# x86_64 vs. ppc64le differ according to NVidia docs
# Linux ppc64le compiler conflicts from Table from the docs below:
# https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html
# https://docs.nvidia.com/cuda/archive/9.2/cuda-installation-guide-linux/index.html
# https://docs.nvidia.com/cuda/archive/9.1/cuda-installation-guide-linux/index.html
# https://docs.nvidia.com/cuda/archive/9.0/cuda-installation-guide-linux/index.html
# https://docs.nvidia.com/cuda/archive/8.0/cuda-installation-guide-linux/index.html
# information prior to CUDA 9 difficult to find
conflicts('%gcc@6:', when='+cuda ^cuda@:9 target=ppc64le:')
conflicts('%gcc@8:', when='+cuda ^cuda@:10.0.130 target=ppc64le:')
conflicts('%gcc@9:', when='+cuda ^cuda@:10.1.243 target=ppc64le:')
# officially, CUDA 11.0.2 only supports the system GCC 8.3 on ppc64le
conflicts('%pgi', when='+cuda ^cuda@:8 target=ppc64le:')
conflicts('%pgi@:16', when='+cuda ^cuda@:9.1.185 target=ppc64le:')
conflicts('%pgi@:17', when='+cuda ^cuda@:10 target=ppc64le:')
conflicts('%clang@4:', when='+cuda ^cuda@:9.0.176 target=ppc64le:')
conflicts('%clang@5:', when='+cuda ^cuda@:9.1 target=ppc64le:')
conflicts('%clang@6:', when='+cuda ^cuda@:9.2 target=ppc64le:')
conflicts('%clang@7:', when='+cuda ^cuda@10.0.130 target=ppc64le:')
conflicts('%clang@7.1:', when='+cuda ^cuda@:10.1.105 target=ppc64le:')
conflicts('%clang@8.1:', when='+cuda ^cuda@:10.2.89 target=ppc64le:')
conflicts('%clang@:5', when='+cuda ^cuda@11.0.2: target=ppc64le:')
conflicts('%clang@10:', when='+cuda ^cuda@:11.0.2 target=ppc64le:')
conflicts('%clang@11:', when='+cuda ^cuda@:11.1.0 target=ppc64le:')
# information prior to CUDA 9 difficult to find
conflicts('%gcc@6:', when='+cuda ^cuda@:9 target=ppc64le:')
conflicts('%gcc@8:', when='+cuda ^cuda@:10.0.130 target=ppc64le:')
conflicts('%gcc@9:', when='+cuda ^cuda@:10.1.243 target=ppc64le:')
# officially, CUDA 11.0.2 only supports the system GCC 8.3 on ppc64le
conflicts('%pgi', when='+cuda ^cuda@:8 target=ppc64le:')
conflicts('%pgi@:16', when='+cuda ^cuda@:9.1.185 target=ppc64le:')
conflicts('%pgi@:17', when='+cuda ^cuda@:10 target=ppc64le:')
conflicts('%clang@4:', when='+cuda ^cuda@:9.0.176 target=ppc64le:')
conflicts('%clang@5:', when='+cuda ^cuda@:9.1 target=ppc64le:')
conflicts('%clang@6:', when='+cuda ^cuda@:9.2 target=ppc64le:')
conflicts('%clang@7:', when='+cuda ^cuda@10.0.130 target=ppc64le:')
conflicts('%clang@7.1:', when='+cuda ^cuda@:10.1.105 target=ppc64le:')
conflicts('%clang@8.1:', when='+cuda ^cuda@:10.2.89 target=ppc64le:')
conflicts('%clang@:5', when='+cuda ^cuda@11.0.2: target=ppc64le:')
conflicts('%clang@10:', when='+cuda ^cuda@:11.0.2 target=ppc64le:')
conflicts('%clang@11:', when='+cuda ^cuda@:11.1.0 target=ppc64le:')
# Intel is mostly relevant for x86_64 Linux, even though it also
# exists for Mac OS X. No information prior to CUDA 3.2 or Intel 11.1
conflicts('%intel@:11.0', when='+cuda ^cuda@:3.1')
conflicts('%intel@:12.0', when='+cuda ^cuda@5.5:')
conflicts('%intel@:13.0', when='+cuda ^cuda@6.0:')
conflicts('%intel@:13.2', when='+cuda ^cuda@6.5:')
conflicts('%intel@:14.9', when='+cuda ^cuda@7:')
# Intel 15.x is compatible with CUDA 7 thru current CUDA
conflicts('%intel@16.0:', when='+cuda ^cuda@:8.0.43')
conflicts('%intel@17.0:', when='+cuda ^cuda@:8.0.60')
conflicts('%intel@18.0:', when='+cuda ^cuda@:9.9')
conflicts('%intel@19.0:', when='+cuda ^cuda@:10.0')
conflicts('%intel@19.1:', when='+cuda ^cuda@:10.1')
conflicts('%intel@19.2:', when='+cuda ^cuda@:11.1.0')
# Intel is mostly relevant for x86_64 Linux, even though it also
# exists for Mac OS X. No information prior to CUDA 3.2 or Intel 11.1
conflicts('%intel@:11.0', when='+cuda ^cuda@:3.1')
conflicts('%intel@:12.0', when='+cuda ^cuda@5.5:')
conflicts('%intel@:13.0', when='+cuda ^cuda@6.0:')
conflicts('%intel@:13.2', when='+cuda ^cuda@6.5:')
conflicts('%intel@:14.9', when='+cuda ^cuda@7:')
# Intel 15.x is compatible with CUDA 7 thru current CUDA
conflicts('%intel@16.0:', when='+cuda ^cuda@:8.0.43')
conflicts('%intel@17.0:', when='+cuda ^cuda@:8.0.60')
conflicts('%intel@18.0:', when='+cuda ^cuda@:9.9')
conflicts('%intel@19.0:', when='+cuda ^cuda@:10.0')
conflicts('%intel@19.1:', when='+cuda ^cuda@:10.1')
conflicts('%intel@19.2:', when='+cuda ^cuda@:11.1.0')
# XL is mostly relevant for ppc64le Linux
conflicts('%xl@:12,14:', when='+cuda ^cuda@:9.1')
conflicts('%xl@:12,14:15,17:', when='+cuda ^cuda@9.2')
conflicts('%xl@:12,17:', when='+cuda ^cuda@:11.1.0')
# XL is mostly relevant for ppc64le Linux
conflicts('%xl@:12,14:', when='+cuda ^cuda@:9.1')
conflicts('%xl@:12,14:15,17:', when='+cuda ^cuda@9.2')
conflicts('%xl@:12,17:', when='+cuda ^cuda@:11.1.0')
# Darwin.
# TODO: add missing conflicts for %apple-clang cuda@:10
conflicts('platform=darwin', when='+cuda ^cuda@11.0.2: ')
# Darwin.
# TODO: add missing conflicts for %apple-clang cuda@:10
conflicts('platform=darwin', when='+cuda ^cuda@11.0.2: ')
# Make sure cuda_arch can not be used without +cuda
for value in cuda_arch_values:

View File

@@ -116,9 +116,9 @@ class IntelPackage(PackageBase):
# that satisfies self.spec will be used.
version_years = {
# intel-daal is versioned 2016 and later, no divining is needed
'intel-ipp@9.0:9.99': 2016,
'intel-mkl@11.3.0:11.3.999': 2016,
'intel-mpi@5.1:5.99': 2016,
'intel-ipp@9.0:9': 2016,
'intel-mkl@11.3.0:11.3': 2016,
'intel-mpi@5.1:5': 2016,
}
# Below is the list of possible values for setting auto dispatch functions

View File

@@ -110,3 +110,6 @@ def installcheck(self):
# Check that self.prefix is there after installation
run_after('install')(PackageBase.sanity_check_prefix)
# On macOS, force rpaths for shared library IDs and remove duplicate rpaths
run_after('install')(PackageBase.apply_macos_rpath_fixups)

View File

@@ -129,7 +129,7 @@ def import_modules(self):
modules = []
root = os.path.join(
self.prefix,
self.spec['python'].package.config_vars['python_lib']['false']['false'],
self.spec['python'].package.config_vars['python_lib']['true']['false'],
)
# Some Python libraries are packages: collections of modules
@@ -393,11 +393,15 @@ def remove_files_from_view(self, view, merge_map):
self.spec
)
)
to_remove = []
for src, dst in merge_map.items():
if ignore_namespace and namespace_init(dst):
continue
if global_view or not path_contains_subdirectory(src, bin_dir):
view.remove_file(src, dst)
to_remove.append(dst)
else:
os.remove(dst)
view.remove_files(to_remove)

View File

@@ -18,6 +18,9 @@ class RubyPackage(PackageBase):
#. :py:meth:`~.RubyPackage.build`
#. :py:meth:`~.RubyPackage.install`
"""
maintainers = ['Kerilk']
#: Phases of a Ruby package
phases = ['build', 'install']
@@ -50,8 +53,12 @@ def install(self, spec, prefix):
gems = glob.glob('*.gem')
if gems:
# if --install-dir is not used, GEM_PATH is deleted from the
# environement, and Gems required to build native extensions will
# not be found. Those extensions are built during `gem install`.
inspect.getmodule(self).gem(
'install', '--norc', '--ignore-dependencies', gems[0])
'install', '--norc', '--ignore-dependencies',
'--install-dir', prefix, gems[0])
# Check that self.prefix is there after installation
run_after('install')(PackageBase.sanity_check_prefix)

View File

@@ -66,7 +66,7 @@ def import_modules(self):
modules = []
root = os.path.join(
self.prefix,
self.spec['python'].package.config_vars['python_lib']['false']['false'],
self.spec['python'].package.config_vars['python_lib']['true']['false'],
)
# Some Python libraries are packages: collections of modules
@@ -99,7 +99,9 @@ def configure(self, spec, prefix):
args = self.configure_args()
python_include_dir = 'python' + str(spec['python'].version.up_to(2))
python_include_dir = os.path.basename(
inspect.getmodule(self).python_include_dir
)
args.extend([
'--verbose',

View File

@@ -23,11 +23,8 @@ def misc_cache_location():
Currently the ``misc_cache`` stores indexes for virtual dependency
providers and for which packages provide which tags.
"""
path = spack.config.get('config:misc_cache')
if not path:
path = os.path.join(spack.paths.user_config_path, 'cache')
path = spack.util.path.canonicalize_path(path)
return path
path = spack.config.get('config:misc_cache', spack.paths.default_misc_cache_path)
return spack.util.path.canonicalize_path(path)
def _misc_cache():
@@ -47,7 +44,7 @@ def fetch_cache_location():
"""
path = spack.config.get('config:source_cache')
if not path:
path = os.path.join(spack.paths.var_path, "cache")
path = spack.paths.default_fetch_cache_path
path = spack.util.path.canonicalize_path(path)
return path

View File

@@ -396,9 +396,6 @@ def append_dep(s, d):
})
for spec in spec_list:
spec.concretize()
# root_spec = get_spec_string(spec)
root_spec = spec
for s in spec.traverse(deptype=all):
@@ -668,16 +665,35 @@ def generate_gitlab_ci_yaml(env, print_summary, output_file,
# Speed up staging by first fetching binary indices from all mirrors
# (including the per-PR mirror we may have just added above).
bindist.binary_index.update()
try:
bindist.binary_index.update()
except bindist.FetchCacheError as e:
tty.error(e)
staged_phases = {}
try:
for phase in phases:
phase_name = phase['name']
with spack.concretize.disable_compiler_existence_check():
staged_phases[phase_name] = stage_spec_jobs(
env.spec_lists[phase_name],
check_index_only=check_index_only)
if phase_name == 'specs':
# Anything in the "specs" of the environment are already
# concretized by the block at the top of this method, so we
# only need to find the concrete versions, and then avoid
# re-concretizing them needlessly later on.
concrete_phase_specs = [
concrete for abstract, concrete in env.concretized_specs()
if abstract in env.spec_lists[phase_name]
]
else:
# Any specs lists in other definitions (but not in the
# "specs") of the environment are not yet concretized so we
# have to concretize them explicitly here.
concrete_phase_specs = env.spec_lists[phase_name]
with spack.concretize.disable_compiler_existence_check():
for phase_spec in concrete_phase_specs:
phase_spec.concretize()
staged_phases[phase_name] = stage_spec_jobs(
concrete_phase_specs,
check_index_only=check_index_only)
finally:
# Clean up PR mirror if enabled
if pr_mirror_url:
@@ -693,6 +709,17 @@ def generate_gitlab_ci_yaml(env, print_summary, output_file,
max_length_needs = 0
max_needs_job = ''
# If this is configured, spack will fail "spack ci generate" if it
# generates any full hash which exists under the broken specs url.
broken_spec_urls = None
if broken_specs_url:
if broken_specs_url.startswith('http'):
# To make checking each spec against the list faster, we require
# a url protocol that allows us to iterate the url in advance.
tty.msg('Cannot use an http(s) url for broken specs, ignoring')
else:
broken_spec_urls = web_util.list_url(broken_specs_url)
before_script, after_script = None, None
for phase in phases:
phase_name = phase['name']
@@ -879,14 +906,10 @@ def generate_gitlab_ci_yaml(env, print_summary, output_file,
tty.debug('Pruning spec that does not need to be rebuilt.')
continue
# Check if this spec is in our list of known failures, now that
# we know this spec needs a rebuild
if broken_specs_url:
broken_spec_path = url_util.join(
broken_specs_url, release_spec_full_hash)
if web_util.url_exists(broken_spec_path):
known_broken_specs_encountered.append('{0} ({1})'.format(
release_spec, release_spec_full_hash))
if (broken_spec_urls is not None and
release_spec_full_hash in broken_spec_urls):
known_broken_specs_encountered.append('{0} ({1})'.format(
release_spec, release_spec_full_hash))
if artifacts_root:
job_dependencies.append({
@@ -1004,6 +1027,14 @@ def generate_gitlab_ci_yaml(env, print_summary, output_file,
'after_script',
]
service_job_retries = {
'max': 2,
'when': [
'runner_system_failure',
'stuck_or_timeout_failure'
]
}
if job_id > 0:
if temp_storage_url_prefix:
# There were some rebuild jobs scheduled, so we will need to
@@ -1023,6 +1054,7 @@ def generate_gitlab_ci_yaml(env, print_summary, output_file,
temp_storage_url_prefix)
]
cleanup_job['when'] = 'always'
cleanup_job['retry'] = service_job_retries
output_object['cleanup'] = cleanup_job
@@ -1046,11 +1078,7 @@ def generate_gitlab_ci_yaml(env, print_summary, output_file,
index_target_mirror)
]
final_job['when'] = 'always'
if artifacts_root:
final_job['variables'] = {
'SPACK_CONCRETE_ENV_DIR': concrete_env_dir
}
final_job['retry'] = service_job_retries
output_object['rebuild-index'] = final_job
@@ -1114,6 +1142,8 @@ def generate_gitlab_ci_yaml(env, print_summary, output_file,
'echo "All specs already up to date, nothing to rebuild."',
]
noop_job['retry'] = service_job_retries
sorted_output = {'no-specs-to-rebuild': noop_job}
if known_broken_specs_encountered:

View File

@@ -27,6 +27,7 @@
import spack.paths
import spack.spec
import spack.store
import spack.user_environment as uenv
import spack.util.spack_json as sjson
import spack.util.string
@@ -153,6 +154,7 @@ def parse_specs(args, **kwargs):
concretize = kwargs.get('concretize', False)
normalize = kwargs.get('normalize', False)
tests = kwargs.get('tests', False)
reuse = kwargs.get('reuse', False)
try:
sargs = args
@@ -161,7 +163,7 @@ def parse_specs(args, **kwargs):
specs = spack.spec.parse(sargs)
for spec in specs:
if concretize:
spec.concretize(tests=tests) # implies normalize
spec.concretize(tests=tests, reuse=reuse) # implies normalize
elif normalize:
spec.normalize(tests=tests)
@@ -259,17 +261,19 @@ def display_specs_as_json(specs, deps=False):
seen = set()
records = []
for spec in specs:
if spec.dag_hash() in seen:
dag_hash = spec.dag_hash()
if dag_hash in seen:
continue
seen.add(spec.dag_hash())
records.append(spec.to_node_dict())
records.append(spec.node_dict_with_hashes())
seen.add(dag_hash)
if deps:
for dep in spec.traverse():
if dep.dag_hash() in seen:
dep_dag_hash = dep.dag_hash()
if dep_dag_hash in seen:
continue
seen.add(dep.dag_hash())
records.append(dep.to_node_dict())
records.append(dep.node_dict_with_hashes())
seen.add(dep_dag_hash)
sjson.dump(records, sys.stdout)
@@ -439,6 +443,28 @@ def format_list(specs):
output.flush()
def filter_loaded_specs(specs):
"""Filter a list of specs returning only those that are
currently loaded."""
hashes = os.environ.get(uenv.spack_loaded_hashes_var, '').split(':')
return [x for x in specs if x.dag_hash() in hashes]
def print_how_many_pkgs(specs, pkg_type=""):
"""Given a list of specs, this will print a message about how many
specs are in that list.
Args:
specs (list): depending on how many items are in this list, choose
the plural or singular form of the word "package"
pkg_type (str): the output string will mention this provided
category, e.g. if pkg_type is "installed" then the message
would be "3 installed packages"
"""
tty.msg("%s" % spack.util.string.plural(
len(specs), pkg_type + " package"))
def spack_is_git_repo():
"""Ensure that this instance of Spack is a git clone."""
return is_git_repo(spack.paths.prefix)

View File

@@ -12,7 +12,7 @@
import llnl.util.tty.colify as colify
import llnl.util.tty.color as color
import spack.architecture as architecture
import spack.platforms
description = "print architecture information about this machine"
section = "system"
@@ -20,6 +20,10 @@
def setup_parser(subparser):
subparser.add_argument(
'-g', '--generic-target', action='store_true',
help='show the best generic target'
)
subparser.add_argument(
'--known-targets', action='store_true',
help='show a list of all known targets and exit'
@@ -74,25 +78,32 @@ def display_target_group(header, target_group):
def arch(parser, args):
if args.generic_target:
print(archspec.cpu.host().generic)
return
if args.known_targets:
display_targets(archspec.cpu.TARGETS)
return
os_args, target_args = 'default_os', 'default_target'
if args.frontend:
arch = architecture.Arch(architecture.platform(),
'frontend', 'frontend')
os_args, target_args = 'frontend', 'frontend'
elif args.backend:
arch = architecture.Arch(architecture.platform(),
'backend', 'backend')
else:
arch = architecture.Arch(architecture.platform(),
'default_os', 'default_target')
os_args, target_args = 'backend', 'backend'
host_platform = spack.platforms.host()
host_os = host_platform.operating_system(os_args)
host_target = host_platform.target(target_args)
architecture = spack.spec.ArchSpec(
(str(host_platform), str(host_os), str(host_target))
)
if args.platform:
print(arch.platform)
print(architecture.platform)
elif args.operating_system:
print(arch.os)
print(architecture.os)
elif args.target:
print(arch.target)
print(architecture.target)
else:
print(arch)
print(architecture)

View File

@@ -10,7 +10,6 @@
import llnl.util.tty as tty
import spack.architecture
import spack.binary_distribution as bindist
import spack.cmd
import spack.cmd.common.arguments as arguments
@@ -105,6 +104,9 @@ def setup_parser(subparser):
" instead of default platform and OS")
# This argument is needed by the bootstrapping logic to verify checksums
install.add_argument('--sha256', help=argparse.SUPPRESS)
install.add_argument(
'--only-root', action='store_true', help=argparse.SUPPRESS
)
arguments.add_common_arguments(install, ['specs'])
install.set_defaults(func=installtarball)
@@ -335,9 +337,13 @@ def match_downloaded_specs(pkgs, allow_multiple_matches=False, force=False,
specs_from_cli = []
has_errors = False
specs = bindist.update_cache_and_get_specs()
try:
specs = bindist.update_cache_and_get_specs()
except bindist.FetchCacheError as e:
tty.error(e)
if not other_arch:
arch = spack.architecture.default_arch().to_spec()
arch = spack.spec.Spec.default_arch()
specs = [s for s in specs if s.satisfies(arch)]
for pkg in pkgs:
@@ -531,9 +537,14 @@ def install_tarball(spec, args):
if s.external or s.virtual:
tty.warn("Skipping external or virtual package %s" % spec.format())
return
for d in s.dependencies(deptype=('link', 'run')):
tty.msg("Installing buildcache for dependency spec %s" % d)
install_tarball(d, args)
# This argument is used only for bootstrapping specs without signatures,
# since we need to check the sha256 of each tarball
if not args.only_root:
for d in s.dependencies(deptype=('link', 'run')):
tty.msg("Installing buildcache for dependency spec %s" % d)
install_tarball(d, args)
package = spack.repo.get(spec)
if s.concrete and package.installed and not args.force:
tty.warn("Package for spec %s already installed." % spec.format())
@@ -561,9 +572,13 @@ def install_tarball(spec, args):
def listspecs(args):
"""list binary packages available from mirrors"""
specs = bindist.update_cache_and_get_specs()
try:
specs = bindist.update_cache_and_get_specs()
except bindist.FetchCacheError as e:
tty.error(e)
if not args.allarch:
arch = spack.architecture.default_arch().to_spec()
arch = spack.spec.Spec.default_arch()
specs = [s for s in specs if s.satisfies(arch)]
if args.specs:

View File

@@ -14,6 +14,7 @@
import spack.repo
import spack.stage
import spack.util.crypto
from spack.package import preferred_version
from spack.util.naming import valid_fully_qualified_module_name
from spack.version import Version, ver
@@ -26,9 +27,16 @@ def setup_parser(subparser):
subparser.add_argument(
'--keep-stage', action='store_true',
help="don't clean up staging area when command completes")
subparser.add_argument(
sp = subparser.add_mutually_exclusive_group()
sp.add_argument(
'-b', '--batch', action='store_true',
help="don't ask which versions to checksum")
sp.add_argument(
'-l', '--latest', action='store_true',
help="checksum the latest available version only")
sp.add_argument(
'-p', '--preferred', action='store_true',
help="checksum the preferred version only")
arguments.add_common_arguments(subparser, ['package'])
subparser.add_argument(
'versions', nargs=argparse.REMAINDER,
@@ -48,15 +56,18 @@ def checksum(parser, args):
# Get the package we're going to generate checksums for
pkg = spack.repo.get(args.package)
url_dict = {}
if args.versions:
# If the user asked for specific versions, use those
url_dict = {}
for version in args.versions:
version = ver(version)
if not isinstance(version, Version):
tty.die("Cannot generate checksums for version lists or "
"version ranges. Use unambiguous versions.")
url_dict[version] = pkg.url_for_version(version)
elif args.preferred:
version = preferred_version(pkg)
url_dict = dict([(version, pkg.url_for_version(version))])
else:
# Otherwise, see what versions we can find online
url_dict = pkg.fetch_remote_versions()
@@ -76,7 +87,7 @@ def checksum(parser, args):
version_lines = spack.stage.get_checksums_for_versions(
url_dict, pkg.name, keep_stage=args.keep_stage,
batch=(args.batch or len(args.versions) > 0 or len(url_dict) == 1),
fetch_options=pkg.fetch_options)
latest=args.latest, fetch_options=pkg.fetch_options)
print()
print(version_lines)

View File

@@ -7,6 +7,7 @@
import os
import shutil
import llnl.util.filesystem
import llnl.util.tty as tty
import spack.bootstrap
@@ -14,9 +15,9 @@
import spack.cmd.common.arguments as arguments
import spack.cmd.test
import spack.config
import spack.main
import spack.repo
import spack.stage
import spack.util.path
from spack.paths import lib_path, var_path
description = "remove temporary build files and/or downloaded archives"
@@ -27,7 +28,7 @@
class AllClean(argparse.Action):
"""Activates flags -s -d -f -m and -p simultaneously"""
def __call__(self, parser, namespace, values, option_string=None):
parser.parse_args(['-sdfmpb'], namespace=namespace)
parser.parse_args(['-sdfmp'], namespace=namespace)
def setup_parser(subparser):
@@ -48,9 +49,11 @@ def setup_parser(subparser):
help="remove .pyc, .pyo files and __pycache__ folders")
subparser.add_argument(
'-b', '--bootstrap', action='store_true',
help="remove software needed to bootstrap Spack")
help="remove software and configuration needed to bootstrap Spack")
subparser.add_argument(
'-a', '--all', action=AllClean, help="equivalent to -sdfmpb", nargs=0
'-a', '--all', action=AllClean,
help="equivalent to -sdfmp (does not include --bootstrap)",
nargs=0
)
arguments.add_common_arguments(subparser, ['specs'])
@@ -73,7 +76,11 @@ def clean(parser, args):
if args.stage:
tty.msg('Removing all temporary build stages')
spack.stage.purge()
# Temp directory where buildcaches are extracted
extract_tmp = os.path.join(spack.store.layout.root, '.tmp')
if os.path.exists(extract_tmp):
tty.debug('Removing {0}'.format(extract_tmp))
shutil.rmtree(extract_tmp)
if args.downloads:
tty.msg('Removing cached downloads')
spack.caches.fetch_cache.destroy()
@@ -102,8 +109,9 @@ def clean(parser, args):
shutil.rmtree(dname)
if args.bootstrap:
msg = 'Removing software in "{0}"'
tty.msg(msg.format(spack.bootstrap.store_path()))
with spack.bootstrap.ensure_bootstrap_configuration():
uninstall = spack.main.SpackCommand('uninstall')
uninstall('-a', '-y')
bootstrap_prefix = spack.util.path.canonicalize_path(
spack.config.get('bootstrap:root')
)
msg = 'Removing bootstrapped software and configuration in "{0}"'
tty.msg(msg.format(bootstrap_prefix))
llnl.util.filesystem.remove_directory_contents(bootstrap_prefix)

View File

@@ -69,7 +69,7 @@ def _specs(self, **kwargs):
# If an environment is provided, we'll restrict the search to
# only its installed packages.
env = ev._active_environment
env = ev.active_environment()
if env:
kwargs['hashes'] = set(env.all_hashes())
@@ -320,3 +320,11 @@ def add_cdash_args(subparser, add_help):
default=None,
help=cdash_help['buildstamp']
)
@arg
def reuse():
return Args(
'--reuse', action='store_true', default=False,
help='reuse installed dependencies'
)

View File

@@ -18,7 +18,6 @@
import spack.compilers
import spack.config
import spack.spec
from spack.spec import ArchSpec, CompilerSpec
description = "manage compilers"
section = "system"
@@ -78,24 +77,13 @@ def compiler_find(args):
# None signals spack.compiler.find_compilers to use its default logic
paths = args.add_paths or None
# Don't initialize compilers config via compilers.get_compiler_config.
# Just let compiler_find do the
# entire process and return an empty config from all_compilers
# Default for any other process is init_config=True
compilers = [c for c in spack.compilers.find_compilers(paths)]
new_compilers = []
for c in compilers:
arch_spec = ArchSpec((None, c.operating_system, c.target))
same_specs = spack.compilers.compilers_for_spec(
c.spec, arch_spec, init_config=False)
if not same_specs:
new_compilers.append(c)
# Below scope=None because we want new compilers that don't appear
# in any other configuration.
new_compilers = spack.compilers.find_new_compilers(paths, scope=None)
if new_compilers:
spack.compilers.add_compilers_to_config(new_compilers,
scope=args.scope,
init_config=False)
spack.compilers.add_compilers_to_config(
new_compilers, scope=args.scope, init_config=False
)
n = len(new_compilers)
s = 's' if n > 1 else ''
@@ -110,7 +98,7 @@ def compiler_find(args):
def compiler_remove(args):
cspec = CompilerSpec(args.compiler_spec)
cspec = spack.spec.CompilerSpec(args.compiler_spec)
compilers = spack.compilers.compilers_for_spec(cspec, scope=args.scope)
if not compilers:
tty.die("No compilers match spec %s" % cspec)
@@ -128,7 +116,7 @@ def compiler_remove(args):
def compiler_info(args):
"""Print info about all compilers matching a spec."""
cspec = CompilerSpec(args.compiler_spec)
cspec = spack.spec.CompilerSpec(args.compiler_spec)
compilers = spack.compilers.compilers_for_spec(cspec, scope=args.scope)
if not compilers:

View File

@@ -4,6 +4,7 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import spack.cmd
import spack.cmd.common.arguments
import spack.environment as ev
description = 'concretize an environment and write a lockfile'
@@ -12,6 +13,7 @@
def setup_parser(subparser):
spack.cmd.common.arguments.add_common_arguments(subparser, ['reuse'])
subparser.add_argument(
'-f', '--force', action='store_true',
help="Re-concretize even if already concretized.")
@@ -34,6 +36,8 @@ def concretize(parser, args):
tests = False
with env.write_transaction():
concretized_specs = env.concretize(force=args.force, tests=tests)
concretized_specs = env.concretize(
force=args.force, tests=tests, reuse=args.reuse
)
ev.display_specs(concretized_specs)
env.write()

View File

@@ -143,7 +143,10 @@ def config_get(args):
"""
scope, section = _get_scope_and_section(args)
if scope and scope.startswith('env:'):
if section is not None:
spack.config.config.print_section(section)
elif scope and scope.startswith('env:'):
config_file = spack.config.config.get_config_filename(scope, section)
if os.path.exists(config_file):
with open(config_file) as f:
@@ -151,9 +154,6 @@ def config_get(args):
else:
tty.die('environment has no %s file' % ev.manifest_name)
elif section is not None:
spack.config.config.print_section(section)
else:
tty.die('`spack config get` requires a section argument '
'or an active environment.')
@@ -170,12 +170,19 @@ def config_edit(args):
With no arguments and an active environment, edit the spack.yaml for
the active environment.
"""
scope, section = _get_scope_and_section(args)
if not scope and not section:
tty.die('`spack config edit` requires a section argument '
'or an active environment.')
spack_env = os.environ.get(ev.spack_env_var)
if spack_env and not args.scope:
# Don't use the scope object for envs, as `config edit` can be called
# for a malformed environment. Use SPACK_ENV to find spack.yaml.
config_file = ev.manifest_file(spack_env)
else:
# If we aren't editing a spack.yaml file, get config path from scope.
scope, section = _get_scope_and_section(args)
if not scope and not section:
tty.die('`spack config edit` requires a section argument '
'or an active environment.')
config_file = spack.config.config.get_config_filename(scope, section)
config_file = spack.config.config.get_config_filename(scope, section)
if args.print_file:
print(config_file)
else:
@@ -426,7 +433,8 @@ def config_prefer_upstream(args):
or var_name not in spec.package.variants):
continue
if variant.value != spec.package.variants[var_name].default:
variant_desc, _ = spec.package.variants[var_name]
if variant.value != variant_desc.default:
variants.append(str(variant))
variants.sort()
variants = ' '.join(variants)

View File

@@ -5,7 +5,10 @@
import os
import os.path
import llnl.util.tty
import spack.container
import spack.container.images
import spack.monitor
description = ("creates recipes to build images for different"
@@ -16,9 +19,26 @@
def setup_parser(subparser):
monitor_group = spack.monitor.get_monitor_group(subparser) # noqa
subparser.add_argument(
'--list-os', action='store_true', default=False,
help='list all the OS that can be used in the bootstrap phase and exit'
)
subparser.add_argument(
'--last-stage',
choices=('bootstrap', 'build', 'final'),
default='final',
help='last stage in the container recipe'
)
def containerize(parser, args):
if args.list_os:
possible_os = spack.container.images.all_bootstrap_os()
msg = 'The following operating systems can be used to bootstrap Spack:'
msg += '\n{0}'.format(' '.join(possible_os))
llnl.util.tty.msg(msg)
return
config_dir = args.env_dir or os.getcwd()
config_file = os.path.abspath(os.path.join(config_dir, 'spack.yaml'))
if not os.path.exists(config_file):
@@ -29,10 +49,12 @@ def containerize(parser, args):
# If we have a monitor request, add monitor metadata to config
if args.use_monitor:
config['spack']['monitor'] = {"disable_auth": args.monitor_disable_auth,
"host": args.monitor_host,
"keep_going": args.monitor_keep_going,
"prefix": args.monitor_prefix,
"tags": args.monitor_tags}
recipe = spack.container.recipe(config)
config['spack']['monitor'] = {
"disable_auth": args.monitor_disable_auth,
"host": args.monitor_host,
"keep_going": args.monitor_keep_going,
"prefix": args.monitor_prefix,
"tags": args.monitor_tags
}
recipe = spack.container.recipe(config, last_phase=args.last_stage)
print(recipe)

View File

@@ -14,9 +14,9 @@
import llnl.util.tty as tty
from llnl.util.filesystem import working_dir
import spack.architecture as architecture
import spack.config
import spack.paths
import spack.platforms
from spack.main import get_version
from spack.util.executable import which
@@ -87,10 +87,15 @@ def create_db_tarball(args):
def report(args):
host_platform = spack.platforms.host()
host_os = host_platform.operating_system('frontend')
host_target = host_platform.target('frontend')
architecture = spack.spec.ArchSpec(
(str(host_platform), str(host_os), str(host_target))
)
print('* **Spack:**', get_version())
print('* **Python:**', platform.python_version())
print('* **Platform:**', architecture.Arch(
architecture.platform(), 'frontend', 'frontend'))
print('* **Platform:**', architecture)
print('* **Concretizer:**', spack.config.get('config:concretizer'))

View File

@@ -68,8 +68,8 @@ def compare_specs(a, b, to_string=False, color=None):
# Prepare a solver setup to parse differences
setup = asp.SpackSolverSetup()
a_facts = set(t for t in setup.spec_clauses(a, body=True))
b_facts = set(t for t in setup.spec_clauses(b, body=True))
a_facts = set(t for t in setup.spec_clauses(a, body=True, expand_hashes=True))
b_facts = set(t for t in setup.spec_clauses(b, body=True, expand_hashes=True))
# We want to present them to the user as simple key: values
intersect = sorted(a_facts.intersection(b_facts))

View File

@@ -6,6 +6,7 @@
import os
import shutil
import sys
import tempfile
import llnl.util.filesystem as fs
import llnl.util.tty as tty
@@ -19,8 +20,10 @@
import spack.cmd.uninstall
import spack.config
import spack.environment as ev
import spack.environment.shell
import spack.schema.env
import spack.util.string as string
from spack.util.environment import EnvironmentModifications
description = "manage virtual environments"
section = "environments"
@@ -68,23 +71,38 @@ def env_activate_setup_parser(subparser):
const=False, default=True,
help="do not update PATH etc. with associated view")
subparser.add_argument(
'-d', '--dir', action='store_true', default=False,
help="force spack to treat env as a directory, not a name")
subparser.add_argument(
'-p', '--prompt', action='store_true', default=False,
help="decorate the command line prompt when activating")
subparser.add_argument(
metavar='env', dest='activate_env',
env_options = subparser.add_mutually_exclusive_group()
env_options.add_argument(
'--temp', action='store_true', default=False,
help='create and activate an environment in a temporary directory')
env_options.add_argument(
'-d', '--dir', default=None,
help="activate the environment in this directory")
env_options.add_argument(
metavar='env', dest='activate_env', nargs='?', default=None,
help='name of environment to activate')
def create_temp_env_directory():
"""
Returns the path of a temporary directory in which to
create an environment
"""
return tempfile.mkdtemp(prefix="spack-")
def env_activate(args):
env = args.activate_env
if not args.activate_env and not args.dir and not args.temp:
tty.die('spack env activate requires an environment name, directory, or --temp')
if not args.shell:
spack.cmd.common.shell_init_instructions(
"spack env activate",
" eval `spack env activate {sh_arg} %s`" % env,
" eval `spack env activate {sh_arg} [...]`",
)
return 1
@@ -93,27 +111,50 @@ def env_activate(args):
tty.die('Calling spack env activate with --env, --env-dir and --no-env '
'is ambiguous')
if ev.exists(env) and not args.dir:
spack_env = ev.root(env)
short_name = env
env_prompt = '[%s]' % env
env_name_or_dir = args.activate_env or args.dir
elif ev.is_env_dir(env):
spack_env = os.path.abspath(env)
short_name = os.path.basename(os.path.abspath(env))
env_prompt = '[%s]' % short_name
# Temporary environment
if args.temp:
env = create_temp_env_directory()
env_path = os.path.abspath(env)
short_name = os.path.basename(env_path)
ev.Environment(env).write(regenerate=False)
# Named environment
elif ev.exists(env_name_or_dir) and not args.dir:
env_path = ev.root(env_name_or_dir)
short_name = env_name_or_dir
# Environment directory
elif ev.is_env_dir(env_name_or_dir):
env_path = os.path.abspath(env_name_or_dir)
short_name = os.path.basename(env_path)
else:
tty.die("No such environment: '%s'" % env)
tty.die("No such environment: '%s'" % env_name_or_dir)
if spack_env == os.environ.get('SPACK_ENV'):
tty.debug("Environment %s is already active" % args.activate_env)
return
env_prompt = '[%s]' % short_name
cmds = ev.activate(
ev.Environment(spack_env), add_view=args.with_view, shell=args.shell,
# We only support one active environment at a time, so deactivate the current one.
if ev.active_environment() is None:
cmds = ''
env_mods = EnvironmentModifications()
else:
cmds = spack.environment.shell.deactivate_header(shell=args.shell)
env_mods = spack.environment.shell.deactivate()
# Activate new environment
active_env = ev.Environment(env_path)
cmds += spack.environment.shell.activate_header(
env=active_env,
shell=args.shell,
prompt=env_prompt if args.prompt else None
)
env_mods.extend(spack.environment.shell.activate(
env=active_env,
add_view=args.with_view
))
cmds += env_mods.shell_modifications(args.shell)
sys.stdout.write(cmds)
@@ -147,10 +188,12 @@ def env_deactivate(args):
tty.die('Calling spack env deactivate with --env, --env-dir and --no-env '
'is ambiguous')
if 'SPACK_ENV' not in os.environ:
if ev.active_environment() is None:
tty.die('No environment is currently active.')
cmds = ev.deactivate(shell=args.shell)
cmds = spack.environment.shell.deactivate_header(args.shell)
env_mods = spack.environment.shell.deactivate()
cmds += env_mods.shell_modifications(args.shell)
sys.stdout.write(cmds)

View File

@@ -5,23 +5,17 @@
from __future__ import print_function
import argparse
import os
import re
import sys
from collections import defaultdict, namedtuple
import six
import llnl.util.filesystem
import llnl.util.tty as tty
import llnl.util.tty.colify as colify
import spack
import spack.cmd
import spack.cmd.common.arguments
import spack.detection
import spack.error
import spack.util.environment
import spack.util.spack_yaml as syaml
description = "manage external packages in Spack configuration"
section = "config"
@@ -53,104 +47,6 @@ def setup_parser(subparser):
)
def is_executable(path):
return os.path.isfile(path) and os.access(path, os.X_OK)
def _get_system_executables():
"""Get the paths of all executables available from the current PATH.
For convenience, this is constructed as a dictionary where the keys are
the executable paths and the values are the names of the executables
(i.e. the basename of the executable path).
There may be multiple paths with the same basename. In this case it is
assumed there are two different instances of the executable.
"""
path_hints = spack.util.environment.get_path('PATH')
search_paths = llnl.util.filesystem.search_paths_for_executables(
*path_hints)
path_to_exe = {}
# Reverse order of search directories so that an exe in the first PATH
# entry overrides later entries
for search_path in reversed(search_paths):
for exe in os.listdir(search_path):
exe_path = os.path.join(search_path, exe)
if is_executable(exe_path):
path_to_exe[exe_path] = exe
return path_to_exe
ExternalPackageEntry = namedtuple(
'ExternalPackageEntry',
['spec', 'base_dir'])
def _generate_pkg_config(external_pkg_entries):
"""Generate config according to the packages.yaml schema for a single
package.
This does not generate the entire packages.yaml. For example, given some
external entries for the CMake package, this could return::
{
'externals': [{
'spec': 'cmake@3.17.1',
'prefix': '/opt/cmake-3.17.1/'
}, {
'spec': 'cmake@3.16.5',
'prefix': '/opt/cmake-3.16.5/'
}]
}
"""
pkg_dict = syaml.syaml_dict()
pkg_dict['externals'] = []
for e in external_pkg_entries:
if not _spec_is_valid(e.spec):
continue
external_items = [('spec', str(e.spec)), ('prefix', e.base_dir)]
if e.spec.external_modules:
external_items.append(('modules', e.spec.external_modules))
if e.spec.extra_attributes:
external_items.append(
('extra_attributes',
syaml.syaml_dict(e.spec.extra_attributes.items()))
)
# external_items.extend(e.spec.extra_attributes.items())
pkg_dict['externals'].append(
syaml.syaml_dict(external_items)
)
return pkg_dict
def _spec_is_valid(spec):
try:
str(spec)
except spack.error.SpackError:
# It is assumed here that we can at least extract the package name from
# the spec so we can look up the implementation of
# determine_spec_details
tty.warn('Constructed spec for {0} does not have a string'
' representation'.format(spec.name))
return False
try:
spack.spec.Spec(str(spec))
except spack.error.SpackError:
tty.warn('Constructed spec has a string representation but the string'
' representation does not evaluate to a valid spec: {0}'
.format(str(spec)))
return False
return True
def external_find(args):
# Construct the list of possible packages to be detected
packages_to_check = []
@@ -176,9 +72,9 @@ def external_find(args):
if not args.tags and not packages_to_check:
packages_to_check = spack.repo.path.all_packages()
pkg_to_entries = _get_external_packages(packages_to_check)
new_entries = _update_pkg_config(
args.scope, pkg_to_entries, args.not_buildable
detected_packages = spack.detection.by_executable(packages_to_check)
new_entries = spack.detection.update_configuration(
detected_packages, scope=args.scope, buildable=not args.not_buildable
)
if new_entries:
path = spack.config.config.get_config_filename(args.scope, 'packages')
@@ -190,163 +86,6 @@ def external_find(args):
tty.msg('No new external packages detected')
def _group_by_prefix(paths):
groups = defaultdict(set)
for p in paths:
groups[os.path.dirname(p)].add(p)
return groups.items()
def _convert_to_iterable(single_val_or_multiple):
x = single_val_or_multiple
if x is None:
return []
elif isinstance(x, six.string_types):
return [x]
elif isinstance(x, spack.spec.Spec):
# Specs are iterable, but a single spec should be converted to a list
return [x]
try:
iter(x)
return x
except TypeError:
return [x]
def _determine_base_dir(prefix):
# Given a prefix where an executable is found, assuming that prefix ends
# with /bin/, strip off the 'bin' directory to get a Spack-compatible
# prefix
assert os.path.isdir(prefix)
if os.path.basename(prefix) == 'bin':
return os.path.dirname(prefix)
def _get_predefined_externals():
# Pull from all scopes when looking for preexisting external package
# entries
pkg_config = spack.config.get('packages')
already_defined_specs = set()
for pkg_name, per_pkg_cfg in pkg_config.items():
for item in per_pkg_cfg.get('externals', []):
already_defined_specs.add(spack.spec.Spec(item['spec']))
return already_defined_specs
def _update_pkg_config(scope, pkg_to_entries, not_buildable):
predefined_external_specs = _get_predefined_externals()
pkg_to_cfg, all_new_specs = {}, []
for pkg_name, ext_pkg_entries in pkg_to_entries.items():
new_entries = list(
e for e in ext_pkg_entries
if (e.spec not in predefined_external_specs))
pkg_config = _generate_pkg_config(new_entries)
all_new_specs.extend([
spack.spec.Spec(x['spec']) for x in pkg_config.get('externals', [])
])
if not_buildable:
pkg_config['buildable'] = False
pkg_to_cfg[pkg_name] = pkg_config
pkgs_cfg = spack.config.get('packages', scope=scope)
pkgs_cfg = spack.config.merge_yaml(pkgs_cfg, pkg_to_cfg)
spack.config.set('packages', pkgs_cfg, scope=scope)
return all_new_specs
def _get_external_packages(packages_to_check, system_path_to_exe=None):
if not system_path_to_exe:
system_path_to_exe = _get_system_executables()
exe_pattern_to_pkgs = defaultdict(list)
for pkg in packages_to_check:
if hasattr(pkg, 'executables'):
for exe in pkg.executables:
exe_pattern_to_pkgs[exe].append(pkg)
pkg_to_found_exes = defaultdict(set)
for exe_pattern, pkgs in exe_pattern_to_pkgs.items():
compiled_re = re.compile(exe_pattern)
for path, exe in system_path_to_exe.items():
if compiled_re.search(exe):
for pkg in pkgs:
pkg_to_found_exes[pkg].add(path)
pkg_to_entries = defaultdict(list)
resolved_specs = {} # spec -> exe found for the spec
for pkg, exes in pkg_to_found_exes.items():
if not hasattr(pkg, 'determine_spec_details'):
tty.warn("{0} must define 'determine_spec_details' in order"
" for Spack to detect externally-provided instances"
" of the package.".format(pkg.name))
continue
# TODO: iterate through this in a predetermined order (e.g. by package
# name) to get repeatable results when there are conflicts. Note that
# if we take the prefixes returned by _group_by_prefix, then consider
# them in the order that they appear in PATH, this should be sufficient
# to get repeatable results.
for prefix, exes_in_prefix in _group_by_prefix(exes):
# TODO: multiple instances of a package can live in the same
# prefix, and a package implementation can return multiple specs
# for one prefix, but without additional details (e.g. about the
# naming scheme which differentiates them), the spec won't be
# usable.
specs = _convert_to_iterable(
pkg.determine_spec_details(prefix, exes_in_prefix))
if not specs:
tty.debug(
'The following executables in {0} were decidedly not '
'part of the package {1}: {2}'
.format(prefix, pkg.name, ', '.join(
_convert_to_iterable(exes_in_prefix)))
)
for spec in specs:
pkg_prefix = _determine_base_dir(prefix)
if not pkg_prefix:
tty.debug("{0} does not end with a 'bin/' directory: it"
" cannot be added as a Spack package"
.format(prefix))
continue
if spec in resolved_specs:
prior_prefix = ', '.join(
_convert_to_iterable(resolved_specs[spec]))
tty.debug(
"Executables in {0} and {1} are both associated"
" with the same spec {2}"
.format(prefix, prior_prefix, str(spec)))
continue
else:
resolved_specs[spec] = prefix
try:
spec.validate_detection()
except Exception as e:
msg = ('"{0}" has been detected on the system but will '
'not be added to packages.yaml [reason={1}]')
tty.warn(msg.format(spec, str(e)))
continue
if spec.external_path:
pkg_prefix = spec.external_path
pkg_to_entries[pkg.name].append(
ExternalPackageEntry(spec=spec, base_dir=pkg_prefix))
return pkg_to_entries
def external_list(args):
# Trigger a read of all packages, might take a long time.
list(spack.repo.path.all_packages())

View File

@@ -76,10 +76,6 @@ def fetch(parser, args):
if args.missing and package.installed:
continue
# Do not attempt to fetch externals (they're local)
if package.spec.external:
continue
package.do_fetch()
package = spack.repo.get(spec)

View File

@@ -6,7 +6,6 @@
from __future__ import print_function
import copy
import os
import sys
import llnl.util.lang
@@ -18,9 +17,7 @@
import spack.cmd.common.arguments as arguments
import spack.environment as ev
import spack.repo
import spack.user_environment as uenv
from spack.database import InstallStatuses
from spack.util.string import plural
description = "list and search installed packages"
section = "basic"
@@ -241,8 +238,7 @@ def _find(parser, args):
results = [x for x in results if x.name in packages_with_tags]
if args.loaded:
hashes = os.environ.get(uenv.spack_loaded_hashes_var, '').split(':')
results = [x for x in results if x.dag_hash() in hashes]
results = spack.cmd.filter_loaded_specs(results)
# Display the result
if args.json:
@@ -251,7 +247,10 @@ def _find(parser, args):
if not args.format:
if env:
display_env(env, args, decorator)
if sys.stdout.isatty() and args.groups:
tty.msg("%s" % plural(len(results), 'installed package'))
pkg_type = "loaded" if args.loaded else "installed"
spack.cmd.print_how_many_pkgs(results, pkg_type)
cmd.display_specs(
results, args, decorator=decorator, all_headers=True)

View File

@@ -17,6 +17,7 @@
import spack.fetch_strategy as fs
import spack.repo
import spack.spec
from spack.package import preferred_version
description = 'get detailed information on a particular package'
section = 'basic'
@@ -56,7 +57,7 @@ def variant(s):
class VariantFormatter(object):
def __init__(self, variants):
self.variants = variants
self.headers = ('Name [Default]', 'Allowed values', 'Description')
self.headers = ('Name [Default]', 'When', 'Allowed values', 'Description')
# Formats
fmt_name = '{0} [{1}]'
@@ -67,9 +68,11 @@ def __init__(self, variants):
self.column_widths = [len(x) for x in self.headers]
# Expand columns based on max line lengths
for k, v in variants.items():
for k, e in variants.items():
v, w = e
candidate_max_widths = (
len(fmt_name.format(k, self.default(v))), # Name [Default]
len(str(w)),
len(v.allowed_values), # Allowed values
len(v.description) # Description
)
@@ -77,26 +80,29 @@ def __init__(self, variants):
self.column_widths = (
max(self.column_widths[0], candidate_max_widths[0]),
max(self.column_widths[1], candidate_max_widths[1]),
max(self.column_widths[2], candidate_max_widths[2])
max(self.column_widths[2], candidate_max_widths[2]),
max(self.column_widths[3], candidate_max_widths[3])
)
# Don't let name or possible values be less than max widths
_, cols = tty.terminal_size()
max_name = min(self.column_widths[0], 30)
max_vals = min(self.column_widths[1], 20)
max_when = min(self.column_widths[1], 30)
max_vals = min(self.column_widths[2], 20)
# allow the description column to extend as wide as the terminal.
max_description = min(
self.column_widths[2],
self.column_widths[3],
# min width 70 cols, 14 cols of margins and column spacing
max(cols, 70) - max_name - max_vals - 14,
)
self.column_widths = (max_name, max_vals, max_description)
self.column_widths = (max_name, max_when, max_vals, max_description)
# Compute the format
self.fmt = "%%-%ss%%-%ss%%s" % (
self.fmt = "%%-%ss%%-%ss%%-%ss%%s" % (
self.column_widths[0] + 4,
self.column_widths[1] + 4
self.column_widths[1] + 4,
self.column_widths[2] + 4
)
def default(self, v):
@@ -114,21 +120,27 @@ def lines(self):
underline = tuple([w * "=" for w in self.column_widths])
yield ' ' + self.fmt % underline
yield ''
for k, v in sorted(self.variants.items()):
for k, e in sorted(self.variants.items()):
v, w = e
name = textwrap.wrap(
'{0} [{1}]'.format(k, self.default(v)),
width=self.column_widths[0]
)
if len(w) == 1:
w = w[0]
if w == spack.spec.Spec():
w = '--'
when = textwrap.wrap(str(w), width=self.column_widths[1])
allowed = v.allowed_values.replace('True, False', 'on, off')
allowed = textwrap.wrap(allowed, width=self.column_widths[1])
allowed = textwrap.wrap(allowed, width=self.column_widths[2])
description = []
for d_line in v.description.split('\n'):
description += textwrap.wrap(
d_line,
width=self.column_widths[2]
width=self.column_widths[3]
)
for t in zip_longest(
name, allowed, description, fillvalue=''
name, when, allowed, description, fillvalue=''
):
yield " " + self.fmt % t
@@ -191,29 +203,38 @@ def print_text_info(pkg):
color.cprint('')
color.cprint(section_title('Safe versions: '))
color.cprint(version(' None'))
color.cprint('')
color.cprint(section_title('Deprecated versions: '))
color.cprint(version(' None'))
else:
pad = padder(pkg.versions, 4)
# Here we sort first on the fact that a version is marked
# as preferred in the package, then on the fact that the
# version is not develop, then lexicographically
key_fn = lambda v: (pkg.versions[v].get('preferred', False),
not v.isdevelop(),
v)
preferred = sorted(pkg.versions, key=key_fn).pop()
preferred = preferred_version(pkg)
url = ''
if pkg.has_code:
url = fs.for_package_version(pkg, preferred)
line = version(' {0}'.format(pad(preferred))) + color.cescape(url)
color.cprint(line)
color.cprint('')
color.cprint(section_title('Safe versions: '))
safe = []
deprecated = []
for v in reversed(sorted(pkg.versions)):
if not pkg.versions[v].get('deprecated', False):
if pkg.has_code:
url = fs.for_package_version(pkg, v)
if pkg.has_code:
url = fs.for_package_version(pkg, v)
if pkg.versions[v].get('deprecated', False):
deprecated.append((v, url))
else:
safe.append((v, url))
for title, vers in [('Safe', safe), ('Deprecated', deprecated)]:
color.cprint('')
color.cprint(section_title('{0} versions: '.format(title)))
if not vers:
color.cprint(version(' None'))
continue
for v, url in vers:
line = version(' {0}'.format(pad(v))) + color.cescape(url)
color.cprint(line)
@@ -222,7 +243,7 @@ def print_text_info(pkg):
formatter = VariantFormatter(pkg.variants)
for line in formatter.lines:
color.cprint(line)
color.cprint(color.cescape(line))
if hasattr(pkg, 'phases') and pkg.phases:
color.cprint('')

View File

@@ -78,7 +78,7 @@ def setup_parser(subparser):
subparser.add_argument(
'-u', '--until', type=str, dest='until', default=None,
help="phase to stop after when installing (default None)")
arguments.add_common_arguments(subparser, ['jobs'])
arguments.add_common_arguments(subparser, ['jobs', 'reuse'])
subparser.add_argument(
'--overwrite', action='store_true',
help="reinstall an existing spec, even if it has dependents")
@@ -338,7 +338,7 @@ def get_tests(specs):
if not args.only_concrete:
with env.write_transaction():
concretized_specs = env.concretize(tests=tests)
concretized_specs = env.concretize(tests=tests, reuse=args.reuse)
ev.display_specs(concretized_specs)
# save view regeneration for later, so that we only do it
@@ -392,7 +392,8 @@ def get_tests(specs):
try:
specs = spack.cmd.parse_specs(
args.spec, concretize=True, tests=tests)
args.spec, concretize=True, tests=tests, reuse=args.reuse
)
except SpackError as e:
tty.debug(e)
reporter.concretization_report(e.message)

View File

@@ -16,7 +16,6 @@
import llnl.util.tty as tty
from llnl.util.tty.colify import colify
import spack.cmd.common.arguments as arguments
import spack.dependency
import spack.repo
from spack.version import VersionList
@@ -57,8 +56,6 @@ def setup_parser(subparser):
'-v', '--virtuals', action='store_true', default=False,
help='include virtual packages in list')
arguments.add_common_arguments(subparser, ['tags'])
def filter_by_name(pkgs, args):
"""
@@ -221,9 +218,13 @@ def head(n, span_id, title, anchor=None):
out.write('<dt>Homepage:</dt>\n')
out.write('<dd><ul class="first last simple">\n')
out.write(('<li>'
'<a class="reference external" href="%s">%s</a>'
'</li>\n') % (pkg.homepage, escape(pkg.homepage, True)))
if pkg.homepage:
out.write(('<li>'
'<a class="reference external" href="%s">%s</a>'
'</li>\n') % (pkg.homepage, escape(pkg.homepage, True)))
else:
out.write('No homepage\n')
out.write('</ul></dd>\n')
out.write('<dt>Spack package:</dt>\n')
@@ -273,13 +274,6 @@ def list(parser, args):
# Filter the set appropriately
sorted_packages = filter_by_name(pkgs, args)
# Filter by tags
if args.tags:
packages_with_tags = set(
spack.repo.path.packages_with_tags(*args.tags))
sorted_packages = set(sorted_packages) & packages_with_tags
sorted_packages = sorted(sorted_packages)
if args.update:
# change output stream if user asked for update
if os.path.exists(args.update):

View File

@@ -7,6 +7,7 @@
import spack.cmd
import spack.cmd.common.arguments as arguments
import spack.cmd.find
import spack.environment as ev
import spack.store
import spack.user_environment as uenv
@@ -20,8 +21,7 @@
def setup_parser(subparser):
"""Parser is only constructed so that this prints a nice help
message with -h. """
arguments.add_common_arguments(
subparser, ['recurse_dependencies', 'installed_specs'])
arguments.add_common_arguments(subparser, ['constraint'])
shells = subparser.add_mutually_exclusive_group()
shells.add_argument(
@@ -53,14 +53,29 @@ def setup_parser(subparser):
the dependencies"""
)
subparser.add_argument(
'--list',
action='store_true',
default=False,
help="show loaded packages: same as `spack find --loaded`"
)
def load(parser, args):
env = ev.active_environment()
if args.list:
results = spack.cmd.filter_loaded_specs(args.specs())
if sys.stdout.isatty():
spack.cmd.print_how_many_pkgs(results, "loaded")
spack.cmd.display_specs(results)
return
specs = [spack.cmd.disambiguate_spec(spec, env, first=args.load_first)
for spec in spack.cmd.parse_specs(args.specs)]
for spec in spack.cmd.parse_specs(args.constraint)]
if not args.shell:
specs_str = ' '.join(args.specs) or "SPECS"
specs_str = ' '.join(args.constraint) or "SPECS"
spack.cmd.common.shell_init_instructions(
"spack load",
" eval `spack load {sh_arg} %s`" % specs_str,

View File

@@ -56,8 +56,8 @@ def setup_parser(subparser):
help="build directory for a spec "
"(requires it to be staged first)")
directories.add_argument(
'-e', '--env', action='store', dest='location_env',
help="location of an environment managed by spack")
'-e', '--env', action='store', dest='location_env', nargs='?', metavar="name",
default=False, help="location of the named or current environment")
arguments.add_common_arguments(subparser, ['spec'])
@@ -71,10 +71,17 @@ def location(parser, args):
print(spack.paths.prefix)
return
if args.location_env:
path = ev.root(args.location_env)
if not os.path.isdir(path):
tty.die("no such environment: '%s'" % args.location_env)
# no -e corresponds to False, -e without arg to None, -e name to the string name.
if args.location_env is not False:
if args.location_env is None:
# Get current environment path
spack.cmd.require_active_env('location -e')
path = ev.active_environment().path
else:
# Get named environment path
if not ev.exists(args.location_env):
tty.die("no such environment: '%s'" % args.location_env)
path = ev.root(args.location_env)
print(path)
return

View File

@@ -44,7 +44,8 @@ def setup_parser(subparser):
# Below are arguments w.r.t. spec display (like spack spec)
arguments.add_common_arguments(
subparser, ['long', 'very_long', 'install_status'])
subparser, ['long', 'very_long', 'install_status', 'reuse']
)
subparser.add_argument(
'-y', '--yaml', action='store_const', dest='format', default=None,
const='yaml', help='print concrete spec as yaml')
@@ -103,16 +104,14 @@ def solve(parser, args):
# dump generated ASP program
result = asp.solve(
specs, dump=dump, models=models, timers=args.timers, stats=args.stats
specs, dump=dump, models=models, timers=args.timers, stats=args.stats,
reuse=args.reuse,
)
if 'solutions' not in dump:
return
# die if no solution was found
# TODO: we need to be able to provide better error messages than this
if not result.satisfiable:
result.print_cores()
tty.die("Unsatisfiable spec.")
result.raise_if_unsat()
# dump the solutions as concretized specs
if 'solutions' in dump:
@@ -121,13 +120,21 @@ def solve(parser, args):
tty.msg("Best of %d considered solutions." % result.nmodels)
tty.msg("Optimization Criteria:")
maxlen = max(len(s) for s in result.criteria)
maxlen = max(len(s[2]) for s in result.criteria)
color.cprint(
"@*{ Priority Criterion %sValue}" % ((maxlen - 10) * " ")
"@*{ Priority Criterion %sInstalled ToBuild}" % ((maxlen - 10) * " ")
)
for i, (name, val) in enumerate(zip(result.criteria, opt)):
fmt = " @K{%%-8d} %%-%ds%%5d" % maxlen
color.cprint(fmt % (i + 1, name, val))
fmt = " @K{%%-8d} %%-%ds%%9s %%7s" % maxlen
for i, (idx, build_idx, name) in enumerate(result.criteria, 1):
color.cprint(
fmt % (
i,
name,
"-" if build_idx is None else opt[idx],
opt[idx] if build_idx is None else opt[build_idx],
)
)
print()
for spec in result.specs:

View File

@@ -28,7 +28,8 @@ def setup_parser(subparser):
spack help --spec
"""
arguments.add_common_arguments(
subparser, ['long', 'very_long', 'install_status'])
subparser, ['long', 'very_long', 'install_status', 'reuse']
)
subparser.add_argument(
'-y', '--yaml', action='store_const', dest='format', default=None,
const='yaml', help='print concrete spec as YAML')
@@ -64,7 +65,7 @@ def spec(parser, args):
name_fmt = '{namespace}.{name}' if args.namespaces else '{name}'
fmt = '{@version}{%compiler}{compiler_flags}{variants}{arch=architecture}'
install_status_fn = spack.spec.Spec.install_status
kwargs = {
tree_kwargs = {
'cover': args.cover,
'format': name_fmt + fmt,
'hashlen': None if args.very_long else 7,
@@ -81,11 +82,15 @@ def spec(parser, args):
if not args.specs:
tty.die("spack spec requires at least one spec")
concretize_kwargs = {
'reuse': args.reuse
}
for spec in spack.cmd.parse_specs(args.specs):
# With -y, just print YAML to output.
if args.format:
if spec.name in spack.repo.path or spec.virtual:
spec.concretize()
spec.concretize(**concretize_kwargs)
# The user can specify the hash type to use
hash_type = getattr(ht, args.hash_type)
@@ -98,13 +103,13 @@ def spec(parser, args):
continue
with tree_context():
kwargs['hashes'] = False # Always False for input spec
tree_kwargs['hashes'] = False # Always False for input spec
print("Input spec")
print("--------------------------------")
print(spec.tree(**kwargs))
print(spec.tree(**tree_kwargs))
kwargs['hashes'] = args.long or args.very_long
tree_kwargs['hashes'] = args.long or args.very_long
print("Concretized")
print("--------------------------------")
spec.concretize()
print(spec.tree(**kwargs))
spec.concretize(**concretize_kwargs)
print(spec.tree(**tree_kwargs))

107
lib/spack/spack/cmd/tags.py Normal file
View File

@@ -0,0 +1,107 @@
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import sys
import six
import llnl.util.tty as tty
import llnl.util.tty.colify as colify
import spack.repo
import spack.store
import spack.tag
description = "Show package tags and associated packages"
section = "basic"
level = "long"
def report_tags(category, tags):
buffer = six.StringIO()
isatty = sys.stdout.isatty()
if isatty:
num = len(tags)
fmt = '{0} package tag'.format(category)
buffer.write("{0}:\n".format(spack.util.string.plural(num, fmt)))
if tags:
colify.colify(tags, output=buffer, tty=isatty, indent=4)
else:
buffer.write(" None\n")
print(buffer.getvalue())
def setup_parser(subparser):
subparser.epilog = (
"Tags from known packages will be used if no tags are provided on "
"the command\nline. If tags are provided, packages with at least one "
"will be reported.\n\nYou are not allowed to provide tags and use "
"'--all' at the same time."
)
subparser.add_argument(
'-i', '--installed', action='store_true', default=False,
help="show information for installed packages only"
)
subparser.add_argument(
'-a', '--all', action='store_true', default=False,
help="show packages for all available tags"
)
subparser.add_argument(
'tag',
nargs='*',
help="show packages with the specified tag"
)
def tags(parser, args):
# Disallow combining all option with (positional) tags to avoid confusion
if args.all and args.tag:
tty.die("Use the '--all' option OR provide tag(s) on the command line")
# Provide a nice, simple message if database is empty
if args.installed and not spack.environment.installed_specs():
tty.msg("No installed packages")
return
# unique list of available tags
available_tags = sorted(spack.repo.path.tag_index.keys())
if not available_tags:
tty.msg("No tagged packages")
return
show_packages = args.tag or args.all
# Only report relevant, available tags if no packages are to be shown
if not show_packages:
if not args.installed:
report_tags("available", available_tags)
else:
tag_pkgs = spack.tag.packages_with_tags(available_tags, True, True)
tags = tag_pkgs.keys() if tag_pkgs else []
report_tags("installed", tags)
return
# Report packages associated with tags
buffer = six.StringIO()
isatty = sys.stdout.isatty()
tags = args.tag if args.tag else available_tags
tag_pkgs = spack.tag.packages_with_tags(tags, args.installed, False)
missing = 'No installed packages' if args.installed else 'None'
for tag in sorted(tag_pkgs):
# TODO: Remove the sorting once we're sure noone has an old
# TODO: tag cache since it can accumulate duplicates.
packages = sorted(list(set(tag_pkgs[tag])))
if isatty:
buffer.write("{0}:\n".format(tag))
if packages:
colify.colify(packages, output=buffer, tty=isatty, indent=4)
else:
buffer.write(" {0}\n".format(missing))
buffer.write("\n")
print(buffer.getvalue())

View File

@@ -89,6 +89,12 @@ def setup_parser(subparser):
"-a", "--all", action="store_true", dest="list_all",
help="list all packages with tests (not just installed)")
list_parser.add_argument(
'tag',
nargs='*',
help="limit packages to those with all listed tags"
)
# Find
find_parser = sp.add_parser('find', description=test_find.__doc__,
help=first_line(test_find.__doc__))
@@ -137,6 +143,12 @@ def test_run(args):
If no specs are listed, run tests for all packages in the current
environment or all installed packages if there is no active environment.
"""
if args.alias:
suites = spack.install_test.get_named_test_suites(args.alias)
if suites:
tty.die('Test suite "{0}" already exists. Try another alias.'
.format(args.alias))
# cdash help option
if args.help_cdash:
parser = argparse.ArgumentParser(
@@ -208,15 +220,25 @@ def has_test_method(pkg):
def test_list(args):
"""List installed packages with available tests."""
tagged = set(spack.repo.path.packages_with_tags(*args.tag)) if args.tag \
else set()
def has_test_and_tags(pkg_class):
return has_test_method(pkg_class) and \
(not args.tag or pkg_class.name in tagged)
if args.list_all:
all_packages_with_tests = [
report_packages = [
pkg_class.name
for pkg_class in spack.repo.path.all_package_classes()
if has_test_method(pkg_class)
if has_test_and_tags(pkg_class)
]
if sys.stdout.isatty():
tty.msg("%d packages with tests." % len(all_packages_with_tests))
colify.colify(all_packages_with_tests)
filtered = ' tagged' if args.tag else ''
tty.msg("{0}{1} packages with tests.".
format(len(report_packages), filtered))
colify.colify(report_packages)
return
# TODO: This can be extended to have all of the output formatting options
@@ -225,7 +247,7 @@ def test_list(args):
hashes = env.all_hashes() if env else None
specs = spack.store.db.query(hashes=hashes)
specs = list(filter(lambda s: has_test_method(s.package_class), specs))
specs = list(filter(lambda s: has_test_and_tags(s.package_class), specs))
spack.cmd.display_specs(specs, long=True)

View File

@@ -24,7 +24,7 @@
# tutorial configuration parameters
tutorial_branch = "releases/v0.16"
tutorial_branch = "releases/v%d.%d" % spack.spack_version_info[:2]
tutorial_mirror = "file:///mirror"
tutorial_key = os.path.join(spack.paths.share_path, "keys", "tutorial.pub")

View File

@@ -16,7 +16,6 @@
import llnl.util.tty as tty
from llnl.util.filesystem import path_contains_subdirectory, paths_containing_libs
import spack.architecture
import spack.compilers
import spack.error
import spack.spec

View File

@@ -20,11 +20,11 @@
import llnl.util.lang
import llnl.util.tty as tty
import spack.architecture
import spack.compiler
import spack.config
import spack.error
import spack.paths
import spack.platforms
import spack.spec
from spack.util.environment import get_path
from spack.util.naming import mod_to_class
@@ -192,15 +192,12 @@ def all_compiler_specs(scope=None, init_config=True):
def find_compilers(path_hints=None):
"""Returns the list of compilers found in the paths given as arguments.
"""Return the list of compilers found in the paths given as arguments.
Args:
path_hints (list or None): list of path hints where to look for.
A sensible default based on the ``PATH`` environment variable
will be used if the value is None
Returns:
List of compilers found
"""
if path_hints is None:
path_hints = get_path('PATH')
@@ -242,6 +239,30 @@ def remove_errors(item):
)
def find_new_compilers(path_hints=None, scope=None):
"""Same as ``find_compilers`` but return only the compilers that are not
already in compilers.yaml.
Args:
path_hints (list or None): list of path hints where to look for.
A sensible default based on the ``PATH`` environment variable
will be used if the value is None
scope (str): scope to look for a compiler. If None consider the
merged configuration.
"""
compilers = find_compilers(path_hints)
compilers_not_in_config = []
for c in compilers:
arch_spec = spack.spec.ArchSpec((None, c.operating_system, c.target))
same_specs = compilers_for_spec(
c.spec, arch_spec, scope=scope, init_config=False
)
if not same_specs:
compilers_not_in_config.append(c)
return compilers_not_in_config
def supported_compilers():
"""Return a set of names of compilers supported by Spack.
@@ -289,8 +310,9 @@ def all_compilers(scope=None):
@_auto_compiler_spec
def compilers_for_spec(compiler_spec, arch_spec=None, scope=None,
use_cache=True, init_config=True):
def compilers_for_spec(
compiler_spec, arch_spec=None, scope=None, use_cache=True, init_config=True
):
"""This gets all compilers that satisfy the supplied CompilerSpec.
Returns an empty list if none are found.
"""
@@ -497,7 +519,7 @@ def all_os_classes():
"""
classes = []
platform = spack.architecture.platform()
platform = spack.platforms.host()
for os_class in platform.operating_sys.values():
classes.append(os_class)

View File

@@ -31,10 +31,10 @@
import llnl.util.tty as tty
import spack.abi
import spack.architecture
import spack.compilers
import spack.environment
import spack.error
import spack.platforms
import spack.repo
import spack.spec
import spack.target
@@ -269,7 +269,7 @@ def concretize_architecture(self, spec):
new_plat = spack.platforms.by_name(platform_spec.architecture.platform)
else:
# If no platform anywhere in this spec, grab the default
new_plat = spack.architecture.platform()
new_plat = spack.platforms.host()
# Get nearest spec with relevant platform and an os
# Generally, same algorithm as finding platform, except we only
@@ -384,7 +384,8 @@ def concretize_variants(self, spec):
changed = False
preferred_variants = PackagePrefs.preferred_variants(spec.name)
pkg_cls = spec.package_class
for name, variant in pkg_cls.variants.items():
for name, entry in pkg_cls.variants.items():
variant, when = entry
var = spec.variants.get(name, None)
if var and '*' in var:
# remove variant wildcard before concretizing
@@ -392,12 +393,16 @@ def concretize_variants(self, spec):
# multivalue variant, a concrete variant cannot have the value
# wildcard, and a wildcard does not constrain a variant
spec.variants.pop(name)
if name not in spec.variants:
if name not in spec.variants and any(spec.satisfies(w)
for w in when):
changed = True
if name in preferred_variants:
spec.variants[name] = preferred_variants.get(name)
else:
spec.variants[name] = variant.make_default()
if name in spec.variants and not any(spec.satisfies(w)
for w in when):
raise vt.InvalidVariantForSpecError(name, when, spec)
return changed
@@ -727,12 +732,12 @@ def concretize_specs_together(*abstract_specs, **kwargs):
def _concretize_specs_together_new(*abstract_specs, **kwargs):
import spack.solver.asp
result = spack.solver.asp.solve(abstract_specs)
if not result.satisfiable:
result.print_cores()
tty.die("Unsatisfiable spec.")
concretization_kwargs = {
'tests': kwargs.get('tests', False),
'reuse': kwargs.get('reuse', False)
}
result = spack.solver.asp.solve(abstract_specs, **concretization_kwargs)
result.raise_if_unsat()
return [s.copy() for s in result.specs]
@@ -767,10 +772,15 @@ def make_concretization_repository(abstract_specs):
abstract_specs = [spack.spec.Spec(s) for s in abstract_specs]
concretization_repository = make_concretization_repository(abstract_specs)
concretization_kwargs = {
'tests': kwargs.get('tests', False),
'reuse': kwargs.get('reuse', False)
}
with spack.repo.additional_repository(concretization_repository):
# Spec from a helper package that depends on all the abstract_specs
concretization_root = spack.spec.Spec('concretizationroot')
concretization_root.concretize(tests=kwargs.get('tests', False))
concretization_root.concretize(**concretization_kwargs)
# Retrieve the direct dependencies
concrete_specs = [
concretization_root[spec.name].copy() for spec in abstract_specs

View File

@@ -47,9 +47,9 @@
import llnl.util.tty as tty
from llnl.util.filesystem import mkdirp
import spack.architecture
import spack.compilers
import spack.paths
import spack.platforms
import spack.schema
import spack.schema.bootstrap
import spack.schema.compilers
@@ -84,22 +84,9 @@
all_schemas.update(dict((key, spack.schema.env.schema)
for key in spack.schema.env.keys))
#: Builtin paths to configuration files in Spack
configuration_paths = (
# Default configuration scope is the lowest-level scope. These are
# versioned with Spack and can be overridden by systems, sites or users
('defaults', os.path.join(spack.paths.etc_path, 'spack', 'defaults')),
# System configuration is per machine.
# No system-level configs should be checked into spack by default
('system', os.path.join(spack.paths.system_etc_path, 'spack')),
# Site configuration is per spack instance, for sites or projects
# No site-level configs should be checked into spack by default.
('site', os.path.join(spack.paths.etc_path, 'spack')),
# User configuration can override both spack defaults and site config
('user', spack.paths.user_config_path)
#: Path to the default configuration
configuration_defaults_path = (
'defaults', os.path.join(spack.paths.etc_path, 'spack', 'defaults')
)
#: Hard-coded default values for some key configuration options.
@@ -764,7 +751,7 @@ def override(path_or_scope, value=None):
def _add_platform_scope(cfg, scope_type, name, path):
"""Add a platform-specific subdirectory for the current platform."""
platform = spack.architecture.platform().name
platform = spack.platforms.host().name
plat_name = '%s/%s' % (name, platform)
plat_path = os.path.join(path, platform)
cfg.push_scope(scope_type(plat_name, plat_path))
@@ -803,8 +790,37 @@ def _config():
cfg = Configuration()
# first do the builtin, hardcoded defaults
defaults = InternalConfigScope('_builtin', config_defaults)
cfg.push_scope(defaults)
builtin = InternalConfigScope('_builtin', config_defaults)
cfg.push_scope(builtin)
# Builtin paths to configuration files in Spack
configuration_paths = [
# Default configuration scope is the lowest-level scope. These are
# versioned with Spack and can be overridden by systems, sites or users
configuration_defaults_path,
]
disable_local_config = "SPACK_DISABLE_LOCAL_CONFIG" in os.environ
# System configuration is per machine.
# This is disabled if user asks for no local configuration.
if not disable_local_config:
configuration_paths.append(
('system', spack.paths.system_config_path),
)
# Site configuration is per spack instance, for sites or projects
# No site-level configs should be checked into spack by default.
configuration_paths.append(
('site', os.path.join(spack.paths.etc_path, 'spack')),
)
# User configuration can override both spack defaults and site config
# This is disabled if user asks for no local configuration.
if not disable_local_config:
configuration_paths.append(
('user', spack.paths.user_config_path)
)
# add each scope and its platform-specific directory
for name, path in configuration_paths:
@@ -1051,22 +1067,36 @@ def get_valid_type(path):
path given, the priority order is ``list``, ``dict``, ``str``, ``bool``,
``int``, ``float``.
"""
types = {
'array': list,
'object': syaml.syaml_dict,
'string': str,
'boolean': bool,
'integer': int,
'number': float
}
components = process_config_path(path)
section = components[0]
for type in (list, syaml.syaml_dict, str, bool, int, float):
try:
ret = type()
test_data = ret
for component in reversed(components):
test_data = {component: test_data}
validate(test_data, section_schemas[section])
return ret
except (ConfigFormatError, AttributeError):
# This type won't validate, try the next one
# Except AttributeError because undefined behavior of dict ordering
# in python 3.5 can cause the validator to raise an AttributeError
# instead of a ConfigFormatError.
pass
# Use None to construct the test data
test_data = None
for component in reversed(components):
test_data = {component: test_data}
try:
validate(test_data, section_schemas[section])
except (ConfigFormatError, AttributeError) as e:
jsonschema_error = e.validation_error
if jsonschema_error.validator == 'type':
return types[jsonschema_error.validator_value]()
elif jsonschema_error.validator == 'anyOf':
for subschema in jsonschema_error.validator_value:
anyof_type = subschema.get('type')
if anyof_type is not None:
return types[anyof_type]()
else:
return type(None)
raise ConfigError("Cannot determine valid type for path '%s'." % path)
@@ -1285,6 +1315,7 @@ class ConfigFormatError(ConfigError):
def __init__(self, validation_error, data, filename=None, line=None):
# spack yaml has its own file/line marks -- try to find them
# we prioritize these over the inputs
self.validation_error = validation_error
mark = self._get_mark(validation_error, data)
if mark:
filename = mark.name

View File

@@ -1,6 +1,53 @@
{
"images": {
"alpine:3": {
"bootstrap": {
"template": "container/alpine_3.dockerfile"
},
"os_package_manager": "apk"
},
"amazonlinux:2": {
"bootstrap": {
"template": "container/amazonlinux_2.dockerfile"
},
"os_package_manager": "yum_amazon"
},
"centos:8": {
"bootstrap": {
"template": "container/centos_8.dockerfile"
},
"os_package_manager": "yum"
},
"centos:7": {
"bootstrap": {
"template": "container/centos_7.dockerfile"
},
"os_package_manager": "yum",
"build": "spack/centos7",
"build_tags": {
"develop": "latest"
}
},
"nvidia/cuda:11.2.1": {
"bootstrap": {
"template": "container/cuda_11_2_1.dockerfile",
"image": "nvidia/cuda:11.2.1-devel"
},
"final": {
"image": "nvidia/cuda:11.2.1-base"
},
"os_package_manager": "apt"
},
"ubuntu:20.04": {
"bootstrap": {
"template": "container/ubuntu_2004.dockerfile"
},
"os_package_manager": "apt"
},
"ubuntu:18.04": {
"bootstrap": {
"template": "container/ubuntu_1804.dockerfile"
},
"os_package_manager": "apt",
"build": "spack/ubuntu-bionic",
"build_tags": {
@@ -8,29 +55,22 @@
}
},
"ubuntu:16.04": {
"bootstrap": {
"template": "container/ubuntu_1604.dockerfile"
},
"os_package_manager": "apt",
"build": "spack/ubuntu-xenial",
"build_tags": {
"develop": "latest"
}
},
"centos:7": {
"os_package_manager": "yum",
"environment": [],
"build": "spack/centos7",
"build_tags": {
"develop": "latest"
}
},
"centos:6": {
"os_package_manager": "yum",
"build": "spack/centos6",
"build_tags": {
"develop": "latest"
}
}
},
"os_package_managers": {
"apk": {
"update": "apk update",
"install": "apk add --no-cache",
"clean": "true"
},
"apt": {
"update": "apt-get -yqq update && apt-get -yqq upgrade",
"install": "apt-get -yqq install",
@@ -40,6 +80,11 @@
"update": "yum update -y && yum install -y epel-release && yum update -y",
"install": "yum install -y",
"clean": "rm -rf /var/cache/yum && yum clean all"
},
"yum_amazon": {
"update": "yum update -y && amazon-linux-extras install epel -y",
"install": "yum install -y",
"clean": "rm -rf /var/cache/yum && yum clean all"
}
}
}

View File

@@ -2,9 +2,15 @@
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""Manages the details on the images used in the build and the run stage."""
"""Manages the details on the images used in the various stages."""
import json
import os.path
import sys
import llnl.util.filesystem as fs
import llnl.util.tty as tty
import spack.util.executable as executable
#: Global variable used to cache in memory the content of images.json
_data = None
@@ -39,18 +45,12 @@ def build_info(image, spack_version):
# Don't handle error here, as a wrong image should have been
# caught by the JSON schema
image_data = data()["images"][image]
build_image = image_data['build']
build_image = image_data.get('build', None)
if not build_image:
return None, None
# Try to check if we have a tag for this Spack version
try:
# Translate version from git to docker if necessary
build_tag = image_data['build_tags'].get(spack_version, spack_version)
except KeyError:
msg = ('the image "{0}" has no tag for Spack version "{1}" '
'[valid versions are {2}]')
msg = msg.format(build_image, spack_version,
', '.join(image_data['build_tags'].keys()))
raise ValueError(msg)
# Translate version from git to docker if necessary
build_tag = image_data['build_tags'].get(spack_version, spack_version)
return build_image, build_tag
@@ -70,6 +70,11 @@ def os_package_manager_for(image):
return name
def all_bootstrap_os():
"""Return a list of all the OS that can be used to bootstrap Spack"""
return list(data()['images'])
def commands_for(package_manager):
"""Returns the commands used to update system repositories, install
system packages and clean afterwards.
@@ -82,3 +87,47 @@ def commands_for(package_manager):
"""
info = data()["os_package_managers"][package_manager]
return info['update'], info['install'], info['clean']
def bootstrap_template_for(image):
return data()["images"][image]["bootstrap"]["template"]
def _verify_ref(url, ref, enforce_sha):
# Do a checkout in a temporary directory
msg = 'Cloning "{0}" to verify ref "{1}"'.format(url, ref)
tty.info(msg, stream=sys.stderr)
git = executable.which('git', required=True)
with fs.temporary_dir():
git('clone', '-q', url, '.')
sha = git('rev-parse', '-q', ref + '^{commit}',
output=str, error=os.devnull, fail_on_error=False)
if git.returncode:
msg = '"{0}" is not a valid reference for "{1}"'
raise RuntimeError(msg.format(sha, url))
if enforce_sha:
ref = sha.strip()
return ref
def checkout_command(url, ref, enforce_sha, verify):
"""Return the checkout command to be used in the bootstrap phase.
Args:
url (str): url of the Spack repository
ref (str): either a branch name, a tag or a commit sha
enforce_sha (bool): if true turns every
verify (bool):
"""
url = url or 'https://github.com/spack/spack.git'
ref = ref or 'develop'
enforce_sha, verify = bool(enforce_sha), bool(verify)
# If we want to enforce a sha or verify the ref we need
# to checkout the repository locally
if enforce_sha or verify:
ref = _verify_ref(url, ref, enforce_sha)
command = 'git clone {0} . && git checkout {1} '.format(url, ref)
return command

View File

@@ -12,7 +12,14 @@
import spack.schema.env
import spack.tengine as tengine
import spack.util.spack_yaml as syaml
from spack.container.images import build_info, commands_for, os_package_manager_for
from spack.container.images import (
bootstrap_template_for,
build_info,
checkout_command,
commands_for,
data,
os_package_manager_for,
)
#: Caches all the writers that are currently supported
_writer_factory = {}
@@ -31,23 +38,94 @@ def _decorator(factory):
return _decorator
def create(configuration):
def create(configuration, last_phase=None):
"""Returns a writer that conforms to the configuration passed as input.
Args:
configuration: how to generate the current recipe
configuration (dict): how to generate the current recipe
last_phase (str): last phase to be printed or None to print them all
"""
name = ev.config_dict(configuration)['container']['format']
return _writer_factory[name](configuration)
return _writer_factory[name](configuration, last_phase)
def recipe(configuration):
def recipe(configuration, last_phase=None):
"""Returns a recipe that conforms to the configuration passed as input.
Args:
configuration: how to generate the current recipe
configuration (dict): how to generate the current recipe
last_phase (str): last phase to be printed or None to print them all
"""
return create(configuration)()
return create(configuration, last_phase)()
def _stage_base_images(images_config):
"""Return a tuple with the base images to be used at the various stages.
Args:
images_config (dict): configuration under container:images
"""
# If we have custom base images, just return them verbatim.
build_stage = images_config.get('build', None)
if build_stage:
final_stage = images_config['final']
return None, build_stage, final_stage
# Check the operating system: this will be the base of the bootstrap
# stage, if there, and of the final stage.
operating_system = images_config.get('os', None)
# Check the OS is mentioned in the internal data stored in a JSON file
images_json = data()['images']
if not any(os_name == operating_system for os_name in images_json):
msg = ('invalid operating system name "{0}". '
'[Allowed values are {1}]')
msg = msg.format(operating_system, ', '.join(data()['images']))
raise ValueError(msg)
# Retrieve the build stage
spack_info = images_config['spack']
if isinstance(spack_info, dict):
build_stage = 'bootstrap'
else:
spack_version = images_config['spack']
image_name, tag = build_info(operating_system, spack_version)
build_stage = 'bootstrap'
if image_name:
build_stage = ':'.join([image_name, tag])
# Retrieve the bootstrap stage
bootstrap_stage = None
if build_stage == 'bootstrap':
bootstrap_stage = images_json[operating_system]['bootstrap'].get(
'image', operating_system
)
# Retrieve the final stage
final_stage = images_json[operating_system].get(
'final', {'image': operating_system}
)['image']
return bootstrap_stage, build_stage, final_stage
def _spack_checkout_config(images_config):
spack_info = images_config['spack']
url = 'https://github.com/spack/spack.git'
ref = 'develop'
resolve_sha, verify = False, False
# Config specific values may override defaults
if isinstance(spack_info, dict):
url = spack_info.get('url', url)
ref = spack_info.get('ref', ref)
resolve_sha = spack_info.get('resolve_sha', resolve_sha)
verify = spack_info.get('verify', verify)
else:
ref = spack_info
return url, ref, resolve_sha, verify
class PathContext(tengine.Context):
@@ -55,41 +133,34 @@ class PathContext(tengine.Context):
install software in a common location and make it available
directly via PATH.
"""
def __init__(self, config):
def __init__(self, config, last_phase):
self.config = ev.config_dict(config)
self.container_config = self.config['container']
# Operating system tag as written in the configuration file
self.operating_system_key = self.container_config['images'].get('os')
# Get base images and verify the OS
bootstrap, build, final = _stage_base_images(
self.container_config['images']
)
self.bootstrap_image = bootstrap
self.build_image = build
self.final_image = final
# Record the last phase
self.last_phase = last_phase
@tengine.context_property
def run(self):
"""Information related to the run image."""
images_config = self.container_config['images']
# Check if we have custom images
image = images_config.get('final', None)
# If not use the base OS image
if image is None:
image = images_config['os']
Run = collections.namedtuple('Run', ['image'])
return Run(image=image)
return Run(image=self.final_image)
@tengine.context_property
def build(self):
"""Information related to the build image."""
images_config = self.container_config['images']
# Check if we have custom images
image = images_config.get('build', None)
# If not select the correct build image based on OS and Spack version
if image is None:
operating_system = images_config['os']
spack_version = images_config['spack']
image_name, tag = build_info(operating_system, spack_version)
image = ':'.join([image_name, tag])
Build = collections.namedtuple('Build', ['image'])
return Build(image=image)
return Build(image=self.build_image)
@tengine.context_property
def strip(self):
@@ -213,6 +284,39 @@ def extra_instructions(self):
def labels(self):
return self.container_config.get('labels', {})
@tengine.context_property
def bootstrap(self):
"""Information related to the build image."""
images_config = self.container_config['images']
bootstrap_recipe = None
if self.bootstrap_image:
config_args = _spack_checkout_config(images_config)
command = checkout_command(*config_args)
template_path = bootstrap_template_for(self.operating_system_key)
env = tengine.make_environment()
context = {"bootstrap": {
"image": self.bootstrap_image,
"spack_checkout": command
}}
bootstrap_recipe = env.get_template(template_path).render(**context)
Bootstrap = collections.namedtuple('Bootstrap', ['image', 'recipe'])
return Bootstrap(image=self.bootstrap_image, recipe=bootstrap_recipe)
@tengine.context_property
def render_phase(self):
render_bootstrap = bool(self.bootstrap_image)
render_build = not (self.last_phase == 'bootstrap')
render_final = self.last_phase in (None, 'final')
Render = collections.namedtuple(
'Render', ['bootstrap', 'build', 'final']
)
return Render(
bootstrap=render_bootstrap,
build=render_build,
final=render_final
)
def __call__(self):
"""Returns the recipe as a string"""
env = tengine.make_environment()

View File

@@ -1024,12 +1024,7 @@ def _write(self, type, value, traceback):
raise
def _read(self):
"""Re-read Database from the data in the set location.
This does no locking, with one exception: it will automatically
try to regenerate a missing DB if local. This requires taking a
write lock.
"""
"""Re-read Database from the data in the set location. This does no locking."""
if os.path.isfile(self._index_path):
current_verifier = ''
if _use_uuid:
@@ -1049,12 +1044,6 @@ def _read(self):
"No database index file is present, and upstream"
" databases cannot generate an index file")
# The file doesn't exist, try to traverse the directory.
# reindex() takes its own write lock, so no lock here.
with lk.WriteTransaction(self.lock):
self._write(None, None, None)
self.reindex(spack.store.layout)
def _add(
self,
spec,

View File

@@ -0,0 +1,14 @@
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from .common import DetectedPackage, executable_prefix, update_configuration
from .path import by_executable, executables_in_path
__all__ = [
'DetectedPackage',
'by_executable',
'executables_in_path',
'executable_prefix',
'update_configuration'
]

View File

@@ -0,0 +1,177 @@
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""Define a common data structure to represent external packages and a
function to update packages.yaml given a list of detected packages.
Ideally, each detection method should be placed in a specific subpackage
and implement at least a function that returns a list of DetectedPackage
objects. The update in packages.yaml can then be done using the function
provided here.
The module also contains other functions that might be useful across different
detection mechanisms.
"""
import collections
import os
import os.path
import six
import llnl.util.tty
import spack.config
import spack.spec
import spack.util.spack_yaml
#: Information on a package that has been detected
DetectedPackage = collections.namedtuple(
'DetectedPackage', ['spec', 'prefix']
)
def _externals_in_packages_yaml():
"""Return all the specs mentioned as externals in packages.yaml"""
packages_yaml = spack.config.get('packages')
already_defined_specs = set()
for pkg_name, package_configuration in packages_yaml.items():
for item in package_configuration.get('externals', []):
already_defined_specs.add(spack.spec.Spec(item['spec']))
return already_defined_specs
def _pkg_config_dict(external_pkg_entries):
"""Generate a package specific config dict according to the packages.yaml schema.
This does not generate the entire packages.yaml. For example, given some
external entries for the CMake package, this could return::
{
'externals': [{
'spec': 'cmake@3.17.1',
'prefix': '/opt/cmake-3.17.1/'
}, {
'spec': 'cmake@3.16.5',
'prefix': '/opt/cmake-3.16.5/'
}]
}
"""
pkg_dict = spack.util.spack_yaml.syaml_dict()
pkg_dict['externals'] = []
for e in external_pkg_entries:
if not _spec_is_valid(e.spec):
continue
external_items = [('spec', str(e.spec)), ('prefix', e.prefix)]
if e.spec.external_modules:
external_items.append(('modules', e.spec.external_modules))
if e.spec.extra_attributes:
external_items.append(
('extra_attributes',
spack.util.spack_yaml.syaml_dict(e.spec.extra_attributes.items()))
)
# external_items.extend(e.spec.extra_attributes.items())
pkg_dict['externals'].append(
spack.util.spack_yaml.syaml_dict(external_items)
)
return pkg_dict
def _spec_is_valid(spec):
try:
str(spec)
except spack.error.SpackError:
# It is assumed here that we can at least extract the package name from
# the spec so we can look up the implementation of
# determine_spec_details
msg = 'Constructed spec for {0} does not have a string representation'
llnl.util.tty.warn(msg.format(spec.name))
return False
try:
spack.spec.Spec(str(spec))
except spack.error.SpackError:
llnl.util.tty.warn(
'Constructed spec has a string representation but the string'
' representation does not evaluate to a valid spec: {0}'
.format(str(spec))
)
return False
return True
def is_executable(file_path):
"""Return True if the path passed as argument is that of an executable"""
return os.path.isfile(file_path) and os.access(file_path, os.X_OK)
def _convert_to_iterable(single_val_or_multiple):
x = single_val_or_multiple
if x is None:
return []
elif isinstance(x, six.string_types):
return [x]
elif isinstance(x, spack.spec.Spec):
# Specs are iterable, but a single spec should be converted to a list
return [x]
try:
iter(x)
return x
except TypeError:
return [x]
def executable_prefix(executable_dir):
"""Given a directory where an executable is found, guess the prefix
(i.e. the "root" directory of that installation) and return it.
Args:
executable_dir: directory where an executable is found
"""
# Given a prefix where an executable is found, assuming that prefix
# contains /bin/, strip off the 'bin' directory to get a Spack-compatible
# prefix
assert os.path.isdir(executable_dir)
components = executable_dir.split(os.sep)
if 'bin' not in components:
return None
idx = components.index('bin')
return os.sep.join(components[:idx])
def update_configuration(detected_packages, scope=None, buildable=True):
"""Add the packages passed as arguments to packages.yaml
Args:
detected_packages (list): list of DetectedPackage objects to be added
scope (str): configuration scope where to add the detected packages
buildable (bool): whether the detected packages are buildable or not
"""
predefined_external_specs = _externals_in_packages_yaml()
pkg_to_cfg, all_new_specs = {}, []
for package_name, entries in detected_packages.items():
new_entries = [
e for e in entries if (e.spec not in predefined_external_specs)
]
pkg_config = _pkg_config_dict(new_entries)
all_new_specs.extend([
spack.spec.Spec(x['spec']) for x in pkg_config.get('externals', [])
])
if buildable is False:
pkg_config['buildable'] = False
pkg_to_cfg[package_name] = pkg_config
pkgs_cfg = spack.config.get('packages', scope=scope)
pkgs_cfg = spack.config.merge_yaml(pkgs_cfg, pkg_to_cfg)
spack.config.set('packages', pkgs_cfg, scope=scope)
return all_new_specs

View File

@@ -0,0 +1,149 @@
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""Detection of software installed in the system based on paths inspections
and running executables.
"""
import collections
import os
import os.path
import re
import llnl.util.filesystem
import llnl.util.tty
import spack.util.environment
from .common import (
DetectedPackage,
_convert_to_iterable,
executable_prefix,
is_executable,
)
def executables_in_path(path_hints=None):
"""Get the paths of all executables available from the current PATH.
For convenience, this is constructed as a dictionary where the keys are
the executable paths and the values are the names of the executables
(i.e. the basename of the executable path).
There may be multiple paths with the same basename. In this case it is
assumed there are two different instances of the executable.
Args:
path_hints (list): list of paths to be searched. If None the list will be
constructed based on the PATH environment variable.
"""
path_hints = path_hints or spack.util.environment.get_path('PATH')
search_paths = llnl.util.filesystem.search_paths_for_executables(*path_hints)
path_to_exe = {}
# Reverse order of search directories so that an exe in the first PATH
# entry overrides later entries
for search_path in reversed(search_paths):
for exe in os.listdir(search_path):
exe_path = os.path.join(search_path, exe)
if is_executable(exe_path):
path_to_exe[exe_path] = exe
return path_to_exe
def _group_by_prefix(paths):
groups = collections.defaultdict(set)
for p in paths:
groups[os.path.dirname(p)].add(p)
return groups.items()
def by_executable(packages_to_check, path_hints=None):
"""Return the list of packages that have been detected on the system,
searching by path.
Args:
packages_to_check (list): list of packages to be detected
path_hints (list): list of paths to be searched. If None the list will be
constructed based on the PATH environment variable.
"""
path_to_exe_name = executables_in_path(path_hints=path_hints)
exe_pattern_to_pkgs = collections.defaultdict(list)
for pkg in packages_to_check:
if hasattr(pkg, 'executables'):
for exe in pkg.executables:
exe_pattern_to_pkgs[exe].append(pkg)
pkg_to_found_exes = collections.defaultdict(set)
for exe_pattern, pkgs in exe_pattern_to_pkgs.items():
compiled_re = re.compile(exe_pattern)
for path, exe in path_to_exe_name.items():
if compiled_re.search(exe):
for pkg in pkgs:
pkg_to_found_exes[pkg].add(path)
pkg_to_entries = collections.defaultdict(list)
resolved_specs = {} # spec -> exe found for the spec
for pkg, exes in pkg_to_found_exes.items():
if not hasattr(pkg, 'determine_spec_details'):
llnl.util.tty.warn(
"{0} must define 'determine_spec_details' in order"
" for Spack to detect externally-provided instances"
" of the package.".format(pkg.name))
continue
for prefix, exes_in_prefix in sorted(_group_by_prefix(exes)):
# TODO: multiple instances of a package can live in the same
# prefix, and a package implementation can return multiple specs
# for one prefix, but without additional details (e.g. about the
# naming scheme which differentiates them), the spec won't be
# usable.
specs = _convert_to_iterable(
pkg.determine_spec_details(prefix, exes_in_prefix)
)
if not specs:
llnl.util.tty.debug(
'The following executables in {0} were decidedly not '
'part of the package {1}: {2}'
.format(prefix, pkg.name, ', '.join(
_convert_to_iterable(exes_in_prefix)))
)
for spec in specs:
pkg_prefix = executable_prefix(prefix)
if not pkg_prefix:
msg = "no bin/ dir found in {0}. Cannot add it as a Spack package"
llnl.util.tty.debug(msg.format(prefix))
continue
if spec in resolved_specs:
prior_prefix = ', '.join(
_convert_to_iterable(resolved_specs[spec]))
llnl.util.tty.debug(
"Executables in {0} and {1} are both associated"
" with the same spec {2}"
.format(prefix, prior_prefix, str(spec)))
continue
else:
resolved_specs[spec] = prefix
try:
spec.validate_detection()
except Exception as e:
msg = ('"{0}" has been detected on the system but will '
'not be added to packages.yaml [reason={1}]')
llnl.util.tty.warn(msg.format(spec, str(e)))
continue
if spec.external_path:
pkg_prefix = spec.external_path
pkg_to_entries[pkg.name].append(
DetectedPackage(spec=spec, prefix=pkg_prefix)
)
return pkg_to_entries

View File

@@ -89,6 +89,9 @@ def make_when_spec(value):
value indicating when a directive should be applied.
"""
if isinstance(value, spack.spec.Spec):
return value
# Unsatisfiable conditions are discarded by the caller, and never
# added to the package class
if value is False:
@@ -241,17 +244,23 @@ def _wrapper(*args, **kwargs):
if DirectiveMeta._when_constraints_from_context:
# Check that directives not yet supporting the when= argument
# are not used inside the context manager
if decorated_function.__name__ in ('version', 'variant'):
if decorated_function.__name__ == 'version':
msg = ('directive "{0}" cannot be used within a "when"'
' context since it does not support a "when=" '
'argument')
msg = msg.format(decorated_function.__name__)
raise DirectiveError(msg)
when_spec_from_context = ' '.join(
when_constraints = [
spack.spec.Spec(x) for x in
DirectiveMeta._when_constraints_from_context
]
if kwargs.get('when'):
when_constraints.append(spack.spec.Spec(kwargs['when']))
when_spec = spack.spec.merge_abstract_anonymous_specs(
*when_constraints
)
when_spec = kwargs.get('when', '') + ' ' + when_spec_from_context
kwargs['when'] = when_spec
# If any of the arguments are executors returned by a
@@ -553,7 +562,8 @@ def variant(
description='',
values=None,
multi=None,
validator=None):
validator=None,
when=None):
"""Define a variant for the package. Packager can specify a default
value as well as a text description.
@@ -572,6 +582,8 @@ def variant(
logic. It receives the package name, the variant name and a tuple
of values and should raise an instance of SpackError if the group
doesn't meet the additional constraints
when (spack.spec.Spec, bool): optional condition on which the
variant applies
Raises:
DirectiveError: if arguments passed to the directive are invalid
@@ -631,14 +643,23 @@ def _raise_default_not_set(pkg):
description = str(description).strip()
def _execute_variant(pkg):
when_spec = make_when_spec(when)
when_specs = [when_spec]
if not re.match(spack.spec.identifier_re, name):
directive = 'variant'
msg = "Invalid variant name in {0}: '{1}'"
raise DirectiveError(directive, msg.format(pkg.name, name))
pkg.variants[name] = spack.variant.Variant(
if name in pkg.variants:
# We accumulate when specs, but replace the rest of the variant
# with the newer values
_, orig_when = pkg.variants[name]
when_specs += orig_when
pkg.variants[name] = (spack.variant.Variant(
name, default, description, values, multi, validator
)
), when_specs)
return _execute_variant

View File

@@ -6,6 +6,7 @@
import errno
import glob
import os
import re
import shutil
import tempfile
from contextlib import contextmanager
@@ -88,8 +89,8 @@ def __init__(self, root, **kwargs):
self.manifest_file_name = 'install_manifest.json'
@property
def hidden_file_paths(self):
return (self.metadata_dir,)
def hidden_file_regexes(self):
return (re.escape(self.metadata_dir),)
def relative_path_for_spec(self, spec):
_check_concrete(spec)

View File

@@ -0,0 +1,59 @@
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from .environment import (
Environment,
SpackEnvironmentError,
activate,
active,
active_environment,
all_environment_names,
all_environments,
config_dict,
create,
deactivate,
default_manifest_yaml,
default_view_name,
display_specs,
exists,
installed_specs,
is_env_dir,
is_latest_format,
lockfile_name,
manifest_file,
manifest_name,
no_active_environment,
read,
root,
spack_env_var,
update_yaml,
)
__all__ = [
'Environment',
'SpackEnvironmentError',
'activate',
'active',
'active_environment',
'all_environment_names',
'all_environments',
'config_dict',
'create',
'deactivate',
'default_manifest_yaml',
'default_view_name',
'display_specs',
'exists',
'installed_specs',
'is_env_dir',
'is_latest_format',
'lockfile_name',
'manifest_file',
'manifest_name',
'no_active_environment',
'read',
'root',
'spack_env_var',
'update_yaml',
]

View File

@@ -9,6 +9,7 @@
import re
import shutil
import sys
import time
import ruamel.yaml as yaml
import six
@@ -16,22 +17,27 @@
import llnl.util.filesystem as fs
import llnl.util.tty as tty
from llnl.util.tty.color import colorize
import spack.bootstrap
import spack.compilers
import spack.concretize
import spack.config
import spack.error
import spack.hash_types as ht
import spack.hooks
import spack.paths
import spack.repo
import spack.schema.env
import spack.spec
import spack.stage
import spack.store
import spack.subprocess_context
import spack.user_environment as uenv
import spack.util.cpus
import spack.util.environment
import spack.util.hash
import spack.util.lock as lk
import spack.util.parallel
import spack.util.path
import spack.util.spack_json as sjson
import spack.util.spack_yaml as syaml
@@ -85,7 +91,7 @@
valid_environment_name_re = r'^\w[\w-]*$'
#: version of the lockfile format. Must increase monotonically.
lockfile_format_version = 2
lockfile_format_version = 3
# Magic names
# The name of the standalone spec list in the manifest yaml
@@ -96,6 +102,16 @@
default_view_link = 'all'
def installed_specs():
"""
Returns the specs of packages installed in the active environment or None
if no packages are installed.
"""
env = spack.environment.active_environment()
hashes = env.all_hashes() if env else None
return spack.store.db.query(hashes=hashes)
def valid_env_name(name):
return re.match(valid_environment_name_re, name)
@@ -108,9 +124,7 @@ def validate_env_name(name):
return name
def activate(
env, use_env_repo=False, add_view=True, shell='sh', prompt=None
):
def activate(env, use_env_repo=False):
"""Activate an environment.
To activate an environment, we add its configuration scope to the
@@ -121,148 +135,52 @@ def activate(
env (Environment): the environment to activate
use_env_repo (bool): use the packages exactly as they appear in the
environment's repository
add_view (bool): generate commands to add view to path variables
shell (str): One of `sh`, `csh`, `fish`.
prompt (str): string to add to the users prompt, or None
Returns:
str: Shell commands to activate environment.
TODO: environment to use the activated spack environment.
"""
global _active_environment
_active_environment = env
prepare_config_scope(_active_environment)
# Fail early to avoid ending in an invalid state
if not isinstance(env, Environment):
raise TypeError("`env` should be of type {0}".format(Environment.__name__))
# Check if we need to reinitialize the store due to pushing the configuration
# below.
store_before_pushing = spack.config.get('config:install_tree')
prepare_config_scope(env)
store_after_pushing = spack.config.get('config:install_tree')
if store_before_pushing != store_after_pushing:
# Hack to store the state of the store before activation
env.store_token = spack.store.reinitialize()
if use_env_repo:
spack.repo.path.put_first(_active_environment.repo)
spack.repo.path.put_first(env.repo)
tty.debug("Using environment '%s'" % _active_environment.name)
tty.debug("Using environment '%s'" % env.name)
# Construct the commands to run
cmds = ''
if shell == 'csh':
# TODO: figure out how to make color work for csh
cmds += 'setenv SPACK_ENV %s;\n' % env.path
cmds += 'alias despacktivate "spack env deactivate";\n'
if prompt:
cmds += 'if (! $?SPACK_OLD_PROMPT ) '
cmds += 'setenv SPACK_OLD_PROMPT "${prompt}";\n'
cmds += 'set prompt="%s ${prompt}";\n' % prompt
elif shell == 'fish':
if os.getenv('TERM') and 'color' in os.getenv('TERM') and prompt:
prompt = colorize('@G{%s} ' % prompt, color=True)
cmds += 'set -gx SPACK_ENV %s;\n' % env.path
cmds += 'function despacktivate;\n'
cmds += ' spack env deactivate;\n'
cmds += 'end;\n'
#
# NOTE: We're not changing the fish_prompt function (which is fish's
# solution to the PS1 variable) here. This is a bit fiddly, and easy to
# screw up => spend time reasearching a solution. Feedback welcome.
#
else:
if os.getenv('TERM') and 'color' in os.getenv('TERM') and prompt:
prompt = colorize('@G{%s} ' % prompt, color=True)
cmds += 'export SPACK_ENV=%s;\n' % env.path
cmds += "alias despacktivate='spack env deactivate';\n"
if prompt:
cmds += 'if [ -z ${SPACK_OLD_PS1+x} ]; then\n'
cmds += ' if [ -z ${PS1+x} ]; then\n'
cmds += " PS1='$$$$';\n"
cmds += ' fi;\n'
cmds += ' export SPACK_OLD_PS1="${PS1}";\n'
cmds += 'fi;\n'
cmds += 'export PS1="%s ${PS1}";\n' % prompt
#
# NOTE in the fish-shell: Path variables are a special kind of variable
# used to support colon-delimited path lists including PATH, CDPATH,
# MANPATH, PYTHONPATH, etc. All variables that end in PATH (case-sensitive)
# become PATH variables.
#
try:
if add_view and default_view_name in env.views:
with spack.store.db.read_transaction():
cmds += env.add_default_view_to_shell(shell)
except (spack.repo.UnknownPackageError,
spack.repo.UnknownNamespaceError) as e:
tty.error(e)
tty.die(
'Environment view is broken due to a missing package or repo.\n',
' To activate without views enabled, activate with:\n',
' spack env activate -V {0}\n'.format(env.name),
' To remove it and resolve the issue, '
'force concretize with the command:\n',
' spack -e {0} concretize --force'.format(env.name))
return cmds
# Do this last, because setting up the config must succeed first.
_active_environment = env
def deactivate(shell='sh'):
"""Undo any configuration or repo settings modified by ``activate()``.
Arguments:
shell (str): One of `sh`, `csh`, `fish`. Shell style to use.
Returns:
str: shell commands for `shell` to undo environment variables
"""
def deactivate():
"""Undo any configuration or repo settings modified by ``activate()``."""
global _active_environment
if not _active_environment:
return
# If we attached a store token on activation, restore the previous state
# and consume the token
if hasattr(_active_environment, 'store_token'):
spack.store.restore(_active_environment.store_token)
delattr(_active_environment, 'store_token')
deactivate_config_scope(_active_environment)
# use _repo so we only remove if a repo was actually constructed
if _active_environment._repo:
spack.repo.path.remove(_active_environment._repo)
cmds = ''
if shell == 'csh':
cmds += 'unsetenv SPACK_ENV;\n'
cmds += 'if ( $?SPACK_OLD_PROMPT ) '
cmds += 'set prompt="$SPACK_OLD_PROMPT" && '
cmds += 'unsetenv SPACK_OLD_PROMPT;\n'
cmds += 'unalias despacktivate;\n'
elif shell == 'fish':
cmds += 'set -e SPACK_ENV;\n'
cmds += 'functions -e despacktivate;\n'
#
# NOTE: Not changing fish_prompt (above) => no need to restore it here.
#
else:
cmds += 'if [ ! -z ${SPACK_ENV+x} ]; then\n'
cmds += 'unset SPACK_ENV; export SPACK_ENV;\n'
cmds += 'fi;\n'
cmds += 'unalias despacktivate;\n'
cmds += 'if [ ! -z ${SPACK_OLD_PS1+x} ]; then\n'
cmds += ' if [ "$SPACK_OLD_PS1" = \'$$$$\' ]; then\n'
cmds += ' unset PS1; export PS1;\n'
cmds += ' else\n'
cmds += ' export PS1="$SPACK_OLD_PS1";\n'
cmds += ' fi;\n'
cmds += ' unset SPACK_OLD_PS1; export SPACK_OLD_PS1;\n'
cmds += 'fi;\n'
try:
if default_view_name in _active_environment.views:
with spack.store.db.read_transaction():
cmds += _active_environment.rm_default_view_from_shell(shell)
except (spack.repo.UnknownPackageError,
spack.repo.UnknownNamespaceError) as e:
tty.warn(e)
tty.warn('Could not fully deactivate view due to missing package '
'or repo, shell environment may be corrupt.')
tty.debug("Deactivated environment '%s'" % _active_environment.name)
_active_environment = None
return cmds
_active_environment = None
def active_environment():
@@ -581,6 +499,10 @@ def regenerate(self, all_specs, roots):
tty.warn(msg)
def _create_environment(*args, **kwargs):
return Environment(*args, **kwargs)
class Environment(object):
def __init__(self, path, init_file=None, with_view=None, keep_relative=False):
"""Create a new environment.
@@ -601,6 +523,9 @@ def __init__(self, path, init_file=None, with_view=None, keep_relative=False):
directory.
"""
self.path = os.path.abspath(path)
self.init_file = init_file
self.with_view = with_view
self.keep_relative = keep_relative
self.txlock = lk.Lock(self._transaction_lock_path)
@@ -643,6 +568,11 @@ def __init__(self, path, init_file=None, with_view=None, keep_relative=False):
# If with_view is None, then defer to the view settings determined by
# the manifest file
def __reduce__(self):
return _create_environment, (
self.path, self.init_file, self.with_view, self.keep_relative
)
def _rewrite_relative_paths_on_relocation(self, init_file_dir):
"""When initializing the environment from a manifest file and we plan
to store the environment in a different directory, we have to rewrite
@@ -1105,7 +1035,7 @@ def is_develop(self, spec):
"""Returns true when the spec is built from local sources"""
return spec.name in self.dev_specs
def concretize(self, force=False, tests=False):
def concretize(self, force=False, tests=False, reuse=False):
"""Concretize user_specs in this environment.
Only concretizes specs that haven't been concretized yet unless
@@ -1119,6 +1049,8 @@ def concretize(self, force=False, tests=False):
already concretized
tests (bool or list or set): False to run no tests, True to test
all packages, or a list of package names to run tests for some
reuse (bool): if True try to maximize reuse of already installed
specs, if False don't account for installation status.
Returns:
List of specs that have been concretized. Each entry is a tuple of
@@ -1132,14 +1064,15 @@ def concretize(self, force=False, tests=False):
# Pick the right concretization strategy
if self.concretization == 'together':
return self._concretize_together(tests=tests)
return self._concretize_together(tests=tests, reuse=reuse)
if self.concretization == 'separately':
return self._concretize_separately(tests=tests)
return self._concretize_separately(tests=tests, reuse=reuse)
msg = 'concretization strategy not implemented [{0}]'
raise SpackEnvironmentError(msg.format(self.concretization))
def _concretize_together(self, tests=False):
def _concretize_together(self, tests=False, reuse=False):
"""Concretization strategy that concretizes all the specs
in the same DAG.
"""
@@ -1172,13 +1105,14 @@ def _concretize_together(self, tests=False):
self.specs_by_hash = {}
concrete_specs = spack.concretize.concretize_specs_together(
*self.user_specs, tests=tests)
*self.user_specs, tests=tests, reuse=reuse
)
concretized_specs = [x for x in zip(self.user_specs, concrete_specs)]
for abstract, concrete in concretized_specs:
self._add_concrete_spec(abstract, concrete)
return concretized_specs
def _concretize_separately(self, tests=False):
def _concretize_separately(self, tests=False, reuse=False):
"""Concretization strategy that concretizes separately one
user spec after the other.
"""
@@ -1197,14 +1131,62 @@ def _concretize_separately(self, tests=False):
self._add_concrete_spec(s, concrete, new=False)
# Concretize any new user specs that we haven't concretized yet
concretized_specs = []
arguments, root_specs = [], []
for uspec, uspec_constraints in zip(
self.user_specs, self.user_specs.specs_as_constraints):
self.user_specs, self.user_specs.specs_as_constraints
):
if uspec not in old_concretized_user_specs:
concrete = _concretize_from_constraints(uspec_constraints, tests=tests)
self._add_concrete_spec(uspec, concrete)
concretized_specs.append((uspec, concrete))
return concretized_specs
root_specs.append(uspec)
arguments.append((uspec_constraints, tests, reuse))
# Ensure we don't try to bootstrap clingo in parallel
if spack.config.get('config:concretizer') == 'clingo':
with spack.bootstrap.ensure_bootstrap_configuration():
spack.bootstrap.ensure_clingo_importable_or_raise()
# Ensure all the indexes have been built or updated, since
# otherwise the processes in the pool may timeout on waiting
# for a write lock. We do this indirectly by retrieving the
# provider index, which should in turn trigger the update of
# all the indexes if there's any need for that.
_ = spack.repo.path.provider_index
# Ensure we have compilers in compilers.yaml to avoid that
# processes try to write the config file in parallel
_ = spack.compilers.get_compiler_config()
# Early return if there is nothing to do
if len(arguments) == 0:
return []
# Solve the environment in parallel on Linux
start = time.time()
max_processes = min(
len(arguments), # Number of specs
16 # Cap on 16 cores
)
# TODO: revisit this print as soon as darwin is parallel too
msg = 'Starting concretization'
if sys.platform != 'darwin':
pool_size = spack.util.parallel.num_processes(max_processes=max_processes)
if pool_size > 1:
msg = msg + ' pool with {0} processes'.format(pool_size)
tty.msg(msg)
concretized_root_specs = spack.util.parallel.parallel_map(
_concretize_task, arguments, max_processes=max_processes,
debug=tty.is_debug()
)
finish = time.time()
tty.msg('Environment concretized in %.2f seconds.' % (finish - start))
results = []
for abstract, concrete in zip(root_specs, concretized_root_specs):
self._add_concrete_spec(abstract, concrete)
results.append((abstract, concrete))
return results
def concretize_and_add(self, user_spec, concrete_spec=None, tests=False):
"""Concretize and add a single spec to the environment.
@@ -1333,12 +1315,18 @@ def _env_modifications_for_default_view(self, reverse=False):
return all_mods, errors
def add_default_view_to_shell(self, shell):
env_mod = spack.util.environment.EnvironmentModifications()
def add_default_view_to_env(self, env_mod):
"""
Collect the environment modifications to activate an environment using the
default view. Removes duplicate paths.
Args:
env_mod (spack.util.environment.EnvironmentModifications): the environment
modifications object that is modified.
"""
if default_view_name not in self.views:
# No default view to add to shell
return env_mod.shell_modifications(shell)
return env_mod
env_mod.extend(uenv.unconditional_environment_modifications(
self.default_view))
@@ -1353,14 +1341,20 @@ def add_default_view_to_shell(self, shell):
for env_var in env_mod.group_by_name():
env_mod.prune_duplicate_paths(env_var)
return env_mod.shell_modifications(shell)
return env_mod
def rm_default_view_from_shell(self, shell):
env_mod = spack.util.environment.EnvironmentModifications()
def rm_default_view_from_env(self, env_mod):
"""
Collect the environment modifications to deactivate an environment using the
default view. Reverses the action of ``add_default_view_to_env``.
Args:
env_mod (spack.util.environment.EnvironmentModifications): the environment
modifications object that is modified.
"""
if default_view_name not in self.views:
# No default view to add to shell
return env_mod.shell_modifications(shell)
return env_mod
env_mod.extend(uenv.unconditional_environment_modifications(
self.default_view).reversed())
@@ -1368,7 +1362,7 @@ def rm_default_view_from_shell(self, shell):
mods, _ = self._env_modifications_for_default_view(reverse=True)
env_mod.extend(mods)
return env_mod.shell_modifications(shell)
return env_mod
def _add_concrete_spec(self, spec, concrete, new=True):
"""Called when a new concretized spec is added to the environment.
@@ -1695,12 +1689,12 @@ def _to_lockfile_dict(self):
concrete_specs = {}
for spec in self.specs_by_hash.values():
for s in spec.traverse():
dag_hash_all = s.build_hash()
if dag_hash_all not in concrete_specs:
build_hash = s.build_hash()
if build_hash not in concrete_specs:
spec_dict = s.to_node_dict(hash=ht.build_hash)
# Assumes no legacy formats, since this was just created.
spec_dict[ht.dag_hash.name] = s.dag_hash()
concrete_specs[dag_hash_all] = spec_dict
concrete_specs[build_hash] = spec_dict
hash_spec_list = zip(
self.concretized_order, self.concretized_user_specs)
@@ -1711,6 +1705,7 @@ def _to_lockfile_dict(self):
'_meta': {
'file-type': 'spack-lockfile',
'lockfile-version': lockfile_format_version,
'specfile-version': spack.spec.specfile_format_version
},
# users specs + hashes are the 'roots' of the environment
@@ -1741,13 +1736,18 @@ def _read_lockfile_dict(self, d):
root_hashes = set(self.concretized_order)
specs_by_hash = {}
for dag_hash, node_dict in json_specs_by_hash.items():
specs_by_hash[dag_hash] = Spec.from_node_dict(node_dict)
for build_hash, node_dict in json_specs_by_hash.items():
spec = Spec.from_node_dict(node_dict)
if d['_meta']['lockfile-version'] > 1:
# Build hash is stored as a key, but not as part of the node dict
# To ensure build hashes are not recomputed, we reattach here
setattr(spec, ht.build_hash.attr, build_hash)
specs_by_hash[build_hash] = spec
for dag_hash, node_dict in json_specs_by_hash.items():
for build_hash, node_dict in json_specs_by_hash.items():
for _, dep_hash, deptypes, _ in (
Spec.dependencies_from_node_dict(node_dict)):
specs_by_hash[dag_hash]._add_dependency(
specs_by_hash[build_hash]._add_dependency(
specs_by_hash[dep_hash], deptypes)
# If we are reading an older lockfile format (which uses dag hashes
@@ -1926,7 +1926,7 @@ def _update_and_write_manifest(self, raw_yaml_dict, yaml_dict):
written = os.path.exists(self.manifest_path)
if changed or not written:
self.raw_yaml = copy.deepcopy(self.yaml)
with fs.write_tmp_and_move(self.manifest_path) as f:
with fs.write_tmp_and_move(os.path.realpath(self.manifest_path)) as f:
_write_yaml(self.yaml, f)
def __enter__(self):
@@ -1992,7 +1992,7 @@ def _tree_to_display(spec):
print('')
def _concretize_from_constraints(spec_constraints, tests=False):
def _concretize_from_constraints(spec_constraints, tests=False, reuse=False):
# Accept only valid constraints from list and concretize spec
# Get the named spec even if out of order
root_spec = [s for s in spec_constraints if s.name]
@@ -2011,7 +2011,7 @@ def _concretize_from_constraints(spec_constraints, tests=False):
if c not in invalid_constraints:
s.constrain(c)
try:
return s.concretized(tests=tests)
return s.concretized(tests=tests, reuse=reuse)
except spack.spec.InvalidDependencyError as e:
invalid_deps_string = ['^' + d for d in e.invalid_deps]
invalid_deps = [c for c in spec_constraints
@@ -2030,6 +2030,12 @@ def _concretize_from_constraints(spec_constraints, tests=False):
invalid_constraints.extend(inv_variant_constraints)
def _concretize_task(packed_arguments):
spec_constraints, tests, reuse = packed_arguments
with tty.SuppressOutput(msg_enabled=False):
return _concretize_from_constraints(spec_constraints, tests, reuse)
def make_repo_path(root):
"""Make a RepoPath from the repo subdirectories in an environment."""
path = spack.repo.RepoPath()
@@ -2147,14 +2153,17 @@ def is_latest_format(manifest):
@contextlib.contextmanager
def deactivate_environment():
"""Deactivate an active environment for the duration of the context."""
global _active_environment
current, _active_environment = _active_environment, None
def no_active_environment():
"""Deactivate the active environment for the duration of the context. Has no
effect when there is no active environment."""
env = active_environment()
try:
deactivate()
yield
finally:
_active_environment = current
# TODO: we don't handle `use_env_repo` here.
if env:
activate(env)
class SpackEnvironmentError(spack.error.SpackError):

View File

@@ -0,0 +1,165 @@
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import llnl.util.tty as tty
from llnl.util.tty.color import colorize
import spack.environment as ev
import spack.repo
import spack.store
from spack.util.environment import EnvironmentModifications
def activate_header(env, shell, prompt=None):
# Construct the commands to run
cmds = ''
if shell == 'csh':
# TODO: figure out how to make color work for csh
cmds += 'setenv SPACK_ENV %s;\n' % env.path
cmds += 'alias despacktivate "spack env deactivate";\n'
if prompt:
cmds += 'if (! $?SPACK_OLD_PROMPT ) '
cmds += 'setenv SPACK_OLD_PROMPT "${prompt}";\n'
cmds += 'set prompt="%s ${prompt}";\n' % prompt
elif shell == 'fish':
if 'color' in os.getenv('TERM', '') and prompt:
prompt = colorize('@G{%s} ' % prompt, color=True)
cmds += 'set -gx SPACK_ENV %s;\n' % env.path
cmds += 'function despacktivate;\n'
cmds += ' spack env deactivate;\n'
cmds += 'end;\n'
#
# NOTE: We're not changing the fish_prompt function (which is fish's
# solution to the PS1 variable) here. This is a bit fiddly, and easy to
# screw up => spend time reasearching a solution. Feedback welcome.
#
else:
if 'color' in os.getenv('TERM', '') and prompt:
prompt = colorize('@G{%s} ' % prompt, color=True)
cmds += 'export SPACK_ENV=%s;\n' % env.path
cmds += "alias despacktivate='spack env deactivate';\n"
if prompt:
cmds += 'if [ -z ${SPACK_OLD_PS1+x} ]; then\n'
cmds += ' if [ -z ${PS1+x} ]; then\n'
cmds += " PS1='$$$$';\n"
cmds += ' fi;\n'
cmds += ' export SPACK_OLD_PS1="${PS1}";\n'
cmds += 'fi;\n'
cmds += 'export PS1="%s ${PS1}";\n' % prompt
return cmds
def deactivate_header(shell):
cmds = ''
if shell == 'csh':
cmds += 'unsetenv SPACK_ENV;\n'
cmds += 'if ( $?SPACK_OLD_PROMPT ) '
cmds += 'set prompt="$SPACK_OLD_PROMPT" && '
cmds += 'unsetenv SPACK_OLD_PROMPT;\n'
cmds += 'unalias despacktivate;\n'
elif shell == 'fish':
cmds += 'set -e SPACK_ENV;\n'
cmds += 'functions -e despacktivate;\n'
#
# NOTE: Not changing fish_prompt (above) => no need to restore it here.
#
else:
cmds += 'if [ ! -z ${SPACK_ENV+x} ]; then\n'
cmds += 'unset SPACK_ENV; export SPACK_ENV;\n'
cmds += 'fi;\n'
cmds += 'unalias despacktivate;\n'
cmds += 'if [ ! -z ${SPACK_OLD_PS1+x} ]; then\n'
cmds += ' if [ "$SPACK_OLD_PS1" = \'$$$$\' ]; then\n'
cmds += ' unset PS1; export PS1;\n'
cmds += ' else\n'
cmds += ' export PS1="$SPACK_OLD_PS1";\n'
cmds += ' fi;\n'
cmds += ' unset SPACK_OLD_PS1; export SPACK_OLD_PS1;\n'
cmds += 'fi;\n'
return cmds
def activate(env, use_env_repo=False, add_view=True):
"""
Activate an environment and append environment modifications
To activate an environment, we add its configuration scope to the
existing Spack configuration, and we set active to the current
environment.
Arguments:
env (spack.environment.Environment): the environment to activate
use_env_repo (bool): use the packages exactly as they appear in the
environment's repository
add_view (bool): generate commands to add view to path variables
Returns:
spack.util.environment.EnvironmentModifications: Environment variables
modifications to activate environment.
"""
ev.activate(env, use_env_repo=use_env_repo)
env_mods = EnvironmentModifications()
#
# NOTE in the fish-shell: Path variables are a special kind of variable
# used to support colon-delimited path lists including PATH, CDPATH,
# MANPATH, PYTHONPATH, etc. All variables that end in PATH (case-sensitive)
# become PATH variables.
#
try:
if add_view and ev.default_view_name in env.views:
with spack.store.db.read_transaction():
env.add_default_view_to_env(env_mods)
except (spack.repo.UnknownPackageError,
spack.repo.UnknownNamespaceError) as e:
tty.error(e)
tty.die(
'Environment view is broken due to a missing package or repo.\n',
' To activate without views enabled, activate with:\n',
' spack env activate -V {0}\n'.format(env.name),
' To remove it and resolve the issue, '
'force concretize with the command:\n',
' spack -e {0} concretize --force'.format(env.name))
return env_mods
def deactivate():
"""
Deactivate an environment and collect corresponding environment modifications.
Note: unloads the environment in its current state, not in the state it was
loaded in, meaning that specs that were removed from the spack environment
after activation are not unloaded.
Returns:
spack.util.environment.EnvironmentModifications: Environment variables
modifications to activate environment.
"""
env_mods = EnvironmentModifications()
active = ev.active_environment()
if active is None:
return env_mods
if ev.default_view_name in active.views:
try:
with spack.store.db.read_transaction():
active.rm_default_view_from_env(env_mods)
except (spack.repo.UnknownPackageError,
spack.repo.UnknownNamespaceError) as e:
tty.warn(e)
tty.warn('Could not fully deactivate view due to missing package '
'or repo, shell environment may be corrupt.')
ev.deactivate()
return env_mods

View File

@@ -117,11 +117,24 @@ class SpecError(SpackError):
class UnsatisfiableSpecError(SpecError):
"""Raised when a spec conflicts with package constraints.
Provide the requirement that was violated when raising."""
def __init__(self, provided, required, constraint_type):
super(UnsatisfiableSpecError, self).__init__(
"%s does not satisfy %s" % (provided, required))
"""
Raised when a spec conflicts with package constraints.
For original concretizer, provide the requirement that was violated when
raising.
"""
def __init__(self, provided, required=None, constraint_type=None, conflicts=None):
# required is only set by the original concretizer.
# clingo concretizer handles error messages differently.
if required is not None:
assert not conflicts # can't mix formats
super(UnsatisfiableSpecError, self).__init__(
"%s does not satisfy %s" % (provided, required))
else:
indented = [' %s\n' % conflict for conflict in conflicts]
conflict_msg = ''.join(indented)
msg = '%s is unsatisfiable, conflicts are:\n%s' % (provided, conflict_msg)
super(UnsatisfiableSpecError, self).__init__(msg)
self.provided = provided
self.required = required
self.constraint_type = constraint_type

View File

@@ -48,11 +48,11 @@
import spack.util.crypto as crypto
import spack.util.pattern as pattern
import spack.util.url as url_util
import spack.util.web as web_util
import spack.util.web
import spack.version
from spack.util.compression import decompressor_for, extension
from spack.util.executable import CommandNotFoundError, which
from spack.util.string import comma_and, quote
from spack.version import Version, ver
#: List of all fetch strategies, created by FetchStrategy metaclass.
all_strategies = []
@@ -350,8 +350,8 @@ def _existing_url(self, url):
else:
# Telling urllib to check if url is accessible
try:
url, headers, response = web_util.read_from_url(url)
except web_util.SpackWebError:
url, headers, response = spack.util.web.read_from_url(url)
except spack.util.web.SpackWebError:
msg = "Urllib fetch failed to verify url {0}".format(url)
raise FailedDownloadError(url, msg)
return (response.getcode() is None or response.getcode() == 200)
@@ -380,8 +380,8 @@ def _fetch_urllib(self, url):
# Run urllib but grab the mime type from the http headers
try:
url, headers, response = web_util.read_from_url(url)
except web_util.SpackWebError as e:
url, headers, response = spack.util.web.read_from_url(url)
except spack.util.web.SpackWebError as e:
# clean up archive on failure.
if self.archive_file:
os.remove(self.archive_file)
@@ -571,7 +571,7 @@ def archive(self, destination):
if not self.archive_file:
raise NoArchiveFileError("Cannot call archive() before fetching.")
web_util.push_to_url(
spack.util.web.push_to_url(
self.archive_file,
destination,
keep_original=True)
@@ -750,7 +750,7 @@ def __init__(self, **kwargs):
@property
def go_version(self):
vstring = self.go('version', output=str).split(' ')[2]
return Version(vstring)
return spack.version.Version(vstring)
@property
def go(self):
@@ -843,7 +843,7 @@ def version_from_git(git_exe):
"""
version_output = git_exe('--version', output=str)
m = re.search(GitFetchStrategy.git_version_re, version_output)
return Version(m.group(1))
return spack.version.Version(m.group(1))
@property
def git(self):
@@ -852,7 +852,7 @@ def git(self):
# Disable advice for a quieter fetch
# https://github.com/git/git/blob/master/Documentation/RelNotes/1.7.2.txt
if self.git_version >= Version('1.7.2'):
if self.git_version >= spack.version.Version('1.7.2'):
self._git.add_default_arg('-c')
self._git.add_default_arg('advice.detachedHead=false')
@@ -895,25 +895,52 @@ def fetch(self):
tty.debug('Already fetched {0}'.format(self.stage.source_path))
return
self.clone(commit=self.commit, branch=self.branch, tag=self.tag)
def clone(self, dest=None, commit=None, branch=None, tag=None, bare=False):
"""
Clone a repository to a path.
This method handles cloning from git, but does not require a stage.
Arguments:
dest (str or None): The path into which the code is cloned. If None,
requires a stage and uses the stage's source path.
commit (str or None): A commit to fetch from the remote. Only one of
commit, branch, and tag may be non-None.
branch (str or None): A branch to fetch from the remote.
tag (str or None): A tag to fetch from the remote.
bare (bool): Execute a "bare" git clone (--bare option to git)
"""
# Default to spack source path
dest = dest or self.stage.source_path
tty.debug('Cloning git repository: {0}'.format(self._repo_info()))
git = self.git
if self.commit:
debug = spack.config.get('config:debug')
if bare:
# We don't need to worry about which commit/branch/tag is checked out
clone_args = ['clone', '--bare']
if not debug:
clone_args.append('--quiet')
clone_args.extend([self.url, dest])
git(*clone_args)
elif commit:
# Need to do a regular clone and check out everything if
# they asked for a particular commit.
debug = spack.config.get('config:debug')
clone_args = ['clone', self.url]
if not debug:
clone_args.insert(1, '--quiet')
with temp_cwd():
git(*clone_args)
repo_name = get_single_file('.')
self.stage.srcdir = repo_name
shutil.move(repo_name, self.stage.source_path)
if self.stage:
self.stage.srcdir = repo_name
shutil.move(repo_name, dest)
with working_dir(self.stage.source_path):
checkout_args = ['checkout', self.commit]
with working_dir(dest):
checkout_args = ['checkout', commit]
if not debug:
checkout_args.insert(1, '--quiet')
git(*checkout_args)
@@ -921,18 +948,18 @@ def fetch(self):
else:
# Can be more efficient if not checking out a specific commit.
args = ['clone']
if not spack.config.get('config:debug'):
if not debug:
args.append('--quiet')
# If we want a particular branch ask for it.
if self.branch:
args.extend(['--branch', self.branch])
elif self.tag and self.git_version >= ver('1.8.5.2'):
args.extend(['--branch', self.tag])
if branch:
args.extend(['--branch', branch])
elif tag and self.git_version >= spack.version.ver('1.8.5.2'):
args.extend(['--branch', tag])
# Try to be efficient if we're using a new enough git.
# This checks out only one branch's history
if self.git_version >= ver('1.7.10'):
if self.git_version >= spack.version.ver('1.7.10'):
if self.get_full_repo:
args.append('--no-single-branch')
else:
@@ -942,7 +969,7 @@ def fetch(self):
# Yet more efficiency: only download a 1-commit deep
# tree, if the in-use git and protocol permit it.
if (not self.get_full_repo) and \
self.git_version >= ver('1.7.1') and \
self.git_version >= spack.version.ver('1.7.1') and \
self.protocol_supports_shallow_clone():
args.extend(['--depth', '1'])
@@ -950,14 +977,15 @@ def fetch(self):
git(*args)
repo_name = get_single_file('.')
self.stage.srcdir = repo_name
shutil.move(repo_name, self.stage.source_path)
if self.stage:
self.stage.srcdir = repo_name
shutil.move(repo_name, dest)
with working_dir(self.stage.source_path):
with working_dir(dest):
# For tags, be conservative and check them out AFTER
# cloning. Later git versions can do this with clone
# --branch, but older ones fail.
if self.tag and self.git_version < ver('1.8.5.2'):
if tag and self.git_version < spack.version.ver('1.8.5.2'):
# pull --tags returns a "special" error code of 1 in
# older versions that we have to ignore.
# see: https://github.com/git/git/commit/19d122b
@@ -971,7 +999,7 @@ def fetch(self):
git(*co_args)
if self.submodules_delete:
with working_dir(self.stage.source_path):
with working_dir(dest):
for submodule_to_delete in self.submodules_delete:
args = ['rm', submodule_to_delete]
if not spack.config.get('config:debug'):
@@ -980,7 +1008,7 @@ def fetch(self):
# Init submodules if the user asked for them.
if self.submodules:
with working_dir(self.stage.source_path):
with working_dir(dest):
args = ['submodule', 'update', '--init', '--recursive']
if not spack.config.get('config:debug'):
args.insert(1, '--quiet')
@@ -1359,6 +1387,55 @@ def fetch(self):
basename = os.path.basename(parsed_url.path)
with working_dir(self.stage.path):
_, headers, stream = spack.util.web.read_from_url(self.url)
with open(basename, 'wb') as f:
shutil.copyfileobj(stream, f)
content_type = spack.util.web.get_header(headers, 'Content-type')
if content_type == 'text/html':
warn_content_type_mismatch(self.archive_file or "the archive")
if self.stage.save_filename:
os.rename(
os.path.join(self.stage.path, basename),
self.stage.save_filename)
if not self.archive_file:
raise FailedDownloadError(self.url)
@fetcher
class GCSFetchStrategy(URLFetchStrategy):
"""FetchStrategy that pulls from a GCS bucket."""
url_attr = 'gs'
def __init__(self, *args, **kwargs):
try:
super(GCSFetchStrategy, self).__init__(*args, **kwargs)
except ValueError:
if not kwargs.get('url'):
raise ValueError(
"GCSFetchStrategy requires a url for fetching.")
@_needs_stage
def fetch(self):
import spack.util.web as web_util
if self.archive_file:
tty.debug('Already downloaded {0}'.format(self.archive_file))
return
parsed_url = url_util.parse(self.url)
if parsed_url.scheme != 'gs':
raise FetchError(
'GCSFetchStrategy can only fetch from gs:// urls.')
tty.debug('Fetching {0}'.format(self.url))
basename = os.path.basename(parsed_url.path)
with working_dir(self.stage.path):
_, headers, stream = web_util.read_from_url(self.url)
@@ -1502,8 +1579,15 @@ def for_package_version(pkg, version):
check_pkg_attributes(pkg)
if not isinstance(version, Version):
version = Version(version)
if not isinstance(version, spack.version.Version):
version = spack.version.Version(version)
# if it's a commit, we must use a GitFetchStrategy
if version.is_commit and hasattr(pkg, "git"):
# Populate the version with comparisons to other commits
version.generate_commit_lookup(pkg)
fetcher = GitFetchStrategy(git=pkg.git, commit=str(version))
return fetcher
# If it's not a known version, try to extrapolate one by URL
if version not in pkg.versions:

View File

@@ -19,7 +19,6 @@
import spack.config
import spack.projections
import spack.relocate
import spack.schema.projections
import spack.spec
import spack.store
@@ -61,8 +60,8 @@ def view_copy(src, dst, view, spec=None):
Use spec and view to generate relocations
"""
shutil.copyfile(src, dst)
if spec:
shutil.copy2(src, dst)
if spec and not spec.external:
# Not metadata, we have to relocate it
# Get information on where to relocate from/to
@@ -73,16 +72,20 @@ def view_copy(src, dst, view, spec=None):
# will have the old sbang location in their shebangs.
# TODO: Not sure which one to use...
import spack.hooks.sbang as sbang
# Break a package include cycle
import spack.relocate
orig_sbang = '#!/bin/bash {0}/bin/sbang'.format(spack.paths.spack_root)
new_sbang = sbang.sbang_shebang_line()
prefix_to_projection = OrderedDict({
spec.prefix: view.get_projection_for_spec(spec),
spack.paths.spack_root: view._root})
spec.prefix: view.get_projection_for_spec(spec)})
for dep in spec.traverse():
prefix_to_projection[dep.prefix] = \
view.get_projection_for_spec(dep)
if not dep.external:
prefix_to_projection[dep.prefix] = \
view.get_projection_for_spec(dep)
if spack.relocate.is_binary(dst):
spack.relocate.relocate_text_bin(
@@ -96,6 +99,11 @@ def view_copy(src, dst, view, spec=None):
files=[dst],
prefixes=prefix_to_projection
)
try:
stat = os.stat(src)
os.chown(dst, stat.st_uid, stat.st_gid)
except OSError:
tty.debug('Can\'t change the permissions for %s' % dst)
def view_func_parser(parsed_name):
@@ -400,7 +408,7 @@ def merge(self, spec, ignore=None):
ignore = ignore or (lambda f: False)
ignore_file = match_predicate(
self.layout.hidden_file_paths, ignore)
self.layout.hidden_file_regexes, ignore)
# check for dir conflicts
conflicts = tree.find_dir_conflicts(view_dst, ignore_file)
@@ -426,7 +434,7 @@ def unmerge(self, spec, ignore=None):
ignore = ignore or (lambda f: False)
ignore_file = match_predicate(
self.layout.hidden_file_paths, ignore)
self.layout.hidden_file_regexes, ignore)
merge_map = tree.get_file_map(view_dst, ignore_file)
pkg.remove_files_from_view(self, merge_map)
@@ -434,11 +442,7 @@ def unmerge(self, spec, ignore=None):
# now unmerge the directory tree
tree.unmerge_directories(view_dst, ignore_file)
def remove_file(self, src, dest):
if not os.path.lexists(dest):
tty.warn("Tried to remove %s which does not exist" % dest)
return
def remove_files(self, files):
def needs_file(spec, file):
# convert the file we want to remove to a source in this spec
projection = self.get_projection_for_spec(spec)
@@ -457,16 +461,23 @@ def needs_file(spec, file):
manifest = {}
return test_path in manifest
# remove if dest is not owned by any other package in the view
# This will only be false if two packages are merged into a prefix
# and have a conflicting file
specs = self.get_all_specs()
# check all specs for whether they own the file. That include the spec
# we are currently removing, as we remove files before unlinking the
# metadata directory.
if len([s for s in self.get_all_specs()
if needs_file(s, dest)]) <= 1:
os.remove(dest)
for file in files:
if not os.path.lexists(file):
tty.warn("Tried to remove %s which does not exist" % file)
continue
# remove if file is not owned by any other package in the view
# This will only be false if two packages are merged into a prefix
# and have a conflicting file
# check all specs for whether they own the file. That include the spec
# we are currently removing, as we remove files before unlinking the
# metadata directory.
if len([s for s in specs if needs_file(s, file)]) <= 1:
tty.debug("Removing file " + file)
os.remove(file)
def check_added(self, spec):
assert spec.concrete

View File

@@ -0,0 +1,26 @@
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import six.moves.urllib.response as urllib_response
import spack.util.url as url_util
import spack.util.web as web_util
def gcs_open(req, *args, **kwargs):
"""Open a reader stream to a blob object on GCS
"""
import spack.util.gcs as gcs_util
url = url_util.parse(req.get_full_url())
gcsblob = gcs_util.GCSBlob(url)
if not gcsblob.exists():
raise web_util.SpackWebError('GCS blob {0} does not exist'.format(
gcsblob.blob_path))
stream = gcsblob.get_blob_byte_stream()
headers = gcsblob.get_blob_headers()
return urllib_response.addinfourl(stream, headers, url)

View File

@@ -44,6 +44,13 @@ def attr(self):
deptype=('build', 'link', 'run'), package_hash=False, name='build_hash')
#: Hash descriptor used only to transfer a DAG, as is, across processes
process_hash = SpecHashDescriptor(
deptype=('build', 'link', 'run', 'test'),
package_hash=False,
name='process_hash'
)
#: Full hash used in build pipelines to determine when to rebuild packages.
full_hash = SpecHashDescriptor(
deptype=('build', 'link', 'run'), package_hash=True, name='full_hash')

Some files were not shown because too many files have changed in this diff Show More