Can't emit LLVM from a C file with OpenMP (original) (raw)
December 21, 2024, 1:57am 1
My test:
$ clang -fopenmp -S -emit-llvm a.c -o a.ll
a.c:1:10: fatal error: 'omp.h' file not found
1 | #include <omp.h>
| ^~~~~~~
Looking for this header with the find
command, it lays on the gcc includes path, which is not compatible with clang. And I’ve tried to install every possible variation of the libomp
and it still doesn’t work.
jhuber6 December 21, 2024, 1:58am 2
That’s installed in the resource directory if you built your LLVM installation with the openmp
project enabled. ./lib/clang/20/include/omp.h
.
kparzysz December 21, 2024, 4:05pm 3
The resource directory should be automatically added to the default include paths. What’s the output when you add -v
to the compile flags? Did you compile clang yourself? If so, what were your cmake options?
wesuRage December 21, 2024, 8:32pm 4
@kparzysz it shows everything but the OpenMP lib. But I recompiled again, now it works!!