add libs property to IntelMkl and IntelParallelStudio (#10993)

* add libs property to IntelMkl and IntelParallelStudio
* fix scalapack_libs when MPI is provided by intel-parallel-studio
This commit is contained in:
Denis Davydov 2019-03-29 21:01:43 +01:00 committed by Gregory Lee
parent 03d39ed34c
commit def5b23763
3 changed files with 32 additions and 3 deletions

View File

@ -10,7 +10,7 @@
import tempfile
import re
import inspect
import xml.etree.ElementTree as ET
import xml.etree.ElementTree as ElementTree
import llnl.util.tty as tty
from llnl.util.filesystem import \
@ -227,7 +227,7 @@ def _filtered_components(self):
#
# https://software.intel.com/en-us/articles/configuration-file-format
#
xmltree = ET.parse('pset/mediaconfig.xml')
xmltree = ElementTree.parse('pset/mediaconfig.xml')
for entry in xmltree.getroot().findall('.//Abbr'): # XPath expression
name_present = entry.text
for name_requested in requested:
@ -790,7 +790,8 @@ def scalapack_libs(self):
blacs_lib = 'libmkl_blacs'
elif ('^mpich@2:' in spec_root or
'^mvapich2' in spec_root or
'^intel-mpi' in spec_root):
'^intel-mpi' in spec_root or
'^intel-parallel-studio' in spec_root):
blacs_lib = 'libmkl_blacs_intelmpi'
elif '^mpt' in spec_root:
blacs_lib = 'libmkl_blacs_sgimpt'

View File

@ -6,6 +6,7 @@
import sys
from spack import *
from spack.build_systems.intel import debug_print
class IntelMkl(IntelPackage):
@ -64,3 +65,16 @@ class IntelMkl(IntelPackage):
if sys.platform == 'darwin':
# there is no libmkl_gnu_thread on macOS
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

View File

@ -4,6 +4,7 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
from spack.build_systems.intel import debug_print
class IntelParallelStudio(IntelPackage):
@ -195,3 +196,16 @@ def setup_dependent_environment(self, *args):
'F90': 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