Skip to content

Features/cflags#360

Merged
tgamblin merged 48 commits intodevelopfrom
features/cflags
May 17, 2016
Merged

Features/cflags#360
tgamblin merged 48 commits intodevelopfrom
features/cflags

Conversation

@becker33
Copy link
Copy Markdown
Member

@becker33 becker33 commented Jan 16, 2016

New features:

  • Changed architecture syntax from '=' to ' arch='.
    - variants can be specified by 'name=value' as well, supporting arbitary values
  • Compiler flags can be specified from the command line with the same syntax
    - cflags=
    - cxxflags=
    - fflags=
    - ldflags=
    - ldlibs=
    - cppflags=
    - values must be escape-quoted (spack install foo cflags="-O1 -ansi") on the command line
    - they can be normally quoted from within python
  • Compiler flags can also be specified from the compiler config file.
    - These defaults will be applied to every package using that compiler
    - The same five flags are supported
    - The syntax is the same as for compiler paths (flag: value)
  • Variants no longer have to be boolean.
    - specified by name= on command line
    - if the value is a string 'True' of 'false' (any capitalization) that is a synonym for the current syntax
    - the existing syntax will still work.
  • Specs can be referenced by hash
    - Hashes are prefaced by the '/' symbol
    - E.G. spack uninstall /phrk
    - The length of the hash reference doesn't matter
    - If it's long enough to specify a single spec, it will work.
  • Find command can search "anonymous" specs
    - spack find %gcc will return all specs built with gcc
    - Works with all parameters
  • Added -f option to spack find command
    - This option prints specs including user supplied compiler flags
    - Includes flags from both command line and config file.

becker33 and others added 21 commits November 10, 2015 15:39
…Decided to prepend flag names with + for clarity in spec names and ease of parsing. Also generalized variants, although there is not yet a way to specify a generalized (name=value) variant.
       Flags are passed from the command line all the way through
build environments to environment variables.
      Flags are specified using +name=value and values are quoted
using escaped quotes when necessary.

Future work includes using the flags in the compiler wrapper script
and hopefully updating the parser for a gentler user experience of
the spec language.
…hin the compiler string. Added -f option to find command; with -f, find prints flags
…d cflag concretizer to concretize each flag individually, allowing us to have unconcretized FlagMap objects for find and uninstall. Now empty flags in find match any, whereas specifying +cflags=\'\' matches only those with empty strings for flags
@adamjstewart
Copy link
Copy Markdown
Member

I really like the spack find %gcc addition. I was thinking about suggesting that myself.

@tgamblin
Copy link
Copy Markdown
Member

tgamblin commented Feb 1, 2016

@adamjstewart: referring to specs by hash is v. nice too :). Thanks @becker33

@adamjstewart
Copy link
Copy Markdown
Member

Will this change also support spack uninstall -a %gcc?

@tgamblin
Copy link
Copy Markdown
Member

tgamblin commented Mar 4, 2016

yes.

@aaroncblack
Copy link
Copy Markdown
Contributor

What's the current status on this pull request? I could really use this functionality... I appreciate the work that @becker33 has done on this.

@tgamblin
Copy link
Copy Markdown
Member

tgamblin commented Apr 4, 2016

@aaroncblack: this is on @becker33's list after #561, which adds cray support, better architecture support, and support for module-loaded compilers. We need that one in to get ORNL and NERSC going, and it also has compiler support that is needed for this PR.

@eschnett
Copy link
Copy Markdown
Contributor

To be complete, a sixth flag -libs= should be added. This allows listing system-dependent libraries as well, e.g. if one wants to use a debug malloc or a profiling library. It is not possible to put this into ldflags since ldflags need to be added in the beginning of the linker arguments, whereas libs need to be listed at the end.

print "You can either:"
print " a) Use a more specific hash, or"
print " b) Specify the package by name."
sys.exit(1)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parser should raise some type of ParseException (e.g. an AmbiguousHashError that extends ParseError) rather than printing all this and exiting. Give the caller a chance to handle the error. Also the parser shouldn't be responsible for any user interaction.

@tgamblin
Copy link
Copy Markdown
Member

tgamblin commented May 9, 2016

@becker33: Ok I went over this and put a few comments in. It's nearly ready to go. There are a few things that need to get done though:

  • Test that compiler flags are making it into the compile line. Look at lib/spack/spack/test/cc.py for tests that verify this. There should probably be tests for all the flags.
  • Spec.name should be None when undefined, like all the other Spec fields.
  • test that fcflags works.
  • Docs for compiler flags, anonymous specs, and hash specs.

@tgamblin tgamblin merged commit 45bf934 into develop May 17, 2016
@adamjstewart
Copy link
Copy Markdown
Member

Where can I find the documentation for this?

@trws
Copy link
Copy Markdown
Contributor

trws commented May 20, 2016

Do I understand correctly that the "variant=value" syntax didn't actually make it in from this PR?

@tgamblin tgamblin deleted the features/cflags branch June 17, 2016 21:24
becker33 referenced this pull request Jan 9, 2017
* Removes the extra argument from Package.do_install while maintaining the changes in behavior pulled in #1603

* install : removed -i and -d shorthands (breaks backward compatibility)

* Change ':' to ','
tgamblin pushed a commit that referenced this pull request Jan 16, 2017
* Fixed parser to eliminate need for escape quotes. TODO: Fix double call to shlex, fix spaces in spec __str__

* Fixed double shlex

* cleanup

* rebased on develop

* Fixed parsing for multiple specs; broken since #360

* Revoked elimination of the `-` sigil in the syntax, and added it back into tests

* flake8

* more flake8

* Cleaned up dead code and added comments to parsing code

* bugfix for spaces in arguments; new bug found in testing

* Added unit tests for kv pairs in parsing/lexing

* Even more flake8

* ... yet another flake8

* Allow multiple specs in install

* unfathomable levels of flake8

* Updated documentation to match parser fix
matz-e added a commit to matz-e/spack that referenced this pull request Apr 27, 2020
Comment on lines +1561 to +1563
deps_strict = strict
if not (self.name and other.name):
deps_strict=True
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@becker33 Do you remember why this was added here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To explain the context, I'm trying to get a more formally correct implementation of satisfies while fixing #35597 see #35599

climbfuji added a commit to climbfuji/spack that referenced this pull request Nov 8, 2023
Added version 4.1.6 to the openmpi package
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants