From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Tue, 12 Apr 2016 14:26:40 -0700 Message-ID: From: Skip Tavakkolian To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=94eb2c0356ec2a35ac0530505131 Subject: Re: [9fans] Go on Plan 9? Topicbox-Message-UUID: 8ce31a20-ead9-11e9-9d60-3106f5b1d025 --94eb2c0356ec2a35ac0530505131 Content-Type: text/plain; charset=UTF-8 i've not built Go under plan9/arm. however, in practice (in a real Plan 9 environment) this is not an issue. the way authentication and namespaces (including file server) work in a Plan 9 envrionment, it is natural to use the fastest cpu available to (cross) compile apps. typical sessions are like this: supermic% ls -l d-rwxrwxr-x M 5543 fst fst 0 Jul 21 2015 .hg --rw-rw-r-- M 5543 fst fst 1071 Feb 10 2013 LICENSE --rw-rw-r-- M 5543 fst fst 206 Feb 10 2013 README --rw-rw-r-- M 5543 fst fst 12477 Feb 10 2013 admui.go --rw-rw-r-- M 5543 fst fst 6332 Feb 10 2013 client.go --rw-rw-r-- M 5543 fst fst 8623 Feb 10 2013 index.html --rw-rw-r-- M 5543 fst fst 450 Feb 10 2013 logger.go --rw-rw-r-- M 5543 fst fst 1307 Feb 10 2013 main.go --rw-rw-r-- M 5543 fst fst 4232 May 13 2013 server.go --rwxrwxr-x M 5543 fst fst 5977542 Apr 12 13:57 tcpmeter supermic% rm tcpmeter supermic% go build supermic% ls -ltr --rw-rw-r-- M 5543 fst fst 6332 Feb 10 2013 client.go --rw-rw-r-- M 5543 fst fst 450 Feb 10 2013 logger.go --rw-rw-r-- M 5543 fst fst 1071 Feb 10 2013 LICENSE --rw-rw-r-- M 5543 fst fst 1307 Feb 10 2013 main.go --rw-rw-r-- M 5543 fst fst 206 Feb 10 2013 README --rw-rw-r-- M 5543 fst fst 12477 Feb 10 2013 admui.go --rw-rw-r-- M 5543 fst fst 8623 Feb 10 2013 index.html --rw-rw-r-- M 5543 fst fst 4232 May 13 2013 server.go d-rwxrwxr-x M 5543 fst fst 0 Jul 21 2015 .hg --rwxrwxr-x M 5543 fst fst 5855281 Apr 12 14:00 tcpmeter supermic% file tcpmeter tcpmeter: 386 plan 9 executable supermic% ./tcpmeter -? flag provided but not defined: -? 2016/04/12 14:00:31 usage: ./tcpmeter (-c|-s) [-r [host:]port] [-h [host:]port] [-l logfile] supermic% GOARCH=arm go build supermic% file tcpmeter tcpmeter: arm plan 9 executable supermic% cpu -h rpi2 rpi2% ./tcpmeter -? flag provided but not defined: -? 2016/04/12 14:04:35 usage: ./tcpmeter (-c|-s) [-r [host:]port] [-h [host:]port] [-l logfile] rpi2% pwd /usr/fst/GoApps/src/tcpmeter rpi2% exit supermic% pwd /usr/fst/GoApps/src/tcpmeter supermic% Similar setup could be done under Linux/MacOSX with some work. I found this article very helpful: https://medium.com/@rakyll/go-1-5-cross-compilation-488092ba44ec#.635w6yhi5 btw, building Go on rpi/linux, took some time. i have not tried rpi3 yet (waiting for 64bit plan9 or linux). building Go on odroid-c2 (linux/arm64) "feels" as speedy as on atom or i3. On Tue, Apr 12, 2016 at 12:21 PM, Chris McGee wrote: > Hi Skip, > > Have you managed to get Go running on an RPi this way? > > Cheers, > Chris > > > > > If you run Plan 9 in a VM, emulator or a confined device (RPi), it will > be easier/faster to cross compile your app and copy it over. E.g. to > compile for 9Pi: > > $ GOOS=plan9 GOARCH=arm go build > > > > > > > --94eb2c0356ec2a35ac0530505131 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
i've not built Go under plan9/arm. =C2=A0however, in p= ractice (in a real Plan 9 environment) this is not an issue. the way authen= tication and namespaces (including file server) work in a Plan 9 envrionmen= t, it is natural to use the fastest cpu available to (cross) compile apps. = typical sessions are like this:

supermic% ls -= l
d-rwxrwxr-x M 5543 fst fst =C2=A0 =C2=A0 =C2=A0 0 Jul 21 =C2=A0= 2015 .hg
--rw-rw-r-- M 5543 fst fst =C2=A0 =C2=A01071 Feb 10 =C2= =A02013 LICENSE
--rw-rw-r-- M 5543 fst fst =C2=A0 =C2=A0 206 Feb = 10 =C2=A02013 README
--rw-rw-r-- M 5543 fst fst =C2=A0 12477 Feb = 10 =C2=A02013 admui.go
--rw-rw-r-- M 5543 fst fst =C2=A0 =C2=A063= 32 Feb 10 =C2=A02013 client.go
--rw-rw-r-- M 5543 fst fst =C2=A0 = =C2=A08623 Feb 10 =C2=A02013 index.html
--rw-rw-r-- M 5543 fst fs= t =C2=A0 =C2=A0 450 Feb 10 =C2=A02013 logger.go
--rw-rw-r-- M 554= 3 fst fst =C2=A0 =C2=A01307 Feb 10 =C2=A02013 main.go
--rw-rw-r--= M 5543 fst fst =C2=A0 =C2=A04232 May 13 =C2=A02013 server.go
--r= wxrwxr-x M 5543 fst fst 5977542 Apr 12 13:57 tcpmeter
supermic% r= m tcpmeter
supermic% go build
supermic% ls -ltr
--rw-rw-r-- M 5543 fst fst =C2=A0 =C2=A06332 Feb 10 =C2=A02013 client.go=
--rw-rw-r-- M 5543 fst fst =C2=A0 =C2=A0 450 Feb 10 =C2=A02013 l= ogger.go
--rw-rw-r-- M 5543 fst fst =C2=A0 =C2=A01071 Feb 10 =C2= =A02013 LICENSE
--rw-rw-r-- M 5543 fst fst =C2=A0 =C2=A01307 Feb = 10 =C2=A02013 main.go
--rw-rw-r-- M 5543 fst fst =C2=A0 =C2=A0 20= 6 Feb 10 =C2=A02013 README
--rw-rw-r-- M 5543 fst fst =C2=A0 1247= 7 Feb 10 =C2=A02013 admui.go
--rw-rw-r-- M 5543 fst fst =C2=A0 = =C2=A08623 Feb 10 =C2=A02013 index.html
--rw-rw-r-- M 5543 fst fs= t =C2=A0 =C2=A04232 May 13 =C2=A02013 server.go
d-rwxrwxr-x M 554= 3 fst fst =C2=A0 =C2=A0 =C2=A0 0 Jul 21 =C2=A02015 .hg
--rwxrwxr-= x M 5543 fst fst 5855281 Apr 12 14:00 tcpmeter
supermic% file tcp= meter
tcpmeter: 386 plan 9 executable
supermic% ./tcpme= ter -?
flag provided but not defined: -?
2016/04/12 14:= 00:31 usage: ./tcpmeter (-c|-s) [-r [host:]port] [-h [host:]port] [-l logfi= le]
supermic% GOARCH=3Darm go build
supermic% file tcpm= eter
tcpmeter: arm plan 9 executable
supermic% cpu -h r= pi2
rpi2% ./tcpmeter -?
flag provided but not defined: = -?
2016/04/12 14:04:35 usage: ./tcpmeter (-c|-s) [-r [host:]port]= [-h [host:]port] [-l logfile]
rpi2% pwd
/usr/fst/GoApp= s/src/tcpmeter
rpi2% exit
supermic% pwd
/usr/= fst/GoApps/src/tcpmeter
supermic%=C2=A0

Similar setup could be done under Linux/MacOSX with some work. I foun= d this article very helpful:
https://medium.com/@rak= yll/go-1-5-cross-compilation-488092ba44ec#.635w6yhi5

=
btw, building Go on rpi/linux, took some time. =C2=A0i have not tried = rpi3 yet (waiting for 64bit plan9 or linux). =C2=A0building Go on odroid-c2= (linux/arm64) "feels" as speedy as on atom or i3.


On Tue, Apr 12, 2016 at 12:21 PM, Chris McGee <= sirnewton_01@yah= oo.ca> wrote:
Hi Skip,

Have you managed to get Go running on an RPi this way?

Cheers,
Chris

>
> If you run Plan 9 in a VM, emulator or a confined device (RPi), it wil= l be easier/faster to cross compile your app and copy it over. E.g. to comp= ile for 9Pi:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$ GOOS=3Dplan9 GOARCH=3Darm go build<= br> >
>



--94eb2c0356ec2a35ac0530505131--