<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/120347>120347</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
`Generic_GCC` can't find GCC 13's `omp.h`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
adamnovak
</td>
</tr>
</table>
<pre>
I'm using Binder with LLVM 14.0.5. It seems like it builds and uses a bunch of Clang, and the bits of Clang it uses are having a lot of trouble finding my `omp.h`. Here's my log:
```
BINDER COMMAND: binder/./build/llvm-14.0.5/llvm-14.0.5.Linux-5.15.49-linuxkit-aarch64-with-glibc2.39.release/bin/binder --root-module bdsg --prefix /mnt/libbdsg-bindings-fix/libbdsg/bdsg/cmake_bindings/ --bind bdsg --config config.cfg all_cmake_includes.hpp -- -std=c++14 -I/mnt/libbdsg-bindings-fix/libbdsg/bdsg/include -I/mnt/libbdsg-bindings-fix/libbdsg/bdsg/deps/DYNAMIC/include -I/mnt/libbdsg-bindings-fix/libbdsg/bdsg/deps/pybind11/include -I/mnt/libbdsg-bindings-fix/libbdsg/bdsg/deps/hopscotch-map/include -I/mnt/libbdsg-bindings-fix/libbdsg/bdsg/deps/sdsl-lite/include -I/mnt/libbdsg-bindings-fix/libbdsg/bdsg/deps/mio/include -I/mnt/libbdsg-bindings-fix/libbdsg/bdsg/deps/libhandlegraph/src/include -I/mnt/libbdsg-bindings-fix/libbdsg/bdsg/deps/sparsepp -I/mnt/libbdsg-bindings-fix/libbdsg/bdsg/deps/BBHash -DNDEBUG -v
clang version 14.0.5 (https://github.com/RosettaCommons/binder.git d5ef611f80cc91848db1fbd09d26b97013aa4db5)
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir:
Found candidate GCC installation: /../lib/gcc/aarch64-linux-gnu/13
Selected GCC installation: /../lib/gcc/aarch64-linux-gnu/13
Candidate multilib: .;@m64
Selected multilib: .;@m64
clang version 14.0.5 (https://github.com/RosettaCommons/binder.git d5ef611f80cc91848db1fbd09d26b97013aa4db5)
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: /mnt/libbdsg-bindings-fix/libbdsg/binder/build/llvm-14.0.5/llvm-14.0.5.Linux-5.15.49-linuxkit-aarch64-with-glibc2.39.release/bin
Found candidate GCC installation: /usr/lib/gcc/aarch64-linux-gnu/13
Selected GCC installation: /usr/lib/gcc/aarch64-linux-gnu/13
Candidate multilib: .;@m64
Selected multilib: .;@m64
clang Invocation:
"/mnt/libbdsg-bindings-fix/libbdsg/binder/build/llvm-14.0.5/llvm-14.0.5.Linux-5.15.49-linuxkit-aarch64-with-glibc2.39.release/bin/clang-tool" "-cc1" "-triple" "aarch64-unknown-linux-gnu" "-fsyntax-only" "-disable-free" "-clear-ast-before-backend" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "all_cmake_includes.hpp" "-mrelocation-model" "static" "-mframe-pointer=non-leaf" "-fmath-errno" "-ffp-contract=on" "-fno-rounding-math" "-mconstructor-aliases" "-funwind-tables=2" "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8a" "-target-abi" "aapcs" "-fallow-half-arguments-and-returns" "-debugger-tuning=gdb" "-v" "-fcoverage-compilation-dir=/mnt/libbdsg-bindings-fix/libbdsg" "-resource-dir" "/mnt/libbdsg-bindings-fix/libbdsg/binder/build/llvm-14.0.5/llvm-14.0.5.Linux-5.15.49-linuxkit-aarch64-with-glibc2.39.release/lib/clang/14.0.5" "-I" "/mnt/libbdsg-bindings-fix/libbdsg/bdsg/include" "-I" "/mnt/libbdsg-bindings-fix/libbdsg/bdsg/deps/DYNAMIC/include" "-I" "/mnt/libbdsg-bindings-fix/libbdsg/bdsg/deps/pybind11/include" "-I" "/mnt/libbdsg-bindings-fix/libbdsg/bdsg/deps/hopscotch-map/include" "-I" "/mnt/libbdsg-bindings-fix/libbdsg/bdsg/deps/sdsl-lite/include" "-I" "/mnt/libbdsg-bindings-fix/libbdsg/bdsg/deps/mio/include" "-I" "/mnt/libbdsg-bindings-fix/libbdsg/bdsg/deps/libhandlegraph/src/include" "-I" "/mnt/libbdsg-bindings-fix/libbdsg/bdsg/deps/sparsepp" "-I" "/mnt/libbdsg-bindings-fix/libbdsg/bdsg/deps/BBHash" "-D" "NDEBUG" "-internal-isystem" "/usr/lib/gcc/aarch64-linux-gnu/13/../../../../include/c++/13" "-internal-isystem" "/usr/lib/gcc/aarch64-linux-gnu/13/../../../../include/aarch64-linux-gnu/c++/13" "-internal-isystem" "/usr/lib/gcc/aarch64-linux-gnu/13/../../../../include/c++/13/backward" "-internal-isystem" "/mnt/libbdsg-bindings-fix/libbdsg/binder/build/llvm-14.0.5/llvm-14.0.5.Linux-5.15.49-linuxkit-aarch64-with-glibc2.39.release/lib/clang/14.0.5/include" "-internal-isystem" "/usr/local/include" "-internal-isystem" "/usr/lib/gcc/aarch64-linux-gnu/13/../../../../aarch64-linux-gnu/include" "-internal-externc-isystem" "/usr/include/aarch64-linux-gnu" "-internal-externc-isystem" "/include" "-internal-externc-isystem" "/usr/include" "-std=c++14" "-fdeprecated-macro" "-fdebug-compilation-dir=/mnt/libbdsg-bindings-fix/libbdsg" "-ferror-limit" "19" "-fno-signed-char" "-fgnuc-version=4.2.1" "-fcxx-exceptions" "-fexceptions" "-fcolor-diagnostics" "-target-feature" "+outline-atomics" "-faddrsig" "-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-x" "c++-header" "/mnt/libbdsg-bindings-fix/libbdsg/all_cmake_includes.hpp"
clang -cc1 version 14.0.5 based upon LLVM 14.0.5 default target aarch64-unknown-linux-gnu
ignoring nonexistent directory "/usr/lib/gcc/aarch64-linux-gnu/13/../../../../aarch64-linux-gnu/include"
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
/mnt/libbdsg-bindings-fix/libbdsg/bdsg/include
/mnt/libbdsg-bindings-fix/libbdsg/bdsg/deps/DYNAMIC/include
/mnt/libbdsg-bindings-fix/libbdsg/bdsg/deps/pybind11/include
/mnt/libbdsg-bindings-fix/libbdsg/bdsg/deps/hopscotch-map/include
/mnt/libbdsg-bindings-fix/libbdsg/bdsg/deps/sdsl-lite/include
/mnt/libbdsg-bindings-fix/libbdsg/bdsg/deps/mio/include
/mnt/libbdsg-bindings-fix/libbdsg/bdsg/deps/libhandlegraph/src/include
/mnt/libbdsg-bindings-fix/libbdsg/bdsg/deps/sparsepp
/mnt/libbdsg-bindings-fix/libbdsg/bdsg/deps/BBHash
/usr/lib/gcc/aarch64-linux-gnu/13/../../../../include/c++/13
/usr/lib/gcc/aarch64-linux-gnu/13/../../../../include/aarch64-linux-gnu/c++/13
/usr/lib/gcc/aarch64-linux-gnu/13/../../../../include/c++/13/backward
/mnt/libbdsg-bindings-fix/libbdsg/binder/build/llvm-14.0.5/llvm-14.0.5.Linux-5.15.49-linuxkit-aarch64-with-glibc2.39.release/lib/clang/14.0.5/include
/usr/local/include
/usr/include/aarch64-linux-gnu
/usr/include
End of search list.
Process input file /mnt/libbdsg-bindings-fix/libbdsg/all_cmake_includes.hpp
/mnt/libbdsg-bindings-fix/libbdsg/all_cmake_includes.hpp:88:10: fatal error: 'omp.h' file not found
#include <omp.h>
^~~~~~~
Generate bindings, pass 1...
Generate bindings, pass 2...
Generate bindings, pass 3...
Generate bindings, pass 4...
Generate bindings, pass 5...
Generate bindings, pass 6...
Sorting Binders...
Sorting Binders... Done.
Writing code...
Writing code... Done.
1 error generated.
```
The driver (?) successfully finds the right GCC installation with has the C++ STL that I want to be used in the bindings that Binder will generate (`/usr/lib/gcc/aarch64-linux-gnu/13`). But the final include search path doesn't end up featuring `/usr/lib/gcc/aarch64-linux-gnu/13/include/`, where `omp.h` actually lives.
It seems like that directory should be [found by `Generic_GCC::AddMultilibIncludeArgs`](https://github.com/llvm/llvm-project/blob/c12386ae247c0d46e1d513942e322e3a0510b126/clang/lib/Driver/ToolChains/Gnu.cpp#L2855-L2872), since I think this is a multilib-specific include directory (though it's also version specific). But I think that that's actually coming up with the `/usr/lib/gcc/aarch64-linux-gnu/13/../../../../aarch64-linux-gnu/include`, which ends in the triple and `/include` like the function seems to be going for, but which doesn't actually exist.
How is `Generic_GCC` *meant* to be finding the directory with the triple-specific, GCC-version-specific `omp.h` in it?
I haven't tried newer Clang versions here; it's possible this logic has changed and works in newer versions. But I looked over the code and it wasn't clear in the current version how this directory is meant to be found either. There's no real difference in [the one non-c++-specific include-finding function](https://github.com/llvm/llvm-project/blob/b24caf3d2b91ad8b2b29d70fb69fce3c5347b9f4/clang/lib/Driver/ToolChains/Gnu.cpp#L3241-L3258).
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzcWl9v2zgS_zTKC0FBovz3IQ-OHbcB0t5h29vFPQUUOZJ4oUiBpJzk5T77gaIkO2nc1I13t7iicGxx5sfhcGb4IylqrSgVwGU0vYqmmwvaukqbS8pprfSO3l_kmj9d3kRkXqPWClWiK6E4GPQgXIVub3__hNJJnMTTGN04ZAFqi6S4ByQcylshuUVUcdRasIiivFWsQrpAa0lVGZF11-gqQLlwdmzwykHDAKrozndLkdTOSzij21wCKoTivqF-QtEs0XUTV9EsidFHMBCRufUNUpdRtoqS7v8s6f8nq6ubz5vr39D6H58-rT5vomyF8m5UEdnGEdl2hkdkK-WuxmF4z3_Ft0K1j3gap9N4ssTS_7oXDlNqWDWbYO8cXEqRMxJny9iABGrBIwsVPr0LMTZaO1xr3kpAObclwrgxUIhHFJFtrZzvVeS-BedhuBYX4nH_2IOFP6ym93A3SEVki3CnM-AyrQpRovAnZkWJqJR3QUsoJlsONq6aBmGMsHU8yjYsIlcRuUonCN-cbE-P-TOqHBo_gM2_P68-3azPgtU8ecE0PQtYpRvLtGMVrmlzFkTLrcRSODgLWi30WXCkyCuquITS0KbyZhp2nuE21FjwsfbTEFdXH6mtEN583lxf_esDwrsoWbGueOzAWKFVX5dQRBaVc431hYBsI7IthavaPGa6jsj2N23BObrWda2VHXMzLoVDfArFLE2LR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