Package.compiler: add support for opt_flags/debug_flags#50126
Merged
alalazo merged 10 commits intospack:developfrom Apr 24, 2025
Merged
Package.compiler: add support for opt_flags/debug_flags#50126alalazo merged 10 commits intospack:developfrom
alalazo merged 10 commits intospack:developfrom
Conversation
alalazo
reviewed
Apr 21, 2025
Member
Author
|
Update PR based on discussion (and also updated PR description). |
alalazo
reviewed
Apr 23, 2025
Member
alalazo
left a comment
There was a problem hiding this comment.
A few minor comments, but essentially LGTM, thanks!
Member
Author
|
I followed all requests except for #50126 (comment) (where I explain my reasoning). I added a docstring to the |
alalazo
approved these changes
Apr 24, 2025
danielsjensen1
added a commit
to danielsjensen1/spack
that referenced
this pull request
Apr 26, 2025
* develop: (752 commits) mesa: add v23.3.3 and use py-packaging while python>=3.12 (spack#49121) gcc: add v15.1.0 (spack#50212) draco: add v7.20.0 (spack#49996) sgpp: update dependencies and variants (spack#49384) input_analysis.py: fix conditional requirements (spack#50194) boost: add 1.88.0 (spack#50158) mapl: add v2.55.1 (spack#50201) mepo: add v2.3.2 (spack#50202) py-repligit: add v0.1.1 (spack#50204) [package updates] Bump version of cp2k and sirius (spack#50141) petsc4py: update ldshared.patch for v3.20.1, and skip for v3.23.1+ (spack#50170) namd: add v3.0.1 (spack#50192) geomodel: depend on c (spack#49781) CompilerAdaptor: add support for opt_flags/debug_flags (spack#50126) Add ls alias to spack {compiler, external} (spack#50189) covfie: depend on c (spack#50190) lua-sol2: add v3.5.0 (spack#49970) crtm-fix: fix directory logic (spack#50172) py-build: add v1.2.2 (spack#50148) py-pillow: fix build (spack#50177) ...
teaguesterling
pushed a commit
to teaguesterling/spack
that referenced
this pull request
May 20, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See
mfemfor an examplethis wasn't working, so I added
opt_flagsto the compiler adaptor.Package.compiler.opt_flagswill return theopt_flagsfor C, C++, or Fortran compiler, the first of whichever is defined (in that order). A test is added for this behavior.mfemitself is refactored to usespec["cxx"].opt_flags, which is preferred (but the general change above is to support packages in other repos which may not have updated to this form yet).This also adds a default empty
opt_flags/debug_flagstoCompilerPackage, so one can ask forSpec["c"].opt_flagsregardless of what underlying compiler is in use.If the package only depends on one language, or uses the same compiler for c/c++, then you can ask forcompiler.opt_flags; otherwise you ask forcompiler.opt_flags_for_lang(c).