This issue was initially brought to my attention at https://github.com/open-mpi/ompi/issues/11737
With armflang 22.x and the latest 23.04.1, the #include directive does not work as expected.
Instead of opening the file with an absolute path, it tries to append the absolute path to the include directories.
Here is a simple way to evidence the issue:
$ armflang --version
Arm C/C++/Fortran Compiler version 23.04.1 (build number 14) (based on LLVM 16.0.2)
Thread model: posix
more /tmp/include/header.h /tmp/src/main.F90
! dummy header
armflang -c main.F90
F90-F-0906-Can't find include file /tmp/include/header.h (main.F90: 1)
F90/aarch64 Linux FlangArm F90 - 1.5 2017-05-01: compilation aborted
FWIW, using a relative path works as expected
$ more main2.F90
$ armflang -c main2.F90
I suspect this is a bug, but if this is a feature/limitation of armflang, please let me know.
FWIW, I tried flang-new from LLVM 15 and 16 but the error does not occur with these compilers.
Thanks for the bug report and the excellent reproducer.
We have reproduced it on our end and agree with your diagnosis as a compiler bug.
I'll get back to you soon with a fix ETA.