Andrew Gerrand | 5bc444d | 2014-12-10 11:35:11 +1100 | [diff] [blame] | 1 | # Introduction |
| 2 | |
| 3 | This is a companion to http://golang.org/doc/install/source providing additional instructions for various operating systems. |
| 4 | |
| 5 | ## Install C tools |
| 6 | |
| 7 | On OS X, a C compiler is bundled in the command line tools for |
| 8 | [Xcode](http://developer.apple.com/Xcode/), |
| 9 | and you don't need to install the whole Xcode to compile Go. |
| 10 | If you have already installed Xcode 4.3+, you can install command |
| 11 | line tools from the Components tab of the Downloads preferences panel. |
| 12 | In more recent versions of Xcode, you can use ` xcode-select --install ` |
| 13 | command to install the command line tools without opening Xcode. |
| 14 | To verify you have a working compiler, just invoke ` gcc ` |
| 15 | in a freshly created Terminal window, unless you see the |
| 16 | ` "gcc: command not found" ` error, you are ready to go. |
| 17 | |
| 18 | On Ubuntu/Debian, use ` sudo apt-get install gcc libc6-dev `. |
| 19 | If you want to build 32-bit binaries on a 64-bit system you'll also need the ` libc6-dev-i386 ` package. |
| 20 | |
| 21 | On RedHat/Centos 6, use ` sudo yum install gcc glibc-devel `. |
| 22 | If 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 | |
| 25 | On Windows, install ` gcc ` with |
peterGo | 92b0c50 | 2015-03-12 19:49:33 -0400 | [diff] [blame] | 26 | [TDM-GCC](http://tdm-gcc.tdragon.net/). |
Gianluca Casati | b542768 | 2015-07-21 22:24:21 +0200 | [diff] [blame] | 27 | (Make sure you add its ` bin ` subdirectory to your ` PATH `.) Go does not support the Cygwin toolchain. |