Commit graph

2458 commits

Author SHA1 Message Date
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