Minor tweaks to abi code.

This commit is contained in:
Todd Gamblin 2016-02-07 11:27:39 -07:00
parent 0244d794cd
commit b0572a5462

View file

@ -86,11 +86,10 @@ def _intel_compiler_compare(self, pversion, cversion):
"""Returns true iff the intel version pversion and cversion
are ABI compatible"""
#Test major and minor versions. Ignore build version.
# Test major and minor versions. Ignore build version.
if (len(pversion.version) < 2 or len(cversion.version) < 2):
return False
return (pversion.version[0] == cversion.version[0]) and \
(pversion.version[1] == cversion.version[1])
return pversion.version[:2] == cversion.version[:2]
def compiler_compatible(self, parent, child, **kwargs):
@ -99,23 +98,25 @@ def compiler_compatible(self, parent, child, **kwargs):
return True
if parent.compiler.name != child.compiler.name:
#Different compiler families are assumed ABI incompatible
# Different compiler families are assumed ABI incompatible
return False
if kwargs.get('loose', False):
return True
# TODO: Can we move the specialized ABI matching stuff
# TODO: into compiler classes?
for pversion in parent.compiler.versions:
for cversion in child.compiler.versions:
#For a few compilers use specialized comparisons. Otherwise
# For a few compilers use specialized comparisons. Otherwise
# match on version match.
if pversion.satisfies(cversion):
return True
elif parent.compiler.name == "gcc" and \
self._gcc_compiler_compare(pversion, cversion):
elif (parent.compiler.name == "gcc" and
self._gcc_compiler_compare(pversion, cversion)):
return True
elif parent.compiler.name == "intel" and \
self._intel_compiler_compare(pversion, cversion):
elif (parent.compiler.name == "intel" and
self._intel_compiler_compare(pversion, cversion)):
return True
return False
@ -125,4 +126,3 @@ def compatible(self, parent, child, **kwargs):
loosematch = kwargs.get('loose', False)
return self.architecture_compatible(parent, child) and \
self.compiler_compatible(parent, child, loose=loosematch)