Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Installing Google's Go in Ubuntu 9.10

  1. #1
    Join Date
    Apr 2007
    Location
    Alabama
    Beans
    64

    Post Installing Google's Go in Ubuntu 9.10

    Google Go
    Go is Google's newest offering to the development community. According to the project's page, Go is an expressive, concurrent, garbage collected programming language that is simple, fast, safe, concurrent, fun and (best of all) open source. Touted as a cross between C/C++ and Python, Go seems to be generating a lot of buzz and hoards of seemingly early adopters despite having surfaced only earlier today (11.10.2009) . Of course this is somewhat expected - what has Google ever released that didn't generate it's share of hype/buzz/excitement associated with it?

    I bit. I am guessing since you are reading this, you did too.

    Getting Ready to Go


    The following instructions detail the steps that I used to setup Go on my x64 Ubuntu 9.10 (Karmic Koala) box.

    Standard disclaimer: Your mileage may vary. For me everything was pretty much straight forward when following the maintainer's provided setup instructions (http://golang.org/doc/install.html). The only hiccup I encountered during setup was an error with a test during make - Error 2 in [net.test]. A quick bounce over to #go-nuts resolved that - friendly go-nut knowledge base, iant, advised me that there was an issue with this test on some machines in the release version and that I should pull an update. Update pulled, problem fixed.

    For simplicity sake, I am working from the gnome-terminal. Access bash as you see fit. When you see '$', it denotes a command to enter in the CLI (Command Line Interface). When you see '>', it denotes and output line.

    FYI - My Machine Info:

    Code:
    $uname -a
    >2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:05:01 UTC 2009 x86_64 GNU/Linux
    Installing Required Tools

    Install GCC and Mercurial:

    Code:
     $sudo apt-get install mercurial bison gcc libc6-dev
    Setting Up Your Environment

    1) Make 'bin' directory for go - You may have one - this will create it for you if you don't:

    Code:
    $mkdir ~/bin
    2) Setting up environmental variables:

    Edit your Bash environment variables to include the Go required variables as well as making sure your bin folder is in the $PATH

    Code:
    $cp ~/.bashrc ~/.bashrc.bu
    $gedit ~/.bashrc
    Add following to your .bashrc - note: If using 386, set "GOARCH=386" (worked great on my EeePC):

    Code:
    #Google Go Vars
    export GOROOT=~/go
    export GOOS=linux
    export GOARCH=amd64
    PATH=${PATH}:$HOME/bin
    Reload .bashrc

    Code:
    $source .bashrc
    Note: You can close your terminal session and restart terminal instead. Up to you.

    Check out Go ( to your Go root using Mercurial)

    Code:
    $hg clone -r release https://go.googlecode.com/hg/ $GOROOT
    Note: I had to pull an update due to errors during make (details below with build instructions):

    Code:
    $cd $GOROOT
    $hg pull -u
    Building Go

    Code:
    $cd $GOROOT/src
    $./all.bash
    If successful, results should be:

    Code:
    >--- cd ../test
    >0 known bugs; 0 unexpected bugs
    Note on make errors: Before pulling an update on the repository, make resulted in:

    Code:
    >make[1]: Leaving directory `/home/eznet/go/src/pkg/net'
    >make: *** [net.test] Error 2
    Updating via the 'hg pull -u' command above resolved this issue and allowed make to complete as desired.

    GO play with Go

    Tutorial: http://golang.org/doc/go_tutorial.html

    http://blog.eznet.frih.net/?p=121

    Edit:"Installing Required Tools" was modified to skip Python's Setup Tools as mbudde pointed out that mercurial is available from the Ubuntu repositories.
    Last edited by eznet; November 11th, 2009 at 05:37 PM.
    Processor: Intel Q6600 (Quad Cores @ 2.5GHz)
    Video: Dual nVidia 8500GT (SLI - 1GB Total)
    Ram: 2GB
    Hard Drive: 300GB@7200rpm, 200GB@7200rpm, 150GB, 120GB, 60GB

  2. #2
    Join Date
    Aug 2008
    Beans
    2
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: Installing Google's Go in Ubuntu 9.10

    Thank you for writing this.

    Code:
    uname -a
    Linux aki 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:05:01 UTC 2009 x86_64 GNU/Linux
    I am getting some errors on the installation of mercurial:

    Code:
    sudo easy_install mercurial
    Code:
    Searching for mercurial
    Reading http://pypi.python.org/simple/mercurial/
    Reading http://www.selenic.com/mercurial
    Best match: mercurial 1.3.1
    Downloading http://mercurial.selenic.com/release/mercurial-1.3.1.tar.gz
    Processing mercurial-1.3.1.tar.gz
    Running mercurial-1.3.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-ZEeZtO/mercurial-1.3.1/egg-dist-tmp-hXLT1l
    mercurial/base85.c:12:20: error: Python.h: No such file or directory
    mercurial/base85.c: In function ‘b85prep’:
    mercurial/base85.c:23: warning: implicit declaration of function ‘memset’
    mercurial/base85.c:23: warning: incompatible implicit declaration of built-in function ‘memset’
    mercurial/base85.c: At top level:
    mercurial/base85.c:28: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    mercurial/base85.c:76: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    mercurial/base85.c:141: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘methods’
    mercurial/base85.c:150: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘initbase85’
    error: Setup script exited with error: command 'gcc' failed with exit status 1

  3. #3
    Join Date
    Nov 2009
    Beans
    3

    Re: Installing Google's Go in Ubuntu 9.10

    Same error on easy_install mercurial.

    When I install the mercurial in synaptic Go's .bash.all fails with:

    gcc -m32 -O2 -fPIC -o linux_386.o -c linux_386.c
    In file included from /usr/include/features.h:378,
    from /usr/include/pthread.h:23,
    from linux_386.c:5:
    /usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory
    gcc -m32 -O2 -fPIC -o 386.o -c 386.S
    make: *** [linux_386.o] Error 1
    (Brand new 9.10 on i386)

  4. #4
    Join Date
    Nov 2009
    Beans
    3

    Re: Installing Google's Go in Ubuntu 9.10

    Aha, first do a 'sudo apt-get install python-dev' then the mercurial install should work.

    Then do a 'sudo apt-get install libc6-dev-i386' and the Go build should succeed
    Last edited by BarryNorton; November 11th, 2009 at 12:24 PM.

  5. #5
    Join Date
    Mar 2007
    Beans
    Hidden!

    Re: Installing Google's Go in Ubuntu 9.10

    The section "Installing Required Tools" should just be
    Code:
    $sudo apt-get install mercurial bison gcc libc6-dev
    There is no reason to use easy_install to install mercurial.

  6. #6
    Join Date
    Apr 2007
    Location
    Alabama
    Beans
    64

    Re: Installing Google's Go in Ubuntu 9.10

    Quote Originally Posted by mbudde View Post
    The section "Installing Required Tools" should just be
    Code:
    $sudo apt-get install mercurial bison gcc libc6-dev
    There is no reason to use easy_install to install mercurial.
    It appears that you are correct. I think that I must have misspelled Mercurial when looking in Synaptic initially... Doh!

    Thanks.
    Processor: Intel Q6600 (Quad Cores @ 2.5GHz)
    Video: Dual nVidia 8500GT (SLI - 1GB Total)
    Ram: 2GB
    Hard Drive: 300GB@7200rpm, 200GB@7200rpm, 150GB, 120GB, 60GB

  7. #7

    Re: Installing Google's Go in Ubuntu 9.10

    See http://digitalpbk.com/2009/11/instal...o-linux-ubuntu to get a bash script to do it all in one step for 386.
    Last edited by digitalpbk; November 22nd, 2009 at 06:24 AM.

  8. #8
    Join Date
    Nov 2004
    Location
    Gauteng, South Africa
    Beans
    86

    Unhappy Re: Installing Google's Go in Ubuntu 9.10

    I'm having trouble installing go on my laptop:

    %%%% making libcgo %%%%

    gcc -m32 -O2 -fPIC -o linux_386.o -c linux_386.c
    as -o 386.o 386.s
    gcc -m32 -O2 -fPIC -o util.o -c util.c
    386.s: Assembler messages:
    386.s:21: Error: junk at end of line, first unrecognized character is `('
    386.s:22: Error: invalid character '(' in mnemonic
    make: *** [386.o] Error 1
    make: *** Waiting for unfinished jobs....


    The environment is identical to my desktop machine where it all went smoothly. Any ideas?

    Linux fld28976l 2.6.31-15-generic #50-Ubuntu SMP Tue Nov 10 14:54:29 UTC 2009 i686 GNU/Linux
    we are assimilated...

    Yusuf's Blog Supplemental

  9. #9
    Join Date
    Dec 2007
    Beans
    1,068

    Re: Installing Google's Go in Ubuntu 9.10

    I have followed what you have mentioned.
    I am getting the following errors.

    mike@ubuntu:~$ cd $GOROOT/src
    mike@ubuntu:~/hg/src$ ./all.bash
    installed quietgcc as /home/luc/bin/quietgcc but 'which quietgcc' fails
    double-check that /home/mike/bin is in your $PATH
    mike@ubuntu:~/hg/src$

  10. #10
    Join Date
    Dec 2007
    Beans
    1,068

    Re: Installing Google's Go in Ubuntu 9.10

    Quote Originally Posted by hoboy View Post
    I have followed what you have mentioned.
    I am getting the following errors.

    mike@ubuntu:~$ cd $GOROOT/src
    mike@ubuntu:~/hg/src$ ./all.bash
    installed quietgcc as /home/luc/bin/quietgcc but 'which quietgcc' fails
    double-check that /home/mike/bin is in your $PATH
    mike@ubuntu:~/hg/src$
    Problem solved.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •