From b8b334e86c9fb0ab4c7f682bccf82815d114e0a8 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sun, 16 Mar 2014 14:51:03 -0700 Subject: New, more consistent package directory structure. - Packages now live in /package.py - spack.packages refactored to use a PackageDB object instead of monolithic module. - Implementation of mock_packages_test.py is greatly simplified - Added test to exercise install/uninstall code because that wasn't covered by existing tests and kept breaking. --- lib/spack/spack/cmd/checksum.py | 3 +- lib/spack/spack/cmd/clean.py | 4 +- lib/spack/spack/cmd/create.py | 7 +- lib/spack/spack/cmd/edit.py | 5 +- lib/spack/spack/cmd/fetch.py | 4 +- lib/spack/spack/cmd/find.py | 4 +- lib/spack/spack/cmd/graph.py | 3 +- lib/spack/spack/cmd/info.py | 3 +- lib/spack/spack/cmd/install.py | 3 +- lib/spack/spack/cmd/list.py | 4 +- lib/spack/spack/cmd/mirror.py | 7 +- lib/spack/spack/cmd/patch.py | 4 +- lib/spack/spack/cmd/providers.py | 4 +- lib/spack/spack/cmd/stage.py | 5 +- lib/spack/spack/cmd/test.py | 1 - lib/spack/spack/cmd/uninstall.py | 6 +- lib/spack/spack/cmd/versions.py | 4 +- lib/spack/spack/concretize.py | 1 - lib/spack/spack/globals.py | 8 +- lib/spack/spack/package.py | 30 +- lib/spack/spack/packages/__init__.py | 453 ++++++++------------- lib/spack/spack/packages/callpath.py | 37 -- lib/spack/spack/packages/callpath/package.py | 37 ++ lib/spack/spack/packages/cmake.py | 36 -- lib/spack/spack/packages/cmake/package.py | 36 ++ lib/spack/spack/packages/dyninst.py | 41 -- lib/spack/spack/packages/dyninst/package.py | 41 ++ lib/spack/spack/packages/graphlib.py | 14 - lib/spack/spack/packages/graphlib/package.py | 14 + lib/spack/spack/packages/launchmon/__init__.py | 45 -- lib/spack/spack/packages/launchmon/package.py | 45 ++ lib/spack/spack/packages/libdwarf.py | 75 ---- lib/spack/spack/packages/libdwarf/package.py | 75 ++++ lib/spack/spack/packages/libelf.py | 47 --- lib/spack/spack/packages/libelf/package.py | 47 +++ lib/spack/spack/packages/libunwind.py | 36 -- lib/spack/spack/packages/libunwind/package.py | 36 ++ lib/spack/spack/packages/mpich.py | 43 -- lib/spack/spack/packages/mpich/package.py | 43 ++ lib/spack/spack/packages/mpileaks.py | 37 -- lib/spack/spack/packages/mpileaks/package.py | 37 ++ lib/spack/spack/packages/mrnet.py | 15 - lib/spack/spack/packages/mrnet/package.py | 15 + lib/spack/spack/packages/mvapich2/__init__.py | 27 -- lib/spack/spack/packages/mvapich2/package.py | 27 ++ lib/spack/spack/packages/openmpi/__init__.py | 29 -- lib/spack/spack/packages/openmpi/package.py | 29 ++ lib/spack/spack/packages/pmgr_collective.py | 37 -- .../spack/packages/pmgr_collective/package.py | 37 ++ lib/spack/spack/packages/scr.py | 39 -- lib/spack/spack/packages/scr/package.py | 39 ++ lib/spack/spack/packages/spindle.py | 39 -- lib/spack/spack/packages/spindle/package.py | 39 ++ lib/spack/spack/packages/stat.py | 39 -- lib/spack/spack/packages/stat/package.py | 39 ++ lib/spack/spack/patch.py | 3 +- lib/spack/spack/relations.py | 1 - lib/spack/spack/spec.py | 24 +- lib/spack/spack/test/__init__.py | 5 +- lib/spack/spack/test/concretize.py | 18 +- lib/spack/spack/test/install.py | 98 +++++ lib/spack/spack/test/mock_packages/__init__.py | 24 -- lib/spack/spack/test/mock_packages/callpath.py | 41 -- .../spack/test/mock_packages/callpath/package.py | 41 ++ lib/spack/spack/test/mock_packages/direct_mpich.py | 36 -- .../test/mock_packages/direct_mpich/package.py | 36 ++ .../test/mock_packages/directory-pkg/__init__.py | 39 -- lib/spack/spack/test/mock_packages/dyninst.py | 42 -- .../spack/test/mock_packages/dyninst/package.py | 42 ++ lib/spack/spack/test/mock_packages/fake.py | 33 -- lib/spack/spack/test/mock_packages/fake/package.py | 33 ++ .../spack/test/mock_packages/indirect_mpich.py | 41 -- .../test/mock_packages/indirect_mpich/package.py | 41 ++ lib/spack/spack/test/mock_packages/libdwarf.py | 44 -- .../spack/test/mock_packages/libdwarf/package.py | 44 ++ lib/spack/spack/test/mock_packages/libelf.py | 43 -- .../spack/test/mock_packages/libelf/package.py | 43 ++ lib/spack/spack/test/mock_packages/mpich.py | 43 -- .../spack/test/mock_packages/mpich/package.py | 43 ++ lib/spack/spack/test/mock_packages/mpich2.py | 47 --- .../spack/test/mock_packages/mpich2/package.py | 47 +++ lib/spack/spack/test/mock_packages/mpileaks.py | 40 -- .../spack/test/mock_packages/mpileaks/package.py | 40 ++ lib/spack/spack/test/mock_packages/multimethod.py | 143 ------- .../test/mock_packages/multimethod/package.py | 143 +++++++ .../trivial_install_test_package/package.py | 38 ++ lib/spack/spack/test/mock_packages/zmpi.py | 39 -- lib/spack/spack/test/mock_packages/zmpi/package.py | 39 ++ lib/spack/spack/test/mock_packages_test.py | 45 +- lib/spack/spack/test/multimethod.py | 48 +-- lib/spack/spack/test/packages.py | 40 +- lib/spack/spack/test/spec_dag.py | 1 - lib/spack/spack/virtual.py | 142 +++++++ 93 files changed, 1806 insertions(+), 1739 deletions(-) delete mode 100644 lib/spack/spack/packages/callpath.py create mode 100644 lib/spack/spack/packages/callpath/package.py delete mode 100644 lib/spack/spack/packages/cmake.py create mode 100644 lib/spack/spack/packages/cmake/package.py delete mode 100644 lib/spack/spack/packages/dyninst.py create mode 100644 lib/spack/spack/packages/dyninst/package.py delete mode 100644 lib/spack/spack/packages/graphlib.py create mode 100644 lib/spack/spack/packages/graphlib/package.py delete mode 100644 lib/spack/spack/packages/launchmon/__init__.py create mode 100644 lib/spack/spack/packages/launchmon/package.py delete mode 100644 lib/spack/spack/packages/libdwarf.py create mode 100644 lib/spack/spack/packages/libdwarf/package.py delete mode 100644 lib/spack/spack/packages/libelf.py create mode 100644 lib/spack/spack/packages/libelf/package.py delete mode 100644 lib/spack/spack/packages/libunwind.py create mode 100644 lib/spack/spack/packages/libunwind/package.py delete mode 100644 lib/spack/spack/packages/mpich.py create mode 100644 lib/spack/spack/packages/mpich/package.py delete mode 100644 lib/spack/spack/packages/mpileaks.py create mode 100644 lib/spack/spack/packages/mpileaks/package.py delete mode 100644 lib/spack/spack/packages/mrnet.py create mode 100644 lib/spack/spack/packages/mrnet/package.py delete mode 100644 lib/spack/spack/packages/mvapich2/__init__.py create mode 100644 lib/spack/spack/packages/mvapich2/package.py delete mode 100644 lib/spack/spack/packages/openmpi/__init__.py create mode 100644 lib/spack/spack/packages/openmpi/package.py delete mode 100644 lib/spack/spack/packages/pmgr_collective.py create mode 100644 lib/spack/spack/packages/pmgr_collective/package.py delete mode 100644 lib/spack/spack/packages/scr.py create mode 100644 lib/spack/spack/packages/scr/package.py delete mode 100644 lib/spack/spack/packages/spindle.py create mode 100644 lib/spack/spack/packages/spindle/package.py delete mode 100644 lib/spack/spack/packages/stat.py create mode 100644 lib/spack/spack/packages/stat/package.py create mode 100644 lib/spack/spack/test/install.py delete mode 100644 lib/spack/spack/test/mock_packages/__init__.py delete mode 100644 lib/spack/spack/test/mock_packages/callpath.py create mode 100644 lib/spack/spack/test/mock_packages/callpath/package.py delete mode 100644 lib/spack/spack/test/mock_packages/direct_mpich.py create mode 100644 lib/spack/spack/test/mock_packages/direct_mpich/package.py delete mode 100644 lib/spack/spack/test/mock_packages/directory-pkg/__init__.py delete mode 100644 lib/spack/spack/test/mock_packages/dyninst.py create mode 100644 lib/spack/spack/test/mock_packages/dyninst/package.py delete mode 100644 lib/spack/spack/test/mock_packages/fake.py create mode 100644 lib/spack/spack/test/mock_packages/fake/package.py delete mode 100644 lib/spack/spack/test/mock_packages/indirect_mpich.py create mode 100644 lib/spack/spack/test/mock_packages/indirect_mpich/package.py delete mode 100644 lib/spack/spack/test/mock_packages/libdwarf.py create mode 100644 lib/spack/spack/test/mock_packages/libdwarf/package.py delete mode 100644 lib/spack/spack/test/mock_packages/libelf.py create mode 100644 lib/spack/spack/test/mock_packages/libelf/package.py delete mode 100644 lib/spack/spack/test/mock_packages/mpich.py create mode 100644 lib/spack/spack/test/mock_packages/mpich/package.py delete mode 100644 lib/spack/spack/test/mock_packages/mpich2.py create mode 100644 lib/spack/spack/test/mock_packages/mpich2/package.py delete mode 100644 lib/spack/spack/test/mock_packages/mpileaks.py create mode 100644 lib/spack/spack/test/mock_packages/mpileaks/package.py delete mode 100644 lib/spack/spack/test/mock_packages/multimethod.py create mode 100644 lib/spack/spack/test/mock_packages/multimethod/package.py create mode 100644 lib/spack/spack/test/mock_packages/trivial_install_test_package/package.py delete mode 100644 lib/spack/spack/test/mock_packages/zmpi.py create mode 100644 lib/spack/spack/test/mock_packages/zmpi/package.py create mode 100644 lib/spack/spack/virtual.py (limited to 'lib') diff --git a/lib/spack/spack/cmd/checksum.py b/lib/spack/spack/cmd/checksum.py index 4867d1b520..97ce91386b 100644 --- a/lib/spack/spack/cmd/checksum.py +++ b/lib/spack/spack/cmd/checksum.py @@ -34,7 +34,6 @@ from llnl.util.tty.colify import colify import spack import spack.cmd -import spack.packages as packages import spack.util.crypto from spack.stage import Stage, FailedDownloadError from spack.version import * @@ -81,7 +80,7 @@ def get_checksums(versions, urls, **kwargs): def checksum(parser, args): # get the package we're going to generate checksums for - pkg = packages.get(args.package) + pkg = spack.db.get(args.package) # If the user asked for specific versions, use those. versions = [ver(v) for v in args.versions] diff --git a/lib/spack/spack/cmd/clean.py b/lib/spack/spack/cmd/clean.py index d54b529d3c..6091cae6c8 100644 --- a/lib/spack/spack/cmd/clean.py +++ b/lib/spack/spack/cmd/clean.py @@ -26,8 +26,8 @@ import argparse import llnl.util.tty as tty +import spack import spack.cmd -import spack.packages as packages import spack.stage as stage description = "Remove staged files for packages" @@ -49,7 +49,7 @@ def clean(parser, args): specs = spack.cmd.parse_specs(args.packages, concretize=True) for spec in specs: - package = packages.get(spec) + package = spack.db.get(spec) if args.dist: package.do_clean_dist() elif args.work: diff --git a/lib/spack/spack/cmd/create.py b/lib/spack/spack/cmd/create.py index 236485f9a1..e8fbb46d7a 100644 --- a/lib/spack/spack/cmd/create.py +++ b/lib/spack/spack/cmd/create.py @@ -33,7 +33,6 @@ import llnl.util.tty as tty import spack import spack.cmd import spack.package -import spack.packages as packages import spack.url import spack.util.crypto as crypto import spack.cmd.checksum @@ -131,7 +130,7 @@ def create(parser, args): tty.msg("Couldn't guess a name for this package.") while not name: new_name = raw_input("Name: ") - if packages.valid_name(name): + if spack.db.valid_name(name): name = new_name else: print "Package name can only contain A-Z, a-z, 0-9, '_' and '-'" @@ -141,11 +140,11 @@ def create(parser, args): tty.msg("Creating template for package %s" % name) - pkg_path = packages.filename_for_package_name(name) + pkg_path = spack.db.filename_for_package_name(name) if os.path.exists(pkg_path) and not args.force: tty.die("%s already exists." % pkg_path) - class_name = packages.class_name_for_package_name(name) + class_name = spack.db.class_name_for_package_name(name) versions = list(reversed(spack.package.find_versions_of_archive(url))) archives_to_fetch = 1 diff --git a/lib/spack/spack/cmd/edit.py b/lib/spack/spack/cmd/edit.py index b6373872c0..8a22567099 100644 --- a/lib/spack/spack/cmd/edit.py +++ b/lib/spack/spack/cmd/edit.py @@ -29,7 +29,6 @@ from contextlib import closing import llnl.util.tty as tty import spack -import spack.packages as packages description = "Open package files in $EDITOR" @@ -67,7 +66,7 @@ def edit(parser, args): if not name: path = spack.packages_path else: - path = packages.filename_for_package_name(name) + path = spack.db.filename_for_package_name(name) if os.path.exists(path): if not os.path.isfile(path): @@ -78,7 +77,7 @@ def edit(parser, args): tty.die("No package '%s'. Use spack create, or supply -f/--force " "to edit a new file." % name) else: - class_name = packages.class_name_for_package_name(name) + class_name = spack.db.class_name_for_package_name(name) with closing(open(path, "w")) as pkg_file: pkg_file.write( diff --git a/lib/spack/spack/cmd/fetch.py b/lib/spack/spack/cmd/fetch.py index 86bc9cdef3..1dd8703daf 100644 --- a/lib/spack/spack/cmd/fetch.py +++ b/lib/spack/spack/cmd/fetch.py @@ -24,8 +24,8 @@ ############################################################################## import argparse +import spack import spack.cmd -import spack.packages as packages description = "Fetch archives for packages" @@ -46,5 +46,5 @@ def fetch(parser, args): specs = spack.cmd.parse_specs(args.packages, concretize=True) for spec in specs: - package = packages.get(spec) + package = spack.db.get(spec) package.do_fetch() diff --git a/lib/spack/spack/cmd/find.py b/lib/spack/spack/cmd/find.py index 3db0608d6b..9e8bf190a8 100644 --- a/lib/spack/spack/cmd/find.py +++ b/lib/spack/spack/cmd/find.py @@ -31,7 +31,7 @@ from llnl.util.tty.color import * import spack import spack.spec -import spack.packages as packages +import spack description ="Find installed spack packages" @@ -83,7 +83,7 @@ def find(parser, args): # Make a dict with specs keyed by architecture and compiler. index = hasher() - for spec in packages.installed_package_specs(): + for spec in spack.db.installed_package_specs(): if query_specs and not any(spec.satisfies(q) for q in query_specs): continue diff --git a/lib/spack/spack/cmd/graph.py b/lib/spack/spack/cmd/graph.py index 07fe67ca4b..39dbfbb150 100644 --- a/lib/spack/spack/cmd/graph.py +++ b/lib/spack/spack/cmd/graph.py @@ -23,9 +23,8 @@ # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## import spack -import spack.packages as packages description = "Write out inter-package dependencies in dot graph format" def graph(parser, args): - packages.graph_dependencies() + spack.db.graph_dependencies() diff --git a/lib/spack/spack/cmd/info.py b/lib/spack/spack/cmd/info.py index 3a17b2ce3c..648dbf905a 100644 --- a/lib/spack/spack/cmd/info.py +++ b/lib/spack/spack/cmd/info.py @@ -26,7 +26,6 @@ import re import textwrap from llnl.util.tty.colify import colify import spack -import spack.packages as packages description = "Get detailed information on a particular package" @@ -35,7 +34,7 @@ def setup_parser(subparser): def info(parser, args): - package = packages.get(args.name) + package = spack.db.get(args.name) print "Package: ", package.name print "Homepage: ", package.homepage print "Download: ", package.url diff --git a/lib/spack/spack/cmd/install.py b/lib/spack/spack/cmd/install.py index f80baf0ad6..02194c1b3f 100644 --- a/lib/spack/spack/cmd/install.py +++ b/lib/spack/spack/cmd/install.py @@ -26,7 +26,6 @@ import sys import argparse import spack -import spack.packages as packages import spack.cmd description = "Build and install packages" @@ -56,6 +55,6 @@ def install(parser, args): specs = spack.cmd.parse_specs(args.packages, concretize=True) for spec in specs: - package = packages.get(spec) + package = spack.db.get(spec) package.dirty = args.dirty package.do_install() diff --git a/lib/spack/spack/cmd/list.py b/lib/spack/spack/cmd/list.py index 15e1581868..2b996371ea 100644 --- a/lib/spack/spack/cmd/list.py +++ b/lib/spack/spack/cmd/list.py @@ -22,8 +22,8 @@ # along with this program; if not, write to the Free Software Foundation, # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## -import spack.packages as packages from llnl.util.tty.colify import colify +import spack description ="List available spack packages" @@ -33,4 +33,4 @@ def setup_parser(subparser): def list(parser, args): # Print all the package names in columns - colify(packages.all_package_names()) + colify(spack.db.all_package_names()) diff --git a/lib/spack/spack/cmd/mirror.py b/lib/spack/spack/cmd/mirror.py index 91fe38fe67..94e40557ff 100644 --- a/lib/spack/spack/cmd/mirror.py +++ b/lib/spack/spack/cmd/mirror.py @@ -29,9 +29,8 @@ import argparse import llnl.util.tty as tty from llnl.util.filesystem import mkdirp, join_path -import spack.packages as packages +import spack import spack.cmd - from spack.stage import Stage @@ -46,7 +45,7 @@ def setup_parser(subparser): def mirror(parser, args): if not args.packages: - args.packages = [p for p in packages.all_package_names()] + args.packages = [p for p in spack.db.all_package_names()] if os.path.isfile(args.directory): tty.error("%s already exists and is a file." % args.directory) @@ -59,7 +58,7 @@ def mirror(parser, args): # Iterate through packages and download all the safe tarballs for each of them for pkg_name in args.packages: - pkg = packages.get(pkg_name) + pkg = spack.db.get(pkg_name) # Skip any package that has no checksummed versions. if not pkg.versions: diff --git a/lib/spack/spack/cmd/patch.py b/lib/spack/spack/cmd/patch.py index cc790df56e..2356583b07 100644 --- a/lib/spack/spack/cmd/patch.py +++ b/lib/spack/spack/cmd/patch.py @@ -25,7 +25,7 @@ import argparse import spack.cmd -import spack.packages as packages +import spack description="Patch expanded archive sources in preparation for install" @@ -47,5 +47,5 @@ def patch(parser, args): specs = spack.cmd.parse_specs(args.packages, concretize=True) for spec in specs: - package = packages.get(spec) + package = spack.db.get(spec) package.do_patch() diff --git a/lib/spack/spack/cmd/providers.py b/lib/spack/spack/cmd/providers.py index b59950aeb3..1a652c82d1 100644 --- a/lib/spack/spack/cmd/providers.py +++ b/lib/spack/spack/cmd/providers.py @@ -27,8 +27,8 @@ import argparse from llnl.util.tty.colify import colify +import spack import spack.cmd -import spack.packages description ="List packages that provide a particular virtual package" @@ -39,4 +39,4 @@ def setup_parser(subparser): def providers(parser, args): for spec in spack.cmd.parse_specs(args.vpkg_spec): - colify(sorted(spack.packages.providers_for(spec)), indent=4) + colify(sorted(spack.db.providers_for(spec)), indent=4) diff --git a/lib/spack/spack/cmd/stage.py b/lib/spack/spack/cmd/stage.py index 2ce3d66bcb..1bf1f93c2f 100644 --- a/lib/spack/spack/cmd/stage.py +++ b/lib/spack/spack/cmd/stage.py @@ -24,9 +24,8 @@ ############################################################################## import argparse +import spack import spack.cmd -import spack.packages as packages - description="Expand downloaded archive in preparation for install" @@ -47,5 +46,5 @@ def stage(parser, args): specs = spack.cmd.parse_specs(args.packages, concretize=True) for spec in specs: - package = packages.get(spec) + package = spack.db.get(spec) package.do_stage() diff --git a/lib/spack/spack/cmd/test.py b/lib/spack/spack/cmd/test.py index 16d693aa21..b1418ac2f1 100644 --- a/lib/spack/spack/cmd/test.py +++ b/lib/spack/spack/cmd/test.py @@ -28,7 +28,6 @@ from llnl.util.tty.colify import colify from llnl.util.lang import list_modules import spack -import spack.packages as packages import spack.test description ="Run unit tests" diff --git a/lib/spack/spack/cmd/uninstall.py b/lib/spack/spack/cmd/uninstall.py index e47b4d7f7a..7982892d81 100644 --- a/lib/spack/spack/cmd/uninstall.py +++ b/lib/spack/spack/cmd/uninstall.py @@ -26,8 +26,8 @@ import argparse import llnl.util.tty as tty +import spack import spack.cmd -import spack.packages as packages description="Remove an installed package" @@ -49,7 +49,7 @@ def uninstall(parser, args): # Fail and ask user to be unambiguous if it doesn't pkgs = [] for spec in specs: - matching_specs = packages.get_installed(spec) + matching_specs = spack.db.get_installed(spec) if len(matching_specs) > 1: tty.die("%s matches multiple packages. Which one did you mean?" % spec, *matching_specs) @@ -58,7 +58,7 @@ def uninstall(parser, args): tty.die("%s does not match any installed packages." % spec) installed_spec = matching_specs[0] - pkgs.append(packages.get(installed_spec)) + pkgs.append(spack.db.get(installed_spec)) # Sort packages to be uninstalled by the number of installed dependents # This ensures we do things in the right order diff --git a/lib/spack/spack/cmd/versions.py b/lib/spack/spack/cmd/versions.py index 1f0da9fbd8..c545035279 100644 --- a/lib/spack/spack/cmd/versions.py +++ b/lib/spack/spack/cmd/versions.py @@ -24,7 +24,7 @@ ############################################################################## import os from llnl.util.tty.colify import colify -import spack.packages as packages +import spack description ="List available versions of a package" @@ -33,5 +33,5 @@ def setup_parser(subparser): def versions(parser, args): - pkg = packages.get(args.package) + pkg = spack.db.get(args.package) colify(reversed(pkg.fetch_available_versions())) diff --git a/lib/spack/spack/concretize.py b/lib/spack/spack/concretize.py index 790d67cac8..fc360d59ba 100644 --- a/lib/spack/spack/concretize.py +++ b/lib/spack/spack/concretize.py @@ -35,7 +35,6 @@ TODO: make this customizable and allow users to configure """ import spack.architecture import spack.compilers -import spack.packages import spack.spec from spack.version import * diff --git a/lib/spack/spack/globals.py b/lib/spack/spack/globals.py index 2cf2761362..20801447fa 100644 --- a/lib/spack/spack/globals.py +++ b/lib/spack/spack/globals.py @@ -30,6 +30,7 @@ from spack.version import Version from spack.util.executable import * from spack.directory_layout import SpecHashDirectoryLayout from spack.concretize import DefaultConcretizer +from spack.packages import PackageDB # This lives in $prefix/lib/spac/spack/__file__ prefix = ancestor(__file__, 4) @@ -41,7 +42,6 @@ spack_file = join_path(prefix, "bin", "spack") lib_path = join_path(prefix, "lib", "spack") env_path = join_path(lib_path, "env") module_path = join_path(lib_path, "spack") -packages_path = join_path(module_path, "packages") compilers_path = join_path(module_path, "compilers") test_path = join_path(module_path, "test") @@ -50,6 +50,12 @@ stage_path = join_path(var_path, "stage") install_path = join_path(prefix, "opt") +# +# Set up the packages database. +# +db = PackageDB(join_path(module_path, "packages")) + + # # This controls how spack lays out install prefixes and # stage directories. diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index 68e4e30b3b..ff020fb44c 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -44,19 +44,19 @@ from urlparse import urlparse import llnl.util.tty as tty from llnl.util.tty.color import cwrite -from llnl.util.filesystem import touch +from llnl.util.filesystem import * from llnl.util.lang import * -from spack import * +import spack import spack.spec import spack.error -import spack.packages as packages import spack.url as url import spack.util.crypto as crypto from spack.version import * from spack.stage import Stage from spack.util.web import get_pages from spack.util.environment import * +from spack.util.executable import Executable, which from spack.util.compression import allowed_archive """Allowed URL schemes for spack packages.""" @@ -480,7 +480,7 @@ class Package(object): yield spec continue - for pkg in packages.get(name).preorder_traversal(visited, **kwargs): + for pkg in spack.db.get(name).preorder_traversal(visited, **kwargs): yield pkg @@ -539,7 +539,7 @@ class Package(object): """Return a list of the specs of all installed packages that depend on this one.""" dependents = [] - for spec in packages.installed_package_specs(): + for spec in spack.db.installed_package_specs(): if self.name in spec.dependencies: dep_spec = spec.dependencies[self.name] if self.spec == dep_spec: @@ -594,7 +594,7 @@ class Package(object): self.stage.fetch() - if self.version in self.versions: + if spack.do_checksum and self.version in self.versions: digest = self.versions[self.version] checker = crypto.Checker(digest) if checker.check(self.stage.archive_file): @@ -720,28 +720,28 @@ class Package(object): # Add spack environment at front of path and pass the # lib location along so the compiler script can find spack - os.environ[SPACK_LIB] = lib_path + os.environ[spack.SPACK_LIB] = spack.lib_path # Fix for case-insensitive file systems. Conflicting links are # in directories called "case*" within the env directory. - env_paths = [env_path] - for file in os.listdir(env_path): - path = join_path(env_path, file) + env_paths = [spack.env_path] + for file in os.listdir(spack.env_path): + path = join_path(spack.env_path, file) if file.startswith("case") and os.path.isdir(path): env_paths.append(path) path_put_first("PATH", env_paths) - path_set(SPACK_ENV_PATH, env_paths) + path_set(spack.SPACK_ENV_PATH, env_paths) # Pass along prefixes of dependencies here path_set( - SPACK_DEPENDENCIES, + spack.SPACK_DEPENDENCIES, [dep.package.prefix for dep in self.spec.dependencies.values()]) # Install location - os.environ[SPACK_PREFIX] = self.prefix + os.environ[spack.SPACK_PREFIX] = self.prefix # Build root for logging. - os.environ[SPACK_BUILD_ROOT] = self.stage.expanded_archive_path + os.environ[spack.SPACK_BUILD_ROOT] = self.stage.expanded_archive_path def do_install_dependencies(self): @@ -887,7 +887,7 @@ class MakeExecutable(Executable): def __call__(self, *args, **kwargs): parallel = kwargs.get('parallel', self.parallel) - disable_parallel = env_flag(SPACK_NO_PARALLEL_MAKE) + disable_parallel = env_flag(spack.SPACK_NO_PARALLEL_MAKE) if parallel and not disable_parallel: jobs = "-j%d" % multiprocessing.cpu_count() diff --git a/lib/spack/spack/packages/__init__.py b/lib/spack/spack/packages/__init__.py index 5731fb0d99..beb8ecf6ab 100644 --- a/lib/spack/spack/packages/__init__.py +++ b/lib/spack/spack/packages/__init__.py @@ -28,14 +28,22 @@ import sys import string import inspect import glob +import imp import llnl.util.tty as tty from llnl.util.filesystem import join_path -from llnl.util.lang import list_modules +from llnl.util.lang import memoized import spack import spack.error import spack.spec +from spack.virtual import ProviderIndex + +# Name of module under which packages are imported +_imported_packages_module = 'spack.packages' + +# Name of the package file inside a package directory +_package_file_name = 'package.py' # Valid package names can contain '-' but can't start with it. valid_package_re = r'^\w[\w-]*$' @@ -43,323 +51,216 @@ valid_package_re = r'^\w[\w-]*$' # Don't allow consecutive [_-] in package names invalid_package_re = r'[_-][_-]+' -instances = {} - - -def _autospec(function): - """Decorator that automatically converts the argument of a single-arg - function to a Spec.""" - def converter(arg): - if not isinstance(arg, spack.spec.Spec): - arg = spack.spec.Spec(arg) - return function(arg) - return converter - - -class ProviderIndex(object): - """This is a dict of dicts used for finding providers of particular - virtual dependencies. The dict of dicts looks like: - - { vpkg name : - { full vpkg spec : package providing spec } } - - Callers can use this to first find which packages provide a vpkg, - then find a matching full spec. e.g., in this scenario: - - { 'mpi' : - { mpi@:1.1 : mpich, - mpi@:2.3 : mpich2@1.9: } } - - Calling providers_for(spec) will find specs that provide a - matching implementation of MPI. - """ - def __init__(self, specs, **kwargs): - # TODO: come up with another name for this. This "restricts" values to - # the verbatim impu specs (i.e., it doesn't pre-apply package's constraints, and - # keeps things as broad as possible, so it's really the wrong name) - self.restrict = kwargs.setdefault('restrict', False) - - self.providers = {} - - for spec in specs: - if not isinstance(spec, spack.spec.Spec): - spec = spack.spec.Spec(spec) - - if spec.virtual: - continue - - self.update(spec) - - - def update(self, spec): - if type(spec) != spack.spec.Spec: - spec = spack.spec.Spec(spec) - - assert(not spec.virtual) - - pkg = spec.package - for provided_spec, provider_spec in pkg.provided.iteritems(): - if provider_spec.satisfies(spec, deps=False): - provided_name = provided_spec.name - if provided_name not in self.providers: - self.providers[provided_name] = {} - - if self.restrict: - self.providers[provided_name][provided_spec] = spec - - else: - # Before putting the spec in the map, constrain it so that - # it provides what was asked for. - constrained = spec.copy() - constrained.constrain(provider_spec) - self.providers[provided_name][provided_spec] = constrained - - - def providers_for(self, *vpkg_specs): - """Gives specs of all packages that provide virtual packages - with the supplied specs.""" - providers = set() - for vspec in vpkg_specs: - # Allow string names to be passed as input, as well as specs - if type(vspec) == str: - vspec = spack.spec.Spec(vspec) - - # Add all the providers that satisfy the vpkg spec. - if vspec.name in self.providers: - for provider_spec, spec in self.providers[vspec.name].items(): - if provider_spec.satisfies(vspec, deps=False): - providers.add(spec) - - # Return providers in order - return sorted(providers) - - - # TODO: this is pretty darned nasty, and inefficient. - def _cross_provider_maps(self, lmap, rmap): - result = {} - for lspec in lmap: - for rspec in rmap: - try: - constrained = lspec.copy().constrain(rspec) - if lmap[lspec].name != rmap[rspec].name: - continue - result[constrained] = lmap[lspec].copy().constrain( - rmap[rspec], deps=False) - except spack.spec.UnsatisfiableSpecError: - continue - return result - - - def __contains__(self, name): - """Whether a particular vpkg name is in the index.""" - return name in self.providers - - - def satisfies(self, other): - """Check that providers of virtual specs are compatible.""" - common = set(self.providers) & set(other.providers) - if not common: - return True - - result = {} - for name in common: - crossed = self._cross_provider_maps(self.providers[name], - other.providers[name]) - if crossed: - result[name] = crossed - - return bool(result) - - - -@_autospec -def get(spec): - if spec.virtual: - raise UnknownPackageError(spec.name) - - if not spec in instances: - package_class = get_class_for_package_name(spec.name) - instances[spec.name] = package_class(spec) - - return instances[spec.name] - - -@_autospec -def get_installed(spec): - return [s for s in installed_package_specs() if s.satisfies(spec)] - - -@_autospec -def providers_for(vpkg_spec): - if not hasattr(providers_for, 'index'): - providers_for.index = ProviderIndex(all_package_names()) - - providers = providers_for.index.providers_for(vpkg_spec) - if not providers: - raise UnknownPackageError("No such virtual package: %s" % vpkg_spec) - return providers - def valid_package_name(pkg_name): + """Return whether the pkg_name is valid for use in Spack.""" return (re.match(valid_package_re, pkg_name) and not re.search(invalid_package_re, pkg_name)) def validate_package_name(pkg_name): + """Raise an exception if pkg_name is not valid.""" if not valid_package_name(pkg_name): raise InvalidPackageNameError(pkg_name) -def dirname_for_package_name(pkg_name): - """Get the directory name for a particular package would use, even if it's a - foo.py package and not a directory with a foo/__init__.py file.""" - return join_path(spack.packages_path, pkg_name) +def class_name_for_package_name(pkg_name): + """Get a name for the class the package file should contain. Note that + conflicts don't matter because the classes are in different modules. + """ + validate_package_name(pkg_name) + class_name = pkg_name.replace('_', '-') + class_name = string.capwords(class_name, '-') + class_name = class_name.replace('-', '') -def filename_for_package_name(pkg_name): - """Get the filename for the module we should load for a particular package. - The package can be either in a standalone .py file, or it can be in - a directory with an __init__.py file. + # If a class starts with a number, prefix it with Number_ to make it a valid + # Python class name. + if re.match(r'^[0-9]', class_name): + class_name = "Num_%s" % class_name - Package "foo" in standalone .py file: - packages/foo.py + return class_name - Package "foo" in directory: - packages/foo/__init__.py - The second form is used when there are files (like patches) that need - to be stored along with the package. +def _autospec(function): + """Decorator that automatically converts the argument of a single-arg + function to a Spec.""" + def converter(self, spec_like): + if not isinstance(spec_like, spack.spec.Spec): + spec_like = spack.spec.Spec(spec_like) + return function(self, spec_like) + return converter - If the package doesn't exist yet, this will just return the name - of the standalone .py file. - """ - validate_package_name(pkg_name) - pkg_dir = dirname_for_package_name(pkg_name) - if os.path.isdir(pkg_dir): - init_file = join_path(pkg_dir, '__init__.py') - return init_file - else: - pkg_file = "%s.py" % pkg_dir - return pkg_file +class PackageDB(object): + def __init__(self, root): + """Construct a new package database from a root directory.""" + self.root = root + self.instances = {} + self.provider_index = None -def installed_package_specs(): - return spack.install_layout.all_specs() + @_autospec + def get(self, spec): + if spec.virtual: + raise UnknownPackageError(spec.name) + if not spec in self.instances: + package_class = self.get_class_for_package_name(spec.name) + self.instances[spec.name] = package_class(spec) -def all_package_names(): - """Generator function for all packages.""" - for module in list_modules(spack.packages_path): - yield module + return self.instances[spec.name] -def all_packages(): - for name in all_package_names(): - yield get(name) + @_autospec + def get_installed(self, spec): + return [s for s in self.installed_package_specs() if s.satisfies(spec)] -def class_name_for_package_name(pkg_name): - """Get a name for the class the package file should contain. Note that - conflicts don't matter because the classes are in different modules. - """ - validate_package_name(pkg_name) + @_autospec + def providers_for(self, vpkg_spec): + if self.provider_index is None: + self.provider_index = ProviderIndex(self.all_package_names()) - class_name = pkg_name.replace('_', '-') - class_name = string.capwords(class_name, '-') - class_name = class_name.replace('-', '') + providers = self.provider_index.providers_for(vpkg_spec) + if not providers: + raise UnknownPackageError("No such virtual package: %s" % vpkg_spec) + return providers - # If a class starts with a number, prefix it with Number_ to make it a valid - # Python class name. - if re.match(r'^[0-9]', class_name): - class_name = "Num_%s" % class_name - return class_name + def dirname_for_package_name(self, pkg_name): + """Get the directory name for a particular package. This is the + directory that contains its package.py file.""" + return join_path(self.root, pkg_name) -def exists(pkg_name): - """Whether a package with the supplied name exists .""" - return os.path.exists(filename_for_package_name(pkg_name)) + def filename_for_package_name(self, pkg_name): + """Get the filename for the module we should load for a particular + package. Packages for a pacakge DB live in + ``$root//package.py`` + This will return a proper package.py path even if the + package doesn't exist yet, so callers will need to ensure + the package exists before importing. + """ + validate_package_name(pkg_name) + pkg_dir = self.dirname_for_package_name(pkg_name) + return join_path(pkg_dir, _package_file_name) -def packages_module(): - # TODO: replace this with a proper package DB class, instead of this hackiness. - packages_path = re.sub(spack.module_path + '\/+', 'spack.', spack.packages_path) - packages_module = re.sub(r'/', '.', packages_path) - return packages_module + def installed_package_specs(self): + """Read installed package names straight from the install directory + layout. + """ + return spack.install_layout.all_specs() -def get_class_for_package_name(pkg_name): - file_name = filename_for_package_name(pkg_name) - if os.path.exists(file_name): - if not os.path.isfile(file_name): - tty.die("Something's wrong. '%s' is not a file!" % file_name) - if not os.access(file_name, os.R_OK): - tty.die("Cannot read '%s'!" % file_name) - else: - raise UnknownPackageError(pkg_name) + @memoized + def all_package_names(self): + """Generator function for all packages. This looks for + ``/package.py`` files within the root direcotry""" + all_package_names = [] + for pkg_name in os.listdir(self.root): + pkg_dir = join_path(self.root, pkg_name) + pkg_file = join_path(pkg_dir, _package_file_name) + if os.path.isfile(pkg_file): + all_package_names.append(pkg_name) + all_package_names.sort() + return all_package_names - # Figure out pacakges module from spack.packages_path - # This allows us to change the module path. - if not re.match(r'%s' % spack.module_path, spack.packages_path): - raise RuntimeError("Packages path is not a submodule of spack.") - class_name = class_name_for_package_name(pkg_name) - try: - module_name = "%s.%s" % (packages_module(), pkg_name) - module = __import__(module_name, fromlist=[class_name]) - except ImportError, e: - tty.die("Error while importing %s.%s:\n%s" % (pkg_name, class_name, e.message)) + def all_packages(self): + for name in self.all_package_names(): + yield get(name) - cls = getattr(module, class_name) - if not inspect.isclass(cls): - tty.die("%s.%s is not a class" % (pkg_name, class_name)) - return cls + def exists(self, pkg_name): + """Whether a package with the supplied name exists .""" + return os.path.exists(self.filename_for_package_name(pkg_name)) -def compute_dependents(): - """Reads in all package files and sets dependence information on - Package objects in memory. - """ - if not hasattr(compute_dependents, index): - compute_dependents.index = {} - - for pkg in all_packages(): - if pkg._dependents is None: - pkg._dependents = [] - - for name, dep in pkg.dependencies.iteritems(): - dpkg = get(name) - if dpkg._dependents is None: - dpkg._dependents = [] - dpkg._dependents.append(pkg.name) - - -def graph_dependencies(out=sys.stdout): - """Print out a graph of all the dependencies between package. - Graph is in dot format.""" - out.write('digraph G {\n') - out.write(' label = "Spack Dependencies"\n') - out.write(' labelloc = "b"\n') - out.write(' rankdir = "LR"\n') - out.write(' ranksep = "5"\n') - out.write('\n') - - def quote(string): - return '"%s"' % string - - deps = [] - for pkg in all_packages(): - out.write(' %-30s [label="%s"]\n' % (quote(pkg.name), pkg.name)) - for dep_name, dep in pkg.dependencies.iteritems(): - deps.append((pkg.name, dep_name)) - out.write('\n') - - for pair in deps: - out.write(' "%s" -> "%s"\n' % pair) - out.write('}\n') + @memoized + def get_class_for_package_name(self, pkg_name): + """Get an instance of the class for a particular package. + + This method uses Python's ``imp`` package to load python + source from a Spack package's ``package.py`` file. A + normal python import would only load each package once, but + because we do this dynamically, the method needs to be + memoized to ensure there is only ONE package class + instance, per package, per database. + """ + file_path = self.filename_for_package_name(pkg_name) + + if os.path.exists(file_path): + if not os.path.isfile(file_path): + tty.die("Something's wrong. '%s' is not a file!" % file_path) + if not os.access(file_path, os.R_OK): + tty.die("Cannot read '%s'!" % file_path) + else: + raise UnknownPackageError(pkg_name) + + # Figure out pacakges module based on self.root + if not re.match(r'%s' % spack.module_path, self.root): + raise RuntimeError("Packages path is not a submodule of spack.") + + class_name = class_name_for_package_name(pkg_name) + try: + module_name = _imported_packages_module + '.' + pkg_name + module = imp.load_source(module_name, file_path) + + except ImportError, e: + tty.die("Error while importing %s from %s:\n%s" % ( + pkg_name, file_path, e.message)) + + cls = getattr(module, class_name) + if not inspect.isclass(cls): + tty.die("%s.%s is not a class" % (pkg_name, class_name)) + + return cls + + + def compute_dependents(self): + """Reads in all package files and sets dependence information on + Package objects in memory. + """ + if not hasattr(compute_dependents, index): + compute_dependents.index = {} + + for pkg in all_packages(): + if pkg._dependents is None: + pkg._dependents = [] + + for name, dep in pkg.dependencies.iteritems(): + dpkg = get(name) + if dpkg._dependents is None: + dpkg._dependents = [] + dpkg._dependents.append(pkg.name) + + + def graph_dependencies(self, out=sys.stdout): + """Print out a graph of all the dependencies between package. + Graph is in dot format.""" + out.write('digraph G {\n') + out.write(' label = "Spack Dependencies"\n') + out.write(' labelloc = "b"\n') + out.write(' rankdir = "LR"\n') + out.write(' ranksep = "5"\n') + out.write('\n') + + def quote(string): + return '"%s"' % string + + deps = [] + for pkg in all_packages(): + out.write(' %-30s [label="%s"]\n' % (quote(pkg.name), pkg.name)) + for dep_name, dep in pkg.dependencies.iteritems(): + deps.append((pkg.name, dep_name)) + out.write('\n') + + for pair in deps: + out.write(' "%s" -> "%s"\n' % pair) + out.write('}\n') class InvalidPackageNameError(spack.error.SpackError): diff --git a/lib/spack/spack/packages/callpath.py b/lib/spack/spack/packages/callpath.py deleted file mode 100644 index 5d92d77302..0000000000 --- a/lib/spack/spack/packages/callpath.py +++ /dev/null @@ -1,37 +0,0 @@ -############################################################################## -# Copyright (c) 2013, Lawrence Livermore National Security, LLC. -# Produced at the Lawrence Livermore National Laboratory. -# -# This file is part of Spack. -# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. -# LLNL-CODE-647188 -# -# For details, see https://scalability-llnl.github.io/spack -# Please also see the LICENSE file for our notice and the LGPL. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License (as published by -# the Free Software Foundation) version 2.1 dated February 1999. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and -# conditions of the GNU General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -############################################################################## -from spack import * - -class Callpath(Package): - homepage = "https://github.com/tgamblin/callpath" - url = "http://github.com/tgamblin/callpath-0.2.tar.gz" - - depends_on("dyninst") - depends_on("mpi") - - def install(self, spec, prefix): - configure("--prefix=" + prefix) - make() - make("install") diff --git a/lib/spack/spack/packages/callpath/package.py b/lib/spack/spack/packages/callpath/package.py new file mode 100644 index 0000000000..5d92d77302 --- /dev/null +++ b/lib/spack/spack/packages/callpath/package.py @@ -0,0 +1,37 @@ +############################################################################## +# Copyright (c) 2013, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://scalability-llnl.github.io/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License (as published by +# the Free Software Foundation) version 2.1 dated February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +from spack import * + +class Callpath(Package): + homepage = "https://github.com/tgamblin/callpath" + url = "http://github.com/tgamblin/callpath-0.2.tar.gz" + + depends_on("dyninst") + depends_on("mpi") + + def install(self, spec, prefix): + configure("--prefix=" + prefix) + make() + make("install") diff --git a/lib/spack/spack/packages/cmake.py b/lib/spack/spack/packages/cmake.py deleted file mode 100644 index 70406610b6..0000000000 --- a/lib/spack/spack/packages/cmake.py +++ /dev/null @@ -1,36 +0,0 @@ -############################################################################## -# Copyright (c) 2013, Lawrence Livermore National Security, LLC. -# Produced at the Lawrence Livermore National Laboratory. -# -# This file is part of Spack. -# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. -# LLNL-CODE-647188 -# -# For details, see https://scalability-llnl.github.io/spack -# Please also see the LICENSE file for our notice and the LGPL. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License (as published by -# the Free Software Foundation) version 2.1 dated February 1999. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and -# conditions of the GNU General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -############################################################################## -from spack import * - -class Cmake(Package): - homepage = 'https://www.cmake.org' - url = 'http://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gz' - versions = { '2.8.10.2' : '097278785da7182ec0aea8769d06860c' } - - def install(self, spec, prefix): - configure('--prefix=' + prefix, - '--parallel=' + str(make_jobs)) - make() - make('install') diff --git a/lib/spack/spack/packages/cmake/package.py b/lib/spack/spack/packages/cmake/package.py new file mode 100644 index 0000000000..70406610b6 --- /dev/null +++ b/lib/spack/spack/packages/cmake/package.py @@ -0,0 +1,36 @@ +############################################################################## +# Copyright (c) 2013, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://scalability-llnl.github.io/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License (as published by +# the Free Software Foundation) version 2.1 dated February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +from spack import * + +class Cmake(Package): + homepage = 'https://www.cmake.org' + url = 'http://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gz' + versions = { '2.8.10.2' : '097278785da7182ec0aea8769d06860c' } + + def install(self, spec, prefix): + configure('--prefix=' + prefix, + '--parallel=' + str(make_jobs)) + make() + make('install') diff --git a/lib/spack/spack/packages/dyninst.py b/lib/spack/spack/packages/dyninst.py deleted file mode 100644 index 2318317de5..0000000000 --- a/lib/spack/spack/packages/dyninst.py +++ /dev/null @@ -1,41 +0,0 @@ -############################################################################## -# Copyright (c) 2013, Lawrence Livermore National Security, LLC. -# Produced at the Lawrence Livermore National Laboratory. -# -# This file is part of Spack. -# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. -# LLNL-CODE-647188 -# -# For details, see https://scalability-llnl.github.io/spack -# Please also see the LICENSE file for our notice and the LGPL. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License (as published by -# the Free Software Foundation) version 2.1 dated February 1999. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and -# conditions of the GNU General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -############################################################################## -from spack import * - -class Dyninst(Package): - homepage = "https://paradyn.org" - url = "http://www.dyninst.org/sites/default/files/downloads/dyninst/8.1.2/DyninstAPI-8.1.2.tgz" - list_url = "http://www.dyninst.org/downloads/dyninst-8.x" - - versions = {'8.1.2' : 'bf03b33375afa66fe0efa46ce3f4b17a', - '8.1.1' : '1f8743e3a5662b25ce64a7edf647e77d' } - - depends_on("libelf") - depends_on("libdwarf") - - def install(self, spec, prefix): - configure("--prefix=" + prefix) - make() - make("install") diff --git a/lib/spack/spack/packages/dyninst/package.py b/lib/spack/spack/packages/dyninst/package.py new file mode 100644 index 0000000000..2318317de5 --- /dev/null +++ b/lib/spack/spack/packages/dyninst/package.py @@ -0,0 +1,41 @@ +############################################################################## +# Copyright (c) 2013, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://scalability-llnl.github.io/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License (as published by +# the Free Software Foundation) version 2.1 dated February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +from spack import * + +class Dyninst(Package): + homepage = "https://paradyn.org" + url = "http://www.dyninst.org/sites/default/files/downloads/dyninst/8.1.2/DyninstAPI-8.1.2.tgz" + list_url = "http://www.dyninst.org/downloads/dyninst-8.x" + + versions = {'8.1.2' : 'bf03b33375afa66fe0efa46ce3f4b17a', + '8.1.1' : '1f8743e3a5662b25ce64a7edf647e77d' } + + depends_on("libelf") + depends_on("libdwarf") + + def install(self, spec, prefix): + configure("--prefix=" + prefix) + make() + make("install") diff --git a/lib/spack/spack/packages/graphlib.py b/lib/spack/spack/packages/graphlib.py deleted file mode 100644 index c959135147..0000000000 --- a/lib/spack/spack/packages/graphlib.py +++ /dev/null @@ -1,14 +0,0 @@ -from spack import * - -class Graphlib(Package): - """Library to create, manipulate, and export graphs Graphlib.""" - homepage = "http://https://github.com/lee218llnl/graphlib" - url = "https://github.com/lee218llnl/graphlib/archive/v2.0.0.tar.gz" - - versions = { '2.0.0' : '43c6df84f1d38ba5a5dce0ae19371a70', } - - def install(self, spec, prefix): - cmake(".", *std_cmake_args) - - make() - make("install") diff --git a/lib/spack/spack/packages/graphlib/package.py b/lib/spack/spack/packages/graphlib/package.py new file mode 100644 index 0000000000..c959135147 --- /dev/null +++ b/lib/spack/spack/packages/graphlib/package.py @@ -0,0 +1,14 @@ +from spack import * + +class Graphlib(Package): + """Library to create, manipulate, and export graphs Graphlib.""" + homepage = "http://https://github.com/lee218llnl/graphlib" + url = "https://github.com/lee218llnl/graphlib/archive/v2.0.0.tar.gz" + + versions = { '2.0.0' : '43c6df84f1d38ba5a5dce0ae19371a70', } + + def install(self, spec, prefix): + cmake(".", *std_cmake_args) + + make() + make("install") diff --git a/lib/spack/spack/packages/launchmon/__init__.py b/lib/spack/spack/packages/launchmon/__init__.py deleted file mode 100644 index e2b82610fd..0000000000 --- a/lib/spack/spack/packages/launchmon/__init__.py +++ /dev/null @@ -1,45 +0,0 @@ -############################################################################## -# Copyright (c) 2014, Lawrence Livermore National Security, LLC. -# Produced at the Lawrence Livermore National Laboratory. -# -# This file is part of Spack. -# Written by Matthew LeGendre, legendre1@llnl.gov, All rights reserved. -# LLNL-CODE-647188 -# -# For details, see https://scalability-llnl.github.io/spack -# Please also see the LICENSE file for our notice and the LGPL. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License (as published by -# the Free Software Foundation) version 2.1 dated February 1999. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and -# conditions of the GNU General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -############################################################################## -from spack import * - -class Launchmon(Package): - homepage = "http://sourceforge.net/projects/launchmon" - url = "http://sourceforge.net/code-snapshots/svn/l/la/launchmon/code/launchmon-code-481-branches-launchmon-1.0-release.zip" - force_url = True - list_url = "http://sourceforge.net/p/launchmon/code/HEAD/tree" - - #versions = {'1.0.0' : 'a0e5bfb7d82dc708d58bdbf93697886c'} - versions = {'1.0.0' : '9d1184397d3081b94e2c0577c3c605e5'} - patch('patch.lmon_install_dir', level=0) - - def install(self, spec, prefix): - configure("--prefix=" + prefix) - - # TODO: remove once Jira SPACK-19 is fixed - import shutil - shutil.copy2('/usr/bin/libtool', 'libtool') - - make() - make("install") diff --git a/lib/spack/spack/packages/launchmon/package.py b/lib/spack/spack/packages/launchmon/package.py new file mode 100644 index 0000000000..e2b82610fd --- /dev/null +++ b/lib/spack/spack/packages/launchmon/package.py @@ -0,0 +1,45 @@ +############################################################################## +# Copyright (c) 2014, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Written by Matthew LeGendre, legendre1@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://scalability-llnl.github.io/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License (as published by +# the Free Software Foundation) version 2.1 dated February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +from spack import * + +class Launchmon(Package): + homepage = "http://sourceforge.net/projects/launchmon" + url = "http://sourceforge.net/code-snapshots/svn/l/la/launchmon/code/launchmon-code-481-branches-launchmon-1.0-release.zip" + force_url = True + list_url = "http://sourceforge.net/p/launchmon/code/HEAD/tree" + + #versions = {'1.0.0' : 'a0e5bfb7d82dc708d58bdbf93697886c'} + versions = {'1.0.0' : '9d1184397d3081b94e2c0577c3c605e5'} + patch('patch.lmon_install_dir', level=0) + + def install(self, spec, prefix): + configure("--prefix=" + prefix) + + # TODO: remove once Jira SPACK-19 is fixed + import shutil + shutil.copy2('/usr/bin/libtool', 'libtool') + + make() + make("install") diff --git a/lib/spack/spack/packages/libdwarf.py b/lib/spack/spack/packages/libdwarf.py deleted file mode 100644 index 657e84705a..0000000000 --- a/lib/spack/spack/packages/libdwarf.py +++ /dev/null @@ -1,75 +0,0 @@ -############################################################################## -# Copyright (c) 2013, Lawrence Livermore National Security, LLC. -# Produced at the Lawrence Livermore National Laboratory. -# -# This file is part of Spack. -# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. -# LLNL-CODE-647188 -# -# For details, see https://scalability-llnl.github.io/spack -# Please also see the LICENSE file for our notice and the LGPL. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License (as published by -# the Free Software Foundation) version 2.1 dated February 1999. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and -# conditions of the GNU General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -############################################################################## -from spack import * -import os - -# Only build certain parts of dwarf because the other ones break. -dwarf_dirs = ['libdwarf', 'dwarfdump2'] - -class Libdwarf(Package): - homepage = "http://www.prevanders.net/dwarf.html" - url = "http://www.prevanders.net/libdwarf-20130729.tar.gz" - list_url = homepage - - versions = { '20130729' : '4cc5e48693f7b93b7aa0261e63c0e21d', - '20130207' : '64b42692e947d5180e162e46c689dfbf', - '20130126' : 'ded74a5e90edb5a12aac3c29d260c5db' } - - depends_on("libelf") - - - def clean(self): - for dir in dwarf_dirs: - with working_dir(dir): - if os.path.exists('Makefile'): - make('clean') - - - def install(self, spec, prefix): - # dwarf build does not set arguments for ar properly - make.add_default_arg('ARFLAGS=rcs') - - # Dwarf doesn't provide an install, so we have to do it. - mkdirp(prefix.bin, prefix.include, prefix.lib, prefix.man1) - - with working_dir('libdwarf'): - configure("--prefix=" + prefix, "--enable-shared") - make() - - install('libdwarf.a', prefix.lib) - install('libdwarf.so', prefix.lib) - install('libdwarf.h', prefix.include) - install('dwarf.h', prefix.include) - - with working_dir('dwarfdump2'): - configure("--prefix=" + prefix) - - # This makefile has strings of copy commands that - # cause a race in parallel - make(parallel=False) - - install('dwarfdump', prefix.bin) - install('dwarfdump.conf', prefix.lib) - install('dwarfdump.1', prefix.man1) diff --git a/lib/spack/spack/packages/libdwarf/package.py b/lib/spack/spack/packages/libdwarf/package.py new file mode 100644 index 0000000000..657e84705a --- /dev/null +++ b/lib/spack/spack/packages/libdwarf/package.py @@ -0,0 +1,75 @@ +############################################################################## +# Copyright (c) 2013, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://scalability-llnl.github.io/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License (as published by +# the Free Software Foundation) version 2.1 dated February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +from spack import * +import os + +# Only build certain parts of dwarf because the other ones break. +dwarf_dirs = ['libdwarf', 'dwarfdump2'] + +class Libdwarf(Package): + homepage = "http://www.prevanders.net/dwarf.html" + url = "http://www.prevanders.net/libdwarf-20130729.tar.gz" + list_url = homepage + + versions = { '20130729' : '4cc5e48693f7b93b7aa0261e63c0e21d', + '20130207' : '64b42692e947d5180e162e46c689dfbf', + '20130126' : 'ded74a5e90edb5a12aac3c29d260c5db' } + + depends_on("libelf") + + + def clean(self): + for dir in dwarf_dirs: + with working_dir(dir): + if os.path.exists('Makefile'): + make('clean') + + + def install(self, spec, prefix): + # dwarf build does not set arguments for ar properly + make.add_default_arg('ARFLAGS=rcs') + + # Dwarf doesn't provide an install, so we have to do it. + mkdirp(prefix.bin, prefix.include, prefix.lib, prefix.man1) + + with working_dir('libdwarf'): + configure("--prefix=" + prefix, "--enable-shared") + make() + + install('libdwarf.a', prefix.lib) + install('libdwarf.so', prefix.lib) + install('libdwarf.h', prefix.include) + install('dwarf.h', prefix.include) + + with working_dir('dwarfdump2'): + configure("--prefix=" + prefix) + + # This makefile has strings of copy commands that + # cause a race in parallel + make(parallel=False) + + install('dwarfdump', prefix.bin) + install('dwarfdump.conf', prefix.lib) + install('dwarfdump.1', prefix.man1) diff --git a/lib/spack/spack/packages/libelf.py b/lib/spack/spack/packages/libelf.py deleted file mode 100644 index f663ba750d..0000000000 --- a/lib/spack/spack/packages/libelf.py +++ /dev/null @@ -1,47 +0,0 @@ -############################################################################## -# Copyright (c) 2013, Lawrence Livermore National Security, LLC. -# Produced at the Lawrence Livermore National Laboratory. -# -# This file is part of Spack. -# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. -# LLNL-CODE-647188 -# -# For details, see https://scalability-llnl.github.io/spack -# Please also see the LICENSE file for our notice and the LGPL. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License (as published by -# the Free Software Foundation) version 2.1 dated February 1999. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and -# conditions of the GNU General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -############################################################################## -from spack import * - -class Libelf(Package): - """libelf lets you read, modify or create ELF object files in an - architecture-independent way. The library takes care of size - and endian issues, e.g. you can process a file for SPARC - processors on an Intel-based system.""" - - homepage = "http://www.mr511.de/software/english.html" - url = "http://www.mr511.de/software/libelf-0.8.13.tar.gz" - - versions = { '0.8.13' : '4136d7b4c04df68b686570afa26988ac', - '0.8.12' : 'e21f8273d9f5f6d43a59878dc274fec7', } - - def install(self, spec, prefix): - configure("--prefix=" + prefix, - "--enable-shared", - "--disable-dependency-tracking", - "--disable-debug") - make() - - # The mkdir commands in libelf's install can fail in parallel - make("install", parallel=False) diff --git a/lib/spack/spack/packages/libelf/package.py b/lib/spack/spack/packages/libelf/package.py new file mode 100644 index 0000000000..f663ba750d --- /dev/null +++ b/lib/spack/spack/packages/libelf/package.py @@ -0,0 +1,47 @@ +############################################################################## +# Copyright (c) 2013, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://scalability-llnl.github.io/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License (as published by +# the Free Software Foundation) version 2.1 dated February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +from spack import * + +class Libelf(Package): + """libelf lets you read, modify or create ELF object files in an + architecture-independent way. The library takes care of size + and endian issues, e.g. you can process a file for SPARC + processors on an Intel-based system.""" + + homepage = "http://www.mr511.de/software/english.html" + url = "http://www.mr511.de/software/libelf-0.8.13.tar.gz" + + versions = { '0.8.13' : '4136d7b4c04df68b686570afa26988ac', + '0.8.12' : 'e21f8273d9f5f6d43a59878dc274fec7', } + + def install(self, spec, prefix): + configure("--prefix=" + prefix, + "--enable-shared", + "--disable-dependency-tracking", + "--disable-debug") + make() + + # The mkdir commands in libelf's install can fail in parallel + make("install", parallel=False) diff --git a/lib/spack/spack/packages/libunwind.py b/lib/spack/spack/packages/libunwind.py deleted file mode 100644 index c93b5b2c98..0000000000 --- a/lib/spack/spack/packages/libunwind.py +++ /dev/null @@ -1,36 +0,0 @@ -############################################################################## -# Copyright (c) 2013, Lawrence Livermore National Security, LLC. -# Produced at the Lawrence Livermore National Laboratory. -# -# This file is part of Spack. -# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. -# LLNL-CODE-647188 -# -# For details, see https://scalability-llnl.github.io/spack -# Please also see the LICENSE file for our notice and the LGPL. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License (as published by -# the Free Software Foundation) version 2.1 dated February 1999. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and -# conditions of the GNU General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -############################################################################## -from spack import * - -class Libunwind(Package): - homepage = "http://www.nongnu.org/libunwind/" - url = "http://download.savannah.gnu.org/releases/libunwind/libunwind-1.1.tar.gz" - - versions = { '1.1' : 'fb4ea2f6fbbe45bf032cd36e586883ce' } - - def install(self, spec, prefix): - configure("--prefix=" + prefix) - make() - make("install") diff --git a/lib/spack/spack/packages/libunwind/package.py b/lib/spack/spack/packages/libunwind/package.py new file mode 100644 index 0000000000..c93b5b2c98 --- /dev/null +++ b/lib/spack/spack/packages/libunwind/package.py @@ -0,0 +1,36 @@ +############################################################################## +# Copyright (c) 2013, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://scalability-llnl.github.io/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License (as published by +# the Free Software Foundation) version 2.1 dated February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +from spack import * + +class Libunwind(Package): + homepage = "http://www.nongnu.org/libunwind/" + url = "http://download.savannah.gnu.org/releases/libunwind/libunwind-1.1.tar.gz" + + versions = { '1.1' : 'fb4ea2f6fbbe45bf032cd36e586883ce' } + + def install(self, spec, prefix): + configure("--prefix=" + prefix) + make() + make("install") diff --git a/lib/spack/spack/packages/mpich.py b/lib/spack/spack/packages/mpich.py deleted file mode 100644 index af9e8266dc..0000000000 --- a/lib/spack/spack/packages/mpich.py +++ /dev/null @@ -1,43 +0,0 @@ -############################################################################## -# Copyright (c) 2013, Lawrence Livermore National Security, LLC. -# Produced at the Lawrence Livermore National Laboratory. -# -# This file is part of Spack. -# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. -# LLNL-CODE-647188 -# -# For details, see https://scalability-llnl.github.io/spack -# Please also see the LICENSE file for our notice and the LGPL. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License (as published by -# the Free Software Foundation) version 2.1 dated February 1999. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and -# conditions of the GNU General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -############################################################################## -from spack import * - -class Mpich(Package): - """MPICH is a high performance and widely portable implementation of - the Message Passing Interface (MPI) standard.""" - homepage = "http://www.mpich.org" - url = "http://www.mpich.org/static/downloads/3.0.4/mpich-3.0.4.tar.gz" - list_url = "http://www.mpich.org/static/downloads/" - list_depth = 2 - - versions = { '3.0.4' : '9c5d5d4fe1e17dd12153f40bc5b6dbc0' } - - provides('mpi@:3', when='@3:') - provides('mpi@:1', when='@1:') - - def install(self, spec, prefix): - configure("--prefix=" + prefix) - make() - make("install") diff --git a/lib/spack/spack/packages/mpich/package.py b/lib/spack/spack/packages/mpich/package.py new file mode 100644 index 0000000000..af9e8266dc --- /dev/null +++ b/lib/spack/spack/packages/mpich/package.py @@ -0,0 +1,43 @@ +############################################################################## +# Copyright (c) 2013, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://scalability-llnl.github.io/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License (as published by +# the Free Software Foundation) version 2.1 dated February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +from spack import * + +class Mpich(Package): + """MPICH is a high performance and widely portable implementation of + the Message Passing Interface (MPI) standard.""" + homepage = "http://www.mpich.org" + url = "http://www.mpich.org/static/downloads/3.0.4/mpich-3.0.4.tar.gz" + list_url = "http://www.mpich.org/static/downloads/" + list_depth = 2 + + versions = { '3.0.4' : '9c5d5d4fe1e17dd12153f40bc5b6dbc0' } + + provides('mpi@:3', when='@3:') + provides('mpi@:1', when='@1:') + + def install(self, spec, prefix): + configure("--prefix=" + prefix) + make() + make("install") diff --git a/lib/spack/spack/packages/mpileaks.py b/lib/spack/spack/packages/mpileaks.py deleted file mode 100644 index 3307b9fdee..0000000000 --- a/lib/spack/spack/packages/mpileaks.py +++ /dev/null @@ -1,37 +0,0 @@ -############################################################################## -# Copyright (c) 2013, Lawrence Livermore National Security, LLC. -# Produced at the Lawrence Livermore National Laboratory. -# -# This file is part of Spack. -# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. -# LLNL-CODE-647188 -# -# For details, see https://scalability-llnl.github.io/spack -# Please also see the LICENSE file for our notice and the LGPL. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License (as published by -# the Free Software Foundation) version 2.1 dated February 1999. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and -# conditions of the GNU General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -############################################################################## -from spack import * - -class Mpileaks(Package): - homepage = "http://www.llnl.gov" - url = "http://www.llnl.gov/mpileaks-1.0.tar.gz" - - depends_on("mpi") - depends_on("callpath") - - def install(self, spec, prefix): - configure("--prefix=" + prefix) - make() - make("install") diff --git a/lib/spack/spack/packages/mpileaks/package.py b/lib/spack/spack/packages/mpileaks/package.py new file mode 100644 index 0000000000..3307b9fdee --- /dev/null +++ b/lib/spack/spack/packages/mpileaks/package.py @@ -0,0 +1,37 @@ +############################################################################## +# Copyright (c) 2013, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://scalability-llnl.github.io/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License (as published by +# the Free Software Foundation) version 2.1 dated February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +from spack import * + +class Mpileaks(Package): + homepage = "http://www.llnl.gov" + url = "http://www.llnl.gov/mpileaks-1.0.tar.gz" + + depends_on("mpi") + depends_on("callpath") + + def install(self, spec, prefix): + configure("--prefix=" + prefix) + make() + make("install") diff --git a/lib/spack/spack/packages/mrnet.py b/lib/spack/spack/packages/mrnet.py deleted file mode 100644 index 15d851f83e..0000000000 --- a/lib/spack/spack/packages/mrnet.py +++ /dev/null @@ -1,15 +0,0 @@ -from spack import * - -class Mrnet(Package): - """The MRNet Multi-Cast Reduction Network.""" - homepage = "http://paradyn.org/mrnet" - url = "ftp://ftp.cs.wisc.edu/paradyn/mrnet/mrnet_4.0.0.tar.gz" - - versions = { '4.0.0' : 'd00301c078cba57ef68613be32ceea2f', } - parallel = False - - def install(self, spec, prefix): - configure("--prefix=%s" %prefix, "--enable-shared") - - make() - make("install") diff --git a/lib/spack/spack/packages/mrnet/package.py b/lib/spack/spack/packages/mrnet/package.py new file mode 100644 index 0000000000..15d851f83e --- /dev/null +++ b/lib/spack/spack/packages/mrnet/package.py @@ -0,0 +1,15 @@ +from spack import * + +class Mrnet(Package): + """The MRNet Multi-Cast Reduction Network.""" + homepage = "http://paradyn.org/mrnet" + url = "ftp://ftp.cs.wisc.edu/paradyn/mrnet/mrnet_4.0.0.tar.gz" + + versions = { '4.0.0' : 'd00301c078cba57ef68613be32ceea2f', } + parallel = False + + def install(self, spec, prefix): + configure("--prefix=%s" %prefix, "--enable-shared") + + make() + make("install") diff --git a/lib/spack/spack/packages/mvapich2/__init__.py b/lib/spack/spack/packages/mvapich2/__init__.py deleted file mode 100644 index f372679f49..0000000000 --- a/lib/spack/spack/packages/mvapich2/__init__.py +++ /dev/null @@ -1,27 +0,0 @@ -from spack import * - -class Mvapich2(Package): - """mvapich2 is an MPI implmenetation for infiniband networks.""" - - homepage = "http://mvapich.cse.ohio-state.edu/" - url = "http://mvapich.cse.ohio-state.edu/download/mvapich2/mv2/mvapich2-1.9.tgz" - - versions = { '1.9' : '5dc58ed08fd3142c260b70fe297e127c', } - - provides('mpi@:1', when='@1.9:') - - patch('ad_lustre_rwcontig_open_source.patch', when='@1.9:') - - def install(self, spec, prefix): - configure( - "--prefix=" + prefix, - "--enable-f77", "--enable-fc", "--enable-cxx", - "--enable-fast=all", "--enable-g=dbg", "--enable-nmpi-as-mpi", - "--enable-shared", "--enable-sharedlibs=gcc", - "--enable-debuginfo", - "--with-pm=no", "--with-pmi=slurm", - "--with-device=ch3:psm", - "--enable-romio", "--with-file-system=lustre+nfs+ufs", - "--disable-mpe", "--without-mpe") - make() - make("install") diff --git a/lib/spack/spack/packages/mvapich2/package.py b/lib/spack/spack/packages/mvapich2/package.py new file mode 100644 index 0000000000..f372679f49 --- /dev/null +++ b/lib/spack/spack/packages/mvapich2/package.py @@ -0,0 +1,27 @@ +from spack import * + +class Mvapich2(Package): + """mvapich2 is an MPI implmenetation for infiniband networks.""" + + homepage = "http://mvapich.cse.ohio-state.edu/" + url = "http://mvapich.cse.ohio-state.edu/download/mvapich2/mv2/mvapich2-1.9.tgz" + + versions = { '1.9' : '5dc58ed08fd3142c260b70fe297e127c', } + + provides('mpi@:1', when='@1.9:') + + patch('ad_lustre_rwcontig_open_source.patch', when='@1.9:') + + def install(self, spec, prefix): + configure( + "--prefix=" + prefix, + "--enable-f77", "--enable-fc", "--enable-cxx", + "--enable-fast=all", "--enable-g=dbg", "--enable-nmpi-as-mpi", + "--enable-shared", "--enable-sharedlibs=gcc", + "--enable-debuginfo", + "--with-pm=no", "--with-pmi=slurm", + "--with-device=ch3:psm", + "--enable-romio", "--with-file-system=lustre+nfs+ufs", + "--disable-mpe", "--without-mpe") + make() + make("install") diff --git a/lib/spack/spack/packages/openmpi/__init__.py b/lib/spack/spack/packages/openmpi/__init__.py deleted file mode 100644 index f24a66c12e..0000000000 --- a/lib/spack/spack/packages/openmpi/__init__.py +++ /dev/null @@ -1,29 +0,0 @@ -from spack import * - -class Openmpi(Package): - """Open MPI is a project combining technologies and resources from - several other projects (FT-MPI, LA-MPI, LAM/MPI, and PACX-MPI) - in order to build the best MPI library available. A completely - new MPI-2 compliant implementation, Open MPI offers advantages - for system and software vendors, application developers and - computer science researchers. - """ - - homepage = "http://www.open-mpi.org" - url = "http://www.open-mpi.org/software/ompi/v1.6/downloads/openmpi-1.6.5.tar.bz2" - - versions = { '1.6.5' : '03aed2a4aa4d0b27196962a2a65fc475', } - - patch('ad_lustre_rwcontig_open_source.patch') - patch('llnl-platforms.patch') - - def install(self, spec, prefix): - configure("--prefix=%s" % prefix, - "--with-platform=contrib/platform/lanl/tlcc2/optimized-nopanasas") - - # TODO: implement variants next, so we can have LLNL and LANL options. - # use above for LANL builds, but for LLNL builds, we need this - # "--with-platform=contrib/platform/llnl/optimized") - - make() - make("install") diff --git a/lib/spack/spack/packages/openmpi/package.py b/lib/spack/spack/packages/openmpi/package.py new file mode 100644 index 0000000000..f24a66c12e --- /dev/null +++ b/lib/spack/spack/packages/openmpi/package.py @@ -0,0 +1,29 @@ +from spack import * + +class Openmpi(Package): + """Open MPI is a project combining technologies and resources from + several other projects (FT-MPI, LA-MPI, LAM/MPI, and PACX-MPI) + in order to build the best MPI library available. A completely + new MPI-2 compliant implementation, Open MPI offers advantages + for system and software vendors, application developers and + computer science researchers. + """ + + homepage = "http://www.open-mpi.org" + url = "http://www.open-mpi.org/software/ompi/v1.6/downloads/openmpi-1.6.5.tar.bz2" + + versions = { '1.6.5' : '03aed2a4aa4d0b27196962a2a65fc475', } + + patch('ad_lustre_rwcontig_open_source.patch') + patch('llnl-platforms.patch') + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix, + "--with-platform=contrib/platform/lanl/tlcc2/optimized-nopanasas") + + # TODO: implement variants next, so we can have LLNL and LANL options. + # use above for LANL builds, but for LLNL builds, we need this + # "--with-platform=contrib/platform/llnl/optimized") + + make() + make("install") diff --git a/lib/spack/spack/packages/pmgr_collective.py b/lib/spack/spack/packages/pmgr_collective.py deleted file mode 100644 index 0874e2d17b..0000000000 --- a/lib/spack/spack/packages/pmgr_collective.py +++ /dev/null @@ -1,37 +0,0 @@ -############################################################################## -# Copyright (c) 2013, Lawrence Livermore National Security, LLC. -# Produced at the Lawrence Livermore National Laboratory. -# -# This file is part of Spack. -# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. -# LLNL-CODE-647188 -# -# For details, see https://scalability-llnl.github.io/spack -# Please also see the LICENSE file for our notice and the LGPL. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License (as published by -# the Free Software Foundation) version 2.1 dated February 1999. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and -# conditions of the GNU General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -############################################################################## -from spack import * - -class PmgrCollective(Package): - """PMGR_COLLECTIVE provides a scalable network for bootstrapping - MPI jobs.""" - homepage = "http://www.sourceforge.net/projects/pmgrcollective" - url = "http://downloads.sourceforge.net/project/pmgrcollective/pmgrcollective/PMGR_COLLECTIVE-1.0/pmgr_collective-1.0.tgz" - - versions = { '1.0' : '0384d008774274cc3fc7b4d810dfd07e' } - - def install(self, spec, prefix): - make('PREFIX="' + prefix + '"') - make('PREFIX="' + prefix + '"', "install") diff --git a/lib/spack/spack/packages/pmgr_collective/package.py b/lib/spack/spack/packages/pmgr_collective/package.py new file mode 100644 index 0000000000..0874e2d17b --- /dev/null +++ b/lib/spack/spack/packages/pmgr_collective/package.py @@ -0,0 +1,37 @@ +############################################################################## +# Copyright (c) 2013, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://scalability-llnl.github.io/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License (as published by +# the Free Software Foundation) version 2.1 dated February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +from spack import * + +class PmgrCollective(Package): + """PMGR_COLLECTIVE provides a scalable network for bootstrapping + MPI jobs.""" + homepage = "http://www.sourceforge.net/projects/pmgrcollective" + url = "http://downloads.sourceforge.net/project/pmgrcollective/pmgrcollective/PMGR_COLLECTIVE-1.0/pmgr_collective-1.0.tgz" + + versions = { '1.0' : '0384d008774274cc3fc7b4d810dfd07e' } + + def install(self, spec, prefix): + make('PREFIX="' + prefix + '"') + make('PREFIX="' + prefix + '"', "install") diff --git a/lib/spack/spack/packages/scr.py b/lib/spack/spack/packages/scr.py deleted file mode 100644 index cb908e830e..0000000000 --- a/lib/spack/spack/packages/scr.py +++ /dev/null @@ -1,39 +0,0 @@ -############################################################################## -# Copyright (c) 2013, Lawrence Livermore National Security, LLC. -# Produced at the Lawrence Livermore National Laboratory. -# -# This file is part of Spack. -# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. -# LLNL-CODE-647188 -# -# For details, see https://scalability-llnl.github.io/spack -# Please also see the LICENSE file for our notice and the LGPL. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License (as published by -# the Free Software Foundation) version 2.1 dated February 1999. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and -# conditions of the GNU General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -############################################################################## -from spack import * - -class Scr(Package): - homepage = "https://computation-rnd.llnl.gov/scr" - url = "http://downloads.sourceforge.net/project/scalablecr/releases/scr-1.1-7.tar.gz" - - depends_on("mpi") - - versions = { '1.1-7' : 'a5930e9ab27d1b7049447c2fd7734ebd' } - - def install(self, spec, prefix): - configure("--prefix=" + prefix, - "--with-scr-config-file=" + prefix + "/etc/scr.conf") - make() - make("install") diff --git a/lib/spack/spack/packages/scr/package.py b/lib/spack/spack/packages/scr/package.py new file mode 100644 index 0000000000..cb908e830e --- /dev/null +++ b/lib/spack/spack/packages/scr/package.py @@ -0,0 +1,39 @@ +############################################################################## +# Copyright (c) 2013, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://scalability-llnl.github.io/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License (as published by +# the Free Software Foundation) version 2.1 dated February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +from spack import * + +class Scr(Package): + homepage = "https://computation-rnd.llnl.gov/scr" + url = "http://downloads.sourceforge.net/project/scalablecr/releases/scr-1.1-7.tar.gz" + + depends_on("mpi") + + versions = { '1.1-7' : 'a5930e9ab27d1b7049447c2fd7734ebd' } + + def install(self, spec, prefix): + configure("--prefix=" + prefix, + "--with-scr-config-file=" + prefix + "/etc/scr.conf") + make() + make("install") diff --git a/lib/spack/spack/packages/spindle.py b/lib/spack/spack/packages/spindle.py deleted file mode 100644 index 0d106221d8..0000000000 --- a/lib/spack/spack/packages/spindle.py +++ /dev/null @@ -1,39 +0,0 @@ -############################################################################## -# Copyright (c) 2014, Lawrence Livermore National Security, LLC. -# Produced at the Lawrence Livermore National Laboratory. -# -# This file is part of Spack. -# Written by Matthew LeGendre, legendre1@llnl.gov, All rights reserved. -# LLNL-CODE-647188 -# -# For details, see https://scalability-llnl.github.io/spack -# Please also see the LICENSE file for our notice and the LGPL. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License (as published by -# the Free Software Foundation) version 2.1 dated February 1999. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and -# conditions of the GNU General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -############################################################################## -from spack import * - -class Spindle(Package): - homepage = "https://computation-rnd.llnl.gov/spindle" - url = "https://github.com/hpc/Spindle/archive/v0.8.1.tar.gz" - list_url = "https://github.com/hpc/Spindle/releases" - - versions = {'0.8.1' : 'f11793a6b9d8df2cd231fccb2857d912' } - - depends_on("launchmon") - - def install(self, spec, prefix): - configure("--prefix=" + prefix) - make() - make("install") diff --git a/lib/spack/spack/packages/spindle/package.py b/lib/spack/spack/packages/spindle/package.py new file mode 100644 index 0000000000..0d106221d8 --- /dev/null +++ b/lib/spack/spack/packages/spindle/package.py @@ -0,0 +1,39 @@ +############################################################################## +# Copyright (c) 2014, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Written by Matthew LeGendre, legendre1@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://scalability-llnl.github.io/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License (as published by +# the Free Software Foundation) version 2.1 dated February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +from spack import * + +class Spindle(Package): + homepage = "https://computation-rnd.llnl.gov/spindle" + url = "https://github.com/hpc/Spindle/archive/v0.8.1.tar.gz" + list_url = "https://github.com/hpc/Spindle/releases" + + versions = {'0.8.1' : 'f11793a6b9d8df2cd231fccb2857d912' } + + depends_on("launchmon") + + def install(self, spec, prefix): + configure("--prefix=" + prefix) + make() + make("install") diff --git a/lib/spack/spack/packages/stat.py b/lib/spack/spack/packages/stat.py deleted file mode 100644 index d621bcef01..0000000000 --- a/lib/spack/spack/packages/stat.py +++ /dev/null @@ -1,39 +0,0 @@ -from spack import * - -class Stat(Package): - """Library to create, manipulate, and export graphs Graphlib.""" - homepage = "http://paradyn.org/STAT/STAT.html" - url = "https://github.com/lee218llnl/stat/archive/v2.0.0.tar.gz" - - versions = { '2.0.0' : 'c7494210b0ba26b577171b92838e1a9b', } - - depends_on('libdwarf') - depends_on('dyninst') - depends_on('graphlib') - #depends_on('launchmon') # TODO: when added, path gets too long (Jira SPACK-21)! - depends_on('mrnet') - - def install(self, spec, prefix): - configure( - "--enable-gui", - "--prefix=%s" % prefix, - - # TODO: this uses the launchmon package, but path is - # too long (see depends_on above) (Jira SPACK-21) - # "--with-launchmon=%s" % spec['launchmon'].prefix, - - # TODO: launchmon line above is the proper one once - # SPACK-21 is fixed - "--with-launchmon=/collab/usr/global/tools/launchmon/chaos_5_x86_64_ib/launchmon-1.0.0-20140312", - - "--with-mrnet=%s" % spec['mrnet'].prefix, - "--with-graphlib=%s" % spec['graphlib'].prefix, - "--with-stackwalker=%s" % spec['dyninst'].prefix, - "--with-libdwarf=%s" % spec['libdwarf'].prefix) - - # TODO: remove once SPACK-19 is fixed - import shutil - shutil.copy2('/usr/bin/libtool', 'libtool') - - make(parallel=False) - make("install") diff --git a/lib/spack/spack/packages/stat/package.py b/lib/spack/spack/packages/stat/package.py new file mode 100644 index 0000000000..d621bcef01 --- /dev/null +++ b/lib/spack/spack/packages/stat/package.py @@ -0,0 +1,39 @@ +from spack import * + +class Stat(Package): + """Library to create, manipulate, and export graphs Graphlib.""" + homepage = "http://paradyn.org/STAT/STAT.html" + url = "https://github.com/lee218llnl/stat/archive/v2.0.0.tar.gz" + + versions = { '2.0.0' : 'c7494210b0ba26b577171b92838e1a9b', } + + depends_on('libdwarf') + depends_on('dyninst') + depends_on('graphlib') + #depends_on('launchmon') # TODO: when added, path gets too long (Jira SPACK-21)! + depends_on('mrnet') + + def install(self, spec, prefix): + configure( + "--enable-gui", + "--prefix=%s" % prefix, + + # TODO: this uses the launchmon package, but path is + # too long (see depends_on above) (Jira SPACK-21) + # "--with-launchmon=%s" % spec['launchmon'].prefix, + + # TODO: launchmon line above is the proper one once + # SPACK-21 is fixed + "--with-launchmon=/collab/usr/global/tools/launchmon/chaos_5_x86_64_ib/launchmon-1.0.0-20140312", + + "--with-mrnet=%s" % spec['mrnet'].prefix, + "--with-graphlib=%s" % spec['graphlib'].prefix, + "--with-stackwalker=%s" % spec['dyninst'].prefix, + "--with-libdwarf=%s" % spec['libdwarf'].prefix) + + # TODO: remove once SPACK-19 is fixed + import shutil + shutil.copy2('/usr/bin/libtool', 'libtool') + + make(parallel=False) + make("install") diff --git a/lib/spack/spack/patch.py b/lib/spack/spack/patch.py index 2638000b27..42d49b15e5 100644 --- a/lib/spack/spack/patch.py +++ b/lib/spack/spack/patch.py @@ -30,7 +30,6 @@ from llnl.util.filesystem import join_path import spack import spack.stage import spack.error -import spack.packages as packages from spack.util.executable import which @@ -55,7 +54,7 @@ class Patch(object): if '://' in path_or_url: self.url = path_or_url else: - pkg_dir = packages.dirname_for_package_name(pkg_name) + pkg_dir = spack.db.dirname_for_package_name(pkg_name) self.path = join_path(pkg_dir, path_or_url) if not os.path.isfile(self.path): raise NoSuchPatchFileError(pkg_name, self.path) diff --git a/lib/spack/spack/relations.py b/lib/spack/spack/relations.py index 3950bd1a20..f46b7dfc84 100644 --- a/lib/spack/spack/relations.py +++ b/lib/spack/spack/relations.py @@ -80,7 +80,6 @@ import spack.error from spack.patch import Patch from spack.spec import Spec, parse_anonymous_spec -from spack.packages import packages_module """Adds a dependencies local variable in the locals of diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index a660e840d0..a4f585b28a 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -99,16 +99,16 @@ import llnl.util.tty as tty from llnl.util.lang import * from llnl.util.tty.color import * +import spack import spack.parse import spack.error import spack.compilers import spack.compilers.gcc -import spack.packages as packages from spack.version import * from spack.util.string import * from spack.util.prefix import Prefix - +from spack.virtual import ProviderIndex # Convenient names for color formats so that other things can use them compiler_color = '@g' @@ -379,7 +379,7 @@ class Spec(object): @property def package(self): - return packages.get(self) + return spack.db.get(self) @property @@ -391,7 +391,7 @@ class Spec(object): Possible idea: just use conventin and make virtual deps all caps, e.g., MPI vs mpi. """ - return not packages.exists(self.name) + return not spack.db.exists(self.name) @property @@ -532,7 +532,7 @@ class Spec(object): return for spec in virtuals: - providers = packages.providers_for(spec) + providers = spack.db.providers_for(spec) concrete = spack.concretizer.choose_provider(spec, providers) concrete = concrete.copy() spec._replace_with(concrete) @@ -624,7 +624,7 @@ class Spec(object): # Combine constraints from package dependencies with # constraints on the spec's dependencies. - pkg = packages.get(self.name) + pkg = spack.db.get(self.name) for name, pkg_dep in self.package.dependencies.items(): # If it's a virtual dependency, try to find a provider if pkg_dep.virtual: @@ -653,7 +653,7 @@ class Spec(object): else: # if it's a real dependency, check whether it provides something # already required in the spec. - index = packages.ProviderIndex([pkg_dep], restrict=True) + index = ProviderIndex([pkg_dep], restrict=True) for vspec in (v for v in spec_deps.values() if v.virtual): if index.providers_for(vspec): vspec._replace_with(pkg_dep) @@ -718,7 +718,7 @@ class Spec(object): # Remove virtual deps that are already provided by something in the spec spec_packages = [d.package for d in spec_deps.values() if not d.virtual] - index = packages.ProviderIndex(spec_deps.values(), restrict=True) + index = ProviderIndex(spec_deps.values(), restrict=True) visited = set() self._normalize_helper(visited, spec_deps, index) @@ -754,7 +754,7 @@ class Spec(object): for spec in self.preorder_traversal(): # Don't get a package for a virtual name. if not spec.virtual: - packages.get(spec.name) + spack.db.get(spec.name) # validate compiler name in addition to the package name. if spec.compiler: @@ -888,10 +888,8 @@ class Spec(object): return False # For virtual dependencies, we need to dig a little deeper. - self_index = packages.ProviderIndex( - self.preorder_traversal(), restrict=True) - other_index = packages.ProviderIndex( - other.preorder_traversal(), restrict=True) + self_index = ProviderIndex(self.preorder_traversal(), restrict=True) + other_index = ProviderIndex(other.preorder_traversal(), restrict=True) # This handles cases where there are already providers for both vpkgs if not self_index.satisfies(other_index): diff --git a/lib/spack/spack/test/__init__.py b/lib/spack/spack/test/__init__.py index 2aadf40382..271b915479 100644 --- a/lib/spack/spack/test/__init__.py +++ b/lib/spack/spack/test/__init__.py @@ -30,6 +30,8 @@ from llnl.util.tty.colify import colify import spack +import spack.test.install + """Names of tests to be included in Spack's test suite""" test_names = ['versions', @@ -40,7 +42,8 @@ test_names = ['versions', 'spec_semantics', 'spec_dag', 'concretize', - 'multimethod'] + 'multimethod', + 'install'] def list_tests(): diff --git a/lib/spack/spack/test/concretize.py b/lib/spack/spack/test/concretize.py index 538c13f2cd..62e2732749 100644 --- a/lib/spack/spack/test/concretize.py +++ b/lib/spack/spack/test/concretize.py @@ -24,7 +24,7 @@ ############################################################################## import unittest -import spack.packages as packages +import spack from spack.spec import Spec from spack.test.mock_packages_test import * @@ -113,22 +113,22 @@ class ConcretizeTest(MockPackagesTest): we ask for some advanced version. """ self.assertTrue(not any(spec.satisfies('mpich2@:1.0') - for spec in packages.providers_for('mpi@2.1'))) + for spec in spack.db.providers_for('mpi@2.1'))) self.assertTrue(not any(spec.satisfies('mpich2@:1.1') - for spec in packages.providers_for('mpi@2.2'))) + for spec in spack.db.providers_for('mpi@2.2'))) self.assertTrue(not any(spec.satisfies('mpich2@:1.1') - for spec in packages.providers_for('mpi@2.2'))) + for spec in spack.db.providers_for('mpi@2.2'))) self.assertTrue(not any(spec.satisfies('mpich@:1') - for spec in packages.providers_for('mpi@2'))) + for spec in spack.db.providers_for('mpi@2'))) self.assertTrue(not any(spec.satisfies('mpich@:1') - for spec in packages.providers_for('mpi@3'))) + for spec in spack.db.providers_for('mpi@3'))) self.assertTrue(not any(spec.satisfies('mpich2') - for spec in packages.providers_for('mpi@3'))) + for spec in spack.db.providers_for('mpi@3'))) def test_virtual_is_fully_expanded_for_callpath(self): @@ -162,8 +162,4 @@ class ConcretizeTest(MockPackagesTest): def test_my_dep_depends_on_provider_of_my_virtual_dep(self): spec = Spec('indirect_mpich') spec.normalize() - - print - print spec.tree(color=True) - spec.concretize() diff --git a/lib/spack/spack/test/install.py b/lib/spack/spack/test/install.py new file mode 100644 index 0000000000..e567f6f9b5 --- /dev/null +++ b/lib/spack/spack/test/install.py @@ -0,0 +1,98 @@ +############################################################################## +# Copyright (c) 2013, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://scalability-llnl.github.io/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License (as published by +# the Free Software Foundation) version 2.1 dated February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +import unittest +import shutil +from contextlib import closing + +from llnl.util.filesystem import * + +import spack +from spack.stage import Stage +from spack.util.executable import which +from spack.test.mock_packages_test import * + +dir_name = 'trivial-1.0' +archive_name = 'trivial-1.0.tar.gz' +install_test_package = 'trivial_install_test_package' + +class InstallTest(MockPackagesTest): + """Tests install and uninstall on a trivial package.""" + + def setUp(self): + super(InstallTest, self).setUp() + + self.stage = Stage('not_a_real_url') + archive_dir = join_path(self.stage.path, dir_name) + dummy_configure = join_path(archive_dir, 'configure') + + mkdirp(archive_dir) + with closing(open(dummy_configure, 'w')) as configure: + configure.write( + "#!/bin/sh\n" + "prefix=$(echo $1 | sed 's/--prefix=//')\n" + "cat > Makefile <