[llvm-dev] OpenMP Error in Clang

Johannes Doerfert via llvm-dev llvm-dev at lists.llvm.org
Wed May 27 07:35:05 PDT 2020


On 5/27/20 5:44 AM, Michael Kruse via llvm-dev wrote:
> I don't see what the difference is between the two command lines is. However,

Me neither.


> 1. the option is "clang -fopenmp" (without -Xclang, which is for
> options for the -cc1 invocation)

Right. If you don't use the driver option you need to manage your 
include and library paths yourself.

Does `clang -fopenmp test.c` work for you?


>
> 2. omp.h is part of the openmp subproject, it must be enabled
> (-DLLVM_ENABLE_PROJECTS=openmp) and omp.h found in the include path.
>
> Michael
>
>
> Am Di., 26. Mai 2020 um 20:29 Uhr schrieb Chatterjee, Bodhisatwa via
> llvm-dev <llvm-dev at lists.llvm.org>:
>> Hello,
>>
>> I am getting the following error while trying to build a benchmark with a custom function pass:
>>
>> clang  -Xclang -fopenmp=libomp -Xclang -load -Xclang my_lib.so file.c
>>
>>
>>   error: unknown argument: '-fopenmp=libomp'
>>
>> If I use this instead:
>>
>> clang  -Xclang -fopenmp=libomp -Xclang -load -Xclang my_lib.so file.c
>>
>> I get the error:  fatal error: 'omp.h' file not found
>>
>> I am not sure where the problem is, especially since I have used OpenMP applications with llvm before.
>>
>> Thanks,
>> Bodhi
>> _______________________________________________
>> LLVM Developers mailing list
>> llvm-dev at lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


More information about the llvm-dev mailing list