Skip to content

[flang][OpenMP] real(10) prevents compilation #146876

@hakostra

Description

@hakostra

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions