diff options
author | Peter Scheibel <scheibel1@llnl.gov> | 2024-09-06 10:37:33 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-06 10:37:33 -0700 |
commit | 78a4d3e7d2bb5720dcd9d1ac1c375ceae8dcd12f (patch) | |
tree | 49e489faf9d54fafd2bec570c6313afad9ca21d1 /var | |
parent | 2b9a621d19e348b3984ac4a1c7befe8e75a005ed (diff) | |
download | spack-78a4d3e7d2bb5720dcd9d1ac1c375ceae8dcd12f.tar.gz spack-78a4d3e7d2bb5720dcd9d1ac1c375ceae8dcd12f.tar.bz2 spack-78a4d3e7d2bb5720dcd9d1ac1c375ceae8dcd12f.tar.xz spack-78a4d3e7d2bb5720dcd9d1ac1c375ceae8dcd12f.zip |
Mixed-source cflags (#41049)
Allow flags from different sources (compilers, `require:`, command-line
specs, and `depends_on`) to be merged together, and enforce a consistent
order among them.
The order is based on the sources, e.g. flags on specs from the command
line always come last. Some flag order consistency issues are fixed:
1. Flags from `compilers.yaml` and the command line were always intra- and
inter-source order consistent.
2. Flags from dependents and packages.yaml (introduced via `require:`)
were not: for `-a -b` from one source and `-c` from another, the final
result might rearrange `-a -b`, and would also be inconsistent in terms
of whether `-c` came before or after.
(1) is/was handled by going back to the original source, i.e., flags are
retrieved directly from the command line spec rather than the solver.
(2) is addressed by:
* Keeping track of grouped flags in the solver
* Keeping track of flag sources in the solver on a per-flag basis
The latter info is used in this PR to enforce DAG ordering on flags
applied from multiple dependents to the same package, e.g., for this
graph:
```
a
/|\
b | c
\|/
d
```
If `a`, `b`, and `c` impose flags on `d`, the combined flags on `d` will
contain the flags of `a`, `b`, and `c` -- in that order.
Conflicting flags are allowed (e.g. -O2 and -O3). `Spec.satisifes()` has
been updated such that X satisfies Y as long as X has *at least* all of
the flags that Y has. This is also true in the solver constraints.
`.satisfies` does not account for how order can change behavior (so
`-O2 -O3` can satisfy `-O3 -O2`); it is expected that this can be
addressed later (e.g. by prohibiting flag conflicts).
`Spec.constrain` and `.intersects` have been updated to be consistent
with this new definition of `.satisfies`.
Diffstat (limited to 'var')
0 files changed, 0 insertions, 0 deletions