windows build steps

15 views
Skip to first unread message

Joe

unread,
Jan 23, 2010, 3:45:58 AM1/23/10
to golang-nuts
First, great job to all who're working on Go!

Thought I'd share the steps I used to build Go on windows xp.

Note that not all the packages build at the moment due to some missing
code but you can still play around with the compiler.

I used the latest code from the repository as of 1-22-10.

- install mingw http://www.mingw.org/
- install msys http://www.mingw.org/wiki/MSYS
- download Bison, Ed, gawk (includes awk), and their dependencies,
from: http://gnuwin32.sourceforge.net/packages.html I used the
zipped binaries and dependencies and installed them manually
- copy Bison, Ed, Gawk, and dependencies, to the mingw bin/share
folders, I put the DLLs in the bin folder as well
- set the following environment variables:
GOARCH = 386
GOBIN = c:/go/bin
GOOS = mingw
GOROOT = c:/go
- add c:/go/bin to the path environment
- download the Go soure code: > hg clone -r release https://go.googlecode.com/hg/
$GOROOT
- the build for go/src/cmd/cov/ and go/src/cmd/prof/ failed so I
removed prof and cov from the build in c:/go/src/cmd/make.bash I was
in a bit of a rush and didn't have time to figure out why but I didn't
care since they're not needed to compile files

The "package" build will fail at syscall with the following error
message:

make[2]: Entering directory `/c/go/src/pkg/syscall'
make[2]: *** No rule to make target `dir_mingw.go', needed by `_go_.
8'. Stop.
make[2]: Leaving directory `/c/go/src/pkg/syscall'

I originally commented out the syscall build (c:/go/src/pkg/Makefile)
to see how many more packages would build/fail, os also failed but it
didn't matter; I just wanted the runtime package for building basic
programs.

I built and ran the code below with the following commands:
> 8g test.go
> 8l -o test.exe test.g
> test.exe

package main
func main() {
x := 100
for {
x--
println( "x:", x);
if x < 1 {
break
}
}
}

And the output was as expected. Hope the info is useful.

Cheers,
Joe

Joe

unread,
Jan 23, 2010, 3:50:38 AM1/23/10
to golang-nuts
Sorry, I left out the build step.

Open a shell window via msys an cd to c:/go/src then run: > make -d
all


On Jan 23, 2:45 am, Joe <jdpoir...@gmail.com> wrote:
> First, great job to all who're working on Go!
>
> Thought I'd share the steps I used to build Go on windows xp.
>
> Note that not all the packages build at the moment due to some missing
> code but you can still play around with the compiler.
>
> I used the latest code from the repository as of 1-22-10.
>
> - install mingw    http://www.mingw.org/
> - install msys      http://www.mingw.org/wiki/MSYS
> - download Bison, Ed, gawk (includes awk), and their dependencies,
> from:http://gnuwin32.sourceforge.net/packages.html  I used the
> zipped binaries and dependencies and installed them manually
> - copy Bison, Ed, Gawk, and dependencies, to the mingw bin/share
> folders, I put the DLLs in the bin folder as well
> - set the following environment variables:
>   GOARCH = 386
>   GOBIN = c:/go/bin
>   GOOS  = mingw
>   GOROOT = c:/go
> - add  c:/go/bin   to the path environment

> - download the Go soure code: > hg clone -r releasehttps://go.googlecode.com/hg/

abiosoft

unread,
Jan 23, 2010, 9:39:38 AM1/23/10
to golang-nuts
I've tried building on windows but just couldn't correct all errors.

sorry if i may be going too far but I wouldn't mind if you can upload
it somewhere downloadable like Hector did on http://code.google.com/p/go-windows/.

Thanks.

Joe

unread,
Jan 23, 2010, 11:37:33 AM1/23/10
to golang-nuts
Okay, I can do that.

Also, I compiled and ran the code from a standard cmd shell.


On Jan 23, 8:39 am, abiosoft <abiol...@gmail.com> wrote:
> I've tried building on windows but just couldn't correct all errors.
>
> sorry if i may be going too far but I wouldn't mind if you can upload

> it somewhere downloadable like Hector did onhttp://code.google.com/p/go-windows/.

Joe

unread,
Jan 23, 2010, 12:10:28 PM1/23/10
to golang-nuts
Here's a link to download a zip file:
http://bitbucket.org/jpoirier/go_mingw/downloads/go_mingw-12210.zip

I compiled and ran the _Go_ code from the standard windows cmd shell.

Remember that there are packages missing. You can look in go/pkg/
mingw_386 to see what was built but I wouldn't use anything other than
the standard runtime, so _don't_ import anything, because the packages
listed may have dependencies on missing packages.

abiosoft

unread,
Jan 23, 2010, 2:14:50 PM1/23/10
to golang-nuts
Thanks a lot, i really appreciate this. I'm already downloading it
Reply all
Reply to author
Forward
0 new messages