From d95f14084ea438185e35e9ce0cfa20dda4cff7bc Mon Sep 17 00:00:00 2001 From: Howard Pritchard Date: Tue, 18 Oct 2022 11:18:04 -0600 Subject: [PATCH] papi: fix for Intel OneAPI compiler (#33225) Without this patch one hits this error trying to compiler papi with Intel OneAPI: icx: error: Note that use of '-g' without any optimization-level option will turn off most compiler optimizations similar to use of '-O0' [-Werror,-Wdebug-disables-optimization] Signed-off-by: Howard Pritchard Signed-off-by: Howard Pritchard --- var/spack/repos/builtin/packages/papi/package.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/var/spack/repos/builtin/packages/papi/package.py b/var/spack/repos/builtin/packages/papi/package.py index f3fe762e448..35ea13fbd9c 100644 --- a/var/spack/repos/builtin/packages/papi/package.py +++ b/var/spack/repos/builtin/packages/papi/package.py @@ -105,6 +105,11 @@ def setup_build_environment(self, env): env.set("HSA_TOOLS_LIB", "unset") if "+rocm_smi" in spec: env.append_flags("CFLAGS", "-I%s/rocm_smi" % spec["rocm-smi-lib"].prefix.include) + # + # Intel OneAPI LLVM cannot compile papi unless the DBG enviroment variable is cleared + # + if spec.satisfies("%oneapi"): + env.set("DBG", "") setup_run_environment = setup_build_environment