Programming Blog

Jeremy Morgan

Mostly Coherent Ramblings of a Silicon Forest Software Developer

Tutorial: How to Install the Google GO Compiler on Ubuntu Linux

By: Jeremy Morgan

This week google introduced “go”, their new programming language. I was curious so I started messing around with it. Here’s how you can try it out if you’d like to “give it a go”.

About Google Go

From the Go website:

No major systems language has emerged in over a decade, but over that time the computing landscape has changed tremendously. There are several trends:
  • Computers are enormously quicker but software development is not faster.
  • Dependency management is a big part of software development today but the “header files” of languages in the C tradition are antithetical to clean dependency analysis - and fast compilation.
  • There is a growing rebellion against cumbersome type systems like those of Java and C++, pushing people towards dynamically typed languages such as Python and JavaScript.
  • Some fundamental concepts such as garbage collection and parallel computation are not well supported by popular systems languages.
  • The emergence of multicore computers has generated worry and confusion.
We believe it’s worth trying again with a new language, a concurrent, garbage-collected language with fast compilation.

So I decided to install the GO compiler, so I could play around with it. I found it to be a little different than the instructions.

Step 1: edit your .bashrc and add these lines:

Lines to add to .bashrc
export GOROOT=$HOME/go
export GOARCH=386
export GOOS=linux
export GOBIN=$HOME/bin

The last two are not listed on the GO site, but I needed them to compile.

Step 2. Create a bin folder

mkdir ~/bin
chmod 755 ~/bin

This was also not included in the instructions, this is so quietgcc has a place to sit, and be run by the installer.

Step 3. Run the following commands:

sudo apt-get install python-setuptools python-dev
sudo apt-get install mercurial
hg clone -r release $GOROOT

This will pull down the latest copy of go. Next, you’ll need the libraries to build go:

sudo apt-get install bison gcc libc6-dev ed make

Step 4: Build and install

cd $GOROOT/src

If all goes well, you’ll see this screen:

I am using Ubuntu Linux, Karmic Koala with GCC 4.4.1

If you have any questions, feel free to contact me!