Chatterjee, Bodhisatwa via llvm-dev
2020-May-27 01:29 UTC
[llvm-dev] OpenMP Error in Clang
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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200527/70899f4f/attachment.html>
I don't see what the difference is between the two command lines is. However, 1. the option is "clang -fopenmp" (without -Xclang, which is for options for the -cc1 invocation) 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
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
Maybe Matching Threads
- LLVM crashing while trying to build SPEC with Clang
- clang only spawns one thread
- [LLVMdev] [3.7 Release] RC1 has been tagged, Testing Phase I begins
- [LLVMdev] libiomp, not libgomp as default library linked with -fopenmp
- [LLVMdev] [Openmp-dev] OpenMP 3.1 Implementation Complete