From 38592b9e4f974254c18ce82e8b7ccca65a07539e Mon Sep 17 00:00:00 2001 From: Tiziano Müller Date: Fri, 12 Nov 2021 08:02:08 +0100 Subject: boost: ensure Spack wrappers are used for %intel (#27348) Fixes #26117 --- var/spack/repos/builtin/packages/boost/package.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/boost/package.py b/var/spack/repos/builtin/packages/boost/package.py index 360d72c585..a330338f3f 100644 --- a/var/spack/repos/builtin/packages/boost/package.py +++ b/var/spack/repos/builtin/packages/boost/package.py @@ -333,6 +333,7 @@ class Boost(Package): def determine_toolset(self, spec): toolsets = {'g++': 'gcc', 'icpc': 'intel', + 'icpx': 'intel', 'clang++': 'clang', 'armclang++': 'clang', 'xlc++': 'xlcpp', @@ -343,6 +344,8 @@ class Boost(Package): if spec.satisfies('@1.47:'): toolsets['icpc'] += '-linux' + toolsets['icpx'] += '-linux' + for cc, toolset in toolsets.items(): if cc in self.compiler.cxx_names: return toolset @@ -383,14 +386,8 @@ class Boost(Package): with open('user-config.jam', 'w') as f: # Boost may end up using gcc even though clang+gfortran is set in # 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 = - # error: previous initialization at ./user-config.jam:1 - f.write("using {0} : : {1} ;\n".format(boost_toolset_id, - spack_cxx)) + f.write("using {0} : : {1} ;\n".format(boost_toolset_id, + spack_cxx)) if '+mpi' in spec: # Use the correct mpi compiler. If the compiler options are @@ -572,6 +569,11 @@ class Boost(Package): 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) b2name = './b2' if spec.satisfies('@1.47:') else './bjam' -- cgit v1.2.3-60-g2f50