你如何建立转到第八代和6G围棋编译器 [英] How do you build the 8g and 6g Go compilers for Go
问题描述
我在写这将广泛地部署有所之间在x86和x86-64架构的Windows,Mac和Linux系统的软件。每当我设置了编译器去我的Mac和Linux系统上我只得到6克建造。在Windows中我只是使用pre-建实验的二进制文件,它使用8克。
I'm writing software that will be somewhat widely deployed amongst Windows, Mac, and Linux systems on x86 and x86-64 architectures. Whenever I set up the go compiler on my Mac and Linux systems I only ever get 6g built. On Windows I just use the pre-built experimental binaries, which uses 8g.
当我得到周围设置构建服务器,我想我还需要建立8克这样我就可以产生32位的构建也是如此。我如何设置8G,尤其是在Mac上(因为他们可以是x86或x64取决于他们的年龄有多大)?
When I get around to setting up build servers, I assume I need to also build 8g so I can produce 32 bit builds as well. How do I set up 8g, in particular on a Mac (since they can be x86 or x64 depending on how old they are)?
推荐答案
作为另一个海报说,使用 GOARCH
。他没有说的是,你不需要多个目录。
As another poster said, use GOARCH
. What he didn't say is that you don't need multiple directories.
运行 all.bash
两次,相同的 GOROOT
:
GOARCH=amd64 ./all.bash
GOARCH=386 ./all.bash
当你用 gomake
的东西建立 GOARCH
如果默认不适合你。
When you build something with gomake
set up GOARCH
if the default doesn't suit you
GOARCH=386 gomake
不幸的是 goinstall
不兑现 GOARCH
呢。
注意,GC的编译器总是交叉编译。一旦你有你需要的架构,设置编译器 GOOS
和建立 $ GOROOT / src目录/ PKG
包,那么你应该能够建立你的软件定位任何操作系统或体系结构。
Notice that gc compilers are always cross compiling. Once you have the compilers for the architecture you need, set GOOS
and build the packages in $GOROOT/src/pkg
, then you should be able to build your software targeting any operating system or architecture.
GOARCH=386 GOOS=windows gomake
这篇关于你如何建立转到第八代和6G围棋编译器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!