summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/atlas/package.py
diff options
context:
space:
mode:
Diffstat (limited to 'var/spack/repos/builtin/packages/atlas/package.py')
-rw-r--r--var/spack/repos/builtin/packages/atlas/package.py36
1 files changed, 25 insertions, 11 deletions
diff --git a/var/spack/repos/builtin/packages/atlas/package.py b/var/spack/repos/builtin/packages/atlas/package.py
index f9d5da6166..e1914aac98 100644
--- a/var/spack/repos/builtin/packages/atlas/package.py
+++ b/var/spack/repos/builtin/packages/atlas/package.py
@@ -51,6 +51,7 @@ class Atlas(Package):
url='http://sourceforge.net/projects/math-atlas/files/Developer%20%28unstable%29/3.11.34/atlas3.11.34.tar.bz2')
variant('shared', default=True, description='Builds shared library')
+ variant('pthread', default=False, description='Use multithreaded libraries')
provides('blas')
provides('lapack')
@@ -107,18 +108,32 @@ class Atlas(Package):
make("install")
self.install_test()
- def setup_dependent_package(self, module, dspec):
+ @property
+ def blas_libs(self):
# libsatlas.[so,dylib,dll ] contains all serial APIs (serial lapack,
# serial BLAS), and all ATLAS symbols needed to support them. Whereas
# libtatlas.[so,dylib,dll ] is parallel (multithreaded) version.
- name = 'libsatlas.%s' % dso_suffix
- libdir = find_library_path(name,
- self.prefix.lib64,
- self.prefix.lib)
-
+ is_threaded = '+pthread' in self.spec
if '+shared' in self.spec:
- self.spec.blas_shared_lib = join_path(libdir, name)
- self.spec.lapack_shared_lib = self.spec.blas_shared_lib
+ to_find = ['libtatlas'] if is_threaded else ['libsatlas']
+ shared = True
+ else:
+ interfaces = [
+ 'libptcblas',
+ 'libptf77blas'
+ ] if is_threaded else [
+ 'libcblas',
+ 'libf77blas'
+ ]
+ to_find = ['liblapack'] + interfaces + ['libatlas']
+ shared = False
+ return find_libraries(
+ to_find, root=self.prefix, shared=shared, recurse=True
+ )
+
+ @property
+ def lapack_libs(self):
+ return self.blas_libs
def install_test(self):
source_file = join_path(os.path.dirname(self.module.__file__),
@@ -126,9 +141,8 @@ class Atlas(Package):
blessed_file = join_path(os.path.dirname(self.module.__file__),
'test_cblas_dgemm.output')
- include_flags = ["-I%s" % join_path(self.spec.prefix, "include")]
- link_flags = ["-L%s" % join_path(self.spec.prefix, "lib"),
- "-lsatlas"]
+ include_flags = ["-I%s" % self.spec.prefix.include]
+ link_flags = self.lapack_libs.ld_flags
output = compile_c_and_execute(source_file, include_flags, link_flags)
compare_output_file(output, blessed_file)