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

    <tr>
        <th>Summary</th>
        <td>
            [flang][OpenMP] real(10) prevents compilation
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          hakostra
      </td>
    </tr>
</table>

<pre>
    This issue is the same as issue #128015. I have a recent `flang` built from sources with OpenMP offload support:

```
$ flang --version
flang version 21.0.0git (https://github.com/llvm/llvm-project.git b68e8f1de71a65b21910aff4aea75fc1ca6bf6e0)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/llvm/llvm-project/install/bin
```

I have found issue #128015 still to prevent targeting my Nvidia GPU (I have no AMD GPU to test with atm). The same small reproducer from PR #129742 still applies:

```
program real10
 use ieee_arithmetic
  implicit none
end program
```

Produces:
```
$ flang -fopenmp -fopenmp-targets=nvptx64 real10.F90
error: Semantic errors in real10.F90
/opt/llvm/llvm-project/install/bin/../include/flang/ieee_arithmetic.mod:143:1: error: REAL(KIND=10) is not an enabled type for this target
 real(10),intent(in)::x
 ^^^^^^^^^^^^^^^^^^^^^^
/opt/llvm/llvm-project/install/bin/../include/flang/ieee_arithmetic.mod:183:1: error: REAL(KIND=10) is not an enabled type for this target
 real(10),intent(in)::y
```
and so on for many, many lines. This error is also preventing me from using the HDF5 library in any projects with OpenMP, even if no HDF5 related functionality is ever touching the GPU...

If it makes any difference, my LLVM build is compiled with the following CMake command:

```
cmake -GNinja \
    -DCMAKE_BUILD_TYPE="Release" \
 -DCMAKE_INSTALL_PREFIX="/opt/llvm/llvm-project/install" \
 -DCMAKE_CUDA_COMPILER=${CUDACXX} \
 -DCMAKE_CUDA_HOST_COMPILER="clang++-19" \
 -DCMAKE_CUDA_ARCHITECTURES="89;120" \
 -DLLVM_ENABLE_PROJECTS="clang;lld;flang;lldb" \
 -DLLVM_ENABLE_RUNTIMES="compiler-rt;openmp;offload;flang-rt" \
 -DLLVM_TARGETS_TO_BUILD="X86;NVPTX" \
    -DLLVM_ENABLE_RTTI="ON" \
 -DOPENMP_ENABLE_LIBOMPTARGET="ON" \
 -DFLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT="OpenMP" \
 -DFLANG_RT_DEVICE_ARCHITECTURES="sm_89;sm_120" \
 -DFLANG_EXPERIMENTAL_OMP_OFFLOAD_BUILD="host_device" \
    ../llvm
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzEVluPozoS_jXOSykIDOTykAcSoCd7ckFpetT7hBwwic8YG9kmM_n3K0Myp9OTI-1otToS6kB11VcfX10w0ZqdBKULFC5RGI9IZ85SLc7km9RGkdFRVtdFfmYamNYdBabBnClo0lAgdyPCvodnrhc6sIYzuVAgoGhJhQE0cWtOxAlNXDh2jBuolWxAy06VVMN3Zs6wb6nYZiDrmktSge7aViqD_Ai5_TVxb5cbIRxAjwfj8YUqzaRAbjRYbs-APcd13BMzgPDsbEyrLRROEU5PzJy7o1PKBuGU88v9Z9wq-SctjWOjjpMZndVeRacemYRH7M09l9R1QCiZhnXplWRyrCfURXiO3Cgn6kQtWfgxmxSTYNyJb0J-F2PORPdjfBKddTorSipoZEW5dW2lZj-QG62FNoRzWsVMWTvCqWzNc24Ip2xwRzg9MvFZGTe6aV_LTlSfKwPaMM7BSGgVvdjKmJ44EydorrC7sIoReMnerGg3ICEh2sa90UgwVJuhXsQ0CM8dyO-NoBvCOSjaKll1JVVDjbPDkH4-DfAtPWlbzqh-WtpWyZMiDShKuGcN0GkKjFJaEMXMuaGGldYMrGk5K5kBIQVFbkRFBbfoX0XJBk73nM97qZYtFU3782Y8iKORH4tLa35MghstJ53bUKqU7Av2ShsiDCuht2hg4tHxtwqKU8fpjSXvKopwOkwOTj-J4DSyQn7kBb79a2n85HNIog3Csz_Wuxj5sWd71I6skAaIACr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