boost: ensure Spack wrappers are used for %intel (#27348)

Fixes #26117
This commit is contained in:
Tiziano Müller
2021-11-12 08:02:08 +01:00
committed by GitHub
parent f777cc079d
commit 38592b9e4f

View File

@@ -333,6 +333,7 @@ def url_for_version(self, version):
def determine_toolset(self, spec): def determine_toolset(self, spec):
toolsets = {'g++': 'gcc', toolsets = {'g++': 'gcc',
'icpc': 'intel', 'icpc': 'intel',
'icpx': 'intel',
'clang++': 'clang', 'clang++': 'clang',
'armclang++': 'clang', 'armclang++': 'clang',
'xlc++': 'xlcpp', 'xlc++': 'xlcpp',
@@ -343,6 +344,8 @@ def determine_toolset(self, spec):
if spec.satisfies('@1.47:'): if spec.satisfies('@1.47:'):
toolsets['icpc'] += '-linux' toolsets['icpc'] += '-linux'
toolsets['icpx'] += '-linux'
for cc, toolset in toolsets.items(): for cc, toolset in toolsets.items():
if cc in self.compiler.cxx_names: if cc in self.compiler.cxx_names:
return toolset return toolset
@@ -383,12 +386,6 @@ def determine_bootstrap_options(self, spec, with_libs, options):
with open('user-config.jam', 'w') as f: with open('user-config.jam', 'w') as f:
# Boost may end up using gcc even though clang+gfortran is set in # Boost may end up using gcc even though clang+gfortran is set in
# compilers.yaml. Make sure this does not happen: # compilers.yaml. Make sure this does not happen:
if not spec.satisfies('%intel'):
# using intel-linux : : spack_cxx in user-config.jam leads to
# error: at project-config.jam:12
# error: duplicate initialization of intel-linux with the following parameters: # noqa
# error: version = <unspecified>
# error: previous initialization at ./user-config.jam:1
f.write("using {0} : : {1} ;\n".format(boost_toolset_id, f.write("using {0} : : {1} ;\n".format(boost_toolset_id,
spack_cxx)) spack_cxx))
@@ -572,6 +569,11 @@ def install(self, spec, prefix):
bootstrap(*bootstrap_options) bootstrap(*bootstrap_options)
# strip the toolchain to avoid double include errors (intel) or
# user-config being overwritten (again intel, but different boost version)
filter_file(r'^\s*using {0}.*'.format(self.determine_toolset(spec)), '',
os.path.join(self.stage.source_path, 'project-config.jam'))
# b2 used to be called bjam, before 1.47 (sigh) # b2 used to be called bjam, before 1.47 (sigh)
b2name = './b2' if spec.satisfies('@1.47:') else './bjam' b2name = './b2' if spec.satisfies('@1.47:') else './bjam'