From d62268a21ac5fc69ea227fa4d5269e3dba483af5 Mon Sep 17 00:00:00 2001
From: Pedro Costa
Date: Sun, 29 Oct 2023 19:07:58 +0100
Subject: [PATCH] Improved support for `ifx` compiler. (#93)
---
configs/compilers.mk | 3 +++
configs/flags.mk | 18 ++++++------------
2 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/configs/compilers.mk b/configs/compilers.mk
index 96b1b42a..5aab3f06 100644
--- a/configs/compilers.mk
+++ b/configs/compilers.mk
@@ -5,6 +5,9 @@ endif
ifeq ($(strip $(FCOMP)),INTEL)
FC = mpiifort
endif
+ifeq ($(strip $(FCOMP)),INTEL_IFX)
+FC = mpiifx
+endif
ifeq ($(strip $(FCOMP)),NVIDIA)
FC = mpifort
endif
diff --git a/configs/flags.mk b/configs/flags.mk
index ecb1e0e3..481430b9 100644
--- a/configs/flags.mk
+++ b/configs/flags.mk
@@ -1,7 +1,7 @@
ifeq ($(strip $(FCOMP)),GNU)
FFLAGS_MOD_DIR := -J
endif
-ifeq ($(strip $(FCOMP)),INTEL)
+ifeq ($(findstring INTEL,$(strip $(FCOMP))),INTEL)
FFLAGS_MOD_DIR := -module
endif
ifeq ($(strip $(FCOMP)),NVIDIA)
@@ -19,7 +19,7 @@ ifeq ($(strip $(FFLAGS_DEBUG)),1)
ifeq ($(strip $(FCOMP)),GNU)
override FFLAGS += -O0 -g -fbacktrace -Wall -Wextra -pedantic -fcheck=all -finit-real=snan -ffpe-trap=invalid -std=f2018
endif
-ifeq ($(strip $(FCOMP)),INTEL)
+ifeq ($(findstring INTEL,$(strip $(FCOMP))),INTEL)
override FFLAGS += -O0 -g -traceback -fpe0 -stand f18
endif
ifeq ($(strip $(FCOMP)),NVIDIA)
@@ -36,7 +36,7 @@ ifeq ($(strip $(FFLAGS_DEBUG_MAX)),1)
ifeq ($(strip $(FCOMP)),GNU)
override FFLAGS += -O0 -g -fbacktrace -Wall -Wextra -Wimplicit-interface -Wno-unused-function -fPIC -fcheck=all -ffpe-trap=invalid,zero,overflow -finit-real=snan -finit-integer=-99999999 -std=f2018
endif
-ifeq ($(strip $(FCOMP)),INTEL)
+ifeq ($(findstring INTEL,$(strip $(FCOMP))),INTEL)
override FFLAGS += -O0 -warn all -g -traceback -fpe0 -stand f18
endif
ifeq ($(strip $(FCOMP)),NVIDIA)
@@ -53,7 +53,7 @@ ifeq ($(strip $(FFLAGS_OPT)),1)
ifeq ($(strip $(FCOMP)),GNU)
override FFLAGS += -O3
endif
-ifeq ($(strip $(FCOMP)),INTEL)
+ifeq ($(findstring INTEL,$(strip $(FCOMP))),INTEL)
override FFLAGS += -O3
endif
ifeq ($(strip $(FCOMP)),NVIDIA)
@@ -70,7 +70,7 @@ ifeq ($(strip $(FFLAGS_OPT_MAX)),1)
ifeq ($(strip $(FCOMP)),GNU)
override FFLAGS += -Ofast -march=native
endif
-ifeq ($(strip $(FCOMP)),INTEL)
+ifeq ($(findstring INTEL,$(strip $(FCOMP))),INTEL)
override FFLAGS += -fast -xHost
endif
ifeq ($(strip $(FCOMP)),NVIDIA)
@@ -133,7 +133,7 @@ endif
ifeq ($(strip $(OPENMP)),1)
ifeq ($(strip $(FCOMP)),GNU)
override FFLAGS += -fopenmp
-else ifeq ($(strip $(FCOMP)),INTEL)
+else ifeq ($(findstring INTEL,$(strip $(FCOMP))),INTEL)
override FFLAGS += -qopenmp
else ifeq ($(strip $(FCOMP)),NVIDIA)
override FFLAGS += -mp
@@ -143,9 +143,3 @@ else
override FFLAGS += -fopenmp
endif
endif
-
-ifeq ($(strip $(FCOMP)),INTEL)
-ifeq ($(strip $(INTEL_IFX)),1)
-override FFLAGS += -fc=ifx
-endif
-endif