spack/var/spack/repos/builtin/packages/atlas/package.py

61 lines
2.4 KiB
Python
Raw Normal View History

from spack import *
from spack.util.executable import Executable
2016-03-04 16:31:03 +08:00
import os.path
class Atlas(Package):
"""
2016-03-04 16:31:03 +08:00
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/"
2015-06-08 06:41:15 +08:00
version('3.10.2', 'a4e21f343dec8f22e7415e339f09f6da',
2016-03-04 16:31:03 +08:00
url='http://downloads.sourceforge.net/project/math-atlas/Stable/3.10.2/atlas3.10.2.tar.bz2', preferred=True)
resource(name='lapack',
url='http://www.netlib.org/lapack/lapack-3.5.0.tgz',
md5='b1d3e3e425b2e44a06760ff173104bdf',
destination='spack-resource-lapack',
when='@3:')
2015-06-08 06:41:15 +08:00
2016-03-04 16:31:03 +08:00
version('3.11.34', '0b6c5389c095c4c8785fd0f724ec6825',
url='http://sourceforge.net/projects/math-atlas/files/Developer%20%28unstable%29/3.11.34/atlas3.11.34.tar.bz2/download')
2015-06-08 06:41:15 +08:00
2016-03-04 16:31:03 +08:00
variant('shared', default=True, description='Builds shared library')
2016-03-04 16:31:03 +08:00
provides('blas')
provides('lapack')
2016-03-04 16:59:16 +08:00
parallel = False
2015-04-08 13:32:00 +08:00
def patch(self):
2016-03-04 16:31:03 +08:00
# Disable thread check. LLNL's environment does not allow
2015-04-08 13:32:00 +08:00
# disabling of CPU throttling in a way that ATLAS actually
# understands.
filter_file(r'^\s+if \(thrchk\) exit\(1\);', 'if (0) exit(1);',
'CONFIG/src/config.c')
# TODO: investigate a better way to add the check back in
# TODO: using, say, MSRs. Or move this to a variant.
2015-06-08 06:41:15 +08:00
def install(self, spec, prefix):
2016-03-04 16:31:03 +08:00
options = []
if '+shared' in spec:
options.append('--shared')
2015-06-08 06:41:15 +08:00
2016-03-04 16:31:03 +08:00
# Lapack resource
lapack_stage = self.stage[1]
lapack_tarfile = os.path.basename(lapack_stage.fetcher.url)
lapack_tarfile_path = join_path(lapack_stage.path, lapack_tarfile)
options.append('--with-netlib-lapack-tarfile=%s' % lapack_tarfile_path)
2016-03-04 16:31:03 +08:00
with working_dir('spack-build', create=True):
configure = Executable('../configure')
configure('--prefix=%s' % prefix, *options)
make()
make('check')
make('ptcheck')
make('time')
make("install")