Russ Cox | 270a22d | 2023-12-05 11:15:03 -0500 | [diff] [blame] | 1 | --- |
| 2 | title: InstallFromSource |
| 3 | --- |
| 4 | |
| 5 | ## Introduction |
Andrew Gerrand | 5bc444d | 2014-12-10 11:35:11 +1100 | [diff] [blame] | 6 | |
Sean Liao | 3c9c9e1 | 2022-01-22 17:27:16 +0100 | [diff] [blame] | 7 | This is a companion to https://go.dev/doc/install/source providing additional instructions for various operating systems. |
Andrew Gerrand | 5bc444d | 2014-12-10 11:35:11 +1100 | [diff] [blame] | 8 | |
| 9 | ## Install C tools |
| 10 | |
| 11 | On OS X, a C compiler is bundled in the command line tools for |
| 12 | [Xcode](http://developer.apple.com/Xcode/), |
| 13 | and you don't need to install the whole Xcode to compile Go. |
| 14 | If you have already installed Xcode 4.3+, you can install command |
| 15 | line tools from the Components tab of the Downloads preferences panel. |
| 16 | In more recent versions of Xcode, you can use ` xcode-select --install ` |
| 17 | command to install the command line tools without opening Xcode. |
| 18 | To verify you have a working compiler, just invoke ` gcc ` |
| 19 | in a freshly created Terminal window, unless you see the |
| 20 | ` "gcc: command not found" ` error, you are ready to go. |
| 21 | |
| 22 | On Ubuntu/Debian, use ` sudo apt-get install gcc libc6-dev `. |
| 23 | If you want to build 32-bit binaries on a 64-bit system you'll also need the ` libc6-dev-i386 ` package. |
| 24 | |
| 25 | On RedHat/Centos 6, use ` sudo yum install gcc glibc-devel `. |
| 26 | If you want to build 32-bit binaries on a 64-bit system you'll need both |
| 27 | ` glibc-devel.i386 ` and ` glibc-devel.x86_64 ` packages. |
| 28 | |
| 29 | On Windows, install ` gcc ` with |
Ian Lance Taylor | c9bf037 | 2023-03-27 10:45:21 -0700 | [diff] [blame] | 30 | [TDM-GCC](http://tdm-gcc.tdragon.net/). or try [TDM-GCC Sourceforge link](https://sourceforge.net/projects/tdm-gcc/). |
Gianluca Casati | b542768 | 2015-07-21 22:24:21 +0200 | [diff] [blame] | 31 | (Make sure you add its ` bin ` subdirectory to your ` PATH `.) Go does not support the Cygwin toolchain. |
Russ Cox | 270a22d | 2023-12-05 11:15:03 -0500 | [diff] [blame] | 32 | |