Arithmetic overflow when building stdlib with gfortran 9

I just attempted to build stdlib for the first time. I’m using fpm 0.12.0 alpha and gfortran 9.4.0 in WSL, compiling the stdlib-fpm branch.

Is it expected to have a compiler error for integer overflow on the 64-bit hash routines?

stdlib_hash_64bit.f90                  failed.
[  0%] Compiling...
././src/stdlib_hash_64bit.f90:66:29:

   66 |         pow64_over_phi = int(z'9E3779B97F4A7C15', int64)
      |                             1
Error: Arithmetic overflow converting INTEGER(16) to INTEGER(8) at (1). This check can be disabled with the option ‘-fno-range-check’

It builds with no errors with fpm build --profile release --compiler ifx using ifx 2025.3.0 20251023.

Have you tried a more recent version of gfortran? stdlib’s CI checks several versions starting from the 10 up to 15.

1 Like

I installed gfortran 13 and that fixed it. I didn’t consider that gfortran 9 is a relatively old version. It’s the default in my WSL installation.

1 Like

But now I get test errors with ifx.

<ERROR> Execution for object " test_string_derivedtype_io " returned exit code  128
<ERROR> Execution for object " test_string_to_string " returned exit code  128
<ERROR> *cmd_run*:stopping due to failed executions
STOP 128

I have no idea how to diagnose this. Any help would be greatly appreciated!