intel: consolidate libs() in the base class (#11143)
* intel: consolidate libs() in the base class * white space * flake8
This commit is contained in:
parent
82455a30d0
commit
1f1ea2c859
@ -935,18 +935,25 @@ def headers(self):
|
|||||||
@property
|
@property
|
||||||
def libs(self):
|
def libs(self):
|
||||||
result = LibraryList([])
|
result = LibraryList([])
|
||||||
|
if '+tbb' in self.spec or self.provides('tbb'):
|
||||||
|
result = self.tbb_libs + result
|
||||||
|
if '+mkl' in self.spec or self.provides('blas'):
|
||||||
|
result = self.blas_libs + result
|
||||||
|
if '+mkl' in self.spec or self.provides('lapack'):
|
||||||
|
result = self.lapack_libs + result
|
||||||
if '+mpi' in self.spec or self.provides('mpi'):
|
if '+mpi' in self.spec or self.provides('mpi'):
|
||||||
# If prefix is too general, recursive searches may get files from
|
# If prefix is too general, recursive searches may get files from
|
||||||
# supported but inappropriate sub-architectures like 'mic'.
|
# supported but inappropriate sub-architectures like 'mic'.
|
||||||
libnames = ['libmpifort', 'libmpi']
|
libnames = ['libmpifort', 'libmpi']
|
||||||
if 'cxx' in self.spec.last_query.extra_parameters:
|
if 'cxx' in self.spec.last_query.extra_parameters:
|
||||||
libnames = ['libmpicxx'] + libnames
|
libnames = ['libmpicxx'] + libnames
|
||||||
result += find_libraries(
|
result = find_libraries(
|
||||||
libnames,
|
libnames,
|
||||||
root=self.component_lib_dir('mpi'),
|
root=self.component_lib_dir('mpi'),
|
||||||
shared=True, recursive=True)
|
shared=True, recursive=True) + result
|
||||||
|
|
||||||
# NB: MKL uses domain-specifics: blas_libs/lapack_libs/scalapack_libs
|
if '+mkl' in self.spec or self.provides('scalapack'):
|
||||||
|
result = self.scalapack_libs + result
|
||||||
|
|
||||||
debug_print(result)
|
debug_print(result)
|
||||||
return result
|
return result
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
from spack import *
|
from spack import *
|
||||||
from spack.build_systems.intel import debug_print
|
|
||||||
|
|
||||||
|
|
||||||
class IntelMkl(IntelPackage):
|
class IntelMkl(IntelPackage):
|
||||||
@ -65,16 +64,3 @@ class IntelMkl(IntelPackage):
|
|||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
# there is no libmkl_gnu_thread on macOS
|
# there is no libmkl_gnu_thread on macOS
|
||||||
conflicts('threads=openmp', when='%gcc')
|
conflicts('threads=openmp', when='%gcc')
|
||||||
|
|
||||||
@property
|
|
||||||
def libs(self):
|
|
||||||
libs = LibraryList([])
|
|
||||||
if self.provides('blas'):
|
|
||||||
libs = self.blas_libs
|
|
||||||
if self.provides('lapack'):
|
|
||||||
libs = self.lapack_libs + libs
|
|
||||||
if self.provides('scalapack'):
|
|
||||||
libs = self.scalapack_libs + libs
|
|
||||||
|
|
||||||
debug_print(libs)
|
|
||||||
return libs
|
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
from spack import *
|
from spack import *
|
||||||
from spack.build_systems.intel import debug_print
|
|
||||||
|
|
||||||
|
|
||||||
class IntelParallelStudio(IntelPackage):
|
class IntelParallelStudio(IntelPackage):
|
||||||
@ -196,16 +195,3 @@ def setup_dependent_environment(self, *args):
|
|||||||
'F90': spack_fc,
|
'F90': spack_fc,
|
||||||
'FC': spack_fc,
|
'FC': spack_fc,
|
||||||
})
|
})
|
||||||
|
|
||||||
@property
|
|
||||||
def libs(self):
|
|
||||||
libs = LibraryList([])
|
|
||||||
if self.provides('blas'):
|
|
||||||
libs = self.blas_libs
|
|
||||||
if self.provides('lapack'):
|
|
||||||
libs = self.lapack_libs + libs
|
|
||||||
if self.provides('scalapack'):
|
|
||||||
libs = self.scalapack_libs + libs
|
|
||||||
|
|
||||||
debug_print(libs)
|
|
||||||
return libs
|
|
||||||
|
Loading…
Reference in New Issue
Block a user