I am going to show how to install swift from development branch source code on ubuntu 16.04 LTS.
For doing so open your terminal and install the following dependencies running the following command:
sudo apt-get install git cmake ninja-build clang python uuid-dev libicu-dev icu-devtools libbsd-dev libedit-dev libxml2-dev libsqlite3-dev swig libpython-dev libncurses5-dev pkg-config libblocksruntime-dev libcurl4-openssl-dev
After installing the dependencies successfully installing the dependencies
we need to clone the source code inside a specific directory for locating other
swift sub-module directories.
So lets create a directory name swift-build. Run the commands on
now clone the git repository inside this repo
git clone https://github.com/apple/swift.git
wait few minutes for the cloning and after cloning is complete run the
following command to install sub-modules
this will take long as it will install/clone a lot of things.
After cloning all the sub modules we need to clone and bootstrap ninja
build system as its the new build tool for swift.
git clone https://github.com/ninja-build/ninja.git
git checkout release
This won't take much to bootstrap. And after bootstrapping move to
./utils/build-script -r -t
The last command will start building all swift related tools.