Skip to content

Commit b2019a6

Browse files
committed
Merge tag 'v0.10.0' into binary_packages
2 parents 9412ee1 + 52a9e5d commit b2019a6

File tree

779 files changed

+35645
-22222
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

779 files changed

+35645
-22222
lines changed

.coveragerc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# -*- conf -*-
22
# .coveragerc to control coverage.py
33
[run]
4+
parallel = True
5+
concurrency = multiprocessing
46
branch = True
57
source = lib
68
omit =

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@
2020
.coverage
2121
#*
2222
.#*
23+
/.cache
24+
/bin/spackc

.travis.yml

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1+
#=============================================================================
2+
# Project settings
3+
#=============================================================================
14
language: python
25

36
# Only build master and develop on push; do not build every branch.
47
branches:
58
only:
69
- master
710
- develop
11+
- /^releases\/.*$/
812

9-
# Construct build matrix
13+
#=============================================================================
14+
# Build matrix
15+
#=============================================================================
1016
python:
1117
- 2.6
1218
- 2.7
@@ -17,30 +23,48 @@ env:
1723
- TEST_SUITE=doc
1824

1925
matrix:
26+
# Flake8 and Sphinx no longer support Python 2.6, and one run is enough.
2027
exclude:
2128
- python: 2.6
22-
# Flake8 no longer supports Python 2.6
2329
env: TEST_SUITE=flake8
2430
- python: 2.6
25-
# Sphinx no longer supports Python 2.6
2631
env: TEST_SUITE=doc
32+
# Explicitly include an OS X build with homebrew's python.
33+
# Works around Python issues on Travis for OSX, described here:
34+
# http://blog.fizyk.net.pl/blog/running-python-tests-on-traviss-osx-workers.html
35+
include:
36+
- os: osx
37+
language: generic
38+
env: TEST_SUITE=unit
2739

40+
#=============================================================================
41+
# Environment
42+
#=============================================================================
2843
# Use new Travis infrastructure (Docker can't sudo yet)
2944
sudo: false
3045

3146
# Docs need graphviz to build
3247
addons:
3348
apt:
3449
packages:
50+
- gfortran
3551
- graphviz
3652
- libyaml-dev
3753

54+
# Work around Travis's lack of support for Python on OSX
55+
before_install:
56+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
57+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew ls --versions python > /dev/null || brew install python; fi
58+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew ls --versions gcc > /dev/null || brew install gcc; fi
59+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then virtualenv venv; fi
60+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then source venv/bin/activate; fi
61+
3862
# Install various dependencies
3963
install:
40-
- pip install coveralls
41-
- pip install flake8
42-
- pip install sphinx
43-
- pip install mercurial
64+
- pip install --upgrade coveralls
65+
- pip install --upgrade flake8
66+
- pip install --upgrade sphinx
67+
- pip install --upgrade mercurial
4468

4569
before_script:
4670
# Need this for the git tests to succeed.
@@ -50,11 +74,17 @@ before_script:
5074
# Need this to be able to compute the list of changed files
5175
- git fetch origin develop:develop
5276

77+
#=============================================================================
78+
# Building
79+
#=============================================================================
5380
script: share/spack/qa/run-$TEST_SUITE-tests
5481

5582
after_success:
56-
- if [[ $TEST_SUITE == unit && $TRAVIS_PYTHON_VERSION == 2.7 ]]; then coveralls; fi
83+
- if [[ $TEST_SUITE == unit && $TRAVIS_PYTHON_VERSION == 2.7 && $TRAVIS_OS_NAME == "linux" ]]; then coveralls; fi
5784

85+
#=============================================================================
86+
# Notifications
87+
#=============================================================================
5888
notifications:
5989
email:
6090
recipients: [email protected]

bin/spack

Lines changed: 40 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ if (sys.version_info[0] > 2) or (sys.version_info[:2] < (2, 6)):
3131
"This is Python %d.%d.%d." % v_info)
3232

3333
import os
34+
import inspect
3435

3536
# Find spack's location and its prefix.
3637
SPACK_FILE = os.path.realpath(os.path.expanduser(__file__))
@@ -45,14 +46,6 @@ sys.path.insert(0, SPACK_LIB_PATH)
4546
SPACK_EXTERNAL_LIBS = os.path.join(SPACK_LIB_PATH, "external")
4647
sys.path.insert(0, SPACK_EXTERNAL_LIBS)
4748

48-
import warnings
49-
# Avoid warnings when nose is installed with the python exe being used to run
50-
# spack. Note this must be done after Spack's external libs directory is added
51-
# to sys.path.
52-
with warnings.catch_warnings():
53-
warnings.filterwarnings("ignore", ".*nose was already imported")
54-
import nose
55-
5649
# Quick and dirty check to clean orphaned .pyc files left over from
5750
# previous revisions. These files were present in earlier versions of
5851
# Spack, were removed, but shadow system modules that Spack still
@@ -129,23 +122,16 @@ parser.add_argument('-V', '--version', action='version',
129122
# subparser for setup.
130123
subparsers = parser.add_subparsers(metavar='SUBCOMMAND', dest="command")
131124

125+
132126
import spack.cmd
133127
for cmd in spack.cmd.commands:
134128
module = spack.cmd.get_module(cmd)
135129
cmd_name = cmd.replace('_', '-')
136130
subparser = subparsers.add_parser(cmd_name, help=module.description)
137131
module.setup_parser(subparser)
138132

139-
# Just print help and exit if run with no arguments at all
140-
if len(sys.argv) == 1:
141-
parser.print_help()
142-
sys.exit(1)
143-
144-
# actually parse the args.
145-
args = parser.parse_args()
146133

147-
148-
def main():
134+
def _main(args, unknown_args):
149135
# Set up environment based on args.
150136
tty.set_verbose(args.verbose)
151137
tty.set_debug(args.debug)
@@ -171,8 +157,21 @@ def main():
171157

172158
# Try to load the particular command asked for and run it
173159
command = spack.cmd.get_command(args.command.replace('-', '_'))
160+
161+
# Allow commands to inject an optional argument and get unknown args
162+
# if they want to handle them.
163+
info = dict(inspect.getmembers(command))
164+
varnames = info['__code__'].co_varnames
165+
argcount = info['__code__'].co_argcount
166+
167+
# Actually execute the command
174168
try:
175-
return_val = command(parser, args)
169+
if argcount == 3 and varnames[2] == 'unknown_args':
170+
return_val = command(parser, args, unknown_args)
171+
else:
172+
if unknown_args:
173+
tty.die('unrecognized arguments: %s' % ' '.join(unknown_args))
174+
return_val = command(parser, args)
176175
except SpackError as e:
177176
e.die()
178177
except KeyboardInterrupt:
@@ -188,11 +187,26 @@ def main():
188187
tty.die("Bad return value from command %s: %s"
189188
% (args.command, return_val))
190189

191-
if args.profile:
192-
import cProfile
193-
cProfile.run('main()', sort='time')
194-
elif args.pdb:
195-
import pdb
196-
pdb.run('main()')
197-
else:
198-
main()
190+
191+
def main(args):
192+
# Just print help and exit if run with no arguments at all
193+
if len(args) == 1:
194+
parser.print_help()
195+
sys.exit(1)
196+
197+
# actually parse the args.
198+
args, unknown = parser.parse_known_args()
199+
200+
if args.profile:
201+
import cProfile
202+
cProfile.runctx('_main(args, unknown)', globals(), locals(),
203+
sort='time')
204+
elif args.pdb:
205+
import pdb
206+
pdb.runctx('_main(args, unknown)', globals(), locals())
207+
else:
208+
_main(args, unknown)
209+
210+
211+
if __name__ == '__main__':
212+
main(sys.argv)

lib/spack/docs/basic_usage.rst

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -123,21 +123,21 @@ that the packages is installed:
123123
124124
$ spack install mpileaks
125125
==> Installing mpileaks
126-
==> mpich is already installed in /home/gamblin2/spack/opt/linux-debian7-x86_64/[email protected]/[email protected].
127-
==> callpath is already installed in /home/gamblin2/spack/opt/linux-debian7-x86_64/[email protected]/[email protected].
128-
==> adept-utils is already installed in /home/gamblin2/spack/opt/linux-debian7-x86_64/[email protected]/[email protected].
126+
==> mpich is already installed in ~/spack/opt/linux-debian7-x86_64/[email protected]/[email protected].
127+
==> callpath is already installed in ~/spack/opt/linux-debian7-x86_64/[email protected]/[email protected].
128+
==> adept-utils is already installed in ~/spack/opt/linux-debian7-x86_64/[email protected]/[email protected].
129129
==> Trying to fetch from https://github.com/hpc/mpileaks/releases/download/v1.0/mpileaks-1.0.tar.gz
130130
######################################################################## 100.0%
131-
==> Staging archive: /home/gamblin2/spack/var/spack/stage/[email protected]%[email protected] arch=linux-debian7-x86_64-59f6ad23/mpileaks-1.0.tar.gz
132-
==> Created stage in /home/gamblin2/spack/var/spack/stage/[email protected]%[email protected] arch=linux-debian7-x86_64-59f6ad23.
131+
==> Staging archive: ~/spack/var/spack/stage/[email protected]%[email protected] arch=linux-debian7-x86_64-59f6ad23/mpileaks-1.0.tar.gz
132+
==> Created stage in ~/spack/var/spack/stage/[email protected]%[email protected] arch=linux-debian7-x86_64-59f6ad23.
133133
==> No patches needed for mpileaks.
134134
==> Building mpileaks.
135135
136136
... build output ...
137137
138138
==> Successfully installed mpileaks.
139139
Fetch: 2.16s. Build: 9.82s. Total: 11.98s.
140-
[+] /home/gamblin2/spack/opt/linux-debian7-x86_64/[email protected]/[email protected]
140+
[+] ~/spack/opt/linux-debian7-x86_64/[email protected]/[email protected]
141141
142142
The last line, with the ``[+]``, indicates where the package is
143143
installed.
@@ -252,7 +252,7 @@ the tarballs in question to it (see :ref:`mirrors`):
252252
.. code-block:: yaml
253253
254254
mirrors:
255-
manual: file:///home/me/.spack/manual_mirror
255+
manual: file://~/.spack/manual_mirror
256256
257257
#. Put your tarballs in it. Tarballs should be named
258258
``<package>/<package>-<version>.tar.gz``. For example:
@@ -374,13 +374,13 @@ use ``spack find --paths``:
374374
$ spack find --paths
375375
==> 74 installed packages.
376376
-- linux-debian7-x86_64 / [email protected] --------------------------------
377-
[email protected] /home/gamblin2/spack/opt/linux-debian7-x86_64/[email protected]/[email protected]
378-
[email protected] /home/gamblin2/spack/opt/linux-debian7-x86_64/[email protected]/[email protected]
379-
[email protected] /home/gamblin2/spack/opt/linux-debian7-x86_64/[email protected]/[email protected]
380-
[email protected] /home/gamblin2/spack/opt/linux-debian7-x86_64/[email protected]/[email protected]
381-
[email protected] /home/gamblin2/spack/opt/linux-debian7-x86_64/[email protected]/[email protected]
382-
[email protected] /home/gamblin2/spack/opt/linux-debian7-x86_64/[email protected]/[email protected]
383-
[email protected] /home/gamblin2/spack/opt/linux-debian7-x86_64/[email protected]/[email protected]
377+
[email protected] ~/spack/opt/linux-debian7-x86_64/[email protected]/[email protected]
378+
[email protected] ~/spack/opt/linux-debian7-x86_64/[email protected]/[email protected]
379+
[email protected] ~/spack/opt/linux-debian7-x86_64/[email protected]/[email protected]
380+
[email protected] ~/spack/opt/linux-debian7-x86_64/[email protected]/[email protected]
381+
[email protected] ~/spack/opt/linux-debian7-x86_64/[email protected]/[email protected]
382+
[email protected] ~/spack/opt/linux-debian7-x86_64/[email protected]/[email protected]
383+
[email protected] ~/spack/opt/linux-debian7-x86_64/[email protected]/[email protected]
384384
...
385385
386386
And, finally, you can restrict your search to a particular package
@@ -390,9 +390,9 @@ by supplying its name:
390390
391391
$ spack find --paths libelf
392392
-- linux-debian7-x86_64 / [email protected] --------------------------------
393-
[email protected] /home/gamblin2/spack/opt/linux-debian7-x86_64/[email protected]/[email protected]
394-
[email protected] /home/gamblin2/spack/opt/linux-debian7-x86_64/[email protected]/[email protected]
395-
[email protected] /home/gamblin2/spack/opt/linux-debian7-x86_64/[email protected]/[email protected]
393+
[email protected] ~/spack/opt/linux-debian7-x86_64/[email protected]/[email protected]
394+
[email protected] ~/spack/opt/linux-debian7-x86_64/[email protected]/[email protected]
395+
[email protected] ~/spack/opt/linux-debian7-x86_64/[email protected]/[email protected]
396396
397397
``spack find`` actually does a lot more than this. You can use
398398
*specs* to query for specific configurations and builds of each
@@ -647,8 +647,8 @@ avoid ambiguity.
647647

648648
When spack normalizes specs, it prints them out with no spaces boolean
649649
variants using the backwards compatibility syntax and uses only ``~``
650-
for disabled boolean variants. We allow ``-`` and spaces on the command
651-
line is provided for convenience and legibility.
650+
for disabled boolean variants. The ``-`` and spaces on the command
651+
line are provided for convenience and legibility.
652652

653653
^^^^^^^^^^^^^^
654654
Compiler Flags
@@ -658,14 +658,17 @@ Compiler flags are specified using the same syntax as non-boolean variants,
658658
but fulfill a different purpose. While the function of a variant is set by
659659
the package, compiler flags are used by the compiler wrappers to inject
660660
flags into the compile line of the build. Additionally, compiler flags are
661-
inherited by dependencies. ``spack install libdwarf cppflags=\"-g\"`` will
661+
inherited by dependencies. ``spack install libdwarf cppflags="-g"`` will
662662
install both libdwarf and libelf with the ``-g`` flag injected into their
663663
compile line.
664664

665-
Notice that the value of the compiler flags must be escape quoted on the
666-
command line. From within python files, the same spec would be specified
667-
``libdwarf cppflags="-g"``. This is necessary because of how the shell
668-
handles the quote symbols.
665+
Notice that the value of the compiler flags must be quoted if it
666+
contains any spaces. Any of ``cppflags=-O3``, ``cppflags="-O3"``,
667+
``cppflags='-O3'``, and ``cppflags="-O3 -fPIC"`` are acceptable, but
668+
``cppflags=-O3 -fPIC`` is not. Additionally, if they value of the
669+
compiler flags is not the last thing on the line, it must be followed
670+
by a space. The commmand ``spack install libelf cppflags="-O3"%intel``
671+
will be interpreted as an attempt to set `cppflags="-O3%intel"``.
669672
670673
The six compiler flags are injected in the order of implicit make commands
671674
in GNU Autotools. If all flags are set, the order is
@@ -900,7 +903,7 @@ prefixes, and you can see this with ``spack find --paths``:
900903
$ spack find --paths py-numpy
901904
==> 1 installed packages.
902905
-- linux-debian7-x86_64 / [email protected] --------------------------------
903-
[email protected] /g/g21/gamblin2/src/spack/opt/linux-debian7-x86_64/[email protected]/[email protected]
906+
[email protected] ~/spack/opt/linux-debian7-x86_64/[email protected]/[email protected]
904907
905908
However, even though this package is installed, you cannot use it
906909
directly when you run ``python``:

lib/spack/docs/conf.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
# flake8: noqa
22
##############################################################################
3+
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
4+
# Produced at the Lawrence Livermore National Laboratory.
5+
#
36
# This file is part of Spack.
4-
# Created by Todd Gamblin, [email protected].
7+
# Created by Todd Gamblin, [email protected], All rights reserved.
58
# LLNL-CODE-647188
69
#
710
# For details, see https://github.com/llnl/spack
811
# Please also see the LICENSE file for our notice and the LGPL.
912
#
1013
# This program is free software; you can redistribute it and/or modify
11-
# it under the terms of the GNU General Public License (as published by
12-
# the Free Software Foundation) version 2.1 dated February 1999.
14+
# it under the terms of the GNU Lesser General Public License (as
15+
# published by the Free Software Foundation) version 2.1, February 1999.
1316
#
1417
# This program is distributed in the hope that it will be useful, but
1518
# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
1619
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
17-
# conditions of the GNU General Public License for more details.
20+
# conditions of the GNU Lesser General Public License for more details.
1821
#
19-
# You should have received a copy of the GNU Lesser General Public License
20-
# along with this program; if not, write to the Free Software Foundation,
21-
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22+
# You should have received a copy of the GNU Lesser General Public
23+
# License along with this program; if not, write to the Free Software
24+
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2225
##############################################################################
2326
# -*- coding: utf-8 -*-
2427
#

lib/spack/docs/contribution_guide.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ This allows you to develop iteratively: make a change, test that change, make
7575
another change, test that change, etc. To get a list of all available unit
7676
tests, run:
7777

78-
.. command-output:: spack test --list
78+
.. command-output:: spack test --collect-only
7979

8080
Unit tests are crucial to making sure bugs aren't introduced into Spack. If you
8181
are modifying core Spack libraries or adding new functionality, please consider

0 commit comments

Comments
 (0)