Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation failure on aarch64 with Arm Compiler for Linux's flang #5090

Open
dslarm opened this issue Nov 12, 2024 · 5 comments
Open

Compilation failure on aarch64 with Arm Compiler for Linux's flang #5090

dslarm opened this issue Nov 12, 2024 · 5 comments

Comments

@dslarm
Copy link

dslarm commented Nov 12, 2024

Using Spack to set up config and compile, the following error occurs: 5 errors found in build log.

It makes no difference if I disable the non-standard float16 - using an arg to cmake of: -DHDF5_ENABLE_NONSTANDARD_FEATURE_FLOAT16:BOOL=OFF

5 errors found in build log:
     3047    F90-S-0081-Illegal selector - KIND parameter has unknown value for data type  (/tmp/user/spack-stage/s
             pack-stage-hdf5-1.14.5-rzhstpbozkrcypkkfn5ntevpg2gwfof7/spack-build-rzhstpb/fortran/static/H5_gen.F90: 604
             9)
     3048      0 inform,   0 warnings,   1 severes, 0 fatal for h5pget_kind_16
     3049    F90-S-0081-Illegal selector - KIND parameter has unknown value for data type  (/tmp/user/spack-stage/s
             pack-stage-hdf5-1.14.5-rzhstpbozkrcypkkfn5ntevpg2gwfof7/spack-build-rzhstpb/fortran/static/H5_gen.F90: 609
             7)
     3050      0 inform,   0 warnings,   1 severes, 0 fatal for h5pregister_kind_16
     3051    F90-S-0081-Illegal selector - KIND parameter has unknown value for data type  (/tmp/user/spack-stage/s
             pack-stage-hdf5-1.14.5-rzhstpbozkrcypkkfn5ntevpg2gwfof7/spack-build-rzhstpb/fortran/static/H5_gen.F90: 614
             5)
     3052      0 inform,   0 warnings,   1 severes, 0 fatal for h5pinsert_kind_16
  >> 3053    make[2]: *** [fortran/src/CMakeFiles/hdf5_fortran-static.dir/build.make:325: fortran/src/CMakeFiles/hdf5_f
             ortran-static.dir/__/static/H5_gen.F90.o] Error 1
     3054    make[2]: Leaving directory '/tmp/user/spack-stage/spack-stage-hdf5-1.14.5-rzhstpbozkrcypkkfn5ntevpg2gw
             fof7/spack-build-rzhstpb'

This is using Arm Compiler for Linux - which is LLVM derivative but the NVIDIA/PGI fortran Flang.

As the float16 is disabled, it ought not to be trying to generate it?

@lrbison
Copy link

lrbison commented Dec 16, 2024

I see the same. At configure time I see:

-- Performing Test FORTRAN_CHAR_ALLOC - Success
-- ....NUMBER OF INTEGER KINDS FOUND 4
-- ....REAL KINDS FOUND {4,8,16}
-- ....INTEGER KINDS FOUND {1,2,4,8}
-- ....MAX DECIMAL PRECISION 15
-- ....LOGICAL KINDS FOUND {1,2,4,8}
-- ....FOUND SIZEOF for REAL KINDs {4,8,8}

A simple test tells me that armflang does not support REAL KIND=16, so I'm not sure how REAL KINDS FOUND contains 16. Additionally FOUND SIZEOF for REAL KINDs {4,8,8} is suspicious, since the last two kinds have the same sizeof.

The test seems to happen here:

@lrbison
Copy link

lrbison commented Dec 16, 2024

There is a follow-up check here which seems to try and catch the problem:

# Remove the invalid kind from the list
if (${${HDF_PREFIX}_HAVE_FLOAT128})
if (NOT(16 EQUAL ${max_real_fortran_sizeof}) AND NOT(${${HDF_PREFIX}_FORTRAN_SIZEOF_LONG_DOUBLE} EQUAL ${max_real_fortran_sizeof})
# Account for the fact that the C compiler can have 16-byte __float128 and the fortran compiler only has 8-byte doubles,
# so we don't want to remove the 8-byte fortran doubles.
AND NOT(${PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF} EQUAL ${max_real_fortran_sizeof}))
message (WARNING "
Fortran REAL(KIND=${max_real_fortran_kind}) is $max_real_fortran_sizeof Bytes, but no corresponding C float type exists of that size

@lrbison
Copy link

lrbison commented Dec 17, 2024

Compiling with HDF5 1.12.0 works, and has the following configure output:

-- Performing Test FC_AVAIL_KINDS_RESULT - Success
-- ....NUMBER OF INTEGER KINDS FOUND 4
-- ....REAL KINDS FOUND {4,8}
-- ....INTEGER KINDS FOUND {1,2,4,8}
-- ....MAX DECIMAL PRECISION 15

So it seems the detection logic changed. Best guess would be 9b5d968

@lrbison
Copy link

lrbison commented Dec 17, 2024

I truly don't understand how REAL KINDS FOUND includes kind=16 for armflang...

tmp$ cat test_fortran_r16.f90
PROGRAM main
  USE ISO_C_BINDING
  USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY : stdout=>OUTPUT_UNIT
  IMPLICIT NONE
  REAL (KIND=16) a
  WRITE(stdout, '(I0)') SIZEOF(a)
END
tmp$ armflang test_fortran_r16.f90
F90-S-0081-Illegal selector - KIND parameter has unknown value for data type  (test_fortran_r16.f90: 5)
  0 inform,   0 warnings,   1 severes, 0 fatal for main
tmp$ echo $?
1

@lrbison
Copy link

lrbison commented Dec 17, 2024

@derobins could you shed any light on the desired configury path here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants