From 132c32076affebe1dd22b833befebe4e57dbb30e Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Tue, 28 Oct 2014 16:44:35 -0700 Subject: Add Muster parallel clustering library. --- var/spack/packages/muster/package.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 var/spack/packages/muster/package.py (limited to 'var') diff --git a/var/spack/packages/muster/package.py b/var/spack/packages/muster/package.py new file mode 100644 index 0000000000..31d03f4b45 --- /dev/null +++ b/var/spack/packages/muster/package.py @@ -0,0 +1,21 @@ +from spack import * + +class Muster(Package): + """The Muster library provides implementations of sequential and + parallel K-Medoids clustering algorithms. It is intended as a + general framework for parallel cluster analysis, particularly + for performance data analysis on systems with very large + numbers of processes. + """ + homepage = "https://github.com/scalability-llnl/muster" + url = "https://github.com/scalability-llnl/muster/archive/v1.0.tar.gz" + + version('1.0', '2eec6979a4a36d3a65a792d12969be16') + + depends_on("boost") + depends_on("mpi") + + def install(self, spec, prefix): + cmake(".", *std_cmake_args) + make() + make("install") -- cgit v1.2.3-70-g09d2 From 8c8fc749be47aeb1aee74f74b7129f233afdbe51 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Thu, 30 Oct 2014 15:02:06 -0700 Subject: Initial versions of python and libffi. --- var/spack/packages/libffi/package.py | 16 ++++++++++++++++ var/spack/packages/python/package.py | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 var/spack/packages/libffi/package.py create mode 100644 var/spack/packages/python/package.py (limited to 'var') diff --git a/var/spack/packages/libffi/package.py b/var/spack/packages/libffi/package.py new file mode 100644 index 0000000000..2c1c4eed4d --- /dev/null +++ b/var/spack/packages/libffi/package.py @@ -0,0 +1,16 @@ +from spack import * + +class Libffi(Package): + """The libffi library provides a portable, high level programming + interface to various calling conventions. This allows a programmer + to call any function specified by a call interface description at + run time.""" + homepage = "https://sourceware.org/libffi/" + url = "ftp://sourceware.org/pub/libffi/libffi-3.1.tar.gz" + + version('3.1', 'f5898b29bbfd70502831a212d9249d10') + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") diff --git a/var/spack/packages/python/package.py b/var/spack/packages/python/package.py new file mode 100644 index 0000000000..db2d954445 --- /dev/null +++ b/var/spack/packages/python/package.py @@ -0,0 +1,16 @@ +from spack import * + +class Python(Package): + """The Python programming language.""" + homepage = "http://www.python.org" + url = "http://www.python.org/ftp/python/2.7.8/Python-2.7.8.tar.xz" + + version('2.7.8', 'd235bdfa75b8396942e360a70487ee00') + + depends_on("openssl") + depends_on("sqlite") + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") -- cgit v1.2.3-70-g09d2 From 1656f62a125232b30235da01e816a3ade4481b8a Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sat, 1 Nov 2014 16:56:19 -0700 Subject: Add bzip2 package and spack pkg add command. --- lib/spack/spack/cmd/pkg.py | 17 ++++++++++++++++- var/spack/packages/bzip2/package.py | 19 +++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 var/spack/packages/bzip2/package.py (limited to 'var') diff --git a/lib/spack/spack/cmd/pkg.py b/lib/spack/spack/cmd/pkg.py index 82ebd13ff9..da905603fa 100644 --- a/lib/spack/spack/cmd/pkg.py +++ b/lib/spack/spack/cmd/pkg.py @@ -37,6 +37,10 @@ def setup_parser(subparser): sp = subparser.add_subparsers( metavar='SUBCOMMAND', dest='pkg_command') + add_parser = sp.add_parser('add', help=pkg_add.__doc__) + add_parser.add_argument('packages', nargs=argparse.REMAINDER, + help="Names of packages to add to git repo.") + list_parser = sp.add_parser('list', help=pkg_list.__doc__) list_parser.add_argument('rev', default='HEAD', nargs='?', help="Revision to list packages for.") @@ -79,6 +83,16 @@ def list_packages(rev): return sorted(line[len(relpath):] for line in output.split('\n') if line) +def pkg_add(args): + for pkg_name in args.packages: + filename = spack.db.filename_for_package_name(pkg_name) + if not os.path.isfile(filename): + tty.die("No such package: %s. Path does not exist:" % pkg_name, filename) + + git = get_git() + git('-C', spack.packages_path, 'add', filename) + + def pkg_list(args): """List packages associated with a particular spack git revision.""" colify(list_packages(args.rev)) @@ -117,7 +131,8 @@ def pkg_added(args): def pkg(parser, args): - action = { 'diff' : pkg_diff, + action = { 'add' : pkg_add, + 'diff' : pkg_diff, 'list' : pkg_list, 'removed' : pkg_removed, 'added' : pkg_added } diff --git a/var/spack/packages/bzip2/package.py b/var/spack/packages/bzip2/package.py new file mode 100644 index 0000000000..83ae88e564 --- /dev/null +++ b/var/spack/packages/bzip2/package.py @@ -0,0 +1,19 @@ +from spack import * + +class Bzip2(Package): + """bzip2 is a freely available, patent free high-quality data + compressor. It typically compresses files to within 10% to 15% + of the best available techniques (the PPM family of statistical + compressors), whilst being around twice as fast at compression + and six times faster at decompression.""" + homepage = "http://www.bzip.org" + url = "http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz" + + version('1.0.6', '00b516f4704d4a7cb50a1d97e6e8e15b') + + def install(self, spec, prefix): + # No configure system -- have to filter the makefile for this package. + filter_file(r'CC=gcc', 'CC=cc', 'Makefile', string=True) + + make() + make("install", "PREFIX=%s" % prefix) -- cgit v1.2.3-70-g09d2 From 6c8c41da98a01d595b8ef77175e2c717accf02d7 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Mon, 3 Nov 2014 00:15:05 -0800 Subject: Working Python 2.7.8, ncurses, readline --- var/spack/packages/ncurses/package.py | 8 ++++++-- var/spack/packages/python/package.py | 11 ++++++++++- var/spack/packages/readline/package.py | 21 +++++++++++++++++++++ 3 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 var/spack/packages/readline/package.py (limited to 'var') diff --git a/var/spack/packages/ncurses/package.py b/var/spack/packages/ncurses/package.py index 4885caa628..2556e600f6 100644 --- a/var/spack/packages/ncurses/package.py +++ b/var/spack/packages/ncurses/package.py @@ -10,10 +10,14 @@ class Ncurses(Package): homepage = "http://invisible-island.net/ncurses/ncurses.html" version('5.9', '8cb9c412e5f2d96bc6f459aa8c6282a1', - url='http://invisible-island.net/datafiles/release/ncurses.tar.gz') + url='http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz') def install(self, spec, prefix): - configure("--prefix=%s" % prefix) + configure("--prefix=%s" % prefix, + "--with-shared", + "--enable-widec", + "--enable-pc-files", + "--without-ada") make() make("install") diff --git a/var/spack/packages/python/package.py b/var/spack/packages/python/package.py index db2d954445..e6c3e28820 100644 --- a/var/spack/packages/python/package.py +++ b/var/spack/packages/python/package.py @@ -8,9 +8,18 @@ class Python(Package): version('2.7.8', 'd235bdfa75b8396942e360a70487ee00') depends_on("openssl") + depends_on("bzip2") + depends_on("readline") + depends_on("ncurses") depends_on("sqlite") def install(self, spec, prefix): - configure("--prefix=%s" % prefix) + # Need this to allow python build to find the Python installation. + env['PYTHONHOME'] = prefix + + # Rest of install is pretty standard. + configure("--prefix=%s" % prefix, + "--with-threads", + "--enable-shared") make() make("install") diff --git a/var/spack/packages/readline/package.py b/var/spack/packages/readline/package.py new file mode 100644 index 0000000000..1b870e0e7f --- /dev/null +++ b/var/spack/packages/readline/package.py @@ -0,0 +1,21 @@ +from spack import * + +class Readline(Package): + """The GNU Readline library provides a set of functions for use by + applications that allow users to edit command li nes as they + are typed in. Both Emacs and vi editing modes are + available. The Readline library includes additional functions + to maintain a list of previously-entered command lines, to + recall and perhaps reedit those lines, and perform csh-like + history expansion on previous commands. """ + homepage = "http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html" + url = "ftp://ftp.cwru.edu/pub/bash/readline-6.3.tar.gz" + + version('6.3', '33c8fb279e981274f485fd91da77e94a') + + depends_on("ncurses") + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make("SHLIB_LIBS=-lncurses") + make("install") -- cgit v1.2.3-70-g09d2 From 6c4bac2ed8544e6b0e7d8f99aeeb18144a81772f Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Mon, 3 Nov 2014 14:17:10 -0800 Subject: Update libmonitor URL to point to google code. --- var/spack/packages/libmonitor/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/packages/libmonitor/package.py b/var/spack/packages/libmonitor/package.py index ed619e4cce..3b95b86ddf 100644 --- a/var/spack/packages/libmonitor/package.py +++ b/var/spack/packages/libmonitor/package.py @@ -28,7 +28,7 @@ class Libmonitor(Package): """Libmonitor is a library for process and thread control.""" homepage = "http://hpctoolkit.org" - version('20130218', svn='https://outreach.scidac.gov/svn/libmonitor/trunk', revision=146) + version('20130218', svn='http://libmonitor.googlecode.com/svn/trunk/', revision=146) def install(self, spec, prefix): configure("--prefix=" + prefix) -- cgit v1.2.3-70-g09d2 From 7905b50dcb14c1a71303ce38dc6b0bdb7931d89c Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Mon, 3 Nov 2014 01:44:30 -0800 Subject: Bump ImageMagick version --- var/spack/packages/ImageMagick/package.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'var') diff --git a/var/spack/packages/ImageMagick/package.py b/var/spack/packages/ImageMagick/package.py index 39c733e0df..ae06368f85 100644 --- a/var/spack/packages/ImageMagick/package.py +++ b/var/spack/packages/ImageMagick/package.py @@ -3,9 +3,10 @@ from spack import * class Imagemagick(Package): """ImageMagick is a image processing library""" homepage = "http://www.imagemagic.org" - url = "http://www.imagemagick.org/download/ImageMagick-6.8.9-9.tar.gz" + url = "http://www.imagemagick.org/download/ImageMagick-6.8.9-10.tar.gz" - version('6.8.9-9', 'e63fed3e3550851328352c708f800676') + version('6.8.9-10', 'aa050bf9785e571c956c111377bbf57c') + version('6.8.9-9', 'e63fed3e3550851328352c708f800676') depends_on('libtool') depends_on('jpeg') -- cgit v1.2.3-70-g09d2 From a37828bafba2f594e54e0e7487df909fdeac4c8f Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Wed, 8 Oct 2014 21:59:47 -0700 Subject: Packages for gcc and its dependencies. --- var/spack/packages/gcc/package.py | 43 ++++++++++++++++++++++++++++++++++++++ var/spack/packages/gmp/package.py | 40 +++++++++++++++++++++++++++++++++++ var/spack/packages/mpc/package.py | 42 +++++++++++++++++++++++++++++++++++++ var/spack/packages/mpfr/package.py | 38 +++++++++++++++++++++++++++++++++ 4 files changed, 163 insertions(+) create mode 100644 var/spack/packages/gcc/package.py create mode 100644 var/spack/packages/gmp/package.py create mode 100644 var/spack/packages/mpc/package.py create mode 100644 var/spack/packages/mpfr/package.py (limited to 'var') diff --git a/var/spack/packages/gcc/package.py b/var/spack/packages/gcc/package.py new file mode 100644 index 0000000000..bb5fee8192 --- /dev/null +++ b/var/spack/packages/gcc/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 Gcc(Package): + """The GNU Compiler Collection includes front ends for C, C++, + Objective-C, Fortran, and Java.""" + homepage = "https://gcc.gnu.org" + url = "http://www.netgull.com/gcc/releases/gcc-4.9.1/gcc-4.9.1.tar.bz2" + + version('4.9.1', 'fddf71348546af523353bd43d34919c1') + + depends_on("mpc") + depends_on("mpfr") + depends_on("gmp") + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix, + "--disable-multilib") + make() + make("install") diff --git a/var/spack/packages/gmp/package.py b/var/spack/packages/gmp/package.py new file mode 100644 index 0000000000..d6af821b34 --- /dev/null +++ b/var/spack/packages/gmp/package.py @@ -0,0 +1,40 @@ +############################################################################## +# 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 Gmp(Package): + """GMP is a free library for arbitrary precision arithmetic, + operating on signed integers, rational numbers, and + floating-point numbers.""" + homepage = "https://gmplib.org" + url = "https://gmplib.org/download/gmp/gmp-6.0.0a.tar.bz2" + + version('6.0.0a', 'b7ff2d88cae7f8085bd5006096eed470') + version('6.0.0' , '6ef5869ae735db9995619135bd856b84') + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") diff --git a/var/spack/packages/mpc/package.py b/var/spack/packages/mpc/package.py new file mode 100644 index 0000000000..6fbfca3007 --- /dev/null +++ b/var/spack/packages/mpc/package.py @@ -0,0 +1,42 @@ +############################################################################## +# 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 Mpc(Package): + """Gnu Mpc is a C library for the arithmetic of complex numbers + with arbitrarily high precision and correct rounding of the + result.""" + homepage = "http://www.multiprecision.org" + url = "ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.2.tar.gz" + + version('1.0.2', '68fadff3358fb3e7976c7a398a0af4c3') + + depends_on("gmp") + depends_on("mpfr") + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") diff --git a/var/spack/packages/mpfr/package.py b/var/spack/packages/mpfr/package.py new file mode 100644 index 0000000000..62dac63206 --- /dev/null +++ b/var/spack/packages/mpfr/package.py @@ -0,0 +1,38 @@ +############################################################################## +# 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 Mpfr(Package): + """The MPFR library is a C library for multiple-precision + floating-point computations with correct rounding.""" + homepage = "http://www.mpfr.org" + url = "http://www.mpfr.org/mpfr-current/mpfr-3.1.2.tar.bz2" + + version('3.1.2', 'ee2c3ac63bf0c2359bf08fc3ee094c19') + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") -- cgit v1.2.3-70-g09d2 From b97ee67a4b8ddddf9af8a93c3e8292e34d507467 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Wed, 5 Nov 2014 09:54:43 -0800 Subject: Working GCC package. --- lib/spack/llnl/util/filesystem.py | 23 +++++++++++++++-- var/spack/packages/gcc/package.py | 53 ++++++++++++++++++++++++++++++++++++--- 2 files changed, 71 insertions(+), 5 deletions(-) (limited to 'var') diff --git a/lib/spack/llnl/util/filesystem.py b/lib/spack/llnl/util/filesystem.py index dc722297ec..6a04d98a18 100644 --- a/lib/spack/llnl/util/filesystem.py +++ b/lib/spack/llnl/util/filesystem.py @@ -22,8 +22,9 @@ # along with this program; if not, write to the Free Software Foundation, # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## -__all__ = ['install', 'expand_user', 'working_dir', 'touch', 'mkdirp', - 'join_path', 'ancestor', 'can_access', 'filter_file', 'change_sed_delimiter'] +__all__ = ['set_install_permissions', 'install', 'expand_user', 'working_dir', + 'touch', 'mkdirp', 'force_remove', 'join_path', 'ancestor', + 'can_access', 'filter_file', 'change_sed_delimiter'] import os import sys @@ -127,10 +128,19 @@ def change_sed_delimiter(old_delim, new_delim, *filenames): filter_file(double_quoted, '"%s"' % repl, f) +def set_install_permissions(path): + """Set appropriate permissions on the installed file.""" + if os.path.isdir(path): + os.chmod(path, 0755) + else: + os.chmod(path, 0644) + + def install(src, dest): """Manually install a file to a particular location.""" tty.info("Installing %s to %s" % (src, dest)) shutil.copy(src, dest) + set_install_permissions(dest) def expand_user(path): @@ -152,6 +162,15 @@ def mkdirp(*paths): raise OSError(errno.EEXIST, "File alredy exists", path) +def force_remove(*paths): + """Remove files without printing errors. Like rm -f, does NOT + remove directories.""" + for path in paths: + try: + os.remove(path) + except OSError, e: + pass + @contextmanager def working_dir(dirname, **kwargs): if kwargs.get('create', False): diff --git a/var/spack/packages/gcc/package.py b/var/spack/packages/gcc/package.py index bb5fee8192..e1f1084c96 100644 --- a/var/spack/packages/gcc/package.py +++ b/var/spack/packages/gcc/package.py @@ -24,20 +24,67 @@ ############################################################################## from spack import * +from contextlib import closing +from glob import glob + class Gcc(Package): """The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, and Java.""" homepage = "https://gcc.gnu.org" - url = "http://www.netgull.com/gcc/releases/gcc-4.9.1/gcc-4.9.1.tar.bz2" - version('4.9.1', 'fddf71348546af523353bd43d34919c1') + list_url = 'http://mirrors.kernel.org/gnu/gcc/' + list_depth = 2 + + version('4.9.2', '4df8ee253b7f3863ad0b86359cd39c43', + url="http://mirrors.kernel.org/gnu/gcc/gcc-4.9.2/gcc-4.9.2.tar.bz2") + version('4.9.1', 'fddf71348546af523353bd43d34919c1', + url="http://mirrors.kernel.org/gnu/gcc/gcc-4.9.1/gcc-4.9.1.tar.bz2") depends_on("mpc") depends_on("mpfr") depends_on("gmp") + depends_on("libelf") + def install(self, spec, prefix): + # libjava/configure needs a minor fix to install into spack paths. + filter_file(r"'@.*@'", "'@[[:alnum:]]*@'", 'libjava/configure', string=True) + + # Rest of install is straightforward. configure("--prefix=%s" % prefix, - "--disable-multilib") + "--libdir=%s/lib64" % prefix, + "--disable-multilib", + "--enable-languages=c,c++,fortran,java,objc,go", + "--enable-lto", + "--with-quad") make() make("install") + + self.write_rpath_specs() + + + @property + def spec_dir(self): + # e.g. lib64/gcc/x86_64-unknown-linux-gnu/4.9.2 + spec_dir = glob("%s/lib64/gcc/*/*" % self.prefix) + return spec_dir[0] if spec_dir else None + + + def write_rpath_specs(self): + """Generate a spec file so the linker adds a rpath to the libs + the compiler used to build the executable.""" + if not self.spec_dir: + tty.warn("Could not install specs for %s." % self.spec.format('$_$@')) + return + + gcc = Executable(join_path(self.prefix.bin, 'gcc')) + lines = gcc('-dumpspecs', return_output=True).split("\n") + for i, line in enumerate(lines): + if line.startswith("*link:"): + specs_file = join_path(self.spec_dir, 'specs') + with closing(open(specs_file, 'w')) as out: + out.write(lines[i] + "\n") + out.write("-rpath %s/lib:%s/lib64 \\\n" + % (self.prefix, self.prefix)) + out.write(lines[i+1] + "\n") + set_install_permissions(specs_file) -- cgit v1.2.3-70-g09d2 From d78ece658b0b139604998886a788acc11e661b14 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Fri, 7 Nov 2014 00:13:52 -0800 Subject: Change to faster gcc mirror that allows spidering. --- var/spack/packages/gcc/package.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'var') diff --git a/var/spack/packages/gcc/package.py b/var/spack/packages/gcc/package.py index e1f1084c96..da0debd5dc 100644 --- a/var/spack/packages/gcc/package.py +++ b/var/spack/packages/gcc/package.py @@ -32,13 +32,13 @@ class Gcc(Package): Objective-C, Fortran, and Java.""" homepage = "https://gcc.gnu.org" - list_url = 'http://mirrors.kernel.org/gnu/gcc/' + list_url = 'http://open-source-box.org/gcc/' list_depth = 2 version('4.9.2', '4df8ee253b7f3863ad0b86359cd39c43', - url="http://mirrors.kernel.org/gnu/gcc/gcc-4.9.2/gcc-4.9.2.tar.bz2") + url="http://open-source-box.org/gcc/gcc-4.9.2/gcc-4.9.2.tar.bz2") version('4.9.1', 'fddf71348546af523353bd43d34919c1', - url="http://mirrors.kernel.org/gnu/gcc/gcc-4.9.1/gcc-4.9.1.tar.bz2") + url="http://open-source-box.org/gcc/gcc-4.9.1/gcc-4.9.1.tar.bz2") depends_on("mpc") depends_on("mpfr") -- cgit v1.2.3-70-g09d2 From 9033ae646006bf6c4c1e482c024af9217fcdea99 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Fri, 7 Nov 2014 00:20:39 -0800 Subject: Add package for Sandia QThreads. --- var/spack/packages/qthreads/package.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 var/spack/packages/qthreads/package.py (limited to 'var') diff --git a/var/spack/packages/qthreads/package.py b/var/spack/packages/qthreads/package.py new file mode 100644 index 0000000000..dacdb71524 --- /dev/null +++ b/var/spack/packages/qthreads/package.py @@ -0,0 +1,22 @@ +from spack import * + +class Qthreads(Package): + """The qthreads API is designed to make using large numbers of + threads convenient and easy, and to allow portable access to + threading constructs used in massively parallel shared memory + environments. The API maps well to both MTA-style threading and + PIM-style threading, and we provide an implementation of this + interface in both a standard SMP context as well as the SST + context. The qthreads API provides access to full/empty-bit + (FEB) semantics, where every word of memory can be marked + either full or empty, and a thread can wait for any word to + attain either state.""" + homepage = "http://www.cs.sandia.gov/qthreads/" + url = "https://qthreads.googlecode.com/files/qthread-1.10.tar.bz2" + + version('1.10', '5af8c8bbe88c2a6d45361643780d1671') + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") -- cgit v1.2.3-70-g09d2 From 57076f6ca4ae37cf2d0cc91fa7b4de688df1be1c Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sat, 8 Nov 2014 11:42:54 -0800 Subject: URL parsing improvements --- lib/spack/env/cc | 10 ++++- lib/spack/spack/spec.py | 5 ++- lib/spack/spack/test/url_extrapolate.py | 38 ++++++++++++++----- lib/spack/spack/url.py | 67 ++++++++++++++++++--------------- var/spack/packages/jpeg/package.py | 2 +- var/spack/packages/openmpi/package.py | 6 +-- 6 files changed, 81 insertions(+), 47 deletions(-) (limited to 'var') diff --git a/lib/spack/env/cc b/lib/spack/env/cc index f68cb0b2cd..19ca31cace 100755 --- a/lib/spack/env/cc +++ b/lib/spack/env/cc @@ -275,9 +275,15 @@ for dir in "${libraries[@]}"; do args+=("-L$dir"); done for lib in "${libs[@]}"; do args+=("-l$lib"); done if [ "$mode" = ccld ]; then - for dir in "${rpaths[@]}"; do args+=("-Wl,-rpath=$dir"); done + for dir in "${rpaths[@]}"; do + args+=("-Wl,-rpath") + args+=("-Wl,$dir"); + done elif [ "$mode" = ld ]; then - for dir in "${rpaths[@]}"; do args+=("-rpath=$dir"); done + for dir in "${rpaths[@]}"; do + args+=("-rpath") + args+=("$dir"); + done fi # diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index a0ab38c049..570bb1191c 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -1096,8 +1096,9 @@ class Spec(object): def __contains__(self, spec): - """True if this spec has any dependency that satisfies the supplied - spec.""" + """True if this spec satisfis the provided spec, or if any dependency + does. If the spec has no name, then we parse this one first. + """ spec = self._autospec(spec) for s in self.traverse(): if s.satisfies(spec): diff --git a/lib/spack/spack/test/url_extrapolate.py b/lib/spack/spack/test/url_extrapolate.py index c30ff1f009..71aa249e49 100644 --- a/lib/spack/spack/test/url_extrapolate.py +++ b/lib/spack/spack/test/url_extrapolate.py @@ -34,15 +34,35 @@ from spack.test.mock_packages_test import * class UrlExtrapolateTest(MockPackagesTest): - def test_known_version(self): - d = spack.db.get('dyninst') - - self.assertEqual( - d.url_for_version('8.2'), 'http://www.paradyn.org/release8.2/DyninstAPI-8.2.tgz') + def test_libelf_version(self): + base = "http://www.mr511.de/software/libelf-0.8.13.tar.gz" + self.assertEqual(url.substitute_version(base, '0.8.13'), base) + self.assertEqual(url.substitute_version(base, '0.8.12'), + "http://www.mr511.de/software/libelf-0.8.12.tar.gz") + self.assertEqual(url.substitute_version(base, '0.3.1'), + "http://www.mr511.de/software/libelf-0.3.1.tar.gz") + self.assertEqual(url.substitute_version(base, '1.3.1b'), + "http://www.mr511.de/software/libelf-1.3.1b.tar.gz") + + + def test_libdwarf_version(self): + base = "http://www.prevanders.net/libdwarf-20130729.tar.gz" + self.assertEqual(url.substitute_version(base, '20130729'), base) + self.assertEqual(url.substitute_version(base, '8.12'), + "http://www.prevanders.net/libdwarf-8.12.tar.gz") + + + def test_dyninst_version(self): + # Dyninst has a version twice in the URL. + base = "http://www.dyninst.org/sites/default/files/downloads/dyninst/8.1.2/DyninstAPI-8.1.2.tgz" + self.assertEqual(url.substitute_version(base, '8.1.2'), base) self.assertEqual( - d.url_for_version('8.1.2'), 'http://www.paradyn.org/release8.1.2/DyninstAPI-8.1.2.tgz') + url.substitute_version(base, '8.2'), + "http://www.dyninst.org/sites/default/files/downloads/dyninst/8.2/DyninstAPI-8.2.tgz") + self.assertEqual( - d.url_for_version('8.1.1'), 'http://www.paradyn.org/release8.1/DyninstAPI-8.1.1.tgz') + url.substitute_version(base, '8.3.1'), + "http://www.dyninst.org/sites/default/files/downloads/dyninst/8.3.1/DyninstAPI-8.3.1.tgz") def test_extrapolate_version(self): @@ -59,8 +79,8 @@ class UrlExtrapolateTest(MockPackagesTest): # 8.2 matches both the release8.2 component and the DyninstAPI-8.2 component. # Extrapolation should replace both with the new version. # TODO: figure out a consistent policy for this. - # self.assertEqual( - # d.url_for_version('8.2.3'), 'http://www.paradyn.org/release8.2.3/DyninstAPI-8.2.3.tgz') + self.assertEqual( + d.url_for_version('8.2.3'), 'http://www.paradyn.org/release8.2.3/DyninstAPI-8.2.3.tgz') def test_with_package(self): diff --git a/lib/spack/spack/url.py b/lib/spack/spack/url.py index a0410131b0..1c0c0d2438 100644 --- a/lib/spack/spack/url.py +++ b/lib/spack/spack/url.py @@ -57,27 +57,6 @@ from spack.version import Version # "path" seemed like the most generic term. # -class UrlParseError(spack.error.SpackError): - """Raised when the URL module can't parse something correctly.""" - def __init__(self, msg, path): - super(UrlParseError, self).__init__(msg) - self.path = path - - -class UndetectableVersionError(UrlParseError): - """Raised when we can't parse a version from a string.""" - def __init__(self, path): - super(UndetectableVersionError, self).__init__( - "Couldn't detect version in: " + path, path) - - -class UndetectableNameError(UrlParseError): - """Raised when we can't parse a package name from a string.""" - def __init__(self, path): - super(UndetectableNameError, self).__init__( - "Couldn't parse package name in: " + path, path) - - def find_list_url(url): """Finds a good list URL for the supplied URL. This depends on the site. By default, just assumes that a good list URL is the @@ -98,7 +77,7 @@ def find_list_url(url): return os.path.dirname(url) -def parse_version_string_with_indices(path): +def parse_version_offset(path): """Try to extract a version string from a filename or URL. This is taken largely from Homebrew's Version class.""" @@ -112,6 +91,7 @@ def parse_version_string_with_indices(path): # Take basename to avoid including parent dirs in version name # Remember the offset of the stem in the full path. stem = os.path.basename(path) + offset = len(path) - len(stem) version_types = [ # GitHub tarballs, e.g. v1.2.3 @@ -172,13 +152,13 @@ def parse_version_string_with_indices(path): # e.g. http://www.ijg.org/files/jpegsrc.v8d.tar.gz (r'\.v(\d+[a-z]?)', stem)] - for vtype in version_types: + for i, vtype in enumerate(version_types): regex, match_string = vtype[:2] match = re.search(regex, match_string) if match and match.group(1) is not None: version = match.group(1) - start = path.index(version) - return version, start, start+len(version) + start = offset + match.start(1) + return version, start, len(version) raise UndetectableVersionError(path) @@ -187,11 +167,11 @@ def parse_version(path): """Given a URL or archive name, extract a version from it and return a version object. """ - ver, start, end = parse_version_string_with_indices(path) + ver, start, l = parse_version_offset(path) return Version(ver) -def parse_name(path, ver=None): +def parse_name_offset(path, ver=None): if ver is None: ver = parse_version(path) @@ -207,10 +187,16 @@ def parse_name(path, ver=None): for nt in ntypes: match = re.search(nt, path) if match: - return match.group(1) + name = match.group(1) + return name, match.start(1), len(name) raise UndetectableNameError(path) +def parse_name(path, ver=None): + name, start, l = parse_name_offset(path, ver) + return name + + def parse_name_and_version(path): ver = parse_version(path) name = parse_name(path, ver) @@ -231,8 +217,8 @@ def substitute_version(path, new_version): """Given a URL or archive name, find the version in the path and substitute the new version for it. """ - ver, start, end = parse_version_string_with_indices(path) - return path[:start] + str(new_version) + path[end:] + ver, start, l = parse_version_offset(path) + return path[:start] + str(new_version) + path[(start+l):] def wildcard_version(path): @@ -266,3 +252,24 @@ def wildcard_version(path): # Put it all back together with original name matches intact. return ''.join(name_parts) + '.' + ext + + +class UrlParseError(spack.error.SpackError): + """Raised when the URL module can't parse something correctly.""" + def __init__(self, msg, path): + super(UrlParseError, self).__init__(msg) + self.path = path + + +class UndetectableVersionError(UrlParseError): + """Raised when we can't parse a version from a string.""" + def __init__(self, path): + super(UndetectableVersionError, self).__init__( + "Couldn't detect version in: " + path, path) + + +class UndetectableNameError(UrlParseError): + """Raised when we can't parse a package name from a string.""" + def __init__(self, path): + super(UndetectableNameError, self).__init__( + "Couldn't parse package name in: " + path, path) diff --git a/var/spack/packages/jpeg/package.py b/var/spack/packages/jpeg/package.py index b34fd5cb2d..bb5b77e01c 100644 --- a/var/spack/packages/jpeg/package.py +++ b/var/spack/packages/jpeg/package.py @@ -5,7 +5,7 @@ class Jpeg(Package): homepage = "http://www.ijg.org" url = "http://www.ijg.org/files/jpegsrc.v9a.tar.gz" - version('9', 'b397211ddfd506b92cd5e02a22ac924d') + version('9a', 'b397211ddfd506b92cd5e02a22ac924d') def install(self, spec, prefix): configure("--prefix=%s" % prefix) diff --git a/var/spack/packages/openmpi/package.py b/var/spack/packages/openmpi/package.py index 1ef8a8f000..7e84cbaf65 100644 --- a/var/spack/packages/openmpi/package.py +++ b/var/spack/packages/openmpi/package.py @@ -13,9 +13,9 @@ class Openmpi(Package): version('1.8.2', 'ab538ed8e328079d566fc797792e016e', url='http://www.open-mpi.org/software/ompi/v1.8/downloads/openmpi-1.8.2.tar.gz') - version('1.6.5', '03aed2a4aa4d0b27196962a2a65fc475', url = "http://www.open-mpi.org/software/ompi/v1.6/downloads/openmpi-1.6.5.tar.bz2") + patch('ad_lustre_rwcontig_open_source.patch', when="@1.6.5") patch('llnl-platforms.patch', when="@1.6.5") @@ -27,8 +27,8 @@ class Openmpi(Package): # TODO: use variants for this, e.g. +lanl, +llnl, etc. # use this for LANL builds, but for LLNL builds, we need: # "--with-platform=contrib/platform/llnl/optimized" - if self.version == ver("1.6.5"): - confg_args.append("--with-platform=contrib/platform/lanl/tlcc2/optimized-nopanasas") + if self.version == ver("1.6.5") and '+lanl' in spec: + config_args.append("--with-platform=contrib/platform/lanl/tlcc2/optimized-nopanasas") # TODO: Spack should make it so that you can't actually find # these compilers if they're "disabled" for the current -- cgit v1.2.3-70-g09d2 From 0c12e26026cd8262be6f678da437430c76293e47 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Tue, 2 Dec 2014 14:25:52 -0800 Subject: Bugfix in boost build. - b2 used to be called bjam --- var/spack/packages/boost/package.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/packages/boost/package.py b/var/spack/packages/boost/package.py index d3231c3baa..254d1afda1 100644 --- a/var/spack/packages/boost/package.py +++ b/var/spack/packages/boost/package.py @@ -53,7 +53,10 @@ class Boost(Package): bootstrap = Executable('./bootstrap.sh') bootstrap() - b2 = Executable('./b2') + # b2 used to be called bjam, before 1.47 (sigh) + b2name = './b2' if spec.satisfies('@1.47:') else './bjam' + + b2 = Executable(b2name) b2('install', '-j %s' % make_jobs, '--prefix=%s' % prefix) -- cgit v1.2.3-70-g09d2 From 908400bfc5bca8bf10ee5bdadf17a40bddc68caf Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Tue, 2 Dec 2014 21:57:22 -0800 Subject: Fix dyninst 8.1.1 checksum. --- var/spack/packages/dyninst/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/packages/dyninst/package.py b/var/spack/packages/dyninst/package.py index df19ac7bc0..9fbc6385a9 100644 --- a/var/spack/packages/dyninst/package.py +++ b/var/spack/packages/dyninst/package.py @@ -32,7 +32,7 @@ class Dyninst(Package): list_url = "http://www.dyninst.org/downloads/dyninst-8.x" version('8.1.2', 'bf03b33375afa66fe0efa46ce3f4b17a') - version('8.1.1', '1f8743e3a5662b25ce64a7edf647e77d') + version('8.1.1', 'd1a04e995b7aa70960cd1d1fac8bd6ac') depends_on("libelf") depends_on("libdwarf") -- cgit v1.2.3-70-g09d2 From 0f04f75fa3caeb5de5b367c62a79167d8b52a3fe Mon Sep 17 00:00:00 2001 From: Adam Moody Date: Tue, 2 Dec 2014 18:12:25 -0800 Subject: add autoconf and libcircle dependencies, call autoconf before configure --- var/spack/packages/mpibash/mpibash-4.3.patch | 1565 ++++++++++++++++++++++++++ var/spack/packages/mpibash/package.py | 32 + 2 files changed, 1597 insertions(+) create mode 100644 var/spack/packages/mpibash/mpibash-4.3.patch create mode 100644 var/spack/packages/mpibash/package.py (limited to 'var') diff --git a/var/spack/packages/mpibash/mpibash-4.3.patch b/var/spack/packages/mpibash/mpibash-4.3.patch new file mode 100644 index 0000000000..17e285b0bf --- /dev/null +++ b/var/spack/packages/mpibash/mpibash-4.3.patch @@ -0,0 +1,1565 @@ +diff -Naur bash-4.3/builtins/circle.def mpibash-4.3/builtins/circle.def +--- bash-4.3/builtins/circle.def 1969-12-31 17:00:00.000000000 -0700 ++++ mpibash-4.3/builtins/circle.def 2014-05-13 11:27:37.314100671 -0600 +@@ -0,0 +1,620 @@ ++This file is circle.def, from which is created circle.c. ++It implements all of the "circle_*" builtins in Bash. ++ ++$PRODUCES circle.c ++ ++#include ++ ++#include ++#if defined (HAVE_UNISTD_H) ++# ifdef _MINIX ++# include ++# endif ++# include ++#endif ++ ++#include "../bashintl.h" ++#include "../shell.h" ++#include "common.h" ++#include "bashgetopt.h" ++#include ++ ++extern int running_trap, trap_saved_exit_value; ++ ++static int circle_rank; /* Rank in the Libcircle job */ ++static SHELL_VAR *create_func = NULL; /* User-defined callback function for CIRCLE_cb_create. */ ++static SHELL_VAR *process_func = NULL; /* User-defined callback function for CIRCLE_cb_process. */ ++static SHELL_VAR *reduce_init_func = NULL; /* User-defined callback function for CIRCLE_cb_reduce_init. */ ++static SHELL_VAR *reduce_fini_func = NULL; /* User-defined callback function for CIRCLE_cb_reduce_fini. */ ++static SHELL_VAR *reduce_op_func = NULL; /* User-defined callback function for CIRCLE_cb_reduce_op. */ ++static CIRCLE_handle *current_handle = NULL; /* Active handle within a callback or NULL if not within a callback */ ++static int within_reduction = 0; /* 1=within a reduction callback; 0=not */ ++ ++/* Return with a usage message if no arguments remain. */ ++#define YES_ARGS(LIST) \ ++ if ((LIST) == 0) \ ++ { \ ++ builtin_usage (); \ ++ return (EX_USAGE); \ ++ } ++ ++/* Perform the same operation as bind_variable, but with VALUE being a ++ * number, not a string. */ ++static SHELL_VAR * ++bind_variable_number (name, value, flags) ++ const char *name; ++ long value; ++ int flags; ++{ ++ char numstr[25]; /* String version of VALUE */ ++ ++ sprintf (numstr, "%ld", value); ++ return bind_variable (name, numstr, flags); ++} ++ ++/* Invoke the user-defined creation-callback function (create_func). */ ++static void ++internal_create_func (handle) ++ CIRCLE_handle *handle; ++{ ++ WORD_LIST *funcargs; ++ ++ if (create_func == NULL) ++ return; ++ current_handle = handle; ++ funcargs = make_word_list (make_word ("cb_create"), NULL); ++ execute_shell_function (create_func, funcargs); ++ dispose_words (funcargs); ++ current_handle = NULL; ++} ++ ++/* Invoke the user-defined process-callback function (process_func). */ ++static void ++internal_process_func (handle) ++ CIRCLE_handle *handle; ++{ ++ WORD_LIST *funcargs; ++ ++ if (process_func == NULL) ++ return; ++ current_handle = handle; ++ funcargs = make_word_list (make_word ("cb_process"), NULL); ++ execute_shell_function (process_func, funcargs); ++ dispose_words (funcargs); ++ current_handle = NULL; ++} ++ ++/* Invoke the user-defined reduction-initiation callback function ++ * (reduce_init_func). */ ++static void ++internal_reduce_init_func (void) ++{ ++ WORD_LIST *funcargs; ++ ++ if (reduce_init_func == NULL) ++ return; ++ within_reduction = 1; ++ funcargs = make_word_list (make_word ("cb_reduce_init"), NULL); ++ execute_shell_function (reduce_init_func, funcargs); ++ dispose_words (funcargs); ++ within_reduction = 0; ++} ++ ++/* Invoke the user-defined reduction callback function ++ * (reduce_op_func). */ ++static void ++internal_reduce_op_func (buf1, size1, buf2, size2) ++ const void* buf1; ++ size_t size1; ++ const void* buf2; ++ size_t size2; ++{ ++ WORD_LIST *funcargs; ++ ++ if (reduce_op_func == NULL) ++ return; ++ within_reduction = 1; ++ funcargs = make_word_list (make_word (buf2), NULL); ++ funcargs = make_word_list (make_word (buf1), funcargs); ++ funcargs = make_word_list (make_word ("cb_reduce_op"), funcargs); ++ execute_shell_function (reduce_op_func, funcargs); ++ dispose_words (funcargs); ++ within_reduction = 0; ++} ++ ++/* Invoke the user-defined reduction-finalization callback function ++ * (reduce_fini_func). */ ++static void ++internal_reduce_fini_func (buf, size) ++ const void* buf; ++ size_t size; ++{ ++ WORD_LIST *funcargs; ++ ++ if (reduce_fini_func == NULL) ++ return; ++ funcargs = make_word_list (make_word (buf), NULL); ++ funcargs = make_word_list (make_word ("cb_reduce_fini"), funcargs); ++ execute_shell_function (reduce_fini_func, funcargs); ++ dispose_words (funcargs); ++} ++ ++/* Look up a user-provided callback function. */ ++static int ++find_callback_function (list, user_func) ++ WORD_LIST *list; ++ SHELL_VAR **user_func; ++{ ++ char *funcname; /* Name of the user-defined function. */ ++ ++ /* If no argument was provided, nullify the callback function. */ ++ if (list == NULL) ++ { ++ *user_func = NULL; ++ return EXECUTION_SUCCESS; ++ } ++ ++ /* Get the callback function. */ ++ funcname = list->word->word; ++ list = list->next; ++ no_args (list); ++ *user_func = find_function (funcname); ++ if (*user_func == NULL) ++ { ++ builtin_error (_("function %s not found"), funcname); ++ return EXECUTION_FAILURE; ++ } ++ return EXECUTION_SUCCESS; ++} ++ ++/* Initialize Libcircle. */ ++void ++initialize_libcircle (argc, argv) ++ int argc; ++ char **argv; ++{ ++ circle_rank = CIRCLE_init (argc, argv, CIRCLE_DEFAULT_FLAGS); ++ bind_variable_number ("circle_rank", circle_rank, 0); ++ CIRCLE_enable_logging (CIRCLE_LOG_WARN); ++ CIRCLE_cb_create (internal_create_func); ++ CIRCLE_cb_process (internal_process_func); ++ CIRCLE_cb_reduce_init (internal_reduce_init_func); ++ CIRCLE_cb_reduce_op (internal_reduce_op_func); ++ CIRCLE_cb_reduce_fini (internal_reduce_fini_func); ++} ++ ++/* Finalize Libcircle. */ ++void ++finalize_libcircle (void) ++{ ++ CIRCLE_finalize (); ++} ++ ++/* ---------------------------------------------------------------------- */ ++ ++$BUILTIN circle_set_options ++$FUNCTION circle_set_options_builtin ++$SHORT_DOC circle_set_options [flag]... ++Change Libcircle's run-time behavior. ++ ++Arguments: ++ FLAG "split_random", "split_equal", or "create_global" ++ ++Multiple flags can be provided. If no flags are provided, Libcircle ++reverts to its default options. ++ ++Exit Status: ++Returns 0 unless an invalid option is given. ++$END ++/*'*/ ++ ++/* Here is the circle_set_options builtin. */ ++int ++circle_set_options_builtin (list) ++ WORD_LIST *list; ++{ ++ char *word; /* One argument */ ++ int flags = 0; /* Flags to pass to CIRCLE_set_options */ ++ ++ if (list == NULL) ++ flags = CIRCLE_DEFAULT_FLAGS; ++ else ++ while (list != NULL) ++ { ++ word = list->word->word; ++ if (!strcmp (word, "split_random")) ++ flags |= CIRCLE_SPLIT_RANDOM; ++ else if (!strcmp (word, "split_equal")) ++ flags |= CIRCLE_SPLIT_EQUAL; ++ else if (!strcmp (word, "create_global")) ++ flags |= CIRCLE_CREATE_GLOBAL; ++ else ++ { ++ builtin_error (_("invalid flag \"%s\""), word); ++ return (EXECUTION_FAILURE); ++ } ++ list = list->next; ++ } ++ CIRCLE_set_options (flags); ++ return EXECUTION_SUCCESS; ++} ++ ++$BUILTIN circle_cb_create ++$FUNCTION circle_cb_create_builtin ++$SHORT_DOC circle_cb_create [func] ++Register a function that will create work when asked. ++ ++Arguments: ++ FUNC User-defined callback function that will invoke ++ circle_enqueue when called ++ ++If FUNC is omitted, no function will be associated with work creation. ++This can be used to nullify a previous circle_cb_create invocation. ++ ++Exit Status: ++Returns 0 unless an invalid function is given or an error occurs. ++$END ++ ++/* Here is the circle_cb_create builtin. */ ++int ++circle_cb_create_builtin (list) ++ WORD_LIST *list; ++{ ++ return find_callback_function (list, &create_func); ++} ++ ++$BUILTIN circle_cb_process ++$FUNCTION circle_cb_process_builtin ++$SHORT_DOC circle_cb_process [func] ++Register a function that will process work when asked. ++ ++Arguments: ++ FUNC User-defined callback function that will invoke ++ circle_enqueue when called ++ ++If FUNC is omitted, no function will be associated with work processing. ++This can be used to nullify a previous circle_cb_process invocation. ++ ++Exit Status: ++Returns 0 unless an invalid function is given or an error occurs. ++$END ++ ++/* Here is the circle_cb_process builtin. */ ++int ++circle_cb_process_builtin (list) ++ WORD_LIST *list; ++{ ++ return find_callback_function (list, &process_func); ++} ++ ++$BUILTIN circle_begin ++$FUNCTION circle_begin_builtin ++$SHORT_DOC circle_begin ++Begin creation and processing of the distributed work queue. ++ ++Exit Status: ++Returns 0 unless an error occurs. ++$END ++ ++/* Here is the circle_begin builtin. */ ++int ++circle_begin_builtin (list) ++ WORD_LIST *list; ++{ ++ no_args (list); ++ CIRCLE_begin (); ++ return EXECUTION_SUCCESS; ++} ++ ++$BUILTIN circle_enqueue ++$FUNCTION circle_enqueue_builtin ++$SHORT_DOC circle_enqueue work ++Enqueue work onto the distributed queue. ++ ++Arguments: ++ WORK "Work" as represented by an arbitrary string of limited ++ size (generally around 4KB) ++ ++Exit Status: ++Returns 0 unless an error occurs. ++$END ++ ++/* Here is the circle_enqueue builtin. */ ++int ++circle_enqueue_builtin (list) ++ WORD_LIST *list; ++{ ++ char *work; /* Work to perform */ ++ ++ /* Extract the work argument. */ ++ YES_ARGS (list); ++ work = list->word->word; ++ list = list->next; ++ no_args (list); ++ ++ /* Complain if we're not within a proper callback function. */ ++ if (current_handle == NULL) ++ { ++ builtin_error (_("not within a Libcircle \"create\" or \"process\" callback function")); ++ return EXECUTION_FAILURE; ++ } ++ ++ /* Enqueue the work. */ ++ if (current_handle->enqueue (work) == -1) ++ return EXECUTION_FAILURE; ++ return EXECUTION_SUCCESS; ++} ++ ++$BUILTIN circle_dequeue ++$FUNCTION circle_dequeue_builtin ++$SHORT_DOC circle_dequeue var ++Dequeue work from the distributed queue into a variable. ++ ++Arguments: ++ VAR Variable in which to receive previously enqueued "work" ++ ++Exit Status: ++Returns 0 unless an error occurs. ++$END ++ ++/* Here is the circle_dequeue builtin. */ ++int ++circle_dequeue_builtin (list) ++ WORD_LIST *list; ++{ ++ char *varname; /* Variable in which to store the work string */ ++ char work[CIRCLE_MAX_STRING_LEN+1]; /* Work to perform */ ++ ++ /* Extract the variable-name argument. */ ++ YES_ARGS (list); ++ varname = list->word->word; ++ list = list->next; ++ no_args (list); ++ ++ /* Complain if we're not within a callback function. */ ++ if (current_handle == NULL) ++ { ++ builtin_error (_("not within a Libcircle callback function")); ++ return EXECUTION_FAILURE; ++ } ++ ++ /* Dequeue the work and bind it to the given variable. */ ++ if (current_handle->dequeue (work) == -1) ++ return EXECUTION_FAILURE; ++ bind_variable (varname, work, 0); ++ return EXECUTION_SUCCESS; ++} ++ ++$BUILTIN circle_enable_logging ++$FUNCTION circle_enable_logging_builtin ++$SHORT_DOC circle_enable_logging log_level ++Change Libcircle's logging verbosity ++ ++Arguments: ++ LOG_LEVEL "fatal", "error", "warning", "info", or "debug" ++ ++Exit Status: ++Returns 0 unless an invalid option is given. ++$END ++/*'*/ ++ ++/* Here is the circle_enable_logging builtin. */ ++int ++circle_enable_logging_builtin (list) ++ WORD_LIST *list; ++{ ++ char *word; /* One argument */ ++ CIRCLE_loglevel loglevel; /* Level to set */ ++ ++ /* Parse the log level. */ ++ YES_ARGS (list); ++ word = list->word->word; ++ if (!strcmp (word, "fatal")) ++ loglevel = CIRCLE_LOG_FATAL; ++ else if (!strcmp (word, "error")) ++ loglevel = CIRCLE_LOG_ERR; ++ else if (!strcmp (word, "warning")) ++ loglevel = CIRCLE_LOG_WARN; ++ else if (!strcmp (word, "info")) ++ loglevel = CIRCLE_LOG_INFO; ++ else if (!strcmp (word, "debug")) ++ loglevel = CIRCLE_LOG_DBG; ++ else ++ { ++ builtin_error (_("invalid log level \"%s\""), word); ++ return (EXECUTION_FAILURE); ++ } ++ ++ /* Set the log level. */ ++ CIRCLE_enable_logging (loglevel); ++ return EXECUTION_SUCCESS; ++} ++ ++$BUILTIN circle_abort ++$FUNCTION circle_abort_builtin ++$SHORT_DOC circle_abort ++Terminate queue processing. ++ ++Exit Status: ++Returns 0 unless an error occurs. ++$END ++ ++/* Here is the circle_abort builtin. */ ++int ++circle_abort_builtin (list) ++ WORD_LIST *list; ++{ ++ no_args (list); ++ CIRCLE_abort (); ++ return EXECUTION_SUCCESS; ++} ++ ++$BUILTIN circle_checkpoint ++$FUNCTION circle_checkpoint_builtin ++$SHORT_DOC circle_checkpoint ++Checkpoint a work queue to disk. ++ ++Write a file called circle${circle_rank}.txt containing the current ++queue state of rank ${circle_rank}. On a later run, a worker can ++invoke circle_read_restarts to repopulate its queue from such a ++checkpoint file. ++ ++Exit Status: ++Returns 0 unless an error occurs. ++$END ++/*'*/ ++ ++/* Here is the circle_checkpoint builtin. */ ++int ++circle_checkpoint_builtin (list) ++ WORD_LIST *list; ++{ ++ no_args (list); ++ CIRCLE_checkpoint (); ++ return EXECUTION_SUCCESS; ++} ++ ++$BUILTIN circle_read_restarts ++$FUNCTION circle_read_restarts_builtin ++$SHORT_DOC circle_read_restarts ++Repopulate a work queue from a disk checkpoint. ++ ++Read queue contents from a file called circle${circle_rank}.txt, which ++was previously produced by circle_checkpoint. ++ ++Exit Status: ++Returns 0 unless an error occurs. ++$END ++/*'*/ ++ ++/* Here is the circle_read_restarts builtin. */ ++int ++circle_read_restarts_builtin (list) ++ WORD_LIST *list; ++{ ++ no_args (list); ++ CIRCLE_read_restarts (); ++ return EXECUTION_SUCCESS; ++} ++ ++$BUILTIN circle_cb_reduce_init ++$FUNCTION circle_cb_reduce_init_builtin ++$SHORT_DOC circle_cb_reduce_init [func] ++Register a function that will initiate a reduction operation. ++ ++Arguments: ++ FUNC User-defined callback function that will invoke ++ circle_reduce when called ++ ++FUNC will be invoked on all ranks. ++ ++If FUNC is omitted, no function will be associated with reduction ++initialization. This can be used to nullify a previous ++circle_cb_reduce_init invocation. ++ ++Exit Status: ++Returns 0 unless an invalid function is given or an error occurs. ++$END ++ ++/* Here is the circle_cb_reduce_init builtin. */ ++int ++circle_cb_reduce_init_builtin (list) ++ WORD_LIST *list; ++{ ++ return find_callback_function (list, &reduce_init_func); ++} ++ ++$BUILTIN circle_cb_reduce_op ++$FUNCTION circle_cb_reduce_op_builtin ++$SHORT_DOC circle_cb_reduce_op [func] ++Register a function that will complete a reduction operation. ++ ++Arguments: ++ FUNC User-defined callback function that will receive ++ two items to reduce and invoke circle_reduce on ++ the reduced value ++ ++If FUNC is omitted, no function will be associated with reduction ++execution. This can be used to nullify a previous circle_cb_reduce_op ++invocation. ++ ++Exit Status: ++Returns 0 unless an invalid function is given or an error occurs. ++$END ++ ++/* Here is the circle_cb_reduce_op builtin. */ ++int ++circle_cb_reduce_op_builtin (list) ++ WORD_LIST *list; ++{ ++ return find_callback_function (list, &reduce_op_func); ++} ++ ++$BUILTIN circle_cb_reduce_fini ++$FUNCTION circle_cb_reduce_fini_builtin ++$SHORT_DOC circle_cb_reduce_fini [func] ++Register a function that will complete a reduction operation. ++ ++Arguments: ++ FUNC User-defined callback function that will receive ++ the final reduced data ++ ++If FUNC is omitted, no function will be associated with reduction ++completion. This can be used to nullify a previous ++circle_cb_reduce_fini invocation. ++ ++Libcircle guarantees that FUNC will be invoked only on rank 0. ++ ++Exit Status: ++Returns 0 unless an invalid function is given or an error occurs. ++$END ++ ++/* Here is the circle_cb_reduce_fini builtin. */ ++int ++circle_cb_reduce_fini_builtin (list) ++ WORD_LIST *list; ++{ ++ return find_callback_function (list, &reduce_fini_func); ++} ++ ++$BUILTIN circle_reduce ++$FUNCTION circle_reduce_builtin ++$SHORT_DOC circle_reduce work ++Seed the next phase of a reduction operation ++ ++Arguments: ++ WORK "Work" as represented by an arbitrary string of limited ++ size (generally around 4KB) ++ ++This function should be called both by the callback function ++registered with circle_reduce_init and the callback function ++registered with circle_reduce_op. ++ ++Exit Status: ++Returns 0 unless an error occurs. ++$END ++ ++/* Here is the circle_reduce builtin. */ ++int ++circle_reduce_builtin (list) ++ WORD_LIST *list; ++{ ++ char *work; /* Work to perform */ ++ ++ /* Extract the work argument. */ ++ YES_ARGS (list); ++ work = list->word->word; ++ list = list->next; ++ no_args (list); ++ ++ /* Complain if we're not within a proper callback function. */ ++ if (!within_reduction) ++ { ++ builtin_error (_("not within a Libcircle \"reduce_init\" or \"reduce_op\" callback function")); ++ return EXECUTION_FAILURE; ++ } ++ ++ /* Reduce the work. */ ++ CIRCLE_reduce (work, strlen (work)); ++ return EXECUTION_SUCCESS; ++} +diff -Naur bash-4.3/builtins/Makefile.in mpibash-4.3/builtins/Makefile.in +--- bash-4.3/builtins/Makefile.in 2012-05-25 07:29:19.000000000 -0600 ++++ mpibash-4.3/builtins/Makefile.in 2014-05-13 11:27:37.314100671 -0600 +@@ -141,7 +141,9 @@ + $(srcdir)/times.def $(srcdir)/trap.def $(srcdir)/type.def \ + $(srcdir)/ulimit.def $(srcdir)/umask.def $(srcdir)/wait.def \ + $(srcdir)/reserved.def $(srcdir)/pushd.def $(srcdir)/shopt.def \ +- $(srcdir)/printf.def $(srcdir)/complete.def $(srcdir)/mapfile.def ++ $(srcdir)/printf.def $(srcdir)/complete.def $(srcdir)/mapfile.def \ ++ $(srcdir)/mpi.def \ ++@CIRCLE@ $(srcdir)/circle.def + + STATIC_SOURCE = common.c evalstring.c evalfile.c getopt.c bashgetopt.c \ + getopt.h +@@ -153,7 +155,9 @@ + jobs.o kill.o let.o mapfile.o \ + pushd.o read.o return.o set.o setattr.o shift.o source.o \ + suspend.o test.o times.o trap.o type.o ulimit.o umask.o \ +- wait.o getopts.o shopt.o printf.o getopt.o bashgetopt.o complete.o ++ wait.o getopts.o shopt.o printf.o getopt.o bashgetopt.o complete.o \ ++ mpi.o \ ++@CIRCLE@ circle.o + + CREATED_FILES = builtext.h builtins.c psize.aux pipesize.h tmpbuiltins.c \ + tmpbuiltins.h +@@ -317,6 +321,8 @@ + getopts.o: getopts.def + reserved.o: reserved.def + complete.o: complete.def ++@CIRCLE@ circle.o: circle.def ++mpi.o: mpi.def + + # C files + bashgetopt.o: ../config.h $(topdir)/bashansi.h $(BASHINCDIR)/ansi_stdlib.h +@@ -644,6 +650,19 @@ + mapfile.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h + mapfile.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/variables.h $(topdir)/conftypes.h + mapfile.o: $(topdir)/arrayfunc.h ../pathnames.h ++@CIRCLE@ circle.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h $(topdir)/error.h ++@CIRCLE@ circle.o: $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/subst.h $(topdir)/externs.h ++@CIRCLE@ circle.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h ++@CIRCLE@ circle.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h ++@CIRCLE@ circle.o: $(BASHINCDIR)/maxpath.h ../pathnames.h ++mpi.o: ../config.h ../config-top.h ../config-bot.h ../bashintl.h ++mpi.o: ../include/gettext.h ../shell.h ../config.h ../bashjmp.h ++mpi.o: ../include/posixjmp.h ../command.h ../syntax.h ../general.h ++mpi.o: ../bashtypes.h ../include/chartypes.h ../xmalloc.h ../bashansi.h ++mpi.o: ../error.h ../variables.h ../array.h ../assoc.h ../hashlib.h ++mpi.o: ../conftypes.h ../arrayfunc.h ../quit.h ../sig.h ../include/maxpath.h ++mpi.o: ../unwind_prot.h ../dispose_cmd.h ../make_cmd.h ../include/ocache.h ++mpi.o: ../subst.h ../pathnames.h ../externs.h common.h bashgetopt.h + + #bind.o: $(RL_LIBSRC)chardefs.h $(RL_LIBSRC)readline.h $(RL_LIBSRC)keymaps.h + +diff -Naur bash-4.3/builtins/mpi.def mpibash-4.3/builtins/mpi.def +--- bash-4.3/builtins/mpi.def 1969-12-31 17:00:00.000000000 -0700 ++++ mpibash-4.3/builtins/mpi.def 2014-05-13 11:27:37.314100671 -0600 +@@ -0,0 +1,744 @@ ++This file is mpi.def, from which is created mpi.c. ++It implements all of the "mpi_*" builtins in Bash. ++ ++$PRODUCES mpi.c ++ ++#include ++ ++#include ++#if defined (HAVE_UNISTD_H) ++# ifdef _MINIX ++# include ++# endif ++# include ++#endif ++ ++#include "../bashintl.h" ++#include "../shell.h" ++#include "common.h" ++#include "bashgetopt.h" ++#include ++ ++extern int running_trap, trap_saved_exit_value; ++ ++/* Keep track of who we are within MPI_COMM_WORLD. */ ++static int mpi_rank; ++static int mpi_num_ranks; ++ ++/* Try an MPI operation. Return with an error message on failure. */ ++#define MPI_TRY(STMT) \ ++ do \ ++ { \ ++ int mpierr; \ ++ mpierr = STMT; \ ++ if (mpierr != MPI_SUCCESS) \ ++ return report_mpi_error (mpierr); \ ++ } \ ++ while (0) ++ ++/* Return with a usage message if no arguments remain. */ ++#define YES_ARGS(LIST) \ ++ if ((LIST) == 0) \ ++ { \ ++ builtin_usage (); \ ++ return (EX_USAGE); \ ++ } ++ ++/* Return with an error message if a given variable is read-only or if ++ * we can't write to it for any other reason (e.g., it's defined as a ++ * function). */ ++#define REQUIRE_WRITABLE(NAME) \ ++ do \ ++ { \ ++ SHELL_VAR *bindvar = find_shell_variable (NAME); \ ++ if (bindvar) \ ++ { \ ++ if (readonly_p (bindvar)) \ ++ { \ ++ err_readonly (NAME); \ ++ return (EXECUTION_FAILURE); \ ++ } \ ++ if (unbind_variable (NAME) == -1) \ ++ { \ ++ builtin_error ("Failed to write to variable %s", NAME); \ ++ return (EXECUTION_FAILURE); \ ++ } \ ++ } \ ++ } \ ++ while (0) ++ ++/* Initialize MPI. */ ++void ++initialize_mpi (argc, argv) ++ int argc; ++ char **argv; ++{ ++ int init_done; ++ ++ MPI_Initialized (&init_done); ++ if (!init_done) ++ MPI_Init (&argc, &argv); ++ MPI_Errhandler_set (MPI_COMM_WORLD, MPI_ERRORS_RETURN); ++ MPI_Comm_rank (MPI_COMM_WORLD, &mpi_rank); ++ MPI_Comm_size (MPI_COMM_WORLD, &mpi_num_ranks); ++} ++ ++/* Finalize MPI. */ ++void ++finalize_mpi () ++{ ++ MPI_Finalize (); ++} ++ ++/* Parse an operation name into an MPI_Op. Return 1 on success, 0 on ++ * failure. */ ++static int ++parse_operation (char *name, MPI_Op *op) ++{ ++ /* Define a mapping from operator names to MPI_Op values. */ ++ typedef struct { ++ char *name; /* Operation name (e.g., "sum") */ ++ MPI_Op value; /* Operation value (e.g., MPI_SUM) */ ++ } opname2value_t; ++ static opname2value_t oplist[] = { ++ {"max", MPI_MAX}, ++ {"min", MPI_MIN}, ++ {"sum", MPI_SUM}, ++ {"prod", MPI_PROD}, ++ {"land", MPI_LAND}, ++ {"band", MPI_BAND}, ++ {"lor", MPI_LOR}, ++ {"bor", MPI_BOR}, ++ {"lxor", MPI_LXOR}, ++ {"bxor", MPI_BXOR}, ++ {"maxloc", MPI_MAXLOC}, ++ {"minloc", MPI_MINLOC} ++ }; ++ size_t i; ++ ++ for (i = 0; i < sizeof(oplist)/sizeof(opname2value_t); i++) ++ if (!strcmp(name, oplist[i].name)) ++ { ++ *op = oplist[i].value; ++ if (i > 0) ++ { ++ /* As a performance optimization, bubble up the value we ++ * just found. */ ++ opname2value_t prev = oplist[i - 1]; ++ oplist[i - 1] = oplist[i]; ++ oplist[i] = prev; ++ } ++ return 1; ++ } ++ return 0; ++} ++ ++/* Report an error to the user and return EXECUTION_FAILURE. */ ++static int ++report_mpi_error (mpierr) ++ int mpierr; ++{ ++ char errstr[MPI_MAX_ERROR_STRING]; ++ int errstrlen; ++ ++ MPI_Error_string (mpierr, errstr, &errstrlen); ++ builtin_error ("%s", errstr); ++ return EXECUTION_FAILURE; ++} ++ ++/* Perform the same operation as bind_variable, but with VALUE being a ++ * number, not a string. */ ++static SHELL_VAR * ++bind_variable_number (name, value, flags) ++ const char *name; ++ long value; ++ int flags; ++{ ++ char numstr[25]; /* String version of VALUE */ ++ ++ sprintf (numstr, "%ld", value); ++ return bind_variable (name, numstr, flags); ++} ++ ++/* Perform the same operation as bind_array_variable, but with VALUE ++ * being a number, not a string. */ ++static SHELL_VAR * ++bind_array_variable_number (name, ind, value, flags) ++ char *name; ++ arrayind_t ind; ++ long value; ++ int flags; ++{ ++ char numstr[25]; /* String version of VALUE */ ++ ++ sprintf (numstr, "%ld", value); ++ return bind_array_variable (name, ind, numstr, flags); ++} ++ ++/* Define a reduction-type function (allreduce, scan, exscan, etc.). */ ++typedef int (*reduction_func_t)(void *, void *, int, MPI_Datatype, MPI_Op, MPI_Comm); ++ ++/* Perform any reduction-type operation (allreduce, scan, exscan, etc.). */ ++static int ++reduction_like (list, funcname, func) ++ WORD_LIST *list; ++ char *funcname; ++ reduction_func_t func; ++{ ++ char *word; /* One argument */ ++ struct { ++ long int value; /* Reduced value */ ++ int rank; /* Rank associated with the above */ ++ } number, result; ++ MPI_Op operation = MPI_SUM; /* Operation to perform */ ++ char *varname; /* Name of the variable to bind the results to */ ++ intmax_t n; ++ int i; ++ ++ /* Parse "-O OPERATION" (optional), where OPERATION is a reduction ++ * operation. */ ++ YES_ARGS (list); ++ word = list->word->word; ++ if (ISOPTION (word, 'O')) ++ { ++ list = list->next; ++ if (list == 0) ++ { ++ sh_needarg (funcname); ++ return (EX_USAGE); ++ } ++ word = list->word->word; ++ if (!parse_operation (word, &operation)) ++ { ++ sh_invalidopt ("-O"); ++ return (EX_USAGE); ++ } ++ list = list->next; ++ } ++ ++ /* Parse the argument, which must be a number. */ ++ YES_ARGS (list); ++ word = list->word->word; ++ if (!legal_number (word, &n)) ++ { ++ sh_neednumarg (funcname); ++ return (EX_USAGE); ++ } ++ number.value = (long int) n; ++ number.rank = mpi_rank; ++ list = list->next; ++ ++ /* Parse the target variable, which must not be read-only. */ ++ YES_ARGS (list); ++ varname = list->word->word; ++ if (mpi_rank != 0 || func != MPI_Exscan) ++ REQUIRE_WRITABLE (varname); ++ list = list->next; ++ no_args (list); ++ ++ /* Perform the reduction operation. Bind the given array variable ++ * to the result and, for minloc/maxloc, the associated rank. */ ++ if (mpi_rank != 0 || func != MPI_Exscan) { ++ bind_array_variable (varname, 0, "", 0); ++ bind_array_variable (varname, 1, "", 0); ++ } ++ if (operation == MPI_MINLOC || operation == MPI_MAXLOC) ++ { ++ MPI_TRY (func (&number, &result, 1, MPI_LONG_INT, operation, MPI_COMM_WORLD)); ++ if (mpi_rank != 0 || func != MPI_Exscan) ++ bind_array_variable_number (varname, 1, result.rank, 0); ++ } ++ else ++ MPI_TRY (func (&number.value, &result.value, 1, MPI_LONG, operation, MPI_COMM_WORLD)); ++ if (mpi_rank != 0 || func != MPI_Exscan) ++ bind_array_variable_number (varname, 0, result.value, 0); ++ return EXECUTION_SUCCESS; ++} ++ ++$BUILTIN mpi_comm_rank ++$FUNCTION mpi_comm_rank_builtin ++$SHORT_DOC mpi_comm_rank name ++Return the process's rank in the MPI job. ++ ++Arguments: ++ NAME Scalar variable in which to receive the rank ++ ++Exit Status: ++Returns 0 unless an invalid option is given. ++$END ++/*'*/ ++ ++/* Here is the mpi_comm_rank builtin. */ ++int ++mpi_comm_rank_builtin (list) ++ WORD_LIST *list; ++{ ++ char *varname; /* Name of the variable to bind the results to */ ++ ++ YES_ARGS (list); ++ varname = list->word->word; ++ REQUIRE_WRITABLE (varname); ++ list = list->next; ++ no_args (list); ++ bind_variable_number (varname, mpi_rank, 0); ++ return EXECUTION_SUCCESS; ++} ++ ++$BUILTIN mpi_comm_size ++$FUNCTION mpi_comm_size_builtin ++$SHORT_DOC mpi_comm_size name ++Return the total number of ranks in the MPI job. ++ ++Arguments: ++ NAME Scalar variable in which to receive the number of ranks ++ ++Exit Status: ++Returns 0 unless an invalid option is given. ++$END ++ ++/* Here is the mpi_comm_size builtin. */ ++int ++mpi_comm_size_builtin (list) ++ WORD_LIST *list; ++{ ++ char *varname; /* Name of the variable to bind the results to */ ++ ++ YES_ARGS (list); ++ varname = list->word->word; ++ REQUIRE_WRITABLE (varname); ++ list = list->next; ++ no_args (list); ++ bind_variable_number (varname, mpi_num_ranks, 0); ++ return EXECUTION_SUCCESS; ++} ++ ++$BUILTIN mpi_abort ++$FUNCTION mpi_abort_builtin ++$SHORT_DOC mpi_abort [n] ++Abort all processes in the MPI job and exit the shell. ++ ++Exits not only the caller's shell (with a status of N) but also all ++remote shells that are part of the same MPI job. If N is omitted, the ++exit status is that of the last command executed. ++ ++This command should be used only in extreme circumstances. It is ++better for each process to exit normally on its own. ++$END ++/*'*/ ++ ++/* Here is the mpi_abort builtin. */ ++int ++mpi_abort_builtin (list) ++ WORD_LIST *list; ++{ ++ int exit_value; ++ ++ exit_value = (running_trap == 1 && list == 0) ? trap_saved_exit_value : get_exitstat (list); /* Copied from exit.def */ ++ MPI_TRY (MPI_Abort (MPI_COMM_WORLD, exit_value)); ++ return EXECUTION_FAILURE; ++} ++ ++$BUILTIN mpi_send ++$FUNCTION mpi_send_builtin ++$SHORT_DOC mpi_send [-t tag] rank message ++Send a message to a remote process in the same MPI job. ++ ++Options: ++ -t TAG Send the message using tag TAG (default: 0). TAG must ++ be a nonnegative integer. ++ ++Arguments: ++ RANK Whom to send the message to. RANK must be an integer in ++ the range [0, $(mpi_comm_size)-1]. ++ ++ MESSAGE String to send to rank RANK. ++ ++Exit Status: ++Returns 0 unless an invalid option is given or an error occurs. ++$END ++ ++/* Here is the mpi_send builtin. */ ++int ++mpi_send_builtin (list) ++ WORD_LIST *list; ++{ ++ char *word; /* One argument */ ++ intmax_t target_rank; /* MPI target rank */ ++ char *message; /* Message to send to rank target_rank */ ++ intmax_t tag = 0; /* Message tag to use */ ++ ++ /* Parse "-t TAG" (optional), where TAG is a number or "any". */ ++ YES_ARGS (list); ++ word = list->word->word; ++ if (ISOPTION (word, 't')) ++ { ++ list = list->next; ++ if (list == 0) ++ { ++ sh_needarg ("mpi_recv"); ++ return (EX_USAGE); ++ } ++ word = list->word->word; ++ if (!legal_number (word, &tag)) ++ { ++ sh_neednumarg ("-t"); ++ return (EX_USAGE); ++ } ++ list = list->next; ++ } ++ else if (*word == '-') ++ { ++ sh_invalidopt (word); ++ builtin_usage (); ++ return (EX_USAGE); ++ } ++ ++ /* Parse the target rank, which must be a number. */ ++ YES_ARGS (list); ++ word = list->word->word; ++ if (!legal_number (word, &target_rank)) ++ { ++ builtin_error (_("mpi_send: numeric rank required")); ++ return (EX_USAGE); ++ } ++ list = list->next; ++ ++ /* Parse the message to send. */ ++ YES_ARGS (list); ++ message = list->word->word; ++ list = list->next; ++ no_args (list); ++ ++ /* Send the message. */ ++ MPI_TRY (MPI_Send (message, strlen(message)+1, MPI_BYTE, (int)target_rank, (int)tag, MPI_COMM_WORLD)); ++ return EXECUTION_SUCCESS; ++} ++ ++ ++$BUILTIN mpi_recv ++$FUNCTION mpi_recv_builtin ++$SHORT_DOC mpi_recv [-t tag] rank name ++Receive a message from a remote process in the same MPI job. ++ ++Options: ++ -t TAG Receive only messages sent using tag TAG (default: 0). ++ TAG must be either a nonnegative integer or the string ++ "any" to receive messages sent using any tag. ++ ++Arguments: ++ RANK Receive only messages sent from sender RANK. RANK ++ must either be in the range [0, $(mpi_comm_size)-1] or ++ be the string "any" to receive messages from any sender. ++ ++ NAME Array variable in which to receive the message, sender ++ rank, and tag. ++ ++Exit Status: ++Returns 0 unless an invalid option is given or an error occurs. ++$END ++ ++/* Here is the mpi_recv builtin. */ ++int ++mpi_recv_builtin (list) ++ WORD_LIST *list; ++{ ++ char *word; /* One argument */ ++ intmax_t source_rank; /* MPI source rank */ ++ char *endptr; /* Used for parsing strings into numbers */ ++ MPI_Status status; /* Status of an MPI operation */ ++ int count; /* Message length in bytes */ ++ intmax_t tag = 0; /* Message tag to use */ ++ char *varname; /* Name of the variable to bind the results to */ ++ static char *message = NULL; /* Message received from MPI */ ++ static size_t alloced = 0; /* Number of bytes allocated for the above */ ++ int opt; /* Parsed option */ ++ ++ /* Parse any options provided. */ ++ reset_internal_getopt (); ++ while ((opt = internal_getopt (list, "t:")) != -1) ++ { ++ switch (opt) ++ { ++ case 't': ++ if (!strcmp (list_optarg, "any")) ++ tag = MPI_ANY_TAG; ++ else if (!legal_number (list_optarg, &tag)) ++ { ++ builtin_error (_("-t: numeric argument or \"any\" required")); ++ return (EX_USAGE); ++ } ++ break; ++ ++ default: ++ sh_invalidopt (word); ++ builtin_usage (); ++ return (EX_USAGE); ++ } ++ } ++ list = loptend; ++ ++ /* Parse the source rank, which must be a number or "any". */ ++ YES_ARGS (list); ++ word = list->word->word; ++ if (!legal_number (word, &source_rank)) ++ { ++ if (!strcmp (word, "any")) ++ source_rank = MPI_ANY_SOURCE; ++ else ++ { ++ builtin_error (_("mpi_recv: numeric rank or \"any\" required")); ++ return (EX_USAGE); ++ } ++ } ++ list = list->next; ++ ++ /* Parse the target variable, which must not be read-only. */ ++ YES_ARGS (list); ++ varname = list->word->word; ++ REQUIRE_WRITABLE (varname); ++ list = list->next; ++ no_args (list); ++ ++ /* Receive a message. Because we don't know long the message will ++ * be, we first probe to get the length. */ ++ MPI_TRY (MPI_Probe ((int)source_rank, (int)tag, MPI_COMM_WORLD, &status)); ++ MPI_TRY (MPI_Get_count (&status, MPI_BYTE, &count)); ++ if (alloced < count) ++ { ++ message = xrealloc (message, count); ++ alloced = count; ++ } ++ MPI_TRY (MPI_Recv (message, count, MPI_BYTE, status.MPI_SOURCE, status.MPI_TAG, MPI_COMM_WORLD, &status)); ++ bind_array_variable (varname, 0, message, 0); ++ bind_array_variable_number (varname, 1, status.MPI_SOURCE, 0); ++ bind_array_variable_number (varname, 2, status.MPI_TAG, 0); ++ return EXECUTION_SUCCESS; ++} ++ ++$BUILTIN mpi_barrier ++$FUNCTION mpi_barrier_builtin ++$SHORT_DOC mpi_barrier ++Synchronizes all of the processes in the MPI job. ++ ++No process will return from mpi_barrier until all processes have ++called mpi_barrier. ++ ++Exit Status: ++Returns 0 unless an invalid option is given or an error occurs. ++$END ++ ++/* Here is the mpi_barrier builtin. */ ++int ++mpi_barrier_builtin (list) ++ WORD_LIST *list; ++{ ++ no_args (list); ++ MPI_TRY (MPI_Barrier (MPI_COMM_WORLD)); ++ return EXECUTION_SUCCESS; ++} ++ ++$BUILTIN mpi_bcast ++$FUNCTION mpi_bcast_builtin ++$SHORT_DOC mpi_bcast [message] name ++Broadcast a message to all processes in the same MPI job. ++ ++Arguments: ++ MESSAGE String to broadcast from one process to all the others. ++ ++ NAME Scalar variable in which to receive the broadcast message. ++ ++Exactly one process in the MPI job must specify a message to ++broadcast. No process will return from mpi_bcast until all processes ++have called mpi_bcast. ++ ++Exit Status: ++Returns 0 unless an invalid option is given or an error occurs. ++$END ++ ++/* Here is the mpi_bcast builtin. */ ++int ++mpi_bcast_builtin (list) ++ WORD_LIST *list; ++{ ++ char *word; /* One argument */ ++ int root; /* MPI root rank */ ++ char *root_message; /* Message to broadcast */ ++ int msglen; /* Length in bytes of the above (including the NULL byte) */ ++ char *varname; /* Name of the variable to bind the results to */ ++ static int *all_lengths = NULL; /* List of every rank's msglen */ ++ static char *message = NULL; /* Message received from the root */ ++ static int alloced = 0; /* Bytes allocated for the above */ ++ int i; ++ ++ /* Parse the optional message and target variable, which must not be ++ * read-only. */ ++ YES_ARGS (list); ++ if (list->next == NULL) ++ { ++ /* Non-root */ ++ root_message = NULL; ++ msglen = -1; ++ } ++ else ++ { ++ /* Root */ ++ root_message = list->word->word; ++ msglen = (int) strlen(root_message) + 1; ++ list = list->next; ++ } ++ varname = list->word->word; ++ REQUIRE_WRITABLE (varname); ++ list = list->next; ++ no_args (list); ++ ++ /* Acquire global agreement on the root and the message size. */ ++ if (all_lengths == NULL) ++ all_lengths = xmalloc (mpi_num_ranks*sizeof(int)); ++ MPI_TRY (MPI_Allgather (&msglen, 1, MPI_INT, all_lengths, 1, MPI_INT, MPI_COMM_WORLD)); ++ root = -1; ++ for (i = 0; i < mpi_num_ranks; i++) ++ { ++ if (all_lengths[i] == -1) ++ continue; ++ if (root != -1) ++ { ++ builtin_error (_("mpi_bcast: more than one process specified a message")); ++ return (EXECUTION_FAILURE); ++ } ++ root = i; ++ msglen = all_lengths[i]; ++ } ++ if (root == -1) ++ { ++ builtin_error (_("mpi_bcast: no process specified a message")); ++ return (EXECUTION_FAILURE); ++ } ++ ++ /* Broadcast the message. */ ++ if (mpi_rank == root) ++ { ++ MPI_TRY (MPI_Bcast (root_message, msglen, MPI_BYTE, root, MPI_COMM_WORLD)); ++ bind_variable (varname, root_message, 0); ++ } ++ else ++ { ++ if (alloced < msglen) ++ { ++ message = xrealloc (message, msglen); ++ alloced = msglen; ++ } ++ MPI_TRY (MPI_Bcast (message, msglen, MPI_BYTE, root, MPI_COMM_WORLD)); ++ bind_variable (varname, message, 0); ++ } ++ return EXECUTION_SUCCESS; ++} ++ ++$BUILTIN mpi_scan ++$FUNCTION mpi_scan_builtin ++$SHORT_DOC mpi_scan number name ++Perform an inclusive scan across all processes in the same MPI job. ++ ++ -O OPERATION Operation to perform. Must be one of "max", "min", ++ "sum", "prod", "land", "band", "lor", "bor", "lxor", ++ "bxor", "maxloc", or "minloc" (default: "sum"). ++ ++Arguments: ++ NUMBER Integer to use in the scan operation. ++ ++ NAME Array variable in which to receive the result and, in ++ the case of maxloc and minloc, the associated rank. ++ ++In an inclusive-scan operation, each process i presents a number, ++a[i]. Once all processes in the MPI job have presented their number, ++the command returns a[0] to rank 0, a[0]+a[1] to rank 1, ++a[0]+a[1]+a[2] to rank 2, and so forth. The -O option enables "+" to ++be replaced with other operations. ++ ++Inclusive scans can be useful for assigning a unique index to each ++process in the MPI job. ++ ++Exit Status: ++Returns 0 unless an invalid option is given or an error occurs. ++$END ++ ++/* Here is the mpi_scan builtin. */ ++int ++mpi_scan_builtin (list) ++ WORD_LIST *list; ++{ ++ return reduction_like (list, "mpi_scan", MPI_Scan); ++} ++ ++$BUILTIN mpi_exscan ++$FUNCTION mpi_exscan_builtin ++$SHORT_DOC mpi_exscan number name ++Perform an exclusive scan across all processes in the same MPI job. ++ ++ -O OPERATION Operation to perform. Must be one of "max", "min", ++ "sum", "prod", "land", "band", "lor", "bor", "lxor", ++ "bxor", "maxloc", or "minloc" (default: "sum"). ++ ++Arguments: ++ NUMBER Integer to use in the scan operation. ++ ++ NAME Array variable in which to receive the result and, in ++ the case of maxloc and minloc, the associated rank. ++ ++In a exclusive-scan operation, each process i presents a number, a[i]. ++Once all processes in the MPI job have presented their number, the ++command assigns a[0] to NAME on rank 1, a[0]+a[1] to NAME on rank 2, ++a[0]+a[1]+a[2] to NAME on rank 3, and so forth. No assignment is ++performed on rank 0. The -O option enables "+" to be replaced with ++other operations. ++ ++Exclusive scans can be useful for assigning a unique index to each ++process in the MPI job. ++ ++Exit Status: ++Returns 0 unless an invalid option is given or an error occurs. ++$END ++ ++/* Here is the mpi_exscan builtin. */ ++int ++mpi_exscan_builtin (list) ++ WORD_LIST *list; ++{ ++ return reduction_like (list, "mpi_exscan", MPI_Exscan); ++} ++ ++$BUILTIN mpi_allreduce ++$FUNCTION mpi_allreduce_builtin ++$SHORT_DOC mpi_allreduce number name ++Reduce numbers from all processes in an MPI job to a single number. ++ ++Options: ++ ++ -O OPERATION Operation to perform. Must be one of "max", "min", ++ "sum", "prod", "land", "band", "lor", "bor", "lxor", ++ "bxor", "maxloc", or "minloc" (default: "sum"). ++ ++Arguments: ++ NUMBER Integer to use in the allreduce operation. ++ ++ NAME Array variable in which to receive the result and, in ++ the case of maxloc and minloc, the associated rank. ++ ++In an all-reduce operation, each process i presents a number, a[i]. ++Once all processes in the MPI job have presented their number, the ++command returns a[0]+a[1]+...+a[n-1] to all ranks. The -O option ++enables "+" to be replaced with other operations. ++ ++All-reduces can be useful for reaching global agreement (e.g., of a ++termination condition). ++ ++Exit Status: ++Returns 0 unless an invalid option is given or an error occurs. ++$END ++ ++/* Here is the mpi_allreduce builtin. */ ++int ++mpi_allreduce_builtin (list) ++ WORD_LIST *list; ++{ ++ return reduction_like (list, "mpi_allreduce", MPI_Allreduce); ++} +diff -Naur bash-4.3/config.h.in mpibash-4.3/config.h.in +--- bash-4.3/config.h.in 2013-06-29 15:35:33.000000000 -0600 ++++ mpibash-4.3/config.h.in 2014-05-13 11:27:37.314100671 -0600 +@@ -1147,6 +1147,12 @@ + /* Define if you have the `__argz_stringify' function. */ + #undef HAVE___ARGZ_STRINGIFY + ++/* Define if you have both the header file and the libcircle library. */ ++#undef HAVE_LIBCIRCLE ++ ++/* Define if you have the `CIRCLE_cb_reduce_op' function. */ ++#undef HAVE_CIRCLE_CB_REDUCE_OP ++ + /* End additions for lib/intl */ + + #include "config-bot.h" +diff -Naur bash-4.3/configure.ac mpibash-4.3/configure.ac +--- bash-4.3/configure.ac 2014-02-11 08:37:53.000000000 -0700 ++++ mpibash-4.3/configure.ac 2014-05-13 11:27:37.302100179 -0600 +@@ -24,7 +24,7 @@ + AC_REVISION([for Bash 4.3, version 4.063])dnl + + define(bashvers, 4.3) +-define(relstatus, release) ++define(relstatus, MPI) + + AC_INIT([bash], bashvers-relstatus, [bug-bash@gnu.org]) + +@@ -813,6 +813,21 @@ + fi + ]) + ++dnl Ensure that we can find an MPI library. ++AC_CHECK_FUNCS([MPI_Init], [], [ ++ AC_MSG_ERROR([Cannot continue without MPI. Consider specifying CC=mpicc.])]) ++ ++dnl If we have Libcircle, use it, too. ++AC_SEARCH_LIBS([CIRCLE_cb_create], [circle], [AC_CHECK_HEADERS([libcircle.h])]) ++if test "x$ac_cv_header_libcircle_h" = xyes; then ++ libcircle_make_prefix="" ++ AC_DEFINE([HAVE_LIBCIRCLE], [1], [Define if you have the Libcircle header and library.]) ++ AC_CHECK_FUNCS([CIRCLE_cb_reduce_op]) ++else ++ libcircle_make_prefix="#" ++fi ++AC_SUBST([CIRCLE], [$libcircle_make_prefix]) ++ + BASH_CHECK_DECL(strtoimax) + BASH_CHECK_DECL(strtol) + BASH_CHECK_DECL(strtoll) +diff -Naur bash-4.3/Makefile.in mpibash-4.3/Makefile.in +--- bash-4.3/Makefile.in 2014-01-25 14:27:30.000000000 -0700 ++++ mpibash-4.3/Makefile.in 2014-05-13 11:27:37.314100671 -0600 +@@ -104,7 +104,7 @@ + VERSPROG = bashversion$(EXEEXT) + VERSOBJ = bashversion.$(OBJEXT) + +-Program = bash$(EXEEXT) ++Program = mpibash$(EXEEXT) + Version = @BASHVERS@ + PatchLevel = `$(BUILD_DIR)/$(VERSPROG) -p` + RELSTATUS = @RELSTATUS@ +diff -Naur bash-4.3/shell.c mpibash-4.3/shell.c +--- bash-4.3/shell.c 2014-01-14 06:04:32.000000000 -0700 ++++ mpibash-4.3/shell.c 2014-05-13 11:27:37.314100671 -0600 +@@ -107,6 +107,13 @@ + extern char *primary_prompt, *secondary_prompt; + extern char *this_command_name; + ++extern void initialize_mpi __P((int, char **)); ++extern void finalize_mpi __P((void)); ++#ifdef HAVE_LIBCIRCLE ++extern void initialize_libcircle __P((int, char **)); ++extern void finalize_libcircle __P((void)); ++#endif ++ + /* Non-zero means that this shell has already been run; i.e. you should + call shell_reinitialize () if you need to start afresh. */ + int shell_initialized = 0; +@@ -324,7 +331,7 @@ + static void init_interactive_script __P((void)); + + static void set_shell_name __P((char *)); +-static void shell_initialize __P((void)); ++static void shell_initialize __P((int, char **)); + static void shell_reinitialize __P((void)); + + static void show_shell_usage __P((FILE *, int)); +@@ -561,7 +568,7 @@ + + /* From here on in, the shell must be a normal functioning shell. + Variables from the environment are expected to be set, etc. */ +- shell_initialize (); ++ shell_initialize (argc, argv); + + set_default_lang (); + set_default_locale_vars (); +@@ -941,6 +948,12 @@ + end_job_control (); + #endif /* JOB_CONTROL */ + ++#ifdef HAVE_LIBCIRCLE ++ finalize_libcircle (); ++#else ++ finalize_mpi (); ++#endif ++ + /* Always return the exit status of the last command to our parent. */ + sh_exit (s); + } +@@ -1691,7 +1704,9 @@ + /* Do whatever is necessary to initialize the shell. + Put new initializations in here. */ + static void +-shell_initialize () ++shell_initialize (argc, argv) ++ int argc; ++ char **argv; + { + char hostname[256]; + +@@ -1760,6 +1775,17 @@ + initialize_shell_options (privileged_mode||running_setuid); + initialize_bashopts (privileged_mode||running_setuid); + #endif ++ ++ /* Initialize Libcircle and MPI. */ ++#ifdef HAVE_LIBCIRCLE ++ initialize_libcircle (argc, argv); ++ initialize_mpi (argc, argv); ++ bind_variable ("libcircle", "yes", 0); ++#else ++ initialize_mpi (argc, argv); ++ bind_variable ("libcircle", "no", 0); ++#endif ++ bind_variable ("mpibash", "yes", 0); + } + + /* Function called by main () when it appears that the shell has already diff --git a/var/spack/packages/mpibash/package.py b/var/spack/packages/mpibash/package.py new file mode 100644 index 0000000000..d0f6dafed6 --- /dev/null +++ b/var/spack/packages/mpibash/package.py @@ -0,0 +1,32 @@ +import os +from spack import * + +class Mpibash(Package): + """Parallel scripting right from the Bourne-Again Shell (Bash)""" + homepage = "http://www.ccs3.lanl.gov/~pakin/software/mpibash-4.3.html" + + version('4.3', '81348932d5da294953e15d4814c74dd1', + url="http://ftp.gnu.org/gnu/bash/bash-4.3.tar.gz") + + # patch -p1 < ../mpibash-4.3.patch + patch('mpibash-4.3.patch', level=1, when='@4.3') + + # above patch modifies configure.ac + depends_on('autoconf') + + # uses MPI_Exscan which is in MPI-1.2 and later + depends_on('mpi@1.2:') + + depends_on('libcircle') + + def install(self, spec, prefix): + # run autoconf to rebuild configure + autoconf = which('autoconf') + autoconf() + + configure("--prefix=" + prefix, + "CC=mpicc") + + make(parallel=False) + + make("install") -- cgit v1.2.3-70-g09d2 From 7dc90c709712bf364b2b0b26686cf07cc038f5ab Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Thu, 4 Dec 2014 10:53:52 -0800 Subject: Add experimental gasnet package for legion. --- var/spack/packages/gasnet/package.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 var/spack/packages/gasnet/package.py (limited to 'var') diff --git a/var/spack/packages/gasnet/package.py b/var/spack/packages/gasnet/package.py new file mode 100644 index 0000000000..705961d1de --- /dev/null +++ b/var/spack/packages/gasnet/package.py @@ -0,0 +1,35 @@ +from spack import * + +class Gasnet(Package): + """GASNet is a language-independent, low-level networking layer + that provides network-independent, high-performance communication + primitives tailored for implementing parallel global address space + SPMD languages and libraries such as UPC, Co-Array Fortran, SHMEM, + Cray Chapel, and Titanium. + """ + homepage = "http://gasnet.lbl.gov" + url = "http://gasnet.lbl.gov/GASNet-1.24.0.tar.gz" + + version('1.24.0', 'c8afdf48381e8b5a7340bdb32ca0f41a') + + + def install(self, spec, prefix): + # TODO: don't use paths with @ in them. + change_sed_delimiter('@', ';', 'configure') + + configure("--prefix=%s" % prefix, + # TODO: factor IB suport out into architecture description. + "--enable-ibv", + "--enable-udp", + "--disable-mpi", + "--enable-par", + "--enable-mpi-compat", + "--enable-segment-fast", + "--disable-aligned-segments", + # TODO: make an option so that Legion can request builds with/without this. + # See the Legion webpage for details on when to/not to use. + "--disable-pshm", + "--with-segment-mmap-max=64MB") + + make() + make("install") -- cgit v1.2.3-70-g09d2 From 588955a98732b208f60a741d00ee3eaabd74f1a6 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Fri, 5 Dec 2014 08:45:51 -0800 Subject: Disable pkgconfig files until I support this better. --- var/spack/packages/ncurses/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/packages/ncurses/package.py b/var/spack/packages/ncurses/package.py index 2556e600f6..a22e83503f 100644 --- a/var/spack/packages/ncurses/package.py +++ b/var/spack/packages/ncurses/package.py @@ -16,7 +16,7 @@ class Ncurses(Package): configure("--prefix=%s" % prefix, "--with-shared", "--enable-widec", - "--enable-pc-files", + "--disable-pc-files", "--without-ada") make() make("install") -- cgit v1.2.3-70-g09d2 From a9be5e723977629def451d783d6a4a75296060ba Mon Sep 17 00:00:00 2001 From: Adam Moody Date: Thu, 18 Dec 2014 11:31:58 -0800 Subject: add gperftools (tcmalloc and friends) --- var/spack/packages/gperftools/package.py | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 var/spack/packages/gperftools/package.py (limited to 'var') diff --git a/var/spack/packages/gperftools/package.py b/var/spack/packages/gperftools/package.py new file mode 100644 index 0000000000..8900462324 --- /dev/null +++ b/var/spack/packages/gperftools/package.py @@ -0,0 +1,38 @@ +############################################################################## +# 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 Gperftools(Package): + """Google's fast malloc/free implementation, especially for multi-threaded applications. + Contains tcmalloc, heap-checker, heap-profiler, and cpu-profiler.""" + homepage = "https://code.google.com/p/gperftools" + url = "https://googledrive.com/host/0B6NtGsLhIcf7MWxMMF9JdTN3UVk/gperftools-2.3.tar.gz" + + version('2.3', 'f54dd119f0e46ac1f13264f8d97adf90', url="https://googledrive.com/host/0B6NtGsLhIcf7MWxMMF9JdTN3UVk/gperftools-2.3.tar.gz") + + def install(self, spec, prefix): + configure("--prefix=" + prefix) + make() + make("install") -- cgit v1.2.3-70-g09d2 From 983f35f32a9f421f93d9cae636aee6f182749b6f Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Tue, 16 Dec 2014 15:24:23 -0800 Subject: Tweak extrae indentation. --- var/spack/packages/extrae/package.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/packages/extrae/package.py b/var/spack/packages/extrae/package.py index 3b842bc1ec..b1a3a3e440 100644 --- a/var/spack/packages/extrae/package.py +++ b/var/spack/packages/extrae/package.py @@ -31,7 +31,15 @@ class Extrae(Package): elif 'mvapich2' in spec: mpi = spec['mvapich2'] - configure("--prefix=%s" % prefix, "--with-mpi=%s" % mpi.prefix, "--with-unwind=%s" % spec['libunwind'].prefix, "--with-dyninst=%s" % spec['dyninst'].prefix, "--with-boost=%s" % spec['boost'].prefix, "--with-dwarf=%s" % spec['libdwarf'].prefix, "--with-papi=%s" % spec['papi'].prefix, "--with-dyninst-headers=%s" % spec['dyninst'].prefix.include, "--with-dyninst-libs=%s" % spec['dyninst'].prefix.lib) + configure("--prefix=%s" % prefix, + "--with-mpi=%s" % mpi.prefix, + "--with-unwind=%s" % spec['libunwind'].prefix, + "--with-dyninst=%s" % spec['dyninst'].prefix, + "--with-boost=%s" % spec['boost'].prefix, + "--with-dwarf=%s" % spec['libdwarf'].prefix, + "--with-papi=%s" % spec['papi'].prefix, + "--with-dyninst-headers=%s" % spec['dyninst'].prefix.include, + "--with-dyninst-libs=%s" % spec['dyninst'].prefix.lib) make() make("install", parallel=False) -- cgit v1.2.3-70-g09d2 From e0b5890ab5ba528e55867071020b624e3b334ca4 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Thu, 30 Oct 2014 15:02:06 -0700 Subject: Initial versions of Qt and some dependencies. --- var/spack/packages/dbus/package.py | 40 ++++++++++++++++++++++++++++++++++++++ var/spack/packages/pcre/package.py | 15 ++++++++++++++ var/spack/packages/qt/package.py | 18 +++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 var/spack/packages/dbus/package.py create mode 100644 var/spack/packages/pcre/package.py create mode 100644 var/spack/packages/qt/package.py (limited to 'var') diff --git a/var/spack/packages/dbus/package.py b/var/spack/packages/dbus/package.py new file mode 100644 index 0000000000..7f0019d67c --- /dev/null +++ b/var/spack/packages/dbus/package.py @@ -0,0 +1,40 @@ +# FIXME: +# This is a template package file for Spack. We've conveniently +# put "FIXME" labels next to all the things you'll want to change. +# +# Once you've edited all the FIXME's, delete this whole message, +# save this file, and test out your package like this: +# +# spack install dbus +# +# You can always get back here to change things with: +# +# spack edit dbus +# +# See the spack documentation for more information on building +# packages. +# +from spack import * + +class Dbus(Package): + """FIXME: put a proper description of your package here.""" + # FIXME: add a proper url for your package's homepage here. + homepage = "http://www.example.com" + url = "http://dbus.freedesktop.org/releases/dbus/dbus-1.8.8.tar.gz" + + version('1.9.0', 'ec6895a4d5c0637b01f0d0e7689e2b36') + version('1.8.8', 'b9f4a18ee3faa1e07c04aa1d83239c43') + version('1.8.6', '6a08ba555d340e9dfe2d623b83c0eea8') + version('1.8.4', '4717cb8ab5b80978fcadf2b4f2f72e1b') + version('1.8.2', 'd6f709bbec0a022a1847c7caec9d6068') + + # FIXME: Add dependencies if this package requires them. + # depends_on("foo") + + def install(self, spec, prefix): + # FIXME: Modify the configure line to suit your build system here. + configure("--prefix=%s" % prefix) + + # FIXME: Add logic to build and install here + make() + make("install") diff --git a/var/spack/packages/pcre/package.py b/var/spack/packages/pcre/package.py new file mode 100644 index 0000000000..3424048a6c --- /dev/null +++ b/var/spack/packages/pcre/package.py @@ -0,0 +1,15 @@ +from spack import * + +class Pcre(Package): + """The PCRE package contains Perl Compatible Regular Expression + libraries. These are useful for implementing regular expression + pattern matching using the same syntax and semantics as Perl 5.""" + homepage = "http://www.pcre.org""" + url = "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.36.tar.bz2" + + version('8.36', 'b767bc9af0c20bc9c1fe403b0d41ad97') + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") diff --git a/var/spack/packages/qt/package.py b/var/spack/packages/qt/package.py new file mode 100644 index 0000000000..aae9367a1b --- /dev/null +++ b/var/spack/packages/qt/package.py @@ -0,0 +1,18 @@ +from spack import * + +class Qt(Package): + """Qt is a comprehensive cross-platform C++ application framework.""" + homepage = "http://qt.io" + + version('4.8.6', '2edbe4d6c2eff33ef91732602f3518eb', + "http://download.qt-project.org/official_releases/qt/4.8/4.8.6/qt-everywhere-opensource-src-4.8.6.tar.gz") + + # depends_on("zlib") + + def install(self, spec, prefix): + # FIXME: Modify the configure line to suit your build system here. + configure("--prefix=%s" % prefix) + + # FIXME: Add logic to build and install here + make() + make("install") -- cgit v1.2.3-70-g09d2 From 8edf299dd21cce9f6f297a81a5fb375b3417bf2a Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sat, 1 Nov 2014 15:00:24 -0700 Subject: gnutls, nettle, wget, dbus --- var/spack/packages/dbus/package.py | 35 ++++++++++------------------------- var/spack/packages/gnutls/package.py | 22 ++++++++++++++++++++++ var/spack/packages/nettle/package.py | 15 +++++++++++++++ var/spack/packages/qt/package.py | 2 +- var/spack/packages/wget/package.py | 21 +++++++++++++++++++++ 5 files changed, 69 insertions(+), 26 deletions(-) create mode 100644 var/spack/packages/gnutls/package.py create mode 100644 var/spack/packages/nettle/package.py create mode 100644 var/spack/packages/wget/package.py (limited to 'var') diff --git a/var/spack/packages/dbus/package.py b/var/spack/packages/dbus/package.py index 7f0019d67c..5fee103f03 100644 --- a/var/spack/packages/dbus/package.py +++ b/var/spack/packages/dbus/package.py @@ -1,25 +1,16 @@ -# FIXME: -# This is a template package file for Spack. We've conveniently -# put "FIXME" labels next to all the things you'll want to change. -# -# Once you've edited all the FIXME's, delete this whole message, -# save this file, and test out your package like this: -# -# spack install dbus -# -# You can always get back here to change things with: -# -# spack edit dbus -# -# See the spack documentation for more information on building -# packages. -# from spack import * class Dbus(Package): - """FIXME: put a proper description of your package here.""" - # FIXME: add a proper url for your package's homepage here. - homepage = "http://www.example.com" + """D-Bus is a message bus system, a simple way for applications to + talk to one another. D-Bus supplies both a system daemon (for + events such new hardware device printer queue ) and a + per-user-login-session daemon (for general IPC needs among user + applications). Also, the message bus is built on top of a + general one-to-one message passing framework, which can be used + by any two applications to communicate directly (without going + through the message bus daemon).""" + + homepage = "http://dbus.freedesktop.org/" url = "http://dbus.freedesktop.org/releases/dbus/dbus-1.8.8.tar.gz" version('1.9.0', 'ec6895a4d5c0637b01f0d0e7689e2b36') @@ -28,13 +19,7 @@ class Dbus(Package): version('1.8.4', '4717cb8ab5b80978fcadf2b4f2f72e1b') version('1.8.2', 'd6f709bbec0a022a1847c7caec9d6068') - # FIXME: Add dependencies if this package requires them. - # depends_on("foo") - def install(self, spec, prefix): - # FIXME: Modify the configure line to suit your build system here. configure("--prefix=%s" % prefix) - - # FIXME: Add logic to build and install here make() make("install") diff --git a/var/spack/packages/gnutls/package.py b/var/spack/packages/gnutls/package.py new file mode 100644 index 0000000000..cf57a24a6d --- /dev/null +++ b/var/spack/packages/gnutls/package.py @@ -0,0 +1,22 @@ +from spack import * + +class Gnutls(Package): + """GnuTLS is a secure communications library implementing the SSL, + TLS and DTLS protocols and technologies around them. It + provides a simple C language application programming interface + (API) to access the secure communications protocols as well as + APIs to parse and write X.509, PKCS #12, OpenPGP and other + required structures. It is aimed to be portable and efficient + with focus on security and interoperability.""" + + homepage = "http://www.gnutls.org" + url = "ftp://ftp.gnutls.org/gcrypt/gnutls/v3.3/gnutls-3.3.9.tar.xz" + + version('3.3.9', 'ff61b77e39d09f1140ab5a9cf52c58b6') + + depends_on("nettle") + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") diff --git a/var/spack/packages/nettle/package.py b/var/spack/packages/nettle/package.py new file mode 100644 index 0000000000..0f20bc06df --- /dev/null +++ b/var/spack/packages/nettle/package.py @@ -0,0 +1,15 @@ +from spack import * + +class Nettle(Package): + """The Nettle package contains the low-level cryptographic library + that is designed to fit easily in many contexts.""" + + homepage = "http://www.example.com" + url = "http://ftp.gnu.org/gnu/nettle/nettle-2.7.1.tar.gz" + + version('2.7', '2caa1bd667c35db71becb93c5d89737f') + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") diff --git a/var/spack/packages/qt/package.py b/var/spack/packages/qt/package.py index aae9367a1b..fe0d4531c1 100644 --- a/var/spack/packages/qt/package.py +++ b/var/spack/packages/qt/package.py @@ -5,7 +5,7 @@ class Qt(Package): homepage = "http://qt.io" version('4.8.6', '2edbe4d6c2eff33ef91732602f3518eb', - "http://download.qt-project.org/official_releases/qt/4.8/4.8.6/qt-everywhere-opensource-src-4.8.6.tar.gz") + url="http://download.qt-project.org/official_releases/qt/4.8/4.8.6/qt-everywhere-opensource-src-4.8.6.tar.gz") # depends_on("zlib") diff --git a/var/spack/packages/wget/package.py b/var/spack/packages/wget/package.py new file mode 100644 index 0000000000..c8fd025122 --- /dev/null +++ b/var/spack/packages/wget/package.py @@ -0,0 +1,21 @@ +from spack import * + +class Wget(Package): + """GNU Wget is a free software package for retrieving files using + HTTP, HTTPS and FTP, the most widely-used Internet protocols. It + is a non-interactive commandline tool, so it may easily be called + from scripts, cron jobs, terminals without X-Windows support, + etc.""" + + homepage = "http://www.gnu.org/software/wget/" + url = "http://ftp.gnu.org/gnu/wget/wget-1.16.tar.xz" + + version('1.16', 'fe102975ab3a6c049777883f1bb9ad07') + + depends_on("openssl") + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix, + "--with-ssl=openssl") + make() + make("install") -- cgit v1.2.3-70-g09d2 From 01ca61c7cce510f7f80912f5b01bd69043de7008 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Mon, 22 Dec 2014 23:23:11 -0800 Subject: Updates for Qt dependencies --- var/spack/packages/ImageMagick/package.py | 1 + var/spack/packages/jpeg/package.py | 2 +- var/spack/packages/lcms/package.py | 19 +++++++++++++++++++ var/spack/packages/libmng/package.py | 19 +++++++++++++++++++ var/spack/packages/qt/package.py | 2 +- 5 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 var/spack/packages/lcms/package.py create mode 100644 var/spack/packages/libmng/package.py (limited to 'var') diff --git a/var/spack/packages/ImageMagick/package.py b/var/spack/packages/ImageMagick/package.py index ae06368f85..657b9255a3 100644 --- a/var/spack/packages/ImageMagick/package.py +++ b/var/spack/packages/ImageMagick/package.py @@ -5,6 +5,7 @@ class Imagemagick(Package): homepage = "http://www.imagemagic.org" url = "http://www.imagemagick.org/download/ImageMagick-6.8.9-10.tar.gz" + version('6.9.0-0', '2cf094cb86ec518fa5bc669ce2d21613') version('6.8.9-10', 'aa050bf9785e571c956c111377bbf57c') version('6.8.9-9', 'e63fed3e3550851328352c708f800676') diff --git a/var/spack/packages/jpeg/package.py b/var/spack/packages/jpeg/package.py index bb5b77e01c..87820467db 100644 --- a/var/spack/packages/jpeg/package.py +++ b/var/spack/packages/jpeg/package.py @@ -5,7 +5,7 @@ class Jpeg(Package): homepage = "http://www.ijg.org" url = "http://www.ijg.org/files/jpegsrc.v9a.tar.gz" - version('9a', 'b397211ddfd506b92cd5e02a22ac924d') + version('9a', '3353992aecaee1805ef4109aadd433e7') def install(self, spec, prefix): configure("--prefix=%s" % prefix) diff --git a/var/spack/packages/lcms/package.py b/var/spack/packages/lcms/package.py new file mode 100644 index 0000000000..a53c2f997a --- /dev/null +++ b/var/spack/packages/lcms/package.py @@ -0,0 +1,19 @@ +from spack import * + +class Lcms(Package): + """Little cms is a color management library. Implements fast + transforms between ICC profiles. It is focused on speed, and is + portable across several platforms (MIT license).""" + homepage = "http://www.littlecms.com" + url = "http://downloads.sourceforge.net/project/lcms/lcms/2.6/lcms2-2.6.tar.gz" + + version('2.6', 'f4c08d38ceade4a664ebff7228910a33') + + depends_on("jpeg") + depends_on("libtiff") + depends_on("zlib") + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") diff --git a/var/spack/packages/libmng/package.py b/var/spack/packages/libmng/package.py new file mode 100644 index 0000000000..11d060496c --- /dev/null +++ b/var/spack/packages/libmng/package.py @@ -0,0 +1,19 @@ +from spack import * + +class Libmng(Package): + """libmng -THE reference library for reading, displaying, writing + and examining Multiple-Image Network Graphics. MNG is the animation + extension to the popular PNG image-format.""" + homepage = "http://sourceforge.net/projects/libmng/" + url = "http://downloads.sourceforge.net/project/libmng/libmng-devel/2.0.2/libmng-2.0.2.tar.gz" + + version('2.0.2', '1ffefaed4aac98475ee6267422cbca55') + + depends_on("jpeg") + depends_on("zlib") + depends_on("lcms") + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") diff --git a/var/spack/packages/qt/package.py b/var/spack/packages/qt/package.py index fe0d4531c1..270a28bf0a 100644 --- a/var/spack/packages/qt/package.py +++ b/var/spack/packages/qt/package.py @@ -7,7 +7,7 @@ class Qt(Package): version('4.8.6', '2edbe4d6c2eff33ef91732602f3518eb', url="http://download.qt-project.org/official_releases/qt/4.8/4.8.6/qt-everywhere-opensource-src-4.8.6.tar.gz") - # depends_on("zlib") + depends_on("lcms") def install(self, spec, prefix): # FIXME: Modify the configure line to suit your build system here. -- cgit v1.2.3-70-g09d2 From d98e475361acdadb3b734fd2dbf97ec603f9b7e8 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Thu, 25 Dec 2014 16:09:42 -0800 Subject: Qt4 builds successfully with proper RPATHs. --- var/spack/packages/atk/package.py | 18 +++++++++++++++ var/spack/packages/cairo/package.py | 19 +++++++++++++++ var/spack/packages/gdk-pixbuf/package.py | 22 ++++++++++++++++++ var/spack/packages/glib/package.py | 18 +++++++++++++++ var/spack/packages/gtkplus/package.py | 22 ++++++++++++++++++ var/spack/packages/harfbuzz/package.py | 20 ++++++++++++++++ var/spack/packages/icu/package.py | 25 ++++++++++++++++++++ var/spack/packages/libjpeg-turbo/package.py | 20 ++++++++++++++++ var/spack/packages/libmng/package.py | 4 ++++ var/spack/packages/libtiff/package.py | 2 ++ var/spack/packages/libxml2/package.py | 16 +++++++++++++ var/spack/packages/nasm/package.py | 14 +++++++++++ var/spack/packages/pango/package.py | 19 +++++++++++++++ var/spack/packages/pixman/package.py | 18 +++++++++++++++ var/spack/packages/qt/package.py | 36 +++++++++++++++++++++++++---- var/spack/packages/xz/package.py | 16 +++++++++++++ var/spack/packages/yasm/package.py | 16 +++++++++++++ 17 files changed, 300 insertions(+), 5 deletions(-) create mode 100644 var/spack/packages/atk/package.py create mode 100644 var/spack/packages/cairo/package.py create mode 100644 var/spack/packages/gdk-pixbuf/package.py create mode 100644 var/spack/packages/glib/package.py create mode 100644 var/spack/packages/gtkplus/package.py create mode 100644 var/spack/packages/harfbuzz/package.py create mode 100644 var/spack/packages/icu/package.py create mode 100644 var/spack/packages/libjpeg-turbo/package.py create mode 100644 var/spack/packages/libxml2/package.py create mode 100644 var/spack/packages/nasm/package.py create mode 100644 var/spack/packages/pango/package.py create mode 100644 var/spack/packages/pixman/package.py create mode 100644 var/spack/packages/xz/package.py create mode 100644 var/spack/packages/yasm/package.py (limited to 'var') diff --git a/var/spack/packages/atk/package.py b/var/spack/packages/atk/package.py new file mode 100644 index 0000000000..769805b227 --- /dev/null +++ b/var/spack/packages/atk/package.py @@ -0,0 +1,18 @@ +from spack import * + +class Atk(Package): + """ATK provides the set of accessibility interfaces that are + implemented by other toolkits and applications. Using the ATK + interfaces, accessibility tools have full access to view and + control running applications.""" + homepage = "https://developer.gnome.org/atk/" + url = "http://ftp.gnome.org/pub/gnome/sources/atk/2.14/atk-2.14.0.tar.xz" + + version('2.14.0', 'ecb7ca8469a5650581b1227d78051b8b') + + depends_on("glib") + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") diff --git a/var/spack/packages/cairo/package.py b/var/spack/packages/cairo/package.py new file mode 100644 index 0000000000..e1ac8aaa7d --- /dev/null +++ b/var/spack/packages/cairo/package.py @@ -0,0 +1,19 @@ +from spack import * + +class Cairo(Package): + """Cairo is a 2D graphics library with support for multiple output devices.""" + homepage = "http://cairographics.org" + url = "http://cairographics.org/releases/cairo-1.14.0.tar.xz" + + version('1.14.0', 'fc3a5edeba703f906f2241b394f0cced') + + depends_on("libpng") + depends_on("glib") + depends_on("pixman") + depends_on("fontconfig@2.10.91:") # Require newer version of fontconfig. + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix, + "--enable-tee") + make() + make("install") diff --git a/var/spack/packages/gdk-pixbuf/package.py b/var/spack/packages/gdk-pixbuf/package.py new file mode 100644 index 0000000000..14a5569984 --- /dev/null +++ b/var/spack/packages/gdk-pixbuf/package.py @@ -0,0 +1,22 @@ +from spack import * + +class GdkPixbuf(Package): + """The Gdk Pixbuf is a toolkit for image loading and pixel buffer + manipulation. It is used by GTK+ 2 and GTK+ 3 to load and + manipulate images. In the past it was distributed as part of + GTK+ 2 but it was split off into a separate package in + preparation for the change to GTK+ 3.""" + homepage = "https://developer.gnome.org/gdk-pixbuf/" + url = "http://ftp.gnome.org/pub/gnome/sources/gdk-pixbuf/2.31/gdk-pixbuf-2.31.1.tar.xz" + + version('2.31.2', '6be6bbc4f356d4b79ab4226860ab8523') + + depends_on("glib") + depends_on("jpeg") + depends_on("libpng") + depends_on("libtiff") + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") diff --git a/var/spack/packages/glib/package.py b/var/spack/packages/glib/package.py new file mode 100644 index 0000000000..178f0b9df5 --- /dev/null +++ b/var/spack/packages/glib/package.py @@ -0,0 +1,18 @@ +from spack import * + +class Glib(Package): + """The GLib package contains a low-level libraries useful for + providing data structure handling for C, portability wrappers + and interfaces for such runtime functionality as an event loop, + threads, dynamic loading and an object system.""" + homepage = "https://developer.gnome.org/glib/" + url = "http://ftp.gnome.org/pub/gnome/sources/glib/2.42/glib-2.42.1.tar.xz" + + version('2.42.1', '89c4119e50e767d3532158605ee9121a') + + depends_on("libffi") + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") diff --git a/var/spack/packages/gtkplus/package.py b/var/spack/packages/gtkplus/package.py new file mode 100644 index 0000000000..0ebc7100de --- /dev/null +++ b/var/spack/packages/gtkplus/package.py @@ -0,0 +1,22 @@ +from spack import * + +class Gtkplus(Package): + """The GTK+ 2 package contains libraries used for creating graphical user interfaces for applications.""" + homepage = "http://www.gtk.org" + + version('2.24.25', '612350704dd3aacb95355a4981930c6f', + url="http://ftp.gnome.org/pub/gnome/sources/gtk+/2.24/gtk+-2.24.25.tar.xz") + + depends_on("atk") + depends_on("gdk-pixbuf") + depends_on("pango") + + def patch(self): + # remove disable deprecated flag. + filter_file(r'CFLAGS="-DGDK_PIXBUF_DISABLE_DEPRECATED $CFLAGS"', + '', 'configure', string=True) + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") diff --git a/var/spack/packages/harfbuzz/package.py b/var/spack/packages/harfbuzz/package.py new file mode 100644 index 0000000000..ed7c42a909 --- /dev/null +++ b/var/spack/packages/harfbuzz/package.py @@ -0,0 +1,20 @@ +from spack import * + +class Harfbuzz(Package): + """The Harfbuzz package contains an OpenType text shaping engine.""" + homepage = "http://www.freedesktop.org/wiki/Software/HarfBuzz/" + url = "http://www.freedesktop.org/software/harfbuzz/release/harfbuzz-0.9.37.tar.bz2" + + version('0.9.37', 'bfe733250e34629a188d82e3b971bc1e') + + depends_on("glib") + depends_on("icu") + depends_on("freetype") + + def patch(self): + change_sed_delimiter('@', ';', 'src/Makefile.in') + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") diff --git a/var/spack/packages/icu/package.py b/var/spack/packages/icu/package.py new file mode 100644 index 0000000000..f256ec5712 --- /dev/null +++ b/var/spack/packages/icu/package.py @@ -0,0 +1,25 @@ +from spack import * + +class Icu(Package): + """The International Components for Unicode (ICU) package is a + mature, widely used set of C/C++ libraries providing Unicode and + Globalization support for software applications. ICU is widely + portable and gives applications the same results on all + platforms.""" + # FIXME: add a proper url for your package's homepage here. + homepage = "http://www.example.com" + url = "http://download.icu-project.org/files/icu4c/54.1/icu4c-54_1-src.tgz" + + version('54.1', 'e844caed8f2ca24c088505b0d6271bc0') + + + def url_for_version(self, version): + return "http://download.icu-project.org/files/icu4c/%s/icu4c-%s-src.tgz" % ( + version, str(version).replace('.', '_')) + + + def install(self, spec, prefix): + with working_dir("source"): + configure("--prefix=%s" % prefix) + make() + make("install") diff --git a/var/spack/packages/libjpeg-turbo/package.py b/var/spack/packages/libjpeg-turbo/package.py new file mode 100644 index 0000000000..07ee183947 --- /dev/null +++ b/var/spack/packages/libjpeg-turbo/package.py @@ -0,0 +1,20 @@ +from spack import * + +class LibjpegTurbo(Package): + """libjpeg-turbo is a fork of the original IJG libjpeg which uses + SIMD to accelerate baseline JPEG compression and + decompression. libjpeg is a library that implements JPEG image + encoding, decoding and transcoding.""" + homepage = "http://libjpeg-turbo.virtualgl.org" + url = "http://downloads.sourceforge.net/libjpeg-turbo/libjpeg-turbo-1.3.1.tar.gz" + + version('1.3.1', '2c3a68129dac443a72815ff5bb374b05') + + # Can use either of these. + depends_on("yasm") + depends_on("nasm") + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") diff --git a/var/spack/packages/libmng/package.py b/var/spack/packages/libmng/package.py index 11d060496c..e5336ea2c2 100644 --- a/var/spack/packages/libmng/package.py +++ b/var/spack/packages/libmng/package.py @@ -13,6 +13,10 @@ class Libmng(Package): depends_on("zlib") depends_on("lcms") + def patch(self): + # jpeg requires stdio to beincluded before its headrs. + filter_file(r'^(\#include \)', '#include\n\\1', 'libmng_types.h') + def install(self, spec, prefix): configure("--prefix=%s" % prefix) make() diff --git a/var/spack/packages/libtiff/package.py b/var/spack/packages/libtiff/package.py index ec54cf7adf..63c6704cb8 100644 --- a/var/spack/packages/libtiff/package.py +++ b/var/spack/packages/libtiff/package.py @@ -8,6 +8,8 @@ class Libtiff(Package): version('4.0.3', '051c1068e6a0627f461948c365290410') depends_on('jpeg') + depends_on('zlib') + depends_on('xz') def install(self, spec, prefix): configure("--prefix=%s" % prefix) diff --git a/var/spack/packages/libxml2/package.py b/var/spack/packages/libxml2/package.py new file mode 100644 index 0000000000..5eaed36d94 --- /dev/null +++ b/var/spack/packages/libxml2/package.py @@ -0,0 +1,16 @@ +from spack import * + +class Libxml2(Package): + """Libxml2 is the XML C parser and toolkit developed for the Gnome + project (but usable outside of the Gnome platform), it is free + software available under the MIT License.""" + homepage = "http://xmlsoft.org" + url = "http://xmlsoft.org/sources/libxml2-2.9.2.tar.gz" + + version('2.9.2', '9e6a9aca9d155737868b3dc5fd82f788') + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix, + "--without-python") + make() + make("install") diff --git a/var/spack/packages/nasm/package.py b/var/spack/packages/nasm/package.py new file mode 100644 index 0000000000..933b6a62c5 --- /dev/null +++ b/var/spack/packages/nasm/package.py @@ -0,0 +1,14 @@ +from spack import * + +class Nasm(Package): + """NASM (Netwide Assembler) is an 80x86 assembler designed for + portability and modularity. It includes a disassembler as well.""" + homepage = "http://www.nasm.us" + url = "http://www.nasm.us/pub/nasm/releasebuilds/2.11.06/nasm-2.11.06.tar.xz" + + version('2.11.06', '2b958e9f5d200641e6fc9564977aecc5') + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") diff --git a/var/spack/packages/pango/package.py b/var/spack/packages/pango/package.py new file mode 100644 index 0000000000..df43625bf5 --- /dev/null +++ b/var/spack/packages/pango/package.py @@ -0,0 +1,19 @@ +from spack import * + +class Pango(Package): + """Pango is a library for laying out and rendering of text, with + an emphasis on internationalization. It can be used anywhere + that text layout is needed, though most of the work on Pango so + far has been done in the context of the GTK+ widget toolkit.""" + homepage = "http://www.pango.org" + url = "http://ftp.gnome.org/pub/gnome/sources/pango/1.36/pango-1.36.8.tar.xz" + + version('1.36.8', '217a9a753006275215fa9fa127760ece') + + depends_on("harfbuzz") + depends_on("cairo") + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") diff --git a/var/spack/packages/pixman/package.py b/var/spack/packages/pixman/package.py new file mode 100644 index 0000000000..895cbdbca5 --- /dev/null +++ b/var/spack/packages/pixman/package.py @@ -0,0 +1,18 @@ +from spack import * + +class Pixman(Package): + """The Pixman package contains a library that provides low-level + pixel manipulation features such as image compositing and + trapezoid rasterization.""" + homepage = "http://www.pixman.org" + url = "http://cairographics.org/releases/pixman-0.32.6.tar.gz" + + version('0.32.6', '3a30859719a41bd0f5cccffbfefdd4c2') + + depends_on("libpng") + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix, + "--disable-gtk") + make() + make("install") diff --git a/var/spack/packages/qt/package.py b/var/spack/packages/qt/package.py index 270a28bf0a..01f9de7f3c 100644 --- a/var/spack/packages/qt/package.py +++ b/var/spack/packages/qt/package.py @@ -7,12 +7,38 @@ class Qt(Package): version('4.8.6', '2edbe4d6c2eff33ef91732602f3518eb', url="http://download.qt-project.org/official_releases/qt/4.8/4.8.6/qt-everywhere-opensource-src-4.8.6.tar.gz") - depends_on("lcms") + # Use system openssl for security. + #depends_on("openssl") - def install(self, spec, prefix): - # FIXME: Modify the configure line to suit your build system here. - configure("--prefix=%s" % prefix) + depends_on("glib") + depends_on("gtkplus") + depends_on("libxml2") + depends_on("zlib") + depends_on("dbus") + depends_on("libtiff") + depends_on("libpng") + depends_on("libmng") + depends_on("jpeg") + + def patch(self): + # Fix qmake compilers in the default mkspec + qmake_conf = 'mkspecs/common/g++-base.conf' + filter_file(r'^QMAKE_CC *=.*$', 'QMAKE_CC = cc', qmake_conf) + filter_file(r'^QMAKE_CXX *=.*$', 'QMAKE_CXX = c++', qmake_conf) - # FIXME: Add logic to build and install here + + def install(self, spec, prefix): + configure('-v', + '-confirm-license', + '-opensource', + '-prefix', prefix, + '-openssl-linked', + '-dbus-linked', + '-fast', + '-optimized-qmake', + '-no-pch', + '-no-phonon', + '-no-phonon-backend', + '-no-openvg') make() make("install") diff --git a/var/spack/packages/xz/package.py b/var/spack/packages/xz/package.py new file mode 100644 index 0000000000..88c5793018 --- /dev/null +++ b/var/spack/packages/xz/package.py @@ -0,0 +1,16 @@ +from spack import * + +class Xz(Package): + """XZ Utils is free general-purpose data compression software with + high compression ratio. XZ Utils were written for POSIX-like + systems, but also work on some not-so-POSIX systems. XZ Utils are + the successor to LZMA Utils.""" + homepage = "http://tukaani.org/xz/" + url = "http://tukaani.org/xz/xz-5.2.0.tar.bz2" + + version('5.2.0', '867cc8611760240ebf3440bd6e170bb9') + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") diff --git a/var/spack/packages/yasm/package.py b/var/spack/packages/yasm/package.py new file mode 100644 index 0000000000..d3a695b16d --- /dev/null +++ b/var/spack/packages/yasm/package.py @@ -0,0 +1,16 @@ +from spack import * + +class Yasm(Package): + """Yasm is a complete rewrite of the NASM-2.11.06 assembler. It + supports the x86 and AMD64 instruction sets, accepts NASM and + GAS assembler syntaxes and outputs binary, ELF32 and ELF64 + object formats.""" + homepage = "http://yasm.tortall.net" + url = "http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz" + + version('1.3.0', 'fc9e586751ff789b34b1f21d572d96af') + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") -- cgit v1.2.3-70-g09d2 From 0bc861db6e8edf470c91be81e60546b0619216de Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Thu, 25 Dec 2014 17:55:19 -0800 Subject: Fix up bzip2 install --- lib/spack/llnl/util/filesystem.py | 8 ++++++++ lib/spack/spack/build_environment.py | 1 + var/spack/packages/bzip2/package.py | 17 ++++++++++++++++- 3 files changed, 25 insertions(+), 1 deletion(-) (limited to 'var') diff --git a/lib/spack/llnl/util/filesystem.py b/lib/spack/llnl/util/filesystem.py index 24c77a80db..9f08832598 100644 --- a/lib/spack/llnl/util/filesystem.py +++ b/lib/spack/llnl/util/filesystem.py @@ -30,6 +30,7 @@ import os import sys import re import shutil +import stat import errno import getpass from contextlib import contextmanager, closing @@ -145,6 +146,13 @@ def install(src, dest): shutil.copy(src, dest) set_install_permissions(dest) + src_mode = os.stat(src).st_mode + dest_mode = os.stat(dest).st_mode + if src_mode | stat.S_IXUSR: dest_mode |= stat.S_IXUSR + if src_mode | stat.S_IXGRP: dest_mode |= stat.S_IXGRP + if src_mode | stat.S_IXOTH: dest_mode |= stat.S_IXOTH + os.chmod(dest, dest_mode) + def expand_user(path): """Find instances of '%u' in a path and replace with the current user's diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py index 87cfa772ca..45353ec640 100644 --- a/lib/spack/spack/build_environment.py +++ b/lib/spack/spack/build_environment.py @@ -190,6 +190,7 @@ def set_module_variables_for_package(pkg): m.makedirs = os.makedirs m.remove = os.remove m.removedirs = os.removedirs + m.symlink = os.symlink m.mkdirp = mkdirp m.install = install diff --git a/var/spack/packages/bzip2/package.py b/var/spack/packages/bzip2/package.py index 83ae88e564..fbd5869a53 100644 --- a/var/spack/packages/bzip2/package.py +++ b/var/spack/packages/bzip2/package.py @@ -1,4 +1,5 @@ from spack import * +from glob import glob class Bzip2(Package): """bzip2 is a freely available, patent free high-quality data @@ -15,5 +16,19 @@ class Bzip2(Package): # No configure system -- have to filter the makefile for this package. filter_file(r'CC=gcc', 'CC=cc', 'Makefile', string=True) - make() + make('-f', 'Makefile-libbz2_so') + make('clean') make("install", "PREFIX=%s" % prefix) + + bzip2_exe = join_path(prefix.bin, 'bzip2') + install('bzip2-shared', bzip2_exe) + for libfile in glob('libbz2.so*'): + install(libfile, prefix.lib) + + bunzip2 = join_path(prefix.bin, 'bunzip2') + remove(bunzip2) + symlink(bzip2_exe, bunzip2) + + bzcat = join_path(prefix.bin, 'bzcat') + remove(bzcat) + symlink(bzip2_exe, bzcat) -- cgit v1.2.3-70-g09d2 From b0ce1b81bae627cc9d3e7853683be60b0f47dbed Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Thu, 25 Dec 2014 18:42:03 -0800 Subject: Fix SPINDLE and SCR download URLs. --- var/spack/packages/scr/package.py | 2 +- var/spack/packages/spindle/package.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'var') diff --git a/var/spack/packages/scr/package.py b/var/spack/packages/scr/package.py index d456ecaba0..74b75a8742 100644 --- a/var/spack/packages/scr/package.py +++ b/var/spack/packages/scr/package.py @@ -28,7 +28,7 @@ class Scr(Package): """SCR caches checkpoint data in storage on the compute nodes of a Linux cluster to provide a fast, scalable checkpoint/restart capability for MPI codes""" - homepage = "https://computation-rnd.llnl.gov/scr" + homepage = "https://computation.llnl.gov/project/scr/" url = "http://downloads.sourceforge.net/project/scalablecr/releases/scr-1.1-7.tar.gz" depends_on("mpi") diff --git a/var/spack/packages/spindle/package.py b/var/spack/packages/spindle/package.py index fd59282ebb..06a1e14284 100644 --- a/var/spack/packages/spindle/package.py +++ b/var/spack/packages/spindle/package.py @@ -30,7 +30,7 @@ class Spindle(Package): overload on a shared file system when loading dynamically linked libraries, causing site-wide performance problems. """ - homepage = "https://computation-rnd.llnl.gov/spindle" + homepage = "https://computation.llnl.gov/project/spindle/" url = "https://github.com/hpc/Spindle/archive/v0.8.1.tar.gz" list_url = "https://github.com/hpc/Spindle/releases" -- cgit v1.2.3-70-g09d2 From 9dabcc870385de329b9fcb6986d5d6688fa7dca8 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Fri, 26 Dec 2014 00:07:15 -0800 Subject: Git package. --- var/spack/packages/git/package.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 var/spack/packages/git/package.py (limited to 'var') diff --git a/var/spack/packages/git/package.py b/var/spack/packages/git/package.py new file mode 100644 index 0000000000..0f1a3ba05b --- /dev/null +++ b/var/spack/packages/git/package.py @@ -0,0 +1,27 @@ +from spack import * + +class Git(Package): + """Git is a free and open source distributed version control + system designed to handle everything from small to very large + projects with speed and efficiency.""" + homepage = "http://git-scm.com" + url = "https://www.kernel.org/pub/software/scm/git/git-2.2.1.tar.xz" + + version('2.2.1', '43e01f9d96ba8c11611e0eef0d9f9f28') + + # Use system openssl. + # depends_on("openssl") + + # Use system perl for now. + # depends_on("perl") + # depends_on("pcre") + + depends_on("zlib") + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix, + "--without-pcre", + "--without-python") + + make() + make("install") -- cgit v1.2.3-70-g09d2 From cd9e4b5b7f1aa13b846e48fbc07a7f847a21f46a Mon Sep 17 00:00:00 2001 From: Justin Too Date: Tue, 6 Jan 2015 11:12:02 -0800 Subject: (Package) Add Oracle JDK package --- var/spack/packages/jdk/package.py | 46 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 var/spack/packages/jdk/package.py (limited to 'var') diff --git a/var/spack/packages/jdk/package.py b/var/spack/packages/jdk/package.py new file mode 100644 index 0000000000..8f8076dd14 --- /dev/null +++ b/var/spack/packages/jdk/package.py @@ -0,0 +1,46 @@ +#------------------------------------------------------------------------------ +# Author: Justin Too +#------------------------------------------------------------------------------ +import distutils +from distutils import dir_util +from subprocess import call + +import spack +from spack import * +import llnl.util.tty as tty + +class Jdk(Package): + """The Java Development Kit (JDK) released by Oracle Corporation + in the form of a binary product aimed at Java developers.""" + homepage = "http://www.oracle.com/technetwork/java/javase/downloads/index.html" + + version('8u25-linux-x64', 'e145c03a7edc845215092786bcfba77e', + url="http://download.oracle.com/otn-pub/java/jdk/8u25-b17/jdk-8u25-linux-x64.tar.gz") + + # Oracle requires that you accept their License Agreement in order + # to access the Java packages in download.oracle.com. In order to + # automate this process, we need to utilize these additional curl + # commandline options. + # + # See http://stackoverflow.com/questions/10268583/how-to-automate-download-and-installation-of-java-jdk-on-linux + curl_options=[ + '-j', # junk cookies + '-H', # specify required License Agreement cookie + 'Cookie: oraclelicense=accept-securebackup-cookie'] + + def do_fetch(self): + # Add our custom curl commandline options + tty.msg( + "[Jdk] Adding required commandline options to curl " + + "before performing fetch: %s" % + (self.curl_options)) + + for option in self.curl_options: + spack.curl.add_default_arg(option) + + # Now perform the actual fetch + super(Jdk, self).do_fetch() + + + def install(self, spec, prefix): + distutils.dir_util.copy_tree(".", prefix) -- cgit v1.2.3-70-g09d2 From 3a07ec6c7d28bb38979209d1d32ebf1742a9e570 Mon Sep 17 00:00:00 2001 From: Justin Too Date: Tue, 6 Jan 2015 15:43:32 -0800 Subject: (Package) Add ROSE compiler package --- .../rose/add_spack_compiler_recognition.patch | 13 ++++++++ var/spack/packages/rose/package.py | 39 ++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 var/spack/packages/rose/add_spack_compiler_recognition.patch create mode 100644 var/spack/packages/rose/package.py (limited to 'var') diff --git a/var/spack/packages/rose/add_spack_compiler_recognition.patch b/var/spack/packages/rose/add_spack_compiler_recognition.patch new file mode 100644 index 0000000000..ce61ae4e4c --- /dev/null +++ b/var/spack/packages/rose/add_spack_compiler_recognition.patch @@ -0,0 +1,13 @@ +diff --git a/config/compiler-defs.m4 b/config/compiler-defs.m4 +index d7d85d2..780c8de 100644 +--- a/config/compiler-defs.m4 ++++ b/config/compiler-defs.m4 +@@ -28,7 +28,7 @@ dnl predefined by a specific compiler + # g++|gcc|mpicc|mpic++|mpicxx|mpiCC) + # TOO (2/16/2011): added support for tensilica compilers, assuming they are + # like GCC (they use a GCC front-end) +- g++*|gcc*|mpicc|mpic++|mpicxx|mpiCC|xt-xc++|xt-xcc) ++ cc*|c++*|g++*|gcc*|mpicc|mpic++|mpicxx|mpiCC|xt-xc++|xt-xcc) + BACKEND_GCC_MAJOR=`echo|$BACKEND_CXX_COMPILER -dumpversion | cut -d\. -f1` + BACKEND_GCC_MINOR=`echo|$BACKEND_CXX_COMPILER -dumpversion | cut -d\. -f2` + BACKEND_GCC_PATCHLEVEL=`echo|$BACKEND_CXX_COMPILER -dumpversion | cut -d\. -f3` diff --git a/var/spack/packages/rose/package.py b/var/spack/packages/rose/package.py new file mode 100644 index 0000000000..1d7294acab --- /dev/null +++ b/var/spack/packages/rose/package.py @@ -0,0 +1,39 @@ +#------------------------------------------------------------------------------ +# Author: Justin Too +#------------------------------------------------------------------------------ + +from spack import * + +class Rose(Package): + """A compiler infrastructure to build source-to-source program + transformation and analysis tools. + (Developed at Lawrence Livermore National Lab)""" + + homepage = "http://rosecompiler.org/" + url = "https://github.com/rose-compiler/edg4x-rose" + + version('master', branch='master', git='https://github.com/rose-compiler/edg4x-rose.git') + + patch('add_spack_compiler_recognition.patch') + + depends_on("autoconf@2.69") + depends_on("automake@1.14") + depends_on("libtool@2.4") + depends_on("boost@1.54.0") + depends_on("jdk@8u25-linux-x64") + + def install(self, spec, prefix): + # Bootstrap with autotools + bash = which('bash') + bash('build') + + # Configure, compile & install + with working_dir('rose-build', create=True): + boost = spec['boost'] + + configure = Executable('../configure') + configure("--prefix=" + prefix, + "--with-boost=" + boost.prefix, + "--disable-boost-version-check") + make("install-core") + -- cgit v1.2.3-70-g09d2 From 844c0838487529c0f2edc6f09e6ef86f12364716 Mon Sep 17 00:00:00 2001 From: Luc Jaulmes Date: Mon, 12 Jan 2015 20:38:32 +0100 Subject: Updated versions in OmpSs and Extrae, which resolves version-dependency problems with MPI --- var/spack/packages/extrae/package.py | 30 +++++++++++++++--------------- var/spack/packages/ompss/package.py | 5 +++-- 2 files changed, 18 insertions(+), 17 deletions(-) (limited to 'var') diff --git a/var/spack/packages/extrae/package.py b/var/spack/packages/extrae/package.py index b1a3a3e440..3ad4cbaf86 100644 --- a/var/spack/packages/extrae/package.py +++ b/var/spack/packages/extrae/package.py @@ -1,5 +1,8 @@ from spack import * +# typical working line with extrae 3.0.1 +# ./configure --prefix=/usr/local --with-mpi=/usr/lib64/mpi/gcc/openmpi --with-unwind=/usr/local --with-papi=/usr --with-dwarf=/usr --with-elf=/usr --with-dyninst=/usr --with-binutils=/usr --with-xml-prefix=/usr --enable-openmp --enable-nanos --enable-pthread --disable-parallel-merge LDFLAGS=-pthread + class Extrae(Package): """Extrae is the package devoted to generate tracefiles which can be analyzed later by Paraver. Extrae is a tool that uses @@ -10,11 +13,10 @@ class Extrae(Package): programming models either alone or in conjunction with MPI : OpenMP, CUDA, OpenCL, pthread, OmpSs""" homepage = "http://www.bsc.es/computer-sciences/extrae" - url = "http://www.bsc.es/ssl/apps/performanceTools/files/extrae-2.5.1.tar.bz2" - version('2.5.1', '422376b9c68243bd36a8a73fa62de106') + url = "http://www.bsc.es/ssl/apps/performanceTools/files/extrae-3.0.1.tar.bz2" + version('3.0.1', 'a6a8ca96cd877723cd8cc5df6bdb922b') - #depends_on("mpi") - depends_on("openmpi@:1.6") + depends_on("mpi") depends_on("dyninst") depends_on("libunwind") depends_on("boost") @@ -24,22 +26,20 @@ class Extrae(Package): def install(self, spec, prefix): if 'openmpi' in spec: mpi = spec['openmpi'] - #if spec.satisfies('@2.5.1') and spec.satisfies('^openmpi@1.6.5'): - # tty.error("Some headers conflict when using OpenMPI 1.6.5. Please use 1.6 instead.") elif 'mpich' in spec: mpi = spec['mpich'] elif 'mvapich2' in spec: mpi = spec['mvapich2'] - configure("--prefix=%s" % prefix, - "--with-mpi=%s" % mpi.prefix, - "--with-unwind=%s" % spec['libunwind'].prefix, - "--with-dyninst=%s" % spec['dyninst'].prefix, - "--with-boost=%s" % spec['boost'].prefix, - "--with-dwarf=%s" % spec['libdwarf'].prefix, - "--with-papi=%s" % spec['papi'].prefix, - "--with-dyninst-headers=%s" % spec['dyninst'].prefix.include, - "--with-dyninst-libs=%s" % spec['dyninst'].prefix.lib) + configure("--prefix=%s" % prefix, + "--with-mpi=%s" % mpi.prefix, + "--with-unwind=%s" % spec['libunwind'].prefix, + "--with-dyninst=%s" % spec['dyninst'].prefix, + "--with-boost=%s" % spec['boost'].prefix, + "--with-dwarf=%s" % spec['libdwarf'].prefix, + "--with-papi=%s" % spec['papi'].prefix, + "--with-dyninst-headers=%s" % spec['dyninst'].prefix.include, + "--with-dyninst-libs=%s" % spec['dyninst'].prefix.lib) make() make("install", parallel=False) diff --git a/var/spack/packages/ompss/package.py b/var/spack/packages/ompss/package.py index 544671de38..d529058036 100644 --- a/var/spack/packages/ompss/package.py +++ b/var/spack/packages/ompss/package.py @@ -16,8 +16,9 @@ class Ompss(Package): APIs like CUDA or OpenCL. Our OmpSs environment is built on top of our Mercurium compiler and Nanos++ runtime system.""" homepage = "http://pm.bsc.es/" - url = "http://pm.bsc.es/sites/default/files/ftp/ompss/releases/ompss-14.06.tar.gz" - version('14.06', '99be5dce74c0d7eea42636d26af47b4181ae2e11') + url = "http://pm.bsc.es/sites/default/files/ftp/ompss/releases/ompss-14.10.tar.gz" + version('14.10', '404d161265748f2f96bb35fd8c7e79ee') + # all dependencies are optional, really depends_on("mpi") -- cgit v1.2.3-70-g09d2 From 917d82be0de261d3d211960749f0dba469253edf Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Tue, 13 Jan 2015 00:45:12 -0800 Subject: Add list_url for ompss --- var/spack/packages/ompss/package.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'var') diff --git a/var/spack/packages/ompss/package.py b/var/spack/packages/ompss/package.py index d529058036..e09e0a624f 100644 --- a/var/spack/packages/ompss/package.py +++ b/var/spack/packages/ompss/package.py @@ -17,8 +17,9 @@ class Ompss(Package): of our Mercurium compiler and Nanos++ runtime system.""" homepage = "http://pm.bsc.es/" url = "http://pm.bsc.es/sites/default/files/ftp/ompss/releases/ompss-14.10.tar.gz" - version('14.10', '404d161265748f2f96bb35fd8c7e79ee') + list_url = 'http://pm.bsc.es/ompss-downloads' + version('14.10', '404d161265748f2f96bb35fd8c7e79ee') # all dependencies are optional, really depends_on("mpi") @@ -47,4 +48,3 @@ class Ompss(Package): configure("--prefix=%s" % prefix, "--with-nanox=%s" % prefix, "--enable-ompss", "--with-mpi=%s" % mpi.prefix, *openmp_options) make() make("install") - -- cgit v1.2.3-70-g09d2 From 4e3662f3188df8c9b6631caf7802e5ece3960b39 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sat, 17 Jan 2015 17:09:42 -0800 Subject: Dyninst 8.2 works. --- var/spack/packages/dyninst/package.py | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'var') diff --git a/var/spack/packages/dyninst/package.py b/var/spack/packages/dyninst/package.py index 9fbc6385a9..2e6f3e010a 100644 --- a/var/spack/packages/dyninst/package.py +++ b/var/spack/packages/dyninst/package.py @@ -31,13 +31,34 @@ class Dyninst(Package): 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" - version('8.1.2', 'bf03b33375afa66fe0efa46ce3f4b17a') - version('8.1.1', 'd1a04e995b7aa70960cd1d1fac8bd6ac') + version('8.2.1', 'abf60b7faabe7a2e4b54395757be39c7', + url="http://www.paradyn.org/release8.2/DyninstAPI-8.2.1.tgz") + version('8.1.2', 'bf03b33375afa66fe0efa46ce3f4b17a', + url="http://www.paradyn.org/release8.1.2/DyninstAPI-8.1.2.tgz") + version('8.1.1', 'd1a04e995b7aa70960cd1d1fac8bd6ac', + url="http://www.paradyn.org/release8.1/DyninstAPI-8.1.1.tgz") depends_on("libelf") depends_on("libdwarf") - depends_on("boost@1.42:") + depends_on("boost@1.42:1.43") + # new version uses cmake + def install(self, spec, prefix): + libelf = spec['libelf'].prefix + libdwarf = spec['libdwarf'].prefix + + with working_dir('spack-build', create=True): + cmake('..', + '-DLIBELF_INCLUDE_DIR=%s' % join_path(libelf.include, 'libelf'), + '-DLIBELF_LIBRARIES=%s' % join_path(libelf.lib, 'libelf.so'), + '-DLIBDWARF_INCLUDE_DIR=%s' % libdwarf.include, + '-DLIBDWARF_LIBRARIES=%s' % join_path(libdwarf.lib, 'libdwarf.so'), + *std_cmake_args) + make() + make("install") + + + @when('@:8.1') def install(self, spec, prefix): configure("--prefix=" + prefix) make() -- cgit v1.2.3-70-g09d2 From a4c19eee14103e9944e04917a44edec2b3209f94 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Mon, 19 Jan 2015 14:00:54 -0800 Subject: Qt5 webkit requires gperf --- var/spack/packages/gperf/package.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 var/spack/packages/gperf/package.py (limited to 'var') diff --git a/var/spack/packages/gperf/package.py b/var/spack/packages/gperf/package.py new file mode 100644 index 0000000000..32551b67b4 --- /dev/null +++ b/var/spack/packages/gperf/package.py @@ -0,0 +1,19 @@ +from spack import * + +class Gperf(Package): + """GNU gperf is a perfect hash function generator. For a given + list of strings, it produces a hash function and hash table, in + form of C or C++ code, for looking up a value depending on the + input string. The hash function is perfect, which means that the + hash table has no collisions, and the hash table lookup needs a + single string comparison only.""" + + homepage = "https://www.gnu.org/software/gperf/" + url = "http://ftp.gnu.org/pub/gnu/gperf/gperf-3.0.4.tar.gz" + + version('3.0.4', 'c1f1db32fb6598d6a93e6e88796a8632') + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") -- cgit v1.2.3-70-g09d2 From 53c8b4249ad5b875678ebe6d784fbc5493aef160 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Mon, 19 Jan 2015 14:06:09 -0800 Subject: Make dbus put a machine id file in the right place. --- var/spack/packages/dbus/package.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'var') diff --git a/var/spack/packages/dbus/package.py b/var/spack/packages/dbus/package.py index 5fee103f03..f7f394498c 100644 --- a/var/spack/packages/dbus/package.py +++ b/var/spack/packages/dbus/package.py @@ -23,3 +23,7 @@ class Dbus(Package): configure("--prefix=%s" % prefix) make() make("install") + + # dbus needs a machine id generated after install + dbus_uuidgen = Executable(join_path(prefix.bin, 'dbus-uuidgen')) + dbus_uuidgen('--ensure') -- cgit v1.2.3-70-g09d2 From 0211adbdb6010b403495644aab619ba8a9bed31e Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Mon, 19 Jan 2015 14:06:25 -0800 Subject: version bump libpng --- var/spack/packages/libpng/package.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'var') diff --git a/var/spack/packages/libpng/package.py b/var/spack/packages/libpng/package.py index a6d9bf0b46..affc14ea92 100644 --- a/var/spack/packages/libpng/package.py +++ b/var/spack/packages/libpng/package.py @@ -3,9 +3,9 @@ from spack import * class Libpng(Package): """libpng graphics file format""" homepage = "http://www.libpng.org/pub/png/libpng.html" - url = "http://sourceforge.net/projects/libpng/files/libpng16/1.6.14/libpng-1.6.14.tar.gz/download" + url = "http://prdownloads.sourceforge.net/libpng/libpng-1.6.16.tar.gz?download" - version('1.6.14', '2101b3de1d5f348925990f9aa8405660') + version('1.6.16', '1a4ad377919ab15b54f6cb6a3ae2622d') def install(self, spec, prefix): configure("--prefix=%s" % prefix) -- cgit v1.2.3-70-g09d2 From b7dacb427d2d9e80778b6c0eec05e0cc64d60859 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Mon, 19 Jan 2015 14:06:45 -0800 Subject: Qt5 & VTK builds. VTK works with Qt 4 and 5. --- var/spack/packages/qt/package.py | 76 +++++++++++++++++++++++++++++++-------- var/spack/packages/vtk/package.py | 40 +++++++++++++++++++++ 2 files changed, 101 insertions(+), 15 deletions(-) create mode 100644 var/spack/packages/vtk/package.py (limited to 'var') diff --git a/var/spack/packages/qt/package.py b/var/spack/packages/qt/package.py index 01f9de7f3c..4f82a9d9d6 100644 --- a/var/spack/packages/qt/package.py +++ b/var/spack/packages/qt/package.py @@ -3,7 +3,16 @@ from spack import * class Qt(Package): """Qt is a comprehensive cross-platform C++ application framework.""" homepage = "http://qt.io" + list_url = 'http://download.qt-project.org/official_releases/qt/' + list_depth = 2 + version('5.4.0', 'e8654e4b37dd98039ba20da7a53877e6', + url='http://download.qt-project.org/official_releases/qt/5.4/5.4.0/single/qt-everywhere-opensource-src-5.4.0.tar.gz') + version('5.3.2', 'febb001129927a70174467ecb508a682', + url='http://download.qt.io/archive/qt/5.3/5.3.2/single/qt-everywhere-opensource-src-5.3.2.tar.gz') + + version('5.2.1', 'a78408c887c04c34ce615da690e0b4c8', + url='http://download.qt.io/archive/qt/5.2/5.2.1/single/qt-everywhere-opensource-src-5.2.1.tar.gz') version('4.8.6', '2edbe4d6c2eff33ef91732602f3518eb', url="http://download.qt-project.org/official_releases/qt/4.8/4.8.6/qt-everywhere-opensource-src-4.8.6.tar.gz") @@ -20,25 +29,62 @@ class Qt(Package): depends_on("libmng") depends_on("jpeg") + depends_on("gperf") # Needed to build Qt with webkit. + def patch(self): + if self.spec.satisfies('@4'): + qmake_conf = 'mkspecs/common/g++-base.conf' + elif self.spec.satisfies('@5'): + qmake_conf = 'qtbase/mkspecs/common/g++-base.conf' + else: + return + # Fix qmake compilers in the default mkspec - qmake_conf = 'mkspecs/common/g++-base.conf' - filter_file(r'^QMAKE_CC *=.*$', 'QMAKE_CC = cc', qmake_conf) - filter_file(r'^QMAKE_CXX *=.*$', 'QMAKE_CXX = c++', qmake_conf) + filter_file(r'^QMAKE_COMPILER *=.*$', 'QMAKE_COMPILER = cc', qmake_conf) + filter_file(r'^QMAKE_CC *=.*$', 'QMAKE_CC = cc', qmake_conf) + filter_file(r'^QMAKE_CXX *=.*$', 'QMAKE_CXX = c++', qmake_conf) - def install(self, spec, prefix): - configure('-v', - '-confirm-license', - '-opensource', - '-prefix', prefix, - '-openssl-linked', - '-dbus-linked', - '-fast', - '-optimized-qmake', - '-no-pch', - '-no-phonon', + @property + def common_config_args(self): + return [ + '-prefix', self.prefix, + '-v', + '-opensource', + "-release", + '-shared', + '-confirm-license', + '-openssl-linked', + '-dbus-linked', + '-optimized-qmake', + '-no-openvg', + '-no-pch', + # For now, disable all the database drivers + "-no-sql-db2", "-no-sql-ibase", "-no-sql-mysql", "-no-sql-oci", "-no-sql-odbc", + "-no-sql-psql", "-no-sql-sqlite", "-no-sql-sqlite2", "-no-sql-tds", + # NIS is deprecated in more recent glibc + "-no-nis"] + + + @when('@4') + def configure(self): + configure('-no-phonon', '-no-phonon-backend', - '-no-openvg') + '-fast', + *self.common_config_args) + + + @when('@5') + def configure(self): + configure('-no-eglfs', + '-no-directfb', + '-qt-xcb', + # If someone wants to get a webkit build working, be my guest! + '-skip', 'qtwebkit', + *self.common_config_args) + + + def install(self, spec, prefix): + self.configure() make() make("install") diff --git a/var/spack/packages/vtk/package.py b/var/spack/packages/vtk/package.py new file mode 100644 index 0000000000..4a27a8fedb --- /dev/null +++ b/var/spack/packages/vtk/package.py @@ -0,0 +1,40 @@ +from spack import * + +class Vtk(Package): + """The Visualization Toolkit (VTK) is an open-source, freely + available software system for 3D computer graphics, image + processing and visualization. """ + homepage = "http://www.vtk.org" + url = "http://www.vtk.org/files/release/6.1/VTK-6.1.0.tar.gz" + + version('6.1.0', '25e4dfb3bad778722dcaec80cd5dab7d') + + depends_on("qt") + + def install(self, spec, prefix): + with working_dir('spack-build', create=True): + cmake_args = [ + "..", + "-DBUILD_SHARED_LIBS=ON", + # Disable wrappers for other languages. + "-DVTK_WRAP_PYTHON=OFF", + "-DVTK_WRAP_JAVA=OFF", + "-DVTK_WRAP_TCL=OFF"] + cmake_args.extend(std_cmake_args) + + # Enable Qt support here. + cmake_args.extend([ + "-DQT_QMAKE_EXECUTABLE:PATH=%s/qmake" % spec['qt'].prefix.bin, + "-DVTK_Group_Qt:BOOL=ON", + # Ignore webkit because it's hard to build w/Qt + "-DVTK_Group_Qt=OFF", + "-DModule_vtkGUISupportQt:BOOL=ON", + "-DModule_vtkGUISupportQtOpenGL:BOOL=ON" + ]) + + if spec['qt'].satisfies('@5'): + cmake_args.append("-DVTK_QT_VERSION:STRING=5") + + cmake(*cmake_args) + make() + make("install") -- cgit v1.2.3-70-g09d2 From d08c0703a06825311a4fabf2c49f7f04cceadbf9 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Mon, 19 Jan 2015 14:07:41 -0800 Subject: Initial build of MemAxes GUI. --- var/spack/packages/memaxes/package.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 var/spack/packages/memaxes/package.py (limited to 'var') diff --git a/var/spack/packages/memaxes/package.py b/var/spack/packages/memaxes/package.py new file mode 100644 index 0000000000..afa62009a6 --- /dev/null +++ b/var/spack/packages/memaxes/package.py @@ -0,0 +1,20 @@ +from spack import * + +class Memaxes(Package): + """MemAxes is a visualizer for sampled memory trace data.""" + + homepage = "https://github.com/scalability-llnl/MemAxes" + + version('0.5', 'b0f561d48aa7301e028d074bc4b5751b', + url='https://github.com/scalability-llnl/MemAxes/archive/v0.5.tar.gz') + + depends_on("cmake@2.8.9:") + depends_on("qt@5:") + depends_on("vtk") + + def install(self, spec, prefix): + with working_dir('spack-build', create=True): + cmake('..', *std_cmake_args) + make() + make("install") + -- cgit v1.2.3-70-g09d2 From 2a0e33876ec9f6e33a0408228463a021a1809668 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Mon, 19 Jan 2015 20:41:45 -0800 Subject: Add PSAPI --- var/spack/packages/psapi/package.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 var/spack/packages/psapi/package.py (limited to 'var') diff --git a/var/spack/packages/psapi/package.py b/var/spack/packages/psapi/package.py new file mode 100644 index 0000000000..b73c75c221 --- /dev/null +++ b/var/spack/packages/psapi/package.py @@ -0,0 +1,18 @@ +from spack import * + +class Psapi(Package): + """PSAPI is a library and a tool for collecting sampled memory + performance data to view with MemAxes""" + + homepage = "https://github.com/scalability-llnl/PSAPI" + url = "http://www.example.com/memaxes-psapi-1.0.tar.gz" + + version('0.5', git='https://github.com/scalability-llnl/PSAPI.git', tag='v0.5') + + depends_on('dyninst') + + def install(self, spec, prefix): + with working_dir('spack-build', create=True): + cmake('..', *std_cmake_args) + make() + make("install") -- cgit v1.2.3-70-g09d2 From e97db785d6d2f3a5b54d3a9e6ff0782901aa1b11 Mon Sep 17 00:00:00 2001 From: Alfredo Gimenez Date: Wed, 21 Jan 2015 20:42:44 -0800 Subject: psapi v0.6 --- var/spack/packages/psapi/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/packages/psapi/package.py b/var/spack/packages/psapi/package.py index b73c75c221..489c4f530e 100644 --- a/var/spack/packages/psapi/package.py +++ b/var/spack/packages/psapi/package.py @@ -7,7 +7,7 @@ class Psapi(Package): homepage = "https://github.com/scalability-llnl/PSAPI" url = "http://www.example.com/memaxes-psapi-1.0.tar.gz" - version('0.5', git='https://github.com/scalability-llnl/PSAPI.git', tag='v0.5') + version('0.6', git='https://github.com/scalability-llnl/PSAPI.git', tag='v0.6') depends_on('dyninst') -- cgit v1.2.3-70-g09d2 From 3e37903ffdbc72410264d1949dde9239e81ec698 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Thu, 22 Jan 2015 23:34:39 -0800 Subject: Packages have rpath property. --- lib/spack/spack/package.py | 31 +++++++++++++++++++++++++++---- var/spack/packages/gcc/package.py | 29 +++++++++++++++++++++++------ 2 files changed, 50 insertions(+), 10 deletions(-) (limited to 'var') diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index 1a797e88b1..fe4fc748d8 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -713,6 +713,14 @@ class Package(object): tty.msg("Patched %s" % self.name) + def do_fake_install(self): + """Make a fake install directory contaiing a 'fake' file in bin.""" + mkdirp(self.prefix.bin) + touch(join_path(self.prefix.bin, 'fake')) + mkdirp(self.prefix.lib) + mkdirp(self.prefix.man1) + + def do_install(self, **kwargs): """This class should call this version of the install method. Package implementations should override install(). @@ -758,13 +766,11 @@ class Package(object): spack.install_layout.make_path_for_spec(self.spec) # Set up process's build environment before running install. + self.stage.chdir_to_source() build_env.setup_package(self) if fake_install: - mkdirp(self.prefix.bin) - touch(join_path(self.prefix.bin, 'fake')) - mkdirp(self.prefix.lib) - mkdirp(self.prefix.man1) + self.do_fake_install() else: # Subclasses implement install() to do the real work. self.install(self.spec, self.prefix) @@ -925,6 +931,23 @@ class Package(object): e.url, e.message) + @property + def rpath(self): + """Get the rpath this package links with, as a list of paths.""" + rpaths = [self.prefix.lib, self.prefix.lib64] + rpaths.extend(d.prefix.lib for d in self.spec.traverse(root=False) + if os.path.isdir(d.prefix.lib)) + rpaths.extend(d.prefix.lib64 for d in self.spec.traverse(root=False) + if os.path.isdir(d.prefix.lib64)) + return rpaths + + + @property + def rpath_args(self): + """Get the rpath args as a string, with -Wl,-rpath= for each element.""" + return " ".join("-Wl,-rpath=%s" % p for p in self.rpath) + + def find_versions_of_archive(*archive_urls, **kwargs): list_url = kwargs.get('list_url', None) list_depth = kwargs.get('list_depth', 1) diff --git a/var/spack/packages/gcc/package.py b/var/spack/packages/gcc/package.py index da0debd5dc..3da6c25d47 100644 --- a/var/spack/packages/gcc/package.py +++ b/var/spack/packages/gcc/package.py @@ -32,29 +32,46 @@ class Gcc(Package): Objective-C, Fortran, and Java.""" homepage = "https://gcc.gnu.org" + url = "http://open-source-box.org/gcc/gcc-4.9.2/gcc-4.9.2.tar.bz2" list_url = 'http://open-source-box.org/gcc/' list_depth = 2 - version('4.9.2', '4df8ee253b7f3863ad0b86359cd39c43', - url="http://open-source-box.org/gcc/gcc-4.9.2/gcc-4.9.2.tar.bz2") - version('4.9.1', 'fddf71348546af523353bd43d34919c1', - url="http://open-source-box.org/gcc/gcc-4.9.1/gcc-4.9.1.tar.bz2") + version('4.9.2', '4df8ee253b7f3863ad0b86359cd39c43') + version('4.9.1', 'fddf71348546af523353bd43d34919c1') + version('4.8.4', '5a84a30839b2aca22a2d723de2a626ec') + version('4.7.4', '4c696da46297de6ae77a82797d2abe28') + version('4.6.4', 'b407a3d1480c11667f293bfb1f17d1a4') + version('4.5.4', '27e459c2566b8209ab064570e1b378f7') - depends_on("mpc") depends_on("mpfr") depends_on("gmp") + depends_on("mpc") # when @4.5: depends_on("libelf") + # Save these until we can do optional deps. + #depends_on("isl") + #depends_on("ppl") + #depends_on("cloog") def install(self, spec, prefix): # libjava/configure needs a minor fix to install into spack paths. filter_file(r"'@.*@'", "'@[[:alnum:]]*@'", 'libjava/configure', string=True) + enabled_languages = set(('c', 'c++', 'fortran', 'java', 'objc')) + if spec.satisfies("@4.7.1:"): + enabled_languages.add('go') + # Rest of install is straightforward. configure("--prefix=%s" % prefix, "--libdir=%s/lib64" % prefix, "--disable-multilib", - "--enable-languages=c,c++,fortran,java,objc,go", + "--enable-languages=" + ','.join(enabled_languages), + "--with-mpc=%s" % spec['mpc'].prefix, + "--with-mpfr=%s" % spec['mpfr'].prefix, + "--with-gmp=%s" % spec['gmp'].prefix, + "--with-libelf=%s" % spec['libelf'].prefix, + "--with-stage1-ldflags=%s" % self.rpath_args, + "--with-boot-ldflags=%s" % self.rpath_args, "--enable-lto", "--with-quad") make() -- cgit v1.2.3-70-g09d2 From 0ac6ffb3ef8aee18b5b559df691b6d81d5a00d35 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Fri, 23 Jan 2015 00:05:23 -0800 Subject: Add extra gcc dependencies. - not used until optional/conditional deps are implemented. --- var/spack/packages/cloog/package.py | 26 ++++++++++++++++++++++++++ var/spack/packages/isl/package.py | 17 +++++++++++++++++ var/spack/packages/ppl/package.py | 28 ++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+) create mode 100644 var/spack/packages/cloog/package.py create mode 100644 var/spack/packages/isl/package.py create mode 100644 var/spack/packages/ppl/package.py (limited to 'var') diff --git a/var/spack/packages/cloog/package.py b/var/spack/packages/cloog/package.py new file mode 100644 index 0000000000..814a33c76c --- /dev/null +++ b/var/spack/packages/cloog/package.py @@ -0,0 +1,26 @@ +from spack import * + +class Cloog(Package): + """CLooG is a free software and library to generate code for + scanning Z-polyhedra. That is, it finds a code (e.g. in C, + FORTRAN...) that reaches each integral point of one or more + parameterized polyhedra.""" + + homepage = "http://www.cloog.org" + url = "http://www.bastoul.net/cloog/pages/download/count.php3?url=./cloog-0.18.1.tar.gz" + list_url = "http://www.bastoul.net/cloog/pages/download" + + version('0.18.1', 'e34fca0540d840e5d0f6427e98c92252') + version('0.18.0', 'be78a47bd82523250eb3e91646db5b3d') + version('0.17.0', '0aa3302c81f65ca62c114e5264f8a802') + + depends_on("gmp") + depends_on("isl") + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix, + "--with-osl=no", + "--with-isl=%s" % spec['isl'].prefix, + "--with-gmp=%s" % spec['gmp'].prefix) + make() + make("install") diff --git a/var/spack/packages/isl/package.py b/var/spack/packages/isl/package.py new file mode 100644 index 0000000000..836ef3ea40 --- /dev/null +++ b/var/spack/packages/isl/package.py @@ -0,0 +1,17 @@ +from spack import * + +class Isl(Package): + """isl is a thread-safe C library for manipulating sets and + relations of integer points bounded by affine constraints.""" + homepage = "http://isl.gforge.inria.fr" + url = "http://isl.gforge.inria.fr/isl-0.14.tar.bz2" + + version('0.14', 'acd347243fca5609e3df37dba47fd0bb') + + depends_on("gmp") + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix, + "--with-gmp-prefix=%s" % spec['gmp'].prefix) + make() + make("install") diff --git a/var/spack/packages/ppl/package.py b/var/spack/packages/ppl/package.py new file mode 100644 index 0000000000..018d5c523d --- /dev/null +++ b/var/spack/packages/ppl/package.py @@ -0,0 +1,28 @@ +from spack import * + +class Ppl(Package): + """The Parma Polyhedra Library (PPL) provides numerical + abstractions especially targeted at applications in the field of + analysis and verification of complex systems. These abstractions + include convex polyhedra, some special classes of polyhedra shapes + that offer interesting complexity/precision tradeoffs, and grids + which represent regularly spaced points that satisfy a set of + linear congruence relations. The library also supports finite + powersets and products of polyhedra and grids, a mixed integer + linear programming problem solver using an exact-arithmetic + version of the simplex algorithm, a parametric integer programming + solver, and primitives for termination analysis via the automatic + synthesis of linear ranking functions.""" + + homepage = "http://bugseng.com/products/ppl/" + url = "http://bugseng.com/products/ppl/download/ftp/releases/1.1/ppl-1.1.tar.gz" + + version('1.1', '4f2422c0ef3f409707af32108deb30a7') + + depends_on("gmp") + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix, + "--with-gmp=%s" % spec['gmp'].prefix) + make() + make("install") -- cgit v1.2.3-70-g09d2 From 6a496ef62038f40ad1f4c22abd816f990fdfd4db Mon Sep 17 00:00:00 2001 From: Alfredo Gimenez Date: Fri, 23 Jan 2015 16:58:15 -0800 Subject: PSAPI v0.6 -> Mitos v0.7 --- var/spack/packages/Mitos/package.py | 18 ++++++++++++++++++ var/spack/packages/psapi/package.py | 18 ------------------ 2 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 var/spack/packages/Mitos/package.py delete mode 100644 var/spack/packages/psapi/package.py (limited to 'var') diff --git a/var/spack/packages/Mitos/package.py b/var/spack/packages/Mitos/package.py new file mode 100644 index 0000000000..272360a55c --- /dev/null +++ b/var/spack/packages/Mitos/package.py @@ -0,0 +1,18 @@ +from spack import * + +class Mitos(Package): + """Mitos is a library and a tool for collecting sampled memory + performance data to view with MemAxes""" + + homepage = "https://github.com/scalability-llnl/Mitos" + url = "https://github.com/scalability-llnl/Mitos" + + version('0.7', git='https://github.com/scalability-llnl/Mitos.git', tag='v0.7') + + depends_on('dyninst') + + def install(self, spec, prefix): + with working_dir('spack-build', create=True): + cmake('..', *std_cmake_args) + make() + make("install") diff --git a/var/spack/packages/psapi/package.py b/var/spack/packages/psapi/package.py deleted file mode 100644 index 489c4f530e..0000000000 --- a/var/spack/packages/psapi/package.py +++ /dev/null @@ -1,18 +0,0 @@ -from spack import * - -class Psapi(Package): - """PSAPI is a library and a tool for collecting sampled memory - performance data to view with MemAxes""" - - homepage = "https://github.com/scalability-llnl/PSAPI" - url = "http://www.example.com/memaxes-psapi-1.0.tar.gz" - - version('0.6', git='https://github.com/scalability-llnl/PSAPI.git', tag='v0.6') - - depends_on('dyninst') - - def install(self, spec, prefix): - with working_dir('spack-build', create=True): - cmake('..', *std_cmake_args) - make() - make("install") -- cgit v1.2.3-70-g09d2 From 2c1eda66c4d7a0df8f0a05ad16be38942f54dcee Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Tue, 6 Jan 2015 14:50:40 -0500 Subject: First python extension package: setuptools --- var/spack/packages/py-setuptools/package.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 var/spack/packages/py-setuptools/package.py (limited to 'var') diff --git a/var/spack/packages/py-setuptools/package.py b/var/spack/packages/py-setuptools/package.py new file mode 100644 index 0000000000..e2c4e1a0be --- /dev/null +++ b/var/spack/packages/py-setuptools/package.py @@ -0,0 +1,19 @@ +from spack import * + +class PySetuptools(Package): + """Easily download, build, install, upgrade, and uninstall Python packages.""" + homepage = "https://pypi.python.org/pypi/setuptools" + url = "https://pypi.python.org/packages/source/s/setuptools/setuptools-11.3.tar.gz" + + version('11.3.1', '01f69212e019a2420c1693fb43593930') + + extends('python') + + def install(self, spec, prefix): + site_packages_dir = "%s/lib/python2.7/site-packages" % prefix + mkdirp(site_packages_dir) + + env['PYTHONPATH'] = site_packages_dir + + python = which('python') + python('setup.py', 'install', '--prefix=%s' % prefix) -- cgit v1.2.3-70-g09d2 From 99775434785779d223997a9e41972da470214e5d Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Wed, 7 Jan 2015 11:48:21 -0800 Subject: Added feature: package extensions - packages can be "extended" by others - allows extension to be symlinked into extendee's prefix. - used for python modules. - first module: py-setuptools --- lib/spack/llnl/util/filesystem.py | 82 +++++++++++++++++++++++++++++++++- lib/spack/spack/__init__.py | 2 +- lib/spack/spack/directory_layout.py | 55 ++++++++++++++++------- lib/spack/spack/hooks/extensions.py | 49 +++++++++++++++++++++ lib/spack/spack/package.py | 85 ++++++++++++++++++++++++++++++++++++ lib/spack/spack/relations.py | 4 +- var/spack/packages/python/package.py | 3 ++ 7 files changed, 261 insertions(+), 19 deletions(-) create mode 100644 lib/spack/spack/hooks/extensions.py (limited to 'var') diff --git a/lib/spack/llnl/util/filesystem.py b/lib/spack/llnl/util/filesystem.py index 0578415653..9fb76d3a35 100644 --- a/lib/spack/llnl/util/filesystem.py +++ b/lib/spack/llnl/util/filesystem.py @@ -24,7 +24,8 @@ ############################################################################## __all__ = ['set_install_permissions', 'install', 'expand_user', 'working_dir', 'touch', 'mkdirp', 'force_remove', 'join_path', 'ancestor', - 'can_access', 'filter_file', 'change_sed_delimiter', 'is_exe'] + 'can_access', 'filter_file', 'change_sed_delimiter', 'is_exe', + 'check_link_tree', 'merge_link_tree', 'unmerge_link_tree'] import os import sys @@ -222,3 +223,82 @@ def ancestor(dir, n=1): def can_access(file_name): """True if we have read/write access to the file.""" return os.access(file_name, os.R_OK|os.W_OK) + + +def traverse_link_tree(src_root, dest_root, follow_nonexisting=True, **kwargs): + # Yield directories before or after their contents. + order = kwargs.get('order', 'pre') + if order not in ('pre', 'post'): + raise ValueError("Order must be 'pre' or 'post'.") + + # List of relative paths to ignore under the src root. + ignore = kwargs.get('ignore', None) + if isinstance(ignore, basestring): + ignore = (ignore,) + + for dirpath, dirnames, filenames in os.walk(src_root): + rel_path = dirpath[len(src_root):] + rel_path = rel_path.lstrip(os.path.sep) + dest_dirpath = os.path.join(dest_root, rel_path) + + # Don't descend into ignored directories + if ignore and dest_dirpath in ignore: + return + + # Don't descend into dirs in dest that do not exist in src. + if not follow_nonexisting: + dirnames[:] = [ + d for d in dirnames + if os.path.exists(os.path.join(dest_dirpath, d))] + + # preorder yields directories before children + if order == 'pre': + yield (dirpath, dest_dirpath) + + for name in filenames: + src_file = os.path.join(dirpath, name) + dest_file = os.path.join(dest_dirpath, name) + + # Ignore particular paths inside the install root. + src_relpath = src_file[len(src_root):] + src_relpath = src_relpath.lstrip(os.path.sep) + if ignore and src_relpath in ignore: + continue + + yield (src_file, dest_file) + + # postorder yields directories after children + if order == 'post': + yield (dirpath, dest_dirpath) + + + +def check_link_tree(src_root, dest_root, **kwargs): + for src, dest in traverse_link_tree(src_root, dest_root, False, **kwargs): + if os.path.exists(dest) and not os.path.isdir(dest): + return dest + return None + + +def merge_link_tree(src_root, dest_root, **kwargs): + kwargs['order'] = 'pre' + for src, dest in traverse_link_tree(src_root, dest_root, **kwargs): + if os.path.isdir(src): + mkdirp(dest) + else: + assert(not os.path.exists(dest)) + os.symlink(src, dest) + + +def unmerge_link_tree(src_root, dest_root, **kwargs): + kwargs['order'] = 'post' + for src, dest in traverse_link_tree(src_root, dest_root, **kwargs): + if os.path.isdir(dest): + if not os.listdir(dest): + # TODO: what if empty directories were present pre-merge? + shutil.rmtree(dest, ignore_errors=True) + + elif os.path.exists(dest): + if not os.path.islink(dest): + raise ValueError("%s is not a link tree!" % dest) + os.remove(dest) diff --git a/lib/spack/spack/__init__.py b/lib/spack/spack/__init__.py index 6697e00e40..6763411f7d 100644 --- a/lib/spack/spack/__init__.py +++ b/lib/spack/spack/__init__.py @@ -138,7 +138,7 @@ sys_type = None # should live. This file is overloaded for spack core vs. for packages. # __all__ = ['Package', 'Version', 'when', 'ver'] -from spack.package import Package +from spack.package import Package, ExtensionConflictError from spack.version import Version, ver from spack.multimethod import when diff --git a/lib/spack/spack/directory_layout.py b/lib/spack/spack/directory_layout.py index 4ab9a515cf..ff327ed504 100644 --- a/lib/spack/spack/directory_layout.py +++ b/lib/spack/spack/directory_layout.py @@ -53,6 +53,19 @@ class DirectoryLayout(object): self.root = root + @property + def hidden_file_paths(self): + """Return a list of hidden files used by the directory layout. + + Paths are relative to the root of an install directory. + + If the directory layout uses no hidden files to maintain + state, this should return an empty container, e.g. [] or (,). + + """ + raise NotImplementedError() + + def all_specs(self): """To be implemented by subclasses to traverse all specs for which there is a directory within the root. @@ -156,6 +169,11 @@ class SpecHashDirectoryLayout(DirectoryLayout): self.extension_file_name = extension_file_name + @property + def hidden_file_paths(self): + return ('.spec', '.extensions') + + def relative_path_for_spec(self, spec): _check_concrete(spec) dir_name = spec.format('$_$@$+$#') @@ -249,28 +267,32 @@ class SpecHashDirectoryLayout(DirectoryLayout): def get_extensions(self, spec): - path = self.extension_file_path(spec) + _check_concrete(spec) + path = self.extension_file_path(spec) extensions = set() if os.path.exists(path): - with closing(open(path)) as spec_file: - for line in spec_file: + with closing(open(path)) as ext_file: + for line in ext_file: try: - extensions.add(Spec(line)) - except SpecError, e: + extensions.add(Spec(line.strip())) + except spack.error.SpackError, e: raise InvalidExtensionSpecError(str(e)) return extensions - def write_extensions(self, extensions): + def write_extensions(self, spec, extensions): path = self.extension_file_path(spec) with closing(open(path, 'w')) as spec_file: for extension in sorted(extensions): - spec_file.write("%s\n" % extensions) + spec_file.write("%s\n" % extension) def add_extension(self, spec, extension_spec): - exts = get_extensions(spec) + _check_concrete(spec) + _check_concrete(extension_spec) + + exts = self.get_extensions(spec) if extension_spec in exts: raise ExtensionAlreadyInstalledError(spec, extension_spec) else: @@ -279,16 +301,19 @@ class SpecHashDirectoryLayout(DirectoryLayout): raise ExtensionConflictError(spec, extension_spec, already_installed) exts.add(extension_spec) - self.write_extensions(exts) + self.write_extensions(spec, exts) def remove_extension(self, spec, extension_spec): - exts = get_extensions(spec) + _check_concrete(spec) + _check_concrete(extension_spec) + + exts = self.get_extensions(spec) if not extension_spec in exts: raise NoSuchExtensionError(spec, extension_spec) exts.remove(extension_spec) - self.write_extensions(exts) + self.write_extensions(spec, exts) class DirectoryLayoutError(SpackError): @@ -328,7 +353,7 @@ class ExtensionAlreadyInstalledError(DirectoryLayoutError): """Raised when an extension is added to a package that already has it.""" def __init__(self, spec, extension_spec): super(ExtensionAlreadyInstalledError, self).__init__( - "%s is already installed in %s" % (extension_spec, spec)) + "%s is already installed in %s" % (extension_spec.short_spec, spec.short_spec)) class ExtensionConflictError(DirectoryLayoutError): @@ -336,12 +361,12 @@ class ExtensionConflictError(DirectoryLayoutError): def __init__(self, spec, extension_spec, conflict): super(ExtensionConflictError, self).__init__( "%s cannot be installed in %s because it conflicts with %s."% ( - extension_spec, spec, conflict)) + extension_spec.short_spec, spec.short_spec, conflict.short_spec)) class NoSuchExtensionError(DirectoryLayoutError): """Raised when an extension isn't there on remove.""" def __init__(self, spec, extension_spec): super(NoSuchExtensionError, self).__init__( - "%s cannot be removed from %s beacuse it's not installed."% ( - extension_spec, spec, conflict)) + "%s cannot be removed from %s because it's not installed."% ( + extension_spec.short_spec, spec.short_spec)) diff --git a/lib/spack/spack/hooks/extensions.py b/lib/spack/spack/hooks/extensions.py new file mode 100644 index 0000000000..444472bffa --- /dev/null +++ b/lib/spack/spack/hooks/extensions.py @@ -0,0 +1,49 @@ +############################################################################## +# 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 spack + + +def post_install(pkg): + assert(pkg.spec.concrete) + for name, spec in pkg.extendees.items(): + ext = pkg.spec[name] + epkg = ext.package + if epkg.installed: + epkg.do_activate(pkg) + + +def pre_uninstall(pkg): + assert(pkg.spec.concrete) + + # Need to do this b/c uninstall does not automatically do it. + # TODO: store full graph info in stored .spec file. + pkg.spec.normalize() + + for name, spec in pkg.extendees.items(): + ext = pkg.spec[name] + epkg = ext.package + if epkg.installed: + epkg.do_deactivate(pkg) diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index 04f0d842da..b7dae552e4 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -329,6 +329,9 @@ class Package(object): """By default we build in parallel. Subclasses can override this.""" parallel = True + """Most packages are NOT extendable. Set to True if you want extensions.""" + extendable = False + def __init__(self, spec): # this determines how the package should be built. @@ -398,6 +401,9 @@ class Package(object): self._fetch_time = 0.0 self._total_time = 0.0 + for name, spec in self.extendees.items(): + spack.db.get(spec)._check_extendable() + @property def version(self): @@ -877,6 +883,79 @@ class Package(object): spack.hooks.post_uninstall(self) + def _check_extendable(self): + if not self.extendable: + raise ValueError("Package %s is not extendable!" % self.name) + + + def _sanity_check_extension(self, extension): + self._check_extendable() + if not self.installed: + raise ValueError("Can only (de)activate extensions for installed packages.") + if not extension.installed: + raise ValueError("Extensions must first be installed.") + if not self.name in extension.extendees: + raise ValueError("%s does not extend %s!" % (extension.name, self.name)) + if not self.spec.satisfies(extension.extendees[self.name]): + raise ValueError("%s does not satisfy %s!" % (self.spec, extension.spec)) + + + def do_activate(self, extension): + self._sanity_check_extension(extension) + + self.activate(extension) + spack.install_layout.add_extension(self.spec, extension.spec) + tty.msg("Activated extension %s for %s." + % (extension.spec.short_spec, self.spec.short_spec)) + + + def activate(self, extension): + """Symlinks all files from the extension into extendee's install dir. + + Package authors can override this method to support other + extension mechanisms. Spack internals (commands, hooks, etc.) + should call do_activate() method so that proper checks are + always executed. + + """ + conflict = check_link_tree( + extension.prefix, self.prefix, + ignore=spack.install_layout.hidden_file_paths) + + if conflict: + raise ExtensionConflictError(conflict) + + merge_link_tree(extension.prefix, self.prefix, + ignore=spack.install_layout.hidden_file_paths) + + + def do_deactivate(self, extension): + self._sanity_check_extension(extension) + self.deactivate(extension) + + ext = extension.spec + if ext in spack.install_layout.get_extensions(self.spec): + spack.install_layout.remove_extension(self.spec, ext) + + tty.msg("Deactivated extension %s for %s." + % (extension.spec.short_spec, self.spec.short_spec)) + + + def deactivate(self, extension): + """Unlinks all files from extension out of extendee's install dir. + + Package authors can override this method to support other + extension mechanisms. Spack internals (commands, hooks, etc.) + should call do_deactivate() method so that proper checks are + always executed. + + """ + unmerge_link_tree(extension.prefix, self.prefix, + ignore=spack.install_layout.hidden_file_paths) + tty.msg("Deactivated %s as extension of %s." + % (extension.spec.short_spec, self.spec.short_spec)) + + def do_clean(self): if self.stage.expanded_archive_path: self.stage.chdir_to_source() @@ -1068,3 +1147,9 @@ class NoURLError(PackageError): def __init__(self, cls): super(NoURLError, self).__init__( "Package %s has no version with a URL." % cls.__name__) + + +class ExtensionConflictError(PackageError): + def __init__(self, path): + super(ExtensionConflictError, self).__init__( + "Extension blocked by file: %s" % path) diff --git a/lib/spack/spack/relations.py b/lib/spack/spack/relations.py index aaca9c199e..17bec1664f 100644 --- a/lib/spack/spack/relations.py +++ b/lib/spack/spack/relations.py @@ -68,7 +68,7 @@ provides spack install mpileaks ^mvapich spack install mpileaks ^mpich """ -__all__ = [ 'depends_on', 'provides', 'patch', 'version' ] +__all__ = [ 'depends_on', 'extends', 'provides', 'patch', 'version' ] import re import inspect @@ -135,7 +135,7 @@ def extends(*specs): for string in specs: for spec in spack.spec.parse(string): if pkg == spec.name: - raise CircularReferenceError('depends_on', pkg) + raise CircularReferenceError('extends', pkg) dependencies[spec.name] = spec extendees[spec.name] = spec diff --git a/var/spack/packages/python/package.py b/var/spack/packages/python/package.py index e6c3e28820..953be69cc2 100644 --- a/var/spack/packages/python/package.py +++ b/var/spack/packages/python/package.py @@ -1,10 +1,13 @@ from spack import * + class Python(Package): """The Python programming language.""" homepage = "http://www.python.org" url = "http://www.python.org/ftp/python/2.7.8/Python-2.7.8.tar.xz" + extendable = True + version('2.7.8', 'd235bdfa75b8396942e360a70487ee00') depends_on("openssl") -- cgit v1.2.3-70-g09d2 From bcccf020204a556e382c0af2897ad9126bb24984 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sat, 10 Jan 2015 19:37:01 -0800 Subject: Add setup_extension_environment() method. - lets packages do some setup before their extensions run install() --- lib/spack/spack/package.py | 30 +++++++++++++++++++++++++++++ var/spack/packages/py-setuptools/package.py | 6 ------ var/spack/packages/python/package.py | 23 +++++++++++++++++++++- 3 files changed, 52 insertions(+), 7 deletions(-) (limited to 'var') diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index da251dc4e8..8504b96fcf 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -783,6 +783,12 @@ class Package(object): self.stage.chdir_to_source() build_env.setup_package(self) + # Allow extendees to further set up the environment. + for ext_name in self.extendees: + ext_spec = self.spec[ext_name] + ext_spec.package.setup_extension_environment( + self.module, ext_spec, self.spec) + if fake_install: self.do_fake_install() else: @@ -854,6 +860,30 @@ class Package(object): fromlist=[self.__class__.__name__]) + def setup_extension_environment(self, module, spec, ext_spec): + """Called before the install() method of extensions. + + Default implementation does nothing, but this can be + overridden by an extendable package to set up the install + environment for its extensions. This is useful if there are + some common steps to installing all extensions for a + certain package. + + Some examples: + + 1. Installing python modules generally requires PYTHONPATH to + point to the lib/pythonX.Y/site-packages directory in the + module's install prefix. This could set that variable. + + 2. Extensions often need to invoke the 'python' interpreter + from the Python installation being extended. This routine can + put a 'python' Execuable object in the module scope for the + extension package to simplify extension installs. + + """ + pass + + def install(self, spec, prefix): """Package implementations override this with their own build configuration.""" raise InstallError("Package %s provides no install method!" % self.name) diff --git a/var/spack/packages/py-setuptools/package.py b/var/spack/packages/py-setuptools/package.py index e2c4e1a0be..755288d55c 100644 --- a/var/spack/packages/py-setuptools/package.py +++ b/var/spack/packages/py-setuptools/package.py @@ -10,10 +10,4 @@ class PySetuptools(Package): extends('python') def install(self, spec, prefix): - site_packages_dir = "%s/lib/python2.7/site-packages" % prefix - mkdirp(site_packages_dir) - - env['PYTHONPATH'] = site_packages_dir - - python = which('python') python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/python/package.py b/var/spack/packages/python/package.py index 953be69cc2..9700179ab8 100644 --- a/var/spack/packages/python/package.py +++ b/var/spack/packages/python/package.py @@ -1,5 +1,5 @@ from spack import * - +import os class Python(Package): """The Python programming language.""" @@ -26,3 +26,24 @@ class Python(Package): "--enable-shared") make() make("install") + + + def setup_extension_environment(self, module, spec, ext_spec): + """Called before python modules' install() methods. + + In most cases, extensions will only need to have one line:: + + python('setup.py', 'install', '--prefix=%s' % prefix) + """ + # Python extension builds can have a global python executable function + module.python = Executable(join_path(spec.prefix.bin, 'python')) + + # Add variables for lib/pythonX.Y and lib/pythonX.Y/site-packages dirs. + module.python_lib_dir = join_path(ext_spec.prefix.lib, 'python%d.%d' % self.version[:2]) + module.site_packages_dir = join_path(module.python_lib_dir, 'site-packages') + + # Add site packages directory to the PYTHONPATH + os.environ['PYTHONPATH'] = module.site_packages_dir + + # Make the site packages directory if it does not exist already. + mkdirp(module.site_packages_dir) -- cgit v1.2.3-70-g09d2 From 7992f415fe0e50c5e15964f348ed23c1fc1795b5 Mon Sep 17 00:00:00 2001 From: "Gregory L. Lee" Date: Thu, 15 Jan 2015 10:11:40 -0800 Subject: added py-nose --- var/spack/packages/py-nose/package.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 var/spack/packages/py-nose/package.py (limited to 'var') diff --git a/var/spack/packages/py-nose/package.py b/var/spack/packages/py-nose/package.py new file mode 100644 index 0000000000..7bd7106b8c --- /dev/null +++ b/var/spack/packages/py-nose/package.py @@ -0,0 +1,13 @@ +from spack import * + +class PyNose(Package): + """nose extends the test loading and running features of unittest, making it easier to write, find and run tests.""" + homepage = "https://pypi.python.org/pypi/nose" + url = "https://pypi.python.org/packages/source/n/nose/nose-1.3.4.tar.gz" + + version('1.3.4', '6ed7169887580ddc9a8e16048d38274d') + + extends('python') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) -- cgit v1.2.3-70-g09d2 From 9fa489b7f2dab452929729e300f189f8c50b817c Mon Sep 17 00:00:00 2001 From: "Gregory L. Lee" Date: Tue, 20 Jan 2015 09:39:21 -0800 Subject: added several modules --- var/spack/packages/py-cython/package.py | 13 +++++++++++++ var/spack/packages/py-dateutil/package.py | 13 +++++++++++++ var/spack/packages/py-epydoc/package.py | 13 +++++++++++++ var/spack/packages/py-ipython/package.py | 14 ++++++++++++++ var/spack/packages/py-matplotlib/package.py | 20 ++++++++++++++++++++ var/spack/packages/py-numpy/package.py | 14 ++++++++++++++ var/spack/packages/py-pexpect/package.py | 13 +++++++++++++ var/spack/packages/py-pygments/package.py | 14 ++++++++++++++ var/spack/packages/py-pyparsing/package.py | 13 +++++++++++++ var/spack/packages/py-pyside/package.py | 18 ++++++++++++++++++ var/spack/packages/py-pytz/package.py | 13 +++++++++++++ var/spack/packages/py-scipy/package.py | 15 +++++++++++++++ var/spack/packages/py-six/package.py | 13 +++++++++++++ var/spack/packages/py-virtualenv/package.py | 18 ++++++++++++++++++ 14 files changed, 204 insertions(+) create mode 100644 var/spack/packages/py-cython/package.py create mode 100644 var/spack/packages/py-dateutil/package.py create mode 100644 var/spack/packages/py-epydoc/package.py create mode 100644 var/spack/packages/py-ipython/package.py create mode 100644 var/spack/packages/py-matplotlib/package.py create mode 100644 var/spack/packages/py-numpy/package.py create mode 100644 var/spack/packages/py-pexpect/package.py create mode 100644 var/spack/packages/py-pygments/package.py create mode 100644 var/spack/packages/py-pyparsing/package.py create mode 100644 var/spack/packages/py-pyside/package.py create mode 100644 var/spack/packages/py-pytz/package.py create mode 100644 var/spack/packages/py-scipy/package.py create mode 100644 var/spack/packages/py-six/package.py create mode 100644 var/spack/packages/py-virtualenv/package.py (limited to 'var') diff --git a/var/spack/packages/py-cython/package.py b/var/spack/packages/py-cython/package.py new file mode 100644 index 0000000000..af67a15526 --- /dev/null +++ b/var/spack/packages/py-cython/package.py @@ -0,0 +1,13 @@ +from spack import * + +class PyCython(Package): + """The Cython compiler for writing C extensions for the Python language.""" + homepage = "https://pypi.python.org/pypi/cython" + url = "https://pypi.python.org/packages/source/C/Cython/Cython-0.21.2.tar.gz" + + version('0.21.2', 'd21adb870c75680dc857cd05d41046a4') + + extends('python') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-dateutil/package.py b/var/spack/packages/py-dateutil/package.py new file mode 100644 index 0000000000..96e3ecab07 --- /dev/null +++ b/var/spack/packages/py-dateutil/package.py @@ -0,0 +1,13 @@ +from spack import * + +class PyDateutil(Package): + """Extensions to the standard Python datetime module.""" + homepage = "https://pypi.python.org/pypi/dateutil" + url = "https://pypi.python.org/packages/source/p/python-dateutil/python-dateutil-2.4.0.tar.gz" + + version('2.4.0', '75714163bb96bedd07685cdb2071b8bc') + + extends('python') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-epydoc/package.py b/var/spack/packages/py-epydoc/package.py new file mode 100644 index 0000000000..af05510504 --- /dev/null +++ b/var/spack/packages/py-epydoc/package.py @@ -0,0 +1,13 @@ +from spack import * + +class PyEpydoc(Package): + """Epydoc is a tool for generating API documentation documentation for Python modules, based on their docstrings.""" + homepage = "https://pypi.python.org/pypi/epydoc" + url = "https://pypi.python.org/packages/source/e/epydoc/epydoc-3.0.1.tar.gz" + + version('3.0.1', '36407974bd5da2af00bf90ca27feeb44') + + extends('python') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-ipython/package.py b/var/spack/packages/py-ipython/package.py new file mode 100644 index 0000000000..731e661dfd --- /dev/null +++ b/var/spack/packages/py-ipython/package.py @@ -0,0 +1,14 @@ +from spack import * + +class PyIpython(Package): + """IPython provides a rich toolkit to help you make the most out of using Python interactively.""" + homepage = "https://pypi.python.org/pypi/ipython" + url = "https://pypi.python.org/packages/source/i/ipython/ipython-2.3.1.tar.gz" + + version('2.3.1', '2b7085525dac11190bfb45bb8ec8dcbf') + + extends('python') + depends_on('py-pygments') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-matplotlib/package.py b/var/spack/packages/py-matplotlib/package.py new file mode 100644 index 0000000000..836273c923 --- /dev/null +++ b/var/spack/packages/py-matplotlib/package.py @@ -0,0 +1,20 @@ +from spack import * + +class PyMatplotlib(Package): + """Python plotting package.""" + homepage = "https://pypi.python.org/pypi/matplotlib" + url = "https://pypi.python.org/packages/source/m/matplotlib/matplotlib-1.4.2.tar.gz" + + version('1.4.2', '7d22efb6cce475025733c50487bd8898') + + extends('python') + depends_on('py-pyside') + depends_on('py-ipython') + depends_on('py-pyparsing') + depends_on('py-six') + depends_on('py-dateutil') + depends_on('py-pytz') + depends_on('py-nose') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-numpy/package.py b/var/spack/packages/py-numpy/package.py new file mode 100644 index 0000000000..e6cb6a464f --- /dev/null +++ b/var/spack/packages/py-numpy/package.py @@ -0,0 +1,14 @@ +from spack import * + +class PyNumpy(Package): + """array processing for numbers, strings, records, and objects.""" + homepage = "https://pypi.python.org/pypi/numpy" + url = "https://pypi.python.org/packages/source/n/numpy/numpy-1.9.1.tar.gz" + + version('1.9.1', '78842b73560ec378142665e712ae4ad9') + + extends('python') + depends_on('py-nose') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-pexpect/package.py b/var/spack/packages/py-pexpect/package.py new file mode 100644 index 0000000000..ff5fac84e0 --- /dev/null +++ b/var/spack/packages/py-pexpect/package.py @@ -0,0 +1,13 @@ +from spack import * + +class PyPexpect(Package): + """Pexpect allows easy control of interactive console applications.""" + homepage = "https://pypi.python.org/pypi/pexpect" + url = "https://pypi.python.org/packages/source/p/pexpect/pexpect-3.3.tar.gz" + + version('3.3', '0de72541d3f1374b795472fed841dce8') + + extends('python') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-pygments/package.py b/var/spack/packages/py-pygments/package.py new file mode 100644 index 0000000000..990eebde65 --- /dev/null +++ b/var/spack/packages/py-pygments/package.py @@ -0,0 +1,14 @@ +from spack import * + +class PyPygments(Package): + """Pygments is a syntax highlighting package written in Python.""" + homepage = "https://pypi.python.org/pypi/pygments" + url = "https://pypi.python.org/packages/source/P/Pygments/Pygments-2.0.1.tar.gz" + + version('2.0.1', 'e0daf4c14a4fe5b630da765904de4d6c') + + extends('python') + depends_on('py-setuptools') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-pyparsing/package.py b/var/spack/packages/py-pyparsing/package.py new file mode 100644 index 0000000000..a6e50ad139 --- /dev/null +++ b/var/spack/packages/py-pyparsing/package.py @@ -0,0 +1,13 @@ +from spack import * + +class PyPyparsing(Package): + """A Python Parsing Module.""" + homepage = "https://pypi.python.org/pypi/pyparsing" + url = "https://pypi.python.org/packages/source/p/pyparsing/pyparsing-2.0.3.tar.gz" + + version('2.0.3', '0fe479be09fc2cf005f753d3acc35939') + + extends('python') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-pyside/package.py b/var/spack/packages/py-pyside/package.py new file mode 100644 index 0000000000..b01e16d7e6 --- /dev/null +++ b/var/spack/packages/py-pyside/package.py @@ -0,0 +1,18 @@ +from spack import * +import spack.package +import os + +class PyPyside(Package): + """array processing for numbers, strings, records, and objects.""" + homepage = "https://pypi.python.org/pypi/pyside" + url = "https://pypi.python.org/packages/source/P/PySide/PySide-1.2.2.tar.gz" + + version('1.2.2', 'c45bc400c8a86d6b35f34c29e379e44d') + + extends('python') + + def install(self, spec, prefix): + qmake_path = '/usr/lib64/qt4/bin/qmake' + if not os.path.exists(qmake_path): + raise spack.package.InstallError("Failed to find qmake in %s" % qmake_path) + python('setup.py', 'install', '--prefix=%s' % prefix, '--qmake=%s' % qmake_path) diff --git a/var/spack/packages/py-pytz/package.py b/var/spack/packages/py-pytz/package.py new file mode 100644 index 0000000000..80bcfe82ca --- /dev/null +++ b/var/spack/packages/py-pytz/package.py @@ -0,0 +1,13 @@ +from spack import * + +class PyPytz(Package): + """World timezone definitions, modern and historical.""" + homepage = "https://pypi.python.org/pypi/pytz" + url = "https://pypi.python.org/packages/source/p/pytz/pytz-2014.10.tar.gz" + + version('2014.10', 'eb1cb941a20c5b751352c52486aa1dd7') + + extends('python') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-scipy/package.py b/var/spack/packages/py-scipy/package.py new file mode 100644 index 0000000000..b5325b919f --- /dev/null +++ b/var/spack/packages/py-scipy/package.py @@ -0,0 +1,15 @@ +from spack import * + +class PyScipy(Package): + """Scientific Library for Python.""" + homepage = "https://pypi.python.org/pypi/scipy" + url = "https://pypi.python.org/packages/source/s/scipy/scipy-0.15.0.tar.gz" + + version('0.15.0', '639112f077f0aeb6d80718dc5019dc7a') + + extends('python') + depends_on('py-nose') + depends_on('py-numpy') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-six/package.py b/var/spack/packages/py-six/package.py new file mode 100644 index 0000000000..04d29adced --- /dev/null +++ b/var/spack/packages/py-six/package.py @@ -0,0 +1,13 @@ +from spack import * + +class PySix(Package): + """Python 2 and 3 compatibility utilities.""" + homepage = "https://pypi.python.org/pypi/six" + url = "https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz" + + version('1.9.0', '476881ef4012262dfc8adc645ee786c4') + + extends('python') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-virtualenv/package.py b/var/spack/packages/py-virtualenv/package.py new file mode 100644 index 0000000000..c1b359e164 --- /dev/null +++ b/var/spack/packages/py-virtualenv/package.py @@ -0,0 +1,18 @@ +from spack import * +import shutil + +class PyVirtualenv(Package): + """virtualenv is a tool to create isolated Python environments.""" + homepage = "http://virtualenv.readthedocs.org/projects/virtualenv/" + url = "https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.11.6.tar.gz" + + version('1.11.6', 'f61cdd983d2c4e6aeabb70b1060d6f49') + + extends('python') + + def clean(self): + if os.path.exists('build'): + shutil.rmtree('build') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) -- cgit v1.2.3-70-g09d2 From ff9cb94f4f92112739f53881bcb0a9a19811684d Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Tue, 20 Jan 2015 00:23:16 -0800 Subject: Add arguements to extends() and activate/deactivate. --- lib/spack/spack/package.py | 40 ++++++++++++++++++++++++++---------- lib/spack/spack/relations.py | 17 ++++++++------- var/spack/packages/python/package.py | 32 +++++++++++++++++++++++++++-- 3 files changed, 69 insertions(+), 20 deletions(-) (limited to 'var') diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index ae34f8ae45..bd63c2e0c0 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -497,16 +497,26 @@ class Package(object): @property def extendee_spec(self): """Spec of the extendee of this package, or None if it is not an extension.""" - if not self.extendees: return None - + if not self.extendees: + return None name = next(iter(self.extendees)) if not name in self.spec: - return self.extendees[name] + spec, kwargs = self.extendees[name] + return spec # Need to do this to get the concrete version of the spec return self.spec[name] + @property + def extendee_args(self): + """Spec of the extendee of this package, or None if it is not an extension.""" + if not self.extendees: + return None + name = next(iter(self.extendees)) + return self.extendees[name][1] + + @property def is_extension(self): return len(self.extendees) > 0 @@ -949,6 +959,8 @@ class Package(object): def _sanity_check_extension(self): + if not self.is_extension: + raise ValueError("This package is not an extension.") extendee_package = self.extendee_spec.package extendee_package._check_extendable() @@ -967,14 +979,14 @@ class Package(object): activate() directly. """ self._sanity_check_extension() - self.extendee_spec.package.activate(self) + self.extendee_spec.package.activate(self, **self.extendee_args) spack.install_layout.add_extension(self.extendee_spec, self.spec) tty.msg("Activated extension %s for %s." % (self.spec.short_spec, self.extendee_spec.short_spec)) - def activate(self, extension): + def activate(self, extension, **kwargs): """Symlinks all files from the extension into extendee's install dir. Package authors can override this method to support other @@ -983,17 +995,20 @@ class Package(object): always executed. """ + ignore_files = set(spack.install_layout.hidden_file_paths) + ignore_files.update(kwargs.get('ignore', ())) + tree = LinkTree(extension.prefix) - conflict = tree.find_conflict( - self.prefix, ignore=spack.install_layout.hidden_file_paths) + conflict = tree.find_conflict(self.prefix, ignore=ignore_files) if conflict: raise ExtensionConflictError(conflict) - tree.merge(self.prefix, ignore=spack.install_layout.hidden_file_paths) + tree.merge(self.prefix, ignore=ignore_files) def do_deactivate(self): + """Called on the extension to invoke extendee's deactivate() method.""" self._sanity_check_extension() - self.extendee_spec.package.deactivate(self) + self.extendee_spec.package.deactivate(self, **self.extendee_args) if self.spec in spack.install_layout.get_extensions(self.extendee_spec): spack.install_layout.remove_extension(self.extendee_spec, self.spec) @@ -1002,7 +1017,7 @@ class Package(object): % (self.spec.short_spec, self.extendee_spec.short_spec)) - def deactivate(self, extension): + def deactivate(self, extension, **kwargs): """Unlinks all files from extension out of this package's install dir. Package authors can override this method to support other @@ -1011,8 +1026,11 @@ class Package(object): always executed. """ + ignore_files = set(spack.install_layout.hidden_file_paths) + ignore_files.update(kwargs.get('ignore', ())) + tree = LinkTree(extension.prefix) - tree.unmerge(self.prefix, ignore=spack.install_layout.hidden_file_paths) + tree.unmerge(self.prefix, ignore=ignore_files) def do_clean(self): diff --git a/lib/spack/spack/relations.py b/lib/spack/spack/relations.py index 60ff5bef34..a0c7723473 100644 --- a/lib/spack/spack/relations.py +++ b/lib/spack/spack/relations.py @@ -117,7 +117,7 @@ def depends_on(*specs): dependencies[spec.name] = spec -def extends(*specs): +def extends(spec, **kwargs): """Same as depends_on, but dependency is symlinked into parent prefix. This is for Python and other language modules where the module @@ -126,6 +126,10 @@ def extends(*specs): but allowing ONE module version to be symlinked into a parent Python install at a time. + keyword arguments can be passed to extends() so that extension + packages can pass parameters to the extendee's extension + mechanism. + """ pkg = get_calling_package_name() clocals = caller_locals() @@ -134,12 +138,11 @@ def extends(*specs): if extendees: raise RelationError("Packages can extend at most one other package.") - for string in specs: - for spec in spack.spec.parse(string): - if pkg == spec.name: - raise CircularReferenceError('extends', pkg) - dependencies[spec.name] = spec - extendees[spec.name] = spec + spec = Spec(spec) + if pkg == spec.name: + raise CircularReferenceError('extends', pkg) + dependencies[spec.name] = spec + extendees[spec.name] = (spec, kwargs) def provides(*specs, **kwargs): diff --git a/var/spack/packages/python/package.py b/var/spack/packages/python/package.py index 9700179ab8..86b903bc23 100644 --- a/var/spack/packages/python/package.py +++ b/var/spack/packages/python/package.py @@ -28,6 +28,16 @@ class Python(Package): make("install") + @property + def python_lib_dir(self): + return os.path.join('lib', 'python%d.%d' % self.version[:2]) + + + @property + def site_packages_dir(self): + return os.path.join(self.python_lib_dir, 'site-packages') + + def setup_extension_environment(self, module, spec, ext_spec): """Called before python modules' install() methods. @@ -39,11 +49,29 @@ class Python(Package): module.python = Executable(join_path(spec.prefix.bin, 'python')) # Add variables for lib/pythonX.Y and lib/pythonX.Y/site-packages dirs. - module.python_lib_dir = join_path(ext_spec.prefix.lib, 'python%d.%d' % self.version[:2]) - module.site_packages_dir = join_path(module.python_lib_dir, 'site-packages') + module.python_lib_dir = os.path.join(ext_spec.prefix, self.python_lib_dir) + module.site_packages_dir = os.path.join(ext_spec.prefix, self.site_packages_dir) # Add site packages directory to the PYTHONPATH os.environ['PYTHONPATH'] = module.site_packages_dir # Make the site packages directory if it does not exist already. mkdirp(module.site_packages_dir) + + + def add_ignore_files(self, args): + """Add some ignore files to activate/deactivate args.""" + ignore = set(args.get('ignore', ())) + ignore.add(os.path.join(self.site_packages_dir, 'site.py')) + ignore.add(os.path.join(self.site_packages_dir, 'site.pyc')) + args.update(ignore=ignore) + + + def activate(self, ext_pkg, **args): + self.add_ignore_files(args) + super(Python, self).activate(ext_pkg, **args) + + + def deactivate(self, ext_pkg, **args): + self.add_ignore_files(args) + super(Python, self).deactivate(ext_pkg, **args) -- cgit v1.2.3-70-g09d2 From de91c95e8e45b8ab066ba3dfc8f89c92da761b5a Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Tue, 20 Jan 2015 15:07:53 -0800 Subject: Ability to ignore files in activate/deactivate for extensions. --- lib/spack/llnl/util/link_tree.py | 11 ++++------- lib/spack/spack/package.py | 16 +++++++++------- var/spack/packages/py-nose/package.py | 4 +++- var/spack/packages/python/package.py | 17 ++++++++++------- 4 files changed, 26 insertions(+), 22 deletions(-) (limited to 'var') diff --git a/lib/spack/llnl/util/link_tree.py b/lib/spack/llnl/util/link_tree.py index 19c2d46938..2d7126be2c 100644 --- a/lib/spack/llnl/util/link_tree.py +++ b/lib/spack/llnl/util/link_tree.py @@ -72,8 +72,7 @@ class LinkTree(object): order=[pre|post] -- Whether to do pre- or post-order traveral. - ignore= -- Optional container of root-relative - paths to ignore. + ignore= -- Predicate indicating which files to ignore. follow_nonexisting -- Whether to descend into directories in src that do not exit in dest. @@ -85,9 +84,7 @@ class LinkTree(object): raise ValueError("Order must be 'pre' or 'post'.") # List of relative paths to ignore under the src root. - ignore = kwargs.get('ignore', None) - if isinstance(ignore, basestring): - ignore = (ignore,) + ignore = kwargs.get('ignore', lambda filename: False) # Whether to descend when dirs dont' exist in dest. follow_nonexisting = kwargs.get('follow_nonexisting', True) @@ -98,7 +95,7 @@ class LinkTree(object): dest_dirpath = os.path.join(dest_root, rel_path) # Don't descend into ignored directories - if ignore and dest_dirpath in ignore: + if ignore(dest_dirpath): return # Don't descend into dirs in dest that do not exist in src. @@ -118,7 +115,7 @@ class LinkTree(object): # Ignore particular paths inside the install root. src_relpath = src_file[len(self._root):] src_relpath = src_relpath.lstrip(os.path.sep) - if ignore and src_relpath in ignore: + if ignore(src_relpath): continue yield (src_file, dest_file) diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index bd63c2e0c0..43b1fcd9c8 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -995,14 +995,15 @@ class Package(object): always executed. """ - ignore_files = set(spack.install_layout.hidden_file_paths) - ignore_files.update(kwargs.get('ignore', ())) + def ignore(filename): + return (filename in spack.install_layout.hidden_file_paths or + kwargs.get('ignore', lambda f: False)(filename)) tree = LinkTree(extension.prefix) - conflict = tree.find_conflict(self.prefix, ignore=ignore_files) + conflict = tree.find_conflict(self.prefix, ignore=ignore) if conflict: raise ExtensionConflictError(conflict) - tree.merge(self.prefix, ignore=ignore_files) + tree.merge(self.prefix, ignore=ignore) def do_deactivate(self): @@ -1026,11 +1027,12 @@ class Package(object): always executed. """ - ignore_files = set(spack.install_layout.hidden_file_paths) - ignore_files.update(kwargs.get('ignore', ())) + def ignore(filename): + return (filename in spack.install_layout.hidden_file_paths or + kwargs.get('ignore', lambda f: False)(filename)) tree = LinkTree(extension.prefix) - tree.unmerge(self.prefix, ignore=ignore_files) + tree.unmerge(self.prefix, ignore=ignore) def do_clean(self): diff --git a/var/spack/packages/py-nose/package.py b/var/spack/packages/py-nose/package.py index 7bd7106b8c..6df84e831d 100644 --- a/var/spack/packages/py-nose/package.py +++ b/var/spack/packages/py-nose/package.py @@ -1,7 +1,9 @@ from spack import * class PyNose(Package): - """nose extends the test loading and running features of unittest, making it easier to write, find and run tests.""" + """nose extends the test loading and running features of unittest, + making it easier to write, find and run tests.""" + homepage = "https://pypi.python.org/pypi/nose" url = "https://pypi.python.org/packages/source/n/nose/nose-1.3.4.tar.gz" diff --git a/var/spack/packages/python/package.py b/var/spack/packages/python/package.py index 86b903bc23..a22bd54c82 100644 --- a/var/spack/packages/python/package.py +++ b/var/spack/packages/python/package.py @@ -1,5 +1,6 @@ from spack import * import os +import re class Python(Package): """The Python programming language.""" @@ -59,19 +60,21 @@ class Python(Package): mkdirp(module.site_packages_dir) - def add_ignore_files(self, args): + def make_ignore(self, args): """Add some ignore files to activate/deactivate args.""" - ignore = set(args.get('ignore', ())) - ignore.add(os.path.join(self.site_packages_dir, 'site.py')) - ignore.add(os.path.join(self.site_packages_dir, 'site.pyc')) - args.update(ignore=ignore) + orig_ignore = args.get('ignore', lambda f: False) + def ignore(filename): + return (re.search(r'/site\.pyc?$', filename) or + re.search(r'\.pth$', filename) or + orig_ignore(filename)) + return ignore def activate(self, ext_pkg, **args): - self.add_ignore_files(args) + args.update(ignore=self.make_ignore(args)) super(Python, self).activate(ext_pkg, **args) def deactivate(self, ext_pkg, **args): - self.add_ignore_files(args) + args.update(ignore=self.make_ignore(args)) super(Python, self).deactivate(ext_pkg, **args) -- cgit v1.2.3-70-g09d2 From 2bc3f74df263eb92a99e5477f4ce04972eb76994 Mon Sep 17 00:00:00 2001 From: "Gregory L. Lee" Date: Thu, 22 Jan 2015 11:50:01 -0800 Subject: added more Python modules --- var/spack/packages/hdf5/package.py | 6 ++++-- var/spack/packages/py-basemap/package.py | 24 +++++++++++++++++++++++ var/spack/packages/py-biopython/package.py | 14 +++++++++++++ var/spack/packages/py-gnuplot/package.py | 13 ++++++++++++ var/spack/packages/py-h5py/package.py | 18 +++++++++++++++++ var/spack/packages/py-matplotlib/package.py | 17 ++++++++++++++++ var/spack/packages/py-mpi4py/package.py | 13 ++++++++++++ var/spack/packages/py-mx/package.py | 13 ++++++++++++ var/spack/packages/py-pil/package.py | 14 +++++++++++++ var/spack/packages/py-pmw/package.py | 13 ++++++++++++ var/spack/packages/py-pylint/package.py | 16 +++++++++++++++ var/spack/packages/py-rpy2/package.py | 14 +++++++++++++ var/spack/packages/py-scientificpython/package.py | 13 ++++++++++++ var/spack/packages/py-scikit-learn/package.py | 13 ++++++++++++ var/spack/packages/py-sympy/package.py | 13 ++++++++++++ 15 files changed, 212 insertions(+), 2 deletions(-) create mode 100644 var/spack/packages/py-basemap/package.py create mode 100644 var/spack/packages/py-biopython/package.py create mode 100644 var/spack/packages/py-gnuplot/package.py create mode 100644 var/spack/packages/py-h5py/package.py create mode 100644 var/spack/packages/py-mpi4py/package.py create mode 100644 var/spack/packages/py-mx/package.py create mode 100644 var/spack/packages/py-pil/package.py create mode 100644 var/spack/packages/py-pmw/package.py create mode 100644 var/spack/packages/py-pylint/package.py create mode 100644 var/spack/packages/py-rpy2/package.py create mode 100644 var/spack/packages/py-scientificpython/package.py create mode 100644 var/spack/packages/py-scikit-learn/package.py create mode 100644 var/spack/packages/py-sympy/package.py (limited to 'var') diff --git a/var/spack/packages/hdf5/package.py b/var/spack/packages/hdf5/package.py index 615c2a7fe4..992dd8ec70 100644 --- a/var/spack/packages/hdf5/package.py +++ b/var/spack/packages/hdf5/package.py @@ -18,12 +18,14 @@ class Hdf5(Package): # TODO: currently hard-coded to use OpenMPI def install(self, spec, prefix): + configure( "--prefix=%s" % prefix, "--with-zlib=%s" % spec['zlib'].prefix, "--enable-parallel", - "CC=%s" % spec['openmpi'].prefix.bin + "/mpicc", - "CXX=%s" % spec['openmpi'].prefix.bin + "/mpic++") + "--enable-shared", + "CC=%s" % spec['mpich'].prefix.bin + "/mpicc", + "CXX=%s" % spec['mpich'].prefix.bin + "/mpic++") make() make("install") diff --git a/var/spack/packages/py-basemap/package.py b/var/spack/packages/py-basemap/package.py new file mode 100644 index 0000000000..8955bf8827 --- /dev/null +++ b/var/spack/packages/py-basemap/package.py @@ -0,0 +1,24 @@ +from spack import * +import os + +class PyBasemap(Package): + """The matplotlib basemap toolkit is a library for plotting 2D data on maps in Python.""" + homepage = "http://matplotlib.org/basemap/" + url = "https://downloads.sourceforge.net/project/matplotlib/matplotlib-toolkits/basemap-1.0.7/basemap-1.0.7.tar.gz" + + version('1.0.7', '48c0557ced9e2c6e440b28b3caff2de8') + + geos_version = {'1.0.7' : '3.3.3'} + + extends('python') + depends_on('py-numpy') + depends_on('py-matplotlib') + depends_on('py-pil') + + def install(self, spec, prefix): + with working_dir('geos-%s' % self.geos_version[str(self.version)]): + configure("--prefix=" + prefix) + make() + make("install") + os.environ['GEOS_DIR'] = prefix + python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-biopython/package.py b/var/spack/packages/py-biopython/package.py new file mode 100644 index 0000000000..2ed04c389e --- /dev/null +++ b/var/spack/packages/py-biopython/package.py @@ -0,0 +1,14 @@ +from spack import * + +class PyBiopython(Package): + """It is a distributed collaborative effort to develop Python libraries and applications which address the needs of current and future work in bioinformatics.""" + homepage = "http://biopython.org/wiki/Main_Page" + url = "http://biopython.org/DIST/biopython-1.65.tar.gz" + + version('1.65', '143e7861ade85c0a8b5e2bbdd1da1f67') + + extends('python') + depends_on('py-mx') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-gnuplot/package.py b/var/spack/packages/py-gnuplot/package.py new file mode 100644 index 0000000000..0a2c073a49 --- /dev/null +++ b/var/spack/packages/py-gnuplot/package.py @@ -0,0 +1,13 @@ +from spack import * + +class PyGnuplot(Package): + """Gnuplot.py is a Python package that allows you to create graphs from within Python using the gnuplot plotting program.""" + homepage = "http://gnuplot-py.sourceforge.net/" + url = "http://downloads.sourceforge.net/project/gnuplot-py/Gnuplot-py/1.8/gnuplot-py-1.8.tar.gz" + + version('1.8', 'abd6f571e7aec68ae7db90a5217cd5b1') + + extends('python') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-h5py/package.py b/var/spack/packages/py-h5py/package.py new file mode 100644 index 0000000000..f72b3ac06e --- /dev/null +++ b/var/spack/packages/py-h5py/package.py @@ -0,0 +1,18 @@ +from spack import * +import re + +class PyH5py(Package): + """The h5py package provides both a high- and low-level interface to the HDF5 library from Python.""" + homepage = "https://pypi.python.org/pypi/h5py" + url = "https://pypi.python.org/packages/source/h/h5py/h5py-2.4.0.tar.gz" + + version('2.4.0', '80c9a94ae31f84885cc2ebe1323d6758') + + extends('python', ignore=lambda f: re.match(r'cy*', f)) + depends_on('hdf5') + depends_on('py-numpy') + depends_on('py-cython') + + def install(self, spec, prefix): + python('setup.py', 'configure', '--hdf5=%s' % spec['hdf5'].prefix) + python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-matplotlib/package.py b/var/spack/packages/py-matplotlib/package.py index 836273c923..270a1ebfe4 100644 --- a/var/spack/packages/py-matplotlib/package.py +++ b/var/spack/packages/py-matplotlib/package.py @@ -1,4 +1,5 @@ from spack import * +import os class PyMatplotlib(Package): """Python plotting package.""" @@ -18,3 +19,19 @@ class PyMatplotlib(Package): def install(self, spec, prefix): python('setup.py', 'install', '--prefix=%s' % prefix) + if str(self.version) == '1.4.2': + # hack to fix configuration file + config_file = None + for p,d,f in os.walk(prefix.lib): + for file in f: + if file.find('matplotlibrc') != -1: + config_file = join_path(p, 'matplotlibrc') + print config_file + if config_file == None: + raise InstallError('could not find config file') + filter_file(r'backend : pyside', + 'backend : Qt4Agg', + config_file) + filter_file(r'#backend.qt4 : PyQt4', + 'backend.qt4 : PySide', + config_file) diff --git a/var/spack/packages/py-mpi4py/package.py b/var/spack/packages/py-mpi4py/package.py new file mode 100644 index 0000000000..fdea340dc2 --- /dev/null +++ b/var/spack/packages/py-mpi4py/package.py @@ -0,0 +1,13 @@ +from spack import * + +class PyMpi4py(Package): + """This package provides Python bindings for the Message Passing Interface (MPI) standard. It is implemented on top of the MPI-1/MPI-2 specification and exposes an API which grounds on the standard MPI-2 C++ bindings.""" + homepage = "https://pypi.python.org/pypi/mpi4py" + url = "https://pypi.python.org/packages/source/m/mpi4py/mpi4py-1.3.1.tar.gz" + + version('1.3.1', 'dbe9d22bdc8ed965c23a7ceb6f32fc3c') + extends('python') + depends_on('mpi') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-mx/package.py b/var/spack/packages/py-mx/package.py new file mode 100644 index 0000000000..717ee0562b --- /dev/null +++ b/var/spack/packages/py-mx/package.py @@ -0,0 +1,13 @@ +from spack import * + +class PyMx(Package): + """The eGenix.com mx Base Distribution for Python is a collection of professional quality software tools which enhance Python's usability in many important areas such as fast text searching, date/time processing and high speed data types.""" + homepage = "http://www.egenix.com/products/python/mxBase/" + url = "https://downloads.egenix.com/python/egenix-mx-base-3.2.8.tar.gz" + + version('3.2.8', '9d9d3a25f9dc051a15e97f452413423b') + + extends('python') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-pil/package.py b/var/spack/packages/py-pil/package.py new file mode 100644 index 0000000000..743b761981 --- /dev/null +++ b/var/spack/packages/py-pil/package.py @@ -0,0 +1,14 @@ +from spack import * + +class PyPil(Package): + """The Python Imaging Library (PIL) adds image processing capabilities to your Python interpreter. This library supports many file formats, and provides powerful image processing and graphics capabilities.""" + + homepage = "http://www.pythonware.com/products/pil/" + url = "http://effbot.org/media/downloads/Imaging-1.1.7.tar.gz" + + version('1.1.7', 'fc14a54e1ce02a0225be8854bfba478e') + + extends('python') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-pmw/package.py b/var/spack/packages/py-pmw/package.py new file mode 100644 index 0000000000..56131811e9 --- /dev/null +++ b/var/spack/packages/py-pmw/package.py @@ -0,0 +1,13 @@ +from spack import * + +class PyPmw(Package): + """Pmw is a toolkit for building high-level compound widgets, or megawidgets, constructed using other widgets as component parts.""" + homepage = "https://pypi.python.org/pypi/Pmw" + url = "https://pypi.python.org/packages/source/P/Pmw/Pmw-2.0.0.tar.gz" + + version('2.0.0', 'c7c3f26c4f5abaa99807edefee578fc0') + + extends('python') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-pylint/package.py b/var/spack/packages/py-pylint/package.py new file mode 100644 index 0000000000..ebde861f94 --- /dev/null +++ b/var/spack/packages/py-pylint/package.py @@ -0,0 +1,16 @@ +from spack import * +import re + +class PyPylint(Package): + """array processing for numbers, strings, records, and objects.""" + homepage = "https://pypi.python.org/pypi/pylint" + url = "https://pypi.python.org/packages/source/p/pylint/pylint-1.4.1.tar.gz" + + version('1.4.1', 'df7c679bdcce5019389038847e4de622') + +# extends('python') + extends('python', ignore=lambda f:re.match(r"site.py*", f)) + depends_on('py-nose') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-rpy2/package.py b/var/spack/packages/py-rpy2/package.py new file mode 100644 index 0000000000..3817059911 --- /dev/null +++ b/var/spack/packages/py-rpy2/package.py @@ -0,0 +1,14 @@ +from spack import * + +class PyRpy2(Package): + """rpy2 is a redesign and rewrite of rpy. It is providing a low-level interface to R from Python, a proposed high-level interface, including wrappers to graphical libraries, as well as R-like structures and functions.""" + homepage = "https://pypi.python.org/pypi/rpy2" + url = "https://pypi.python.org/packages/source/r/rpy2/rpy2-2.5.4.tar.gz" + + version('2.5.4', '115a20ac30883f096da2bdfcab55196d') + + extends('python') + depends_on('py-setuptools') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-scientificpython/package.py b/var/spack/packages/py-scientificpython/package.py new file mode 100644 index 0000000000..73600e6cb9 --- /dev/null +++ b/var/spack/packages/py-scientificpython/package.py @@ -0,0 +1,13 @@ +from spack import * + +class PyScientificpython(Package): + """ScientificPython is a collection of Python modules for scientific computing. It contains support for geometry, mathematical functions, statistics, physical units, IO, visualization, and parallelization.""" + homepage = "https://sourcesup.renater.fr/projects/scientific-py/" + url = "https://sourcesup.renater.fr/frs/download.php/4411/ScientificPython-2.8.1.tar.gz" + + version('2.8.1', '73ee0df19c7b58cdf2954261f0763c77') + + extends('python') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-scikit-learn/package.py b/var/spack/packages/py-scikit-learn/package.py new file mode 100644 index 0000000000..c59c05a619 --- /dev/null +++ b/var/spack/packages/py-scikit-learn/package.py @@ -0,0 +1,13 @@ +from spack import * + +class PyScikitLearn(Package): + """""" + homepage = "https://pypi.python.org/pypi/scikit-learn" + url = "https://pypi.python.org/packages/source/s/scikit-learn/scikit-learn-0.15.2.tar.gz" + + version('0.15.2', 'd9822ad0238e17b382a3c756ea94fe0d') + + extends('python') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-sympy/package.py b/var/spack/packages/py-sympy/package.py new file mode 100644 index 0000000000..c17e35b95f --- /dev/null +++ b/var/spack/packages/py-sympy/package.py @@ -0,0 +1,13 @@ +from spack import * + +class PySympy(Package): + """SymPy is a Python library for symbolic mathematics.""" + homepage = "https://pypi.python.org/pypi/sympy" + url = "https://pypi.python.org/packages/source/s/sympy/sympy-0.7.6.tar.gz" + + version('0.7.6', '3d04753974306d8a13830008e17babca') + + extends('python') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) -- cgit v1.2.3-70-g09d2 From 48f1ff87f836f214e72e1d02f47eac4678f0292a Mon Sep 17 00:00:00 2001 From: "Gregory L. Lee" Date: Fri, 23 Jan 2015 13:53:36 -0800 Subject: added more Python modules --- var/spack/packages/py-dateutil/package.py | 1 + var/spack/packages/py-libxml2/package.py | 13 +++++++++++++ var/spack/packages/py-matplotlib/package.py | 1 + var/spack/packages/py-pychecker/package.py | 13 +++++++++++++ var/spack/packages/py-pyqt4/package.py | 18 ++++++++++++++++++ var/spack/packages/py-sip/package.py | 15 +++++++++++++++ var/spack/packages/qt/package.py | 5 +++-- 7 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 var/spack/packages/py-libxml2/package.py create mode 100644 var/spack/packages/py-pychecker/package.py create mode 100644 var/spack/packages/py-pyqt4/package.py create mode 100644 var/spack/packages/py-sip/package.py (limited to 'var') diff --git a/var/spack/packages/py-dateutil/package.py b/var/spack/packages/py-dateutil/package.py index 96e3ecab07..11699e07ee 100644 --- a/var/spack/packages/py-dateutil/package.py +++ b/var/spack/packages/py-dateutil/package.py @@ -8,6 +8,7 @@ class PyDateutil(Package): version('2.4.0', '75714163bb96bedd07685cdb2071b8bc') extends('python') + depends_on('py-setuptools') def install(self, spec, prefix): python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-libxml2/package.py b/var/spack/packages/py-libxml2/package.py new file mode 100644 index 0000000000..0dcefbd9cf --- /dev/null +++ b/var/spack/packages/py-libxml2/package.py @@ -0,0 +1,13 @@ +from spack import * + +class PyLibxml2(Package): + """A Python wrapper around libxml2.""" + homepage = "https://xmlsoft.org/python.html" + url = "ftp://xmlsoft.org/libxml2/python/libxml2-python-2.6.21.tar.gz" + + version('2.6.21', '229dd2b3d110a77defeeaa73af83f7f3') + + extends('python') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-matplotlib/package.py b/var/spack/packages/py-matplotlib/package.py index 270a1ebfe4..5979ceeab0 100644 --- a/var/spack/packages/py-matplotlib/package.py +++ b/var/spack/packages/py-matplotlib/package.py @@ -16,6 +16,7 @@ class PyMatplotlib(Package): depends_on('py-dateutil') depends_on('py-pytz') depends_on('py-nose') + depends_on('py-numpy') def install(self, spec, prefix): python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-pychecker/package.py b/var/spack/packages/py-pychecker/package.py new file mode 100644 index 0000000000..bda5a746aa --- /dev/null +++ b/var/spack/packages/py-pychecker/package.py @@ -0,0 +1,13 @@ +from spack import * + +class PyPychecker(Package): + """""" + homepage = "http://pychecker.sourceforge.net/" + url = "http://sourceforge.net/projects/pychecker/files/pychecker/0.8.19/pychecker-0.8.19.tar.gz" + + version('0.8.19', 'c37182863dfb09209d6ba4f38fce9d2b') + + extends('python') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-pyqt4/package.py b/var/spack/packages/py-pyqt4/package.py new file mode 100644 index 0000000000..eeb1382560 --- /dev/null +++ b/var/spack/packages/py-pyqt4/package.py @@ -0,0 +1,18 @@ +from spack import * + +class PyPyqt4(Package): + """PyQt is a set of Python v2 and v3 bindings for Digia's Qt application framework and runs on all platforms supported by Qt including Windows, MacOS/X and Linux.""" + homepage = "http://www.riverbankcomputing.com/software/pyqt/intro" + url = "http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.11.3/PyQt-x11-gpl-4.11.3.tar.gz" + + version('4.11.3', '997c3e443165a89a559e0d96b061bf70') + + extends('python') + depends_on('qt') + depends_on('py-sip') + + def install(self, spec, prefix): + version_array = str(spec['python'].version).split('.') + python('configure.py', '--confirm-license', '--destdir=%s/python%s.%s/site-packages' %(self.prefix.lib, version_array[0], version_array[1])) + make() + make('install') diff --git a/var/spack/packages/py-sip/package.py b/var/spack/packages/py-sip/package.py new file mode 100644 index 0000000000..06aea35a74 --- /dev/null +++ b/var/spack/packages/py-sip/package.py @@ -0,0 +1,15 @@ +from spack import * + +class PySip(Package): + """SIP is a tool that makes it very easy to create Python bindings for C and C++ libraries.""" + homepage = "http://www.riverbankcomputing.com/software/sip/intro" + url = "http://sourceforge.net/projects/pyqt/files/sip/sip-4.16.5/sip-4.16.5.tar.gz" + + version('4.16.5', '6d01ea966a53e4c7ae5c5e48c40e49e5') + + extends('python') + + def install(self, spec, prefix): + python('configure.py') + make() + make('install') diff --git a/var/spack/packages/qt/package.py b/var/spack/packages/qt/package.py index 01f9de7f3c..6a55c89701 100644 --- a/var/spack/packages/qt/package.py +++ b/var/spack/packages/qt/package.py @@ -37,8 +37,9 @@ class Qt(Package): '-fast', '-optimized-qmake', '-no-pch', - '-no-phonon', - '-no-phonon-backend', +# phonon required for py-pyqt4 +# '-no-phonon', +# '-no-phonon-backend', '-no-openvg') make() make("install") -- cgit v1.2.3-70-g09d2 From 2d9190d264dd276853aca41998fffbab1baecdb0 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Mon, 2 Feb 2015 06:09:35 -0800 Subject: Add extensions command. --- lib/spack/llnl/util/link_tree.py | 5 ++- lib/spack/spack/cmd/extensions.py | 9 ++-- lib/spack/spack/directory_layout.py | 2 +- lib/spack/spack/package.py | 5 +++ lib/spack/spack/packages.py | 5 +++ lib/spack/spack/spec.py | 7 +++ var/spack/packages/py-basemap/package.py | 1 + var/spack/packages/python/package.py | 77 +++++++++++++++++++++++++++++--- 8 files changed, 99 insertions(+), 12 deletions(-) (limited to 'var') diff --git a/lib/spack/llnl/util/link_tree.py b/lib/spack/llnl/util/link_tree.py index 887f6f4d26..4e4e48316e 100644 --- a/lib/spack/llnl/util/link_tree.py +++ b/lib/spack/llnl/util/link_tree.py @@ -27,7 +27,7 @@ __all__ = ['LinkTree'] import os import shutil -from llnl.util.filesystem import mkdirp +from llnl.util.filesystem import * empty_file_name = '.spack-empty' @@ -93,6 +93,7 @@ def traverse_tree(source_root, dest_root, rel_path='', **kwargs): for f in os.listdir(source_path): source_child = os.path.join(source_path, f) dest_child = os.path.join(dest_path, f) + rel_child = os.path.join(rel_path, f) # Treat as a directory if os.path.isdir(source_child) and ( @@ -101,7 +102,7 @@ def traverse_tree(source_root, dest_root, rel_path='', **kwargs): # When follow_nonexisting isn't set, don't descend into dirs # in source that do not exist in dest if follow_nonexisting or os.path.exists(dest_child): - tuples = traverse_tree(source_child, dest_child, rel_path, **kwargs) + tuples = traverse_tree(source_root, dest_root, rel_child, **kwargs) for t in tuples: yield t # Treat as a file. diff --git a/lib/spack/spack/cmd/extensions.py b/lib/spack/spack/cmd/extensions.py index 961d7e3f24..f28a388bf2 100644 --- a/lib/spack/spack/cmd/extensions.py +++ b/lib/spack/spack/cmd/extensions.py @@ -26,6 +26,7 @@ import sys from external import argparse import llnl.util.tty as tty +from llnl.util.tty.colify import colify import spack import spack.cmd @@ -66,10 +67,10 @@ def extensions(parser, args): exts = spack.install_layout.get_extensions(spec) if not exts: - tty.msg("%s has no activated extensions." % spec.short_spec) + tty.msg("%s has no activated extensions." % spec.cshort_spec) else: - tty.msg("Showing %d activated extension%s for package:" - % (len(exts), 's' if len(exts) > 1 else ''), - spec.short_spec) + tty.msg("Extensions for package %s:" % spec.cshort_spec) + colify(pkg.name for pkg in spack.db.extensions_for(spec)) print + tty.msg("%d currently activated:" % len(exts)) spack.cmd.find.display_specs(exts, mode=args.mode) diff --git a/lib/spack/spack/directory_layout.py b/lib/spack/spack/directory_layout.py index ff327ed504..efc40a17a4 100644 --- a/lib/spack/spack/directory_layout.py +++ b/lib/spack/spack/directory_layout.py @@ -269,8 +269,8 @@ class SpecHashDirectoryLayout(DirectoryLayout): def get_extensions(self, spec): _check_concrete(spec) - path = self.extension_file_path(spec) extensions = set() + path = self.extension_file_path(spec) if os.path.exists(path): with closing(open(path)) as ext_file: for line in ext_file: diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index 0b6bc4ce6c..b905968540 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -522,6 +522,11 @@ class Package(object): return len(self.extendees) > 0 + def extends(self, spec): + return (spec.name in self.extendees and + spec.satisfies(self.extendees[spec.name][0])) + + @property def activated(self): if not self.spec.concrete: diff --git a/lib/spack/spack/packages.py b/lib/spack/spack/packages.py index bb5a94bcab..b3049e812f 100644 --- a/lib/spack/spack/packages.py +++ b/lib/spack/spack/packages.py @@ -112,6 +112,11 @@ class PackageDB(object): return providers + @_autospec + def extensions_for(self, extendee_spec): + return [p for p in self.all_packages() if p.extends(extendee_spec)] + + 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.""" diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index 2f4fe9ca24..dffdccaddb 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -552,6 +552,13 @@ class Spec(object): return self.format('$_$@$%@$+$=$#') + @property + def cshort_spec(self): + """Returns a version of the spec with the dependencies hashed + instead of completely enumerated.""" + return self.format('$_$@$%@$+$=$#', color=True) + + @property def prefix(self): return Prefix(spack.install_layout.path_for_spec(self)) diff --git a/var/spack/packages/py-basemap/package.py b/var/spack/packages/py-basemap/package.py index 8955bf8827..7b6d8e7e65 100644 --- a/var/spack/packages/py-basemap/package.py +++ b/var/spack/packages/py-basemap/package.py @@ -11,6 +11,7 @@ class PyBasemap(Package): geos_version = {'1.0.7' : '3.3.3'} extends('python') + depends_on('py-setuptools') depends_on('py-numpy') depends_on('py-matplotlib') depends_on('py-pil') diff --git a/var/spack/packages/python/package.py b/var/spack/packages/python/package.py index a22bd54c82..8a6d574d9b 100644 --- a/var/spack/packages/python/package.py +++ b/var/spack/packages/python/package.py @@ -1,6 +1,9 @@ from spack import * +import spack import os import re +from contextlib import closing + class Python(Package): """The Python programming language.""" @@ -29,6 +32,10 @@ class Python(Package): make("install") + # ======================================================================== + # Set up environment to make install easy for python extensions. + # ======================================================================== + @property def python_lib_dir(self): return os.path.join('lib', 'python%d.%d' % self.version[:2]) @@ -60,21 +67,81 @@ class Python(Package): mkdirp(module.site_packages_dir) - def make_ignore(self, args): + # ======================================================================== + # Handle specifics of activating and deactivating python modules. + # ======================================================================== + + def python_ignore(self, ext_pkg, args): """Add some ignore files to activate/deactivate args.""" orig_ignore = args.get('ignore', lambda f: False) + def ignore(filename): - return (re.search(r'/site\.pyc?$', filename) or - re.search(r'\.pth$', filename) or + # Always ignore easy-install.pth, as it needs to be merged. + patterns = [r'easy-install\.pth$'] + + # Ignore pieces of setuptools installed by other packages. + if ext_pkg.name != 'py-setuptools': + patterns.append(r'/site\.pyc?$') + patterns.append(r'setuptools\.pth') + patterns.append(r'bin/easy_install[^/]*$') + patterns.append(r'setuptools.*egg$') + + return (any(re.search(p, filename) for p in patterns) or orig_ignore(filename)) + return ignore + def write_easy_install_pth(self, extensions): + paths = [] + for ext in extensions: + ext_site_packages = os.path.join(ext.prefix, self.site_packages_dir) + easy_pth = "%s/easy-install.pth" % ext_site_packages + + if not os.path.isfile(easy_pth): + continue + + with closing(open(easy_pth)) as f: + for line in f: + line = line.rstrip() + + # Skip lines matching these criteria + if not line: continue + if re.search(r'^(import|#)', line): continue + if (ext.name != 'py-setuptools' and + re.search(r'setuptools.*egg$', line)): continue + + paths.append(line) + + site_packages = os.path.join(self.prefix, self.site_packages_dir) + main_pth = "%s/easy-install.pth" % site_packages + + if not paths: + if os.path.isfile(main_pth): + os.remove(main_pth) + + else: + with closing(open(main_pth, 'w')) as f: + f.write("import sys; sys.__plen = len(sys.path)\n") + for path in paths: + f.write("%s\n" % path) + f.write("import sys; new=sys.path[sys.__plen:]; del sys.path[sys.__plen:]; " + "p=getattr(sys,'__egginsert',0); sys.path[p:p]=new; sys.__egginsert = p+len(new)\n") + + def activate(self, ext_pkg, **args): - args.update(ignore=self.make_ignore(args)) + args.update(ignore=self.python_ignore(ext_pkg, args)) super(Python, self).activate(ext_pkg, **args) + extensions = set(spack.install_layout.get_extensions(self.spec)) + extensions.add(ext_pkg.spec) + self.write_easy_install_pth(extensions) + def deactivate(self, ext_pkg, **args): - args.update(ignore=self.make_ignore(args)) + args.update(ignore=self.python_ignore(ext_pkg, args)) super(Python, self).deactivate(ext_pkg, **args) + + extensions = set(spack.install_layout.get_extensions(self.spec)) + extensions.remove(ext_pkg.spec) + self.write_easy_install_pth(extensions) -- cgit v1.2.3-70-g09d2 From 457f2d1d51b2bf008f837bf3ce8ee3cb47d5ba6b Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Fri, 6 Feb 2015 08:37:22 -0800 Subject: Fix libpng to use a better URL Sourceforge URLs like this eventually die when the libpng version is bumped: http://sourceforge.net/projects/libpng/files/libpng16/1.6.14/libpng-1.6.14.tar.gz/download But ones like this give you a "permanently moved", which curl -L will follow: http://download.sourceforge.net/libpng/libpng-1.6.16.tar.gz --- var/spack/packages/libpng/package.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'var') diff --git a/var/spack/packages/libpng/package.py b/var/spack/packages/libpng/package.py index a6d9bf0b46..c148a3d58c 100644 --- a/var/spack/packages/libpng/package.py +++ b/var/spack/packages/libpng/package.py @@ -3,12 +3,13 @@ from spack import * class Libpng(Package): """libpng graphics file format""" homepage = "http://www.libpng.org/pub/png/libpng.html" - url = "http://sourceforge.net/projects/libpng/files/libpng16/1.6.14/libpng-1.6.14.tar.gz/download" + url = "http://download.sourceforge.net/libpng/libpng-1.6.16.tar.gz" version('1.6.14', '2101b3de1d5f348925990f9aa8405660') + version('1.6.15', '829a256f3de9307731d4f52dc071916d') + version('1.6.16', '1a4ad377919ab15b54f6cb6a3ae2622d') def install(self, spec, prefix): configure("--prefix=%s" % prefix) - make() make("install") -- cgit v1.2.3-70-g09d2 From 5cc369c2b831446f1afaaba41cbf0dbdba75b4ed Mon Sep 17 00:00:00 2001 From: "Gregory L. Lee" Date: Fri, 6 Feb 2015 16:35:35 -0800 Subject: add dependent packages to PYTHONPATH for build --- var/spack/packages/python/package.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'var') diff --git a/var/spack/packages/python/package.py b/var/spack/packages/python/package.py index 8a6d574d9b..23b528b089 100644 --- a/var/spack/packages/python/package.py +++ b/var/spack/packages/python/package.py @@ -66,6 +66,11 @@ class Python(Package): # Make the site packages directory if it does not exist already. mkdirp(module.site_packages_dir) + # Add dependent packages' site-packages directory to PYTHONPATH + for d in ext_spec.traverse(): + if d.package.extends(self.spec): + os.environ['PYTHONPATH'] += ':' + os.path.join(d.prefix, self.site_packages_dir) + # ======================================================================== # Handle specifics of activating and deactivating python modules. -- cgit v1.2.3-70-g09d2 From d95d48bbe69eed2772bea8d155ccc4f8d708e4d2 Mon Sep 17 00:00:00 2001 From: Alfredo Gimenez Date: Fri, 6 Feb 2015 16:41:43 -0800 Subject: py-mako and fix for setup-env.sh --- share/spack/setup-env.sh | 4 ++-- var/spack/packages/py-mako/package.py | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 var/spack/packages/py-mako/package.py (limited to 'var') diff --git a/share/spack/setup-env.sh b/share/spack/setup-env.sh index 91b1dc4630..b2bcbaf6c7 100755 --- a/share/spack/setup-env.sh +++ b/share/spack/setup-env.sh @@ -165,8 +165,8 @@ fi # # Set up modules and dotkit search paths in the user environment # -_sp_share_dir="$(dirname $_sp_source_file)" -_sp_prefix="$(dirname $(dirname $_sp_share_dir))" +_sp_share_dir=$(cd "$(dirname $_sp_source_file)" && pwd) +_sp_prefix=$(cd "$(dirname $(dirname $_sp_share_dir))" && pwd) # TODO: fix SYS_TYPE to something non-LLNL-specific _spack_pathadd DK_NODE "$_sp_share_dir/dotkit/$SYS_TYPE" diff --git a/var/spack/packages/py-mako/package.py b/var/spack/packages/py-mako/package.py new file mode 100644 index 0000000000..3e91ffd8e5 --- /dev/null +++ b/var/spack/packages/py-mako/package.py @@ -0,0 +1,16 @@ +from spack import * + +class PyMako(Package): + """A super-fast templating language that borrows the best + ideas from the existing templating languages.""" + + homepage = "https://pypi.python.org/pypi/mako" + url = "https://pypi.python.org/packages/source/M/Mako/Mako-1.0.1.tar.gz" + + version('1.0.1', '9f0aafd177b039ef67b90ea350497a54') + + depends_on('py-setuptools') + extends('python') + + def install(self, spec, prefix): + python('setup.py', 'install', '--prefix=%s' % prefix) -- cgit v1.2.3-70-g09d2 From 5fdf5438ea4375dd5d9ceee7c5af1a4cf6896d53 Mon Sep 17 00:00:00 2001 From: Alfredo Gimenez Date: Fri, 6 Feb 2015 16:55:48 -0800 Subject: flex and bison --- var/spack/packages/bison/package.py | 17 +++++++++++++++++ var/spack/packages/flex/package.py | 15 +++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 var/spack/packages/bison/package.py create mode 100644 var/spack/packages/flex/package.py (limited to 'var') diff --git a/var/spack/packages/bison/package.py b/var/spack/packages/bison/package.py new file mode 100644 index 0000000000..7c526fb958 --- /dev/null +++ b/var/spack/packages/bison/package.py @@ -0,0 +1,17 @@ +from spack import * + +class Bison(Package): + """Bison is a general-purpose parser generator that converts + an annotated context-free grammar into a deterministic LR or + generalized LR (GLR) parser employing LALR(1) parser tables.""" + + homepage = "http://www.gnu.org/software/bison/" + url = "http://ftp.gnu.org/gnu/bison/bison-3.0.tar.gz" + + version('3.0.4', 'a586e11cd4aff49c3ff6d3b6a4c9ccf8') + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + + make() + make("install") diff --git a/var/spack/packages/flex/package.py b/var/spack/packages/flex/package.py new file mode 100644 index 0000000000..b065904912 --- /dev/null +++ b/var/spack/packages/flex/package.py @@ -0,0 +1,15 @@ +from spack import * + +class Flex(Package): + """Flex is a tool for generating scanners.""" + + homepage = "http://flex.sourceforge.net/" + url = "http://download.sourceforge.net/flex/flex-2.5.39.tar.gz" + + version('2.5.39', 'e133e9ead8ec0a58d81166b461244fde') + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + + make() + make("install") -- cgit v1.2.3-70-g09d2 From 676cc84c9e0a845fab117fde4ff0b1dca0b2d792 Mon Sep 17 00:00:00 2001 From: Alfredo Gimenez Date: Fri, 6 Feb 2015 17:24:55 -0800 Subject: more mesa dependencies --- var/spack/packages/dri2proto/package.py | 14 ++++++++++++++ var/spack/packages/libdrm/package.py | 22 ++++++++++++++++++++++ var/spack/packages/libxcb/package.py | 21 +++++++++++++++++++++ var/spack/packages/libxshmfence/package.py | 16 ++++++++++++++++ var/spack/packages/xcb-proto/package.py | 15 +++++++++++++++ 5 files changed, 88 insertions(+) create mode 100644 var/spack/packages/dri2proto/package.py create mode 100644 var/spack/packages/libdrm/package.py create mode 100644 var/spack/packages/libxcb/package.py create mode 100644 var/spack/packages/libxshmfence/package.py create mode 100644 var/spack/packages/xcb-proto/package.py (limited to 'var') diff --git a/var/spack/packages/dri2proto/package.py b/var/spack/packages/dri2proto/package.py new file mode 100644 index 0000000000..11dfa568e2 --- /dev/null +++ b/var/spack/packages/dri2proto/package.py @@ -0,0 +1,14 @@ +from spack import * + +class Dri2proto(Package): + """DRI2 Protocol Headers.""" + homepage = "http://http://cgit.freedesktop.org/xorg/proto/dri2proto/" + url = "http://xorg.freedesktop.org/releases/individual/proto/dri2proto-2.8.tar.gz" + + version('2.8', '19ea18f63d8ae8053c9fa84b60365b77') + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + + make() + make("install") diff --git a/var/spack/packages/libdrm/package.py b/var/spack/packages/libdrm/package.py new file mode 100644 index 0000000000..9164db8141 --- /dev/null +++ b/var/spack/packages/libdrm/package.py @@ -0,0 +1,22 @@ +from spack import * + +class Libdrm(Package): + """A userspace library for accessing the DRM, direct + rendering manager, on Linux, BSD and other operating + systems that support the ioctl interface.""" + + homepage = "http://dri.freedesktop.org/libdrm/" # no real website... + url = "http://dri.freedesktop.org/libdrm/libdrm-2.4.59.tar.gz" + + version('2.4.59', '105ac7af1afcd742d402ca7b4eb168b6') + + # FIXME: Add dependencies if this package requires them. + # depends_on("foo") + + def install(self, spec, prefix): + # FIXME: Modify the configure line to suit your build system here. + configure("--prefix=%s" % prefix) + + # FIXME: Add logic to build and install here + make() + make("install") diff --git a/var/spack/packages/libxcb/package.py b/var/spack/packages/libxcb/package.py new file mode 100644 index 0000000000..521cd0d475 --- /dev/null +++ b/var/spack/packages/libxcb/package.py @@ -0,0 +1,21 @@ +from spack import * + +class Libxcb(Package): + """The X protocol C-language Binding (XCB) is a replacement + for Xlib featuring a small footprint, latency hiding, direct + access to the protocol, improved threading support, and + extensibility.""" + + homepage = "http://xcb.freedesktop.org/" + url = "http://xcb.freedesktop.org/dist/libxcb-1.11.tar.gz" + + version('1.11', '1698dd837d7e6e94d029dbe8b3a82deb') + + depends_on("python") + depends_on("xcb-proto") + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + + make() + make("install") diff --git a/var/spack/packages/libxshmfence/package.py b/var/spack/packages/libxshmfence/package.py new file mode 100644 index 0000000000..3aa2448b46 --- /dev/null +++ b/var/spack/packages/libxshmfence/package.py @@ -0,0 +1,16 @@ +from spack import * + +class Libxshmfence(Package): + """This is a tiny library that exposes a event API on top of Linux + futexes.""" + + homepage = "http://keithp.com/blogs/dri3_extension/" # not really... + url = "http://xorg.freedesktop.org/archive/individual/lib/libxshmfence-1.2.tar.gz" + + version('1.2', 'f0b30c0fc568b22ec524859ee28556f1') + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + + make() + make("install") diff --git a/var/spack/packages/xcb-proto/package.py b/var/spack/packages/xcb-proto/package.py new file mode 100644 index 0000000000..17a94bd892 --- /dev/null +++ b/var/spack/packages/xcb-proto/package.py @@ -0,0 +1,15 @@ +from spack import * + +class XcbProto(Package): + """Protocol for libxcb""" + + homepage = "http://xcb.freedesktop.org/" + url = "http://xcb.freedesktop.org/dist/xcb-proto-1.11.tar.gz" + + version('1.11', 'c8c6cb72c84f58270f4db1f39607f66a') + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + + make() + make("install") -- cgit v1.2.3-70-g09d2 From 932f3930f43e10f22c06ede6bb963a23989443c1 Mon Sep 17 00:00:00 2001 From: Alfredo Gimenez Date: Sat, 7 Feb 2015 09:18:34 -0800 Subject: util-linux added --- var/spack/packages/libdrm/package.py | 5 ----- var/spack/packages/util-linux/package.py | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 var/spack/packages/util-linux/package.py (limited to 'var') diff --git a/var/spack/packages/libdrm/package.py b/var/spack/packages/libdrm/package.py index 9164db8141..3a657e8ecc 100644 --- a/var/spack/packages/libdrm/package.py +++ b/var/spack/packages/libdrm/package.py @@ -10,13 +10,8 @@ class Libdrm(Package): version('2.4.59', '105ac7af1afcd742d402ca7b4eb168b6') - # FIXME: Add dependencies if this package requires them. - # depends_on("foo") - def install(self, spec, prefix): - # FIXME: Modify the configure line to suit your build system here. configure("--prefix=%s" % prefix) - # FIXME: Add logic to build and install here make() make("install") diff --git a/var/spack/packages/util-linux/package.py b/var/spack/packages/util-linux/package.py new file mode 100644 index 0000000000..cb7ceabf57 --- /dev/null +++ b/var/spack/packages/util-linux/package.py @@ -0,0 +1,20 @@ +from spack import * +import os + +class UtilLinux(Package): + """Util-linux is a suite of essential utilities for any Linux system.""" + + homepage = "http://freecode.com/projects/util-linux" + url = "https://www.kernel.org/pub/linux/utils/util-linux/v2.25/util-linux-2.25.tar.gz" + + version('2.25', 'f6d7fc6952ec69c4dc62c8d7c59c1d57') + + depends_on("python@2.7:") + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix, + "PKG_CONFIG_PATH=%s/pkgconfig" % spec['python'].prefix.lib, + "--disable-use-tty-group") + + make() + make("install") -- cgit v1.2.3-70-g09d2 From 1605e04d444583284a19462206755ecacb219d3b Mon Sep 17 00:00:00 2001 From: Alfredo Gimenez Date: Sat, 7 Feb 2015 22:08:50 -0800 Subject: mesa and systemd (systemd not working yet) --- var/spack/packages/mesa/package.py | 26 ++++++++++++++++++++++++ var/spack/packages/systemd/package.py | 38 +++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 var/spack/packages/mesa/package.py create mode 100644 var/spack/packages/systemd/package.py (limited to 'var') diff --git a/var/spack/packages/mesa/package.py b/var/spack/packages/mesa/package.py new file mode 100644 index 0000000000..df28d87700 --- /dev/null +++ b/var/spack/packages/mesa/package.py @@ -0,0 +1,26 @@ +from spack import * + +class Mesa(Package): + """Mesa is an open-source implementation of the OpenGL + specification - a system for rendering interactive 3D graphics.""" + + homepage = "http://www.mesa3d.org" + url = "ftp://ftp.freedesktop.org/pub/mesa/10.4.4/MesaLib-10.4.4.tar.gz" + + version('10.4.4', '8d863a3c209bf5116b2babfccccc68ce') + + depends_on("py-mako") + depends_on("flex") + depends_on("bison") + depends_on("libdrm") + depends_on("dri2proto") + depends_on("libxcb") + depends_on("libxshmfence") + + def install(self, spec, prefix): + # FIXME: Modify the configure line to suit your build system here. + configure("--prefix=%s" % prefix) + + # FIXME: Add logic to build and install here + make() + make("install") diff --git a/var/spack/packages/systemd/package.py b/var/spack/packages/systemd/package.py new file mode 100644 index 0000000000..647b3bda7b --- /dev/null +++ b/var/spack/packages/systemd/package.py @@ -0,0 +1,38 @@ +# FIXME: +# This is a template package file for Spack. We've conveniently +# put "FIXME" labels next to all the things you'll want to change. +# +# Once you've edited all the FIXME's, delete this whole message, +# save this file, and test out your package like this: +# +# spack install systemd +# +# You can always get back here to change things with: +# +# spack edit systemd +# +# See the spack documentation for more information on building +# packages. +# +from spack import * + +class Systemd(Package): + """Systemd is a suite of basic building blocks for a Linux system.""" + + homepage = "http://www.freedesktop.org/wiki/Software/systemd/" + url = "http://www.freedesktop.org/software/systemd/systemd-218.tar.xz" + + version('218', '4e2c511b0a7932d7fc9d79822273aac6') + + depends_on("gperf") + depends_on("coreutils@8.16:") # ln --relative + depends_on("util-linux") # libmount + depends_on("python@2.7:") + depends_on("gcc@4.5:") # pragma gcc diagnostic not allowed inside functions + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix, + "CC=%s/gcc -std=gnu99" % spec['gcc'].prefix.bin) + + make() + make("install") -- cgit v1.2.3-70-g09d2 From cc684a3ebeaa939b9ae87474991e210aab7c3185 Mon Sep 17 00:00:00 2001 From: Alfredo Gimenez Date: Sun, 8 Feb 2015 13:34:45 -0800 Subject: older mesa for 2.6 kernel (not workin yet) --- var/spack/packages/mesa/package.py | 8 ++++---- var/spack/packages/systemd/package.py | 38 ----------------------------------- 2 files changed, 4 insertions(+), 42 deletions(-) delete mode 100644 var/spack/packages/systemd/package.py (limited to 'var') diff --git a/var/spack/packages/mesa/package.py b/var/spack/packages/mesa/package.py index df28d87700..6da13e52b2 100644 --- a/var/spack/packages/mesa/package.py +++ b/var/spack/packages/mesa/package.py @@ -5,9 +5,11 @@ class Mesa(Package): specification - a system for rendering interactive 3D graphics.""" homepage = "http://www.mesa3d.org" - url = "ftp://ftp.freedesktop.org/pub/mesa/10.4.4/MesaLib-10.4.4.tar.gz" + url = "ftp://ftp.freedesktop.org/pub/mesa/older-versions/7.x/7.11.2/MesaLib-7.11.2.tar.gz" + # url = "ftp://ftp.freedesktop.org/pub/mesa/10.4.4/MesaLib-10.4.4.tar.gz" - version('10.4.4', '8d863a3c209bf5116b2babfccccc68ce') + # version('10.4.4', '8d863a3c209bf5116b2babfccccc68ce') + version('7.11.2', 'b9e84efee3931c0acbccd1bb5a860554') depends_on("py-mako") depends_on("flex") @@ -18,9 +20,7 @@ class Mesa(Package): depends_on("libxshmfence") def install(self, spec, prefix): - # FIXME: Modify the configure line to suit your build system here. configure("--prefix=%s" % prefix) - # FIXME: Add logic to build and install here make() make("install") diff --git a/var/spack/packages/systemd/package.py b/var/spack/packages/systemd/package.py deleted file mode 100644 index 647b3bda7b..0000000000 --- a/var/spack/packages/systemd/package.py +++ /dev/null @@ -1,38 +0,0 @@ -# FIXME: -# This is a template package file for Spack. We've conveniently -# put "FIXME" labels next to all the things you'll want to change. -# -# Once you've edited all the FIXME's, delete this whole message, -# save this file, and test out your package like this: -# -# spack install systemd -# -# You can always get back here to change things with: -# -# spack edit systemd -# -# See the spack documentation for more information on building -# packages. -# -from spack import * - -class Systemd(Package): - """Systemd is a suite of basic building blocks for a Linux system.""" - - homepage = "http://www.freedesktop.org/wiki/Software/systemd/" - url = "http://www.freedesktop.org/software/systemd/systemd-218.tar.xz" - - version('218', '4e2c511b0a7932d7fc9d79822273aac6') - - depends_on("gperf") - depends_on("coreutils@8.16:") # ln --relative - depends_on("util-linux") # libmount - depends_on("python@2.7:") - depends_on("gcc@4.5:") # pragma gcc diagnostic not allowed inside functions - - def install(self, spec, prefix): - configure("--prefix=%s" % prefix, - "CC=%s/gcc -std=gnu99" % spec['gcc'].prefix.bin) - - make() - make("install") -- cgit v1.2.3-70-g09d2 From 9e878075aceace1439e85b1d75770a7a6f248566 Mon Sep 17 00:00:00 2001 From: Alfredo Gimenez Date: Sun, 8 Feb 2015 16:09:13 -0800 Subject: mesa 8.0.5 working --- var/spack/packages/libdrm/package.py | 1 + var/spack/packages/llvm/package.py | 6 ++++++ var/spack/packages/mesa/package.py | 27 +++++++++++++++++---------- 3 files changed, 24 insertions(+), 10 deletions(-) (limited to 'var') diff --git a/var/spack/packages/libdrm/package.py b/var/spack/packages/libdrm/package.py index 3a657e8ecc..00736b7811 100644 --- a/var/spack/packages/libdrm/package.py +++ b/var/spack/packages/libdrm/package.py @@ -9,6 +9,7 @@ class Libdrm(Package): url = "http://dri.freedesktop.org/libdrm/libdrm-2.4.59.tar.gz" version('2.4.59', '105ac7af1afcd742d402ca7b4eb168b6') + version('2.4.33', '86e4e3debe7087d5404461e0032231c8') def install(self, spec, prefix): configure("--prefix=%s" % prefix) diff --git a/var/spack/packages/llvm/package.py b/var/spack/packages/llvm/package.py index c7a10df55a..69354a5c90 100644 --- a/var/spack/packages/llvm/package.py +++ b/var/spack/packages/llvm/package.py @@ -35,6 +35,12 @@ class Llvm(Package): url = "http://llvm.org/releases/3.4.2/llvm-3.4.2.src.tar.gz" version('3.4.2', 'a20669f75967440de949ac3b1bad439c') + version('3.0', 'a8e5f5f1c1adebae7b4a654c376a6005', + url='http://llvm.org/releases/3.0/llvm-3.0.tar.gz') + version('2.9', '793138412d2af2c7c7f54615f8943771', + url='http://llvm.org/releases/2.9/llvm-2.9.tgz') + version('2.8', '220d361b4d17051ff4bb21c64abe05ba', + url='http://llvm.org/releases/2.8/llvm-2.8.tgz') def install(self, spec, prefix): env['CXXFLAGS'] = self.compiler.cxx11_flag diff --git a/var/spack/packages/mesa/package.py b/var/spack/packages/mesa/package.py index 6da13e52b2..2dba878a77 100644 --- a/var/spack/packages/mesa/package.py +++ b/var/spack/packages/mesa/package.py @@ -5,19 +5,26 @@ class Mesa(Package): specification - a system for rendering interactive 3D graphics.""" homepage = "http://www.mesa3d.org" - url = "ftp://ftp.freedesktop.org/pub/mesa/older-versions/7.x/7.11.2/MesaLib-7.11.2.tar.gz" + url = "ftp://ftp.freedesktop.org/pub/mesa/older-versions/8.x/8.0.5/MesaLib-8.0.5.tar.gz" # url = "ftp://ftp.freedesktop.org/pub/mesa/10.4.4/MesaLib-10.4.4.tar.gz" # version('10.4.4', '8d863a3c209bf5116b2babfccccc68ce') - version('7.11.2', 'b9e84efee3931c0acbccd1bb5a860554') - - depends_on("py-mako") - depends_on("flex") - depends_on("bison") - depends_on("libdrm") - depends_on("dri2proto") - depends_on("libxcb") - depends_on("libxshmfence") + version('8.0.5', 'cda5d101f43b8784fa60bdeaca4056f2') + + # mesa 7.x, 8.x, 9.x + depends_on("libdrm@2.4.33") + depends_on("llvm@3.0") + + # patch("llvm-fixes.patch") # using newer llvm + + # mesa 10.x + # depends_on("py-mako") + # depends_on("flex") + # depends_on("bison") + # depends_on("dri2proto") + # depends_on("libxcb") + # depends_on("libxshmfence") + def install(self, spec, prefix): configure("--prefix=%s" % prefix) -- cgit v1.2.3-70-g09d2 From e51e01f4f066f9b0f412354cb8abab3642845d43 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sun, 8 Feb 2015 19:39:36 -0800 Subject: Cleaned up python to remove redundant line. --- var/spack/packages/python/package.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'var') diff --git a/var/spack/packages/python/package.py b/var/spack/packages/python/package.py index 23b528b089..8bffbf393c 100644 --- a/var/spack/packages/python/package.py +++ b/var/spack/packages/python/package.py @@ -60,16 +60,16 @@ class Python(Package): module.python_lib_dir = os.path.join(ext_spec.prefix, self.python_lib_dir) module.site_packages_dir = os.path.join(ext_spec.prefix, self.site_packages_dir) - # Add site packages directory to the PYTHONPATH - os.environ['PYTHONPATH'] = module.site_packages_dir - # Make the site packages directory if it does not exist already. mkdirp(module.site_packages_dir) - # Add dependent packages' site-packages directory to PYTHONPATH + # Set PYTHONPATH to include site-packages dir for the + # extension and any other python extensions it depends on. + python_paths = [] for d in ext_spec.traverse(): if d.package.extends(self.spec): - os.environ['PYTHONPATH'] += ':' + os.path.join(d.prefix, self.site_packages_dir) + python_paths.append(os.path.join(d.prefix, self.site_packages_dir)) + os.environ['PYTHONPATH'] = ':'.join(python_paths) # ======================================================================== -- cgit v1.2.3-70-g09d2 From 20ec80295dbf2a36b633860c139d113f9c0e6388 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sun, 8 Feb 2015 19:41:17 -0800 Subject: setup_extension_environment is now setup_dependent_environment. - other packages, like Qt, can now use this to set up relevant build variables and env vars for their dependencies. - not just extensions anymore. --- lib/spack/spack/package.py | 14 ++++++++------ var/spack/packages/python/package.py | 2 +- var/spack/packages/qt/package.py | 6 ++++++ 3 files changed, 15 insertions(+), 7 deletions(-) (limited to 'var') diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index b905968540..6e319a1f87 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -829,10 +829,10 @@ class Package(object): self.stage.chdir_to_source() build_env.setup_package(self) - # Allow extendees to further set up the environment. - if self.is_extension: - self.extendee_spec.package.setup_extension_environment( - self.module, self.extendee_spec, self.spec) + # Allow dependencies to further set up the environment. + for dep_spec in self.spec.traverse(root=False): + dep_spec.package.setup_dependent_environment( + self.module, dep_spec, self.spec) if fake_install: self.do_fake_install() @@ -910,8 +910,8 @@ class Package(object): fromlist=[self.__class__.__name__]) - def setup_extension_environment(self, module, spec, ext_spec): - """Called before the install() method of extensions. + def setup_dependent_environment(self, module, spec, dependent_spec): + """Called before the install() method of dependents. Default implementation does nothing, but this can be overridden by an extendable package to set up the install @@ -930,6 +930,8 @@ class Package(object): put a 'python' Execuable object in the module scope for the extension package to simplify extension installs. + 3. A lot of Qt extensions need QTDIR set. This can be used to do that. + """ pass diff --git a/var/spack/packages/python/package.py b/var/spack/packages/python/package.py index 8bffbf393c..eed81d095c 100644 --- a/var/spack/packages/python/package.py +++ b/var/spack/packages/python/package.py @@ -46,7 +46,7 @@ class Python(Package): return os.path.join(self.python_lib_dir, 'site-packages') - def setup_extension_environment(self, module, spec, ext_spec): + def setup_dependent_environment(self, module, spec, ext_spec): """Called before python modules' install() methods. In most cases, extensions will only need to have one line:: diff --git a/var/spack/packages/qt/package.py b/var/spack/packages/qt/package.py index 6a55c89701..fcbcd2491a 100644 --- a/var/spack/packages/qt/package.py +++ b/var/spack/packages/qt/package.py @@ -1,3 +1,4 @@ +import os from spack import * class Qt(Package): @@ -20,6 +21,11 @@ class Qt(Package): depends_on("libmng") depends_on("jpeg") + def setup_dependent_environment(self, module, spec, dep_spec): + """Dependencies of Qt find it using the QTDIR environment variable.""" + os.environ['QTDIR'] = self.prefix + + def patch(self): # Fix qmake compilers in the default mkspec qmake_conf = 'mkspecs/common/g++-base.conf' -- cgit v1.2.3-70-g09d2 From 27617670f013bd1dbde24079bd7ae38331530695 Mon Sep 17 00:00:00 2001 From: Alfredo Gimenez Date: Mon, 9 Feb 2015 00:01:07 -0800 Subject: qt with hardware accelerated opengl working --- var/spack/packages/icu4c/package.py | 17 +++++++++++++++++ var/spack/packages/qt/package.py | 20 ++++++++++++++++++-- var/spack/packages/ruby/package.py | 16 ++++++++++++++++ 3 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 var/spack/packages/icu4c/package.py create mode 100644 var/spack/packages/ruby/package.py (limited to 'var') diff --git a/var/spack/packages/icu4c/package.py b/var/spack/packages/icu4c/package.py new file mode 100644 index 0000000000..55b44463b2 --- /dev/null +++ b/var/spack/packages/icu4c/package.py @@ -0,0 +1,17 @@ +from spack import * + +class Icu4c(Package): + """ICU is a mature, widely used set of C/C++ and Java libraries + providing Unicode and Globalization support for software applications.""" + + homepage = "http://site.icu-project.org/" + url = "http://downloads.sourceforge.net/project/icu/ICU4C/54.1/icu4c-54_1-src.tgz" + + version('54_1', 'e844caed8f2ca24c088505b0d6271bc0') + + def install(self, spec, prefix): + cd("source") + configure("--prefix=%s" % prefix) + + make() + make("install") diff --git a/var/spack/packages/qt/package.py b/var/spack/packages/qt/package.py index 96e484b995..c8b19d07f5 100644 --- a/var/spack/packages/qt/package.py +++ b/var/spack/packages/qt/package.py @@ -1,4 +1,5 @@ from spack import * +import os class Qt(Package): """Qt is a comprehensive cross-platform C++ application framework.""" @@ -29,7 +30,16 @@ class Qt(Package): depends_on("libmng") depends_on("jpeg") - depends_on("gperf") # Needed to build Qt with webkit. + # Webkit + # depends_on("gperf") + # depends_on("flex") + # depends_on("bison") + # depends_on("ruby") + # depends_on("icu4c") + + # OpenGL hardware acceleration + depends_on("mesa") + depends_on("libxcb") def patch(self): if self.spec.satisfies('@4'): @@ -46,13 +56,19 @@ class Qt(Package): def install(self, spec, prefix): + # Apparently this is the only way to + # "truly" get rid of webkit compiles now... + os.rename("qtwebkit","no-qtwebkit") + os.rename("qtwebkit-examples","no-qtwebkit-examples") configure('-v', '-confirm-license', '-opensource', '-prefix', prefix, '-openssl-linked', '-dbus-linked', - '-fast', + #'-fast', + '-opengl', + '-qt-xcb', '-optimized-qmake', '-no-pch', # phonon required for py-pyqt4 diff --git a/var/spack/packages/ruby/package.py b/var/spack/packages/ruby/package.py new file mode 100644 index 0000000000..718fd0a3be --- /dev/null +++ b/var/spack/packages/ruby/package.py @@ -0,0 +1,16 @@ +from spack import * + +class Ruby(Package): + """A dynamic, open source programming language with a focus on + simplicity and productivity.""" + + homepage = "https://www.ruby-lang.org/" + url = "http://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.0.tar.gz" + + version('2.2.0', 'cd03b28fd0b555970f5c4fd481700852') + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + + make() + make("install") -- cgit v1.2.3-70-g09d2 From 25af341954fa7c9a88943fe24cad88275ee00795 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Mon, 9 Feb 2015 02:54:49 -0800 Subject: Python package improvements. --- var/spack/packages/geos/package.py | 31 +++++++++++++++++++++++++++++ var/spack/packages/py-basemap/package.py | 9 ++------- var/spack/packages/py-biopython/package.py | 1 + var/spack/packages/py-gnuplot/package.py | 1 + var/spack/packages/py-libxml2/package.py | 1 + var/spack/packages/py-matplotlib/package.py | 3 +++ var/spack/packages/py-pyside/package.py | 31 +++++++++++++++++++++++++---- var/spack/packages/py-shiboken/package.py | 21 +++++++++++++++++++ var/spack/packages/python/package.py | 5 +++-- 9 files changed, 90 insertions(+), 13 deletions(-) create mode 100644 var/spack/packages/geos/package.py create mode 100644 var/spack/packages/py-shiboken/package.py (limited to 'var') diff --git a/var/spack/packages/geos/package.py b/var/spack/packages/geos/package.py new file mode 100644 index 0000000000..4a2657e32f --- /dev/null +++ b/var/spack/packages/geos/package.py @@ -0,0 +1,31 @@ +from spack import * + +class Geos(Package): + """GEOS (Geometry Engine - Open Source) is a C++ port of the Java + Topology Suite (JTS). As such, it aims to contain the complete + functionality of JTS in C++. This includes all the OpenGIS + Simple Features for SQL spatial predicate functions and spatial + operators, as well as specific JTS enhanced topology functions.""" + + homepage = "http://trac.osgeo.org/geos/" + url = "http://download.osgeo.org/geos/geos-3.4.2.tar.bz2" + + version('3.4.2', 'fc5df2d926eb7e67f988a43a92683bae') + version('3.4.1', '4c930dec44c45c49cd71f3e0931ded7e') + version('3.4.0', 'e41318fc76b5dc764a69d43ac6b18488') + version('3.3.9', '4794c20f07721d5011c93efc6ccb8e4e') + version('3.3.8', '75be476d0831a2d14958fed76ca266de') + version('3.3.7', '95ab996d22672b067d92c7dee2170460') + version('3.3.6', '6fadfb941541875f4976f75fb0bbc800') + version('3.3.5', '2ba61afb7fe2c5ddf642d82d7b16e75b') + version('3.3.4', '1bb9f14d57ef06ffa41cb1d67acb55a1') + version('3.3.3', '8454e653d7ecca475153cc88fd1daa26') + + extends('python') + depends_on('swig') + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix, + "--enable-python") + make() + make("install") diff --git a/var/spack/packages/py-basemap/package.py b/var/spack/packages/py-basemap/package.py index 7b6d8e7e65..45f1085ba1 100644 --- a/var/spack/packages/py-basemap/package.py +++ b/var/spack/packages/py-basemap/package.py @@ -8,18 +8,13 @@ class PyBasemap(Package): version('1.0.7', '48c0557ced9e2c6e440b28b3caff2de8') - geos_version = {'1.0.7' : '3.3.3'} - extends('python') depends_on('py-setuptools') depends_on('py-numpy') depends_on('py-matplotlib') depends_on('py-pil') + depends_on("geos") def install(self, spec, prefix): - with working_dir('geos-%s' % self.geos_version[str(self.version)]): - configure("--prefix=" + prefix) - make() - make("install") - os.environ['GEOS_DIR'] = prefix + env['GEOS_DIR'] = spec['geos'].prefix python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-biopython/package.py b/var/spack/packages/py-biopython/package.py index 2ed04c389e..8ecaf48626 100644 --- a/var/spack/packages/py-biopython/package.py +++ b/var/spack/packages/py-biopython/package.py @@ -9,6 +9,7 @@ class PyBiopython(Package): extends('python') depends_on('py-mx') + depends_on('py-numpy') def install(self, spec, prefix): python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-gnuplot/package.py b/var/spack/packages/py-gnuplot/package.py index 0a2c073a49..ede4472c03 100644 --- a/var/spack/packages/py-gnuplot/package.py +++ b/var/spack/packages/py-gnuplot/package.py @@ -8,6 +8,7 @@ class PyGnuplot(Package): version('1.8', 'abd6f571e7aec68ae7db90a5217cd5b1') extends('python') + depends_on('py-numpy') def install(self, spec, prefix): python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-libxml2/package.py b/var/spack/packages/py-libxml2/package.py index 0dcefbd9cf..e645acb5dd 100644 --- a/var/spack/packages/py-libxml2/package.py +++ b/var/spack/packages/py-libxml2/package.py @@ -8,6 +8,7 @@ class PyLibxml2(Package): version('2.6.21', '229dd2b3d110a77defeeaa73af83f7f3') extends('python') + depends_on('libxml2') def install(self, spec, prefix): python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-matplotlib/package.py b/var/spack/packages/py-matplotlib/package.py index 5979ceeab0..8b8684c563 100644 --- a/var/spack/packages/py-matplotlib/package.py +++ b/var/spack/packages/py-matplotlib/package.py @@ -17,9 +17,12 @@ class PyMatplotlib(Package): depends_on('py-pytz') depends_on('py-nose') depends_on('py-numpy') + depends_on('qt') + def install(self, spec, prefix): python('setup.py', 'install', '--prefix=%s' % prefix) + if str(self.version) == '1.4.2': # hack to fix configuration file config_file = None diff --git a/var/spack/packages/py-pyside/package.py b/var/spack/packages/py-pyside/package.py index b01e16d7e6..7528a0bf72 100644 --- a/var/spack/packages/py-pyside/package.py +++ b/var/spack/packages/py-pyside/package.py @@ -10,9 +10,32 @@ class PyPyside(Package): version('1.2.2', 'c45bc400c8a86d6b35f34c29e379e44d') extends('python') + depends_on('py-setuptools') + depends_on('qt@:4') + + + def patch(Self): + """Undo PySide RPATH handling and add Spack RPATH.""" + # Add Spack's standard CMake args to the sub-builds. + # They're called BY setup.py so we have to patch it. + filter_file( + r'OPTION_CMAKE,', + r'OPTION_CMAKE, ' + ( + '"-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=FALSE", ' + '"-DCMAKE_INSTALL_RPATH=%s",' % ':'.join(self.rpath)), + 'setup.py') + + # PySide tries to patch ELF files to remove RPATHs + # Disable this and go with the one we set. + filter_file( + r'rpath_cmd\(pyside_path, srcpath\)', + r'#rpath_cmd(pyside_path, srcpath)', + 'pyside_postinstall.py') + def install(self, spec, prefix): - qmake_path = '/usr/lib64/qt4/bin/qmake' - if not os.path.exists(qmake_path): - raise spack.package.InstallError("Failed to find qmake in %s" % qmake_path) - python('setup.py', 'install', '--prefix=%s' % prefix, '--qmake=%s' % qmake_path) + python('setup.py', 'install', + '--prefix=%s' % prefix, + '--jobs=%s' % make_jobs) + + diff --git a/var/spack/packages/py-shiboken/package.py b/var/spack/packages/py-shiboken/package.py new file mode 100644 index 0000000000..47abe64e65 --- /dev/null +++ b/var/spack/packages/py-shiboken/package.py @@ -0,0 +1,21 @@ +from spack import * + +class PyShiboken(Package): + """Shiboken generates bindings for C++ libraries using CPython source code.""" + homepage = "https://shiboken.readthedocs.org/" + url = "https://pypi.python.org/packages/source/S/Shiboken/Shiboken-1.2.2.tar.gz" + + version('1.2.2', '345cfebda221f525842e079a6141e555') + + # TODO: make build dependency + # depends_on("cmake") + + extends('python') + depends_on("py-setuptools") + depends_on("libxml2") + depends_on("qt@:4.8") + + def install(self, spec, prefix): + python('setup.py', 'install', + '--prefix=%s' % prefix, + '--jobs=%s' % make_jobs) diff --git a/var/spack/packages/python/package.py b/var/spack/packages/python/package.py index eed81d095c..4b3b31eb6b 100644 --- a/var/spack/packages/python/package.py +++ b/var/spack/packages/python/package.py @@ -1,9 +1,10 @@ -from spack import * -import spack import os import re from contextlib import closing +from spack import * +import spack + class Python(Package): """The Python programming language.""" -- cgit v1.2.3-70-g09d2 From 5c2608b032f04c063c437eca7d8360baaf6a2a16 Mon Sep 17 00:00:00 2001 From: "Gregory L. Lee" Date: Mon, 9 Feb 2015 15:55:18 -0800 Subject: typo: Self -> self --- var/spack/packages/py-pyside/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/packages/py-pyside/package.py b/var/spack/packages/py-pyside/package.py index 7528a0bf72..1fd037d75f 100644 --- a/var/spack/packages/py-pyside/package.py +++ b/var/spack/packages/py-pyside/package.py @@ -14,7 +14,7 @@ class PyPyside(Package): depends_on('qt@:4') - def patch(Self): + def patch(self): """Undo PySide RPATH handling and add Spack RPATH.""" # Add Spack's standard CMake args to the sub-builds. # They're called BY setup.py so we have to patch it. -- cgit v1.2.3-70-g09d2 From c0c08799249fb56c281f62b3659e7cf7d7080188 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sun, 15 Feb 2015 01:58:35 -0800 Subject: Better extension activation/deactivation --- lib/spack/spack/cmd/extensions.py | 4 +- lib/spack/spack/directory_layout.py | 150 +++++++++++++++++++++++++---------- lib/spack/spack/package.py | 19 ++++- var/spack/packages/python/package.py | 16 ++-- 4 files changed, 133 insertions(+), 56 deletions(-) (limited to 'var') diff --git a/lib/spack/spack/cmd/extensions.py b/lib/spack/spack/cmd/extensions.py index ae73d8ac55..fc8e6842c3 100644 --- a/lib/spack/spack/cmd/extensions.py +++ b/lib/spack/spack/cmd/extensions.py @@ -89,10 +89,10 @@ def extensions(parser, args): spack.cmd.find.display_specs(installed, mode=args.mode) # List specs of activated extensions. - activated = spack.install_layout.get_extensions(spec) + activated = spack.install_layout.extension_map(spec) print if not activated: tty.msg("None activated.") return tty.msg("%d currently activated:" % len(activated)) - spack.cmd.find.display_specs(activated, mode=args.mode) + spack.cmd.find.display_specs(activated.values(), mode=args.mode) diff --git a/lib/spack/spack/directory_layout.py b/lib/spack/spack/directory_layout.py index 37740720a2..562c0bd3ed 100644 --- a/lib/spack/spack/directory_layout.py +++ b/lib/spack/spack/directory_layout.py @@ -27,6 +27,7 @@ import os import exceptions import hashlib import shutil +import tempfile from contextlib import closing import llnl.util.tty as tty @@ -84,17 +85,38 @@ class DirectoryLayout(object): raise NotImplementedError() - def get_extensions(self, spec): - """Get a set of currently installed extension packages for a spec.""" + def extension_map(self, spec): + """Get a dict of currently installed extension packages for a spec. + + Dict maps { name : extension_spec } + Modifying dict does not affect internals of this layout. + """ + raise NotImplementedError() + + + def check_extension_conflict(self, spec, ext_spec): + """Ensure that ext_spec can be activated in spec. + + If not, raise ExtensionAlreadyInstalledError or + ExtensionConflictError. + """ + raise NotImplementedError() + + + def check_activated(self, spec, ext_spec): + """Ensure that ext_spec can be removed from spec. + + If not, raise NoSuchExtensionError. + """ raise NotImplementedError() - def add_extension(self, spec, extension_spec): + def add_extension(self, spec, ext_spec): """Add to the list of currently installed extensions.""" raise NotImplementedError() - def remove_extension(self, spec, extension_spec): + def remove_extension(self, spec, ext_spec): """Remove from the list of currently installed extensions.""" raise NotImplementedError() @@ -173,6 +195,8 @@ class SpecHashDirectoryLayout(DirectoryLayout): self.spec_file_name = spec_file_name self.extension_file_name = extension_file_name + # Cache of already written/read extension maps. + self._extension_maps = {} @property def hidden_file_paths(self): @@ -271,54 +295,94 @@ class SpecHashDirectoryLayout(DirectoryLayout): return join_path(self.path_for_spec(spec), self.extension_file_name) - def get_extensions(self, spec): + def _extension_map(self, spec): + """Get a dict spec> for all extensions currnetly + installed for this package.""" _check_concrete(spec) - extensions = set() - path = self.extension_file_path(spec) - if os.path.exists(path): - with closing(open(path)) as ext_file: - for line in ext_file: - try: - extensions.add(Spec(line.strip())) - except spack.error.SpackError, e: - raise InvalidExtensionSpecError(str(e)) - return extensions + if not spec in self._extension_maps: + path = self.extension_file_path(spec) + if not os.path.exists(path): + self._extension_maps[spec] = {} + + else: + exts = {} + with closing(open(path)) as ext_file: + for line in ext_file: + try: + spec = Spec(line.strip()) + exts[spec.name] = spec + except spack.error.SpackError, e: + # TODO: do something better here -- should be + # resilient to corrupt files. + raise InvalidExtensionSpecError(str(e)) + self._extension_maps[spec] = exts + + return self._extension_maps[spec] + + + def extension_map(self, spec): + """Defensive copying version of _extension_map() for external API.""" + return self._extension_map(spec).copy() + + + def check_extension_conflict(self, spec, ext_spec): + exts = self._extension_map(spec) + if ext_spec.name in exts: + installed_spec = exts[ext_spec.name] + if ext_spec == installed_spec: + raise ExtensionAlreadyInstalledError(spec, ext_spec) + else: + raise ExtensionConflictError(spec, ext_spec, installed_spec) + + def check_activated(self, spec, ext_spec): + exts = self._extension_map(spec) + if (not ext_spec.name in exts) or (ext_spec != exts[ext_spec.name]): + raise NoSuchExtensionError(spec, ext_spec) - def write_extensions(self, spec, extensions): + + def _write_extensions(self, spec, extensions): path = self.extension_file_path(spec) - with closing(open(path, 'w')) as spec_file: - for extension in sorted(extensions): - spec_file.write("%s\n" % extension) + + # Create a temp file in the same directory as the actual file. + dirname, basename = os.path.split(path) + tmp = tempfile.NamedTemporaryFile( + prefix=basename, dir=dirname, delete=False) + + # Write temp file. + with closing(tmp): + for extension in sorted(extensions.values()): + tmp.write("%s\n" % extension) + + # Atomic update by moving tmpfile on top of old one. + os.rename(tmp.name, path) - def add_extension(self, spec, extension_spec): + def add_extension(self, spec, ext_spec): _check_concrete(spec) - _check_concrete(extension_spec) + _check_concrete(ext_spec) - exts = self.get_extensions(spec) - if extension_spec in exts: - raise ExtensionAlreadyInstalledError(spec, extension_spec) - else: - for already_installed in exts: - if spec.name == extension_spec.name: - raise ExtensionConflictError(spec, extension_spec, already_installed) + # Check whether it's already installed or if it's a conflict. + exts = self.extension_map(spec) + self.check_extension_conflict(spec, ext_spec) - exts.add(extension_spec) - self.write_extensions(spec, exts) + # do the actual adding. + exts[ext_spec.name] = ext_spec + self._write_extensions(spec, exts) - def remove_extension(self, spec, extension_spec): + def remove_extension(self, spec, ext_spec): _check_concrete(spec) - _check_concrete(extension_spec) + _check_concrete(ext_spec) - exts = self.get_extensions(spec) - if not extension_spec in exts: - raise NoSuchExtensionError(spec, extension_spec) + # Make sure it's installed before removing. + exts = self.extension_map(spec) + self.check_activated(spec, ext_spec) - exts.remove(extension_spec) - self.write_extensions(spec, exts) + # do the actual removing. + del exts[ext_spec.name] + self._write_extensions(spec, exts) class DirectoryLayoutError(SpackError): @@ -365,24 +429,24 @@ class InvalidExtensionSpecError(DirectoryLayoutError): class ExtensionAlreadyInstalledError(DirectoryLayoutError): """Raised when an extension is added to a package that already has it.""" - def __init__(self, spec, extension_spec): + def __init__(self, spec, ext_spec): super(ExtensionAlreadyInstalledError, self).__init__( - "%s is already installed in %s" % (extension_spec.short_spec, spec.short_spec)) + "%s is already installed in %s" % (ext_spec.short_spec, spec.short_spec)) class ExtensionConflictError(DirectoryLayoutError): """Raised when an extension is added to a package that already has it.""" - def __init__(self, spec, extension_spec, conflict): + def __init__(self, spec, ext_spec, conflict): super(ExtensionConflictError, self).__init__( "%s cannot be installed in %s because it conflicts with %s."% ( - extension_spec.short_spec, spec.short_spec, conflict.short_spec)) + ext_spec.short_spec, spec.short_spec, conflict.short_spec)) class NoSuchExtensionError(DirectoryLayoutError): """Raised when an extension isn't there on remove.""" - def __init__(self, spec, extension_spec): + def __init__(self, spec, ext_spec): super(NoSuchExtensionError, self).__init__( "%s cannot be removed from %s because it's not installed."% ( - extension_spec.short_spec, spec.short_spec)) + ext_spec.short_spec, spec.short_spec)) diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index b18d054990..a624c1ebf5 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -534,7 +534,8 @@ class Package(object): if not self.is_extension: raise ValueError("is_extension called on package that is not an extension.") - return self.spec in spack.install_layout.get_extensions(self.extendee_spec) + exts = spack.install_layout.extension_map(self.extendee_spec) + return (self.name in exts) and (exts[self.name] == self.spec) def preorder_traversal(self, visited=None, **kwargs): @@ -987,6 +988,8 @@ class Package(object): activate() directly. """ self._sanity_check_extension() + spack.install_layout.check_extension_conflict(self.extendee_spec, self.spec) + self.extendee_spec.package.activate(self, **self.extendee_args) spack.install_layout.add_extension(self.extendee_spec, self.spec) @@ -1014,12 +1017,22 @@ class Package(object): tree.merge(self.prefix, ignore=ignore) - def do_deactivate(self): + def do_deactivate(self, **kwargs): """Called on the extension to invoke extendee's deactivate() method.""" + force = kwargs.get('force', False) + self._sanity_check_extension() + + # Allow a force deactivate to happen. This can unlink + # spurious files if something was corrupted. + if not force: + spack.install_layout.check_activated(self.extendee_spec, self.spec) + self.extendee_spec.package.deactivate(self, **self.extendee_args) - if self.spec in spack.install_layout.get_extensions(self.extendee_spec): + # redundant activation check -- makes SURE the spec is not + # still activated even if something was wrong above. + if self.activated: spack.install_layout.remove_extension(self.extendee_spec, self.spec) tty.msg("Deactivated extension %s for %s." diff --git a/var/spack/packages/python/package.py b/var/spack/packages/python/package.py index 4b3b31eb6b..de7f412b52 100644 --- a/var/spack/packages/python/package.py +++ b/var/spack/packages/python/package.py @@ -98,9 +98,9 @@ class Python(Package): return ignore - def write_easy_install_pth(self, extensions): + def write_easy_install_pth(self, exts): paths = [] - for ext in extensions: + for ext in sorted(exts.values()): ext_site_packages = os.path.join(ext.prefix, self.site_packages_dir) easy_pth = "%s/easy-install.pth" % ext_site_packages @@ -139,15 +139,15 @@ class Python(Package): args.update(ignore=self.python_ignore(ext_pkg, args)) super(Python, self).activate(ext_pkg, **args) - extensions = set(spack.install_layout.get_extensions(self.spec)) - extensions.add(ext_pkg.spec) - self.write_easy_install_pth(extensions) + exts = spack.install_layout.extension_map(self.spec) + exts[ext_pkg.name] = ext_pkg.spec + self.write_easy_install_pth(exts) def deactivate(self, ext_pkg, **args): args.update(ignore=self.python_ignore(ext_pkg, args)) super(Python, self).deactivate(ext_pkg, **args) - extensions = set(spack.install_layout.get_extensions(self.spec)) - extensions.remove(ext_pkg.spec) - self.write_easy_install_pth(extensions) + exts = spack.install_layout.extension_map(self.spec) + del exts[ext_pkg.name] + self.write_easy_install_pth(exts) -- cgit v1.2.3-70-g09d2 From 3c0048dd89e4d18ac95afd19b65d7ce54a48d862 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sun, 15 Feb 2015 01:59:36 -0800 Subject: py-sip installs properly into a prefix --- var/spack/packages/py-sip/package.py | 7 ++++++- var/spack/packages/python/package.py | 10 ++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'var') diff --git a/var/spack/packages/py-sip/package.py b/var/spack/packages/py-sip/package.py index 06aea35a74..6753bdd2a5 100644 --- a/var/spack/packages/py-sip/package.py +++ b/var/spack/packages/py-sip/package.py @@ -1,4 +1,5 @@ from spack import * +import os class PySip(Package): """SIP is a tool that makes it very easy to create Python bindings for C and C++ libraries.""" @@ -10,6 +11,10 @@ class PySip(Package): extends('python') def install(self, spec, prefix): - python('configure.py') + python('configure.py', + '--destdir=%s' % site_packages_dir, + '--bindir=%s' % spec.prefix.bin, + '--incdir=%s' % python_include_dir, + '--sipdir=%s' % os.path.join(spec.prefix.share, 'sip')) make() make('install') diff --git a/var/spack/packages/python/package.py b/var/spack/packages/python/package.py index de7f412b52..fb875a7eeb 100644 --- a/var/spack/packages/python/package.py +++ b/var/spack/packages/python/package.py @@ -42,6 +42,11 @@ class Python(Package): return os.path.join('lib', 'python%d.%d' % self.version[:2]) + @property + def python_include_dir(self): + return os.path.join('include', 'python%d.%d' % self.version[:2]) + + @property def site_packages_dir(self): return os.path.join(self.python_lib_dir, 'site-packages') @@ -58,8 +63,9 @@ class Python(Package): module.python = Executable(join_path(spec.prefix.bin, 'python')) # Add variables for lib/pythonX.Y and lib/pythonX.Y/site-packages dirs. - module.python_lib_dir = os.path.join(ext_spec.prefix, self.python_lib_dir) - module.site_packages_dir = os.path.join(ext_spec.prefix, self.site_packages_dir) + module.python_lib_dir = os.path.join(ext_spec.prefix, self.python_lib_dir) + module.python_include_dir = os.path.join(ext_spec.prefix, self.python_include_dir) + module.site_packages_dir = os.path.join(ext_spec.prefix, self.site_packages_dir) # Make the site packages directory if it does not exist already. mkdirp(module.site_packages_dir) -- cgit v1.2.3-70-g09d2 From 2f67cdaf10a3e64474f7ac242518fdfe93e9c87a Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sun, 15 Feb 2015 12:39:10 -0800 Subject: Better time output on build completion. --- lib/spack/spack/package.py | 16 ++++++++++++++-- var/spack/packages/py-pyqt/package.py | 21 +++++++++++++++++++++ var/spack/packages/py-pyqt4/package.py | 18 ------------------ 3 files changed, 35 insertions(+), 20 deletions(-) create mode 100644 var/spack/packages/py-pyqt/package.py delete mode 100644 var/spack/packages/py-pyqt4/package.py (limited to 'var') diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index a624c1ebf5..c48816cb5b 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -848,8 +848,8 @@ class Package(object): build_time = self._total_time - self._fetch_time tty.msg("Successfully installed %s." % self.name, - "Fetch: %.2f sec. Build: %.2f sec. Total: %.2f sec." - % (self._fetch_time, build_time, self._total_time)) + "Fetch: %s. Build: %s. Total: %s." + % (_hms(self._fetch_time), _hms(build_time), _hms(self._total_time))) print_pkg(self.prefix) # Use os._exit here to avoid raising a SystemExit exception, @@ -1201,6 +1201,18 @@ def print_pkg(message): print message +def _hms(seconds): + """Convert time in seconds to hours, minutes, seconds.""" + m, s = divmod(seconds, 60) + h, m = divmod(m, 60) + + parts = [] + if h: parts.append("%dh" % h) + if m: parts.append("%dm" % m) + if s: parts.append("%.2fs" % s) + return ' '.join(parts) + + class FetchError(spack.error.SpackError): """Raised when something goes wrong during fetch.""" def __init__(self, message, long_msg=None): diff --git a/var/spack/packages/py-pyqt/package.py b/var/spack/packages/py-pyqt/package.py new file mode 100644 index 0000000000..cb40af351a --- /dev/null +++ b/var/spack/packages/py-pyqt/package.py @@ -0,0 +1,21 @@ +from spack import * + +class PyPyqt(Package): + """PyQt is a set of Python v2 and v3 bindings for Digia's Qt + application framework and runs on all platforms supported by Qt + including Windows, MacOS/X and Linux.""" + homepage = "http://www.riverbankcomputing.com/software/pyqt/intro" + url = "http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.11.3/PyQt-x11-gpl-4.11.3.tar.gz" + + version('4.11.3', '997c3e443165a89a559e0d96b061bf70') + + extends('python') + depends_on('qt@4') # TODO: allow qt5 when conditional deps are supported. + depends_on('py-sip') + + def install(self, spec, prefix): + python('configure.py', + '--confirm-license', + '--destdir=%s' % site_packages_dir) + make() + make('install') diff --git a/var/spack/packages/py-pyqt4/package.py b/var/spack/packages/py-pyqt4/package.py deleted file mode 100644 index eeb1382560..0000000000 --- a/var/spack/packages/py-pyqt4/package.py +++ /dev/null @@ -1,18 +0,0 @@ -from spack import * - -class PyPyqt4(Package): - """PyQt is a set of Python v2 and v3 bindings for Digia's Qt application framework and runs on all platforms supported by Qt including Windows, MacOS/X and Linux.""" - homepage = "http://www.riverbankcomputing.com/software/pyqt/intro" - url = "http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.11.3/PyQt-x11-gpl-4.11.3.tar.gz" - - version('4.11.3', '997c3e443165a89a559e0d96b061bf70') - - extends('python') - depends_on('qt') - depends_on('py-sip') - - def install(self, spec, prefix): - version_array = str(spec['python'].version).split('.') - python('configure.py', '--confirm-license', '--destdir=%s/python%s.%s/site-packages' %(self.prefix.lib, version_array[0], version_array[1])) - make() - make('install') -- cgit v1.2.3-70-g09d2 From b11061f99d9e501f69d6d39bae56f0b69d17eaa1 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sun, 15 Feb 2015 12:40:02 -0800 Subject: Rename py-pyqt4 to py-pyqt. --- var/spack/packages/py-pyqt/package.py | 5 ++++- var/spack/packages/qt/package.py | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'var') diff --git a/var/spack/packages/py-pyqt/package.py b/var/spack/packages/py-pyqt/package.py index cb40af351a..8edca105bb 100644 --- a/var/spack/packages/py-pyqt/package.py +++ b/var/spack/packages/py-pyqt/package.py @@ -10,9 +10,12 @@ class PyPyqt(Package): version('4.11.3', '997c3e443165a89a559e0d96b061bf70') extends('python') - depends_on('qt@4') # TODO: allow qt5 when conditional deps are supported. depends_on('py-sip') + # TODO: allow qt5 when conditional deps are supported. + # TODO: Fix version matching so that @4 works like @:4 + depends_on('qt@:4') + def install(self, spec, prefix): python('configure.py', '--confirm-license', diff --git a/var/spack/packages/qt/package.py b/var/spack/packages/qt/package.py index fcbcd2491a..3b5096c4f0 100644 --- a/var/spack/packages/qt/package.py +++ b/var/spack/packages/qt/package.py @@ -43,9 +43,9 @@ class Qt(Package): '-fast', '-optimized-qmake', '-no-pch', -# phonon required for py-pyqt4 -# '-no-phonon', -# '-no-phonon-backend', + # phonon required for py-pyqt + # '-no-phonon', + # '-no-phonon-backend', '-no-openvg') make() make("install") -- cgit v1.2.3-70-g09d2 From ce011501f9b0184888ba2b6648fcf6d360f7c404 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sun, 15 Feb 2015 23:02:21 -0800 Subject: Add R package. --- var/spack/packages/R/package.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 var/spack/packages/R/package.py (limited to 'var') diff --git a/var/spack/packages/R/package.py b/var/spack/packages/R/package.py new file mode 100644 index 0000000000..2e6f65a742 --- /dev/null +++ b/var/spack/packages/R/package.py @@ -0,0 +1,33 @@ +from spack import * + +class R(Package): + """R is 'GNU S', a freely available language and environment for + statistical computing and graphics which provides a wide va + riety of statistical and graphical techniques: linear and + nonlinear modelling, statistical tests, time series analysis, + classification, clustering, etc. Please consult the R project + homepage for further information.""" + homepage = "http://www.example.com" + url = "http://cran.cnr.berkeley.edu/src/base/R-3/R-3.1.2.tar.gz" + + version('3.1.2', '3af29ec06704cbd08d4ba8d69250ae74') + + depends_on("readline") + depends_on("ncurses") + depends_on("icu") + depends_on("glib") + depends_on("zlib") + depends_on("libtiff") + depends_on("jpeg") + depends_on("cairo") + depends_on("pango") + depends_on("freetype") + depends_on("tcl") + depends_on("tk") + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix, + "--enable-R-shlib", + "--enable-BLAS-shlib") + make() + make("install") -- cgit v1.2.3-70-g09d2 From 36579844d9f105b5c9182beed83a65bf0bb556a9 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sun, 15 Feb 2015 23:02:36 -0800 Subject: Add Tcl/Tk packages. --- var/spack/packages/tcl/package.py | 22 ++++++++++++++++++++++ var/spack/packages/tk/package.py | 22 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 var/spack/packages/tcl/package.py create mode 100644 var/spack/packages/tk/package.py (limited to 'var') diff --git a/var/spack/packages/tcl/package.py b/var/spack/packages/tcl/package.py new file mode 100644 index 0000000000..529adf7788 --- /dev/null +++ b/var/spack/packages/tcl/package.py @@ -0,0 +1,22 @@ +from spack import * + +class Tcl(Package): + """Tcl (Tool Command Language) is a very powerful but easy to + learn dynamic programming language, suitable for a very wide + range of uses, including web and desktop applications, + networking, administration, testing and many more. Open source + and business-friendly, Tcl is a mature yet evolving language + that is truly cross platform, easily deployed and highly + extensible.""" + homepage = "http://www.tcl.tk" + + version('8.6.3', 'db382feca91754b7f93da16dc4cdad1f', + url="http://prdownloads.sourceforge.net/tcl/tcl8.6.3-src.tar.gz") + + depends_on('zlib') + + def install(self, spec, prefix): + with working_dir('unix'): + configure("--prefix=%s" % prefix) + make() + make("install") diff --git a/var/spack/packages/tk/package.py b/var/spack/packages/tk/package.py new file mode 100644 index 0000000000..96736f6f95 --- /dev/null +++ b/var/spack/packages/tk/package.py @@ -0,0 +1,22 @@ +from spack import * + +class Tk(Package): + """Tk is a graphical user interface toolkit that takes developing + desktop applications to a higher level than conventional + approaches. Tk is the standard GUI not only for Tcl, but for + many other dynamic languages, and can produce rich, native + applications that run unchanged across Windows, Mac OS X, Linux + and more.""" + homepage = "http://www.tcl.tk" + url = "http://prdownloads.sourceforge.net/tcl/tk8.6.3-src.tar.gz" + + version('src', '85ca4dbf4dcc19777fd456f6ee5d0221') + + depends_on("tcl") + + def install(self, spec, prefix): + with working_dir('unix'): + configure("--prefix=%s" % prefix, + "--with-tcl=%s" % spec['tcl'].prefix.lib) + make() + make("install") -- cgit v1.2.3-70-g09d2 From 65d60f92f5c479bdcf8b4cbfa244135a131d08f9 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sun, 15 Feb 2015 23:02:51 -0800 Subject: qhull package. --- var/spack/packages/qhull/package.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 var/spack/packages/qhull/package.py (limited to 'var') diff --git a/var/spack/packages/qhull/package.py b/var/spack/packages/qhull/package.py new file mode 100644 index 0000000000..9da4078a70 --- /dev/null +++ b/var/spack/packages/qhull/package.py @@ -0,0 +1,27 @@ +from spack import * + +class Qhull(Package): + """Qhull computes the convex hull, Delaunay triangulation, Voronoi + diagram, halfspace intersection about a point, furt hest-site + Delaunay triangulation, and furthest-site Voronoi diagram. The + source code runs in 2-d, 3-d, 4-d, and higher dimensions. Qhull + implements the Quickhull algorithm for computing the convex + hull. It handles roundoff errors from floating point + arithmetic. It computes volumes, surface areas, and + approximations to the convex hull. + + Qhull does not support triangulation of non-convex surfaces, + mesh generation of non-convex objects, medium-sized inputs in + 9-D and higher, alpha shapes, weighted Voronoi diagrams, + Voronoi volumes, or constrained Delaunay triangulations.""" + + homepage = "http://www.qhull.org" + + version('1.0', 'd0f978c0d8dfb2e919caefa56ea2953c', + url="http://www.qhull.org/download/qhull-2012.1-src.tgz") + + def install(self, spec, prefix): + with working_dir('spack-build', create=True): + cmake('..', *std_cmake_args) + make() + make("install") -- cgit v1.2.3-70-g09d2 From b86eb695523c235371169d0139486bcae15a7948 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sun, 15 Feb 2015 23:03:33 -0800 Subject: libgcrypt and libgpg-error packages. --- var/spack/packages/libgcrypt/package.py | 19 +++++++++++++++++++ var/spack/packages/libgpg-error/package.py | 17 +++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 var/spack/packages/libgcrypt/package.py create mode 100644 var/spack/packages/libgpg-error/package.py (limited to 'var') diff --git a/var/spack/packages/libgcrypt/package.py b/var/spack/packages/libgcrypt/package.py new file mode 100644 index 0000000000..1d0a57f317 --- /dev/null +++ b/var/spack/packages/libgcrypt/package.py @@ -0,0 +1,19 @@ +from spack import * + +class Libgcrypt(Package): + """Libgcrypt is a general purpose cryptographic library based on + the code from GnuPG. It provides functions for all cryptographic + building blocks: symmetric ciphers, hash algorithms, MACs, public + key algorithms, large integer functions, random numbers and a lot + of supporting functions. """ + homepage = "http://www.gnu.org/software/libgcrypt/" + url = "ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.6.2.tar.bz2" + + version('1.6.2', 'b54395a93cb1e57619943c082da09d5f') + + depends_on("libgpg-error") + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") diff --git a/var/spack/packages/libgpg-error/package.py b/var/spack/packages/libgpg-error/package.py new file mode 100644 index 0000000000..6c1d1a10a7 --- /dev/null +++ b/var/spack/packages/libgpg-error/package.py @@ -0,0 +1,17 @@ +from spack import * + +class LibgpgError(Package): + """Libgpg-error is a small library that defines common error + values for all GnuPG components. Among these are GPG, GPGSM, + GPGME, GPG-Agent, libgcrypt, Libksba, DirMngr, Pinentry, + SmartCard Daemon and possibly more in the future. """ + + homepage = "https://www.gnupg.org/related_software/libgpg-error" + url = "ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.18.tar.bz2" + + version('1.18', '12312802d2065774b787cbfc22cc04e9') + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") -- cgit v1.2.3-70-g09d2 From 847ed8ad399973477a7889b6367911f10c56f6bf Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sun, 15 Feb 2015 23:04:04 -0800 Subject: Add libxslt, cleanup libxml2. --- var/spack/packages/libxml2/package.py | 3 +++ var/spack/packages/libxslt/package.py | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 var/spack/packages/libxslt/package.py (limited to 'var') diff --git a/var/spack/packages/libxml2/package.py b/var/spack/packages/libxml2/package.py index 5eaed36d94..72199d8def 100644 --- a/var/spack/packages/libxml2/package.py +++ b/var/spack/packages/libxml2/package.py @@ -9,6 +9,9 @@ class Libxml2(Package): version('2.9.2', '9e6a9aca9d155737868b3dc5fd82f788') + depends_on('zlib') + depends_on('xz') + def install(self, spec, prefix): configure("--prefix=%s" % prefix, "--without-python") diff --git a/var/spack/packages/libxslt/package.py b/var/spack/packages/libxslt/package.py new file mode 100644 index 0000000000..f97332d020 --- /dev/null +++ b/var/spack/packages/libxslt/package.py @@ -0,0 +1,24 @@ +from spack import * + +class Libxslt(Package): + """Libxslt is the XSLT C library developed for the GNOME + project. XSLT itself is a an XML language to define + transformation for XML. Libxslt is based on libxml2 the XML C + library developed for the GNOME project. It also implements + most of the EXSLT set of processor-portable extensions + functions and some of Saxon's evaluate and expressions + extensions.""" + homepage = "http://www.xmlsoft.org/XSLT/index.html" + url = "http://xmlsoft.org/sources/libxslt-1.1.28.tar.gz" + + version('1.1.28', '9667bf6f9310b957254fdcf6596600b7') + + depends_on("libxml2") + depends_on("xz") + depends_on("zlib") + depends_on("libgcrypt") + + def install(self, spec, prefix): + configure("--prefix=%s" % prefix) + make() + make("install") -- cgit v1.2.3-70-g09d2 From 8aa3afcfde9cebd34fdb534141c258c214ae4132 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sun, 15 Feb 2015 23:04:20 -0800 Subject: Python package cleanup. - Added a number of dependencies to python packages. - Python packages may still not build without some OS support. - Example: Numpy needs ATLAS, and will use a system ATLAS install. - Atlas requires turning off CPU throttling to build. - can't do this as a regular user -- how to build ATLAS with Spack - currnetly relying on a system ATLAS install. --- var/spack/packages/py-libxml2/package.py | 1 + var/spack/packages/py-matplotlib/package.py | 6 +++++- var/spack/packages/py-pyside/package.py | 1 - var/spack/packages/py-rpy2/package.py | 2 ++ var/spack/packages/py-scientificpython/package.py | 6 +++++- var/spack/packages/py-shiboken/package.py | 19 +++++++++++++++++++ 6 files changed, 32 insertions(+), 3 deletions(-) (limited to 'var') diff --git a/var/spack/packages/py-libxml2/package.py b/var/spack/packages/py-libxml2/package.py index e645acb5dd..59005428e4 100644 --- a/var/spack/packages/py-libxml2/package.py +++ b/var/spack/packages/py-libxml2/package.py @@ -9,6 +9,7 @@ class PyLibxml2(Package): extends('python') depends_on('libxml2') + depends_on('libxslt') def install(self, spec, prefix): python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-matplotlib/package.py b/var/spack/packages/py-matplotlib/package.py index 8b8684c563..f6b9c587fd 100644 --- a/var/spack/packages/py-matplotlib/package.py +++ b/var/spack/packages/py-matplotlib/package.py @@ -17,8 +17,12 @@ class PyMatplotlib(Package): depends_on('py-pytz') depends_on('py-nose') depends_on('py-numpy') - depends_on('qt') + depends_on('qt') + depends_on('bzip2') + depends_on('tcl') + depends_on('tk') + depends_on('qhull') def install(self, spec, prefix): python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-pyside/package.py b/var/spack/packages/py-pyside/package.py index 1fd037d75f..c165d9b3bf 100644 --- a/var/spack/packages/py-pyside/package.py +++ b/var/spack/packages/py-pyside/package.py @@ -13,7 +13,6 @@ class PyPyside(Package): depends_on('py-setuptools') depends_on('qt@:4') - def patch(self): """Undo PySide RPATH handling and add Spack RPATH.""" # Add Spack's standard CMake args to the sub-builds. diff --git a/var/spack/packages/py-rpy2/package.py b/var/spack/packages/py-rpy2/package.py index 3817059911..dd0c0672af 100644 --- a/var/spack/packages/py-rpy2/package.py +++ b/var/spack/packages/py-rpy2/package.py @@ -10,5 +10,7 @@ class PyRpy2(Package): extends('python') depends_on('py-setuptools') + depends_on('R') + def install(self, spec, prefix): python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-scientificpython/package.py b/var/spack/packages/py-scientificpython/package.py index 73600e6cb9..020d830703 100644 --- a/var/spack/packages/py-scientificpython/package.py +++ b/var/spack/packages/py-scientificpython/package.py @@ -1,7 +1,11 @@ from spack import * class PyScientificpython(Package): - """ScientificPython is a collection of Python modules for scientific computing. It contains support for geometry, mathematical functions, statistics, physical units, IO, visualization, and parallelization.""" + """ScientificPython is a collection of Python modules for + scientific computing. It contains support for geometry, + mathematical functions, statistics, physical units, IO, + visualization, and parallelization.""" + homepage = "https://sourcesup.renater.fr/projects/scientific-py/" url = "https://sourcesup.renater.fr/frs/download.php/4411/ScientificPython-2.8.1.tar.gz" diff --git a/var/spack/packages/py-shiboken/package.py b/var/spack/packages/py-shiboken/package.py index 47abe64e65..e900947939 100644 --- a/var/spack/packages/py-shiboken/package.py +++ b/var/spack/packages/py-shiboken/package.py @@ -15,6 +15,25 @@ class PyShiboken(Package): depends_on("libxml2") depends_on("qt@:4.8") + def patch(self): + """Undo Shiboken RPATH handling and add Spack RPATH.""" + # Add Spack's standard CMake args to the sub-builds. + # They're called BY setup.py so we have to patch it. + filter_file( + r'OPTION_CMAKE,', + r'OPTION_CMAKE, ' + ( + '"-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=FALSE", ' + '"-DCMAKE_INSTALL_RPATH=%s",' % ':'.join(self.rpath)), + 'setup.py') + + # Shiboken tries to patch ELF files to remove RPATHs + # Disable this and go with the one we set. + filter_file( + r'^\s*rpath_cmd\(shiboken_path, srcpath\)', + r'#rpath_cmd(shiboken_path, srcpath)', + 'shiboken_postinstall.py') + + def install(self, spec, prefix): python('setup.py', 'install', '--prefix=%s' % prefix, -- cgit v1.2.3-70-g09d2 From 614c22fc1b1ac10c85ed9e27a1e59eeb88de0898 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Mon, 16 Feb 2015 12:41:22 -0800 Subject: Allow forced deactivation -- best effort unlinking spack deactivate -f will unlink even if Spack thinks the package isn't enabled. Made deactivate routines idempotent. --- lib/spack/llnl/util/link_tree.py | 4 ++++ lib/spack/spack/cmd/deactivate.py | 7 +++++-- lib/spack/spack/cmd/find.py | 3 +++ var/spack/packages/python/package.py | 5 +++-- 4 files changed, 15 insertions(+), 4 deletions(-) (limited to 'var') diff --git a/lib/spack/llnl/util/link_tree.py b/lib/spack/llnl/util/link_tree.py index 4e4e48316e..4d778eca1e 100644 --- a/lib/spack/llnl/util/link_tree.py +++ b/lib/spack/llnl/util/link_tree.py @@ -175,6 +175,10 @@ class LinkTree(object): kwargs['order'] = 'post' for src, dest in traverse_tree(self._root, dest_root, **kwargs): if os.path.isdir(src): + # Skip non-existing links. + if not os.path.exists(dest): + continue + if not os.path.isdir(dest): raise ValueError("File blocks directory: %s" % dest) diff --git a/lib/spack/spack/cmd/deactivate.py b/lib/spack/spack/cmd/deactivate.py index fd13f051df..f37dfd79ed 100644 --- a/lib/spack/spack/cmd/deactivate.py +++ b/lib/spack/spack/cmd/deactivate.py @@ -30,6 +30,9 @@ import spack.cmd description = "Deactivate a package extension." def setup_parser(subparser): + subparser.add_argument( + '-f', '--force', action='store_true', + help="Run deactivation even if spec is NOT currently activated.") subparser.add_argument( 'spec', nargs=argparse.REMAINDER, help="spec of package extension to deactivate.") @@ -44,7 +47,7 @@ def deactivate(parser, args): spack.db.get(specs[0]) spec = spack.cmd.disambiguate_spec(specs[0]) - if not spec.package.activated: + if not args.force and not spec.package.activated: tty.die("Package %s is not activated." % specs[0].short_spec) - spec.package.do_deactivate() + spec.package.do_deactivate(force=args.force) diff --git a/lib/spack/spack/cmd/find.py b/lib/spack/spack/cmd/find.py index f6f503afe5..dee1dfece7 100644 --- a/lib/spack/spack/cmd/find.py +++ b/lib/spack/spack/cmd/find.py @@ -122,5 +122,8 @@ def find(parser, args): if not args.mode: args.mode = 'short' + + if sys.stdout.isatty(): + tty.msg("%d installed packages." % len(specs)) display_specs(specs, mode=args.mode) diff --git a/var/spack/packages/python/package.py b/var/spack/packages/python/package.py index fb875a7eeb..705d002e80 100644 --- a/var/spack/packages/python/package.py +++ b/var/spack/packages/python/package.py @@ -155,5 +155,6 @@ class Python(Package): super(Python, self).deactivate(ext_pkg, **args) exts = spack.install_layout.extension_map(self.spec) - del exts[ext_pkg.name] - self.write_easy_install_pth(exts) + if ext_pkg.name in exts: # Make deactivate idempotent. + del exts[ext_pkg.name] + self.write_easy_install_pth(exts) -- cgit v1.2.3-70-g09d2 From 13376efafc42c6eeb1bf0ad3b35f509924f1a6df Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Mon, 16 Feb 2015 21:53:34 -0800 Subject: Add package-specific rpath back to shiboken and pyside. --- var/spack/packages/py-pyside/package.py | 13 ++++++++++--- var/spack/packages/py-shiboken/package.py | 7 ++++++- 2 files changed, 16 insertions(+), 4 deletions(-) (limited to 'var') diff --git a/var/spack/packages/py-pyside/package.py b/var/spack/packages/py-pyside/package.py index c165d9b3bf..6583431124 100644 --- a/var/spack/packages/py-pyside/package.py +++ b/var/spack/packages/py-pyside/package.py @@ -1,5 +1,4 @@ from spack import * -import spack.package import os class PyPyside(Package): @@ -9,25 +8,33 @@ class PyPyside(Package): version('1.2.2', 'c45bc400c8a86d6b35f34c29e379e44d') + # TODO: make build dependency + # depends_on("cmake") + extends('python') depends_on('py-setuptools') depends_on('qt@:4') def patch(self): """Undo PySide RPATH handling and add Spack RPATH.""" + # Figure out the special RPATH + pypkg = self.spec['python'].package + rpath = self.rpath + rpath.append(os.path.join(self.prefix, pypkg.site_packages_dir, 'PySide')) + # Add Spack's standard CMake args to the sub-builds. # They're called BY setup.py so we have to patch it. filter_file( r'OPTION_CMAKE,', r'OPTION_CMAKE, ' + ( '"-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=FALSE", ' - '"-DCMAKE_INSTALL_RPATH=%s",' % ':'.join(self.rpath)), + '"-DCMAKE_INSTALL_RPATH=%s",' % ':'.join(rpath)), 'setup.py') # PySide tries to patch ELF files to remove RPATHs # Disable this and go with the one we set. filter_file( - r'rpath_cmd\(pyside_path, srcpath\)', + r'^\s*rpath_cmd\(pyside_path, srcpath\)', r'#rpath_cmd(pyside_path, srcpath)', 'pyside_postinstall.py') diff --git a/var/spack/packages/py-shiboken/package.py b/var/spack/packages/py-shiboken/package.py index e900947939..e4bf4ce07e 100644 --- a/var/spack/packages/py-shiboken/package.py +++ b/var/spack/packages/py-shiboken/package.py @@ -1,4 +1,5 @@ from spack import * +import os class PyShiboken(Package): """Shiboken generates bindings for C++ libraries using CPython source code.""" @@ -19,11 +20,15 @@ class PyShiboken(Package): """Undo Shiboken RPATH handling and add Spack RPATH.""" # Add Spack's standard CMake args to the sub-builds. # They're called BY setup.py so we have to patch it. + pypkg = self.spec['python'].package + rpath = self.rpath + rpath.append(os.path.join(self.prefix, pypkg.site_packages_dir, 'Shiboken')) + filter_file( r'OPTION_CMAKE,', r'OPTION_CMAKE, ' + ( '"-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=FALSE", ' - '"-DCMAKE_INSTALL_RPATH=%s",' % ':'.join(self.rpath)), + '"-DCMAKE_INSTALL_RPATH=%s",' % ':'.join(rpath)), 'setup.py') # Shiboken tries to patch ELF files to remove RPATHs -- cgit v1.2.3-70-g09d2 From 06d6b0b205095f849ace216aa51393b907cf821b Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Mon, 16 Feb 2015 21:53:55 -0800 Subject: More py-setuptools dependencies added. --- var/spack/packages/py-ipython/package.py | 1 + var/spack/packages/py-mpi4py/package.py | 1 + var/spack/packages/py-nose/package.py | 1 + var/spack/packages/py-pylint/package.py | 4 ++-- var/spack/packages/py-virtualenv/package.py | 1 + 5 files changed, 6 insertions(+), 2 deletions(-) (limited to 'var') diff --git a/var/spack/packages/py-ipython/package.py b/var/spack/packages/py-ipython/package.py index 731e661dfd..907ea9edcd 100644 --- a/var/spack/packages/py-ipython/package.py +++ b/var/spack/packages/py-ipython/package.py @@ -9,6 +9,7 @@ class PyIpython(Package): extends('python') depends_on('py-pygments') + depends_on('py-setuptools') def install(self, spec, prefix): python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-mpi4py/package.py b/var/spack/packages/py-mpi4py/package.py index fdea340dc2..8001689a18 100644 --- a/var/spack/packages/py-mpi4py/package.py +++ b/var/spack/packages/py-mpi4py/package.py @@ -7,6 +7,7 @@ class PyMpi4py(Package): version('1.3.1', 'dbe9d22bdc8ed965c23a7ceb6f32fc3c') extends('python') + depends_on('py-setuptools') depends_on('mpi') def install(self, spec, prefix): diff --git a/var/spack/packages/py-nose/package.py b/var/spack/packages/py-nose/package.py index 6df84e831d..b902a35fbb 100644 --- a/var/spack/packages/py-nose/package.py +++ b/var/spack/packages/py-nose/package.py @@ -10,6 +10,7 @@ class PyNose(Package): version('1.3.4', '6ed7169887580ddc9a8e16048d38274d') extends('python') + depends_on('py-setuptools') def install(self, spec, prefix): python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-pylint/package.py b/var/spack/packages/py-pylint/package.py index ebde861f94..7a6ee7dbbc 100644 --- a/var/spack/packages/py-pylint/package.py +++ b/var/spack/packages/py-pylint/package.py @@ -8,9 +8,9 @@ class PyPylint(Package): version('1.4.1', 'df7c679bdcce5019389038847e4de622') -# extends('python') - extends('python', ignore=lambda f:re.match(r"site.py*", f)) + extends('python') depends_on('py-nose') + depends_on('py-setuptools') def install(self, spec, prefix): python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-virtualenv/package.py b/var/spack/packages/py-virtualenv/package.py index c1b359e164..9d94c2dcda 100644 --- a/var/spack/packages/py-virtualenv/package.py +++ b/var/spack/packages/py-virtualenv/package.py @@ -9,6 +9,7 @@ class PyVirtualenv(Package): version('1.11.6', 'f61cdd983d2c4e6aeabb70b1060d6f49') extends('python') + depends_on('py-setuptools') def clean(self): if os.path.exists('build'): -- cgit v1.2.3-70-g09d2 From 67db8ddca8ac7ab9adeb827a7dadd34a385b2b6b Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Tue, 17 Feb 2015 00:21:15 -0800 Subject: Factor ignore logic into a predicate builder. --- lib/spack/llnl/util/lang.py | 31 +++++++++++++++++++++++++++++++ var/spack/packages/python/package.py | 25 +++++++++++-------------- 2 files changed, 42 insertions(+), 14 deletions(-) (limited to 'var') diff --git a/lib/spack/llnl/util/lang.py b/lib/spack/llnl/util/lang.py index db15da0506..332367f537 100644 --- a/lib/spack/llnl/util/lang.py +++ b/lib/spack/llnl/util/lang.py @@ -291,6 +291,37 @@ def check_kwargs(kwargs, fun): % (next(kwargs.iterkeys()), fun.__name__)) +def match_predicate(*args): + """Utility function for making string matching predicates. + + Each arg can be a: + - regex + - list or tuple of regexes + - predicate that takes a string. + + This returns a predicate that is true if: + - any arg regex matches + - any regex in a list or tuple of regexes matches. + - any predicate in args matches. + """ + def match(string): + for arg in args: + if isinstance(arg, basestring): + if re.search(arg, string): + return True + elif isinstance(arg, list) or isinstance(arg, tuple): + if any(re.search(i, string) for i in arg): + return True + elif callable(arg): + if arg(string): + return True + else: + raise ValueError("args to match_predicate must be regex, " + "list of regexes, or callable.") + return False + return match + + class RequiredAttributeError(ValueError): def __init__(self, message): super(RequiredAttributeError, self).__init__(message) diff --git a/var/spack/packages/python/package.py b/var/spack/packages/python/package.py index 705d002e80..31a12ea653 100644 --- a/var/spack/packages/python/package.py +++ b/var/spack/packages/python/package.py @@ -1,6 +1,7 @@ import os import re from contextlib import closing +from llnl.util.lang import match_predicate from spack import * import spack @@ -85,23 +86,19 @@ class Python(Package): def python_ignore(self, ext_pkg, args): """Add some ignore files to activate/deactivate args.""" - orig_ignore = args.get('ignore', lambda f: False) + ignore_arg = args.get('ignore', lambda f: False) - def ignore(filename): - # Always ignore easy-install.pth, as it needs to be merged. - patterns = [r'easy-install\.pth$'] + # Always ignore easy-install.pth, as it needs to be merged. + patterns = [r'easy-install\.pth$'] - # Ignore pieces of setuptools installed by other packages. - if ext_pkg.name != 'py-setuptools': - patterns.append(r'/site\.pyc?$') - patterns.append(r'setuptools\.pth') - patterns.append(r'bin/easy_install[^/]*$') - patterns.append(r'setuptools.*egg$') + # Ignore pieces of setuptools installed by other packages. + if ext_pkg.name != 'py-setuptools': + patterns.append(r'/site\.pyc?$') + patterns.append(r'setuptools\.pth') + patterns.append(r'bin/easy_install[^/]*$') + patterns.append(r'setuptools.*egg$') - return (any(re.search(p, filename) for p in patterns) or - orig_ignore(filename)) - - return ignore + return match_predicate(ignore_arg, patterns) def write_easy_install_pth(self, exts): -- cgit v1.2.3-70-g09d2 From 57f331e2acf75c5bf4c464d0df888fd882295a68 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Tue, 17 Feb 2015 00:22:18 -0800 Subject: Ignore conflicting nose tests in py-nose and py-matplotlib. --- var/spack/packages/py-matplotlib/package.py | 3 ++- var/spack/packages/py-nose/package.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'var') diff --git a/var/spack/packages/py-matplotlib/package.py b/var/spack/packages/py-matplotlib/package.py index f6b9c587fd..04037f004e 100644 --- a/var/spack/packages/py-matplotlib/package.py +++ b/var/spack/packages/py-matplotlib/package.py @@ -8,7 +8,8 @@ class PyMatplotlib(Package): version('1.4.2', '7d22efb6cce475025733c50487bd8898') - extends('python') + extends('python', ignore=r'bin/nosetests.*$') + depends_on('py-pyside') depends_on('py-ipython') depends_on('py-pyparsing') diff --git a/var/spack/packages/py-nose/package.py b/var/spack/packages/py-nose/package.py index b902a35fbb..155019289d 100644 --- a/var/spack/packages/py-nose/package.py +++ b/var/spack/packages/py-nose/package.py @@ -9,7 +9,7 @@ class PyNose(Package): version('1.3.4', '6ed7169887580ddc9a8e16048d38274d') - extends('python') + extends('python', ignore=r'bin/nosetests.*$') depends_on('py-setuptools') def install(self, spec, prefix): -- cgit v1.2.3-70-g09d2 From 724b72bdaf5c7c569e502e383e2aadcb8105983c Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Tue, 17 Feb 2015 00:47:35 -0800 Subject: take out dyninst 8.2 for now. - doesn't build correctly with boost 1.55 --- var/spack/packages/dyninst/package.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'var') diff --git a/var/spack/packages/dyninst/package.py b/var/spack/packages/dyninst/package.py index 2e6f3e010a..f3d661f9a9 100644 --- a/var/spack/packages/dyninst/package.py +++ b/var/spack/packages/dyninst/package.py @@ -31,8 +31,9 @@ class Dyninst(Package): 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" - version('8.2.1', 'abf60b7faabe7a2e4b54395757be39c7', - url="http://www.paradyn.org/release8.2/DyninstAPI-8.2.1.tgz") +# Doesn't build right with boost@1.55.0 +# version('8.2.1', 'abf60b7faabe7a2e4b54395757be39c7', +# url="http://www.paradyn.org/release8.2/DyninstAPI-8.2.1.tgz") version('8.1.2', 'bf03b33375afa66fe0efa46ce3f4b17a', url="http://www.paradyn.org/release8.1.2/DyninstAPI-8.1.2.tgz") version('8.1.1', 'd1a04e995b7aa70960cd1d1fac8bd6ac', @@ -40,7 +41,7 @@ class Dyninst(Package): depends_on("libelf") depends_on("libdwarf") - depends_on("boost@1.42:1.43") + depends_on("boost@1.42:") # new version uses cmake def install(self, spec, prefix): -- cgit v1.2.3-70-g09d2 From 44003449d594e9ba8ea1adaed84c7c938b439972 Mon Sep 17 00:00:00 2001 From: "Gregory L. Lee" Date: Tue, 17 Feb 2015 16:26:00 -0800 Subject: fixed install steps for version 4 --- var/spack/packages/qt/package.py | 55 ++++++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 19 deletions(-) (limited to 'var') diff --git a/var/spack/packages/qt/package.py b/var/spack/packages/qt/package.py index 30f46c08dc..1535bd5948 100644 --- a/var/spack/packages/qt/package.py +++ b/var/spack/packages/qt/package.py @@ -63,24 +63,41 @@ class Qt(Package): def install(self, spec, prefix): - # Apparently this is the only way to - # "truly" get rid of webkit compiles now... - os.rename("qtwebkit","no-qtwebkit") - os.rename("qtwebkit-examples","no-qtwebkit-examples") - configure('-v', - '-confirm-license', - '-opensource', - '-prefix', prefix, - '-openssl-linked', - '-dbus-linked', - #'-fast', - '-opengl', - '-qt-xcb', - '-optimized-qmake', - '-no-pch', - # phonon required for py-pyqt - # '-no-phonon', - # '-no-phonon-backend', - '-no-openvg') + if self.spec.satisfies('@4'): + configure('-v', + '-confirm-license', + '-opensource', + '-prefix', prefix, + '-openssl-linked', + '-dbus-linked', + #'-fast', + '-opengl', + '-optimized-qmake', + '-no-pch', + # phonon required for py-pyqt + # '-no-phonon', + # '-no-phonon-backend', + '-no-openvg') + elif self.spec.satisfies('@5'): + # Apparently this is the only way to + # "truly" get rid of webkit compiles now... + os.rename("qtwebkit","no-qtwebkit") + os.rename("qtwebkit-examples","no-qtwebkit-examples") + + configure('-v', + '-confirm-license', + '-opensource', + '-prefix', prefix, + '-openssl-linked', + '-dbus-linked', + #'-fast', + '-opengl', + '-qt-xcb', + '-optimized-qmake', + '-no-pch', + # phonon required for py-pyqt + # '-no-phonon', + # '-no-phonon-backend', + '-no-openvg') make() make("install") -- cgit v1.2.3-70-g09d2 From 959ce4f98577c872c69a29a30a2e0659e12cff75 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Wed, 18 Feb 2015 10:43:29 -0800 Subject: Downgrade standard version of ImageMagick to a non-changing URL. - bleeding edge still available but commented by default. --- var/spack/packages/ImageMagick/package.py | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'var') diff --git a/var/spack/packages/ImageMagick/package.py b/var/spack/packages/ImageMagick/package.py index 657b9255a3..753ea80ca6 100644 --- a/var/spack/packages/ImageMagick/package.py +++ b/var/spack/packages/ImageMagick/package.py @@ -3,18 +3,32 @@ from spack import * class Imagemagick(Package): """ImageMagick is a image processing library""" homepage = "http://www.imagemagic.org" - url = "http://www.imagemagick.org/download/ImageMagick-6.8.9-10.tar.gz" - version('6.9.0-0', '2cf094cb86ec518fa5bc669ce2d21613') - version('6.8.9-10', 'aa050bf9785e571c956c111377bbf57c') - version('6.8.9-9', 'e63fed3e3550851328352c708f800676') + #------------------------------------------------------------------------- + # ImageMagick does not keep around anything but *-10 versions, so + # this URL may change. If you want the bleeding edge, you can + # uncomment it and see if it works but you may need to try to + # fetch a newer version (-6, -7, -8, -9, etc.) or you can stick + # wtih the older, stable, archived -10 versions below. + # + # TODO: would be nice if spack had a way to recommend avoiding a + # TODO: bleeding edge version, but not comment it out. + # ------------------------------------------------------------------------- + # version('6.9.0-6', 'c1bce7396c22995b8bdb56b7797b4a1b', + # url="http://www.imagemagick.org/download/ImageMagick-6.9.0-6.tar.bz2") + + #------------------------------------------------------------------------- + # *-10 versions are archived, so these versions should fetch reliably. + # ------------------------------------------------------------------------- + version('6.8.9-10', 'aa050bf9785e571c956c111377bbf57c', + url="http://sourceforge.net/projects/imagemagick/files/old-sources/6.x/6.8/ImageMagick-6.8.9-10.tar.gz/download") depends_on('libtool') depends_on('jpeg') depends_on('libpng') depends_on('freetype') depends_on('fontconfig') -# depends_on('libtiff') + depends_on('libtiff') def install(self, spec, prefix): configure("--prefix=%s" % prefix) -- cgit v1.2.3-70-g09d2 From 3e5aa4b0f5c2b1fba3a81abb465298de93009532 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Wed, 18 Feb 2015 10:58:10 -0800 Subject: llvm/clang version bump --- var/spack/packages/clang/package.py | 5 ++--- var/spack/packages/llvm/package.py | 14 ++++++-------- 2 files changed, 8 insertions(+), 11 deletions(-) (limited to 'var') diff --git a/var/spack/packages/clang/package.py b/var/spack/packages/clang/package.py index b0097bd126..4f10385dbd 100644 --- a/var/spack/packages/clang/package.py +++ b/var/spack/packages/clang/package.py @@ -29,11 +29,10 @@ class Clang(Package): Objective C and Objective C++ front-end for the LLVM compiler. """ homepage = "http://clang.llvm.org" - url = "http://llvm.org/releases/3.4.2/cfe-3.4.2.src.tar.gz" + list_url = "http://llvm.org/releases/download.html" depends_on("llvm") - - version('3.4.2', '87945973b7c73038871c5f849a818588') + version('3.4.2', '87945973b7c73038871c5f849a818588', url='http://llvm.org/releases/3.4.2/cfe-3.4.2.src.tar.xz') def install(self, spec, prefix): env['CXXFLAGS'] = self.compiler.cxx11_flag diff --git a/var/spack/packages/llvm/package.py b/var/spack/packages/llvm/package.py index 69354a5c90..9d2be690bb 100644 --- a/var/spack/packages/llvm/package.py +++ b/var/spack/packages/llvm/package.py @@ -32,15 +32,13 @@ class Llvm(Package): it is the full name of the project. """ homepage = "http://llvm.org/" - url = "http://llvm.org/releases/3.4.2/llvm-3.4.2.src.tar.gz" + list_url = "http://llvm.org/releases/download.html" - version('3.4.2', 'a20669f75967440de949ac3b1bad439c') - version('3.0', 'a8e5f5f1c1adebae7b4a654c376a6005', - url='http://llvm.org/releases/3.0/llvm-3.0.tar.gz') - version('2.9', '793138412d2af2c7c7f54615f8943771', - url='http://llvm.org/releases/2.9/llvm-2.9.tgz') - version('2.8', '220d361b4d17051ff4bb21c64abe05ba', - url='http://llvm.org/releases/2.8/llvm-2.8.tgz') + version('3.5.1', '2d3d8004f38852aa679e5945b8ce0b14', url='http://llvm.org/releases/3.5.1/llvm-3.5.1.src.tar.xz') + version('3.4.2', 'a20669f75967440de949ac3b1bad439c', url='http://llvm.org/releases/3.4.2/llvm-3.4.2.src.tar.gz') + version('3.0', 'a8e5f5f1c1adebae7b4a654c376a6005', url='http://llvm.org/releases/3.0/llvm-3.0.tar.gz') + version('2.9', '793138412d2af2c7c7f54615f8943771', url='http://llvm.org/releases/2.9/llvm-2.9.tgz') + version('2.8', '220d361b4d17051ff4bb21c64abe05ba', url='http://llvm.org/releases/2.8/llvm-2.8.tgz') def install(self, spec, prefix): env['CXXFLAGS'] = self.compiler.cxx11_flag -- cgit v1.2.3-70-g09d2 From 6e13d0985cf457b3d2b64908c6652ec4fc2349f0 Mon Sep 17 00:00:00 2001 From: "Gregory L. Lee" Date: Wed, 18 Feb 2015 13:13:19 -0800 Subject: fixed deps for python packages --- var/spack/packages/py-dateutil/package.py | 1 + var/spack/packages/py-six/package.py | 1 + 2 files changed, 2 insertions(+) (limited to 'var') diff --git a/var/spack/packages/py-dateutil/package.py b/var/spack/packages/py-dateutil/package.py index 11699e07ee..3bd2f2ca13 100644 --- a/var/spack/packages/py-dateutil/package.py +++ b/var/spack/packages/py-dateutil/package.py @@ -9,6 +9,7 @@ class PyDateutil(Package): extends('python') depends_on('py-setuptools') + depends_on('py-six') def install(self, spec, prefix): python('setup.py', 'install', '--prefix=%s' % prefix) diff --git a/var/spack/packages/py-six/package.py b/var/spack/packages/py-six/package.py index 04d29adced..05c5bd00a9 100644 --- a/var/spack/packages/py-six/package.py +++ b/var/spack/packages/py-six/package.py @@ -8,6 +8,7 @@ class PySix(Package): version('1.9.0', '476881ef4012262dfc8adc645ee786c4') extends('python') + depends_on('py-setuptools') def install(self, spec, prefix): python('setup.py', 'install', '--prefix=%s' % prefix) -- cgit v1.2.3-70-g09d2 From db113733513345059b0a6d36aae8cddc56e6560a Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Wed, 18 Feb 2015 11:08:25 -0800 Subject: Resurrect combined qt4/5 package from b7dacb --- var/spack/packages/qt/package.py | 77 +++++++++++++++++++++------------------- 1 file changed, 41 insertions(+), 36 deletions(-) (limited to 'var') diff --git a/var/spack/packages/qt/package.py b/var/spack/packages/qt/package.py index 1535bd5948..1dc3e1e51d 100644 --- a/var/spack/packages/qt/package.py +++ b/var/spack/packages/qt/package.py @@ -62,42 +62,47 @@ class Qt(Package): filter_file(r'^QMAKE_CXX *=.*$', 'QMAKE_CXX = c++', qmake_conf) + + @property + def common_config_args(self): + return [ + '-prefix', self.prefix, + '-v', + '-opensource', + '-opengl', + "-release", + '-shared', + '-confirm-license', + '-openssl-linked', + '-dbus-linked', + '-optimized-qmake', + '-no-openvg', + '-no-pch', + # NIS is deprecated in more recent glibc + "-no-nis", + # For now, disable all the database drivers + "-no-sql-db2", "-no-sql-ibase", "-no-sql-mysql", "-no-sql-oci", "-no-sql-odbc", + "-no-sql-psql", "-no-sql-sqlite", "-no-sql-sqlite2", "-no-sql-tds"] + + + @when('@4') + def configure(self): + configure('-fast', + '-no-webkit', + *self.common_config_args) + + + @when('@5') + def configure(self): + configure('-no-eglfs', + '-no-directfb', + '-qt-xcb', + # If someone wants to get a webkit build working, be my guest! + '-skip', 'qtwebkit', + *self.common_config_args) + + def install(self, spec, prefix): - if self.spec.satisfies('@4'): - configure('-v', - '-confirm-license', - '-opensource', - '-prefix', prefix, - '-openssl-linked', - '-dbus-linked', - #'-fast', - '-opengl', - '-optimized-qmake', - '-no-pch', - # phonon required for py-pyqt - # '-no-phonon', - # '-no-phonon-backend', - '-no-openvg') - elif self.spec.satisfies('@5'): - # Apparently this is the only way to - # "truly" get rid of webkit compiles now... - os.rename("qtwebkit","no-qtwebkit") - os.rename("qtwebkit-examples","no-qtwebkit-examples") - - configure('-v', - '-confirm-license', - '-opensource', - '-prefix', prefix, - '-openssl-linked', - '-dbus-linked', - #'-fast', - '-opengl', - '-qt-xcb', - '-optimized-qmake', - '-no-pch', - # phonon required for py-pyqt - # '-no-phonon', - # '-no-phonon-backend', - '-no-openvg') + self.configure() make() make("install") -- cgit v1.2.3-70-g09d2 From c7b8a4e25cde8c2f32e514fdfe5280feca42e4ea Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Wed, 18 Feb 2015 14:00:37 -0800 Subject: Fix for SPACK-46: cleanup spack clean, spack restage. --- lib/spack/spack/cmd/clean.py | 29 +++--------------- lib/spack/spack/cmd/restage.py | 46 +++++++++++++++++++++++++++++ lib/spack/spack/package.py | 21 +++---------- var/spack/packages/libdwarf/package.py | 7 ----- var/spack/packages/py-virtualenv/package.py | 4 --- 5 files changed, 54 insertions(+), 53 deletions(-) create mode 100644 lib/spack/spack/cmd/restage.py (limited to 'var') diff --git a/lib/spack/spack/cmd/clean.py b/lib/spack/spack/cmd/clean.py index ec3b221988..c20136ebe5 100644 --- a/lib/spack/spack/cmd/clean.py +++ b/lib/spack/spack/cmd/clean.py @@ -1,5 +1,5 @@ ############################################################################## -# Copyright (c) 2013, Lawrence Livermore National Security, LLC. +# Copyright (c) 2013-2014, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. @@ -23,45 +23,24 @@ # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## from external import argparse -import subprocess import llnl.util.tty as tty import spack import spack.cmd -import spack.stage as stage -description = "Remove staged files for packages" +description = "Remove build stage and source tarball for packages." def setup_parser(subparser): - subparser.add_argument('-c', "--clean", action="store_true", dest='clean', - help="run make clean in the build directory (default)") - subparser.add_argument('-w', "--work", action="store_true", dest='work', - help="delete the build directory and re-expand it from its archive.") - subparser.add_argument('-d', "--dist", action="store_true", dest='dist', - help="delete the downloaded archive.") subparser.add_argument('packages', nargs=argparse.REMAINDER, help="specs of packages to clean") def clean(parser, args): if not args.packages: - tty.die("spack clean requires at least one package argument") + tty.die("spack clean requires at least one package spec.") specs = spack.cmd.parse_specs(args.packages, concretize=True) for spec in specs: package = spack.db.get(spec) - if args.dist: - package.do_clean_dist() - tty.msg("Cleaned %s" % package.name) - - elif args.work: - package.do_clean_work() - tty.msg("Restaged %s" % package.name) - - else: - try: - package.do_clean() - except subprocess.CalledProcessError, e: - tty.warn("Warning: 'make clean' didn't work. Consider 'spack clean --work'.") - tty.msg("Made clean for %s" % package.name) + package.do_clean() diff --git a/lib/spack/spack/cmd/restage.py b/lib/spack/spack/cmd/restage.py new file mode 100644 index 0000000000..e735a12c32 --- /dev/null +++ b/lib/spack/spack/cmd/restage.py @@ -0,0 +1,46 @@ +############################################################################## +# Copyright (c) 2013-2014, 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 external import argparse + +import llnl.util.tty as tty + +import spack +import spack.cmd + +description = "Revert checked out package source code." + +def setup_parser(subparser): + subparser.add_argument('packages', nargs=argparse.REMAINDER, + help="specs of packages to restage") + + +def restage(parser, args): + if not args.packages: + tty.die("spack restage requires at least one package spec.") + + specs = spack.cmd.parse_specs(args.packages, concretize=True) + for spec in specs: + package = spack.db.get(spec) + package.do_restage() diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index bc8541a184..492af12053 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -1047,26 +1047,13 @@ class Package(object): tree.unmerge(self.prefix, ignore=ignore) - def do_clean(self): - if self.stage.expanded_archive_path: - self.stage.chdir_to_source() - self.clean() - - - def clean(self): - """By default just runs make clean. Override if this isn't good.""" - # TODO: should we really call make clean, ro just blow away the directory? - make = build_env.MakeExecutable('make', self.parallel) - make('clean') - - - def do_clean_work(self): - """By default just blows away the stage directory and re-stages.""" + def do_restage(self): + """Reverts expanded/checked out source to a pristine state.""" self.stage.restage() - def do_clean_dist(self): - """Removes the stage directory where this package was built.""" + def do_clean(self): + """Removes the package's build stage and source tarball.""" if os.path.exists(self.stage.path): self.stage.destroy() diff --git a/var/spack/packages/libdwarf/package.py b/var/spack/packages/libdwarf/package.py index c4d71ebc01..099a974e93 100644 --- a/var/spack/packages/libdwarf/package.py +++ b/var/spack/packages/libdwarf/package.py @@ -53,13 +53,6 @@ class Libdwarf(Package): parallel = False - 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') diff --git a/var/spack/packages/py-virtualenv/package.py b/var/spack/packages/py-virtualenv/package.py index 9d94c2dcda..2d10d440a6 100644 --- a/var/spack/packages/py-virtualenv/package.py +++ b/var/spack/packages/py-virtualenv/package.py @@ -11,9 +11,5 @@ class PyVirtualenv(Package): extends('python') depends_on('py-setuptools') - def clean(self): - if os.path.exists('build'): - shutil.rmtree('build') - def install(self, spec, prefix): python('setup.py', 'install', '--prefix=%s' % prefix) -- cgit v1.2.3-70-g09d2 From 14e70ad68959097bcfa4bda38cbafe8d1e71127b Mon Sep 17 00:00:00 2001 From: Saravan Pantham Date: Wed, 18 Feb 2015 18:05:57 -0800 Subject: Added netcdf package support. --- var/spack/packages/netcdf/package.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 var/spack/packages/netcdf/package.py (limited to 'var') diff --git a/var/spack/packages/netcdf/package.py b/var/spack/packages/netcdf/package.py new file mode 100644 index 0000000000..34284ea725 --- /dev/null +++ b/var/spack/packages/netcdf/package.py @@ -0,0 +1,28 @@ +from spack import * + +class Netcdf(Package): + """NetCDF is a set of software libraries and self-describing, machine-independent + data formats that support the creation, access, and sharing of array-oriented + scientific data.""" + + homepage = "http://www.unidata.ucar.edu/software/netcdf/" + url = "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.3.3.tar.gz" + + version('4.3.3', '5fbd0e108a54bd82cb5702a73f56d2ae') + + # Dependencies: + # >HDF5 + depends_on("hdf5") + + def install(self, spec, prefix): + configure( + "--prefix=%s" % prefix, + "--disable-dap", # Disable DAP. + "--disable-shared", # Don't build shared libraries (use static libs). + "CPPFLAGS=-I%s/include" % spec['hdf5'].prefix, # Link HDF5's include dir. + "LDFLAGS=-L%s/lib" % spec['hdf5'].prefix) # Link HDF5's lib dir. + + make("install") + + # Check the newly installed netcdf package. Currently disabled. + # make("check") -- cgit v1.2.3-70-g09d2 From daef78f53853f30d342c6f3f650f04b25d7457f2 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Mon, 23 Feb 2015 10:31:22 -0800 Subject: Update packaging documentataion. --- lib/spack/docs/packaging_guide.rst | 235 +++++++++++++++++++++----------- var/spack/packages/py-pyside/package.py | 2 - 2 files changed, 156 insertions(+), 81 deletions(-) (limited to 'var') diff --git a/lib/spack/docs/packaging_guide.rst b/lib/spack/docs/packaging_guide.rst index e5ebdb4cd2..48986f8065 100644 --- a/lib/spack/docs/packaging_guide.rst +++ b/lib/spack/docs/packaging_guide.rst @@ -16,16 +16,17 @@ There are two key parts of Spack: software according to a spec. Specs allow a user to describe a *particular* build in a way that a -package author can understand. Packages allow a developer to -encapsulate the logic build logic for different versions, compilers, +package author can understand. Packages allow a the packager to +encapsulate the build logic for different versions, compilers, options, platforms, and dependency combinations in one place. +Essentially, a package translates a spec into build logic. Packages in Spack are written in pure Python, so you can do anything in Spack that you can do in Python. Python was chosen as the implementation language for two reasons. First, Python is becoming -ubiquitous in the HPC community due to its use in numerical codes. -Second, it's a modern language and has many powerful features to help -make package writing easy. +ubiquitous in the scientific software community. Second, it's a modern +language and has many powerful features to help make package writing +easy. Creating & Editing Packages ---------------------------------- @@ -35,24 +36,23 @@ Creating & Editing Packages ``spack create`` ~~~~~~~~~~~~~~~~~~~~~ -The ``spack create`` command generates boilerplate package template -from a URL pointing to a tarball or other software archive. In most -cases, you'll only need to run this once, then slightly modify the -boilerplate to get your package working. +The ``spack create`` command generates a boilerplate package template +from a URL. The URL should point to a tarball or other software +archive. In most cases, ``spack create`` plus a few modifications is +all you need to get a package working. -All you need is the URL to a tarball (other archive formats are ok -too) you want to package: +Here's an example: .. code-block:: sh $ spack create http://www.cmake.org/files/v2.8/cmake-2.8.12.1.tar.gz -When you run this, Spack looks at the tarball URL and tries to figure -out the name of the package to be created. It also tries to determine -out what version strings look like for this package. Using this -information, it tries to find *additional* versions by spidering the -package's webpage. If it finds multiple versions, Spack prompts you -to tell it how many versions you want to download and checksum. +Spack examines the tarball URL and tries to figure out the name of the +package to be created. It also tries to determine what version strings +look like for this package. Using this information, it will try to +find *additional* versions by spidering the package's webpage. If it +finds multiple versions, Spack prompts you to tell it how many +versions you want to download and checksum: .. code-block:: sh @@ -63,12 +63,6 @@ to tell it how many versions you want to download and checksum. 2.8.12.1 http://www.cmake.org/files/v2.8/cmake-2.8.12.1.tar.gz 2.8.12 http://www.cmake.org/files/v2.8/cmake-2.8.12.tar.gz 2.8.11.2 http://www.cmake.org/files/v2.8/cmake-2.8.11.2.tar.gz - 2.8.11.1 http://www.cmake.org/files/v2.8/cmake-2.8.11.1.tar.gz - 2.8.11 http://www.cmake.org/files/v2.8/cmake-2.8.11.tar.gz - 2.8.10.2 http://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gz - 2.8.10.1 http://www.cmake.org/files/v2.8/cmake-2.8.10.1.tar.gz - 2.8.10 http://www.cmake.org/files/v2.8/cmake-2.8.10.tar.gz - 2.8.9 http://www.cmake.org/files/v2.8/cmake-2.8.9.tar.gz ... 2.8.0 http://www.cmake.org/files/v2.8/cmake-2.8.0.tar.gz @@ -77,10 +71,30 @@ to tell it how many versions you want to download and checksum. Spack will automatically download the number of tarballs you specify (starting with the most recent) and checksum each of them. -Note that you don't need to do everything up front. If your package -is large, you can always choose to download just one tarball for now, -then run :ref:`spack checksum ` later if you end up -wanting more. Let's say you choose to download 3 tarballs: +You do not *have* to download all of the versions up front. You can +always choose to download just one tarball initially, and run +:ref:`spack checksum ` later if you need more. + +.. note:: + + If ``spack create`` fails to detect the package name correctly, + you can try supplying it yourself, e.g.:: + + $ spack create --name cmake http://www.cmake.org/files/v2.8/cmake-2.8.12.1.tar.gz + + If it fails entirely, you can get minimal boilerplate by using + :ref:`spack-edit-f`, or you can manually create a directory and + ``package.py`` file for the package in ``var/spack/packages``. + +.. note:: + + Spack can fetch packages from source code repositories, but, + ``spack create`` will *not* currently create a boilerplate package + from a repository URL. You will need to use :ref:`spack-edit-f` + and manually edit the ``version()`` directives to fetch from a + repo. See :ref:`vcs-fetch` for details. + +Let's say you download 3 tarballs: .. code-block:: sh @@ -93,8 +107,8 @@ wanting more. Let's say you choose to download 3 tarballs: ==> Fetching http://www.cmake.org/files/v2.8/cmake-2.8.11.2.tar.gz #################################################################### 95.2% -Now Spack generates boilerplate code and opens the new -``package.py`` file in your favorite ``$EDITOR``: +Now Spack generates boilerplate code and opens a new ``package.py`` +file in your favorite ``$EDITOR``: .. code-block:: python :linenos: @@ -141,12 +155,6 @@ Now Spack generates boilerplate code and opens the new The tedious stuff (creating the class, checksumming archives) has been done for you. -.. note:: - - If ``spack create`` fails to download or to detect the package - version, you can use ``spack edit -f`` to generate simpler - boilerplate. See the next section for more on this. - In the generated package, the download ``url`` attribute is already set. All the things you still need to change are marked with ``FIXME`` labels. The first ``FIXME`` refers to the commented @@ -199,27 +207,30 @@ The ``cmake`` package actually lives in a much simpler shortcut and saves you the trouble of typing the full path. - -``spack edit -f`` -~~~~~~~~~~~~~~~~~~~~ If you try to edit a package that doesn't exist, Spack will recommend -using ``spack create``: +using ``spack create`` or ``spack edit -f``: .. code-block:: sh $ spack edit foo ==> Error: No package 'foo'. Use spack create, or supply -f/--force to edit a new file. -As the output advises, You can use ``spack edit -f/--force`` to force -the creation of a new, *very* simple boilerplate package: +.. _spack-edit-f: + +``spack edit -f`` +~~~~~~~~~~~~~~~~~~~~ + +``spack edit -f`` can be used to create a new, minimal boilerplate +package: .. code-block:: sh $ spack edit -f foo -Unlike ``spack create``, which tries to infer names and versions, and -which actually downloads the tarball and checksums it for you, ``spack -edit -f`` will substitute dummy values for you to fill in yourself: +Unlike ``spack create``, which infers names and versions, and which +actually downloads the tarball and checksums it for you, ``spack edit +-f`` has no such fanciness. It will substitute dummy values for you +to fill in yourself: .. code-block:: python :linenos: @@ -246,6 +257,13 @@ version of your package from the archive URL. Naming & Directory Structure -------------------------------------- +.. note:: + + Spack's default naming and directory structure will change in + version 0.9. Specifically, 0.9 will stop using directory names + with special characters like ``@``, to avoid interfering with + certain packages that do not handle this well. + This section describes how packages need to be named, and where they live in Spack's directory structure. In general, `spack-create`_ and `spack-edit`_ handle creating package files for you, so you can skip @@ -264,6 +282,7 @@ package: .. command-output:: cd $SPACK_ROOT/var/spack/packages; ls -CF :shell: + :ellipsis: 10 Each directory contains a file called ``package.py``, which is where all the python code for the package goes. For example, the ``libelf`` @@ -280,11 +299,9 @@ Package Names Packages are named after the directory containing ``package.py``. So, ``libelf``'s ``package.py`` lives in a directory called ``libelf``. -The ``package.py`` file contains a class called ``Libelf``, which -extends Spack's ``Package`` class. This is what makes it a Spack -package: - -``var/spack/packages/libelf/package.py`` +The ``package.py`` file defines a class called ``Libelf``, which +extends Spack's ``Package`` class. for example, here is +``$SPACK_ROOT/var/spack/packages/libelf/package.py``: .. code-block:: python :linenos: @@ -301,8 +318,9 @@ package: def install(): ... -The **directory name** (``libelf``) is what users need to provide on -the command line. e.g., if you type any of these: +The **directory name** (``libelf``) determines the package name that +users should provide on the command line. e.g., if you type any of +these: .. code-block:: sh @@ -311,8 +329,8 @@ the command line. e.g., if you type any of these: Spack sees the package name in the spec and looks for ``libelf/package.py`` in ``var/spack/packages``. Likewise, if you say -``spack install docbook-xml``, then Spack looks for -``docbook-xml/package.py``. +``spack install py-numpy``, then Spack looks for +``py-numpy/package.py``. Spack uses the directory name as the package name in order to give packagers more freedom in naming their packages. Package names can @@ -342,8 +360,7 @@ some examples: ================= ================= In general, you won't have to remember this naming convention because -`spack-create`_ and `spack-edit`_ will generate boilerplate for you, -and you can just fill in the blanks. +`spack-create`_ and `spack-edit`_ handle the details for you. Adding new versions @@ -381,9 +398,8 @@ For the URL above, you might have to add an explicit URL because the version can't simply be substituted in the original ``url`` to construct the new one for ``8.2.1``. -Wehn you supply a custom URL for a version, Spack uses that URL -*verbatim* when fetching the version, and will *not* perform -extrapolation. +When you supply a custom URL for a version, Spack uses that URL +*verbatim* and does not perform extrapolation. Checksums ~~~~~~~~~~~~~~~~~ @@ -392,10 +408,11 @@ Spack uses a checksum to ensure that the downloaded package version is not corrupted or compromised. This is especially important when fetching from insecure sources, like unencrypted http. By default, a package will *not* be installed if it doesn't pass a checksum test -(though users can overried this with ``spack install --no-checksum``). +(though you can override this with ``spack install --no-checksum``). Spack can currently support checksums using the MD5, SHA-1, SHA-224, -SHA-256, SHA-384, and SHA-512 algorithms. +SHA-256, SHA-384, and SHA-512 algorithms. It determines the algorithm +to use based on the hash length. ``spack md5`` ^^^^^^^^^^^^^^^^^^^^^^ @@ -459,16 +476,18 @@ By default, Spack will search for new tarball downloads by scraping the parent directory of the tarball you gave it. So, if your tarball is at ``http://example.com/downloads/foo-1.0.tar.gz``, Spack will look in ``http://example.com/downloads/`` for links to additional versions. -If you need to search another path for download links, see the -reference documentation on `attribute_list_url`_ and +If you need to search another path for download links, you can supply +some extra attributes that control how your package finds new +versions. See the documentation on `attribute_list_url`_ and `attributee_list_depth`_. .. note:: * This command assumes that Spack can extrapolate new URLs from an existing URL in the package, and that Spack can find similar URLs - on a webpage. If that's not possible, you'll need to manually add - ``version`` calls yourself. + on a webpage. If that's not possible, e.g. if the package's + developers don't name their tarballs consistently, you'll need to + manually add ``version`` calls yourself. * For ``spack checksum`` to work, Spack needs to be able to ``import`` your pacakge in Python. That means it can't have any @@ -481,32 +500,33 @@ reference documentation on `attribute_list_url`_ and Fetching from VCS Repositories -------------------------------------- -For some packages, source code is hosted in a Version Control System -(VCS) repository rather than as a tarball. Packages can be set up to -fetch from a repository instead of a tarball. Currently, Spack -supports fetching with `Git `_, `Mercurial (hg) -`_, and `Subversion (SVN) `_. +For some packages, source code is provided in a Version Control System +(VCS) repository rather than in a tarball. Spack can fetch packages +from VCS repositories. Currently, Spack supports fetching with `Git +`_, `Mercurial (hg) `_, and `Subversion (SVN) +`_. To fetch a package from a source repository, you add a ``version()`` call to your package with parameters indicating the repository URL and -any branch, tag, or revision to fetch. See below for the paramters +any branch, tag, or revision to fetch. See below for the parameters you'll need for each VCS system. Repositories and versions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The package author is responsible for coming up with a sensible name -for each version. For example, if you're fetching from a tag like -``v1.0``, you might call that ``1.0``. If you're fetching a nameless -git commit or an older subversion revision, you might give the commit -an intuitive name, like ``dev`` for a development version, or -``some-fancy-new-feature`` if you want to be more specific. +for each version to be fetched from a repository. For example, if +you're fetching from a tag like ``v1.0``, you might call that ``1.0``. +If you're fetching a nameless git commit or an older subversion +revision, you might give the commit an intuitive name, like ``dev`` +for a development version, or ``some-fancy-new-feature`` if you want +to be more specific. In general, it's recommended to fetch tags or particular commits/revisions, NOT branches or the repository mainline, as branches move forward over time and you aren't guaranteed to get the same thing every time you fetch a particular version. Life isn't -simple, though, so this is not strictly enforced. +always simple, though, so this is not strictly enforced. In some future release, Spack may support extrapolating repository versions as it does for tarball URLs, but currently this is not @@ -633,7 +653,7 @@ Subversion To fetch with subversion, use the ``svn`` and ``revision`` parameters: -Head +Fetching the head Simply add an ``svn`` parameter to ``version``: .. code-block:: python @@ -642,7 +662,7 @@ Head This is not recommended, as the head will move forward over time. -Revisions +Fetching a revision To fetch a particular revision, add a ``revision`` to the version call: @@ -746,6 +766,53 @@ from the URL and then applied to your source code. applies cleanly with ``-p1``, but if you're using a patch you didn't create yourself, ``level`` can be handy. +``patch()`` functions +~~~~~~~~~~~~~~~~~~~~~~~~ + +In addition to supplying patch files, you can write a custom function +to patch a package's source. For example, the ``py-pyside`` package +contains some custom code for tweaking the way the PySide build +handles ``RPATH``: + +.. code-block:: python + :linenos: + + class PyPyside(Package): + ... + + def patch(self): + """Undo PySide RPATH handling and add Spack RPATH.""" + # Figure out the special RPATH + pypkg = self.spec['python'].package + rpath = self.rpath + rpath.append(os.path.join(self.prefix, pypkg.site_packages_dir, 'PySide')) + + # Add Spack's standard CMake args to the sub-builds. + # They're called BY setup.py so we have to patch it. + filter_file( + r'OPTION_CMAKE,', + r'OPTION_CMAKE, ' + ( + '"-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=FALSE", ' + '"-DCMAKE_INSTALL_RPATH=%s",' % ':'.join(rpath)), + 'setup.py') + + # PySide tries to patch ELF files to remove RPATHs + # Disable this and go with the one we set. + filter_file( + r'^\s*rpath_cmd\(pyside_path, srcpath\)', + r'#rpath_cmd(pyside_path, srcpath)', + 'pyside_postinstall.py') + +A ``patch`` function, if present, will be run after patch files are +applied and before ``install()`` is run. + +You could put this logic in ``install()``, but putting it in a patch +function gives you some benefits. First, spack ensures that the +``patch()`` function is run once per code checkout. That means that +if you run install, hit ctrl-C, and run install again, the code in the +patch function is only run once. Also, you can tell Spack to run only the patching part of the build using the .. + + Finding Package Downloads ---------------------------- @@ -1932,6 +1999,8 @@ A typical package workflow might look like this: Below are some commands that will allow you some finer-grained controll over the install process. +.. _spack-fetch: + ``spack fetch`` ~~~~~~~~~~~~~~~~~ @@ -1944,6 +2013,8 @@ directory will be located under ``$SPACK_HOME/var/spack``. When run after the archive has already been downloaded, ``spack fetch`` is idempotent and will not download the archive again. +.. _spack-stage: + ``spack stage`` ~~~~~~~~~~~~~~~~~ @@ -1952,6 +2023,8 @@ the downloaded archive in its temporary directory, where it will be built by ``spack install``. Similar to ``fetch``, if the archive has already been expanded, ``stage`` is idempotent. +.. _spack-patch: + ``spack patch`` ~~~~~~~~~~~~~~~~~ @@ -1963,7 +2036,6 @@ this step if they have been. If Spack discovers that patches didn't apply cleanly on some previous run, then it will restage the entire package before patching. - ``spack clean`` ~~~~~~~~~~~~~~~~~ @@ -2035,6 +2107,11 @@ to get rid of the install prefix before you build again: Graphing Dependencies -------------------------- +.. _spack-graph: + +``spack graph`` +~~~~~~~~~~~~~~~~~~~ + Spack provides the ``spack graph`` command for graphing dependencies. The command by default generates an ASCII rendering of a spec's dependency graph. For example:: diff --git a/var/spack/packages/py-pyside/package.py b/var/spack/packages/py-pyside/package.py index 6583431124..bb5da44d02 100644 --- a/var/spack/packages/py-pyside/package.py +++ b/var/spack/packages/py-pyside/package.py @@ -43,5 +43,3 @@ class PyPyside(Package): python('setup.py', 'install', '--prefix=%s' % prefix, '--jobs=%s' % make_jobs) - - -- cgit v1.2.3-70-g09d2 From ffdb90f39a56e5f0dacefd19ccf85ddd0e7a01c0 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Tue, 24 Feb 2015 10:42:35 -0800 Subject: Last minute Qt bugfix. --- var/spack/packages/qt/package.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'var') diff --git a/var/spack/packages/qt/package.py b/var/spack/packages/qt/package.py index 1dc3e1e51d..4a9a867511 100644 --- a/var/spack/packages/qt/package.py +++ b/var/spack/packages/qt/package.py @@ -79,10 +79,9 @@ class Qt(Package): '-no-openvg', '-no-pch', # NIS is deprecated in more recent glibc - "-no-nis", - # For now, disable all the database drivers - "-no-sql-db2", "-no-sql-ibase", "-no-sql-mysql", "-no-sql-oci", "-no-sql-odbc", - "-no-sql-psql", "-no-sql-sqlite", "-no-sql-sqlite2", "-no-sql-tds"] + "-no-nis"] + # Don't disable all the database drivers, but should + # really get them into spack at some point. @when('@4') -- cgit v1.2.3-70-g09d2