Commit graph

3075 commits

Author SHA1 Message Date
scheibelp
dcdd16b35e Check for namespace-qualified packages in repo_for_pkg (#5787)
* Fixes #5754

Previously when RepoPath.repo_for_pkg was invoked with a string,
it did not check if the string included a namespace. Any
namespace-qualified package provided as a string would not be found
(at which point the behavior was to return the highest-precedence
repository).

* handle nested namespaces for packages specified as strings in repo_for_pkg
* add preliminary repository tests
* add test which replicates #5754
* refactor repo tests with fixtures
* define repo_path equivalent at test-level scope for repo tests
* add tests for unknown namespace/package
* rename fixture function (no longer prefixed with 'test_')
2017-10-25 21:08:03 +02:00
George Hartzell
b43064190c Specify base branch for flake8 comparison (#5796)
Internally we work against a branch named 'llnl/develop', which
mirrors the public repository's `develop` branch.

It's useful to be able to run flake8 on our changes, using
`llnl/develop` as the base branch instead of `develop`.

Internally the flake8 subcommand generates the list of changes files
using a hardcoded range of `develop...`.

This makes the base of that range a command line option, with a
default of `develop`.

That lets us do this:

```
spack flake8 --base llnl/develop
```

which uses a range of `llnl/develop...`.
2017-10-25 14:30:22 +02:00
Massimiliano Culpo
8b7d2d0f24 'spack install' can overwrite an existing installation (#5384)
'spack install' can now reinstall a spec even if it has dependents, via
the --overwrite option. This option moves the current installation in a
temporary directory. If the reinstallation is successful the temporary
is removed, otherwise a rollback is performed.
2017-10-24 12:32:30 -07:00
Todd Gamblin
3f68cc2ba7 Fix bug in spack flake8 when no files differ from develop (#5898) 2017-10-24 11:29:18 +02:00
Todd Gamblin
6b5ca38723 do not use 'l' as a variable name, to appease new flake8 version
- new E741 flake8 checks disallow 'l', 'O', and 'I' as variable names

- rework parts of the code that use this, to be compliant

- we could add exceptions for this, but we're trying to mostly keep up
  with PEP8 and we already have more than a few exceptions.
2017-10-24 10:05:36 +02:00
Todd Gamblin
5449884b2e Fix bare 'except:' to placate errors in new flake8 version.
- fixes E722 errors from latest version of flake8
- requires us to not use 'bare except:' and catch BaseException instead
2017-10-24 10:05:36 +02:00
Todd Gamblin
b98fc48273 log tests use tmpdir properly 2017-10-24 10:05:36 +02:00
Todd Gamblin
0bb1eb32f2 fix bugs found with stricter flake8 rules
- When you don't use wildcards, flake8 will find places where you used an
  undefined name.

- This commit has all the bugfixes resulting from this static check.
2017-10-24 10:05:36 +02:00
Todd Gamblin
7dd79094b0 remove wildcards from make spack core and packages
- This removes all wildcard imports EXCEPT `from spack import *` in packages
2017-10-24 10:05:36 +02:00
Todd Gamblin
7757ebc0bc flake8: no wildcards in core; only import * from spack in packages
There are now separate flake8 configs for core vs. packages:
- core has a smaller set of flake8 exceptions
- packages allow `from spack import *` and module globals
- Allows core to take advantage of static checking for undefined names
- Allows packages to keep using Spack tricks like `from spack import *`
  and dependencies setting globals for dependents.
2017-10-24 10:05:36 +02:00
Todd Gamblin
78e22940c2 add --all option to spack flake8
- `-a`/`--all` causes flake8 to run on all files rather than just
  different ones.
2017-10-24 10:05:36 +02:00
scheibelp
e660611a87 package: remove bare except statements (#5896) 2017-10-23 19:28:53 -07:00
Massimiliano Culpo
3e7680e24a getting_started.rst: removed tip suggesting the use of 2 Spack instances (#4061) 2017-10-20 21:09:08 -07:00
Massimiliano Culpo
3afc6770f0 module-type argument defaults to 'tcl' instead of every known type (#5751)
fixes #5721

This is to solve the fact that lmod needs to be configured
by the user (to specify a core compiler).
2017-10-20 20:41:25 -07:00
Patrick Gartung
a8ee2a912b buildcache command updates (#5860)
* Add better spec matching to spack buildcache

* skip download of spec.yaml and keys if they exist

* autopep8
2017-10-20 20:33:01 -07:00
Adam J. Stewart
2570dfb4d9 Update Getting Started docs to clarify that full Xcode suite is required for qt (#4958)
* Update Getting Started docs to clarify that full Xcode suite is required for qt

* Better error message when only the command-line tools are installed
2017-10-20 17:31:12 -07:00
Todd Gamblin
4dac4736e7 spack blame can take a path to a file in the Spack repo (#5793)
- Previously `spack blame` only worked for package names; now it works
  for paths as well, so developers can use it on core spack files.
2017-10-19 14:27:15 -07:00
Adam J. Stewart
a1c19f8389 Allow documentation to build in Python 3 (#5736) 2017-10-19 00:26:04 -07:00
George Hartzell
464e558aea filter_file, don't remove absent backup file (#5733)
I'm tracking down a problem with the perl package that's been
generating this error:

```
OSError: OSError: [Errno 2] No such file or directory: '/blah/blah/blah/lib/5.24.1/x86_64-linux/Config.pm~'
```

The real problem is upstream, but it's being masked by an exception
raised in `filter_file`s finally block.

In my case, `backup` is `False`.

The backup is created around line 127, the `re.sub()` calls
fails (working on that), the `except` block fires and moves the backup
file back, then the finally block tries to remove the non-existent
backup file.

This change just avoids trying to remove the non-existent file.
2017-10-17 11:26:05 -07:00
Michael F. Herbst
1952a92820 Minor typos and corections (#5789)
- The shell script uses arrays and hence only works on sophisticated shells and not the default `sh`. For clarity the shebang `#!/bin/bash` has been used instead.
2017-10-17 01:36:03 -07:00
Todd Gamblin
100fb1e6ee Exercise more code paths in the git fetcher.
- This fakes out GitFetchStrategy to try code paths for different git
  versions.

- This allows us to test code paths for old versions using a newer git
  version.
2017-10-17 01:26:31 -07:00
Todd Gamblin
d14816cbaf Spack tests no longer clutter var/spack/stage
- Tests use a session-scoped mock stage directory so as not to interfere
  with the real install.

- Every test is forced to clean up after itself with an additional check.
  We now automatically assert that no new files have been added to
  `spack.stage_path` during each test.

  - This means that tests that fail installs now need to clean up their
    stages, but in all other cases the check is useful.
2017-10-17 01:26:31 -07:00
Todd Gamblin
44bebd7a8f `Package.stage` no longer implicitly makes stage directory
- Be explicit about stage creation during the install process.

- This avoids accidental creation of stages
  - e.g., during `spack install --fake`, stages were erroneously recreated
    after being destroyed
2017-10-17 01:26:31 -07:00
Todd Gamblin
894a1a73a4 Spack tests no longer use the var/spack/stage directory.
- This prevents the main spack install from being clusttered by
  invocations of `spack test`.

- This uses a session-scoped stage fixture to ensure tests don't
  interfere.
2017-10-17 01:26:31 -07:00
Todd Gamblin
c14f2dc7b4 Spack core and tests no longer use os.chdir()
- Spack's core package interface was previously overly stateful, in that
  calling methods like `do_stage()` could change your working directory.

- This removes Stage's `chdir` and `chdir_to_source` methods and replaces
  their usages with `with working_dir(stage.path)` and `with
  working_dir(stage.source_path)`, respectively.  These ensure the
  original working directory is preserved.

- This not only makes the API more usable, it makes the tests more
  deterministic, as previously a test could leave the current working
  directory in a bad state and cause subsequent tests to fail
  mysteriously.
2017-10-17 01:26:31 -07:00
Adam J. Stewart
6f9036c858 Ensure that FileList makes it into the documentation (#5739) 2017-10-14 06:20:39 +02:00
Todd Gamblin
1ba4c1af63 Clean up logic in Sepc.satisfies_dependencies()
- This puts in a fast path when there are no dependencies to satisfy.

- Reduces time spent to concretize r-rminer by 2x, down to 5s from 10s
2017-10-13 19:46:57 -07:00
Todd Gamblin
afc99ca516 Remove single-root assertion from Spec.root
- Assertion would search for root through all possible paths.
  - It's also really slow.

- This isn't needed anymore. We're pretty good at ensuring single-rooted
  DAGs, and this assertion has never been thrown.

- This shaves another 6 seconds off r-rminer concretization
2017-10-13 19:46:57 -07:00
Todd Gamblin
3f091fb6db Use list instead of OrderedDict to find virtual/external candidates
- This reduces concretization time for r-rminer from over 1 minute to
  only 16 seconds.
  - OrderedDict ends up taking a *lot* of time to compare larger specs.

- An OrderedDict isn't actually needed here.  It's actually not possible
  to find duplicates, and we end up sorting the contents of the
  OrderedDict anyway.
2017-10-13 19:46:57 -07:00
Todd Gamblin
f58c503091 avoid creating lots of dictionaries in traverse_edges()
- This is an optimization to the way traverse_edges iterates over
  successors.

- Previous version called dependencies_dict(), which involved a lot of
  redundant work (creating dicts and calling caonical_deptype)
2017-10-13 19:46:57 -07:00
Todd Gamblin
9ccaf6474d Don't redundantly check for providers of non-virtuals. 2017-10-13 19:46:57 -07:00
Todd Gamblin
55f85f2307 Cache compilers parsed from config files
- Spack ends up constructing compilers frequently from YAML data.

- This caches the result of parsing the compiler config

- The logic in compilers/__init__.py could use a bigger cleanup, but this
  makes concretization much faster for now.

- on macOS, this also ensures that xcrun is called only twice, as opposed
  to every time a new compiler object is constructed.
2017-10-13 19:46:57 -07:00
Patrick Gartung
2e1aa0a5e9 This fixes a bug in creating rpaths relative to $ORIGIN on linux. (#5726)
* This fixes a bug in creating rpaths relative to  on linux.

* fix for macOS as well

* found in testing

* flake8

* fix testing on macOS

* flake8
2017-10-13 19:13:07 -07:00
Axel Huebl
e17765db39 Docker Workflow (#5582)
This adds a workflow section on how to use spack on Docker.

It provides an example on the best-practices I collected over the
last months and circumvents the common pitfalls I tapped in.

Works with MPI, CUDA, Modules, execution as root, etc.

Background: Developed initially for PIConGPU.
2017-10-13 12:17:20 -07:00
Denis Davydov
1b53e82348 various fixes for macOS high sierra (#5647)
* various fixes for macOS high sierra

* add macOS_version() helper function

* flake8 fixes

* update oce and trilinos

* fix bison
2017-10-12 11:41:57 -07:00
David Hows
0dad5b3ee5 Make --trusted default when running spack gpg list (#5678)
* Make --trusted default when running spack gpg list

Currently running `spack gpg list` with no arguments returns nothing. You must supply either the `--trusted` or the `--signing` options. The idea here is to return some initial data to the user when the command is run. The alternative is to return an error, telling the user to select one of the two options.

* Add an extra test case for the empty list command

Fixes the issue with code coverage
2017-10-12 11:14:48 -07:00
Todd Gamblin
65b38764ae Speed up concretization (#5716)
This isn't a rework of the concretizer but it speeds things up a LOT.

The main culprits were:
  1. Variant code, `provider_index`, and `concretize.py` were calling
     `spec.package` when they could use `spec.package_class`
    - `spec.package` looks up a package instance by `Spec`, which requires a
      (fast-ish but not that fast) DAG compare.
    - `spec.package_class` just looks up the package's class by name, and you
        should use this when all you need is metadata (most of the time).
    - not really clear that the current way packages are looked up is
      necessary -- we can consider refactoring that in the future.

  2. `Repository.repo_for_pkg` parses a `str` argument into a `Spec` when
     called with one, via `@_autospec`, but this is not needed.
     - Add some faster code to handle strings directly and avoid parsing

This speeds up concretization 3-9x in my limited tests.  Still not super
fast but much more bearable:

Before:
  - `spack spec xsdk` took 33.6s
  - `spack spec dealii` took 1m39s

After:
  - `spack spec xsdk` takes 6.8s
  - `spack spec dealii` takes 10.8s
2017-10-12 09:52:38 -07:00
Todd Gamblin
b5e136b729 Better install output (#5714)
* Do not call setup_package for fake installs

- setup package could fail if ``setup_dependent_environment`` or other
  routines expected to use executables from dependencies

- xpetsc and boost try to get python config variables in
  `setup_dependent_package`; this would cause them not to be
  fake-installable

* Remove vestigial deptype_query argument to Spec.traverse()

- The `deptype_query` argument isn't used anymore -- it's only passed
  around and causes confusion when calling traverse.

- Get rid of it and just keep the `deptypes` argument

* Don't print redundant messages when installing dependencies

- `do_install()` was originally depth-first recursive, and printed "<pkg>
  already installed in ..." multiple times for packages as recursive
  calls encountered them.

- For much cleaner output, use spec.traverse(order='post') to install
  dependencies instead
2017-10-12 00:49:59 -07:00
Christoph Junghans
cb7628c9a4 compilers/clang: add flang (#5503)
* compilers/clang: add flang

* Update clang.py
2017-10-10 13:52:10 -07:00
George Hartzell
0d1c36e559 Add package for aspell and ass't dictionaries (#3890)
* Add package for aspell and ass't dictionaries

Add a package definition for aspell.

Add a handful of dictionaries to convince myself that the support for
a bunch of dictionaries works.

* Flake8 cleanup

* Use six's version of urlparse

`urlparse` is not python3 friendly.  This works around it (stolen from
`.../cmd/md5.py`).

* Fix incorrect trimming regexp

* Clean up dictionary build

- more parsimonious use of `which` (`make()` has already been made)
- use `sh` instead of `bash`

* Use a helper method to generate info for variants

I figured out my issues with static methods.  I *think* that it this
is pythonic.

* Convert aspell to an extendable package

Convert aspell to be extendable and rework the dictionaries to be
extensions.

As it stands, there's a great deal of cut and paste in the
dictionaries, I'll abstract that out next.

The {de,}activate methods copy a great deal of code out of
package.py.  Perhaps there's a better way....

* Create AspellDictPackage and use it for the dictionaries

Reduce the repeated code, pull it into a base class.

I'm confused about why 'from spack import *' wasn't more useful in the
base class.

* Oops, -de & -es should be AspellDictPackages too

* Typo: pakcage -> package

* Address some commentary

* Update copyright dates, 2016->2017
2017-10-09 14:14:19 -07:00
becker33
5d13f236b4 Fix setup for changes to dirty flag (#5592)
* Pass dirty arg through setup to setup_package
2017-10-09 10:01:55 -07:00
scheibelp
b08d457dfd Don't check package.installed in _mark_concrete if value=True (#5634)
* spec and spec.package.spec can refer to different objects in the
database. When these two instances of spec differ in terms of
the value of the 'concrete' property, Spec._mark_concrete can
fail when checking Spec.package.installed (which requires
package.spec to be concrete). This skips the check for
spec.package.installed when _mark_concrete is called with
'True' (in other words, when the database is marking all specs
as being concrete).

* add test to confirm this fixes #5293
2017-10-06 14:23:28 -07:00
Jimmy Tang
c6e7fb25a4 Fix formatting typo (#5622) 2017-10-05 10:58:51 -07:00
scheibelp
6243a28da1 Don't change properties on already-installed packages (#5580)
* edits to address issues where spack concretization attempts to set properties on already-installed specs

* most added checks only need to check if the spec is concrete; they dont also need to check if the package is installed

* add test to ensure that patches are not applied to an installed spec

* add test to ensure that an error is detected when a dependent requests a dependency constraint which conflicts with a requested installed dependency
2017-10-05 10:33:04 -07:00
becker33
04a4ac68d5 Identify the flag handlers feature as beta (#5609)
The flag-handling logic added in #4421 may change semantics, so this
commit adds a warning to the documentation for this feature.
2017-10-04 18:32:13 -07:00
becker33
328ab328be Fix module loads (#5599)
Fixes #5455

All methods within setup_package use an EnvironmentModifications object
to control the environment. Those modifications are applied at the end
of setup_package. Module loads for the build environment need to be
done after the rest of the environment modifications are applied, as
otherwise Spack may unset variables set by those modules (for example
LD_LIBRARY_PATH).
2017-10-04 18:25:55 -07:00
Massimiliano Culpo
3556eaae7e module files: restricted token expansion + case sensitivity (#5474)
closes #2884
closes #4684

In #1848 we decided to use `Spec.format` to expand certain tokens in
the module file naming scheme or in the environment variable name.
Not all the tokens that are allowed in `Spec.format` make sense in
module file generation. This PR restricts the set of tokens that can
be used, and adds tests to check that the intended behavior is respected.

Additionally, the names of environment variables set/modified by module
files were, up to now, always uppercase. There are packages though that
require case sensitive variable names to honor certain behaviors (e.g.
OpenMPI). This PR restricts the uppercase transformation in variable
names to `Spec.format` tokens.
2017-10-04 18:14:06 -07:00
scheibelp
395000c385 spec.patches: fix dictionary reference (#5608)
This fixes a loop that was iterating through the keys of a dictionary
when it was intending to use the values.
2017-10-04 17:14:58 -07:00
Massimiliano Culpo
5fa1191d17 Hotfix: maintain patch order while fixing hash
fixes #5587

In trying to preserve patch ordering, #5476 made equality inconsistent
for the added 'patches' variant. This commit maintains the original
weak ordering of patch applications while preserving consistency of
comparisons. The ordering DOES NOT enter the hashing mechanism. It's
supposed to be a hotfix, while we think of a cleaner and more-permanent
solution.
2017-10-04 11:39:25 -07:00
scheibelp
f53be46186 wrap generator with collection to avoid exhausting it with single iteration (#5586) 2017-10-03 16:47:07 -07:00
Christoph Junghans
d22ee8f993 patch: add workdir option (#5501)
* patch: add working_dir option
* added documentation
2017-10-02 22:56:43 -07:00
Todd Gamblin
29ca18e348 Port CTest's log scraping logic to Spack (#5561)
- This steals the magic regular expressions that CTest uses to parse log
  files and addds them to Spack.  See here:

  https://github.com/Kitware/CMake/blob/master/Source/CTest/cmCTestBuildHandler.cxx

  These are BSD licensed, so the port is in `externa/ctest_log_parser.py`

- We currently use these to do better filtering of errors from build
  output.  Plan is to use them to generate good CDash output.
2017-09-30 22:39:21 -07:00
Todd Gamblin
8648e2cda5 Add testing for spack blame; refactor llnl.util tests 2017-09-30 16:31:56 -07:00
Todd Gamblin
41a2652ef2 Add 'spack blame' command: shows contributors to packages
`spack blame` prints out the contributors to a package.

By modification time:

```
$ spack blame --time llvm
LAST_COMMIT    LINES  %      AUTHOR               EMAIL
3 days ago     2      0.6    Andrey Prokopenko    <andrey.prok@gmail.com>
3 weeks ago    125    34.7   Massimiliano Culpo   <massimiliano.culpo@epfl.ch>
3 weeks ago    3      0.8    Peter Scheibel       <scheibel1@llnl.gov>
2 months ago   21     5.8    Adam J. Stewart      <ajstewart426@gmail.com>
2 months ago   1      0.3    Gregory Becker       <becker33@llnl.gov>
3 months ago   116    32.2   Todd Gamblin         <tgamblin@llnl.gov>
5 months ago   2      0.6    Jimmy Tang           <jcftang@gmail.com>
5 months ago   6      1.7    Jean-Paul Pelteret   <jppelteret@gmail.com>
7 months ago   65     18.1   Tom Scogland         <tscogland@llnl.gov>
11 months ago  13     3.6    Kelly (KT) Thompson  <kgt@lanl.gov>
a year ago     1      0.3    Scott Pakin          <pakin@lanl.gov>
a year ago     3      0.8    Erik Schnetter       <schnetter@gmail.com>
3 years ago    2      0.6    David Beckingsale    <davidbeckingsale@gmail.com>

3 days ago     360    100.0
```

Or by percent contribution:

```
$ spack blame --percent llvm
LAST_COMMIT    LINES  %      AUTHOR               EMAIL
3 weeks ago    125    34.7   Massimiliano Culpo   <massimiliano.culpo@epfl.ch>
3 months ago   116    32.2   Todd Gamblin         <tgamblin@llnl.gov>
7 months ago   65     18.1   Tom Scogland         <tscogland@llnl.gov>
2 months ago   21     5.8    Adam J. Stewart      <ajstewart426@gmail.com>
11 months ago  13     3.6    Kelly (KT) Thompson  <kgt@lanl.gov>
5 months ago   6      1.7    Jean-Paul Pelteret   <jppelteret@gmail.com>
3 weeks ago    3      0.8    Peter Scheibel       <scheibel1@llnl.gov>
a year ago     3      0.8    Erik Schnetter       <schnetter@gmail.com>
3 years ago    2      0.6    David Beckingsale    <davidbeckingsale@gmail.com>
3 days ago     2      0.6    Andrey Prokopenko    <andrey.prok@gmail.com>
5 months ago   2      0.6    Jimmy Tang           <jcftang@gmail.com>
2 months ago   1      0.3    Gregory Becker       <becker33@llnl.gov>
a year ago     1      0.3    Scott Pakin          <pakin@lanl.gov>

3 days ago     360    100.0
```
2017-09-30 16:31:56 -07:00
George Hartzell
46d5901770 Typo: file -> directory (#5560)
Mirrors are directories (that use `file://` URLS, not files.
2017-09-30 14:32:07 -07:00
Todd Gamblin
96d2488e0c Documentation for dependency patching. 2017-09-30 02:06:59 -07:00
Todd Gamblin
4f8c7d57eb Patches are hashed with specs, and can be associated with dependencies.
- A package can depend on a special patched version of its dependencies.

  - The `Spec` YAML (and therefore the hash) now includes the sha256 of
    the patch in the `Spec` YAML, which changes its hash.

  - The special patched version will be built separately from a "vanilla"
    version of the same package.

  - This allows packages to maintain patches on their dependencies
    without affecting either the dependency package or its dependents.
    This could previously be accomplished with special variants, but
    having to add variants means the hash of the dependency changes
    frequently when it really doesn't need to.  This commit allows the
    hash to change *just* for dependencies that need patches.

  - Patching dependencies shouldn't be the common case, but some packages
    (qmcpack, hpctoolkit, openspeedshop) do this kind of thing and it
    makes the code structure mirror maintenance responsibilities.

- Note that this commit means that adding or changing a patch on a
  package will change its hash.  This is probably what *should* happen,
  but we haven't done it so far.

  - Only applies to `patch()` directives; `package.py` files (and their
    `patch()` functions) are not hashed, but we'd like to do that in the
    future.

- The interface looks like this: `depends_on()` can optionally take a
  patch directive or a list of them:

     depends_on(<spec>,
                patches=patch(..., when=<cond>),
                when=<cond>)
     # or
     depends_on(<spec>,
                patches=[patch(..., when=<cond>),
                         patch(..., when=<cond>)],
                when=<cond>)

- Previously, the `patch()` directive only took an `md5` parameter.  Now
  it only takes a `sha256` parameter.  We restrict this because we want
  to be consistent about which hash is used in the `Spec`.

- A side effect of hashing patches is that *compressed* patches fetched
  from URLs now need *two* checksums: one for the downloaded archive and
  one for the content of the patch itself.  Patches fetched uncompressed
  only need a checksum for the patch.  Rationale:

  - we include the content of the *patch* in the spec hash, as that is
    the checksum we can do consistently for patches included in Spack's
    source and patches fetched remotely, both compressed and
    uncompressed.

  - we *still* need the patch of the downloaded archive, because we want
    to verify the download *before* handing it off to tar, unzip, or
    another decompressor.  Not doing so is a security risk and leaves
    users exposed to any arbitrary code execution vulnerabilities in
    compression tools.
2017-09-30 02:06:59 -07:00
Todd Gamblin
14c141a410 add spack flake8 exception for long checksums 2017-09-30 02:06:59 -07:00
Todd Gamblin
bf610a379f Clean up exceptions and function names in directives.
- Functions returned by directives were all called `_execute`, which made
  reading stack traces hard because you couldn't tell what directive a
  frame came from.
  - renamed them all to `_execute_<directive>`

- Exceptions in directives were only really used in one or two places --
  get rid of the boilerplate init functions and let the callsite specify
  the message.
2017-09-30 02:06:59 -07:00
Todd Gamblin
94d85d842c Consolidate some web-spidering commands in spack.util.web
- move `spack.cmd.checksum.get_checksums` to `spack.util.web.spider_checksums`

- move `spack.error.NoNetworkError` to `spack.util.web.NoNetworkError` since
  it is only used there.
2017-09-30 02:06:59 -07:00
Todd Gamblin
2198a0e229 Disable duplicate cross-reference warnings in Sphinx. 2017-09-30 02:06:59 -07:00
Todd Gamblin
0e8bb9ec5e Refactor Package dependency metadata
- Previously, dependencies and dependency_types were stored as separate
  dicts on Package.
  - This means a package can only depend on another in one specific way,
    which is usually but not always true.
  - Prior code unioned dependency types statically across dependencies on
    the same package.

- New code stores dependency relationships as their own object, with a
  spec constraint and a set of dependency types per relationship.
  - Dependency types are now more precise
  - There is now room to add more information to dependency relationships.

- New Dependency class lives in dependency.py, along with deptype
  definitions that used to live in spack.spec.

Move deptype definitions to spack.dependency
2017-09-30 02:06:59 -07:00
Todd Gamblin
a3cb6b61ea Patch.apply() shouldn't affect working directory of caller. 2017-09-30 02:06:59 -07:00
Todd Gamblin
29ce69f3ed Only print "no patches needed" if there were no patches. 2017-09-30 02:06:59 -07:00
scheibelp
9e7faff6c9 Add test deptype (#5132)
* Add '--test=all' and '--test=root' options to test either the root or the root and all dependencies.
* add a test dependency type that is only used when --test is enabled.
* test dependencies are not added to the spec, but they are provided in the test environment.
2017-09-29 22:08:15 -07:00
Massimiliano Culpo
554937780b modules: specialized configure_options for external packages (#5543)
closes #5473

Prior to this PR we were not exiting early for external packages, which
caused the `configure_options` property of the contexts to fail with
e.g. a key error because the DAG gets truncated for them. More
importantly Spack configure options don't make any sense for externals.

Now we exit early, and leave a message in the module file clarifying
that this package has been installed outside of Spack.
2017-09-29 09:23:13 -07:00
Massimiliano Culpo
8864d145e9 module files: system paths are excluded from path inspection (#5460)
closes #5201

Currently, if a user sets an external package to have a prefix that is
one of the system paths (like '/usr') the module files that are
generated will prepend '/usr/bin' to 'PATH', etc. This is particularly
nasty at the time when a module file is unloaded, and e.g. paths like
'/usr/bin' will be discarded from PATH.

This PR solves the issue skipping system paths when a prefix inspection
is made to generate module files.
2017-09-25 09:47:50 -07:00
scheibelp
45a8c03bdf Prefer later versions of compilers by default (#5234)
* Prefer later versions of compilers by default

* update test to make it less fragile
2017-09-21 17:16:19 -07:00
Denis Davydov
234e00e84c update Blas/Lapack section of packaging guide (#5383) 2017-09-20 15:40:20 -07:00
Massimiliano Culpo
b1d129e681 Modulefiles generated with a template engine (#3183)
* Module files now are generated using a template engine refers #2902 #3173

jinja2 has been hooked into Spack.

The python module `modules.py` has been splitted into several modules
under the python package `spack/modules`. Unit tests stressing module
file generation have been refactored accordingly.

The module file generator for Lmod has been extended to multi-providers
and deeper hierarchies.

* Improved the support for templates in module files.

Added an entry in `config.yaml` (`template_dirs`) to list all the
directories where Spack could find templates for `jinja2`.

Module file generators have a simple override mechanism to override
template selection ('modules.yaml' beats 'package.py' beats 'default').

* Added jinja2 and MarkupSafe to vendored packages.

* Spec.concretize() sets mutual spec-package references

The correct place to set the mutual references between spec and package
objects at the end of concretization. After a call to concretize we
should now be ensured that spec is the same object as spec.package.spec.

Code in `build_environment.py` that was performing the same operation
has been turned into an assertion to be defensive on the new behavior.

* Improved code and data layout for modules and related tests.

Common fixtures related to module file generation have been extracted
in `conftest.py`. All the mock configurations for module files have been
extracted from python code and have been put into their own yaml file.

Added a `context_property` decorator for the template engine, to make
it easy to define dictionaries out of properties.

The default for `verbose` in `modules.yaml` is now False instead of True.

* Extendable module file contexts + short description from docstring

The contexts that are used in conjunction with `jinja2` templates to
generate module files can now be extended from package.py and
modules.yaml.

Module files generators now infer the short description from package.py
docstring (and as you may expect it's the first paragraph)

* 'module refresh' regenerates all modules by default

`module refresh` without `--module-type` specified tries to
regenerate all known module types. The same holds true for `module rm`

Configure options used at build time are extracted and written into the
module files where possible.

* Fixed python3 compatibility, tests for Lmod and Tcl.

Added test for exceptional paths of execution when generating Lmod
module files.

Fixed a few compatibility issues with python3.

Fixed a bug in Tcl with naming_scheme and autoload + unit tests

* Updated module file tutorial docs. Fixed a few typos in docstrings.

The reference section for module files has been reorganized. The idea is
to have only three topics at the highest level:

  - shell support + spack load/unload use/unuse
  - module file generation (a.k.a. APIs + modules.yaml)
  - module file maintenance (spack module refresh/rm)

Module file generation will cover the entries in modules.yaml

Also:

  - Licenses have been updated to include NOTICE and extended to 2017
  - docstrings have been reformatted according to Google style

* Removed redundant arguments to RPackage and WafPackage.

All the callbacks in `RPackage` and `WafPackage` that are not build
phases have been modified not to accept a `spec` and a `prefix`
argument. This permits to leverage the common `configure_args` signature
to insert by default the configuration arguments into the generated
module files. I think it's preferable to handling those packages
differently than `AutotoolsPackage`. Besides only one package seems
to override one of these methods.

* Fixed broken indentation + improved resiliency of refresh

Fixed broken indentation in `spack module refresh` (probably a rebase
gone silently wrong?). Filter the writers for blacklisted specs before
searching for name clashes. An error with a single writer will not
stop regeneration, but instead will print a warning and continue
the command.
2017-09-19 12:34:20 -07:00
Todd Gamblin
c7a789e2d6 Add --show-log-on-error option to spack install
- converted `log_path` and `env_path` to properties of PackageBase.

- InstallErrors in build_environment are now annotated with the package
  that caused them, in the 'pkg' attribute.

- Add `--show-log-on-error` option to `spack install` that catches
  InstallErrors and prints the log to stderr if it exists.

Note that adding a reference to the Pakcage allows a lot of stuff
currently handled by do_install() and build_environment to be handled
externally.
2017-09-17 18:52:25 -07:00
Todd Gamblin
742cd7f127 Remove redundant dest arguments in install.py 2017-09-17 18:52:25 -07:00
Todd Gamblin
eb0ea7697a Fix log error parsing bug introduced in c830eda0e (#5387)
- '\b' in regular expression needs to be in a raw string (r'\b')
- Regression test that would've caught this was unintentionally disabled

- This fixes the string and the test
2017-09-17 15:31:32 -07:00
Pramod S Kumbhar
9aafe21b63 Filter system paths from CMAKE_PREFIX_PATH (#5385) 2017-09-17 14:47:16 +02:00
Kelly (KT) Thompson
0558fd640e Improve external package location detection algorithm. (#5145)
Also inspect `PATH` to help locate an external package and provide a test for
getting path from module's PATH.

Fixes #5141
2017-09-16 13:26:29 -07:00
Denis Davydov
f710a520e5 set CMAKE_PREFIX_PATH for cmake packages (#5364)
* cmake: set CMAKE_PREFIX_PATH

* cmake: use build/link immediate dependencies to construct CMAKE_PREFIX_PATH
2017-09-16 13:14:03 -07:00
Massimiliano Culpo
90d50a0cee Force reference consistency between Spec & Package
The correct place to set the mutual references between spec and
package objects is at the end of concretization. After a call to
concretize we should now be ensured that spec is the same object
as spec.package.spec.

Code in `build_environment.py` that was performing the same
operation has been turned into an assertion to be defensive on
the new behavior.
2017-09-12 12:10:31 -07:00
Todd Gamblin
f8f1c308c9 clean up concreteness detection
- Fixes bugs where concretization would fail due to an erroneously cached
  _concrete attribute.

- Ripped out a bunch of code in spec.py that isn't needed/valid anymore:
  - The various concrete() methods on different types of Specs would
    attempt to statically compute whether the Spec was concrete.
  - This dates back to when DAGs were simpler and there were no optional
    dependencies.  It's actually NOT possible to compute statically
    whether a Spec is concrete now.  The ONLY way you know is if it goes
    through concretization and is marked concrete once that completes.
  - This commit removes all simple concreteness checks and relies only on
    the _concrete attribute.  This should make thinking about
    concreteness simpler.

- Fixed a couple places where Specs need to be marked concrete explicitly.
  - Specs read from files and Specs that are destructively copied from
    concrete Specs now need to be marked concrete explicitly.
  - These spots may previously have "worked", but they were brittle and
    should be explcitly marked anyway.
2017-09-11 17:13:21 -07:00
Todd Gamblin
8c42aed9d5 bugfix: concrete dependencies are now copied properly.
- Dependencies in concrete specs did not previously have their cache
  fields (_concrete, _normal, etc.) preserved.

- _dup and _dup_deps weren't passing each other enough information to
  preserve concreteness properly, so only the root was properly
  preserved.

- cached concreteness is now preserved properly for the entire DAG, not
  just the root.

- added method docs.
2017-09-11 17:13:21 -07:00
Todd Gamblin
14cd73ed3c Simplify logic in Spec.normalize() 2017-09-11 17:13:21 -07:00
Todd Gamblin
de7e99f866 Preserve original stack trace for UnsatisfiableSpecError 2017-09-11 17:13:21 -07:00
Massimiliano Culpo
32117c22de 'with_or_without' accepts bool variants
Fixes #4112

This commit extends the support of the AutotoolsPackage methods
`with_or_without` and `enable_or_disable` to bool-valued variants. It
also defines for those functions a convenience short-cut if the
activation parameter is the prefix of a spec (like in
`--with-{pkg}={prefix}`).

This commit also includes:

* Updates to viennarna and adios accordingly: they have been modified to
  use `enable_or_disable` and `with_or_without`
* Improved docstrings in `autotools.py`. Raise `KeyError` if name is
  not a variant.
2017-09-11 16:20:49 -07:00
Adam J. Stewart
2eb8db1dd2 Fix name detection in HeaderList and LibraryList (#5118)
* Fix name detection in HeaderList and LibraryList

* Add support for CUDA header files
2017-09-09 22:22:56 +02:00
Matthew Scott Krafczyk
51828dd982 Bootstrap environment-modules
Renames the existing bootstrap command to 'clone'. Repurposes
'spack bootstrap' to install packages that are useful to the
operation of Spack (for now this is just environment-modules).
For bash and ksh users running setup-env.sh, if a Spack-installed
instance of environment-modules is detected and environment modules
and dotkit are not externally available, Spack will define the 
'module' command in the user's shell to use the environment-modules
built by Spack.
2017-09-08 10:15:06 -07:00
Rob Latham
4f57c9651a dump environment in sourceable form (#5301)
First, quote the environment variable values.  Second, export the
variables. sorry, this is bourn-shell syntax.  Happy to consider a
shell-independent way to do this, but spack is already using sh-like
"env=value"
2017-09-07 17:07:03 -10:00
Michael Kuhn
84ae7872d3 Update copyright notices for 2017 (#5295) 2017-09-06 17:44:16 -10:00
Massimiliano Culpo
d1a5857a03 Added support for querying by tags (#4786)
* Added support to query packages by tags.
    - The querying commands `spack list`, `spack find` and `spack info` have
      been modified to support querying by tags. Tests have been added to
      check that the feature is working correctly under what should be the
      most frequent use cases.

* Refactored Repo class to make insertion of new file caches easier.
    - Added the class FastPackageChecker. This class is a Mapping from
      package names to stat info, that gets memoized for faster access.

    - Extracted the creation of a ProviderIndex to its own factory function.

* Added a cache file for tags.

    - Following what was done for providers, a TagIndex class has been added.
      This class can serialize and deserialize objects from json. Repo and
      RepoPath have a new method 'packages_with_tags', that uses the TagIndex
      to compute a list of package names that have all the tags passed as
      arguments.

      On Ubuntu 14.04 the effect if the cache reduces the time for spack list
      from ~3sec. to ~0.3sec. after the cache has been built.

* Fixed colorization of `spack info`
2017-09-05 15:44:42 -10:00
Massimiliano Culpo
41d8981ab5 Fixed bug in spack env due to missing argument. (#5280)
This command broke after #5109. It was using the default value for the
"dirty" argument in `setup_package`. Now it adopts the same logic as
in `spack install`. Changed help for '--clean' and '--dirty'. 
Improved coverage of spack env.
2017-09-05 17:15:25 +02:00
scheibelp
5342ecf364 Set default cmake build_type to Release for llvm
Override CMake "build_type" variant to default to "Release" for
llvm package.
2017-09-01 10:32:04 -07:00
Massimiliano Culpo
01eba56e64 Patch directive allows non-archives (#5197)
- Don't expand downloaded patch file if it is not gzipped/tar'd/zipped/etc.
2017-08-31 14:06:03 -10:00
Denis Davydov
b5a9f8ead1 add optional maintainers property to package (#5230)
* add optional package maintainers
2017-08-30 10:56:24 -07:00
Andrey Prokopenko
c830eda0e6 Slightly better error matching when parsing spack logs (#5236) 2017-08-30 00:56:17 -07:00
alalazo
462de9847c Added unit tests for Spec.__init__ exceptional paths 2017-08-29 00:44:43 -07:00
alalazo
bf7b861554 Fixed bug in Spec._dup, updated docstring
The private method `Spec._dup` was missing a line (when setting compiler
flags the parent spec was not set to `self`). This resulted in
an inconsistent state of the duplicated Spec. This problem has been
fixed here. The docstring of `Spec._dup` has been updated.
2017-08-29 00:44:43 -07:00
Todd Gamblin
ee93993b07 Make Spec construction simpler (#5227) 2017-08-29 00:02:25 -07:00
Matthew Scott Krafczyk
c94933343a Add --show-full-compiler option to 'spack find'
When 'spack find' is invoked with the '--show-full-compiler' option,
the compiler flags and version are shown for each spec that is found.
2017-08-28 10:35:46 -07:00
Massimiliano Culpo
005b22aa8b Removed default value for 'dirty' function argument. (#5109)
This change is done to avoid inconsistencies during refactoring. The rationale is that functions at different levels in the call stack all define a default for the 'dirty' argument. This PR removes the default value for all the functions except the top-level one (`PackageBase.do_install`).

In this way not defining 'dirty' will result in an error, instead of the default value being used. This will reduce the risk of having an inconsistent behavior after a refactoring.
2017-08-25 20:40:37 -07:00
Michael Kuhn
91143e9db4 Fix copyright years in spack create template (#5203) 2017-08-25 20:38:56 -07:00
Michael Kuhn
b94711a54f Improve Ubuntu arch detection (#2649)
Ubuntu uses a YY.{04,10} release scheme, where YY.04 is not necessarily
binary-compatible with YY.10.
2017-08-25 17:30:40 -07:00
scheibelp
499617897b Link extra_rpaths from compilers.yaml at build time (#5211) 2017-08-25 11:02:36 -07:00
Gregory Lee
9a1fd166aa patch config.guess for any ppc64le arch (#5215) 2017-08-25 10:55:41 -07:00
Todd Gamblin
313771c734 Improve grammar in build log error message. (#5214)
- "1 error found" instead of "1 errors found"

- don't print any build log context if no errors were found; just refer
  the user to the build log.
2017-08-25 04:07:42 -07:00
Mark C. Miller
a0f39397c1 Add contributors link to Sphinx docs (#5213) 2017-08-25 02:57:44 -07:00
Sergey Kosukhin
fda3249c8b Respect --insecure (-k) flag when fetching list_url. (#5178)
* Respect --insecure when fetching list_url.
* Ensure support for Python 2.6, and that urlopen works for python versions prior 2.7.9 and between 3.0 and 3.4.3.
2017-08-25 02:15:46 -07:00
Ben Boeckel
0e7071befe test/gpg: init from the testing key directory
The old testing pattern set an attribute on the parser directly. Now
that there is a parsed flag, use it instead.
2017-08-24 16:17:35 -07:00
Ben Boeckel
f564b2abf7 gpg: add an argument for the import directory
This is hidden because it is only meant for use by the tests.
2017-08-24 16:17:35 -07:00
Massimiliano Culpo
5d7901b312 Improve Spec literals, add Spec.from_dict() (#5151)
* Simplified Spec.__init__ signature by removing the *dep_like argument.

The `*dep_like` argument of `Spec.__init__` is used only for tests. This
PR removes it from the call signature and introduces an equivalent
fixture to be used in tests.

* Refactored ``spec_from_dict`` to be a static method of ``Spec``

The fixture ``spec_from_dict`` has been refactored to be a static method
of ``Spec``. Test code has been updated accordingly. Added tests for
exceptional paths.

* Renamed argument `unique` to `normal` + added LazySpecCache class

As requested in the review the argument `unique` of `Spec.from_literal`
has been renamed to `normal`. To avoid eager evaluations of
`Spec(spec_like)` expressions a subclass of `collections.defaultdict`
has been introduced.

* Spec object can be keys of the dictionary for a spec literal.

Added back the possibility use a spec directly as a key. This permits
to build DAGs that are partially normalized.
2017-08-23 14:20:40 -07:00
Christoph Junghans
fa1d0a8a4d Add --source option to spack install (#4102)
- -- source will copy source into prefix along with the package.
- added a test for --source, as well
2017-08-23 14:08:52 -07:00
healther
15186d4ae8 add test for lua and node patching in sbang (#5169)
* add test for lua and node handling in sbang patching (cf #5086)
2017-08-23 01:05:36 -07:00
Todd Gamblin
40e9171390 Add testing for new build output.
- Update handling of ChildError so that its output is capturable from a
  SpackCommand

- Update cmd/install test to make sure Python and build log output is
  being displayed properly.
2017-08-22 16:14:38 -07:00
Todd Gamblin
f51b541ef8 Make install command reusable within single Spack run
- install and probably other commands were designed to run once, but now
  we can to test them from within Spack with SpackCommand

- cmd/install.py assumed that it could modify do_install in PackageBase
  and leave it that way; this makes the decorator temporary

- package.py didn't properly initialize its stage if the same package had
  been built successfully before (and the stage removed).
  - manage stage lifecycle better and remember when Package needs to
    re-create the stage
2017-08-22 16:14:38 -07:00
Todd Gamblin
fa1faa61c4 SpackCommand uses log_output to capture command output. 2017-08-22 16:14:38 -07:00
Todd Gamblin
4f444c5f58 log_ouptut can take either a filename or a file object 2017-08-22 16:14:38 -07:00
Todd Gamblin
139d5bfa6b Display build output on ProcessError, instead of Python context.
- If a failure comes from an external command and NOT the Python code,
  display errors highlighted with some context.

- Add some rudimentary support for parsing errors out of the build log
  (not very sophisticated yet).

- Build errors in Python code will still display with Python context.
2017-08-22 16:14:38 -07:00
Todd Gamblin
d54110d208 Limit package context to 3 lines and colorize in error output. 2017-08-22 16:14:38 -07:00
Massimiliano Culpo
4600d106e2 Config scopes are now returning OrderedDicts instead of dicts. (#5183)
It seems 8f21332fec introduced a bug
in that normal dictionaries are returned from ConfigScope objects
instead of OrderedDicts. This is fixed here.
2017-08-22 14:20:19 -07:00
Matthew Scott Krafczyk
48bf1e276b Add environment variables to path substitution
Update documentation on config file variable substitutions and
add expansion of environment variables in config files.
2017-08-21 18:35:00 -07:00
Massimiliano Culpo
581f70ff6f Added custom messages for conflicts directive. fixes #4965 (#5083)
Users can now add an optional custom message to the conflicts directive.
Layout on screen has been changed to improve readability and the long
spec is shown in tree format. Two conflicts in `espresso` have been
modified to showcase the feature.
2017-08-21 09:20:07 -07:00
Todd Gamblin
10bb681b57 Unbuffer so that output from packages appears when redirecting
- Python I/O would not properly interleave (or appear) with output from
  subcommands.

- Add a flusing wrapper around sys.stdout and sys.stderr when
  redirecting, so that Python output is synchronous with that of
  subcommands.
2017-08-20 16:51:10 -07:00
Todd Gamblin
79045afada Add tests for output redirection. 2017-08-20 16:51:10 -07:00
Todd Gamblin
11196e7b69 Preserve verbosity across installs when 'v' is pressed.
- 'v' toggle was previously only good for the current install.
- subsequent installs needed user to press 'v' again.
- 'v' state is now preserved across dependency installs.
2017-08-20 16:51:10 -07:00
Todd Gamblin
48440766df Fix exit call in SpackError.die()
- Previously we would use `os._exit()` in to avoid Spack error handling
  in the parent process when build processes failed.  This isn't
  necessary anymore since build processes propagate their exceptions to
  the parent process.

- Use `sys.exit` instead of `os._exit`. This has the advantage of
  automatically flushing output streams on quit, so output from child
  processes is not lost when Spack exits.
2017-08-20 16:51:10 -07:00
Todd Gamblin
05cc6c966f Rework output redirection in Spack.
- Simplify interface to log_output. New interface requires only one
  context handler instead of two.  Before:

      with log_output('logfile.txt') as log_redirection:
           with log_redirection:
               # do things ... output will be logged

  After:

      with log_output('logfile.txt'):
          # do things ... output will be logged

  If you also want the output to be echoed to ``stdout``, use the
  `echo` parameter::

      with log_output('logfile.txt', echo=True):
          # do things ... output will be logged and printed out

  And, if you just want to echo *some* stuff from the parent, use
  ``force_echo``:

      with log_output('logfile.txt', echo=False) as logger:
          # do things ... output will be logged

          with logger.force_echo():
              # things here will be echoed *and* logged

  A key difference between this and the previous implementation is that
  *everything* in the context handler is logged.  Previously, things like
  `Executing phase 'configure'` would not be logged, only output to the
  screen, so understanding phases in the build log was difficult.

- The implementation of `log_output()` is different in two major ways:

  1. This implementation avoids race cases by using only one pipe (before
     we had a multiprocessing pipe and a unix pipe).  The logger daemon
     stops naturally when the input stream is closed, which avoids a race
     in the previous implementation where we'd miss some lines of output
     because the parent would shut the daemon down before it was done
     with all output.

  2. Instead of turning output redirection on and off, which prevented
     some things from being logged, this version uses control characters
     in the output stream to enable/disable forced echoing.  We're using
     the time-honored xon and xoff codes, which tell the daemon to echo
     anything between them AND write it to the log.  This is how
     `logger.force_echo()` works.

- Fix places where output could get stuck in buffers by flushing more
  aggressively.  This makes the output printed to the terminal the same
  as that which would be printed through a pipe to `cat` or to a file.
  Previously these could be weirdly different, and some output would be
  missing when redirecting Spack to a file or pipe.

- Simplify input and color handling in both `build_environment.fork()`
  and `llnl.util.tty.log.log_output()`.  Neither requires an input_stream
  parameter anymore; we assume stdin will be forwarded if possible.

- remove `llnl.util.lang.duplicate_stream()` and remove associated
  monkey-patching in tests, as these aren't needed if you just check
  whether stdin is a tty and has a fileno attribute.
2017-08-20 16:51:10 -07:00
Todd Gamblin
e0dd55e090 Make SpackCommand a bit more testable
- add fail_on_error argument
- record exception and return code when the command fails
2017-08-20 16:51:10 -07:00
Todd Gamblin
e77c1a20c5 Fix issue with color formatting regular expression. (#5171)
- Fix issue with color formatting regular expression.
  - _separators regex in spec.py could be constructed such that '^' came
    first in the character matcher, e.g. '[^@#/]'.  This inverts the match
    and causes transient KeyErrors.

  - Fixed to escape all characters in the constructed regex.

  - This bug comes up in Python3 due to its more randomized hash iteration
    order, but it could probably also happen in a Python 2 implementation.

- also clean up variable docstrings in spec.py
2017-08-20 15:34:35 -07:00
Todd Gamblin
bb10bc39ab Make test_inspect_path work on Mac OS X without XCode (#5168)
- Mac OS X Sierra has no /usr/include by default
- Instead of assuming there's an include directory in /usr, mock up a directory that looks like we expect.
2017-08-19 14:48:24 -07:00
healther
d6d2dff324 sbang support: add node-js and fix lua
This adds sbang hook support for node-js and fixes the sbang filter
for lua (the character class exclusion was swallowing newlines and
reporting a false positive if lua was mentioned anywhere in the 
file).
2017-08-18 11:57:52 -07:00
Axel Huebl
6472c39c2e Docs: Travis-CI Workflow (#5133)
* Docs: Travis-CI Workflow

Add a workflow how to use spack on Travis-CI.

Future Work:

depending if and how we can simplify 5101:
add a multi-compiler, multi-C++-standard, multi-software
build matrix example

* Fix Typos
2017-08-17 11:25:40 -05:00
Massimiliano Culpo
0f5582cefc Colorize spack info. Adds prominence to preferred version. (#4994)
* Colorize spack info. Adds prominence to preferred version. fixes #2708

This uses 'llnl.util.tty.color' to colorize the output of 'spack info'.
It also displays versions in the order the concretizer would choose
them and shows the preferred in a line on its own and in bold.

* Modified output according to Adam and Denis reviews.

Section titles are not bold + black, but bold + blue. Added a new
section named "Preferred version", which prints the preferred version
in bold characters.

* Further modifications according to Adam and Denis reviews.

After "Homepage:" we now have a single space. Removed newline after each
variant. Preferred version is not in bold fonts anymore. Added a simple
test that just runs the command.
2017-08-17 09:15:57 -07:00
Massimiliano Culpo
101693d823 Improved error message for unsatisfiable specs (#5113)
* Improved error message for unsatisfiable specs. fixes #5066

This PR improves the error message for unsatisfiable specs by showing in tree format both the spec that cannot satisfy the constraint and the spec that asked for that constraint. After that follows a readable error message.
2017-08-17 08:26:04 +02:00
Massimiliano Culpo
c16a68f517 Relaxed constraints on config.yaml structure (#5115)
This PR allows additional unused properties at the top-level of the config.yaml file. Having these properties permits to use two different versions of Spack, one of which adds a new property, without receiving error messages due to the presence of this new property in a configuration cache stored in the user's home.
2017-08-17 06:37:09 +02:00
Patrick Gartung
1c8bdd7e24 buildcache fixes: index.html & unsigned installs
This fixes a syntax error in the index.html file generated by the
"spack buildcache" command when creating build caches. This also
fixes support for installing unsigned binaries.
2017-08-16 19:03:14 -07:00
Adam J. Stewart
af02774b3e Add tab completion & update docs for buildcache
This adds tab completion and fixes some formatting issues in the
documentation for the "spack buildcache" command.
2017-08-16 13:58:09 -07:00
Adam J. Stewart
11b3ce27b7 Add better generator support to CMakePackage (#4988)
* Add better generator support to CMakePackage

* List valid CMake generators on error
2017-08-16 12:25:37 -05:00
Adam J. Stewart
db657d938d Refactor IntelInstaller into IntelPackage base class (#4300)
* Refactor IntelInstaller into IntelPackage base class

* Move license attributes from __init__ to class-level

* Flake8 fixes: remove unused imports

* Fix logic that writes the silent.cfg file

* More specific version numbers for Intel MPI

* Rework logic that selects components to install

* Final changes necessary to get intel package working

* Various updates to intel-parallel-studio

* Add latest version of every Intel package

* Add environment variables for Intel packages

* Update env vars for intel package

* Finalize components for intel-parallel-studio package

Adds a +tbb variant to intel-parallel-studio.
The tbb package was renamed to intel-tbb.
Now both intel-tbb and intel-parallel-studio+tbb
provide tbb.

* Overhaul environment variables set by intel-parallel-studio

* Point dependent packages to the correct MPI wrappers

* Never default to intel-parallel-studio

* Gather env vars by sourcing setup scripts

* Use mpiicc instead of mpicc when using Intel compiler

* Undo change to ARCH

* Add changes from intel-mpi to intel-parallel-studio

* Add comment explaining mpicc vs mpiicc

* Prepend env vars containing 'PATH' or separators

* Flake8 fix

* Fix bugs in from_sourcing_file

* Indentation fix

* Prepend, not set if contains separator

* Fix license symlinking broken by changes to intel-parallel-studio

* Use comments instead of docstrings to document attributes

* Flake8 fixes

* Use a set instead of a list to prevent duplicate components

* Fix MKL and MPI library linking directories

* Remove +all variant from intel-parallel-studio

* It is not possible to build with MKL, GCC, and OpenMP at this time

* Found a workaround for locating GCC libraries

* Typos and variable names

* Fix initialization of empty LibraryList
2017-08-16 12:21:07 -05:00
Patrick Gartung
ab56c742ca Create, install and relocate tarballs of installed packages
Adds the "buildcache" command to spack. The buildcache command is
used to create gpg signatures for archives of installed spack
packages; the signatures and archives are placed together in a
directory that can be added to a spack mirror. A user can retrieve
the archives from a mirror and verify their integrity using the
buildcache command. It is often the case that the user's Spack
instance is located in a different path compared to the Spack
instance used to generate the package archive and signature, so
this includes logic to relocate the RPATHs generated by Spack.
2017-08-14 14:32:27 -07:00
Massimiliano Culpo
5184edb15f Added a custom action for --clean and --dirty. (#5081)
The action `CleanOrDirtyAction` has been added. It sets the default
value for `dest` to `spack.dirty`, and changes it according to the flags
passed via command line. Added unit tests to check that the arguments
are parsed correctly. Removed lines in `PackageBase` that were setting
the default value of dirty according to what was in the configuration.
2017-08-14 11:29:18 -07:00
scheibelp
4d9ef49b49 Decode process stream only for python3
Popen.communicate outputs a str object for python2 and a bytes
object for python3. This updates the Executable.__call__ function
to call .decode on the output of Popen.communicate only for python3.
This ensures that Executable.__call__ returns a str for python2 and
python3.
2017-08-14 11:23:03 -07:00
Massimiliano Culpo
41c87a71a8 patch: get correct package directory for a given package
fixes #4236
fixes #5002

When a package is defined in more than one repository,
RepoPath.dirname_for_package_name may return the path
to either definition. This sidesteps that ambiguity by 
accessing the module associated with the package definition.
2017-08-11 19:18:52 -07:00
becker33
79f9548a9a bugfix for module_cmd (#5038)
* bugfix for modulecmd when bash is symlinked to sh

* update test to make sure module_cmd can interpret sh
2017-08-09 12:14:35 -07:00
Massimiliano Culpo
faeb1b77b2 Merged 'purge' command with 'clean' and deleted 'purge' (#4970)
* Merged 'purge' command with 'clean'. Deleted 'purge'. fixes #2942

'spack purge' has been merged with 'spack clean'. Documentation has been
updated accordingly. The 'clean' and 'purge' behavior are not mutually
exclusive, and they log brief information to tty while they go.

* Fixed a wrong reference to spack clean in the docs

* Added tests for 'spack clean'. Updated bash completion.
2017-08-09 10:02:38 -07:00
Sergey Kosukhin
e463461ed1 Bugfixes for compiler detection on the Cray platform. (#3075)
* Typo fixes in docstrings.

* Let OS classes know if the paths they get were explicitly specified by user.

* Fixed regexp for cray compiler version matching.

* Replaced LinuxDistro with CrayFrontend for the Cray platform's frontend.
2017-08-09 09:00:34 -07:00
scheibelp
5a94cee216 Variant satisfaction for indirect dependencies
Fixes #4898

Constraints that were supposed to be conditionally activated for
specified values of a single-valued variant were being activated
unconditionally in the case that the variant was associated with
an implicit dependency. For example if X->Y->Z and Y places a
conditional constraint on Z for a given single-valued variant on
Y, then it would have been applied unconditionally when
concretizing X.
2017-08-07 10:48:48 -07:00
Adam J. Stewart
a31ce17f0b Various fixes to package name URL parsing (#4978) 2017-08-05 10:15:47 -05:00
Adam J. Stewart
c7df12f698 Massive conversion from Package to CMakePackage (#4975) 2017-08-05 10:15:18 -05:00
Adam J. Stewart
7eb263effe Add a SConsPackage base class (#4936)
* Add a SConsPackage base class

* Make Matlab extendable

* Most dependencies are actually required

* Cantera requires older version of fmt
2017-08-04 16:52:10 -05:00
Adam J. Stewart
b8ed61cfea Make CMake the default build system (#4862) 2017-08-04 14:53:05 -05:00
Adam J. Stewart
452f382293 Add a QMakePackage base class (#4925)
* Add a QMakePackage base class

* Fix sqlite linking bug in qt-creator

* Add latest version of qt-creator

* Add latest version of qwt

* Use raw strings for regular expressions

* Increase minimum required version of qt

* Add comment about specific version of sqlite required

* Fixes for latest version of qwt and qt-creator

* Older versions of Qwt only work with older versions of Qt
2017-08-04 08:46:07 -07:00
Adam J. Stewart
4e269510c5 Fix trailing whitespace at the end of headers.cpp_flags (#4957) 2017-08-03 14:24:51 -05:00
George Hartzell
36496b9174 Fix crashes when running spack install under nohup (#4926)
* Fix crashes when running spack install under nohup

Fixes #4919

For reasons that I do not entire understand, duplicate_stream() throws
an '[Errno 22] Invalid argument' exception when it tries to
`os.fdopen()` the duplicated file descriptor generated by
`os.dup(original.fileno())`.  See spack/llnl/util/lang.py, line
394-ish.

This happens when run under `nohup`, which supposedly has hooked
`stdin` to `/dev/null`.

It seems like opening and using `devnull` on the `input_stream` in
this situation is a reasonable way to handle the problem.

* Be more specific about error being handled.

Only catch the specific error that happens when trying to dup
the stdin that nohup provides.

Catching e as a StandardErorr and then
`type(e).__name__` tells me that it's an OSError.

Printing e.errno tells me that it's 22

Double checking tells me that 22 is EINVAL.

Phew.
2017-08-03 10:33:16 -07:00
Sergey Kosukhin
963eb99b7f Account for hyphens in package names when searching for libraries. (#4948) 2017-08-03 09:17:07 +02:00
Todd Gamblin
44ce0adbd5 Fix color bug in Spec.format() introduced by #3013 2017-08-01 17:40:54 -07:00
Todd Gamblin
b88f55e523 Add spack dependencies command and tests for it and dependents. 2017-08-01 17:40:54 -07:00
Todd Gamblin
af3c794ab5 document and make display_specs more versatile 2017-08-01 17:40:54 -07:00
Todd Gamblin
b575d008bd Fix issue with case check and spack -m 2017-08-01 17:40:54 -07:00
Todd Gamblin
c8b2100630 Refactor installed_dependents -> installed_relatives 2017-08-01 17:40:54 -07:00
Todd Gamblin
36b3dd8cfe Package.possible_dependencies() descends into virtuals. 2017-08-01 17:40:54 -07:00
Todd Gamblin
b9606e3157 Add --transitive option to spack dependents 2017-08-01 17:40:54 -07:00
Todd Gamblin
6928cf7a68 spack dependents lists possible dependencies by default. 2017-08-01 17:40:54 -07:00
Todd Gamblin
bd94a17066 Remove last vestiges of "special" deptypes.
- Remove `special_types` dict in spec.py, as only 'all' is still used
- Still allow 'all' to be used as a deptype
- Simplify `canonical_deptype` function
- Clean up args in spack graph
- Add tests
2017-08-01 17:40:54 -07:00
Todd Gamblin
43f576cf19 Remove unused code. 2017-08-01 17:40:54 -07:00
Todd Gamblin
f2ddcfac5f Add --all argument to spack dependents
--all causes spack dependents to list all possible dependents for a
package, rather than actual dependents for an installed spec.
2017-08-01 17:40:54 -07:00
Adam J. Stewart
82735deafd Clarify docs on using a hash in a spec (#4908) 2017-07-31 13:13:39 -07:00
scheibelp
69a6c8ef78 Fix preference for X.Y version when mixed with X.Y.Z versions (#4922)
For packages which contain a mix of versions with formats X.Y and
X.Y.Z, if the user entered an X.Y version as a preference in
packages.yaml, Spack would get confused and favor any version A.B.Z
where X=A and Y=B. In the case where there is a mix of these version
types, this commit updates preferences so Spack will favor an exact
match.
2017-07-31 13:11:08 -07:00
paulhopkins
1c7e5724d9 Add --color=[always|never|auto] argument; fix color when piping (#3013)
* Disable spec colorization when redirecting stdout and add command line flag to re-enable
* Add command line `--color` flag to control output colorization
* Add options to `llnl.util.tty.color` to allow color to be auto/always/never
* Add `Spec.cformat()` function to be used when `format()` should have auto-coloring
2017-07-31 12:57:47 -07:00
Adam J. Stewart
b33f92da34 Improve version detection for URLs with dynamic after version (#4902) 2017-07-26 17:43:54 -05:00
Adam J. Stewart
07aec4366f Add universal build_type variant to CMakePackage (#4797)
* Add universal build_type variant to CMakePackage
* Override build_type in some packages with different possible values
* Remove reference to no longer existent debug variant
* Update CBTF packages with new build_type variant
* Keep note on build size of LLVM
2017-07-25 16:34:43 -07:00
Gregory Lee
42717bd8e8 fix config.guess patch for ppc64le (#4858)
* fix config.guess patch for ppc64le

* explicit patch for config.guess not required
2017-07-25 13:44:51 -07:00
Adam J. Stewart
250ee413e9 Change Version formatting properties and functions to return Version objects (#4834)
* Change version.up_to() to return Version() object
* Add unit tests for Version.up_to()
* Fix packages that expected up_to() to return a string
* Ensure that up_to() preserves separator characters
* Use version indexing instead of up_to
* Make all Version formatting properties return Version objects
* Update docs
* Tests need to test string representation
2017-07-24 13:02:13 -07:00
Todd Gamblin
f159246d1d Make testing spack commands simpler (#4868)
Adds SpackCommand class allowing Spack commands to be easily in Python

Example usage:

    from spack.main import SpackCommand
    info = SpackCommand('info')
    out, err = info('mpich')
    print(info.returncode)

This allows easier testing of Spack commands.

Also:
* Simplify command tests
* Simplify mocking in command tests.
* Simplify module command test
* Simplify python command test
* Simplify uninstall command test
* Simplify url command test
* SpackCommand uses more compatible output redirection
2017-07-22 21:27:54 -07:00
becker33
f962aba6ce Allow packages to control handling of compiler flags (#4421)
* Initial work on flag trapping using functions called <flag>_handler and default_flag_handler

* Update packages so they do not obliterate flags

* Added append to EnvironmentModifications class

* changed EnvironmentModifications to have append_flags method

* changed flag_val to be a tuple

* Increased test coverage

* added documentation of flag handling
2017-07-19 20:12:00 -07:00
Adam J. Stewart
5fc0243d35 Improve version detection of release versions (#4816) 2017-07-18 22:48:39 -05:00
becker33
d2a63d55fa Open ended variants (#4746)
* Change directives to allow open-ended variants more easily

* make None default to open-ended
2017-07-18 10:03:15 -07:00
Adam J. Stewart
1215c3b20c Change path to CMakeLists.txt to be relative to root, not pwd (#4420)
* Change path to CMakeLists.txt to be relative to root, not pwd

* Changes requested during code review

* Revert back to old naming of root_cmakelists_dir
* Make relative directory more clear in docs

* Revert change causing build_type AttributeError

* Fix forgotten abs_path var

* Update CLHEP with new relative path

* Update more packages with new root_cmakelists_dir syntax
2017-07-18 09:58:19 -07:00
Massimiliano Culpo
5a1ee22575 package: removed default no-op patch (#4103)
* package: removed default no-op patch fixes #4085

* do_patch: handles NoSuchMethodError nicely
2017-07-18 09:53:35 -07:00
George Hartzell
ff906faf9a Typo: submdoules -> submodules (#4716) 2017-07-12 07:48:31 +02:00
Gregory Lee
28cb1e4379 patch config.guess after autoreconf step (#4604) 2017-07-06 23:07:54 -05:00
Todd Gamblin
b4d1654e68 Parametrized lock test and make it work with MPI
- Lock test can be run either as a node-local test or as an MPI test.

- Lock test is now parametrized by filesystem, so you can test the
  locking capabilities of your NFS, Lustre, or GPFS filesystem.  See docs
  for details.
2017-07-04 11:41:37 -07:00
Todd Gamblin
bd7a591df1 Make filesytem more resilient to concurrent updates.
- Uses O_CREAT for touch (for guaranteed atomic open on NFS, multi-node)
- Ignore concurrent create errors in mkdirp
2017-07-04 11:41:37 -07:00
Todd Gamblin
326e2f7f66 Ported lock test to pytest. 2017-07-04 11:41:37 -07:00
Adam J. Stewart
9933d759ac Update hdfgroup packages to new URL structure (#4643)
* Update hdfgroup packages to new URL structure

* Update docs now that HDF5 URL isn't that complicated
2017-06-29 21:38:47 -05:00
EmreAtes
898c7f8838 add mpi to providers to remove virtual package error (#4608) 2017-06-28 12:24:29 -05:00
becker33
b1861b29ef Added install option to read spec from file (#4611) 2017-06-27 12:27:16 -07:00
Adam J. Stewart
ad1382e664 Don't immediately raise an error when an editor is not found (#4587)
* Don't immediately raise an error when an editor is not found
* If no editor is found, raise an error only if we try to use it.
2017-06-25 20:42:38 -07:00
Adam J. Stewart
e5ce7b1639 Allow arbitrary Prefix attributes (#4591)
* Allow arbitrary Prefix attributes
* Test attribute type as well

* Flake8 fixes

* Remove __new__ method

* Fewer uses of join_path in the docs
2017-06-24 22:39:31 -07:00
Todd Gamblin
cac4362f64 Make LICENSE recognizable by GitHub. (#4598) 2017-06-24 22:22:55 -07:00
Massimiliano Culpo
b7ca7274b8 mv variants: packages are now needed only during normalization (#4129)
* mv variants: packages are now needed only during normalization

The relationship among different types of variants have been weakened,
in the sense that now it is permitted to compare MV, SV and BV among
each other. The mechanism that permits this is an implicit conversion
of the variant passed as argument to the type of the variant asking
to execute a constrain, satisfies, etc. operation.

* asbtract variant: added a new type of variant

An abstract variant is like a multi valued variant, but behaves
differently on "satisfies" requests, because it will reply "True"
to requests that **it could** satisfy eventually.

Tests have been modified to reflect the fact that abstract variants
are now what get parsed from expressions like `foo=bar` given by users.

* Removed 'concrete=' and 'normal=' kwargs from Spec.__init__

These two keyword arguments where only used in one test module to force
a Spec to 'appear' concrete. I suspect they are just a leftover from
another refactoring, as now there's the private method '_mark_concrete'
that does essentially the same job. Removed them to reduce a bit the
clutter in Spec.

* Moved yaml related functions from MultiValuedVariant to AbstractVariant.

This is to fix the erros that are occurring in epfl-scitas#73, and that
I can't reproduce locally.
2017-06-23 13:36:29 -07:00
becker33
689c1d2f0c fix issue #4577 (#4579) 2017-06-21 18:33:11 -05:00
becker33
a113101126 Module cmd fix (#3250)
* Parse modules in a way that works for both lmod and tcl

* added test and made method more robust

* refactoring for pythonic clarity

* Improved detection of 'module' shell function + refactored module utilities into spack.util.module_cmd

* Improved regex to reject nested parentheses we are not prepared to handle

* make tests backwards compatible with python 2.6

* Improved regex to account for sh being aliased to bash and used in bash module definition on some systems

* Improve test compatibility with lmod

* Added error for None module_cmd

* Add test for get_module_cmd_from_which()

Add test for get_module_cmd_from_which().
Add -c argument to Popen call to typeset -f module in get_module_cmd_from_bash().

* Increased detection options

Included BASH_FUNC_module() variable outside of typeset as a detection option
This should work on bash even in restricted_shell mode
Kept the typeset detection as an option in case the module function is not exported in bash

Also added try statements to tests, with environment recreation in finally blocks.

* More tests added; some hackiness

* increased test coverage for util/module_cmd
2017-06-21 09:58:41 -07:00
becker33
541496dfe1 System config (#4518)
* Code changes to enable system config scope in /etc

Files will go in either /etc/spack or /etc/spack/<platform>
Required minor changes to conftest.

* Updated documentation to match new config scope
2017-06-16 12:31:56 -07:00
Todd Gamblin
790b06e0c3 bugfix: support EDITOR values with spaces (#4523)
- previous code called `which` on $EDITOR, but that doesn't work for
  EDITORs like `emacs -nw` or `emacsclient -t -nw`.

- This patch just trusts EDITOR if it is set (same as previous
  behavior), and only uses the defaults if it's not.
2017-06-16 14:03:21 +02:00
Massimiliano Culpo
8b5e94976d issue 4492: DependencyMap.concrete checks for unconditional dependencies (#4499)
* issue 4492: added xfailing test, added owner to DependencyMap

* DependencyMap.concrete checks if we have unconditional dependencies

This fixes #4492 and #4107 using some heuristics to avoid an infinite
recursion among Spec.satisfies, Spec.concrete and DependencyMap.concrete

The idea, as suggested by @becker33, is to check just for unconditional
dependencies. This is not covering the whole space and a package with
just conditional dependencies can still fail in the same way. It should
cover though all the **real** packages we have in our repo so far.
2017-06-16 12:41:15 +02:00
Mario Melara
da67ee9790 Fix tests on cray (#4298)
* Check for CRAYPE_VERSION instead of path

Architecture tests would fail on Cray since it would not find
the expected path. To make the test correctly work on Cray search
for the CRAYPE version instead.

* Catch SystemExit error in case flake8 not in path

On shared systems having flake8 can involve starting own virtual env.
Skip the test if no flake8 is found to avoid failure reporting.

* Add compatibility to 1.5 svnadmin create

The flag added is needed to correctly create svn repos on NERSC systems.
This could be unnecessary for other sites. I'd like to see others
test before this change gets merged.
2017-06-15 15:16:14 -07:00
Adam J. Stewart
41e4a034ff Add latest version of JDK (#4317)
* Add latest version of JDK

* Use a more specific URL to get curl to work

* Remove failing unit test
2017-06-15 12:40:55 +02:00
Todd Gamblin
8c2447272e Fix dashes in variant parsing (#4498)
- Skip spack flake8 test when flake8 is not installed.
- Fix parsing of dashes in specs broken by new help parser.
    - use argparse.REMAINDER instead of narg='?'
    - don't interpret parts of specs like -mpi as arguments.
2017-06-15 11:32:55 +02:00
Adam J. Stewart
e627447417 Prefer vim to vi for default editor (#4230)
* vim > vi
* Allow which to accept multiple args
* Update __init__ to use which with multiple args
* Fix doc tests
2017-06-15 11:27:18 +02:00
Nicolas Richart
f06c23ef42 Adding package namd (#4321)
* Initial version of the namd package

* Modified charm to consider compile against intel/intel-mpi

* Correction of namd to compile with intel-mkl and intel compiler

* Adding inclue64 in the prefix

* adding property for the build directory

* removing useless function build
2017-06-14 13:11:30 -05:00
scheibelp
1e69d9d1a9 Override partial installs by default - part three (#4331)
* During install, remove prior unfinished installs

If a user performs an installation which fails, in some cases the
install prefix is still present, and the stage path may also be
present. With this commit, unless the user specifies
'--keep-prefix', installs are guaranteed to begin with a clean
slate. The database is used to decide whether an install finished,
since a database record is not added until the end of the install
process.

* test updates

* repair_partial uses keep_prefix and keep_stage

* use of mock stage object to ensure that stage is destroyed when it should be destroyed (and otherwise not)

* add --restage option to 'install' command; when this option is not set, the default is to reuse a stage if it is found.
2017-06-13 09:15:51 -07:00
Adam J. Stewart
0de653ff01 Add an installcheck phase to MakefilePackage (#4476)
* Add an installcheck phase to MakefilePackage

* Minor changes to ESMF
2017-06-12 09:47:46 -05:00
Todd Gamblin
c67f647785 Move description to top of spack info (#4475) 2017-06-09 21:02:16 -07:00
Adam J. Stewart
36b8ea2f92 Add default list_url for GitLab, BitBucket, and CRAN (#4439)
* Add default list_url for GitLab, BitBucket, and CRAN

* Fix flake and doc tests
2017-06-09 12:28:39 -05:00
Adam J. Stewart
218992862c Move gpg section of docs to Getting Started (#4446) 2017-06-09 12:27:29 -05:00
Adam J. Stewart
85fd8f0b31 Fix url parse offset for SourceForge downloads (#4458) 2017-06-09 08:53:40 +02:00
Adam J. Stewart
1b9af88572 Supress output from gpg --version during tests (#4441) 2017-06-07 11:52:28 -05:00
Stas Sergienko
8018f6cdf6 Fixed duplicated spec: nag@6.1 line in getting started guide (#4445) 2017-06-07 11:50:56 -05:00
Adam J. Stewart
d9d5135ec9 Fix spack info bug for Python 3 (#4391) 2017-05-30 13:37:56 -05:00
Adam J. Stewart
f9ac965fb9 Document known issue with R concretization (#4313) 2017-05-27 12:51:03 -05:00
Adam J. Stewart
d3a82ce632 Fix typo in mod_to_class docstring (#4371) 2017-05-26 22:05:54 -05:00
Adam J. Stewart
6f0ac9d54c Add --configure-args/vars support to RPackage (#4289)
* Add --configure-args/vars support to RPackage

* Docstring formatting change
2017-05-26 16:37:06 -05:00
Ben Boeckel
f38d250e50 gpg: add 'spack gpg subcommand (#3845)
- Add a `spack gpg` subcommand in anticipation of signed binaries.
- GPG keys are stored in var/spack/gpg, and the spack gpg command manages them.
- Docs are included on the command.
2017-05-26 10:31:04 -07:00
George Hartzell
26440accab Touch up string expansion. (#4344)
* Touch up string expansion.

I'm chasing this:

```
$ (module purge; spack install perl %gcc/5.4.0)
==> Error: No installed spec matches the hash: '%s'
```

There's something deeper going on, but the error message isn't helpful.

After this change it tells me this:

```
$ (module purge; spack install perl %gcc/5.4.0)
==> Error: No installed spec matches the hash: '5.4.0'
```

Which is weird because `5.4.0` is not a hash...  Whatever is going on here, the error message needs to be fixed.

* Flake8 whitespace
2017-05-25 13:00:58 -05:00
becker33
12ab882eba Fix issues parsing multiple anonymous specs (#4199)
* fix parser
* Removed xfails
* cleaned up debug print statements
* make use of these changes in gcc
* Added comment explaining unreachable line, line left for added protection
2017-05-24 17:13:18 -07:00
Adam J. Stewart
315bda3487 Fix PGI version detection: 17.4-0 -> 17.4 (#4251) 2017-05-24 06:57:31 -05:00
Todd Gamblin
32c570913d Move doc dependencies to requirements.txt for readthedocs (#4280)
* Move doc dependencies to requirements.txt for readthedocs

* Move sphinx to doc requirements.
2017-05-17 20:45:03 -05:00
Todd Gamblin
3e8662aaa7 fix bug with executables setting their own environment. (#4237) 2017-05-17 11:37:06 -05:00
Adam J. Stewart
cafc3cc3ca Sphinx no longer supports Python 2.6 (#4266)
* Sphinx no longer supports Python 2.6

* Update vendored sphinxcontrib.programoutput from 0.9.0 to 0.10.0

* Documentation cannot be built in parallel

* Let Travis install programoutput for us

* Remove vendored sphinxcontrib-programoutput

Recent updates to the sphinx package prevent the vendored version
from being found in sys.path. We don't vendor sphinx, so it doesn't
make sense to vendor sphinxcontrib-programoutput either.
2017-05-17 11:36:02 -05:00
Adam J. Stewart
b630c06773 Sphinx no longer ignores first argument (#4243)
* Sphinx no longer ignores first argument
* Duplicate first argument for maximum compatibility
2017-05-16 14:24:35 -07:00
Adam J. Stewart
1a6b4afe7f Add helpful error message for uncompressed downloads (#4205) 2017-05-12 09:52:01 -05:00
Adam J. Stewart
e7973dd290 Fix typo in PythonPackage documentation (#4221) 2017-05-11 19:05:02 -05:00
Massimiliano Culpo
f8b3eff01c filesystem.py: fixed bug introduced in #3367 (scrambled order in output) (#4156)
PR #3367 inadvertently changed the semantics of _find_recursive and
_find_non_recursive so that the returned list are not ordered as the
input search list. This commit restores the original semantic, and adds
tests to verify it.
2017-05-11 10:29:08 -07:00
Massimiliano Culpo
306f158c73 cp2k: fixed compilation issues for intel stack
Added DFLAGS to the `make.inc` file being written.
These macros are also added to the language specific variables
like CFLAGS, CXXFLAGS and FCFLAGS. Changed `spec.satisfies('foo')`
with `'foo' in spec` in `intel-mkl`, see #4135. Added a basic
build interface to `intel-mpi`.
2017-05-09 18:46:42 +02:00
Massimiliano Culpo
3efa9bd296 spec_syntax: added xfailing tests for cases in #4144 (#4151)
It seems that parse_anonymous_spec may fail if more than one part
(variant, version range, etc.) is given to the function. Added tests to
code against to fix the problem in #4144.
2017-05-08 13:24:37 -07:00
Todd Gamblin
ff3b5d88e4 rework spack help (#3033)
- Full help is now only generated lazily, when needed.
  - Executing specific commands doesn't require loading all of them.
  - All commands are only loaded if we need them for help.

- There is now short and long help:
  - short help (spack help) shows only basic spack options
  - long help (spack help -a) shows all spack options
  - Both divide help on commands into high-level sections

- Commands now specify attributes from which help is auto-generated:
  - description: used in help to describe the command.
  - section: help section
  - level: short or long

- Clean up command descriptions

- Add a `spack docs` command to open full documentation
  in the browser.

- move `spack doc` command to `spack pydoc` for clarity

- Add a `spack --spec` command to show documentation on 
  the spec syntax.
2017-05-08 13:18:29 -07:00
Massimiliano Culpo
85b0ebe836 BarrierTimeoutError must derive from Exception (#4157)
Seen in https://travis-ci.org/LLNL/spack/builds/229484526, very likely
due to a problem in the Travis builder.
2017-05-07 22:06:39 -07:00
Adam J. Stewart
cf93f49462 Fix PGI compiler detection on PowerPC (#4150) 2017-05-07 22:04:52 -07:00
Massimiliano Culpo
4e44d39f1a Spec.__init__: removed dead code (#4146)
The conditionals are repeated in the statement before _add_dependencies
2017-05-07 21:53:02 -07:00
Adam J. Stewart
73896e9481 Remind developers to update tab completion script (#4148) 2017-05-05 18:52:28 -05:00
Adam J. Stewart
9b49dfdc2a Fix typos in Basic Installation Tutorial (#4127) 2017-05-05 13:05:56 -05:00
Massimiliano Culpo
85b4b15d9a SV variants are evaluated correctly in "when=" (#4118)
* SV variants are evaluated correctly in `when=` statements fixes #4113

The problem here was tricky:
```python
spec.satisfies(other)
```
changes already the MV variants in others into SV variants (where
necessary) if spec is concrete. If it is not concrete it does
nothing because we may be acting at a pure syntactical level.

When evaluating a `when=` keyword spec is for sure not concrete
as it is in the middle of the concretization process. In this case we
have to trigger manually the substitution in other to not end up
comparing a MV variant "foo=bar" to a SV variant "foo=bar" and having
False in return. Which is wrong.

* sv variants: improved error message for typos in "when=" statements
2017-05-04 11:01:02 -07:00
Denis Davydov
7592971cb1 add transitive run dependencies of direct build dependencies 2017-05-04 08:43:06 +02:00
scheibelp
bee105fbb9 Merge pull request #4069 from davydden/fix_transitive_build_dep
only add direct build-only dependencies to PATH
2017-05-03 18:41:26 -07:00
Matthew Scott Krafczyk
6e14b97f84 Update cray compiler options (#4086) 2017-05-03 12:05:15 -05:00
Massimiliano Culpo
ae9a9e019a spack: no stacktrace if not in debug mode + fix emacs variant (#4098)
* spack: no stacktrace if not in debug mode + fix emacs variant

* emacs: removed dead code
2017-05-03 06:21:37 +02:00
Adam J. Stewart
1336630f17 Add link to spack view docs in command index (#4082) 2017-05-02 11:20:45 -05:00
Denis Davydov
708d8586ea add run-time dependencies of direct build-time dependencies to PATH 2017-05-02 08:43:37 +02:00
Denis Davydov
ef5da08f80 only add direct build-only dependencies to PATH 2017-05-01 22:58:24 +02:00
Massimiliano Culpo
9e4b0eb34a Multi-valued variants (#2386)
Modifications:
- added support for multi-valued variants
- refactored code related to variants into variant.py
- added new generic features to AutotoolsPackage that leverage multi-valued variants
- modified openmpi to use new features
- added unit tests for the new semantics
2017-05-01 13:08:47 -07:00
Todd Gamblin
32dd20035f Skip fetch tests for tools that are not installed. (#4059)
This allows people on systems that don't have all the fetchers to still
run Spack tests. Mark tests that require git, subversion, or mercurial to
be skipped if they're not installed.
2017-05-01 11:53:16 -07:00
Massimiliano Culpo
aa9da358b5 url_parse: ported to pytest (#3430) 2017-05-01 08:57:49 -07:00
Massimiliano Culpo
f60134cdb1 namespace_trie: ported to pytest (#4060) 2017-05-01 08:53:50 -07:00
Adam J. Stewart
2511520b32 Add a WafPackage base class (#3975)
* Add a WafPackage base class

* Correct comment in docstring

* Be more specific about the Python versions supported
2017-05-01 08:00:09 -07:00
Massimiliano Culpo
b3ce04cba3 url_substitution: ported to pytest (#4032) 2017-05-01 01:41:48 -07:00
Denis Davydov
c7a5b2eaa9 disable rpaths on Darwin when arg=-r mode=ccld (#3930)
This fixes build of Ipopt package.
2017-04-30 19:16:28 -07:00
Sergey Kosukhin
4421013290 Updated cc wrapper: switch from ld to vcheck if version is requested. (#2501) 2017-04-30 19:08:49 -07:00
Adam J. Stewart
1f303c9ac8 Don't add system paths to PATH (#3910)
* Filter all system paths introduced by dependencies from PATH
* Make sure path filtering works *even* for trailing slashes
* Revert some of the changes to `filter_system_paths`
* Yes, `bin64` is a real thing (sigh)
* add tests: /usr, /usr/, /usr/local/../bin, etc.
* Convert from rST to Google-style docstrings
2017-04-30 18:43:44 -07:00
Massimiliano Culpo
8551ef3874 spack_yaml: ported to pytest (#4033) 2017-04-30 17:27:40 -07:00
Massimiliano Culpo
6a01612ad4 file_list: ported to pytest (#4054) 2017-04-30 10:09:04 -07:00
Christoph Junghans
ea2f6b89e9 fetch: do full clone of git submodules (fix #3956) (#3958)
The required hash of a submodule might point to the
non-HEAD commit of the current main branch and hence
would lead to a "no such remote ref" at checkout in
a shallow submodule.
2017-04-29 17:58:52 -07:00
Adam J. Stewart
ce3ab503de Python command, libraries, and headers (#3367)
## Motivation

Python installations are both important and unfortunately inconsistent. Depending on the Python version, OS, and the strength of the Earth's magnetic field when it was installed, the name of the Python executable, directory containing its libraries, library names, and the directory containing its headers can vary drastically. 

I originally got into this mess with #3274, where I discovered that Boost could not be built with Python 3 because the executable is called `python3` and we were telling it to use `python`. I got deeper into this mess when I started hacking on #3140, where I discovered just how difficult it is to find the location and name of the Python libraries and headers.

Currently, half of the packages that depend on Python and need to know this information jump through hoops to determine the correct information. The other half are hard-coded to use `python`, `spec['python'].prefix.lib`, and `spec['python'].prefix.include`. Obviously, none of these packages would work for Python 3, and there's no reason to duplicate the effort. The Python package itself should contain all of the information necessary to use it properly. This is in line with the recent work by @alalazo and @davydden with respect to `spec['blas'].libs` and friends.

## Prefix

For most packages in Spack, we assume that the installation directory is `spec['python'].prefix`. This generally works for anything installed with Spack, but gets complicated when we include external packages. Python is a commonly used external package (it needs to be installed just to run Spack). If it was installed with Homebrew, `which python` would return `/usr/local/bin/python`, and most users would erroneously assume that `/usr/local` is the installation directory. If you peruse through #2173, you'll immediately see why this is not the case. Homebrew actually installs Python in `/usr/local/Cellar/python/2.7.12_2` and symlinks the executable to `/usr/local/bin/python`. `PYTHONHOME` (and presumably most things that need to know where Python is installed) needs to be set to the actual installation directory, not `/usr/local`.

Normally I would say, "sounds like user error, make sure to use the real installation directory in your `packages.yaml`". But I think we can make a special case for Python. That's what we decided in #2173 anyway. If we change our minds, I would be more than happy to simplify things.

To solve this problem, I created a `spec['python'].home` attribute that works the same way as `spec['python'].prefix` but queries Python to figure out where it was actually installed. @tgamblin Is there any way to overwrite `spec['python'].prefix`? I think it's currently immutable.

## Command

In general, Python 2 comes with both `python` and `python2` commands, while Python 3 only comes with a `python3` command. But this is up to the OS developers. For example, `/usr/bin/python` on Gentoo is actually Python 3. Worse yet, if someone is using an externally installed Python, all 3 commands may exist in the same directory! Here's what I'm thinking:

If the spec is for Python 3, try searching for the `python3` command.
If the spec is for Python 2, try searching for the `python2` command.
If neither are found, try searching for the `python` command.

## Libraries

Spack installs Python libraries in `spec['python'].prefix.lib`. Except on openSUSE 13, where it installs to `spec['python'].prefix.lib64` (see #2295 and #2253). On my CentOS 6 machine, the Python libraries are installed in `/usr/lib64`. Both need to work.

The libraries themselves change name depending on OS and Python version. For Python 2.7 on macOS, I'm seeing:
```
lib/libpython2.7.dylib
```
For Python 3.6 on CentOS 6, I'm seeing:
```
lib/libpython3.so
lib/libpython3.6m.so.1.0
lib/libpython3.6m.so -> lib/libpython3.6m.so.1.0
```
Notice the `m` after the version number. Yeah, that's a thing.

## Headers

In Python 2.7, I'm seeing:
```
include/python2.7/pyconfig.h
```
In Python 3.6, I'm seeing:
```
include/python3.6m/pyconfig.h
```
It looks like all Python 3 installations have this `m`. Tested with Python 3.2 and 3.6 on macOS and CentOS 6

Spack has really nice support for libraries (`find_libraries` and `LibraryList`), but nothing for headers. Fixed.
2017-04-29 17:24:13 -07:00
Adam J. Stewart
4bfba146d5 Add tests to MakefilePackage (#4039) 2017-04-28 14:55:28 -05:00
Massimiliano Culpo
59ac047996 No compiler found: fixed error message (#4034)
When a compiler was not found a stacktrace was displayed to user because
there were three arguments to be substituted in a string with only two
substitutions to be done.
2017-04-28 08:37:47 -05:00
scheibelp
9a67e95686 Reindex checks install for non-external packages (#4027)
Fixes #4026

#1167 updated Database.reindex to keep old installation records to
support external packages. However, when a user manually removes a
prefix and reindexes this kept the records so the packages were
still installed according to "spack find" etc. This adds a check
for non-external packages to ensure they are properly installed
according to the directory layout.
2017-04-27 15:23:09 -07:00
Adam J. Stewart
0488654f67 Prevent spack test flake8 from making changes (#4023) 2017-04-27 15:18:38 -05:00
Adam J. Stewart
a0ebce0cb3 Remove 'release' suffix from package name (#4014) 2017-04-27 10:11:59 -07:00
Adam J. Stewart
d83ae6dcff Don't print successfully uninstalled twice (#4019) 2017-04-27 10:11:35 -07:00
Todd Gamblin
2d9dac9af0 Fix Python3 issue with sbang checking; add tests. (#4017) 2017-04-27 09:21:35 -07:00
Todd Gamblin
455cae01c2 Convert rest docstrings to Google docstrings. (#3994)
- Sometimes you need something mindless to do.
- Sometimes it can be helpful, as well.
2017-04-27 07:45:34 -07:00
Massimiliano Culpo
a6986312ba pattern: ported to pytest (#4015) 2017-04-27 07:45:04 -07:00
Adam J. Stewart
91b32f67cc Fix alignment of versions and urls in spack checksum (#4003) 2017-04-26 15:55:35 -07:00
Massimiliano Culpo
0403a08509 link_tree: ported to pytest (#4008) 2017-04-26 15:36:35 -07:00
Todd Gamblin
b3ba9bdb37 Add __format__ support to version for fancy formatting. (#3996)
- add Version.__format__ to support new-style formatting.
- Python3 doesn't handle this well -- it delegates to
  object.__format__(), which raises an error for fancy format strings.
- not sure why it doesn't call str(self).__format__ instead, but that's
  hwo things are.
2017-04-26 11:06:34 -07:00
Adam J. Stewart
eaa50d3b7c Add API Docs for lib/spack/llnl (#3982)
* Add API Docs for lib/spack/llnl
* Clean up after previous builds
* Better fix for purging API docs
2017-04-25 22:24:02 -07:00
Adam J. Stewart
11dae722c2 Fix bug with '# noqa' filtering (#3993) 2017-04-25 22:23:01 -07:00
Todd Gamblin
3e508884fa spack flake8 should exempt line-wrapped directives (#3990)
- Omit final paren from regular expressions in cmd/flake8.py
- Allows long directives to be exempted even if they are wrapped.
2017-04-25 12:58:24 -07:00
Massimiliano Culpo
fc9896ed45 hooks take spec as an argument (instead of pkg) (#3967) 2017-04-25 12:54:53 -07:00
Adam J. Stewart
58f2a947db Properly ignore flake8 F811 redefinition errors (#3932)
* Properly ignore flake8 F811 redefinition errors
* Add unit tests for flake8 command
* Allow spack flake8 to work on systems with older git
* Skip flake8 unit tests for Python 2.6 and 3.3
2017-04-25 11:01:25 -07:00
Todd Gamblin
99a8297add Rename tutorial_sc16.rst to tutorial.rst (#3974)
- make the name more generic for posterity.
2017-04-24 15:25:41 -07:00
Adam J. Stewart
c144c88302 Use six.moves.input instead of raw_input (#3961)
* Use six.moves.input instead of raw_input

* Remove comment mentioning raw_input
2017-04-23 10:32:08 -05:00
Massimiliano Culpo
3b52d0a883 External packages are now registered in the DB (#1167)
* treats correctly a change from `explicit=False` to `explicit=True` in an external package DB entry.
* added unit tests
* fixed issues raised by @tgamblin . In particular the PR is no more hash-changing for packages that are not external.
* added a test to check correctness of a spec/yaml round-trip for things that involve an external
* Don't find external module path at each step of concretization
    * it's not necessary.. The paths are retrieved at the end of concretizaion
* Don't find replacements for external packages.
* Test root of the DAG if external
    * No reason not to test if the root of the DAG is external when external
packages are now first class citizens!
* Create `external` property for Spec (for external_path and external_module)
* Allow users to specify external package paths relative to spack
    * Canonicalize external package paths so that users may specify their
locations relative to spack's directory.
* Update tests to use new external_path and external properly.
* skip license hooks on external
2017-04-22 18:06:27 -07:00
Adam J. Stewart
fc8106afe3 Find more versions from GitHub (#3952) 2017-04-22 17:31:22 -05:00
Denis Davydov
94a0cca080 add Intel mpi package and add MPI wrappers to Intel parallel studio (#3905)
* intel-mpi: add new package

* fix hashes

* fix typo

* flake8

* add install

* blank line

* error

* add bin64

* fix MPI wrappers in intel-parallel-studio

* add missing I_MPI_FC

* use shorter hashes
2017-04-22 07:30:51 -05:00
Todd Gamblin
9f0b94b4e1 PythonPackage builds flat installs instead of egg directories.
- Spack doesn't need eggs -- it manages its own directories

- Simplify install layout and reduce sys.path searches by installing all
  packages flat (eggs are deprecated for wheels, and this is also what
  wheels do).

- We now supply the --single-version-externally-managed argument to
  `setup.py install` for setuptools packages and setuptools.

- modify packages to only use setuptools args if setuptools is an
  immediate dependency

- Remove setuptools from packages that do not need it.

  - Some packages use setuptools *only* when certain args (likeb
    'develop' or 'bdist') are supplied to setup.py, and they specifically
    do not use setuptools for installation.

  - Spack never calls setup.py this way, so just removing the setuptools
    dependency works for these packages.
2017-04-21 23:35:02 -07:00
Christoph Junghans
0b002c2911 fetch git submodules recursively (#3779)
* fetch git submodules recursively

This is useful if the submodules have submodules themselves. On
the other hand doing a recursive update doesn't hurt if there
is only one level.

* fetch submodules with depth=1 as well (fix #2190)

* use git submodule with depth only for git>=1.8.4
2017-04-21 21:59:30 -07:00
Todd Gamblin
ead58cbb90 spack uninstall no longer requires a known package. (#3915)
- Spack install would previously fail if it could not load a package for
  the thing being uninstalled.

- This reworks uninstall to handle cases where the package is no longer
  known, e.g.:
    a) the package has been renamed or is no longer in Spack
    b) the repository the package came from is no longer registered in
       repos.yaml
2017-04-21 16:52:44 -07:00
Todd Gamblin
c67f8e4aa1 Fix ABI detection issues with macOS gcc. (#3854)
- gcc on macOS says it's version 4.2.1, but it's really clang, and it's
  actually the *same* clang as the system clang.

- It also doesn't respond with a full path when called with
  --print-file-name=libstdc++.dylib, which is expected from gcc in abi.py.
  Instead, it gives a relative path and _gcc_compiler_compare doesn't
  understand what to do with it.  This results in errors like:

  ```
  lib/spack/spack/abi.py, line 71, in _gcc_get_libstdcxx_version
      libpath = os.readlink(output.strip())
  OSError: [Errno 2] No such file or directory: 'libstdc++.dylib'
  ```

- This commit does two things:

  1. Ignore any gcc that's actually clang in abi.py.  We can probably do
     better than this, but it's not clear there is a need to, since we
     should handle the compiler as clang, not gcc.

  2. Don't auto-detect any "gcc" that is actually clang anymore.  Ignore
     it and expect people to use clang (which is the default macOS
     compiler anyway).

Users can still add fake gccs to their compilers.yaml if they want, but
it's discouraged.
2017-04-21 15:45:12 -07:00
Todd Gamblin
63c3410370 Fix checksumming in Python3; add more fetch tests (#3941)
* Checksum code wasn't opening binary files as binary.

- Fixes Python 3 issue where files are opened as unicode text by default,
  and decoding fails for binary blobs.

* Simplify fetch test parametrization.

* - add tests for URL fetching and checksumming.
- fix coverage on interface functions in FetchStrategy superclass
- add some extra crypto tests.
2017-04-21 15:36:15 -07:00
Adam J. Stewart
5250e8ee89 Fix HPL build, convert to MakefilePackage (#3777)
* Fix HPL build, convert to MakefilePackage

* Flake8 fix

* Fix: spec -> self.spec

* Properly query for system libraries

* Update Intel-MKL as well

* Recurse in system libs, fix MKL path, fixes lapack_libs
2017-04-21 12:11:29 -05:00
Adam J. Stewart
21e4a81de0 Add Napoleon extension to support Google docstrings (#3920) 2017-04-20 08:32:21 -07:00
Todd Gamblin
beeca6bb54 Revert "Override partial installs by default" (#3918)
* Revert "Override partial installs by default (#3530)"

This reverts commit a65c37f15d.
2017-04-20 03:53:41 -07:00
Massimiliano Culpo
50d7b33563 test/python_version.py: ported to pytest (#3438) 2017-04-20 01:18:52 -07:00
scheibelp
a65c37f15d Override partial installs by default (#3530)
* Package install remove prior unfinished installs

Depending on how spack is terminated in the middle of building a
package it may leave a partially installed package in the install
prefix. Originally Spack treated the package as being installed if
the prefix was present, in which case the user would have to
manually remove the installation prefix before restarting an
install. This commit adds a more thorough check to ensure that a
package is actually installed. If the installation prefix is present
but Spack determines that the install did not complete, it removes
the installation prefix and starts a new install; if the user has
enabled --keep-prefix, then Spack reverts to its old behavior.

* Added test for partial install handling

* Added test for restoring DB

* Style fixes

* Restoring 2.6 compatibility

* Relocated repair logic to separate function

* If --keep-prefix is set, package installs will continue an install from an existing prefix if one is present

* check metadata consistency when continuing partial install

* Added --force option to make spack reinstall a package (and all dependencies) from scratch

* Updated bash completion; removed '-f' shorthand for '--force' for install command

* dont use multiple write modes for completion file
2017-04-19 21:59:18 -07:00
Adam J. Stewart
e12f2c1855 Set proper deptypes for certain build systems (#3866)
* Set proper deptypes for certain build systems

* Add depends_on to namespace
2017-04-19 21:33:14 -07:00
Adam J. Stewart
f4858cb7a7 Rework Spack's Mercurial support (#3834)
* Add tests to mercurial package

* Add support for --insecure with mercurial fetching

* Install man pages and tab-completion scripts

* Add tests and latest version for all deps

* Flake8 fix

* Use certifi module to find CA certificate

* Flake8 fix

* Unset PYTHONPATH when running hg

* svn_fetch should use to svn-test, not hg-test

* Drop Python 3 support in Mercurial

Python 3 support is a work in progress and isn't currently
recommended:

https://www.mercurial-scm.org/wiki/SupportedPythonVersions

* Test both secure and insecure hg fetching

* Test both secure and insecure git and svn fetching
2017-04-19 18:59:04 -07:00
Adam J. Stewart
5aa273b319 Fix flake8 changed files detection (#3855) 2017-04-15 11:46:28 -05:00
Adam J. Stewart
bd1beedaf5 Allow users to set parallel jobs in config.yaml (#3812)
* Allow users to set parallel jobs in config.yaml

* Undo change from endash to emdash

* Remove parallel config, rename jobs to build_jobs
2017-04-15 08:31:00 -07:00
Ben Boeckel
6574ec3143 stage: remove a rogue period (#3846) 2017-04-14 17:51:54 -05:00
Adam J. Stewart
bec6d99b15 Add documentation on explicit param for do_install (#3823) 2017-04-14 08:13:14 -07:00
Mario Melara
0405505e21 Quick fix for #3153 (#3822) 2017-04-14 07:56:51 -07:00
Adam J. Stewart
e12e9996e4 Document commands that no longer work (#3781) 2017-04-12 10:46:00 -05:00
Denis Davydov
c9da92dc97 doc: start with known issues section (#3722) 2017-04-10 08:20:57 -05:00
Adam J. Stewart
8e4ada5e99 Make it more clear that version ranges are inclusive (#3759) 2017-04-10 07:25:48 -05:00
Massimiliano Culpo
10c395b2f5 Abinit: a few modernizations for the package and its dependencies (#3699)
* libxc: added libs interface

* hdf5: added libs interface, added conflicts

* abinit: modernized package to use build interface

* netcdf-fortran: added libs interface

* abinit: added version 8.2.2
2017-04-07 11:18:34 +02:00
George Hartzell
84208523f9 set_executable can set S_IX{GRP,OTH} (#3742)
`set_executable` now checks if a user/group.other had read permission
on a file and if it does then it sets the corresponding executable
bit.

See #1483.
2017-04-06 16:25:13 -05:00
Max Katz
a526bcaf11 Correct uninstall -d to uninstall -R in tutorial (#3740)
-d was changed to -R as of PR #1917
2017-04-06 15:44:43 -05:00
Todd Gamblin
715ac8b7e6 Update copyright on the docs. (#3718) 2017-04-05 18:34:17 -07:00
Adam J. Stewart
df150b3e92 spack create MakefilePackage (#3710)
* spack create MakefilePackage

* Change default Perl template to match other build systems
2017-04-05 18:00:42 -05:00
scheibelp
9e50d16f13 Merge pull request #2789 from paulhopkins/features/allow_package_installation_directory_to_be_configured
Allow installation directory layout to be configured
2017-04-05 10:45:11 -07:00
Paul Hopkins
95c3cff6be Allow installation directory layout to be configured using either hash
length parameter or spec formatting.
2017-04-05 12:08:56 +01:00
scheibelp
0038ea84a1 Avoid null reference in arch concretization (#2596)
Fixes #2587

The concretizer falls back on using the root architecture (followed
by the default system architecture) to fill in unspecified arch
properties for a spec. It failed to check cases where the root could
be None.
2017-04-04 15:03:52 -07:00
Massimiliano Culpo
20f388cebd Fixes #3675: Abinit: invalid spec on concretization #(3686) 2017-04-04 07:03:11 -07:00
Justin Cook
508c96d046 Update getting_started.rst (#3685)
Fixed typo referring to .bashrc file
2017-04-04 06:50:44 -05:00
Adam J. Stewart
50df071ad9 Overhaul Spack's URL parsing (#2972)
* Remove fake URLs from Spack

* Ignore long lines for URLs that start with ftp:

* Preliminary changes to version regexes

* New redesign of version regexes

* Allow letters in version-only

* Fix detection of versions that end in Final

* Rearrange a few regexes and add examples

* Add tests for common download repositories

* Add test cases for common tarball naming schemes

* Finalize version regexes

* spack url test -> spack url summary

* Clean up comments

* Rearrange suffix checks

* Use query strings for name detection

* Remove no longer necessary url_for_version functions

* Strip off extraneous information after package name

* Add one more test

* Dot in square brackets does not need to be escaped

* Move renaming outside of parse_name_offset

* Fix versions for a couple more packages

* Fix flake8 and doc tests

* Correctly parse Python, Lua, and Bio++ package names

* Use effective URLs for mfem

* Add checksummed version to mitos

* Remove url_for_version from STAR-CCM+ package

* Revert changes to version numbers with underscores and dashes

* Fix name detection for tbb

* Correctly parse Ruby gems

* Reverted mfem back to shortened URLs.

* Updated instructions for better security

* Remove preferred=True from newest version

* Add tests for new `spack url list` flags

* Add tests for strip_name_suffixes

* Add unit tests for version separators

* Fix bugs related to parseable name but in parseable version

* Remove dead code, update docstring

* Ignore 'binary' at end of version string

* Remove platform from version

* Flip libedit version numbers

* Re-support weird NCO alpha/beta versions

* Rebase and remove one new fake URL

* Add / to beginning of regex to avoid picking up similarly named packages

* Ignore weird tar versions

* Fix bug in url parse --spider when no versions found

* Less strict version matching for spack versions

* Don't rename Python packages

* Be a little more selective, version must begin with a digit

* Re-add fake URLs

* Fix up several other packages

* Ignore more file endings

* Add parsing support for Miniconda

* Update tab completion

* XFAILS are now PASSES for 2 web tests
2017-04-03 15:34:16 -07:00
Massimiliano Culpo
ffef681377 new directive: conflicts() (#3125)
* Add conflicts(<spec>) directive
* openblas: added conflicts for intel@16 refs #3119
* added brief docs and unit tests
2017-04-02 11:40:09 -07:00
Todd Gamblin
0e785e0500 Add epigraph in docs. 2017-04-01 15:32:06 -07:00
Todd Gamblin
221f179716 Add better tests for web.py; fix some bugs found with spidering.
- _spider in web.py was actually failing to spider deeper than a certain
  point.
- Fixed multiprocessing pools to not use daemons and to allow recursive
  spawning.
- Added detailed tests for spidering and for finding archive versions.
- left some xfail URL finding exercises for the reader.
- Fix noqa annotations for some @when decorators
2017-04-01 15:10:45 -07:00
Adam J. Stewart
28d6d375b4 Fix Python 3 support in spack versions
- Add missing import, fixes spack versions in Python 2
- Fix spack versions in Python 3
2017-04-01 15:10:45 -07:00
Kenneth Hoste
fb98f9ee19 fix annoying 'fatal: Not a git repository' error message (#3657)
fix annoying 'fatal: Not a git repository' error message produced by 'spack list' when Spack is not run from a Git repository (#3657)
2017-04-01 03:29:06 -07:00
Gregory Lee
12c1216c34 fix flake8 ignore syntax (use E instead of ignore) (#3651) 2017-03-31 17:51:09 -07:00
Massimiliano Culpo
0c44dd28bb test/package_sanity.py: ported to pytest (#3474) 2017-03-31 13:42:04 -07:00
Massimiliano Culpo
ee7753a597 test/versions.py: ported to pytest (#3635) 2017-03-31 13:41:48 -07:00
Todd Gamblin
a8bcc23fe7 Spack works with Python 3
- Update version guard in spack script to allow python 3
- Update min required version in the docs
2017-03-31 13:40:41 -07:00
Todd Gamblin
3f21f2b088 Clean up tests and add Python3 to Travis.
- Clean up spec_syntax tests: don't dependend on DB order.
- spec_syntax hash parsing tests were strongly dependent on the order the
  DB was traversed.
- Tests now specifically grab the specs they want from the mock DB.
- Tests are more readable as a result.

- Add Python3 versions to Travis tests.
2017-03-31 13:40:41 -07:00
Todd Gamblin
7f3f493024 Fix concretization bugs with virtuals and deptypes.
1. Fix #2807: Can't depend on virtual and non-virtual package

- This is tested by test_my_dep_depends_on_provider_of_my_virtual_dep in
  the concretize.py test.

- This was actually working in the test suite, but it depended on the
  order the dependencies were resolved in. Resolving non-virtual then
  virtual worked, but virtual, then non-virtual did not.

- Problem was that an unnecessary copy was made of a spec that already
  had some dependencies set up, and the copy lost half of some of the
  dependency relationships.  This caused the "can'd depend on X twice
  error".

- Fix by eliminating unnecessary copy and ensuring that dep parameter of
  _merge_dependency is always safe to own -- i.e. it's a defensive copy
  from somewhere else.

2. Fix bug and simplify concretization of deptypes.

- deptypes weren't being accumulated; they were being set on each
  DependencySpec. This could cause concretization to get into an infinite
  loop.

- Fixed by accumulating deptypes in DependencySpec.update_deptypes()

- Also simplified deptype normalization logic: deptypes are now merged in
  constrain() like everything else -- there is no need to merge them
  specially or to look at dpeendents in _merge_dependency().

- Add some docstrings to deptype tests.
2017-03-31 13:40:41 -07:00
Todd Gamblin
fe6f39b662 Use key sorting instead of cmp()
- Get rid of pkgsort() usage for preferred variants.
- Concretization is now entirely based on key-based sorting.
- Remove PreferredPackages class and various spec cmp() methods.
- Replace with PackagePrefs class that implements a key function for
  sorting according to packages.yaml.
- Clear package pref caches on config test.
- Explicit compare methods instead of total_ordering in Version.
- Our total_ordering backport wasn't making Python 3 happy for some
  reason.
- Python 3's functools.total_ordering and spelling the operators out
  fixes the problem.
- Fix unicode issues with spec hashes, json, & YAML
- Try to use str everywhere and avoid unicode objects in python 2.
2017-03-31 13:40:41 -07:00
Todd Gamblin
0cd6555388 Resolve Python2/Python3 unicode issues by using str()
- Remove ascii encoding assumption from spack_yaml
- proc.communicate() returns bytes; convert to str before adding.
- Fix various byte string/unicode issues for Python 2/3 support
- Need to decode subprocess output as utf-8 in from_sourcing_files.
- Fix comments in strify()
2017-03-31 13:40:41 -07:00
Todd Gamblin
1d1a14dbe9 Convert Python 2 idioms to Python 2/3-compatible ones.
- convert print, StringIO, except as, octals, izip
- convert print statement to print function
- convert StringIO to six.StringIO
  - remove usage of csv reader in Spec, in favor of simple regex
  - csv reader only does byte strings
- convert 0755 octal literals to 0o755
- convert `except Foo, e` to `except Foo as e`
- fix a few places `str` is used.
  - may need to switch everything to str later.
- convert iteritems usages to use six.iteritems
- fix urllib and HTMLParser
- port metaclasses to use six.with_metaclass
- More octal literal conversions for Python 2/3
- Fix a new octal literal.
- Convert `basestring` to `six.string_types`
- Convert xrange -> range
- Fix various issues with encoding, iteritems, and Python3 semantics.
- Convert contextlib.nested to explicitly nexted context managers.
- Convert use of filter() to list comprehensions.
- Replace reduce() with list comprehensions.
-  Clean up composite: replace inspect.ismethod() with callable()
- Python 3 doesn't have "method" objects; inspect.ismethod returns False.
- Need to use callable in Composite to make it work.
- Update colify to use future division.
- Fix zip() usages that need to be lists.
- Python3: Use line-buffered logging instead of unbuffered.
- Python3 raises an error with unbuffered I/O
  - See https://bugs.python.org/issue17404
2017-03-31 13:40:41 -07:00
Todd Gamblin
0331b08c64 Update externals to work with Python 3
- Update YAML version to support Python 3
- Python 3 support for ordereddict backport
- Exclude Python3 YAML from version tests.
- Vendor six into Spack.
- Make Python version-check tests work with Python 3
- Add ability to add version check exceptions with '# nopyqver' line
  comments.
2017-03-31 13:40:41 -07:00
Adam J. Stewart
bc404532ea PythonPackage: Let There Be Tests! (#2869)
* Run python setup.py test if --run-tests
* Attempt to import the Python module after installation
* Add testing support to numpy and scipy
* Remove duplicated comments
* Update to new run-tests callback methodology
* Remove unrelated changes for another PR
2017-03-31 13:39:07 -07:00
Michael Kuhn
0d421137f4 Fix mxml (#3639)
mxml is now hosted on GitHub.
2017-03-31 13:41:08 -05:00
Milton Woods
9e43ff821c Extendable Perl (#3614)
* perl: make extendable and add Module::Build package
* perl: allow 'spack create' to identify perl packages from their contents
* perl-module-build: fix indenting of package docstring
* perl: split install() method for extensions into phases
* perl: auto-detect build method (Makefile.PL vs Build.PL) and define a 'check' method
* PerlPackage: use import statements similar to those in AutotoolsPackage
* PerlModule: fix detection of Build.PL
* PerlPackageTemplate: remove extraneous lines to avoid flake8 warnings
* PerlPackageTemplate: split into separate templates for Makefile.PL and Build.PL
* PerlPackage: add cross-references to docstrings
* AutotoolsPackage: fix ambiguous cross-references to avoid errors in doc tests
* PerlbuildPackageTemplate: depend on perl-module-build if Build.PL exists
2017-03-30 16:38:58 -07:00
Todd Gamblin
782f29bc4b Fix bug in spack find for installations with unknown namespaces. (#3573)
- Spack find would fail with "unknown namespace" for some queries when a
  package from an unknown namespace was installed.

- Solve by being conservative: assume unknown packages are NOT providers
  of virtual dependencies.
2017-03-28 08:43:43 -07:00
Todd Gamblin
e549daa8ce Bugfix: allow deactivating installs that don't have packages anymore. (#3572)
- deactivate -a wouldn't work if the installation's package was no longer
  available.

- Fix installed_extensions_for so that it doesn't need to look at the
  package.py file.
2017-03-28 08:43:15 -07:00
Denis Davydov
61d01a71dd make git fetching quite (#3180)
also output repo and branch/commit/tag in one line
2017-03-24 17:37:47 -07:00
Adam J. Stewart
4ecfc39e1e Add Expect package (#3517)
* Add Expect package

* Ignore patches during flake8 tests for package.py files

* Remove controversial changes
2017-03-23 14:35:11 -05:00
George Hartzell
9b5f5fccf0 Fix for find --explicit #3374 (#3492)
This fixes the problem described in #3374, which describes `spack find` ignore explicit/implicit.

I believe that this was broken in #2626.

This restores the behavior of implicit/explicit for me.

I believe that it does not screw anything else up, but ....
2017-03-21 15:30:38 -07:00
scheibelp
19dca26f3a Improve output for compiler commands (#3480)
* Order listed compiler sections

"spack compiler list" output compiler sections in an arbitrary order.
With this commit compiler sections are ordered primarily by compiler
name and then by operating system and target.

* Compiler search lists config files with compilers

If a compiler entry is already defined in a configuration file that
the user does not know about, they may be confused when that compiler
is not added by "spack compiler find". This commit adds a message at
the end of "spack compiler find" to inform the user of the locations
of all config files where compilers are defined.
2017-03-20 12:36:44 -07:00
Matthew LeGendre
5ac6421f14 Fix issue with config.guess patching when the overwritten config.guess did not have write permissions. (#3494) 2017-03-20 12:35:38 -07:00
Todd Gamblin
1297e47463 Use byte-encoded UTF-8 for sourced environment in Python 2 (#3489)
- Fixes recurring errors on develop with unicode commit characters.
- still Python3-proof: python3 will use str instead of bytestrings.
2017-03-18 22:48:20 -07:00
Adam J. Stewart
10b767b93f Don't use @system in packages.yaml (#3472) 2017-03-17 07:55:55 -07:00
scheibelp
0b27a7e13d Detect when OS updates affect compiler selection (#3410)
Fixes #1476

Concretization uses compilers defined in config files and if those
are not available defaults to searching typical paths where the
detected operating system would have a compiler. If there is an OS
update, the detected OS can change; in this case all compilers
defined in the config files would no longer match (because they would
be associated with the previous OS version). The error message in
this case was too vague. This commit adds logic for detecting when it
is likely that the OS has been updated (in particular when that
affects compiler concretization) and improves the information provided
to the user in the error message.
2017-03-16 21:08:13 -07:00
scheibelp
5936ad2ca7 Dont propagate flags between different compilers (#3379)
* Dont propagate flags between different compilers

Fixes #2786

Previously when a spec had no parents with an equivalent compiler,
Spack would default to adding the compiler flags associated with the
root of the DAG. This eliminates that default.

* added test for compiler flag propagation

* simplify compiler flag propagation logic
2017-03-16 21:07:35 -07:00
scheibelp
9a27dec8e8 Dont auto-init compiler conf for 'compiler find' (#3439)
Fixes #3428

Users can run 'spack compiler find' to automatically initialize their
compilers.yaml configuration file. It also turns out that Spack will
implicitly initialize the compilers configuration file as part of
detecting compilers if none are found (so if a user were to attempt to
concretize a spec without running 'spack compiler find' it would not
fail). However, in this case Spack was overlooking its own implicit
initialization of the config files and would report that no new
compilers were found. This commit removes implicit initialization when
the user calls 'spack compiler find'.

This did not surface until #2999 because the 'spack compiler' command
defaulted to using a scope 'user/platform' that was not accounted for
in get_compiler_config (where the implicit initialization logic
predates the addition of this new scope); #2999 removed the scope
specification when checking through config files, leading to the
implicit initialization.
2017-03-16 11:24:34 -07:00
Adam J. Stewart
dca4d2b15e Consistent docs and usage of env mod methods (#3351) 2017-03-14 22:26:44 -07:00
Denis Davydov
560d28ac7f fix automatic mixing of clang with gfortran 6.3.0 on macOS (#3427)
* fix automatic mixing of clang with gfortran 6.3.0 on macOS
* automatically mix any gfortran with any clang on macOS
* adjust the unit test
2017-03-14 09:48:27 -07:00
Massimiliano Culpo
8c3edfd36f test/file_cache.py: ported to pytest (#3429) 2017-03-14 09:07:04 -07:00
Todd Gamblin
d11e262b36 Fix from_sourcing_files(): decode json input as utf-8 (#3433) 2017-03-13 15:52:36 -07:00
Erik Schnetter
63a8f79980 Correct inconsistency in comment (#3414) 2017-03-11 12:52:08 -06:00
Todd Gamblin
e3101808ae Make multimethods work with inheritance. (#3411)
Previously, this would fail with a NoSuchMethodError:

    class Package(object):
        # this is the default implementation
        def some_method(self):
            ...

    class Foo(Package):
        @when('platform=cray')
        def some_method(self):
            ...

        @when('platform=linux')
        def some_method(self):
            ...

This fixes the implementation of `@when` so that the superclass method
will be invoked when no subclass method matches.

Adds tests to ensure this works, as well.
2017-03-11 05:48:36 -08:00
scheibelp
e727f56d89 Features/compiler config consistency (#2999)
* default scope for config command is made consistent with cmd/__init__ default

* dont specify a scope when looking for compilers with a matching spec (since compiler concretization is scope-independent)

* config edit should default to platform-specific file only for compilers

* when duplicate compiler specs are detected, the exception raised now points the user to the files where the duplicates appear

* updated error message to emphasize that a spec is duplicated (since multiple specs can reference the same compiler)

* 'spack compilers' is now also broken down into sections by os and target

* Added tests for new compiler methods
2017-03-10 13:58:48 -08:00
Gregory Lee
604b75c1f9 created elf virtual package and updated dependent packages (#3317)
* created elf virtual package and updated dependent packages
* added `hide_files` context manager to handle moving files.
2017-03-09 10:36:32 -08:00
Massimiliano Culpo
f1d66467e3 package.py: packages dump build dependencies in prefix (#3373)
Modifications:
- `dump_packages` copies build dependencies into `$prefix/.spack`, as well as the link/run dependencies that we already copied there.
- fake installs copy dependency packages into `$prefix/.spack` as well
2017-03-07 07:05:45 -08:00
Massimiliano Culpo
c6d9a45f18 test/environment.py: ported to pytest, added a test on separators (#3375) 2017-03-07 07:03:12 -08:00
Adam J. Stewart
a2d70a45fb Allow find_libraries to accept lists or strings (#3363)
* Allow find_libraries to accept lists or strings

* Convert one more example from list to string
2017-03-04 11:23:57 -06:00
Joschka Lingemann
7ef95767ee Fix error raised for multiple virtual packages. (#3306) 2017-03-03 16:30:32 -06:00
Massimiliano Culpo
ed582cef68 New interface for passing build information among specs (#1875)
- Added a new interface for Specs to pass build information
  - Calls forwarded from Spec to Package are now explicit
  - Added descriptor within Spec to manage forwarding
  - Added state in Spec to maintain query information
  - Modified a few packages (the one involved in spack install pexsi) to showcase changes

- This uses an object wrapper to `spec` to implement the `libs` sub-calls.
  - wrapper is returned from `__getitem__` only if spec is concrete
  - allows packagers to access build information easily
2017-03-02 10:01:29 -08:00
Massimiliano Culpo
5ce926d2d1 test/packages: fixed test suite (#3236)
It seems the tests in `packages.py` were running just because we had a specific order of execution. This should fix the problem, and make the test_suite more resilient to running order.
2017-03-02 09:29:23 -08:00
Javier
d49cb2734f Fixing issue wheh overwriting build_args in PythonPackage (#3200) 2017-02-21 08:04:32 -06:00
Adam J. Stewart
6d3f649382 Fix readline support in spack python (#3132)
* Fix readline support in `spack python`
* Add documentation on `spack python`
* Add unit tests for `spack python`
2017-02-17 15:58:06 -08:00
Adam J. Stewart
524303db06 Set default module type based on modules.yaml (#3173) 2017-02-17 13:46:31 -08:00
Adam J. Stewart
e492aff4f7 More consistent yes/no prompts (#3174)
* More consistent yes/no prompts
* Add ==> prefix to yes/no and number prompts
2017-02-17 13:45:02 -08:00
Elizabeth Fischer
29d070e50c On uninstall, change shortcut flag for --dependents to -R, as per Spack convention. (-r = --dependencies, -R = --dependents). (#1917) 2017-02-17 12:08:17 -08:00
Adam J. Stewart
38dd01f6b5 Fix missing space in error message output (#3169) 2017-02-17 12:02:48 -08:00
Elizabeth Fischer
682d5cf164 py-git2: New Package (#1971) 2017-02-17 11:55:22 -08:00
Adam J. Stewart
a9cf99b3e2 Fix typos in External Packages documentation (#3168) 2017-02-17 11:49:55 -08:00
Massimiliano Culpo
e24fdb49ea fix: don't call setup_environment when not needed (#3060)
* Don't call setup_environment when not needed. fixes #3059

* setup_environment and modules: added unit tests
2017-02-10 16:09:43 -08:00
becker33
f9e3b58d7e Make distro more robust to unreadable files (#3110)
* Make distro more robust to unreadable files. Will upstream

* Comment for clarify
2017-02-10 10:23:04 -08:00
Denis Davydov
b1eb921f28 make svn fetch quiet (#3070) 2017-02-09 13:55:18 -08:00
Todd Gamblin
b192011add Revert "db and concretization of packages modified after installation: fixes #2911" (#3078) 2017-02-08 13:12:10 -08:00
Massimiliano Culpo
79c1f7885a db and concretization of modified packages: fixes #2911 (#2920) 2017-02-07 18:28:01 -08:00
becker33
968199de7d Fix spec hash printing (#2941)
- Fix format printing to match command line for hashes and full name formats
- Update spack graph to use new format
- Changed format string signifier for hashes from `$#` to `$/`
2017-02-03 18:27:34 -08:00
George Hartzell
c456dfb60f Make module autoload warnings configurable (#2763)
Modules generated by the module creation machinery currently print out
a notice that warnts the user that things are being autoloaded.  In
some situations those warnings are problematic.  See #2754 for
discussion.

This is a first cut at optionally disabling the warning messages:

- adds a helper tothe EnvModule base class that encapsulates the
  config file variable;
- adds a method to the base class that provides a default (empty)
  code fragment for generating a warning message;
- passes the warning fragment into the bit that formats the autoload
  string;
- adds specialized autload_warner() methods in the tcl and lmod
  subclasses;; and finally
- touches up the autoload_format strings in the specialized classes.
2017-02-03 15:53:30 -08:00
George Hartzell
5a836fd06e Blacklist implicit packages for modulefile generation (#2603)
Add the ability to the modules generation process to blacklist
packages that were installed implicitly.  One can still whitelist
modules that were installed implicitly.

This changes adds a `blacklist_implicts` boolean as a peer to the
`whitelist` and `blacklist` arrays, e.g.:

```
modules:
  enable::
    - lmod
  lmod:
    whitelist:
      - 'lua'
      - 'py-setuptools'
    blacklist:
      -  '%gcc@4.8.3'
    blacklist_implicits: True
```

It adds a small helper in `spec.py` and then touches up the package
filtering code in `modules.py`.
2017-02-03 15:42:46 -08:00
serbanmaerean
8275b44715 Change default fflags for XL compiler to only "-qzerosize" (#2966) 2017-01-31 14:51:05 -05:00
Adam J. Stewart
41c77d7429 Add installcheck phase to AutotoolsPackage (#2863)
* Add installcheck phase to AutotoolsPackage
* Update installcheck phase with new callbacks API
* build_directory has been converted to a property
2017-01-31 14:35:38 -05:00
Henrik Bengtsson
6e729bc333 DOCS: Examplify what file types are automatically extracted (#2955) 2017-01-31 08:26:19 -08:00
Adam J. Stewart
123f057089 Refactor Spack's URL parsing commands (#2938)
* Replace `spack urls` and `spack url-parse` with `spack url`
* Allow spack url list to only list incorrect parsings
* Add spack url test reporting
* Add unit tests for new URL commands
2017-01-31 11:14:52 -05:00
Massimiliano Culpo
2babe4e4ff removed call syntax from property fixes #2944 (#2945) 2017-01-31 10:48:57 -05:00
Adam J. Stewart
0c0a1fdedc Add several new R packages (#2952)
* Add several new R packages

* Add a few more R packages

* Update more versions

* Convert Package to RPackage

* Add a few more packages

* Add missing dependencies
2017-01-31 09:54:34 -05:00
becker33
58a4c5c14d Fix ambiguous hash message generation. (#2940)
* Fix ambiguous hash message generation. Engineering fix
2017-01-27 11:37:21 -08:00
Adam J. Stewart
6158115ca8 Standardize argparse help messages (#2847) 2017-01-26 02:33:01 -08:00
Todd Gamblin
ffb8aaa3f3 Packaging docs for MPI (#2838)
* Add MPI docs to packaging guide and simplify packaging guide TOC a bit.
2017-01-26 02:29:31 -08:00
Massimiliano Culpo
81a5146b1d AutotoolsPackage: minor improvements (#2859)
* AutotoolsPackage: added configure_directory to permit build out of source. The configure script executable is now invoked with an absolute path. Modified a few packages accordingly.

* build_systems: functions returning directories are now properties

* build_systems: fixed issues with tcl and tk

* AutotoolsPackage: reworked recipe for autoreconf
2017-01-26 02:27:15 -08:00
Todd Gamblin
a5700a8888 Use codecov for coverage instead of coveralls (#2933)
* Switch from coveralls to codecov

- Add .codecov.yml, simplify .travis.yml
- Add codecov badge to README.md

* Add tests for spack graph.
2017-01-26 02:19:35 -08:00
scheibelp
e4d2d747ce Spec.satisfies accesses Spec.concrete as property (#2928)
* Spec.satisfies accesses Spec.concrete as property

Fixes #2760

When copying a spec, _concrete is always set to False for each
dependency. "Spec.satisfies" was accessing the member "_concrete"
directly instead of using the property "concrete". This means that
if you copy a spec, the dependencies will be considered equal, but
did not necessarily satisfy one another. Spec.satisfies is a
prerequisite for a package to be considered an extension; as a
consequence, an extension with run-time dependencies that were also
extensions did not activate those extensions. This updates
Spec.satisfies to avoid checking the cached member "_concrete"
directly.

* Added test to check for activation of dependency extension

* Added test to check for transitive satisfiability between a spec and its copy
2017-01-25 21:43:12 -07:00
becker33
8ae380fb71 Fixes for parsing specs with hashes (#2889)
- Allows hashes to be specified after other parts of the spec
- Does not allow other parts of the spec to be specified after the hash
- The hash must either end input or be followed by another separate spec
- The next spec cannot be an anonymous spec (it must start with a package name or a hash)

See #2769 (after it was merged) for further discussion of this interface addition. That discussion resulted in these requirements:

```
python                     # 1 spec
/abc123                    # 1 spec
python /abc123             # 1 spec
/456789                    # 1 spec
python /abc123 /456789     # 2 specs
python /456789 /abc123     # 2 specs
/abc123 /456789            # 2 specs
/456789 /abc123            # 2 specs
/456789 /abc123 python     # 3 specs
```

assuming `abc123` and `456789` are both hashes of different python specs.
2017-01-25 21:38:10 -07:00
serbanmaerean
5e2a96574b Add support for IBM threaded compilers: xl*_r (#2894)
* Add support for IBM threaded compilers, xl*_r

Added new compiler class, xl_r; added default flags to the compilers.yaml file.

* Add cppflags to the set of default flags to be added to the compilers stanza in compiler.yaml.

These flags are optional. Only defined flags will be listed in the compilers.yaml file.

* Fix scripting warnings revealed by flake8.

Updated __init__.py and xl_r.py to conform with flake8 rules.

* Add justification to the definition of the XL default compiler flags.
2017-01-25 16:26:17 -07:00
Massimiliano Culpo
fc866ae0fe build systems: simpler, clearer decorators: run_after, run_before (#2860)
* PackageMeta: `run_before` is an alias of `precondition`, `run_after` an alias of `sanity_check`

* PackageMeta: removed `precondition` and `sanity_check`

* PackageMeta: decorators are now free-standing

* package: modified/added docstrings. Fixed the semantics of `on_package_attributes`.

* package: added unit test assertion as side effects of install

* build_systems: factored build-time test running into base class

* r: updated decorators in package.py

* docs: updated decorator names
2017-01-25 08:57:01 -07:00
Adam J. Stewart
7d3da2ebdc Grammar and broken link fixes in modules tutorial (#2912) 2017-01-24 10:25:44 -07:00
Massimiliano Culpo
a8e1d78881 documentation: build-system phases + build-time tests (#2780)
* documentation: reworked packaging guide to add build-system phases

* documentation: improvements to AutotoolsPackage autodocs

* build_systems: updated autodocs

* run-tests: added a few information on how to run tests fixes #2606 fixes#2605

* documentation: fixed items brought up by @davydden

    * typos in docs
    * consistent use of 'build system' (i.e. removed 'build-system' from docs)
    * added a note on possible default implementations for build-time tests

* documentation: fixed items brought up by @citibeth

    * added note to explain the difference between build system and language used in a package
    * capitalized bullet items
    * added link to API docs

* documentation: fixed multiple cross-references after rebase

* documentation: fixed minor issues raised by @tgamblin

* documentation: added entry in table for the `PythonPackage` class

* docs: fixed issues brought up by @citybeth in the second review
2017-01-23 13:55:39 -08:00
Adam J. Stewart
dae353374e Simplify unit tests listed in Contribution Guide (#2904)
* Simplify unit tests listed in Contribution Guide

* Use long name for option flags
2017-01-23 09:48:49 -08:00
Erik Schnetter
cade0181fd Spack: Correct fix_darwin_install_name (#2886)
Previously, fix_darwin_install_name would only handle dependencies that have no path set, and it ignore dependencies that have the build directory as path baked in. Catch this, and replace it by the install directory.
2017-01-20 10:22:59 -08:00
Adam J. Stewart
4dad5aab84 Add spack edit option for build systems (#2865) 2017-01-18 18:49:48 -08:00
Adam J. Stewart
02f92fc7f8 Massive conversion from Package to AutotoolsPackage (#2845)
* Massive conversion from Package to AutotoolsPackage

* Forgot to convert p4est to AutotoolsPackage

* Fix typo

* Fix broken link in docs
2017-01-18 10:34:09 -08:00
Adam J. Stewart
f0f230d480 Allow spack create to detect packages that need to run autoreconf (#2848) 2017-01-17 17:42:45 -08:00
Jason Sarich
a1f7006400 check if node is already deleted (#2799)
* check if node is already deleted

* fix variable name
2017-01-17 14:23:32 -08:00
Adam J. Stewart
061076aea9 Support scionlib version detection (#2818) 2017-01-17 10:54:36 -08:00
Todd Gamblin
1856317777 Bump version to 0.10.0 2017-01-16 20:01:07 -08:00
Adam J. Stewart
c0aaa8fcea Add PythonPackage base class
- Add a PythonPackage class with build system support.
  - Support build phases in PythonPackage
  - Add a custom sanity check for PythonPackages
  - Get rid of nolink dependencies in python packages

- Update spack create to use new PythonPackage class

- Port most of Python packages to new PythonPackage class

- Conducted a massive install and activate of Python packages.
  - Fixed bugs introduced by install and activate.

- Update API docs on PythonPackage
2017-01-16 20:00:31 -08:00
Adam J. Stewart
1f49493fee Major improvements to spack create (#2707)
* Initial changes to spack create command

* Get 'spack create <url>' working again

* Simplify call to BuildSystemGuesser

* More verbose output of spack create

* Remove duplicated code from spack create and spack checksum

* Add better documentation to spack create docstrings

* Fix pluralization bug

* Flake8

* Update documentation on spack create and deprecate spack edit --force

* Make it more obvious when we are renaming a package

* Further deprecate spack edit --force

* Fix unit tests

* Rename default template to generic template

* Don't add automake/autoconf deps to Autotools packages

* Remove changes to default $EDITOR

* Completely remove all traces of spack edit --force

* Remove grammar changes to make the PR easier to review
2017-01-16 17:13:12 -08:00
Adam J. Stewart
6eed279fce Don't duplicate spack test in spack help (#2837) 2017-01-16 14:56:38 -08:00
George Hartzell
aa3cc0ea81 Add lmod support for spack module loads (#2758)
The `spack module loads` command only supported tcl and dotkit.
This adds support for lmod.
2017-01-16 03:25:39 -08:00
becker33
a091eeceab Parser fix (#2769)
* 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
2017-01-15 19:17:54 -08:00
Adam J. Stewart
f480e3449e Added customization for make targets in 'build' and 'install' phases for CMakePackage (#2742)
* Added customization for make targets in 'build' and 'install' phases for CMakePackage

* Use rst in build system docs so that Sphinx generates nice API docs

* Allow AutotoolsPackages to be built in a different directory

* Flake8

* Fix missing import

* Allow configure to be located in different directory

* Update espressopp to use build targets

* Flake8

* Sphinx fix, lists must be a new paragraph

* Back out change that allowed a configure script in a different directory than build_directory

* Add missing deps, build in parallel

* Missing space for rst list
2017-01-15 16:23:16 -08:00
Adam J. Stewart
f2d4c15395 Remove cmake build dep from CMakePackages (#2684) 2017-01-15 03:18:52 -08:00
Todd Gamblin
0d367bbd20 Add a test to exercise non-buildable external packages. (#2833) 2017-01-15 02:37:20 -08:00
becker33
677623962e Fixed find -lp command (coloring was broken) (#2820) 2017-01-15 02:36:36 -08:00
Massimiliano Culpo
436f6a4ab6 get_std_cmake_args delegates to CMakePackage._std_args fixes #2665 (#2805) 2017-01-15 02:34:15 -08:00
Massimiliano Culpo
cd511791d1 configure and build command: fix the stop iteration semantics
- broke somewhere between bdf4832269 (#2810) and 17b13b161b
2017-01-12 09:11:48 -08:00
Massimiliano Culpo
de2cb864fa mirror: fix error for some specs during concretization (#2806) 2017-01-11 07:38:22 -08:00
Todd Gamblin
f5557b5723 Change nargs='*' to argparse.REMAINDER for constraint options. (#2798) 2017-01-10 12:25:41 -08:00
Elizabeth Fischer
402dfe30f9 Get Rid of nobuild, nolink, and alldeps (#2765)
* Removing the nobuild, nolink, and alldeps dependency types in favor of being explicit.
* This will help with maintenance going forward, as adding more dependency types won't affect existing declared dependencies in weird ways.
* default deptype is still `('build', 'link')`
2017-01-07 19:59:02 -08:00
Adam J. Stewart
daff3c0908 Preliminary RPackage class (#2761) 2017-01-07 16:28:52 -08:00
Axel Huebl
05d77917fd GitLab: Tarball Version Test (#2296)
* GitLab: Tarball Version Test

Upload a test demonstrating #2290

* Add GitLab parsing
2017-01-06 08:53:19 -08:00
Mario Melara
3d54c3c689 Correct env vars for modulecmd; Fixes #1481 (#2745)
Don't override MODULEPATH with PATH, PATH has no modulefiles

PEP8 compliance
2017-01-05 11:15:38 -08:00
Massimiliano Culpo
9271c69b5d test: fixed 'refresh_builtin_mock' fixture (#2748) 2017-01-05 10:25:24 -08:00
Elizabeth Fischer
3dd4a01a5e Standardize package names: lower-case, not Mixed_CASE (#2475)
* Rename packages

* Upcasing depends_on() in packages.

* Downcased extends('r')

* Fixed erroneously changed URL that had slipped through.

* Fixed typo

* Fixed link from documentation into package source code.

* Fixed another doc problem.

* Changed underscores to dashes in package names.

* Added test to enforce lowercase, no-underscore naming convention.

* Fix r-xgboost

* Downcase more instances of 'R' in package auto-creation.

* Fix test.

* Converted unit test packages to use dashes not underscores

* Downcase `r` in the docs.

* Update module_file_support.rst

Fix r->R for class R.
2017-01-04 18:24:07 -08:00
Todd Gamblin
d32d5e45fb Fix issues when a package provides the same vdep twice. (#2710)
* Fix issues when a package provides the same vdep twice.

- provides() now adds to a set of provided vdeps instead of a single one.

* flake8
2017-01-02 18:40:57 -08:00
Todd Gamblin
b9ec69dce1 Disallow vdeps in packages.yaml (#2699)
* Consolidate packages.yaml code to preferred_packages

* Add validation check and a test for packages.py parsing.

* flake8
2016-12-31 08:12:38 -08:00
Adam J. Stewart
8cb54a9a67 Fix missing debug parameter for parse_version() (#2696) 2016-12-30 22:52:49 -08:00
Todd Gamblin
c88df5819d Fix test command arg handling. 2016-12-30 17:18:19 -08:00
Michael Kuhn
a42f340d37 Allow setting default variants (#2644) 2016-12-30 14:11:39 -08:00
Todd Gamblin
972a277956 Fix Python issue with build failures; Add test case for build failures. (#2687) 2016-12-30 11:37:50 -08:00
Todd Gamblin
5fbab1f4b5 Concretize preserves deptypes (#2681)
Concretization preserves deptypes
2016-12-29 14:43:59 -08:00
Todd Gamblin
d6390c159f Fix issues related to the switchover to pytest. (#2685)
- Remove stale reference to `import nose` from `bin/spack` script.
- Add `py` to externals (missing dependency for `pytest`)
2016-12-29 11:59:45 -08:00
Massimiliano Culpo
7ea10e768e unit tests: replace nose with pytest (#2502)
* Porting: substitute nose with ytest

This huge commit substitutes nose with pytest as a testing system. Things done here:

* deleted external/nose as it is no longer used
* moved mock resources in their own directory 'test/mock/'
* ported two tests (cmd/find, build_system) to pytest native syntax as an example
* build_environment, log: used monkeypatch instead of try/catch
* moved global mocking of fetch_cache to an auto-used fixture
* moved global mocking from test/__init__.py to conftest.py
* made `spack test` a wrapper around pytest
* run-unit-tests: avoid running python 2.6 tests under coverage to speed them up
* use `pytest --cov` instead of coverage run to cut down testing time

* mock/packages_test: moved mock yaml configuration to files instead of leaving it in the code as string literals

* concretize.py: ported tests to native pytest, reverted multiprocessing in pytest.ini as it was creating the wrong report for coveralls

* conftest.py, fixtures: added docstrings

* concretize_preferences.py: uses fixtures instead of subclassing MockPackagesTest

* directory_layout.py: uses fixtures instead of subclassing MockPackagesTest

* install.py: uses fixtures instead of subclassing MockPackagesTest

* optional_deps.py: uses fixtures instead of subclassing MockPackagesTest

optional_deps.py: uses fixtures instead of subclassing MockPackagesTest

* packages.py: uses fixtures instead of subclassing MockPackagesTest

* provider_index.py: uses fixtures instead of subclassing MockPackagesTest

* spec_yaml.py: uses fixtures instead of subclassing MockPackagesTest

* multimethod.py: uses fixtures instead of subclassing MockPackagesTest

* install.py: now uses mock_archive_url

* git_fetch.py: uses fixtures instead of subclassing MockPackagesTest

* hg_fetch.py: uses fixtures instead of subclassing MockPackagesTest

* svn_fetch.py, mirror.py: uses fixtures instead of subclassing MockPackagesTest
repo.py: deleted

* test_compiler_cmd.py: uses fixtures instead of subclassing MockPackagesTest

* cmd/module.py, cmd/uninstall.py: uses fixtures instead of subclassing MockDatabase

* database.py: uses fixtures instead of subclassing MockDatabase, removed mock/database

* pytest: uncluttering fixture implementations

* database: changing the scope to 'module'

* config.py: uses fixtures instead of subclassing MockPackagesTest

* spec_dag.py, spec_semantics.py: uses fixtures instead of subclassing MockPackagesTest

* stage.py: uses fixtures instead of subclassing MockPackagesTest. Removed mock directory

* pytest: added docstrings to all the fixtures

* pytest: final cleanup

* build_system_guess.py: fixed naming and docstrings as suggested by @scheibelp

* spec_syntax.py: added expected failure on parsing multiple specs closes #1976

* Add pytest and pytest-cov to Spack externals.

* Make `spack flake8` ignore externals.

* run-unit-tests runs spack test and not pytest.

* Remove all the special stuff for `spack test`

- Remove `conftest.py` magic and all the special case stuff in `bin/spack`

- Spack commands can optionally take unknown arguments, if they want to
  handle them.

- `spack test` is now a command like the others.

- `spack test` now just delegates its arguments to `pytest`, but it does
  it by receiving unknown arguments and NOT taking an explicit
  help argument.

* Fix error in fixtures.

* Improve `spack test` command a bit.

- Now supports an approximation of the old simple interface
- Also supports full pytest options if you want them.

* Use external coverage instead of pytest-cov

* Make coverage use parallel-mode.

* change __init__.py docs to include pytest
2016-12-29 07:48:48 -08:00
Elizabeth Fischer
88f57d7543 Allow exclusion of packages from spack module loads (#2667)
* Allow exclusion of packages from `spack module loads`

* Comment out excluded packages instead of not showing them at all.
2016-12-28 13:31:18 -08:00
Massimiliano Culpo
17b13b161b Directive inheritance: laziness for the win (#2623)
* inheritance of directives: using meta-classes to inject attributes coming from directives into packages + lazy directives

* _dep_types -> dependency_types
* using a meta-class to inject directives into packages
* directives are lazy

fixes #2466

* directives.py: allows for multiple inheritance. Added blank lines as suggested by @tgamblin

* directives.py: added a test for simple inheritance of directives

* Minor improvement requested by @tgamblin

CMakePackage: importing names from spack.directives
directives: wrap __new__ to respect pep8

* Refactoring requested by @tgamblin

directives: removed global variables in favor of class variables. Simplified the interface for directives (they return a callable on a package or a list of them).
2016-12-28 12:37:02 -08:00
Adam J. Stewart
29bac34c1d Ensure that every file in Spack has a license (#2659)
* Ensure that every package has a license

Also fixes URLs with http://http:// doubled.

This is a continuation of #2656.

* Add license to every file in Spack

* Make sure Todd is the author of all packages

* Fix flake8 tests

* Don't license external Sphinx docs

* Don't display licenses in tutorial example packages

Also fixes typos and converts command-line examples
from tcsh to bash, which is more common
2016-12-27 00:17:12 -08:00
Adam J. Stewart
f34c5367d5 Better tabulation for spack checksum (#2673) 2016-12-25 19:25:53 -08:00
Denis Davydov
91bfebbed8 filter_system_path: additionally filter system prefixes (#2672)
That's because in set_build_environment_variables()
the funciton filter_system_paths() is actually applied to
package prefixes, and not to prefix/lib or prefix/include.
2016-12-25 19:24:56 -08:00
Todd Gamblin
c4afaabea9 Add argument to spack spec to show deptypes. (#2680)
- `-t` | `--types` argument now shows deptypes in `spack spec`
2016-12-25 14:15:58 -08:00
Adam J. Stewart
7e8767e3fd Remove usernames from paths in docs (#2675)
* Remove usernames from paths in docs

* Fix path export
2016-12-25 12:36:35 -08:00
Adam J. Stewart
c3cd948537 Modify github archive regex to support luaposix (#2677) 2016-12-25 12:32:19 -08:00
scheibelp
3f1cdbf5ef Revert #2292: use frontend compiler for build deps (#2549)
The primary goal of #2292 was to use the frontend compiler to make
build dependencies like cmake on HPC platforms. It turns out that
while this works in some cases, it did not handle cases where a
package was a link dependency of the root and of a build dependency
(and could produce incorrect concretizations which would not build).
2016-12-20 00:21:25 -08:00
Todd Gamblin
c89de04f40 Support Yorick versions (#2640) 2016-12-19 14:55:23 -08:00
Todd Gamblin
4b7b6768e6 Modify github regex to support NCO. (#2633) 2016-12-19 14:17:18 -08:00
Todd Gamblin
a2b4146e10 Fixes for various hash issues (#2626)
* Better output for disambiguate_specs()

* Fix wrong exception name.

* Fix satsifies(): concrete specs require matching by hash.

- Fixes uninstall by hash and other places where we need to match a
  specific spec.

- Fix an error in provider_index (satisfies() call was backwards)

- Fix an error in satisfies_dependencies(): checks were too shallow.

* Fix default args in Spec.tree()

* Move installed_dependents() to DB to avoid unknown package error.

* Make `spack find` and `sapck.store.db.query()` faster for hashes.

* Add a test to ensure satisfies() respects concrete Specs' hashes.
2016-12-19 09:09:53 -08:00
Alfredo Adolfo Gimenez
68e9a2ed8d Added customization for make targets in 'build' and 'install' phases for AutotoolsPackage (#2464)
* Customization for make targets in build and test phases for AutotoolsPackage

* Updated Blitz++ to use customized make build and test targets

* Removed flake8 error

* Removed make test customization, added make install customization, need to figure out issues with multiple make targets

* Changed build_targets and install_targets to normal attributes
2016-12-18 16:27:47 -08:00
Massimiliano Culpo
87c9b01033 openblas: derives from MakefilePackage (#2488)
* MakefilePackage: changed build_args and install_args for consistency with #2464
openblas: derives from MakefilePackage

* MakefilePackage: changed default edit behavior
2016-12-15 10:15:52 -08:00
Mario Melara
32cecf55ee Fix target for compiler on CNL operating systems (#2580)
Changes any to a string to avoid <built-in function any> being
incorrectly added to target in compilers.yaml.
2016-12-14 14:37:14 -08:00
Adam J. Stewart
1ac4ae0b41 Make unzip quiet (#2593) 2016-12-14 14:24:02 -08:00
Mario Melara
01230a62d4 Change attribute to match ArchSpec refactor (#2579)
Fixes issue #2578
2016-12-13 13:58:03 -08:00
Ben Morgan
fb809189d3 Better cxx11/14/17 flags for GNU/Clang/Intel (#2539)
* Better cxx11/14 flags for GNU/Clang/Intel

- GCC 4.8 only supports -std=c++1y for C++14
- Use CMake's rules for AppleClang to set cxx11 and cxx14 flags based on
  Apple Xcode/LLVM version
- Use CMake's rules for Intel to add support for cxx14 flags based on
  Intel version.

* Add cxx17_flag property

Implement property in compiler for c++17 as per those for c++11/14.
Add concrete support for GNU/Clang:

- Return -std=c++1z for GCC 5 and above per GCC documentation
- Return -std=c++1z for Clang 3.5 and above per Clang documentation
- Return -std=c++1z for Apple LLVM 6.1 and above per CMake's rules
2016-12-13 13:15:10 -08:00
Elizabeth Fischer
4f9e548bf6 Update spack setup and spack graph to be consistent with recent refactoring (#2317)
* Update `spack setup` and `spack graph` to be consistent with c557e765 and 9347f869.  Fixes #2316.

* Added another "fix" necessary to make `spack setup` work.

* Added another "fix" necessary to make `spack setup` work. (reverted from commit 7f0d3ecb38c97ec00491d7cd66b4266e3018b1ca)
2016-12-13 10:48:40 -08:00
Todd Gamblin
8496d8ff77 Add a test to ensure package names have the right case. (#2562) 2016-12-13 01:23:40 -08:00
Adam J. Stewart
9f71382912 Add missing bzip2 dependency to freetype (#2536)
* Add freetype dependency on bzip2

* Switch package with an install method for the docs
2016-12-12 14:20:36 -08:00
Sergey Kosukhin
8f28c9009e Set parent process's input stream inside the build process. (#2535) 2016-12-12 11:55:13 -08:00
Todd Gamblin
d3d87ea190 Add documentation for repositories and namespaces. (#2474)
* Add documentation for repositories and namespaces.

* Update and extend repository documentation per review.

- Also add `-N` argument for `spack spec`
2016-12-12 00:54:20 -08:00
Stephen McDowell
7e96b09e63 [docs] missin .. code-block:: console in Spack 101 (#2530)
The advanced [Uninstalling Packages](spack.readthedocs.io/en/latest/tutorial_sc16_spack_basics.html#uninstalling-packages) via hash has a couple missing `.. code-block:: console` directives ;)

I have no idea what branch to direct this to though...
2016-12-11 11:40:36 -08:00
Denis Davydov
1570f90fde clang: do xcode mockup iff requested by a package (#2544)
* clang: do xcode mockup iff requested by a package

* add a note

* add pkg to setup_custom_environment() and decide whether or not to use mockup XCode there based on the package
2016-12-10 16:23:39 -08:00
becker33
3f8613ae42 Make targets an attribute of compilers (#2500)
* Make targets an attribute of compilers, similar to OS. Allows users to use `spack compiler find` to add compilers for the same platform/os but different targets when spack is installed on a file system mounted on machines with different targets.

* Changed get_compilers() method to treat old compilers with no target as target='any'

* flake8 changes

* Address change requests for comments/code clarity
2016-12-08 22:40:26 -08:00
Sergey Kosukhin
10591fb87f Json loader now returns str objects instead of unicode. (#2524) 2016-12-08 13:42:18 -08:00
scheibelp
065e3d7c0d Revert to-string for CNL operating system (#2526) 2016-12-08 11:41:34 -08:00
Todd Gamblin
be300eb6d5 Add support for parsing R-XML URL versions. (#2525)
* Add support for parsing R-XML URL versions.

* Better url-parse debug output.

- just print the debug stuff all the time.

* fix R-XML versions.
2016-12-08 11:08:58 -08:00
Pramod Kumbhar
29e42143e0 fix for bluegene-q platform (#1980)
* fix for  bluegene-q platform

* change powerpc to ppc64

* change CNK to cnk
2016-12-08 01:01:02 -08:00
scheibelp
83c9f7a4f2 Fix deptypes for deps specified on command line (#2307)
Fixes #2306

Any dependency explicitly mentioned in a spec string ended up with the
build and link deptypes unconditionally. This fixes dependency
resolution to ensure that packages which are mentioned in the spec
string have their deptypes determined by the dependency information
in the package.py files. For example if a package has cmake as a build
dependency, and cmake is mentioned as a dependency in the spec string
for the package, then it ends up with just the build deptype.
2016-12-08 00:54:30 -08:00
scheibelp
30daf95ae8 Use frontend OS for build/run deps by default (#2292)
Packages built targeting a backend may depend on packages like cmake
which can be built against the frontend. With this commit, any build
dependency or child of a build dependency will target the frontend by
default. In compiler concretization when packages copy compilers from
nearby packages, build dependencies use compiler information from
other build dependencies, and link dependencies avoid using compiler
information from build dependencies.
2016-12-08 00:51:19 -08:00
Oliver Breitwieser
55059a53a3 Fixed spelling of variable (#2516) 2016-12-07 13:08:51 -08:00
Todd Gamblin
41b8f31bcd Use JSON for the database instead of YAML. (#2189)
* Use JSON for the database instead of YAML.

- JSON is much faster than YAML *and* can preserve ordered keys.
  - 170x+ faster than Python YAML when using unordered dicts
  - 55x faster than Python YAML (both using OrderedDicts)
  - 8x faster than C YAML (with OrderedDicts)

- JSON is built into Python, unlike C YAML, so doesn't add a dependency.
- Don't need human readability for the package database.
- JSON requires no major changes to the code -- same object model as YAML.
- add to_json, from_json methods to spec.

* Add tests to ensure JSON and YAML don't need to be ordered in DB.

* Write index.json first time it's not found instead of requiring reindex.

* flake8 bug.
2016-12-05 10:03:58 -08:00
Adam J. Stewart
161d6205b2 Allow spack create to handle packages with period in name (#2351)
* Allow spack create to handle packages with period in name

* Update tests to handle new package name detection scheme
2016-12-05 09:34:14 -08:00
Todd Gamblin
b8b14c84e0 Bugfix: restore __contains__ method after ArchSpec refactor. (#2481) 2016-12-04 16:22:16 -08:00
Joseph Ciurej
552b4eae9e Fixes to Handling Multiple Architectures (#2261)
* Added some notes about how multiarch detection could be fixed.

* Implemented a preliminary version of the "spack.spec.ArchSpec" class.

* Updated the "spack.spec.Spec" class to use "ArchSpec" instead of "Arch".

* Fixed a number of small bugs in the "spack.spec.ArchSpec" class.

* Fixed the 'Concretizer.concretize_architecture' method so that it uses the new architecture specs.

* Updated the package class to properly use arch specs.
Removed a number of unused architecture functions.

* Fixed up a number of bugs that were causing the regression tests to fail.
Added a couple of additional regression tests related to architecture parsing/specification.
Fixed a few bugs with setting reserved os/target values on "ArchSpec" objects.
Removed a number of unnecessary functions in the "spack.architecture" and "spack.concretize" modules.

* Fixed a few bugs with reading architecture information from specs.
Updated the tests to use a uniform architecture to improve reliability.
Fixed a few minor style issues.

* Adapted the compiler component of Spack to use arch specs.

* Implemented more test cases for the extended architecture spec features.
Improved error detection for multiple arch components in a spec.

* Fix for backwards compatibility with v0.8 and prior

* Changed os to unknown for compatibility specs

* Use `spack09` instead of `spackcompat` for the platform of old specs.
2016-12-03 15:38:31 -08:00
Matt Belhorn
e26a0be731 Does nothing if no prexisting config.guess is found. (#2446)
* Does nothing if no prexisting config.guess is found.

* Update name for RHEL OS.
2016-12-01 11:54:48 -06:00
TomasPuverle
f1fe614d67 Update tutorial_sc16_packaging.rst (#2450)
Fixed a typo.
2016-12-01 11:53:18 -06:00
TomasPuverle
a961797155 Update workflows.rst (#2451)
Fixed a typo.
2016-12-01 11:53:03 -06:00
Sergey Kosukhin
051720defd More informative help messages for spack config. (#2453) 2016-12-01 11:52:56 -06:00
hegner
c3e34b480a CDash fixes (#2438)
use short spec instead of spec as CDash has a limitation in name length
mark all problems as 'FAILED' as CDash does not understand "ERRORED" status
2016-11-29 13:30:59 -06:00
hegner
a6d579ea15 add headers neede for CDASH to junit output (#2433) 2016-11-29 08:29:57 -06:00
Andrey Prokopenko
11bfccd53f Adding pic_flag property to compilers (#2375)
Different compilers have different flags for PIC (position-independent
code). This patch provides a common ground to accessing it inside specs.

See discussions in #508 and #2373. This patch does not address the issue
of mixed compilers as mentioned in #508.
2016-11-24 12:25:22 -08:00
scheibelp
261d36e801 Add dynamic search option for package sources (#2270)
Package provides a 'list_url' attribute which may be searched to find
download links. #1822 created a slowdown for all tests by always
searching this URL. This reenables dynamic search only in cases where
all other fetchers fail. This also only enables dynamic search when
'mirror_only' is set to false.
2016-11-24 12:21:05 -08:00
Adam J. Stewart
e60bccd95c Fix indentation for newly created packages (#2391) 2016-11-23 10:58:13 -08:00
Adam J. Stewart
f351e4402c Update external distro package to 1.0.1 (#2381) 2016-11-22 14:01:01 -08:00
Todd Gamblin
1901b05b9c Forgot http:// in tutorial link. 2016-11-22 01:24:48 -08:00
Todd Gamblin
c394046971 Fix broken doc links. 2016-11-22 00:55:04 -08:00
Matthew Krafczyk
f1b26cb72e Improve stacktrace printing
Sometimes files in the stacktrace are not from spack. Remove these
files before finding the spack root.
2016-11-17 12:51:41 -05:00
Matthew Krafczyk
de7171db8a Use better scheme for getting root directory 2016-11-16 12:14:25 -05:00
Matthew Krafczyk
6c854246aa Fix some formatting errors caught by flake8. 2016-11-16 11:58:36 -05:00
Matthew Krafczyk
8e6d890a19 -s now includes the file and line number with info
The option -s now causes file and line number information to be printed
along with any invocation of msg, info, etc...

This will greatly ease debugging.
2016-11-16 11:58:36 -05:00
Todd Gamblin
2611cbed40 Move tutorial slides to external link and stop using git LFS (#2341)
- Seems like older git versions won't be able to clone an LFS repo.

- Reverting to an external link for the slides to avoid storing an 8MB
  file in the repo and to avoid using git LFS.
2016-11-15 14:11:26 -07:00
Todd Gamblin
bdd1069a9e Add SC16 tutorial to the Spack docs. 2016-11-14 18:08:21 -07:00
becker33
b13b253ced Edited/fixed basic usage tutorial (#2329)
* Colify compiler output

* Edited/fixed basic usage tutorial

* fix console spacing.
2016-11-13 09:29:32 -07:00
Massimiliano Culpo
103a98a468 fake install: mock include directory (#2294) 2016-11-13 04:45:50 -07:00
Massimiliano Culpo
7e93a0e5f1 install: fixed choices for --only (removed the default) fixes #2303 (#2308) 2016-11-13 04:45:29 -07:00
Gregory Becker
7201053f2a Basic usage step-by-step tutorial 2016-11-12 16:55:37 -07:00
Matthew LeGendre
216d269f1d Add packaging tutorial to docs (#2315)
* Add packaging tutorial to docs

* packaging tutorial: formatting
2016-11-12 07:45:50 -08:00
scheibelp
bece9aca84 Allow compiler wrapper to modify environment (#2275)
* Allow compiler wrapper to modify environment

This adds the ability to set environment variables in the compiler
wrappers. These are specified as part of the compilers.yaml config.
The user may also specify RPATHs in compilers.yaml that should be
added.

* Minor doc tweak
2016-11-09 08:00:34 -08:00
Massimiliano Culpo
01e42bfea0 find, uninstall: improved user interaction in the case of empty DB (#2278) 2016-11-09 07:36:45 -08:00
Todd Gamblin
908ba6e3d6 Waste less space when fetching cached archives, simplify fetch messages. (#2264)
* Waste less space when fetching cached archives, simplify fetch messages.

- Just symlink cached files into the stage instead of copying them with curl.
- Don't copy linked files back into the cache when done fetching.

* Fixes for review.

* more updates

* last update
2016-11-07 01:34:30 -08:00
Todd Gamblin
08477f6624 Don't automatically spider remote list_urls before making stage. (#2263)
- This might be useful but we don't want to do it unconditionally.
2016-11-06 20:50:14 -08:00
becker33
49b1c0df2b Changed cflag matching to exact rather than subset. (#2227)
Not the desired eventual behavior, but cflag subset matching is not currently working for anonymous specs and this provides a temporary solution by restricting the feature until it is fixed.
2016-11-06 15:32:05 -08:00
George Hartzell
7f5d1953d4 Wordsmithing/minor-edits to module tutorial (#2256)
* Wordsmithing/minor-edits to module tutorial

A small set of wordsmithing, spell checking and minor edits to the fancy
new modules tutorial!

* Fix typo (sneaky z key...)

* Fix "S:" and "manual<" typos
2016-11-06 14:56:41 -08:00
Todd Gamblin
544b147370 Add detection for redhat enterprise server to distro.py (#2262) 2016-11-06 14:23:21 -08:00
Massimiliano Culpo
1bef2b7e98 variable referenced before assignment (#2252) 2016-11-05 10:15:29 -07:00
Jeffrey Salmond
a260e7e860 Bugfix in concretize_compiler (#2196)
* fix bug in search for concrete compiler

* simplify implementation of concretize_compiler

* fix flake8 errors
2016-11-04 23:20:49 -07:00
scheibelp
0940ee6015 Fixes #1520 (#1822)
Some packages which include resources fetched from source control
repositories terminated package installs because they failed to
archive; specifically, this included all SCM resources which identify
a specific state of the repo - for example a revision in svn or a
tag/revision in git. This is because the resource stage creation
logic did not choose an appropriate archive name for these kinds of
resources.
2016-11-04 20:14:56 -07:00
Adam J. Stewart
4e6d535058 Set Clang as the default compiler on macOS (#2225)
* Set OS-specific default compilers

* Fix flake8 warnings
2016-11-04 17:32:25 -07:00
Todd Gamblin
78154a63e8 Fix bug in distribution detection on unsupported platforms. 2016-11-04 16:49:19 -07:00
Jeffrey Salmond
9cd83a4efb Use code from the distro package to improve linux distro detection. (#1629)
* Use code from the `distro` package to improve linux distro detection.

Various issues [1] [2] with the platform.linux_distribution function led
to the function being deprecated in python 3.4. The pipi package distro
[3] contains compatible improved code that better tracks current methods
for identifying linux distributions (see, for example, [4],[5]).

[1]: https://bugs.python.org/issue20454
[2]: http://bugs.python.org/issue1322
[3]: https://pypi.python.org/pypi/distro
[4]: https://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/lsbrelease.html
[5]: https://www.freedesktop.org/software/systemd/man/os-release.html

* fix (potential) unicode problems
2016-11-04 16:38:44 -07:00
Axel Huebl
c3d9dda0e5 libSplash: Add 1.6.0 Release (#2244)
* libSplash: Add 1.6.0 Release

Add the latest release of libSplash, version 1.6.0.

* Fix flake8 checks (another loop inversion issue)
2016-11-04 16:27:17 -07:00
Massimiliano Culpo
401b4cb137 module files tutorial : first complete draft (#2228)
* module files tutorial : first complete draft

- first complete draft for module files tutorial
- minor corrections to module file reference

* module file tutorial : first batch of corrections

- module avail spelled out fully
- typos from @adamjstewart
- rewording of a few sentences

* module file tutorial : first batch of corrections

- emphasized lines in yaml files

* module file tutorial : fixes according to @citibeth and @adamjstewart reviews

- used long format for command options
- reworded unclear sentence on tokes
- reworked table in reference manual to make it clearer

* module file tutorial : implemented corrections collected on site from @schlyfts

* module file tutorial : removed comment (@hartzell suggestion)
2016-11-04 12:55:43 -07:00
Gregory Lee
ee6eb508cb patch older config.guess for newer architectures (#2221) 2016-11-04 12:12:37 -07:00
Todd Gamblin
2536029ea9 Better spack spec (#2238)
* Add options for hashes, tree depth, and YAML to `spack spec`.

- Can now display hashes with `spack spec`, like `spack find`.
  - Removed the old "ids" argument to `spack spec` (which
    printed numerical values)b

- Can output YAML spec from `spack spec` with `-y`

- Can control depth of DAG traversal with --cover=[nodes|edges|paths]

- Can print install status (installed, missing, not installed) with -I

* Don't use YAML aliases in specs.

- Force Spack's YAML dumper to ignore aliases.
- aliases cause non-canonical YAML to be used in DAG hash, and result in
  redundant hashes.
- add a test to ensure this behavior stays
2016-11-04 11:47:57 -07:00
Peter J. Scheibel
9a585e6c6a Make spec.format properties case-insensitive 2016-11-04 11:41:20 -07:00
Peter J. Scheibel
74b439b7f1 Support 'COMPILERVERSION' in spec format string 2016-11-04 11:41:20 -07:00
Denis Davydov
1eeef97c78 remove obsolete instructions on hacking clang+gfortran (#2217)
* remove obsolete instructions on hacking clang+gfortran

* add detailed instructions on how to setup Clang+gfortran on macOS
2016-11-03 08:06:33 -07:00
Massimiliano Culpo
36a4ca8b11 spack install: forward sys.stdin to child processes (#2158)
* spack install: forward sys.stdin to child processes fixes #2140

 - [ ] redirection process is spawned in __enter__ instead of __init__
 - [ ] sys.stdin is forwarded to child processes

* log: wrapped __init__ definition
2016-11-03 08:03:10 -07:00
Massimiliano Culpo
5b5894afba spack find: accepts anonymous specs as arguments fixes #2170 (#2188) 2016-11-03 00:45:15 -07:00
Todd Gamblin
b304387308 Fix style checker bug. (#2214)
* Fix style checker bug.

* spack flake8: print cwd-relative paths by default, with root-relative option.
2016-11-02 12:17:35 -05:00
Barry Smith
9455621ec2 Add support for gfortran to be used with clang (#2192)
1) list gfortran as a fc and f77 compiler that can work with clang
2) allow compatible gfortran to ./spack compiler find with clang by matching version numbers

This is based on the discussions in

https://github.com/LLNL/spack/issues/237
https://github.com/dealii/dealii/wiki/deal.II-in-Spack#mixing-gcc-and-clang-on-osx

This is not a long term solution but something to get us through the next months until the compiler
infrastructure is reworked to allow mixing and matching for C/C++ and Fortran compilers

Funded-by: IDEAS
Project: IDEAS/xSDK
Time: 1.5 hours
2016-11-02 11:17:13 -05:00
scheibelp
45a4388164 Update references in debug command (#2204) 2016-11-01 13:55:13 -07:00
Todd Gamblin
edfe2297fd Improved package.py error handling. (#2187)
- Detailed debug information is now handed back to the parent process
  from builds, for *any* type of exception.

- previously this only worked for Spack ProcessErrors, but now it works
  for any type of error raised in a child.

- Spack will print an error message and source code context for build
  errors by default.

- It will print a stack trace when using `spack -d`, even when the error
  occurred in the child process.
2016-10-31 15:32:19 -07:00
Todd Gamblin
1b7f9e24f4 Add spack flake8 command. (#2186)
- Ported old run-flake8-tests qa script to `spack flake8` command.
- New command does not modify files in the source tree
- Copies files to a temp stage modifies them there, and runs tests.
- Updated docs and `run-flake8-tests` script to call `spack flake8`.
2016-10-31 11:40:20 -07:00
Todd Gamblin
4be703cde0 Allow common args to be written the same way regular args are. 2016-10-30 23:55:00 -07:00
Todd Gamblin
8f21332fec Bugfix: '::' only worked on top-level key in config.
- generalized and fixed to work with any key in YAML file
- simplified schema writing, as well
- add more unit tests for the config system
- Rename test/yaml.py to test/spack_yaml.py
  - Add test/yaml.pyc to ignored pyc files.
2016-10-30 23:55:00 -07:00
Todd Gamblin
d155156e32 Documentation for configuration 2016-10-30 23:55:00 -07:00
Todd Gamblin
b962622975 Add spack arch --platform option 2016-10-30 23:55:00 -07:00
Todd Gamblin
58e76721b9 Make provider_index use spack yaml for cleaner output. 2016-10-30 23:55:00 -07:00
Todd Gamblin
da760a66de source_cache, misc_cache, verify_ssl, checksum, & dirty in config.yaml
- Added new preferences to config.yaml:
  - source_cache
  - misc_cache
  - verify_ssl
  - checksum
  - dirty
2016-10-30 23:55:00 -07:00
Todd Gamblin
22b14e0f23 Add module_roots to config.yaml 2016-10-30 23:55:00 -07:00
Todd Gamblin
0da639298c Move temp directory configuration to config.yaml
- Moved temp finding logic to spack.stage
- Updated stage tests
- Added tests for new path substaitution of $user, $spack, $tempdir
2016-10-30 23:55:00 -07:00
Todd Gamblin
9347f86939 Rename install.yaml -> config.yaml, install_area -> "store"
- Added a schema for config.yaml
- Moved install tree configuration to config.yaml
- Moved etc/spack/install.yaml to etc/spack/defaults/config.yaml
- renamed install_area to "store", to use a term in common with guix/nix.
  - in `config.yaml` file, it's called the `install_tree` to be more
    intuitive to users.
  - `install_tree` might've worked in the code, but `install_tree` is
    already a global function in the spack namespace, from
    llnl.util.filesystem.
2016-10-30 23:55:00 -07:00
Benedikt Hegner
24901f7a38 add documentation for new option to set install area 2016-10-30 23:55:00 -07:00
Benedikt Hegner
c557e76565 refactor settings for install area and make them config options 2016-10-30 23:55:00 -07:00
Matt Belhorn
7ccf56a0b7 Removes cyclic dependency on spack.config. (#2121)
Merge #2030 added a cyclic dependency between the Cray platform needing
to read a `targets.yaml` config file and `config.py` needing to get the
platform names.

This commit removes the cyclic dependency in favor of the more general
config scheme. It also removes the now functionless `targets.yaml`
config file. This breaks 'frontend' targets on the Cray platform but
all architecture targets, including the frontend, that are provided by
CrayPE are added to the Platform anyway so users can be explicit about
the architecture targeted by the Cray compiler wrappers:

```
spack spec libelf arch=cray-CNL-frontend
```

becomes

```
spack spec libelf arch=cray-CNL-mc8         # on an XK7 or
spack spec libelf arch=cray-CNL-sandybridge # on an older XC30, etc..
```

The only way the 'frontend' target can be defined after this commit is
through target environment variables.
2016-10-30 21:02:27 -07:00
Massimiliano Culpo
9989f8e267 module file support: major rework of docs (#2169)
* module file support: major rework of docs

* module file support: fixed issues found by @adamjstewart

- list or enumeration should not be indented
- use console instead of bash or csh in things that are not scripts
- other typos

* module file support: fixed other issues found by @adamjstewart

- tables should not be indented
- substitute lines with pyobject to import an entire function
- get help output running commands
- typos

* module file support: fixes according to review comments

- @citibeth moved `spack module loads` after `spack load`
- @glennpj tried to clarify installation table + changes to language
- @tgamblin Removed top level section and moved the whole thing into the reference manual

* module file support: moved directive before spack module loads
2016-10-30 12:41:41 -07:00
Massimiliano Culpo
4d35ac6a16 configuration file for modules : fixed enable keyword (#2176)
- enable keyword works again
- test/modules.py : proper clean-up after tests
2016-10-30 12:30:51 -07:00
Barry Smith
ef2c42a889 Do not check directory layout for external packages (#2172)
External packages do not have an spec.yaml file so don't check for it.
Without this change any time a package depends on an external package
when the new package is installed you will get the error

Install prefix exists but contains no spec.yaml

This problem has also haunted me since I started using Spack since PETSc
depends on Python and I used an external python but fortunately it
was relatively easy to debug once I could reproduce it at will.

Funded-by: IDEAS
Project: IDEAS/xSDK
Time: 1 hour
2016-10-29 20:57:41 -07:00
Matthew Scott Krafczyk
c2d58d39dd Import dso_suffix from spack.build_environment in abi.py (#2174)
Fixes #1845
2016-10-29 16:47:06 -07:00
scheibelp
23683c65de Use Spec.format for token substitution in modules (#1848)
This replaces a custom token-based substitution format with calls to
Spec.format in modules.py

This also resolves a couple issues:

- LmodModules set configuration globally instead of in its initializer
  which meant test-specific configuration was not applied
- Added support for setting hash_length=0 for LmodModules. This only
  affects the module filename and not the directory names for the
  hierarchy tokens in the path. This includes an additional unit test.
2016-10-29 13:56:34 -07:00
Adam J. Stewart
58409a2eaf Fix rpath linking for NAG, add documentation on setup (#2142) 2016-10-27 15:28:09 -07:00
Elizabeth Fischer
12270b9dbf Remove support for deprecated package. See also #2085 and #2086 (#2090) 2016-10-26 21:53:08 -07:00
George Hartzell
bf08bd7076 Fix typo: _choiches -> _choices (#2127)
The breaks `spack create`.
2016-10-26 20:39:08 -07:00
George Hartzell
e652a32f05 typo: vlaues -> values (#2147) 2016-10-26 17:51:01 -07:00
Elizabeth Fischer
3895c974a0 Removed documentation on false paths as per #2083 (#2146)
Removed documentation on false paths as per #2083
2016-10-26 17:11:54 -07:00
Denis Davydov
9f54cea5c5 document recommended usage of system blas/lapack (#2081)
* document recommended usage of system blas/lapack

* update doc

* minor

* reword
2016-10-26 16:22:18 -07:00
Massimiliano Culpo
37dc719d13 ProcessError : now the exception is correctly pickled and passed across processes. (#2143) 2016-10-26 15:17:20 -07:00
Massimiliano Culpo
e73ab84680 spack install : added --log-format option (incorporates test-install command) (#2112)
* spack install : added --log-format option (incorporates test-install command)

fixes #1907

* qa : removed extra whitespace
2016-10-26 14:22:46 -07:00
Denis Davydov
33fb7bbd1b add a unit test for conretization with develop version (#2064) 2016-10-26 01:49:52 -07:00
Denis Davydov
39772e4c4c filter system paths (#2083)
* add filter_system_paths()

* filter system paths in set_build_environment_variables()

* two function: lib/inc + bin

* reverse order in bin

* fix order

* minor

* improvements of the code

* more cleanup

* alternative solution for filter_bins

* fiddle base alalazo's approach

* minor

* minor
2016-10-25 11:25:13 -07:00
Adam J. Stewart
a250792202 Find compatibility versions of GCC (#2099) 2016-10-25 11:07:49 -07:00
Massimiliano Culpo
7a575d2f4b multimethod.py : calls functools.wraps before returning the correct method fixes #2118 (#2119) 2016-10-25 08:30:40 -07:00
Massimiliano Culpo
b27e78cd78 spack setup : fixed regression after #1186 (#2117) 2016-10-25 07:53:11 -07:00
Todd Gamblin
0f6a5cd385 Merge pull request #1186 from epfl-scitas/features/install_with_phases
do_install : allow for an arbitrary number of phases
2016-10-24 17:13:49 -07:00
Todd Gamblin
c1ad4bde28 Rename EditableMakefile to MakefilePackage 2016-10-24 16:41:20 -07:00
Joseph Ciurej
7dd14870ce Bug Fix : Apply Compiler Flags Specified by Manual Compiler Configuration (#1532)
* Fixed a bug causing config-specified compiler flags to be ignored.
Updated the compiler config so all flags are in a separate section.

* Updated the documentation for the `compilers.yaml` file spec.

* Implemented basic testing for the 'flags' section of compiler config.

* Fixed a few minor problems with the manual compiler config documentation.
2016-10-24 14:37:03 -07:00
George Hartzell
e35c023c61 Typo: becuase -> because (#2110) 2016-10-24 14:28:04 -07:00
Elizabeth Fischer
4f0b7cd2c2 Small fix to docs. (#2092) 2016-10-24 11:09:02 -07:00
Massimiliano Culpo
8af9881e9b spack test : exits after ctrl+c fixes #2029 (#2082) 2016-10-24 11:07:08 -07:00
alalazo
7bd735416d package.py : moved each specialized package to its own module file 2016-10-23 22:38:19 +02:00
alalazo
e0f3188970 spack setup : improved error message 2016-10-23 19:10:07 +02:00
alalazo
fa3f07c092 CMakePackage, AutotoolsPackage : added default behavior on check 2016-10-23 19:02:46 +02:00
alalazo
ebbbed166e Merge branch 'develop' of https://github.com/LLNL/spack into features/install_with_phases_rebase 2016-10-23 13:35:12 +02:00
alalazo
284ed13fa6 spack.error : fixed pickling and representation to permit to pass FetchErrors 2016-10-23 13:34:29 +02:00
alalazo
bdf4832269 spack build, spack configure : added commands 2016-10-22 17:08:52 +02:00
alalazo
484aaf50cc CMakePackage : changed method name from wdir to build_directory 2016-10-22 14:54:26 +02:00
alalazo
8091a3d6cb do_install : use build_system_class attribute instead of type(self).__base__ 2016-10-22 10:48:16 +02:00
alalazo
c84123dce5 spack info : shows the build-system class used 2016-10-22 10:39:33 +02:00
Matthew LeGendre
859d296105 Don't clear LD_LIBRARY_PATH and friends from compiler wrappers (#2074)
* Don't clear LD_LIBRARY_PATH and friends from compiler wrappers

* remove debugging print
2016-10-21 16:25:12 -07:00
alalazo
482f60d1d3 packages : moved decorators into AutotoolsPackage and CMakePackage 2016-10-22 01:03:07 +02:00
alalazo
012da99644 spack create : fixed typo 2016-10-22 00:10:37 +02:00