summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlib/spack/external/pyqver2.py3
-rw-r--r--lib/spack/spack/cmd/extensions.py8
-rw-r--r--lib/spack/spack/cmd/fetch.py13
-rw-r--r--lib/spack/spack/cmd/mirror.py12
-rw-r--r--lib/spack/spack/cmd/python.py10
-rw-r--r--lib/spack/spack/cmd/uninstall.py9
-rw-r--r--lib/spack/spack/database.py1
-rw-r--r--lib/spack/spack/hooks/extensions.py4
-rw-r--r--lib/spack/spack/mirror.py2
-rw-r--r--lib/spack/spack/package.py28
-rw-r--r--lib/spack/spack/test/python_version.py4
-rwxr-xr-xshare/spack/setup-env.sh8
-rw-r--r--var/spack/packages/cfitsio/package.py18
-rw-r--r--var/spack/packages/global/package.py6
-rw-r--r--var/spack/packages/mpich/package.py13
-rw-r--r--var/spack/packages/mrnet/package.py1
-rw-r--r--var/spack/packages/mvapich2/package.py30
-rw-r--r--var/spack/packages/py-cffi/package.py2
-rw-r--r--var/spack/packages/spot/package.py18
-rw-r--r--var/spack/packages/tmuxinator/package.py5
20 files changed, 156 insertions, 39 deletions
diff --git a/lib/spack/external/pyqver2.py b/lib/spack/external/pyqver2.py
index 4a16e2811e..4690239748 100755
--- a/lib/spack/external/pyqver2.py
+++ b/lib/spack/external/pyqver2.py
@@ -30,7 +30,8 @@ import sys
StandardModules = {
"__future__": (2, 1),
"abc": (2, 6),
- "argparse": (2, 7),
+# skip argparse now that it's in lib/spack/external
+# "argparse": (2, 7),
"ast": (2, 6),
"atexit": (2, 0),
"bz2": (2, 3),
diff --git a/lib/spack/spack/cmd/extensions.py b/lib/spack/spack/cmd/extensions.py
index c2cf288877..2ce6f406ca 100644
--- a/lib/spack/spack/cmd/extensions.py
+++ b/lib/spack/spack/cmd/extensions.py
@@ -54,7 +54,9 @@ def extensions(parser, args):
if not args.spec:
tty.die("extensions requires a package spec.")
+ #
# Checks
+ #
spec = spack.cmd.parse_specs(args.spec)
if len(spec) > 1:
tty.die("Can only list extensions for one package.")
@@ -70,7 +72,9 @@ def extensions(parser, args):
if not args.mode:
args.mode = 'short'
+ #
# List package names of extensions
+ #
extensions = spack.db.extensions_for(spec)
if not extensions:
tty.msg("%s has no extensions." % spec.cshort_spec)
@@ -79,7 +83,9 @@ def extensions(parser, args):
tty.msg("%d extensions:" % len(extensions))
colify(ext.name for ext in extensions)
+ #
# List specs of installed extensions.
+ #
installed = [s.spec for s in spack.installed_db.installed_extensions_for(spec)]
print
if not installed:
@@ -88,7 +94,9 @@ def extensions(parser, args):
tty.msg("%d installed:" % len(installed))
spack.cmd.find.display_specs(installed, mode=args.mode)
+ #
# List specs of activated extensions.
+ #
activated = spack.install_layout.extension_map(spec)
print
if not activated:
diff --git a/lib/spack/spack/cmd/fetch.py b/lib/spack/spack/cmd/fetch.py
index 6f9e7ab5e2..57d6f6b63b 100644
--- a/lib/spack/spack/cmd/fetch.py
+++ b/lib/spack/spack/cmd/fetch.py
@@ -34,9 +34,12 @@ def setup_parser(subparser):
'-n', '--no-checksum', action='store_true', dest='no_checksum',
help="Do not check packages against checksum")
subparser.add_argument(
+ '-m', '--missing', action='store_true', help="Also fetch all missing dependencies")
+ subparser.add_argument(
+ '-D', '--dependencies', action='store_true', help="Also fetch all dependencies")
+ subparser.add_argument(
'packages', nargs=argparse.REMAINDER, help="specs of packages to fetch")
-
def fetch(parser, args):
if not args.packages:
tty.die("fetch requires at least one package argument")
@@ -46,5 +49,13 @@ def fetch(parser, args):
specs = spack.cmd.parse_specs(args.packages, concretize=True)
for spec in specs:
+ if args.missing or args.dependencies:
+ to_fetch = set()
+ for s in spec.traverse():
+ package = spack.db.get(s)
+ if args.missing and package.installed:
+ continue
+ package.do_fetch()
+
package = spack.db.get(spec)
package.do_fetch()
diff --git a/lib/spack/spack/cmd/mirror.py b/lib/spack/spack/cmd/mirror.py
index 4a1ce00b75..89d51bbe04 100644
--- a/lib/spack/spack/cmd/mirror.py
+++ b/lib/spack/spack/cmd/mirror.py
@@ -55,6 +55,8 @@ def setup_parser(subparser):
create_parser.add_argument(
'-f', '--file', help="File with specs of packages to put in mirror.")
create_parser.add_argument(
+ '-D', '--dependencies', action='store_true', help="Also fetch all dependencies")
+ create_parser.add_argument(
'-o', '--one-version-per-spec', action='store_const', const=1, default=0,
help="Only fetch one 'preferred' version per spec, not all known versions.")
@@ -118,7 +120,7 @@ def mirror_create(args):
"""Create a directory to be used as a spack mirror, and fill it with
package archives."""
# try to parse specs from the command line first.
- specs = spack.cmd.parse_specs(args.specs)
+ specs = spack.cmd.parse_specs(args.specs, concretize=True)
# If there is a file, parse each line as a spec and add it to the list.
if args.file:
@@ -131,6 +133,14 @@ def mirror_create(args):
specs = [Spec(n) for n in spack.db.all_package_names()]
specs.sort(key=lambda s: s.format("$_$@").lower())
+ if args.dependencies:
+ new_specs = set()
+ for spec in specs:
+ spec.concretize()
+ for s in spec.traverse():
+ new_specs.add(s)
+ specs = list(new_specs)
+
# Default name for directory is spack-mirror-<DATESTAMP>
directory = args.directory
if not directory:
diff --git a/lib/spack/spack/cmd/python.py b/lib/spack/spack/cmd/python.py
index e26b8d3e79..5325e8fd9a 100644
--- a/lib/spack/spack/cmd/python.py
+++ b/lib/spack/spack/cmd/python.py
@@ -32,13 +32,16 @@ import spack
def setup_parser(subparser):
subparser.add_argument(
+ '-c', dest='python_command', help='Command to execute.')
+ subparser.add_argument(
'python_args', nargs=argparse.REMAINDER, help="File to run plus arguments.")
description = "Launch an interpreter as spack would launch a command"
def python(parser, args):
# Fake a main python shell by setting __name__ to __main__.
- console = code.InteractiveConsole({'__name__' : '__main__'})
+ console = code.InteractiveConsole({'__name__' : '__main__',
+ 'spack' : spack})
if "PYTHONSTARTUP" in os.environ:
startup_file = os.environ["PYTHONSTARTUP"]
@@ -47,7 +50,10 @@ def python(parser, args):
console.runsource(startup.read(), startup_file, 'exec')
python_args = args.python_args
- if python_args:
+ python_command = args.python_command
+ if python_command:
+ console.runsource(python_command)
+ elif python_args:
sys.argv = python_args
with open(python_args[0]) as file:
console.runsource(file.read(), python_args[0], 'exec')
diff --git a/lib/spack/spack/cmd/uninstall.py b/lib/spack/spack/cmd/uninstall.py
index 191d9d88e8..03873bb5f8 100644
--- a/lib/spack/spack/cmd/uninstall.py
+++ b/lib/spack/spack/cmd/uninstall.py
@@ -42,9 +42,9 @@ def setup_parser(subparser):
help="Remove regardless of whether other packages depend on this one.")
subparser.add_argument(
'-a', '--all', action='store_true', dest='all',
- help="USE CAREFULLY. Remove ALL installed packages that match each supplied spec. " +
- "i.e., if you say uninstall libelf, ALL versions of libelf are uninstalled. " +
- "This is both useful and dangerous, like rm -r.")
+ help="USE CAREFULLY. Remove ALL installed packages that match each " +
+ "supplied spec. i.e., if you say uninstall libelf, ALL versions of " +
+ "libelf are uninstalled. This is both useful and dangerous, like rm -r.")
subparser.add_argument(
'packages', nargs=argparse.REMAINDER, help="specs of packages to uninstall")
@@ -81,7 +81,8 @@ def uninstall(parser, args):
pkgs.append(s.package)
except spack.packages.UnknownPackageError, e:
- # The package.py file has gone away -- but still want to uninstall.
+ # The package.py file has gone away -- but still want to
+ # uninstall.
spack.Package(s).do_uninstall(force=True)
# Sort packages to be uninstalled by the number of installed dependents
diff --git a/lib/spack/spack/database.py b/lib/spack/spack/database.py
index bf54055a24..a6f1cc5077 100644
--- a/lib/spack/spack/database.py
+++ b/lib/spack/spack/database.py
@@ -54,6 +54,7 @@ import spack.spec
from spack.version import Version
from spack.spec import Spec
from spack.error import SpackError
+from spack.packages import UnknownPackageError
# DB goes in this directory underneath the root
_db_dirname = '.spack-db'
diff --git a/lib/spack/spack/hooks/extensions.py b/lib/spack/spack/hooks/extensions.py
index b4847d697f..627184cabd 100644
--- a/lib/spack/spack/hooks/extensions.py
+++ b/lib/spack/spack/hooks/extensions.py
@@ -27,9 +27,7 @@ import spack
def pre_uninstall(pkg):
- # Need to do this b/c uninstall does not automatically do it.
- # TODO: store full graph info in stored .spec file.
- pkg.spec.normalize()
+ assert(pkg.spec.concrete)
if pkg.is_extension:
if pkg.activated:
diff --git a/lib/spack/spack/mirror.py b/lib/spack/spack/mirror.py
index ee0bf6de11..6fbf82de14 100644
--- a/lib/spack/spack/mirror.py
+++ b/lib/spack/spack/mirror.py
@@ -146,7 +146,7 @@ def create(path, specs, **kwargs):
stage = None
try:
# create a subdirectory for the current package@version
- archive_path = os.path.abspath(join_path(path, mirror_archive_path(spec)))
+ archive_path = os.path.abspath(join_path(mirror_root, mirror_archive_path(spec)))
subdir = os.path.dirname(archive_path)
mkdirp(subdir)
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index daba5cd352..4d75726e06 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -487,9 +487,15 @@ class Package(object):
if name == dep.name:
return dep
- # Otherwise return the spec from the extends() directive
- spec, kwargs = self.extendees[name]
- return spec
+ # if the spec is concrete already, then it extends something
+ # that is an *optional* dependency, and the dep isn't there.
+ if self.spec._concrete:
+ return None
+ else:
+ # If it's not concrete, then return the spec from the
+ # extends() directive since that is all we know so far.
+ spec, kwargs = self.extendees[name]
+ return spec
@property
@@ -497,18 +503,28 @@ class Package(object):
"""Spec of the extendee of this package, or None if it is not an extension."""
if not self.extendees:
return None
+
+ # TODO: allow multiple extendees.
name = next(iter(self.extendees))
return self.extendees[name][1]
@property
def is_extension(self):
- return len(self.extendees) > 0
+ # if it is concrete, it's only an extension if it actually
+ # dependes on the extendee.
+ if self.spec._concrete:
+ return self.extendee_spec is not None
+ else:
+ # If not, then it's an extension if it *could* be an extension
+ return bool(self.extendees)
def extends(self, spec):
- return (spec.name in self.extendees and
- spec.satisfies(self.extendees[spec.name][0]))
+ if not spec.name in self.extendees:
+ return False
+ s = self.extendee_spec
+ return s and s.satisfies(spec)
@property
diff --git a/lib/spack/spack/test/python_version.py b/lib/spack/spack/test/python_version.py
index ba570b416f..2ea5febb11 100644
--- a/lib/spack/spack/test/python_version.py
+++ b/lib/spack/spack/test/python_version.py
@@ -63,10 +63,6 @@ class PythonVersionTest(unittest.TestCase):
all_issues = {}
for fn in files:
- if fn != '/Users/gamblin2/src/spack/var/spack/packages/vim/package.py':
- continue
- print fn
-
with open(fn) as pyfile:
versions = pyqver2.get_versions(pyfile.read())
for ver, reasons in versions.items():
diff --git a/share/spack/setup-env.sh b/share/spack/setup-env.sh
index 9f4ddd3faf..47202f6087 100755
--- a/share/spack/setup-env.sh
+++ b/share/spack/setup-env.sh
@@ -173,8 +173,8 @@ fi
#
_sp_share_dir=$(cd "$(dirname $_sp_source_file)" && pwd)
_sp_prefix=$(cd "$(dirname $(dirname $_sp_share_dir))" && pwd)
+_spack_pathadd PATH "${_sp_prefix%/}/bin"
-# TODO: fix SYS_TYPE to something non-LLNL-specific
-_spack_pathadd DK_NODE "$_sp_share_dir/dotkit/$SYS_TYPE"
-_spack_pathadd MODULEPATH "$_sp_share_dir/modules/$SYS_TYPE"
-_spack_pathadd PATH "$_sp_prefix/bin"
+_sp_sys_type=$(spack-python -c 'print(spack.architecture.sys_type())')
+_spack_pathadd DK_NODE "${_sp_share_dir%/}/dotkit/$_sp_sys_type"
+_spack_pathadd MODULEPATH "${_sp_share_dir%/}/modules/$_sp_sys_type"
diff --git a/var/spack/packages/cfitsio/package.py b/var/spack/packages/cfitsio/package.py
new file mode 100644
index 0000000000..ff450cb5f3
--- /dev/null
+++ b/var/spack/packages/cfitsio/package.py
@@ -0,0 +1,18 @@
+from spack import *
+
+class Cfitsio(Package):
+ """
+ CFITSIO is a library of C and Fortran subroutines for reading and writing
+ data files in FITS (Flexible Image Transport System) data format.
+ """
+ homepage = 'http://heasarc.gsfc.nasa.gov/fitsio/'
+ version('3.370', 'abebd2d02ba5b0503c633581e3bfa116')
+
+ def url_for_version(self, v):
+ url = 'ftp://heasarc.gsfc.nasa.gov/software/fitsio/c/cfitsio{0}.tar.gz'
+ return url.format(str(v).replace('.', ''))
+
+ def install(self, spec, prefix):
+ configure('--prefix=' + prefix)
+ make()
+ make('install')
diff --git a/var/spack/packages/global/package.py b/var/spack/packages/global/package.py
index a77b1bdc09..e8f06516d9 100644
--- a/var/spack/packages/global/package.py
+++ b/var/spack/packages/global/package.py
@@ -4,7 +4,7 @@ import os
class Global(Package):
""" The Gnu Global tagging system """
- # FIXME: add a proper url for your package's homepage here.
+
homepage = "http://www.gnu.org/software/global"
url = "http://tamacom.com/global/global-6.5.tar.gz"
@@ -13,9 +13,9 @@ class Global(Package):
depends_on('exuberant-ctags')
def install(self, spec, prefix):
- config_args = ['--prefix={}'.format(prefix)]
+ config_args = ['--prefix={0}'.format(prefix)]
- config_args.append('--with-exuberant-ctags={}'.format(
+ config_args.append('--with-exuberant-ctags={0}'.format(
os.path.join(spec['exuberant-ctags'].prefix.bin, 'ctags')))
configure(*config_args)
diff --git a/var/spack/packages/mpich/package.py b/var/spack/packages/mpich/package.py
index e018a08201..7cfa0a3b61 100644
--- a/var/spack/packages/mpich/package.py
+++ b/var/spack/packages/mpich/package.py
@@ -85,8 +85,13 @@ class Mpich(Package):
mpif77 = os.path.join(bin, 'mpif77')
mpif90 = os.path.join(bin, 'mpif90')
+ spack_cc = os.environ['CC']
+ spack_cxx = os.environ['CXX']
+ spack_f77 = os.environ['F77']
+ spack_fc = os.environ['FC']
+
kwargs = { 'ignore_absent' : True, 'backup' : False, 'string' : True }
- filter_file('CC="cc"', 'CC="%s"' % self.compiler.cc, mpicc, **kwargs)
- filter_file('CXX="c++"', 'CXX="%s"' % self.compiler.cxx, mpicxx, **kwargs)
- filter_file('F77="f77"', 'F77="%s"' % self.compiler.f77, mpif77, **kwargs)
- filter_file('FC="f90"', 'FC="%s"' % self.compiler.fc, mpif90, **kwargs)
+ filter_file('CC="%s"' % spack_cc , 'CC="%s"' % self.compiler.cc, mpicc, **kwargs)
+ filter_file('CXX="%s"'% spack_cxx, 'CXX="%s"' % self.compiler.cxx, mpicxx, **kwargs)
+ filter_file('F77="%s"'% spack_f77, 'F77="%s"' % self.compiler.f77, mpif77, **kwargs)
+ filter_file('FC="%s"' % spack_fc , 'FC="%s"' % self.compiler.fc, mpif90, **kwargs)
diff --git a/var/spack/packages/mrnet/package.py b/var/spack/packages/mrnet/package.py
index 3eb33d0714..fed944e45f 100644
--- a/var/spack/packages/mrnet/package.py
+++ b/var/spack/packages/mrnet/package.py
@@ -7,6 +7,7 @@ class Mrnet(Package):
version('4.0.0', 'd00301c078cba57ef68613be32ceea2f')
version('4.1.0', '5a248298b395b329e2371bf25366115c')
+ version('5.0.1', '17f65738cf1b9f9b95647ff85f69ecdd')
variant('lwthreads', default=False, description="Also build the MRNet LW threadsafe libraries")
parallel = False
diff --git a/var/spack/packages/mvapich2/package.py b/var/spack/packages/mvapich2/package.py
index dc2b2cb23f..23a11b3171 100644
--- a/var/spack/packages/mvapich2/package.py
+++ b/var/spack/packages/mvapich2/package.py
@@ -1,5 +1,5 @@
from spack import *
-
+import os
class Mvapich2(Package):
"""MVAPICH2 is an MPI implementation for Infiniband networks."""
@@ -154,3 +154,31 @@ class Mvapich2(Package):
configure(*configure_args)
make()
make("install")
+
+ self.filter_compilers()
+
+
+ def filter_compilers(self):
+ """Run after install to make the MPI compilers use the
+ compilers that Spack built the package with.
+
+ If this isn't done, they'll have CC, CXX, F77, and FC set
+ to Spack's generic cc, c++, f77, and f90. We want them to
+ be bound to whatever compiler they were built with.
+ """
+ bin = self.prefix.bin
+ mpicc = os.path.join(bin, 'mpicc')
+ mpicxx = os.path.join(bin, 'mpicxx')
+ mpif77 = os.path.join(bin, 'mpif77')
+ mpif90 = os.path.join(bin, 'mpif90')
+
+ spack_cc = os.environ['CC']
+ spack_cxx = os.environ['CXX']
+ spack_f77 = os.environ['F77']
+ spack_fc = os.environ['FC']
+
+ kwargs = { 'ignore_absent' : True, 'backup' : False, 'string' : True }
+ filter_file('CC="%s"' % spack_cc , 'CC="%s"' % self.compiler.cc, mpicc, **kwargs)
+ filter_file('CXX="%s"'% spack_cxx, 'CXX="%s"' % self.compiler.cxx, mpicxx, **kwargs)
+ filter_file('F77="%s"'% spack_f77, 'F77="%s"' % self.compiler.f77, mpif77, **kwargs)
+ filter_file('FC="%s"' % spack_fc , 'FC="%s"' % self.compiler.fc, mpif90, **kwargs)
diff --git a/var/spack/packages/py-cffi/package.py b/var/spack/packages/py-cffi/package.py
index a4d37483fe..909049a67c 100644
--- a/var/spack/packages/py-cffi/package.py
+++ b/var/spack/packages/py-cffi/package.py
@@ -4,7 +4,7 @@ class PyCffi(Package):
"""Foreign Function Interface for Python calling C code"""
homepage = "http://cffi.readthedocs.org/en/latest/"
# base https://pypi.python.org/pypi/cffi
- url = "https://pypi.python.org/packages/source/c/cffi/cffi-1.1.2.tar.gz#md5="
+ url = "https://pypi.python.org/packages/source/c/cffi/cffi-1.1.2.tar.gz"
version('1.1.2', 'ca6e6c45b45caa87aee9adc7c796eaea')
diff --git a/var/spack/packages/spot/package.py b/var/spack/packages/spot/package.py
new file mode 100644
index 0000000000..9e539277ae
--- /dev/null
+++ b/var/spack/packages/spot/package.py
@@ -0,0 +1,18 @@
+from spack import *
+import os
+
+class Spot(Package):
+ """Spot is a C++11 library for omega-automata manipulation and model checking."""
+ homepage = "https://spot.lrde.epita.fr/index.html"
+ url = "http://www.lrde.epita.fr/dload/spot/spot-1.99.3.tar.gz"
+
+ version('1.99.3', 'd53adcb2d0fe7c69f45d4e595a58254e')
+
+ #depends_on("gcc@4.8:")
+ depends_on("python@3.2:")
+
+ def install(self, spec, prefix):
+ configure('--prefix=%s' % prefix)
+
+ make()
+ make("install")
diff --git a/var/spack/packages/tmuxinator/package.py b/var/spack/packages/tmuxinator/package.py
index 26c061cbd6..77ae063e5d 100644
--- a/var/spack/packages/tmuxinator/package.py
+++ b/var/spack/packages/tmuxinator/package.py
@@ -5,7 +5,7 @@ class Tmuxinator(Package):
homepage = "https://github.com/tmuxinator/tmuxinator"
url = "https://github.com/tmuxinator/tmuxinator"
- version('0.6.11',
+ version('0.6.11',
git='https://github.com/tmuxinator/tmuxinator',
tag='v0.6.11')
@@ -13,5 +13,4 @@ class Tmuxinator(Package):
def install(self, spec, prefix):
gem('build', 'tmuxinator.gemspec')
- gem('install', 'tmuxinator-{}.gem'.format(self.version))
-
+ gem('install', 'tmuxinator-{0}.gem'.format(self.version))