FAQ
Where's the 64 bit int? If i need to do something in Mercurial explicit
intructions would be appreciated as i wouldn't have time for the learning
curve right now.

C:\hg\go\src>hg branches
default 14937:f2755950769b
release-branch.go1 13681:d5666bad617d
release-branch.r60 9516:c1702f36df03
release-branch.r59 9023:d5785050f61d
release-branch.r58 8741:acaddf1cea75
release-branch.r57 8306:9d7967223815
C:\hg\go\src>hg branch
default


C:\hg\go\bin>.\go.exe version
go version devel +f2755950769b Wed Nov 21 14:40:50 2012 -0800


C:\hg\go\bin>.\go.exe run c:\code\go\array\test2.go
ptr[ 0 ] 0 0x12181540
ptr[ 1 ] 0 0x12181544
ptr[ 2 ] 0 0x12181548
ptr[ 3 ] 0 0x1218154c
ptr[ 4 ] 0 0x12181550
ptr[ 5 ] 0 0x12181554
ptr[ 6 ] 0 0x12181558
ptr[ 7 ] 0 0x1218155c
ptr[ 8 ] 0 0x12181560
ptr[ 9 ] 0 0x12181564
1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072
262144
524288 1048576 2097152 4194304 8388608 16777216 33554432 67108864
134217728 268
435456 536870912 1073741824



C:\hg\go\bin>cat c:\code\go\array\test2.go
package main
func main(){
arr := make([]int,10)
for i := 0 ; i<10 ; i++ { println("arr[",i,"]", arr[i],&arr[i]) }
for i:=1;i>0;i=i+i { print(i," ") }
}


--

Search Discussions

  • Rémy Oudompheng at Nov 23, 2012 at 7:31 am

    On 2012/11/23 Gorky Park <kilves76@gmail.com>:
    Where's the 64 bit int? If i need to do something in Mercurial explicit
    intructions would be appreciated as i wouldn't have time for the learning
    curve right now.

    C:\hg\go\src>hg branches
    default 14937:f2755950769b
    release-branch.go1 13681:d5666bad617d
    release-branch.r60 9516:c1702f36df03
    release-branch.r59 9023:d5785050f61d
    release-branch.r58 8741:acaddf1cea75
    release-branch.r57 8306:9d7967223815
    C:\hg\go\src>hg branch
    default


    C:\hg\go\bin>.\go.exe version
    go version devel +f2755950769b Wed Nov 21 14:40:50 2012 -0800


    C:\hg\go\bin>.\go.exe run c:\code\go\array\test2.go
    ptr[ 0 ] 0 0x12181540
    ptr[ 1 ] 0 0x12181544
    ptr[ 2 ] 0 0x12181548
    ptr[ 3 ] 0 0x1218154c
    ptr[ 4 ] 0 0x12181550
    ptr[ 5 ] 0 0x12181554
    ptr[ 6 ] 0 0x12181558
    ptr[ 7 ] 0 0x1218155c
    ptr[ 8 ] 0 0x12181560
    ptr[ 9 ] 0 0x12181564
    1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072
    262144
    524288 1048576 2097152 4194304 8388608 16777216 33554432 67108864 134217728
    268
    435456 536870912 1073741824



    C:\hg\go\bin>cat c:\code\go\array\test2.go
    package main
    func main(){
    arr := make([]int,10)
    for i := 0 ; i<10 ; i++ { println("arr[",i,"]", arr[i],&arr[i]) }
    for i:=1;i>0;i=i+i { print(i," ") }
    }
    Hello,

    You need to use a 64-bit architecture to have 64-bit ints. "go env"
    should say "GOARCH=amd64".

    Rémy.

    --
  • Gorky Park at Nov 23, 2012 at 7:48 am

    On Friday, November 23, 2012 2:31:23 PM UTC+7, Rémy Oudompheng wrote:
    You need to use a 64-bit architecture to have 64-bit ints. "go env"
    should say "GOARCH=amd64".
    It is set where? I look through /src *.bat but cannot find where it is
    actually set. (this is a fully 64 bit machine)

    --
  • Rémy Oudompheng at Nov 23, 2012 at 7:54 am

    On 2012/11/23 Gorky Park wrote:
    On Friday, November 23, 2012 2:31:23 PM UTC+7, Rémy Oudompheng wrote:

    You need to use a 64-bit architecture to have 64-bit ints. "go env"
    should say "GOARCH=amd64".

    It is set where? I look through /src *.bat but cannot find where it is
    actually set. (this is a fully 64 bit machine)
    It is set in src/cmd/dist/windows.c . You can set it manually if
    needed. You may need to set GOHOSTARCH.

    Rémy.

    --
  • Gorky Park at Nov 23, 2012 at 8:27 am
    Tried setting SET GOARCH=amd64 and SET GOHOSTARCH=amd64 in cmd and then
    compiling = errors, then separately adding
    gohostarch = "amd64"; after the switch in windows.c and received same
    errors:

    C:\hg\go\src>.\all.bat
    # Building C bootstrap tool.
    cmd/dist

    # Building compilers and Go bootstrap tool.
    lib9
    C:\hg\go\src\lib9\_exits.c:1:0: sorry, unimplemented: 64-bit mode not
    compiled in
    C:\hg\go\src\lib9\argv0.c:1:0: sorry, unimplemented: 64-bit mode not
    compiled in
    C:\hg\go\src\lib9\_p9dir.c:1:0: sorry, unimplemented: 64-bit mode not
    compiled in
    go tool dist: FAILED: gcc -Wall -Wno-sign-compare -Wno-missing-braces
    -Wno-parenthes
    es -Wno-unknown-pragmas -Wno-switch -Wno-comment -Werror -fno-common -ggdb
    -O2 -c -m
    64 -DPLAN9PORT -I C:\hg\go\include -I C:\hg\go\src\lib9 -o
    C:\Users\me\AppData\L
    ocal\Temp\goF915.tmp\_p9dir.o C:\hg\go\src\lib9\_p9dir.c
    C:\hg\go\src\lib9\atoi.c:1:0: sorry, unimplemented: 64-bit mode not
    compiled in
    go tool dist: FAILED: gcc -Wall -Wno-sign-compare -Wno-missing-braces
    -Wno-parenthes
    es -Wno-unknown-pragmas -Wno-switch -Wno-comment -Werror -fno-common -ggdb
    -O2 -c -m
    64 -DPLAN9PORT -I C:\hg\go\include -I C:\hg\go\src\lib9 -o
    C:\Users\me\AppData\L
    ocal\Temp\goF915.tmp\_exits.o C:\hg\go\src\lib9\_exits.c
    go tool dist: FAILED: gcc -Wall -Wno-sign-compare -Wno-missing-braces
    -Wno-parenthes
    es -Wno-unknown-pragmas -Wno-switch -Wno-comment -Werror -fno-common -ggdb
    -O2 -c -m
    64 -DPLAN9PORT -I C:\hg\go\include -I C:\hg\go\src\lib9 -o
    C:\Users\me\AppData\L
    ocal\Temp\goF915.tmp\argv0.o C:\hg\go\src\lib9\argv0.c
    go tool dist: FAILED: gcc -Wall -Wno-sign-compare -Wno-missing-braces
    -Wno-parenthes
    es -Wno-unknown-pragmas -Wno-switch -Wno-comment -Werror -fno-common -ggdb
    -O2 -c -m
    64 -DPLAN9PORT -I C:\hg\go\include -I C:\hg\go\src\lib9 -o
    C:\Users\me\AppData\L
    ocal\Temp\goF915.tmp\atoi.o C:\hg\go\src\lib9\atoi.c


    At this point i'd appreciate full instructions if possible. (i have MinGW
    installed should it be needed to something)

    --
  • David Symonds at Nov 23, 2012 at 8:28 am

    On Fri, Nov 23, 2012 at 7:27 PM, Gorky Park wrote:

    At this point i'd appreciate full instructions if possible. (i have MinGW
    installed should it be needed to something)
    Do you have the 64-bit version of MinGW? The 32-bit version won't work.

    --
  • Gorky Park at Nov 23, 2012 at 8:43 am

    On Friday, November 23, 2012 3:28:42 PM UTC+7, David Symonds wrote:

    Do you have the 64-bit version of MinGW? The 32-bit version won't work.
    Darn didn't notice it is a different project. Need to download and install
    and try again.

    --
  • Gorky Park at Nov 23, 2012 at 11:03 am

    On Friday, November 23, 2012 3:28:42 PM UTC+7, David Symonds wrote:

    Do you have the 64-bit version of MinGW? The 32-bit version won't work.
    Downloaded the 64 bit version package from

    http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/

    but this seems to be for building on Linux despite saying "MinGW-w64 - for
    32 and 64 bit Windows <http://sourceforge.net/projects/mingw-w64/> "?

    Or if there is a way to do this all on windows amd64 it's beyond my
    knowledge and skills. If someone knows how to do this some instructions
    would be badly needed (or rather a way to download nightly binaries for
    windows amd64).

    --
  • Minux at Nov 23, 2012 at 11:01 am

    On Fri, Nov 23, 2012 at 6:55 PM, Gorky Park wrote:
    On Friday, November 23, 2012 3:28:42 PM UTC+7, David Symonds wrote:


    Do you have the 64-bit version of MinGW? The 32-bit version won't work.
    Downloaded the 64 bit version package from


    http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/

    but this seems to be for building on Linux despite saying "MinGW-w64 -
    for 32 and 64 bit Windows <http://sourceforge.net/projects/mingw-w64/> "?

    Or if there is a way to do this all on windows amd64 it's beyond my
    knowledge and skills. If someone knows how to do this some instructions
    would be badly needed (or rather a way to download nightly binaries for
    windows amd64).
    if you can't get a working 64-bit mingw toolchain, just use your 32-bit one
    to compile a 64-bit
    Go toolchain (you just can't use cgo).

    cd path/to/go/src
    set GOHOSTARCH=386
    set GOARCH=amd64
    set CGO_ENABLED=0
    all.bat

    btw, it's easier to install tdm-gcc than 64-bit mingw gcc toolchain.

    --
  • Gorky Park at Nov 23, 2012 at 12:16 pm

    On Friday, November 23, 2012 6:01:33 PM UTC+7, minux wrote:
    cd path/to/go/src
    set GOHOSTARCH=386
    set GOARCH=amd64
    set CGO_ENABLED=0
    all.bat
    Did this, as result there's go*.exe in c:\hg\go\bin, and in subdir
    "windows_amd64".

    Running c:\hg\go\bin\go.exe run c:\code\go\array\new_test2.go there's error:

    C:\hg\go\bin>.\go.exe run c:\code\go\array\new_test2.go
    go build runtime: exec: "C:\\Go\\pkg\\tool\\windows_386\\6g.exe":
    GetFileAttributesE
    x C:\Go\pkg\tool\windows_386\6g.exe: The system cannot find the file
    specified.


    Copying these to c:\go\bin solves the error. But this is 32bit.

    Running c:\hg\go\bin\windows_amd64\go.exe run
    c:\code\go\array\new_test2.go or after copy c:\go\bin\go.exe run
    c:\code\go\array\new_test2.go produce error:

    C:\Go\bin>.\go.exe run c:\code\go\array\new_test2.go
    # runtime
    ..\src\pkg\runtime\extern.go:123: undefined: defaultGoroot
    ..\src\pkg\runtime\extern.go:132: undefined: theVersion
    ..\src\pkg\runtime\extern.go:137: undefined: theGoos
    ..\src\pkg\runtime\extern.go:137: cannot use theGoos as type string in
    const ini
    tializer
    ..\src\pkg\runtime\extern.go:141: undefined: theGoarch
    ..\src\pkg\runtime\extern.go:141: cannot use theGoarch as type string in
    const i
    nitializer



    Btw, some /net tests fail if user has firewall and prevent completing the
    build. Is there an option to skip tests or continue if fail present?

    --
  • Minux at Nov 23, 2012 at 12:48 pm

    On Fri, Nov 23, 2012 at 8:16 PM, Gorky Park wrote:
    On Friday, November 23, 2012 6:01:33 PM UTC+7, minux wrote:


    cd path/to/go/src
    set GOHOSTARCH=386
    set GOARCH=amd64
    set CGO_ENABLED=0
    all.bat
    Did this, as result there's go*.exe in c:\hg\go\bin, and in subdir
    "windows_amd64".

    Running c:\hg\go\bin\go.exe run c:\code\go\array\new_test2.go there's
    error:

    C:\hg\go\bin>.\go.exe run c:\code\go\array\new_test2.go
    go build runtime: exec: "C:\\Go\\pkg\\tool\\windows_386\\6g.exe":
    GetFileAttributesE
    x C:\Go\pkg\tool\windows_386\6g.exe: The system cannot find the file
    specified.

    seems you have GOROOT defined to C:\go, you need to unset that by
    executing:
    set GOROOT=
    and then you should be able to use the newly compiled 64-bit toolchain.
    Copying these to c:\go\bin solves the error. But this is 32bit.

    Running c:\hg\go\bin\windows_amd64\go.exe run
    c:\code\go\array\new_test2.go or after copy c:\go\bin\go.exe run
    c:\code\go\array\new_test2.go produce error:

    C:\Go\bin>.\go.exe run c:\code\go\array\new_test2.go
    # runtime
    ..\src\pkg\runtime\extern.go:123: undefined: defaultGoroot
    ..\src\pkg\runtime\extern.go:132: undefined: theVersion
    ..\src\pkg\runtime\extern.go:137: undefined: theGoos
    ..\src\pkg\runtime\extern.go:137: cannot use theGoos as type string in
    const ini
    tializer
    ..\src\pkg\runtime\extern.go:141: undefined: theGoarch
    ..\src\pkg\runtime\extern.go:141: cannot use theGoarch as type string in
    const i
    nitializer


    Btw, some /net tests fail if user has firewall and prevent completing the
    build. Is there an option to skip tests or continue if fail present?
    you can just compile the toolchain and all the packages with make.bat

    --
  • Shivakumar GN at Nov 23, 2012 at 11:06 am

    On Fri, Nov 23, 2012 at 4:25 PM, Gorky Park wrote:

    Downloaded the 64 bit version package from


    http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/

    but this seems to be for building on Linux despite saying "MinGW-w64 -
    for 32 and 64 bit Windows <http://sourceforge.net/projects/mingw-w64/> "?

    Or if there is a way to do this all on windows amd64 it's beyond my
    knowledge and skills. If someone knows how to do this some instructions
    would be badly needed (or rather a way to download nightly binaries for
    windows amd64).
    The 64bit mingw toolchain link:

    https://code.google.com/p/mingw-builds/downloads/detail?name=x86_64-mingw32-gcc-4.7.0-release-c%2Cc%2B%2B%2Cfortran-sjlj.zip

    I just downloaded and tried it.

    The gcc seems to be ok. The build output as well is 64bit go binaries.
    No special/manual steps was needed.

    --
  • Gorky Park at Nov 23, 2012 at 12:42 pm

    On Friday, November 23, 2012 6:06:41 PM UTC+7, Shivakumar GN wrote:
    The 64bit mingw toolchain link:

    https://code.google.com/p/mingw-builds/downloads/detail?name=x86_64-mingw32-gcc-4.7.0-release-c%2Cc%2B%2B%2Cfortran-sjlj.zip
    Extracted this to C:\MinGW64 , edited PATH to include C:\MinGW64\bin , set
    env variables to GOARCH=amd64 GOHOSTARCH=amd64 GOROOT=C:\Go\ compile went
    ok, but trying with either 32bit (c:\hg\go\bin) or 64bit executables
    (c:\hg\go\bin\windows_amd64) produces this:

    C:\Go\bin>.\go.exe run c:\code\go\array\new_test2.go
    # runtime
    ..\src\pkg\runtime\extern.go:123: undefined: defaultGoroot
    ..\src\pkg\runtime\extern.go:132: undefined: theVersion
    ..\src\pkg\runtime\extern.go:137: undefined: theGoos
    ..\src\pkg\runtime\extern.go:137: cannot use theGoos as type string in
    const initial
    izer
    ..\src\pkg\runtime\extern.go:141: undefined: theGoarch
    ..\src\pkg\runtime\extern.go:141: cannot use theGoarch as type string in
    const initi
    alizer


    Hmm?

    --
  • Minux at Nov 23, 2012 at 12:51 pm

    On Fri, Nov 23, 2012 at 8:42 PM, Gorky Park wrote:

    Extracted this to C:\MinGW64 , edited PATH to include C:\MinGW64\bin , set
    env variables to GOARCH=amd64 GOHOSTARCH=amd64 GOROOT=C:\Go\ compile went
    ok, but trying with either 32bit (c:\hg\go\bin) or 64bit executables
    (c:\hg\go\bin\windows_amd64) produces this:
    if you're using 64-bit mingw toolchain to compile a Go native Go toolchain,
    don't define any GO* environment
    variables as make.bat could deduce them all.
    C:\Go\bin>.\go.exe run c:\code\go\array\new_test2.go
    # runtime
    ..\src\pkg\runtime\extern.go:123: undefined: defaultGoroot
    ..\src\pkg\runtime\extern.go:132: undefined: theVersion
    ..\src\pkg\runtime\extern.go:137: undefined: theGoos
    ..\src\pkg\runtime\extern.go:137: cannot use theGoos as type string in
    const initial
    izer
    ..\src\pkg\runtime\extern.go:141: undefined: theGoarch
    ..\src\pkg\runtime\extern.go:141: cannot use theGoarch as type string in
    const initi
    alizer


    Hmm?
    I suggest you start fresh with a new command prompt window and verify that
    the output of
    set | findstr GO
    doesn't have any Go related environment variables before continuing.

    --
  • Gorky Park at Nov 23, 2012 at 2:27 pm

    On Friday, November 23, 2012 7:51:33 PM UTC+7, minux wrote:

    I suggest you start fresh with a new command prompt window and verify that
    the output of
    set | findstr GO
    doesn't have any Go related environment variables before continuing.
    Yes this did it! Thank you so much! Woohoo :)

    C:\hg\go\bin>.\go.exe run c:\code\go\array\new_test2.go
    arr[ 0 ] 0 0xc200001a00
    arr[ 1 ] 0 0xc200001a08
    arr[ 2 ] 0 0xc200001a10
    arr[ 3 ] 0 0xc200001a18
    arr[ 4 ] 0 0xc200001a20
    arr[ 5 ] 0 0xc200001a28
    arr[ 6 ] 0 0xc200001a30
    arr[ 7 ] 0 0xc200001a38
    arr[ 8 ] 0 0xc200001a40
    arr[ 9 ] 0 0xc200001a48
    1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072
    262144 524
    288 1048576 2097152 4194304 8388608 16777216 33554432 67108864 134217728
    268435456 5
    36870912 1073741824 2147483648 4294967296 8589934592 17179869184
    34359738368 6871947
    6736 137438953472 274877906944 549755813888 1099511627776 2199023255552
    439804651110
    4 8796093022208 17592186044416 35184372088832 70368744177664
    140737488355328 2814749
    76710656 562949953421312 1125899906842624 2251799813685248 4503599627370496
    90071992
    54740992 18014398509481984 36028797018963968 72057594037927936
    144115188075855872 28
    8230376151711744 576460752303423488 1152921504606846976 2305843009213693952
    46116860
    18427387904

    8 bytes per int is how i like it... :P

    --
  • Shivakumar GN at Nov 23, 2012 at 1:19 pm
    On Fri, Nov 23, 2012 at 6:12 PM, Gorky Park wrote:
    <snip>
    Extracted this to C:\MinGW64 , edited PATH to include C:\MinGW64\bin , set
    env variables to GOARCH=amd64 GOHOSTARCH=amd64 GOROOT=C:\Go\ compile went
    ok, but trying with either 32bit (c:\hg\go\bin) or 64bit executables
    (c:\hg\go\bin\windows_amd64) produces this:
    <snip>

    As mentioned previously, I did *not* do any special settings for 64-bit.
    Only GOROOT & GOPATH are set as is the case for any go environment.

    Unset rest of the environment variables and try a rebuild.

    What do you have in c:\hg\go\bin?
    Can you post your c:\code\go\array\new_test2.go for me to check in my env?

    Can you try the below command and post the output. It provides verbose
    output of the run that you already tried:
    go run -v -x c:\code\go\array\new_test2.go
    --
  • Minux at Nov 23, 2012 at 2:12 pm

    On Fri, Nov 23, 2012 at 9:19 PM, Shivakumar GN wrote:

    As mentioned previously, I did *not* do any special settings for 64-bit.
    Only GOROOT & GOPATH are set as is the case for any go environment.
    Note if you compile Go from source, you don't even need to set GOROOT.

    --
  • Gorky Park at Nov 23, 2012 at 2:13 pm

    On Friday, November 23, 2012 8:19:43 PM UTC+7, Shivakumar GN wrote:

    What do you have in c:\hg\go\bin?
    C:\hg\go\bin>dir
    Directory of C:\hg\go\bin
    11/23/2012 07:27 PM <DIR> .
    11/23/2012 07:27 PM <DIR> ..
    11/23/2012 07:27 PM 7,332,352 go.exe
    11/23/2012 07:27 PM 8,574,464 godoc.exe
    11/23/2012 07:27 PM 3,107,328 gofmt.exe
    11/23/2012 06:46 PM <DIR> windows_amd64


    Can you post your c:\code\go\array\new_test2.go for me to check in my env?
    The code's posted in the original first message of the thread. Just
    something very simple to check for memory use and 32bit size bounds.

    Can you try the below command and post the output. It provides verbose
    output of the run that you already tried:
    go run -v -x c:\code\go\array\new_test2.go
    C:\Go\bin>.\go.exe run -v -x c:\code\go\array\new_test2.go
    WORK=C:\Users\me\AppData\Local\Temp\go-build201096891
    runtime
    mkdir -p $WORK\runtime\_obj\
    cd C:\Go\src\pkg\runtime
    C:\Go\pkg\tool\windows_amd64\6g.exe -o $WORK\runtime\_obj\_go_.6 -p runtime
    -+ -D _/
    C_/Go/src/pkg/runtime -I $WORK .\compiler.go .\debug.go .\error.go
    .\extern.go .\mem
    .go .\softfloat64.go .\type.go
    # runtime
    ..\src\pkg\runtime\extern.go:123: undefined: defaultGoroot
    ..\src\pkg\runtime\extern.go:132: undefined: theVersion
    ..\src\pkg\runtime\extern.go:137: undefined: theGoos
    ..\src\pkg\runtime\extern.go:137: cannot use theGoos as type string in
    const initial
    izer
    ..\src\pkg\runtime\extern.go:141: undefined: theGoarch
    ..\src\pkg\runtime\extern.go:141: cannot use theGoarch as type string in
    const initi
    alizer


    It sure would be nice if there was an overnightly binary build to
    download... :P

    --
  • Minux at Nov 23, 2012 at 2:23 pm

    On Fri, Nov 23, 2012 at 10:13 PM, Gorky Park wrote:
    Can you try the below command and post the output. It provides verbose
    output of the run that you already tried:
    go run -v -x c:\code\go\array\new_test2.**go
    C:\Go\bin>.\go.exe run -v -x c:\code\go\array\new_test2.go
    WORK=C:\Users\me\AppData\Local\Temp\go-build201096891
    runtime
    mkdir -p $WORK\runtime\_obj\
    cd C:\Go\src\pkg\runtime
    C:\Go\pkg\tool\windows_amd64\6g.exe -o $WORK\runtime\_obj\_go_.6 -p
    runtime -+ -D _/
    C_/Go/src/pkg/runtime -I $WORK .\compiler.go .\debug.go .\error.go
    .\extern.go .\mem
    .go .\softfloat64.go .\type.go
    # runtime

    ..\src\pkg\runtime\extern.go:123: undefined: defaultGoroot
    ..\src\pkg\runtime\extern.go:132: undefined: theVersion
    ..\src\pkg\runtime\extern.go:137: undefined: theGoos
    ..\src\pkg\runtime\extern.go:137: cannot use theGoos as type string in
    const initial
    izer
    ..\src\pkg\runtime\extern.go:141: undefined: theGoarch
    ..\src\pkg\runtime\extern.go:141: cannot use theGoarch as type string in
    const initi
    alizer

    these errors mean that you didn't run make.bat under C:\Go\src, and some
    necessary files
    are not created.
    It sure would be nice if there was an overnightly binary build to
    download... :P
    Normally, those who use the development version of Go all are more or less
    working on Go,
    so it makes sense to compile by themselves as they might want to modify Go.
    Thus providing
    nightly build isn't necessary for majority of cutting edge users.
    Also, as the development version of Go is not as throughly tested as
    release versions, providing
    binary nightlies might give potential user some false sense of stability.

    --
  • Rémy Oudompheng at Nov 23, 2012 at 8:33 am
    You need a 64-bit MinGW for it to work. Alternatively you can probably
    set GOHOSTARCH=386 and GOARCH=amd64.

    I suppose someone else on the mailing-list will be able to give you
    full instructions.

    Rémy


    2012/11/23, Gorky Park <kilves76@gmail.com>:
    Tried setting SET GOARCH=amd64 and SET GOHOSTARCH=amd64 in cmd and then
    compiling = errors, then separately adding
    gohostarch = "amd64"; after the switch in windows.c and received same
    errors:

    C:\hg\go\src>.\all.bat
    # Building C bootstrap tool.
    cmd/dist

    # Building compilers and Go bootstrap tool.
    lib9
    C:\hg\go\src\lib9\_exits.c:1:0: sorry, unimplemented: 64-bit mode not
    compiled in
    C:\hg\go\src\lib9\argv0.c:1:0: sorry, unimplemented: 64-bit mode not
    compiled in
    C:\hg\go\src\lib9\_p9dir.c:1:0: sorry, unimplemented: 64-bit mode not
    compiled in
    go tool dist: FAILED: gcc -Wall -Wno-sign-compare -Wno-missing-braces
    -Wno-parenthes
    es -Wno-unknown-pragmas -Wno-switch -Wno-comment -Werror -fno-common -ggdb
    -O2 -c -m
    64 -DPLAN9PORT -I C:\hg\go\include -I C:\hg\go\src\lib9 -o
    C:\Users\me\AppData\L
    ocal\Temp\goF915.tmp\_p9dir.o C:\hg\go\src\lib9\_p9dir.c
    C:\hg\go\src\lib9\atoi.c:1:0: sorry, unimplemented: 64-bit mode not
    compiled in
    go tool dist: FAILED: gcc -Wall -Wno-sign-compare -Wno-missing-braces
    -Wno-parenthes
    es -Wno-unknown-pragmas -Wno-switch -Wno-comment -Werror -fno-common -ggdb
    -O2 -c -m
    64 -DPLAN9PORT -I C:\hg\go\include -I C:\hg\go\src\lib9 -o
    C:\Users\me\AppData\L
    ocal\Temp\goF915.tmp\_exits.o C:\hg\go\src\lib9\_exits.c
    go tool dist: FAILED: gcc -Wall -Wno-sign-compare -Wno-missing-braces
    -Wno-parenthes
    es -Wno-unknown-pragmas -Wno-switch -Wno-comment -Werror -fno-common -ggdb
    -O2 -c -m
    64 -DPLAN9PORT -I C:\hg\go\include -I C:\hg\go\src\lib9 -o
    C:\Users\me\AppData\L
    ocal\Temp\goF915.tmp\argv0.o C:\hg\go\src\lib9\argv0.c
    go tool dist: FAILED: gcc -Wall -Wno-sign-compare -Wno-missing-braces
    -Wno-parenthes
    es -Wno-unknown-pragmas -Wno-switch -Wno-comment -Werror -fno-common -ggdb
    -O2 -c -m
    64 -DPLAN9PORT -I C:\hg\go\include -I C:\hg\go\src\lib9 -o
    C:\Users\me\AppData\L
    ocal\Temp\goF915.tmp\atoi.o C:\hg\go\src\lib9\atoi.c


    At this point i'd appreciate full instructions if possible. (i have MinGW
    installed should it be needed to something)

    --

    --
  • Gorky Park at Nov 23, 2012 at 3:03 pm
    To thank everyone of their help, here's the "64bit int Go on Windows for
    Dummies"
    to make this process easier for other beginners:

    0) Install Mercurial (hg.exe, suggested destination: C:\hg ) from

    http://mercurial.selenic.com/downloads/

    1) Fetch the source for "default" branch

    C:\hg> hg clone -u default https://code.google.com/p/go

    OR if you already have the source for some other branch (probably "release")

    1) Change to branch "default"

    List branches
    C:\hg\go\src>hg branches
    default 14937:f2755950769b
    release-branch.go1 13681:d5666bad617d
    release-branch.r60 9516:c1702f36df03
    release-branch.r59 9023:d5785050f61d
    release-branch.r58 8741:acaddf1cea75
    release-branch.r57 8306:9d7967223815
    Show current branch
    C:\hg\go\src> hg branch
    default

    Change to default
    C:\hg\go\src> hg update -C default
    2 files updated, 0 files merged, 0 files removed, 0 files unresolved
    2) Download and install 64bit MinGW

    https://code.google.com/p/mingw-builds/downloads/detail?name=x86_64-mingw32-gcc-4.7.0-release-c%2Cc%2B%2B%2Cfortran-sjlj.zip

    Unpack to C:\MinGW64 or wherever you like

    Edit your system's PATH environment variable to include C:\MinGW64\bin

    Control panel>System>Advanced system options>Environment variables
    Click on PATH, add to end ";C:\MinGW64\bin" without the quotes,
    there must be a semicolon separating it from the previous value

    3) Unset GO* environment variables before compiling

    Find them
    set | findstr GO

    And unset all of them one by one, for example
    set GOARCH=

    4) Compile with

    C:\hg\go\src> all.bat

    If you get errors, try running

    C:\hg\go\src> make.bat

    (Blind leading the blind here, I thought running all.bat is enough, but
    needed to run make.bat separately because of errors)

    5) Your new binaries are in C:\hg\go\bin

    Test with this piece of code, each int should now take 8 bytes in memory
    and counter should not stop at 1 GB:

    package main
    func main() {
    arr := make([]int, 10)
    for i := 0; i < 10; i++ { println("arr[", i, "]", arr[i], &arr[i]) }
    for i := 1; i > 0; i = i + i { print(i, " ") }
    }

    --
  • Gorky Park at Nov 23, 2012 at 3:09 pm
    Of course i forgot something, you either have to point your GOROOT
    environment variable to C:\hg\go\ now, or copy all that to C:\Go\ if that's
    your current GOROOT.

    --
  • Minux at Nov 23, 2012 at 3:16 pm

    On Fri, Nov 23, 2012 at 11:09 PM, Gorky Park wrote:

    Of course i forgot something, you either have to point your GOROOT
    environment variable to C:\hg\go\ now, or copy all that to C:\Go\ if that's
    your current GOROOT.
    i you plan to use Go in the directory under which it's compiled, you don't
    need to set GOROOT.
    if you plan to move Go to another place after compilation, set GOROOT_FINAL
    to that path before
    make.bat or all.bat.

    only when you didn't set GOROOT_FINAL before building and you moved Go's
    directory afterwards,
    do you need to set GOROOT when using Go.

    all these GO* environment variables are document at
    tip.golang.org/doc/install/source and
    in make.bash (make.bat).

    --
  • Gorky Park at Nov 23, 2012 at 4:07 pm
    Had an interesting issue of Go still finding the old 32bit version from
    c:\go\bin , turns out the installer adds c:\go\bin to the SYSTEM PATH, and
    it will always be set in a user's shell unless one would unset the whole
    PATH variable.

    To edit or remove that, one needs to navigate to registry key

    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
    Manager\Environment]

    and edit the Path variable there.

    --
  • Shivakumar GN at Nov 23, 2012 at 3:21 pm
    Is there a reason for you not to use the windows installer (both 32/64 bit
    installers are released for V1.0.3)
    http://code.google.com/p/go/downloads/list

    If you are using for production environment, you must consider using the
    installer unless you have strong reasons not to.

    *Regarding the steps:*

    I suppose you realize some of the steps are unique to your case since
    starting point wasn't clean.
    Below command sets the sources to the tip (latest under development sources)
    "hg update -C default"
    People needing stable version must set the source version to latest release
    as below (right now it is V1.0.3)
    "hg update -C release"
    I use GOROOT for convenience. Not mandatory as pointed out by minux.

    --
  • Gorky Park at Nov 23, 2012 at 3:39 pm

    On Friday, November 23, 2012 10:22:02 PM UTC+7, Shivakumar GN wrote:
    Is there a reason for you not to use the windows installer (both 32/64 bit
    installers are released for V1.0.3)
    The fact that the 64bit installer thinks int=int32 ... that's just nasty.
    In RAM, TB is the GB of yesterday.

    Ok so perhaps i wouldn't Absolutely Need it, because i could
    new([1<<31]int64) and then perhaps write and read that as bytes (or
    whatever type's needed) with the help of unsafe.Pointer. But i don't know
    the proper unsafe.Pointer syntax to do that (could someone help please, my
    tests didn't produce correct results), and yet it's a total gimmick that
    shouldn't be needed.

    --

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedNov 23, '12 at 7:26a
activeNov 23, '12 at 4:07p
posts26
users5
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase