From aab12d579e323ebb514416fefe80738a2fa2a2b5 Mon Sep 17 00:00:00 2001
From: "Peter W. Draper" <p.w.draper@durham.ac.uk>
Date: Fri, 10 Jan 2020 17:08:20 +0000
Subject: [PATCH] Add extra flags recommended for EPYC

From http://www.prace-ri.eu/IMG/pdf/Best-Practice-Guide-AMD.pdf, note we add these to CFLAGS as the icc_flags is a choice vector
---
 m4/ax_cc_maxopt.m4 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/m4/ax_cc_maxopt.m4 b/m4/ax_cc_maxopt.m4
index 5795f540f3..282668af72 100644
--- a/m4/ax_cc_maxopt.m4
+++ b/m4/ax_cc_maxopt.m4
@@ -138,7 +138,8 @@ if test "$ac_test_CFLAGS" != "set"; then
                     *061?f??:*:*:*|61?f??:*:*:*) icc_flags="-march=core-avx2" ;;
                     *06??f??:*:*:*|6??f??:*:*:*) icc_flags="-march=core-avx2" ;;
                     *070?f??:*:*:*|70?f??:*:*:*) icc_flags="-march=core-avx2" ;;
-                                   83?f??:*:*:*) icc_flags="-march=core-avx2" ;; # EPYC
+                                   83?f??:*:*:*) icc_flags="-march=core-avx2"
+                                                 CFLAGS="$CFLAGS -fma -ftz -fomit-frame-pointer";; # EPYC
                   esac ;;
               esac ;;
           esac
-- 
GitLab