Monday, December 14, 2015

How to get started with SWIFT in Ubuntu

Here are some easy steps to get started with SWIFT in LINUX, particularly in Ubuntu. Steps are the same in other flavors too. `Although, you may want to watch for where you download source binaries from.

Head to swift.org for SWIFT libraries, download them
curl -O https://swift.org/builds/ubuntu1404/swift-2.2-SNAPSHOT-2015-12-01-b/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu14.04.tar.gz

Untar the file to local location
tar zxf swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu14.04.tar.gz

I prefer to keep all my additional/specific installations in a single directory /opt. I am sure there are other players who have a directory of their choice. I know a few create a ~/lib directory, few add it to /var or even in /bin. What ever be your choice of directory, please move it into there 

sudo mv ./swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu14.04 /opt

Open .bashrc file and add the following line of code. If you have moved to any other directory, make sure you make the right adjustments

vim .bashrc

Browse to the last line, add this one liner 

export PATH=$PATH:/op/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu14.04

Run .bashrc to reflect your additions
. ./.bashrc

You are all set. Check if swift works by doing the following

swift --version

No comments:

Post a Comment