summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/spack/spack/cmd/info.py2
-rw-r--r--lib/spack/spack/cmd/package-list.py18
-rw-r--r--lib/spack/spack/package.py17
-rw-r--r--lib/spack/spack/test/__init__.py3
-rw-r--r--var/spack/packages/qthreads/package.py22
5 files changed, 41 insertions, 21 deletions
diff --git a/lib/spack/spack/cmd/info.py b/lib/spack/spack/cmd/info.py
index 3e4ff627d5..eafafc601a 100644
--- a/lib/spack/spack/cmd/info.py
+++ b/lib/spack/spack/cmd/info.py
@@ -68,7 +68,7 @@ def print_text_info(pkg):
print
print "Description:"
if pkg.__doc__:
- print format_doc(pkg, indent=4)
+ print pkg.format_doc(indent=4)
else:
print " None"
diff --git a/lib/spack/spack/cmd/package-list.py b/lib/spack/spack/cmd/package-list.py
index aa576bddc2..87c528881e 100644
--- a/lib/spack/spack/cmd/package-list.py
+++ b/lib/spack/spack/cmd/package-list.py
@@ -23,7 +23,6 @@
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
import re
-import textwrap
from StringIO import StringIO
import llnl.util.tty as tty
from llnl.util.tty.colify import *
@@ -32,21 +31,6 @@ import spack
description = "Print a list of all packages in reStructuredText."
-def format_doc(pkg, **kwargs):
- """Wrap doc string at 72 characters and format nicely"""
- indent = kwargs.get('indent', 0)
-
- if not pkg.__doc__:
- return ""
-
- doc = re.sub(r'\s+', ' ', pkg.__doc__)
- lines = textwrap.wrap(doc, 72)
- results = StringIO()
- for line in lines:
- results.write((" " * indent) + line + "\n")
- return results.getvalue()
-
-
def github_url(pkg):
"""Link to a package file on github."""
return ("https://github.com/scalability-llnl/spack/blob/master/var/spack/packages/%s/package.py" %
@@ -99,7 +83,7 @@ def print_rst_package_list():
for d in pkg.dependencies)
print
print "Description"
- print format_doc(pkg, indent=2)
+ print pkg.format_doc(indent=2)
print
print "-----"
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index 58d62a7deb..b5340fa226 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -40,6 +40,8 @@ import subprocess
import platform as py_platform
import multiprocessing
from urlparse import urlparse, urljoin
+import textwrap
+from StringIO import StringIO
import llnl.util.tty as tty
from llnl.util.filesystem import *
@@ -850,6 +852,21 @@ class Package(object):
self.stage.destroy()
+ def format_doc(self, **kwargs):
+ """Wrap doc string at 72 characters and format nicely"""
+ indent = kwargs.get('indent', 0)
+
+ if not self.__doc__:
+ return ""
+
+ doc = re.sub(r'\s+', ' ', self.__doc__)
+ lines = textwrap.wrap(doc, 72)
+ results = StringIO()
+ for line in lines:
+ results.write((" " * indent) + line + "\n")
+ return results.getvalue()
+
+
@property
def all_urls(self):
urls = []
diff --git a/lib/spack/spack/test/__init__.py b/lib/spack/spack/test/__init__.py
index c6a371fd0d..0eda667abc 100644
--- a/lib/spack/spack/test/__init__.py
+++ b/lib/spack/spack/test/__init__.py
@@ -30,9 +30,6 @@ from llnl.util.tty.colify import colify
import spack
-import spack.test.install
-
-
"""Names of tests to be included in Spack's test suite"""
test_names = ['versions',
'url_parse',
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")