Merge pull request #1381 from davydden/pkg/mkl_linux

MKL linux fixes
This commit is contained in:
becker33 2016-08-01 13:36:10 -07:00 committed by GitHub
commit 94238eebfa
3 changed files with 23 additions and 8 deletions

View File

@ -62,10 +62,10 @@ def install(self, spec, prefix):
'--prefix=%s' % prefix, '--prefix=%s' % prefix,
'--with-lapack-libs=%s' % to_lib_name( '--with-lapack-libs=%s' % to_lib_name(
spec['lapack'].lapack_shared_lib), spec['lapack'].lapack_shared_lib),
'--with-lapack-lib-dirs=%s/lib' % spec['lapack'].prefix, '--with-lapack-lib-dirs=%s' % spec['lapack'].prefix.lib,
'--with-blas-libs=%s' % to_lib_name( '--with-blas-libs=%s' % to_lib_name(
spec['blas'].blas_shared_lib), spec['blas'].blas_shared_lib),
'--with-blas-lib-dirs=%s/lib' % spec['blas'].prefix '--with-blas-lib-dirs=%s' % spec['blas'].prefix.lib
] ]
if '+shared' in self.spec: if '+shared' in self.spec:

View File

@ -12,9 +12,9 @@ class Mkl(IntelInstaller):
mirror, see http://software.llnl.gov/spack/mirrors.html. mirror, see http://software.llnl.gov/spack/mirrors.html.
To set the threading layer at run time set MKL_THREADING_LAYER To set the threading layer at run time set MKL_THREADING_LAYER
variable to one of the following values: INTEL, SEQUENTIAL, PGI. variable to one of the following values: INTEL (default), SEQUENTIAL, PGI.
To set interface layer at run time, use set the MKL_INTERFACE_LAYER To set interface layer at run time, use set the MKL_INTERFACE_LAYER
variable to LP64 or ILP64. variable to LP64 (default) or ILP64.
""" """
homepage = "https://software.intel.com/en-us/intel-mkl" homepage = "https://software.intel.com/en-us/intel-mkl"
@ -38,6 +38,13 @@ def install(self, spec, prefix):
for f in os.listdir(mkl_dir): for f in os.listdir(mkl_dir):
os.symlink(os.path.join(mkl_dir, f), os.path.join(self.prefix, f)) 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_package(self, module, dspec): def setup_dependent_package(self, module, dspec):
# For now use Single Dynamic Library: # For now use Single Dynamic Library:
# To set the threading layer at run time, use the # To set the threading layer at run time, use the
@ -53,6 +60,7 @@ def setup_dependent_package(self, module, dspec):
name = 'libmkl_rt.%s' % dso_suffix name = 'libmkl_rt.%s' % dso_suffix
libdir = find_library_path(name, self.prefix.lib64, self.prefix.lib) libdir = find_library_path(name, self.prefix.lib64, self.prefix.lib)
# Now set blas/lapack libs:
self.spec.blas_shared_lib = join_path(libdir, name) self.spec.blas_shared_lib = join_path(libdir, name)
self.spec.lapack_shared_lib = self.spec.blas_shared_lib self.spec.lapack_shared_lib = self.spec.blas_shared_lib

View File

@ -138,16 +138,23 @@ def install(self, spec, prefix):
'-DTPL_ENABLE_LAPACK=ON', '-DTPL_ENABLE_LAPACK=ON',
'-DLAPACK_LIBRARY_NAMES=%s' % to_lib_name( '-DLAPACK_LIBRARY_NAMES=%s' % to_lib_name(
spec['lapack'].lapack_shared_lib), spec['lapack'].lapack_shared_lib),
'-DLAPACK_LIBRARY_DIRS=%s' % spec['lapack'].prefix, '-DLAPACK_LIBRARY_DIRS=%s' % spec['lapack'].prefix.lib,
'-DTrilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON', '-DTrilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON',
'-DTrilinos_ENABLE_CXX11:BOOL=ON', '-DTrilinos_ENABLE_CXX11:BOOL=ON',
'-DTPL_ENABLE_Netcdf:BOOL=ON', '-DTPL_ENABLE_Netcdf:BOOL=ON',
'-DTPL_ENABLE_HYPRE:BOOL=%s' % ( '-DTPL_ENABLE_HYPRE:BOOL=%s' % (
'ON' if '+hypre' in spec else 'OFF'), 'ON' if '+hypre' in spec else 'OFF')
'-DTPL_ENABLE_HDF5:BOOL=%s' % (
'ON' if '+hdf5' in spec else 'OFF'),
]) ])
if '+hdf5' in spec:
options.extend([
'-DTPL_ENABLE_HDF5:BOOL=ON',
'-DHDF5_INCLUDE_DIRS:PATH=%s' % spec['hdf5'].prefix.include,
'-DHDF5_LIBRARY_DIRS:PATH=%s' % spec['hdf5'].prefix.lib
])
else:
options.extend(['-DTPL_ENABLE_HDF5:BOOL=OFF'])
if '+boost' in spec: if '+boost' in spec:
options.extend([ options.extend([
'-DTPL_ENABLE_Boost:BOOL=ON', '-DTPL_ENABLE_Boost:BOOL=ON',