-
Notifications
You must be signed in to change notification settings - Fork 384
Open
Description
I've tried to build MPAS-Model with IntelLLVM 2025.3, and I see several compiler errors that seem to come from preprocessing of macros in the Fortran code.
I'm on Ubuntu24.04, with IntelLLVM 2025.3.1 and modules from spack-stack 2.0 (can give specifics if helpful).
I ran the following,
git clone --branch=develop https://github.com/MPAS-Dev/MPAS-Model.git # 447de92d4
mkdir build
cd build
cmake ../MPAS-Model
make
And I see the build fail with,
[ 14%] Building Fortran object src/framework/CMakeFiles/framework.dir/mpas_dmpar.F.o
mpas_dmpar.F(5547): #error: number of arguments doesn't match.
mpas_dmpar.F(6310): #error: number of arguments doesn't match.
mpas_dmpar.F(8165): #error: number of arguments doesn't match.
mpas_dmpar.F(8202): #error: number of arguments doesn't match.
(And similar errors in several other files)
Note the code pattern used here is, more or less,
#define COMMA ,
#define DMPAR_DEBUG_WRITE(M) !call mpas_log_write( M )
...
5547: DMPAR_DEBUG_WRITE('exch_halo nHaloLayers:$i destList halos:$i' COMMA intArgs=(/nHaloLayers COMMA size(field%recvList%halos)/))
(This pattern also in the other files)
I suspect, but have not proven, that one of two things is happening with the IntelLLVM Fortran compiler:
- the preprocessor is incorrectly transforming the nested macro expansion, OR
- the preprocessor is correctly transforming the macro expansion BUT is erroneously erroring. This would seem an unlikely hypothesis, except for this bug report with the Intel compiler: https://community.intel.com/t5/Intel-Fortran-Compiler/Regression-with-fpp-2025-2-0/td-p/1703735
While this may be a compiler bug, it could still be advantageous to update MPAS-Model's macros to enable compilation with these newer Intel compilers.
Metadata
Metadata
Assignees
Labels
No labels