I need to use LLVM and Clang for the compiler class I'm registered to. This is not a question of the contents of this class, but simply how to install the necessary software.
I run gcc version 4.6.3 and download, create, test and update what I consider LLVM package version 3.4 (latest svn version). I am making a simple hello world application as indicated on the LLVM start page, but on the line
lli helloworld.bc
I get the error "lli: helloworld.bc: Invalid MODULE_CODE_GLOBALVAR entry"
I am a complete newbie with this material, so I donโt know if I gave you everything you need to fix my mistake, write to me if you need to know something. Also, please try to give me as detailed instructions as possible ... I was thrown into the world of Ubuntu and Clang without any instructions, and I cannot read another โsolutionโ that says โread the manual pagesโ.
Thank you so much for your help. I just want it set up so that I can at least try my homework.
EDIT :: Here are the EXTRACT instructions that I ran in the terminal, 99% of which were taken directly from the LLVM website:
cd myFolder svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm cd myFolder cd llvm/tools svn co http://llvm.org/svn/llvm-project/cfe/trunk clang cd myFolder cd llvm/projects svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt cd myFolder mkdir build cd build ../llvm/configure --enable-optimized CC=/usr/bin/clang CXX=/usr/bin/clang++ make make check-all make update
THEN
clang hello.c -o hello clang -03 -emit-llvm hello.c -c -o hello.bc lli hello.bc
And this last line, lli hello.bc, where I get the error above.
In the first group of instructions, WHILE was executed. Something is definitely installed / built / something done. But I have no idea what is going on here.
So here are my big questions:
1) What is installed on my machine? I have to install both Clang and LLVM, right?
2) All my professor said: "We will use clang, and you need to get LLVM version 3.3 or later. Am I even on the right track? If not what should I do to get LLVM 3.3? The detailed guide I found on LLVM's website leads me to the problem described above.