LLVM Installation failing

Hi

I am trying to install llvm and clang on ubuntu 16.04, I tried installing them using apt command but while running the pass it gives me error
"error: llvm/pass.h not found
#include"llvm/pass.h"
so i tried installing using the source code and building it my self, make fails at 98% with this error

collect2: error: ld returned 1 exit status
tools/llvm-c-test/CMakeFiles/llvm-c-test.dir/build.make:525: recipe for target ‘bin/llvm-c-test’ failed
make[2]: *** [bin/llvm-c-test] Error 1
CMakeFiles/Makefile2:62792: recipe for target ‘tools/llvm-c-test/CMakeFiles/llvm-c-test.dir/all’ failed
make[1]: *** [tools/llvm-c-test/CMakeFiles/llvm-c-test.dir/all] Error 2
Makefile:149: recipe for target ‘all’ failed
make: *** [all] Error 2

can anyone tell me what i am doing wrong here.

Thank you

Best Regards
Muhammad Ehtasham

Hi Muhammed,

the header is llvm/Pass.h, capital P.

From the error there is not much to tell, you cut off the actual linker error message. We’ll need a bit more context.

Cheers,
Philip

Hi Philip
​,​

Thanks for the response. I have used capital P for Pass.h.
This is the first time i am working on llvm so i am just trying to run a pass, following this link.
while running the pass with
clang -Xclang -load -Xclang build/skeleton/libSkeletonPass.* something.c

It gives me the error Pass.h file not found (see attached screenshot)

also i have tried running it using
opt-3.8 -load lib/libskeleton.so -option input.bc -o output.bc
​​

and it say
​​
cannot open shared object file: No such file or directory

Thank you
Best Regards