When trying to use LLVM, it is very clear that it isn't a "pure" Windows project. For instance, plain MinGW won't work. While I expected to have to install mingw32-make, I also did have to install MSYS, which I particularly hate.
After downloading the source code, there were a few problems I had to face:
1. Could not rename File exists
c:\MinGW\bin\ranlib.exe: unable to rename 'c:/Users/HP530/Downloads/llvm-2.7/llvm-2.7/llvm-2.7/Release/lib/libLLVMX86CodeGen.a'; reason: File exists
make[3]: *** [/c/Users/HP530/Downloads/llvm-2.7/llvm-2.7/llvm-2.7/Release/lib/libLLVMX86CodeGen.a] Error 1These ones were annoying. To solve them, I first had to go to the Release/lib folder and see if the indicated file existed. If so, I had to delete it and try again. If not, just running make again would make it work.
2. Figuring out the correct order to use when compiling a sample "hello world!" project. Here is the way I used:
g++ `llvm-config --cxxflags` -o hworld.o -c hworld.cpp
g++ `llvm-config --ldflags` -o hworld.exe hworld.o `llvm-config --libs` -limagehlp -lpsapiThe -lpsapi and -limagehlp wasn't obvious, even when looking at LLVM's documentation. I happened to find those mentioned in some mailing list when googling for the problem.
3. Threading
For this one, stackoverflow helped me. Lots of undefined references to __imp__pthreads functions. To solve it, I had to run ./configure with --disable-threads
Now that I've got this out of the way, I hope I'll finally be able to learn LLVM.
References:
http://stackoverflow.com/questions/2129263/how-to-build-llvm-using-gcc-4-on-windows
http://osdir.com/ml/compilers.llvm.devel/2005-09/msg00067.html
http://llvm.org/docs/CommandGuide/html/llvm-config.html
No comments:
Post a Comment