1

I generated a .ll file using llvm-gcc for a Openmp program(written in c).
Then Optimized using opt(version 3.0)
But when I try to execute the optimized .ll file using lli or llvm-ld, getting the following errors,

        LLVM ERROR: Program used external function 'GOMP_parallel_start' which could not be resolved!

Here is the step I followed,

   $ llvm-gcc -emit-llvm loop11.c -fopenmp -o loop.ll -S
   $ opt -O3  loop.ll -o loop.opt.ll -S
   $ lli loop.opt.ll
    LLVM ERROR: Program used external function 'GOMP_parallel_start' which could not be resolved!

Please help me to solve this problem.
Thanks in advance.

1 Answer 1

3

You have to link / load the OpenMP runtime, libgomp in this case.

Sign up to request clarification or add additional context in comments.

2 Comments

I tried linking OpenMP runtime libgomp, [[$llvm-ld -l="/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/libgomp.a" op.bc]] getting same error.
This will work only if you're using llvm-ld to generate the native code. You will either compile libgomp into LLVM IR and link it in, or load libgomp.so into lli's process. Also, make sure that LLVM was compiled with libffi support.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.