- issue caused by the openfoam-org internal naming for their newly added support for aarch64 Co-authored-by: Mark Olesen <Mark.Olesen@esi-group.com>
This commit is contained in:
parent
0857648313
commit
ac8a07ef4a
@ -174,7 +174,7 @@ def projectdir(self):
|
|||||||
@property
|
@property
|
||||||
def foam_arch(self):
|
def foam_arch(self):
|
||||||
if not self._foam_arch:
|
if not self._foam_arch:
|
||||||
self._foam_arch = OpenfoamArch(self.spec, **self.config)
|
self._foam_arch = OpenfoamOrgArch(self.spec, **self.config)
|
||||||
return self._foam_arch
|
return self._foam_arch
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -390,3 +390,17 @@ def install_links(self):
|
|||||||
if os.path.isfile(f)
|
if os.path.isfile(f)
|
||||||
]:
|
]:
|
||||||
os.symlink(f, os.path.basename(f))
|
os.symlink(f, os.path.basename(f))
|
||||||
|
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class OpenfoamOrgArch(OpenfoamArch):
|
||||||
|
"""An openfoam-org variant of OpenfoamArch
|
||||||
|
"""
|
||||||
|
def update_arch(self, spec):
|
||||||
|
"""Handle differences in WM_ARCH naming
|
||||||
|
"""
|
||||||
|
OpenfoamArch.update_arch(self, spec)
|
||||||
|
|
||||||
|
# ARM64 (openfoam) -> Arm64 (openfoam-org)
|
||||||
|
self.arch = self.arch.replace("ARM64", "Arm64")
|
||||||
|
@ -861,12 +861,13 @@ def __init__(self, spec, **kwargs):
|
|||||||
self.options = None
|
self.options = None
|
||||||
self.mplib = kwargs.get('mplib', 'USERMPI')
|
self.mplib = kwargs.get('mplib', 'USERMPI')
|
||||||
|
|
||||||
# Normally support WM_LABEL_OPTION, but not yet for foam-extend
|
# WM_LABEL_OPTION, but perhaps not yet for foam-extend
|
||||||
if '+int64' in spec:
|
if '+int64' in spec:
|
||||||
self.label_size = '64'
|
self.label_size = '64'
|
||||||
elif kwargs.get('label-size', True):
|
elif kwargs.get('label-size', True):
|
||||||
self.label_size = '32'
|
self.label_size = '32'
|
||||||
|
|
||||||
|
# WM_PRECISION_OPTION
|
||||||
if '+spdp' in spec:
|
if '+spdp' in spec:
|
||||||
self.precision_option = 'SPDP'
|
self.precision_option = 'SPDP'
|
||||||
elif '+float32' in spec:
|
elif '+float32' in spec:
|
||||||
@ -876,6 +877,20 @@ def __init__(self, spec, **kwargs):
|
|||||||
if '+knl' in spec:
|
if '+knl' in spec:
|
||||||
self.arch_option = '-march=knl'
|
self.arch_option = '-march=knl'
|
||||||
|
|
||||||
|
# Capitalize first letter of compiler name to obtain the
|
||||||
|
# OpenFOAM naming (eg, gcc -> Gcc, clang -> Clang, etc).
|
||||||
|
# Use compiler_mapping[] for special cases
|
||||||
|
comp = spec.compiler.name
|
||||||
|
if comp in self.compiler_mapping:
|
||||||
|
comp = self.compiler_mapping[comp]
|
||||||
|
|
||||||
|
self.compiler = comp.capitalize()
|
||||||
|
self.update_arch(spec)
|
||||||
|
self.update_options()
|
||||||
|
|
||||||
|
def update_arch(self, spec):
|
||||||
|
"""Set WM_ARCH string corresponding to spack platform/target
|
||||||
|
"""
|
||||||
# spec.architecture.platform is like `uname -s`, but lower-case
|
# spec.architecture.platform is like `uname -s`, but lower-case
|
||||||
platform = str(spec.architecture.platform)
|
platform = str(spec.architecture.platform)
|
||||||
|
|
||||||
@ -883,7 +898,6 @@ def __init__(self, spec, **kwargs):
|
|||||||
target = str(spec.target.family)
|
target = str(spec.target.family)
|
||||||
|
|
||||||
# No spack platform family for ia64 or armv7l
|
# No spack platform family for ia64 or armv7l
|
||||||
|
|
||||||
if platform == 'linux':
|
if platform == 'linux':
|
||||||
if target == 'x86_64':
|
if target == 'x86_64':
|
||||||
platform += '64'
|
platform += '64'
|
||||||
@ -901,21 +915,12 @@ def __init__(self, spec, **kwargs):
|
|||||||
if target == 'x86_64':
|
if target == 'x86_64':
|
||||||
platform += '64'
|
platform += '64'
|
||||||
# ... and others?
|
# ... and others?
|
||||||
|
|
||||||
self.arch = platform
|
self.arch = platform
|
||||||
|
|
||||||
# Capitalize first letter of compiler name, which corresponds
|
def update_options(self):
|
||||||
# to how OpenFOAM handles things (eg, gcc -> Gcc).
|
"""Set WM_OPTIONS string consistent with current settings
|
||||||
# Use compiler_mapping for special cases.
|
"""
|
||||||
comp = spec.compiler.name
|
# WM_OPTIONS
|
||||||
|
|
||||||
if comp in self.compiler_mapping:
|
|
||||||
comp = self.compiler_mapping[comp]
|
|
||||||
comp = comp.capitalize()
|
|
||||||
|
|
||||||
self.compiler = comp
|
|
||||||
|
|
||||||
# Build WM_OPTIONS
|
|
||||||
# ----
|
# ----
|
||||||
# WM_LABEL_OPTION=Int$WM_LABEL_SIZE
|
# WM_LABEL_OPTION=Int$WM_LABEL_SIZE
|
||||||
# WM_OPTIONS_BASE=$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION
|
# WM_OPTIONS_BASE=$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION
|
||||||
|
Loading…
Reference in New Issue
Block a user