当前位置:首页 > 开发 > 编程语言 > go语言 > 正文

Ubuntu Go语言安装记录

发表于: 2011-12-20   作者:cn.popeye   来源:转载   浏览:
摘要: 参考地址:http://golang.org/doc/install.html   一些区别:   amd64   (a.k.a.   x86-64 );   6g,6l,6c,6a The most mature implementation. The compiler has an effective opt

参考地址:http://golang.org/doc/install.html

 

一些区别:

 

amd64   (a.k.a.   x86-64 );   6g,6l,6c,6a
The most mature implementation. The compiler has an effective optimizer (registerizer) and generates good code (although   gccgo   can do noticeably better sometimes).
386   (a.k.a.   x86   or   x86-32 );   8g,8l,8c,8a
Comparable to the   amd64   port.
arm   (a.k.a.   ARM );   5g,5l,5c,5a
Incomplete. It only supports Linux binaries, the optimizer is incomplete, and floating point uses the VFP unit. However, all tests pass. Work on the optimizer is continuing. Tested against a Nexus One.



 

 

安装必要依赖:
$ sudo apt-get install bison gawk gcc libc6-dev make python-setuptools python-dev build-essential

 

    安装Hg:

$sudo easy_install mercurial
 

    获取go源码:

$ hg clone -u release https://go.googlecode.com/hg/ go

 

   安装:

$ cd go/src
$ ./all.bash

 

    看到如下信息就是安装成功:

--- cd ../test
0 known bugs; 0 unexpected bugs

ALL TESTS PASSED

---
Installed Go for linux/amd64 in /home/zc/opt/go.
Installed commands in /home/zc/opt/go/bin.
The compiler is 6g.

 

    验证:

$ cat >hello.go <<EOF
package main

import "fmt"

func main() {
fmt.Printf("hello, world\n")
}
EOF
$ 6g hello.go
$ 6l hello.6
$ ./6.out
hello, world
$
go lang 更新:
$ cd go/src
$ hg pull
$ hg update release
$ ./all.bash

Ubuntu Go语言安装记录

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号