blob: 1ddb634219340d7f932687fe9f4c202fdfffce19 [file] [log] [blame] [view]
Andrew Gerrand5bc444d2014-12-10 11:35:11 +11001# Introduction
2
3This is a companion to http://golang.org/doc/install/source providing additional instructions for various operating systems.
4
5## Install C tools
6
7On OS X, a C compiler is bundled in the command line tools for
8[Xcode](http://developer.apple.com/Xcode/),
9and you don't need to install the whole Xcode to compile Go.
10If you have already installed Xcode 4.3+, you can install command
11line tools from the Components tab of the Downloads preferences panel.
12In more recent versions of Xcode, you can use ` xcode-select --install `
13command to install the command line tools without opening Xcode.
14To verify you have a working compiler, just invoke ` gcc `
15in a freshly created Terminal window, unless you see the
16` "gcc: command not found" ` error, you are ready to go.
17
18On Ubuntu/Debian, use ` sudo apt-get install gcc libc6-dev `.
19If you want to build 32-bit binaries on a 64-bit system you'll also need the ` libc6-dev-i386 ` package.
20
21On RedHat/Centos 6, use ` sudo yum install gcc glibc-devel `.
22If you want to build 32-bit binaries on a 64-bit system you'll need both
23` glibc-devel.i386 ` and ` glibc-devel.x86_64 ` packages.
24
25On Windows, install ` gcc ` with
peterGo92b0c502015-03-12 19:49:33 -040026[TDM-GCC](http://tdm-gcc.tdragon.net/).
Gianluca Casatib5427682015-07-21 22:24:21 +020027(Make sure you add its ` bin ` subdirectory to your ` PATH `.) Go does not support the Cygwin toolchain.
28
29## Easy build from source
30
31Use [dotsoftware](http://g14n.info/dotsoftware/) to build Go from source in few minutes, just copy and paste the following code in your terminal
32
33```
34# get latest .software
35cd
36git clone https://github.com/fibo/.software.git
37# source it in your profile and in current session
38[ -f ~/.bash_profile ] && grep 'source ~/.software/etc/profile' ~/.bash_profile || echo 'source /.software/etc/profile' >> ~/.bash_profile && source ~/.software/etc/profile
39# build Golang
40.software_install Golang
41# you are done!
42```