some fixes to blas/lapack usage in packages (#1852)

* atlas: fix unit test

* openblas: remove symlinks; use lapack_libs.ld_flags in the test

* mkl: fix openmp variant of blas/lapack libs

* intel-parallel-studio: fix openmp variant of blas/lapack libs

* netlib-scalapack: fix blas/lapack for multilib case (e.g. mkl)

* arpack-ng: fix blas/lapack for multilib case (e.g. mkl)

* petsc: explicitly specify blas/lapack

* minor

* cantera: fix blas/lapack usage

* ipopt: fix blas/lapack usage

* netlib-lapack: fix external blas usage

* mfem: fix lapack/blas usage

* superlu-mt: fix blas usage

* flake8 fixes
This commit is contained in:
Denis Davydov
2016-09-26 19:37:23 +02:00
committed by Todd Gamblin
parent cb36aadaf6
commit 1e10309ff7
12 changed files with 29 additions and 43 deletions

View File

@@ -111,24 +111,6 @@ def install(self, spec, prefix):
# no quotes around prefix (spack doesn't use a shell)
make('install', "PREFIX=%s" % prefix, *make_defs)
# TODO : the links below are mainly there because client
# TODO : packages are wrongly written. Check if they can be removed
# Blas virtual package should provide blas.a and libblas.a
with working_dir(prefix.lib):
symlink('libopenblas.a', 'blas.a')
symlink('libopenblas.a', 'libblas.a')
if '+shared' in spec:
symlink('libopenblas.%s' % dso_suffix,
'libblas.%s' % dso_suffix)
# Lapack virtual package should provide liblapack.a
with working_dir(prefix.lib):
symlink('libopenblas.a', 'liblapack.a')
if '+shared' in spec:
symlink('libopenblas.%s' % dso_suffix,
'liblapack.%s' % dso_suffix)
# Openblas may pass its own test but still fail to compile Lapack
# symbols. To make sure we get working Blas and Lapack, do a small
# test.
@@ -141,10 +123,8 @@ def check_install(self, spec):
'test_cblas_dgemm.output')
include_flags = ["-I%s" % join_path(spec.prefix, "include")]
link_flags = ["-L%s" % join_path(spec.prefix, "lib"),
"-llapack",
"-lblas",
"-lpthread"]
link_flags = self.lapack_libs.ld_flags.split()
link_flags.extend(["-lpthread"])
if '+openmp' in spec:
link_flags.extend([self.compiler.openmp_flag])