Note: This guide was written on Ubuntu 16.04 using BASH terminal environment.
- To install ROS for Ubuntu 16.04 follow this (link).
- To install ROS for Ubuntu 14.04 follow this (link).
Before we move forward with this guide, move to the folder where you wish to install llvm and clang. Note: We will make 2 folders llvm
and build_llvm
in the said directory.
Once you are in the target directory please export the current directory as llvm_base_dir
For example, to export the directory /home/nishant/rsia_test
as base directory:
export llvm_base_dir='/home/nishant/rsia_test'
Now, we will download and build both llvm and clang:
- Move to the base directory.
cd $llvm_base_dir
- Download llvm into the base directory.
wget "http://llvm.org/releases/3.9.0/llvm-3.9.0.src.tar.xz"
- Extract the downloaded src for llvm.
tar -xvf llvm-3.9.0.src.tar.xz
- Rename llvm folder for easy access (You can choose to skip this step but from now onwards we will use the folder name llvm instead of llvm-3.9.0.src)
mv llvm-3.9.0.src llvm
- Download Clang into
$llvm_base_dir/llvm/tools/
directory.
cd $llvm_base_dir/llvm/tools
wget "http://llvm.org/releases/3.9.0/cfe-3.9.0.src.tar.xz"
- Extract clang in the same folder.
tar -xvf cfe-3.9.0.src.tar.xz
- Rename clang folder for easy access (You can choose to skip this step but from now onwards we will use the folder name clang instead of cfe-3.9.0.src)
mv cfe-3.9.0.src clang
- Move to the base directory
cd $llvm_base_dir
- Make a new directory
build_llvm
.
mkdir build_llvm
- Export LLVM and Clang cmake files in this directory using (Note: We set the build mode to release)
cd $llvm_base_dir/build_llvm
cmake -G "Unix Makefiles" ../llvm -DCMAKE_BUILD_TYPE=Release
- Compile llvm and clang
make
Wait for make to finish. Once finished LLVM and Clang are successfully built. Verify clang version by running
$llvm_base_dir/build_llvm/bin/clang --version
And it should return this to verify a successful install.
clang version 3.9.0 (tags/RELEASE_390/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: $llvm_base_dir/build_llvm/bin
Yaml-cpp can be installed in two ways:
you can verify if yaml-cpp is already installed using:
ldconfig -p | grep yaml
-
Through ubuntu repositories using
sudo apt-get install libyaml-cpp-dev
-
Can be built through sources and installed. Check yaml-cpp's github repository for that. (Click here)
pugi-xml can be installed in two ways:
You can test if pugi-xml is already installed using
ldconfig -p | grep pugi
-
Through ubuntu repositories using
sudo apt-get install libpugixml-dev
-
Can be built through sources and installed. Check pugi-xml's homepage. (Click here)
you can install graphviz using
sudo apt-get install graphviz