diff options
-rw-r--r-- | lib/spack/docs/basic_usage.rst | 1 | ||||
-rw-r--r-- | lib/spack/llnl/util/lang.py | 58 | ||||
-rw-r--r-- | var/spack/packages/stat/configure_mpicxx.patch | 19 | ||||
-rw-r--r-- | var/spack/packages/stat/package.py | 2 |
4 files changed, 79 insertions, 1 deletions
diff --git a/lib/spack/docs/basic_usage.rst b/lib/spack/docs/basic_usage.rst index 47dc754077..65637f5c74 100644 --- a/lib/spack/docs/basic_usage.rst +++ b/lib/spack/docs/basic_usage.rst @@ -509,7 +509,6 @@ You can see what virtual packages a particular package provides by getting info on it: .. command-output:: spack info mpich - :ellipsis: 10 Spack is unique in that its virtual packages can be versioned, just like regular packages. A particular version of a package may provide diff --git a/lib/spack/llnl/util/lang.py b/lib/spack/llnl/util/lang.py index 9a21c5be5c..7590fb1298 100644 --- a/lib/spack/llnl/util/lang.py +++ b/lib/spack/llnl/util/lang.py @@ -32,6 +32,64 @@ import inspect ignore_modules = [r'^\.#', '~$'] +def index_by(objects, *funcs): + """Create a hierarchy of dictionaries by splitting the supplied + set of objects on unique values of the supplied functions. + Values are used as keys. For example, suppose you have four + objects with attributes that look like this: + + a = Spec(name="boost", compiler="gcc", arch="bgqos_0") + b = Spec(name="mrnet", compiler="intel", arch="chaos_5_x86_64_ib") + c = Spec(name="libelf", compiler="xlc", arch="bgqos_0") + d = Spec(name="libdwarf", compiler="intel", arch="chaos_5_x86_64_ib") + + list_of_specs = [a,b,c,d] + index1 = index_by(list_of_specs, lambda s: s.arch, lambda s: s.compiler) + index2 = index_by(list_of_specs, lambda s: s.compiler) + + ``index1'' now has two levels of dicts, with lists at the + leaves, like this: + + { 'bgqos_0' : { 'gcc' : [a], 'xlc' : [c] }, + 'chaos_5_x86_64_ib' : { 'intel' : [b, d] } + } + + And ``index2'' is a single level dictionary of lists that looks + like this: + + { 'gcc' : [a], + 'intel' : [b,d], + 'xlc' : [c] + } + + If any elemnts in funcs is a string, it is treated as the name + of an attribute, and acts like getattr(object, name). So + shorthand for the above two indexes would be: + + index1 = index_by(list_of_specs, 'arch', 'compiler') + index2 = index_by(list_of_specs, 'compiler') + """ + if not funcs: + return objects + + f = funcs[0] + if isinstance(f, basestring): + f = lambda x: getattr(x, funcs[0]) + + result = {} + for o in objects: + key = f(o) + if key not in result: + result[key] = [o] + else: + result[key].append(o) + + for key, objects in result.items(): + result[key] = index_by(objects, *funcs[1:]) + + return result + + def partition_list(elements, predicate): """Partition a list into two lists, the first containing elements for which the predicate evaluates to true, the second containing diff --git a/var/spack/packages/stat/configure_mpicxx.patch b/var/spack/packages/stat/configure_mpicxx.patch new file mode 100644 index 0000000000..e09056d95c --- /dev/null +++ b/var/spack/packages/stat/configure_mpicxx.patch @@ -0,0 +1,19 @@ +commit 07ab6e565f939c54fff6580fc8463ea61662871a +Author: Gregory L. Lee <lee218@llnl.gov> +Date: Tue May 20 14:53:35 2014 -0700 + + re-boostrap to update configure + +diff --git a/configure b/configure +index 6c4af7d..30901ea 100755 +--- a/configure ++++ b/configure +@@ -15529,7 +15529,7 @@ fi + done + test -n "$MPICC" || MPICC="$CC" + +- for ac_prog in mpig++ mpiicpc mpxlC mpixlC ++ for ac_prog in mpig++ mpiCC mpicxx mpiicpc mpxlC mpixlC + do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 diff --git a/var/spack/packages/stat/package.py b/var/spack/packages/stat/package.py index 3585c5465a..9f156d53e7 100644 --- a/var/spack/packages/stat/package.py +++ b/var/spack/packages/stat/package.py @@ -14,6 +14,8 @@ class Stat(Package): depends_on('launchmon') depends_on('mrnet') + patch('configure_mpicxx.patch', when='@2.1.0:') + def install(self, spec, prefix): configure( "--enable-gui", |