Trilinos: Use more flexible option for locating the BLAS library directory. (#1987)

+ This change fixes a problem that manifests when trilinos is built against a
  MKL installation defined as an external package. In this scenario, the MKL
  libraries are found one directory deeper than for the case where spack
  provides MKL. The extra directory is a platform name like 'intel64'.
+ The changes in this PR were recommended by contributor @davydden. I
  implemented and tested with intel@16.0.3. These changes fix the issue I
  reported. I did not attempt building trilinos against other BLAS
  implementations.
+ fixes #1923
This commit is contained in:
Kelly Thompson 2016-10-11 01:42:59 -06:00 committed by Todd Gamblin
parent b1a2728af6
commit 1891ce3545
2 changed files with 2 additions and 9 deletions

View file

@ -66,13 +66,6 @@ def install(self, spec, prefix):
for f in os.listdir(mkl_dir):
os.symlink(os.path.join(mkl_dir, f), os.path.join(self.prefix, f))
# Unfortunately MKL libs are natively distrubted in prefix/lib/intel64.
# To make MKL play nice with Spack, symlink all files to prefix/lib:
mkl_lib_dir = os.path.join(prefix, "lib", "intel64")
for f in os.listdir(mkl_lib_dir):
os.symlink(os.path.join(mkl_lib_dir, f),
os.path.join(self.prefix, "lib", f))
def setup_dependent_environment(self, spack_env, run_env, dependent_spec):
# set up MKLROOT for everyone using MKL package
spack_env.set('MKLROOT', self.prefix)

View file

@ -149,10 +149,10 @@ def install(self, spec, prefix):
'-DMPI_BASE_DIR:PATH=%s' % spec['mpi'].prefix,
'-DTPL_ENABLE_BLAS=ON',
'-DBLAS_LIBRARY_NAMES=%s' % ';'.join(blas.names),
'-DBLAS_LIBRARY_DIRS=%s' % spec['blas'].prefix.lib,
'-DBLAS_LIBRARY_DIRS=%s' % ';'.join(blas.directories),
'-DTPL_ENABLE_LAPACK=ON',
'-DLAPACK_LIBRARY_NAMES=%s' % ';'.join(lapack.names),
'-DLAPACK_LIBRARY_DIRS=%s' % spec['lapack'].prefix.lib,
'-DLAPACK_LIBRARY_DIRS=%s' % ';'.join(lapack.directories),
'-DTrilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON',
'-DTrilinos_ENABLE_CXX11:BOOL=ON',
'-DTPL_ENABLE_Netcdf:BOOL=ON',