Isca icon indicating copy to clipboard operation
Isca copied to clipboard

Compile Errors with GCC version 10>

Open sit23 opened this issue 2 years ago • 2 comments

Errors with most recent g-fortran and gcc compilers

Description

I've been testing out the gfortran installation of Isca on AWS EC2 Ubuntu and have run into problems with new compiler errors that I hadn't seen before. These are principally:

Error: Type mismatch between actual argument at (1) and actual argument at (2) **********.

and

Error: BOZ literal constant at (1) is neither a data-stmt-constant nor an actual argument to INT, REAL, DBLE, or CMPLX intrinsic function [see '-fno-allow-invalid-boz']

This appears to be because the more recent versions of GCC compilers are now throwing errors in both of these cases where they were not previously doing so.


Isca version Main ExeClim version


System Information: system='Linux', node='ip-172-31-47-194', release='5.15.0-1004-aws', version='#6-Ubuntu SMP Thu Mar 31 09:44:20 UTC 2022', machine='x86_64'

This is an EC2 AWS instance.

One workaround for this is to pass extra compiler flags. To do this, add the following line to your experiment script:

cb.compile_flags.extend(['-fallow-argument-mismatch', '-fallow-invalid-boz'])

This tells the compiler to turn these two error types into warnings, thus allowing the model to compile. In future we should look to fix the errors or automatically include these flags.

sit23 avatar Jun 07 '22 14:06 sit23

@sit23 Just wanted to link this to P/R #236 which was me beginning to have a crack at fixing this. It's also causing the trip tests to fail (because they use these more recent compilers). Unfortunately it's not a one line change, so I've put this on hold until I have the time to finish properly.

ntlewis avatar Jun 08 '22 08:06 ntlewis

I hadn't spotted that other compiler flag, I'll add that into my P/R

ntlewis avatar Jun 08 '22 08:06 ntlewis