From f18ccf098265a2586553fb78e207e1612f9a9ab2 Mon Sep 17 00:00:00 2001 From: Jim Wittig Date: Fri, 6 Feb 2026 16:58:42 -0700 Subject: [PATCH] Change the intel fortran preprocessing order. This fixes a problem when using a macro in the invocation of another macro. This change is only for using the intel build tools. It applies to both gnu make builds and cmake builds. --- Makefile | 4 ++-- cmake/Functions/MPAS_Functions.cmake | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ff75c6be6b..5a7cf5060a 100644 --- a/Makefile +++ b/Makefile @@ -663,11 +663,11 @@ intel: # BUILDTARGET Intel oneAPI Fortran, C, and C++ compiler suite "CC_SERIAL = icx" \ "CXX_SERIAL = icpx" \ "FFLAGS_PROMOTION = -real-size 64" \ - "FFLAGS_OPT = -O3 -convert big_endian -free -align array64byte" \ + "FFLAGS_OPT = -O3 -convert big_endian -free -align array64byte -Qoption,fpp,-macro_expand=vc" \ "CFLAGS_OPT = -O3" \ "CXXFLAGS_OPT = -O3" \ "LDFLAGS_OPT = -O3" \ - "FFLAGS_DEBUG = -g -convert big_endian -free -check bounds,pointers,arg_temp_created,format,shape,contiguous -fpe0 -traceback" \ + "FFLAGS_DEBUG = -g -convert big_endian -free -check bounds,pointers,arg_temp_created,format,shape,contiguous -fpe0 -traceback -Qoption,fpp,-macro_expand=vc" \ "CFLAGS_DEBUG = -g -traceback" \ "CXXFLAGS_DEBUG = -g -traceback" \ "LDFLAGS_DEBUG = -g -traceback" \ diff --git a/cmake/Functions/MPAS_Functions.cmake b/cmake/Functions/MPAS_Functions.cmake index fe76556225..15d9f63fc1 100644 --- a/cmake/Functions/MPAS_Functions.cmake +++ b/cmake/Functions/MPAS_Functions.cmake @@ -121,6 +121,7 @@ function(mpas_fortran_target target) list(APPEND MPAS_FORTRAN_TARGET_COMPILE_OPTIONS_PUBLIC $<$:-align array64byte> $<$:-convert big_endian> + $<$:-Qoption,fpp,-macro_expand=vc> ) if(MPAS_DOUBLE_PRECISION) list(APPEND MPAS_FORTRAN_TARGET_COMPILE_OPTIONS_PRIVATE