Arnamoy Bhattacharyya
2012-Jun-16 19:38 UTC
[LLVMdev] How to Run OpenMP application Using "lli"
Hi; Both -fplugin-arg-dragonegg-emit-ir and -flto works for creating llvm bitcode that can be run with lli. Thanks to Nick for the suggestion. Now, trying to run an OpenMP hello world program. llvm-gcc -fopenmp p_hello.c -flto -S -o p_hello.ll lli p_hello.ll output: LLVM ERROR: Program used external function 'GOMP_parallel_start' which could not be resolved! I am guessing that I have to link libgomp.a somehow but want to know the correct way to do it. Other way around using gcc: llvm-gcc -fopenmp p_hello.c -flto -S -o p_hello.ll llc p_hello.ll gcc -fopenmp p_hello.s -o p_hello ./p_hello output: Hello World Hello World Hello World Hello World I guess this is not the (only) way to run OpenMP programs. I can guess that compiling the libgomp into LLVM IR and then linking it with the hello.ll will allow me to run it with lli? Any other suggestion on how to run them? -- Arnamoy Bhattacharyya Athabasca Hall 143 Department of Computing Science - University of Alberta Edmonton, Alberta, Canada, T6G 2E8 587-710-7073 -------------- next part -------------- An HTML attachment was scrubbed... URL: <lists.llvm.org/pipermail/llvm-dev/attachments/20120616/724ff7f8/attachment.html>
Hi Arnamoy,> Now, trying to run an OpenMP hello world program. > > llvm-gcc -fopenmp p_hello.c -flto -S -o p_hello.ll > lli p_hello.ll > > output: LLVM ERROR: Program used external function 'GOMP_parallel_start' which > could not be resolved! > > I am guessing that I have to link libgomp.a somehow but want to know the correct > way to do it.you can load shared libraries into lli using -load, so if you have libgomp.so then try lli -load=libgomp.so p_hello.ll Ciao, Duncan.
Apparently Analagous Threads
- [LLVMdev] Any Work Done/ Going on for OpenMP Support in Clang?
- [LLVMdev] [Openmp-dev] OpenMP 3.1 Implementation Complete
- [LLVMdev] [Openmp-dev] OpenMP 3.1 Implementation Complete
- dlopen-ing a library with OpenMP by a non-OpenMP process
- [LLVMdev] [Openmp-dev] OpenMP 3.1 Implementation Complete