summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Walters <bwalter4@hawk.iit.edu>2015-03-19 03:20:24 -0500
committerBenjamin Walters <bwalter4@hawk.iit.edu>2015-03-19 03:20:24 -0500
commit3d2df174d16720e44f6b62f51927496ae2923e74 (patch)
tree188d9f6e367bac4cc9127759ad6465f06ab08c8b
parentaf92250c7e0c7fc59cfb4381928ed4a547f2dcf3 (diff)
downloadspack-3d2df174d16720e44f6b62f51927496ae2923e74.tar.gz
spack-3d2df174d16720e44f6b62f51927496ae2923e74.tar.bz2
spack-3d2df174d16720e44f6b62f51927496ae2923e74.tar.xz
spack-3d2df174d16720e44f6b62f51927496ae2923e74.zip
Added package files for Lapack (has virtual dependency blas) and Netlib blas (provides virtual dependency blas).
-rw-r--r--var/spack/packages/lapack/package.py41
-rw-r--r--var/spack/packages/netlib_blas/package.py29
2 files changed, 70 insertions, 0 deletions
diff --git a/var/spack/packages/lapack/package.py b/var/spack/packages/lapack/package.py
new file mode 100644
index 0000000000..25469679ed
--- /dev/null
+++ b/var/spack/packages/lapack/package.py
@@ -0,0 +1,41 @@
+from spack import *
+from subprocess import call
+import sys
+import glob
+
+class Lapack(Package):
+ """
+ Netlib implementation of Lapack. If we end up having more Lapack libraries, we should
+ turn it into a virtual dependency.
+ """
+ homepage = "http://www.netlib.org/lapack/"
+ url = "http://www.netlib.org/lapack/lapack-3.5.0.tgz"
+
+ version('3.5.0', 'b1d3e3e425b2e44a06760ff173104bdf')
+
+ # Doesn't always build correctly in parallel
+ parallel = False
+
+ # virtual
+ depends_on("blas")
+
+ def install(self, spec, prefix):
+ # CMake could be used if the build becomes more complex
+
+ call(['cp', 'make.inc.example', 'make.inc'])
+
+ # Retrieves name of package that satisifies 'blas' virtual dependency
+ blas_name = next(m for m in ('netlib_blas', 'atlas') if m in spec)
+ blas_spec = spec[blas_name]
+ blas_object_path = blas_spec.prefix.lib + '/blas.a'
+
+ # The blas dependency must provide a 'blas.a' - but this is not gauranteed right now
+ # So maybe we should check if it exists first... maybe...
+ make('BLASLIB="%s"' % blas_object_path)
+
+ # Manual install since no method provided
+ # Should probably be changed so only one external call is made
+ # Can install be used on a list of files?
+ mkdirp(prefix.lib)
+ for file in glob.glob('*.a'):
+ install(file, prefix.lib)
diff --git a/var/spack/packages/netlib_blas/package.py b/var/spack/packages/netlib_blas/package.py
new file mode 100644
index 0000000000..e6b7ec80a4
--- /dev/null
+++ b/var/spack/packages/netlib_blas/package.py
@@ -0,0 +1,29 @@
+from spack import *
+from subprocess import call
+
+class NetlibBlas(Package):
+ """Netlib reference BLAS"""
+ homepage = "http://www.netlib.org/lapack/"
+ url = "http://www.netlib.org/lapack/lapack-3.5.0.tgz"
+
+ version('3.5.0', 'b1d3e3e425b2e44a06760ff173104bdf')
+
+ # virtual dependency
+ provides('blas')
+
+ # Doesn't always build correctly in parallel
+ parallel = False
+
+ def install(self, spec, prefix):
+ call(['cp', 'make.inc.example', 'make.inc'])
+ make('blaslib')
+
+ # Tests that blas builds correctly
+ make('blas_testing')
+
+ # No install provided
+ mkdirp(prefix.lib)
+ install('librefblas.a', prefix.lib)
+
+ # Blas virtual package should provide blas.a
+ call(['ln', '-s', prefix.lib + '/librefblas.a', prefix.lib + '/blas.a']) \ No newline at end of file