This guide is many years old is most likely outdated. I'll keep it here for reference; use at your own risk.
Tested on Mac OSX 10.6.7 with LLVM and CLANG version 2.9 Eclipse Helios Service Release 1 (Build 20100917-0705)
Enter the following commands in a shell:
svn co http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_29/final llvm
cd llvm/tools
svn co http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_29/final/ clang
./configure --enable-optimized # Removes debugging flags. Makes compiling much faster
gmake -j2 # (64bit, 2 jobs at a time)
sudo gmake install # This puts llvm and clang into /usr/local
- Install CDT: http://www.eclipse.org/cdt/downloads.php
- Install the LLVM toolchain for Eclipse CDT from http://marketplace.eclipse.org/node/28778
- Go into Eclipse preferences > C/C++ > Build > Environment and click "Select".
- Click on the box next to the PATH variable and "OK".
- The variable will appear in the list. Click on "Edit" and enter the path to the clang installation into the "Value"-Field (i.e. /usr/local/bin)
- Go to Preferences > LLVM and enter "usr/local/" in LLVM installation folder.
Try to build a sample C++ project or create a new project under File > New > C++ Project. Good luck :)
Adjust the CDT indexer settings for faster code completion: Preferences > C/C++ > Indexer
Thanks for sharing all the steps. I have done it so far but how to tell the eclipse to use LLVM as a compiler.