From 53cea629b774f7d255e37b2c75ad4f25f06764db Mon Sep 17 00:00:00 2001 From: Chris MacMackin Date: Wed, 5 Oct 2022 12:57:37 +0100 Subject: [PATCH] autotools: Filter libtools when building with dpcpp (#32876) Due to a [known issue](https://community.intel.com/t5/Intel-oneAPI-Data-Parallel-C/dpcpp-and-GNU-Autotools/m-p/1296985) with dpcpp, autotool-based builds that try to use it will fail because they try to link against temporary files that no longer exist. This commit filters those files out of the libtools script so that linking can work properly. --- lib/spack/spack/build_systems/autotools.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/spack/spack/build_systems/autotools.py b/lib/spack/spack/build_systems/autotools.py index 97b5e9ef51..d6707ac27e 100644 --- a/lib/spack/spack/build_systems/autotools.py +++ b/lib/spack/spack/build_systems/autotools.py @@ -266,7 +266,8 @@ def _set_autotools_environment_variables(self): def _do_patch_libtool(self): """If configure generates a "libtool" script that does not correctly detect the compiler (and patch_libtool is set), patch in the correct - flags for the Arm, Clang/Flang, Fujitsu and NVHPC compilers.""" + flags for the Arm, Clang/Flang, Fujitsu and NVHPC compilers. Also + filter out spurious predep_objects for Intel dpcpp builds.""" # Exit early if we are required not to patch libtool if not self.patch_libtool: @@ -300,6 +301,13 @@ def _patch_libtool(self, libtool_path): ] for o in objfile: fs.filter_file(rehead + o, "", libtool_path) + # Hack to filter out spurious predp_objects when building with + # Intel dpcpp; see issue #32863 + if self.spec.satisfies("%dpcpp"): + fs.filter_file( + r"^(predep_objects=.*)/tmp/conftest-[0-9A-Fa-f]+\.o", r"\1", libtool_path + ) + fs.filter_file(r"^(predep_objects=.*)/tmp/a-[0-9A-Fa-f]+\.o", r"\1", libtool_path) @property def configure_directory(self):