<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/123214>123214</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [flang] The Fortran test cases for hdf5-1.10.6 cannot be built with Flang
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            flang
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          pawosm-arm
      </td>
    </tr>
</table>

<pre>
    Although the hdf5 library can be built and installed when tests are explicitly disabled (with `--disable-tests` passed to the `configure` script), this is not an optimal situation.

I'm configuring hdf5-1.10.6 as such:

```
$ CC=mpicc CXX=mpic++ FC=mpifort F77=mpifort F90=mpifort ./configure --enable-shared --enable-static --enable-parallel --disable-cxx --enable-fortran --enable-hl --prefix=/some/prefix
$ sed -i -e 's#wl=""#wl="-Wl,"#g' libtool
$ sed -i -e 's#pic_flag=""#pic_flag=" -fPIC -DPIC"#g' libtool
```
(the `sed` lines are here to make it able to build shared libs, it's a known flang issue)

Unfortunately, this will fail when building Fortran tests as such:

```
mpifort  -I. -I../../../fortran/test -I../../src -I../../fortran/src -I../../fortran/src -I../../fortran/src  -c -o tH5T.o ../../../fortran/test/tH5T.F90

error: Semantic errors in ../../../fortran/test/tH5T.F90
./../../../fortran/test/tH5T.F90:283:6: error: No specific subroutine of generic 'h5dwrite_f' matches the actual arguments
       CALL h5dwrite_f(dset_id, dt4_id, real_member, data_dims, error, xfer_prp = plist_id)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
./../../../fortran/test/tH5T.F90:541:6: error: No specific subroutine of generic 'h5dread_f' matches the actual arguments
       CALL h5dread_f(dset_id, dt4_id, real_member_out, data_dims, error)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
./../../../fortran/test/tH5T.F90:544:9: error: Cannot use intrinsic function 'verify' as a subroutine
          CALL VERIFY("h5dread_f:Wrong double precision data is read back", real_member_out(i), real_member(i), total_error)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
./../../../fortran/test/tH5T.F90:544:9: error: No specific subroutine of generic 'verify' matches the actual arguments
          CALL VERIFY("h5dread_f:Wrong double precision data is read back", real_member_out(i), real_member(i), total_error)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```

</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzsl02P2zYTxz8NfRnIkChLtg4-KHaEZ4HgQdCmTXoyKGoksaFIgaTi3W9fjKxdr4HmbdFDkXTBtU1yOOLw_xM5FN6rziDuWfaKZceVmEJv3X4UZ-uHSLhhVdvmYV_q0Nup6yH0CH3TZqBV7YR7ACkM1Aj1pHQAYRpQxgehNTZw7tFAQB88CIeA96NWUgX9AI3yoiYTxndnFXpgeRxFS2s0D2F5DKPwHhsIdn4sy2NpTau6ySH1eunUGBgvGD9A6JUH5cFYmgXYMahBaPAqTCIoa9YsLllc3jG-HeDRjTLdHEyUrJN4nYPw4CfZs7S8WLM8XkpcMr6Bw4Glx2FUUsLhw4flN-OvGH8F1dLXWheg2m6f14r4WW3NePUUB0QRmjlo3wuHzbN6EEHJa30UjlZVw3Wd5P39tZ98O2GuDT2Zjg5bdc_SI-OVtwMyXi1Nl4hoeSMFEQLjW894etazMZ_LUy16rxk_XNo6xrekfrBWf87LqOSp1aJ77uu2DaL27d0BouPbu8_4vVn73QKAx4ak18rgBaoeHRIgg_iIoAJQ6FQnHhtYFlW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