diff options
-rw-r--r-- | var/spack/packages/atlas/package.py | 28 | ||||
-rw-r--r-- | var/spack/packages/lapack-atlas/package.py | 40 | ||||
-rw-r--r-- | var/spack/packages/lapack/package.py | 47 | ||||
-rw-r--r-- | var/spack/packages/netlib_blas/package.py | 28 |
4 files changed, 129 insertions, 14 deletions
diff --git a/var/spack/packages/atlas/package.py b/var/spack/packages/atlas/package.py new file mode 100644 index 0000000000..7ee85f7f16 --- /dev/null +++ b/var/spack/packages/atlas/package.py @@ -0,0 +1,28 @@ +from spack import * +from spack.util.executable import Executable +import os + +class Atlas(Package): + """ + Automatically Tuned Linear Algebra Software, generic shared + ATLAS is an approach for the automatic generation and optimization of + numerical software. Currently ATLAS supplies optimized versions for the + complete set of linear algebra kernels known as the Basic Linear Algebra + Subroutines (BLAS), and a subset of the linear algebra routines in the + LAPACK library. + """ + homepage = "http://math-atlas.sourceforge.net/" + url = "http://downloads.sourceforge.net/project/math-atlas/Stable/3.10.2/atlas3.10.2.tar.bz2" + + version('3.10.2', 'a4e21f343dec8f22e7415e339f09f6da') + + def install(self, spec, prefix): + with working_dir('ATLAS-Build', create=True): + self.module.configure = Executable('../configure') + configure("--prefix=%s" % prefix) + + make() + make('check') + make('ptcheck') + make('time') + make("install") diff --git a/var/spack/packages/lapack-atlas/package.py b/var/spack/packages/lapack-atlas/package.py new file mode 100644 index 0000000000..209b02cb94 --- /dev/null +++ b/var/spack/packages/lapack-atlas/package.py @@ -0,0 +1,40 @@ +from spack import * +from spack.util.executable import Executable +import os +import urllib + +class LapackAtlas(Package): + """ + Automatically Tuned Linear Algebra Software, generic shared + ATLAS is an approach for the automatic generation and optimization of + numerical software. Currently ATLAS supplies optimized versions for the + complete set of linear algebra kernels known as the Basic Linear Algebra + Subroutines (BLAS), and a subset of the linear algebra routines in the + LAPACK library. + """ + homepage = "http://math-atlas.sourceforge.net/" + url = "http://downloads.sourceforge.net/project/math-atlas/Stable/3.10.2/atlas3.10.2.tar.bz2" + + version('3.10.2', 'a4e21f343dec8f22e7415e339f09f6da') + + # FIXME: Add dependencies if this package requires them. + # depends_on("foo") + + def install(self, spec, prefix): + #os.mkdir('ATLAS-Build') + #os.chdir('ATLAS-Build') + with working_dir('ATLAS-Build', create=True): + self.module.configure = Executable('../configure') + lapack_file = 'lapack-3.5.0.tgz' + lapack = urllib.URLopener() + lapack.retrieve('http://www.netlib.org/lapack/' + lapack_file, lapack_file) + + configure("--prefix=%s" % prefix, + "--shared", + '--with-netlib-lapack-tarfile=%s' % os.getcwd() + '/' + lapack_file) + + make() + make('check') + make('ptcheck') + make('time') + make("install") diff --git a/var/spack/packages/lapack/package.py b/var/spack/packages/lapack/package.py index de90acd742..d174c5281f 100644 --- a/var/spack/packages/lapack/package.py +++ b/var/spack/packages/lapack/package.py @@ -1,26 +1,45 @@ from spack import * -import os class Lapack(Package): - """LAPACK is written in Fortran 90 and provides routines for solving systems - of simultaneous linear equations, least-squares solutions of linear systems - of equations, eigenvalue problems, and singular value problems.""" - homepage = "http://www.netlib.org/lapack" + """ + LAPACK version 3.X is a comprehensive FORTRAN library that does + linear algebra operations including matrix inversions, least + squared solutions to linear sets of equations, eigenvector + analysis, singular value decomposition, etc. It is a very + comprehensive and reputable package that has found extensive + use in the scientific community. + """ + homepage = "http://www.netlib.org/lapack/" url = "http://www.netlib.org/lapack/lapack-3.5.0.tgz" version('3.5.0', 'b1d3e3e425b2e44a06760ff173104bdf') + version('3.4.2', '61bf1a8a4469d4bdb7604f5897179478') + version('3.4.1', '44c3869c38c8335c2b9c2a8bb276eb55') + version('3.4.0', '02d5706ec03ba885fc246e5fa10d8c70') + version('3.3.1', 'd0d533ec9a5b74933c2a1e84eedc58b4') + # blas is a virtual dependency. depends_on('blas') - def install(self, spec, prefix): - # Lapack and BLAS testing fails for some reason, but the library is - # built and ready to go after make() is called. The testing stuff is - # going to be switched off for now. - filter_file('blas_testing lapack_testing ', ' ', 'Makefile', string=True) - move('./make.inc.example', './make.inc') - filter_file('../../librefblas.a', '%s/libblas.a' % spec['blas'].prefix.lib, 'make.inc', string=True) # Specify the BLAS lib to use. + # Doesn't always build correctly in parallel + parallel = False + @when('^netlib_blas') + def get_blas_libs(self): + blas = self.spec['netlib_blas'] + return [join_path(blas.prefix.lib, 'blas.a')] + + + @when('^atlas') + def get_blas_libs(self): + blas = self.spec['atlas'] + return [join_path(blas.prefix.lib, l) + for l in ('libf77blas.a', 'libatlas.a')] + + + def install(self, spec, prefix): + blas_libs = ";".join(self.get_blas_libs()) + cmake(".", '-DBLAS_LIBRARIES=' + blas_libs, *std_cmake_args) make() - mkdir('%s' % prefix.lib) # Create the lib dir inside the install dir. - move('./liblapack.a', '%s/liblapack.a' % prefix.lib) # Move the library file to the install dir. + make("install") diff --git a/var/spack/packages/netlib_blas/package.py b/var/spack/packages/netlib_blas/package.py new file mode 100644 index 0000000000..725bda1309 --- /dev/null +++ b/var/spack/packages/netlib_blas/package.py @@ -0,0 +1,28 @@ +from spack import * + +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): + symlink('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 + symlink(prefix.lib + '/librefblas.a', prefix.lib + '/blas.a')
\ No newline at end of file |