Running GO1.9 on IOT2040


#1

Is there anybody with experience running Go1.9.x on IOT2040 with resin-alpine-openjdk image?
I run into a warning that ‘This program can only be run on processors with MMX support’ and I think it has something to do with the Go1.9 binary.

Thanks, Bas


#2

Hi Bas,

Go does require MMX support, which the Intel Quark CPU doesn’t have. However I did some digging and it looks like Siemens has done some patching to get Go 1.6 and 1.8 to work on the IoT2040 devices, located here:

Which I found via this Siemens support thread:
https://support.industry.siemens.com/tf/WW/en/posts/golang-on-iot2000/170722?page=0&pageSize=10

Let us know how you get on!


#3

Hi @chrischabot,

Thanks for pointing me in the right direction, it has been a steep learning curve so far but thanks for all the help from you all at Resin!

What I did was download go version 1.8 and apply the patches provided by Siemens. That was the easy part…

Now I have to build go1.8 (with patches) on the resin buildservers, I use:

#install quark-GO (removed MMX)
RUN mkdir -p /go1.8
COPY ./quark-go1.8/ go1.8/
RUN	cd go1.8/src && \
	chmod 0755 all.bash && \
	./all.bash

Running this buildscript gives an error, because if you want to build Go you must have a working Go environment :face_with_raised_eyebrow:

[main]  ##### Building Go bootstrap tool.
[main]  cmd/dist
[main]  ERROR: Cannot find /root/go1.4/bin/go.
[main]  Set $GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4.

So looking into this error puts me into the direction of installing a working Go v.1.9.4 from alpine package manager. So I put this script in front of my #install quark-GO script

#Install go package
RUN apk update && \
	apk add go && \
	rm -rf /var/cache/apk/*

but now I’m wondering what will be the path to set ENV GOROOT_BOOTSTRAP to, where does the GO binary end up when installing a package with apk?

Thank you, Bas