Compiling NEMO 4.2.2 with Intel compilers version 2024

Good afternoon

I’m trying to compile NEMO 4.2.2 on a machine that only has the latest Intel compilers (v 2024.2). With the new versions, the names of the compilers have changed as follows:
icc → icx
ifort → ifx
As I understand, quite a few flags etc have changed with this switch. I managed to get XIOS to compile, but I’m failing on NEMO.

The final error is:
gmake: *** No rule to make target ‘nemogcm.o’, needed by ‘nemo.o’. Stop.
gmake -f /scratch/usr/shkjocke/models_p3/focioifs-4.0/nemo-ORCA05_Z46_SI3_COUPLED/cfgs/ORCA05_Z46_SI3_COUPLED/BLD/Makefile -j 1 all failed (2) at /scratch/usr/shkjocke/models_p3/focioifs-4.0/nemo-ORCA05_Z46_SI3_COUPLED/ext/FCM/bin/…/lib/Fcm/Build.pm line 597.
->Make: 0 second
->TOTAL: 19 seconds
Build failed on Fri Jul 26 16:34:45 2024.

but before that, I get a lot of messages like this:
icx: command line warning #10430: Unsupported command line options encountered
These options as listed are not supported.
For more information, use ‘-qnextgen-diag’.
option list:
-traditional
icx: warning: argument unused during compilation: ‘-I /scratch/usr/shkjocke/models_p3/focioifs-4.0/nemo-ORCA05_Z46_SI3_COUPLED/cfgs/ORCA05_Z46_SI3_COUPLED/BLD/inc’ [-Wunused-command-line-argument]
icx: warning: argument unused during compilation: ‘-I /sw/comm/impi/mpi/2021.13/include’ [-Wunused-command-line-argument]
icx: warning: argument unused during compilation: ‘-P’ [-Wunused-command-line-argument]
icx: warning: argument unused during compilation: ‘-C’ [-Wunused-command-line-argument]
icx: warning: argument unused during compilation: ‘-D key_si3’ [-Wunused-command-line-argument]
icx: warning: argument unused during compilation: ‘-D key_xios’ [-Wunused-command-line-argument]
icx: warning: argument unused during compilation: ‘-D key_netcdf4’ [-Wunused-command-line-argument]
icx: warning: argument unused during compilation: ‘-D key_nosignedzero’ [-Wunused-command-line-argument]
icx: warning: argument unused during compilation: ‘-D key_qco’ [-Wunused-command-line-argument]
icx: warning: argument unused during compilation: ‘-D key_oasis3’ [-Wunused-command-line-argument]

I had a look and I could not find that the “-C”, “-P”, or “-D” flags have changed at all from icc/ifort to icx/ifx.
https://www.intel.com/content/www/us/en/developer/articles/guide/porting-guide-for-icc-users-to-dpcpp-or-icx.html

I’m a bit lost. Has anyone else managed to compile NEMO with the new “icx” and “ifx” compilers? Is there anything major that I need to change in the arch file? I did not change the arch file since the older Intel versions.

Many thanks
Joakim

After posting the same issue to the Intel community forum I realised that the way forward is to not use the C compiler to preprocess:

%CPP                 ${CC} -E

but to instead use the system preprocessor:

%CPP                 cpp -P 
%FPPFLAGS            -P -traditional

I suppose the preprocessing was supported with older versions (icc) but not the new (icx).

/Joakim