go-gl / gl

Go bindings for OpenGL (generated via glow)
MIT License
1.07k stars 74 forks source link

GOARCH=arm support. #76

Closed minhajakhterkhan199 closed 5 years ago

minhajakhterkhan199 commented 7 years ago

I am getting below error, after downloading (go get -u github.com/go-gl/gl/v{3.2,3.3,4.1,4.2,4.3,4.4,4.5}-{core,compatibility}/gl)

# github.com/go-gl/gl/v3.2-core/gl
arm-linux-gnueabi-gcc: error: unrecognized command line option '-m64'
# github.com/go-gl/gl/v3.3-core/gl
arm-linux-gnueabi-gcc: error: unrecognized command line option '-m64'
# github.com/go-gl/gl/v3.2-compatibility/gl
arm-linux-gnueabi-gcc: error: unrecognized command line option '-m64'
# github.com/go-gl/gl/v4.1-core/gl
arm-linux-gnueabi-gcc: error: unrecognized command line option '-m64'
# github.com/go-gl/gl/v3.3-compatibility/gl
arm-linux-gnueabi-gcc: error: unrecognized command line option '-m64'
# github.com/go-gl/gl/v4.1-compatibility/gl
arm-linux-gnueabi-gcc: error: unrecognized command line option '-m64'
# github.com/go-gl/gl/v4.2-core/gl
arm-linux-gnueabi-gcc: error: unrecognized command line option '-m64'
# github.com/go-gl/gl/v4.3-core/gl
arm-linux-gnueabi-gcc: error: unrecognized command line option '-m64'
# github.com/go-gl/gl/v4.2-compatibility/gl
arm-linux-gnueabi-gcc: error: unrecognized command line option '-m64'
# github.com/go-gl/gl/v4.4-core/gl
arm-linux-gnueabi-gcc: error: unrecognized command line option '-m64'
# github.com/go-gl/gl/v4.3-compatibility/gl
arm-linux-gnueabi-gcc: error: unrecognized command line option '-m64'
# github.com/go-gl/gl/v4.5-core/gl
arm-linux-gnueabi-gcc: error: unrecognized command line option '-m64'
# github.com/go-gl/gl/v4.4-compatibility/gl
arm-linux-gnueabi-gcc: error: unrecognized command line option '-m64'
# github.com/go-gl/gl/v4.5-compatibility/gl
arm-linux-gnueabi-gcc: error: unrecognized command line option '-m64'

My development machine is Ubuntu 16.04 amd64 and target is arm. Please advise to solve this issue

dmitshur commented 7 years ago

My development machine is Ubuntu 16.04 amd64 and target is arm.

Target is arm? Can you elaborate?

I don't think targeting arm architecture is supported by go-gl/gl packages.

You may want to consider golang.org/x/mobile/gl and github.com/goxjs/gl packages, which do support iOS and Android (which are arm targets).

minhajakhterkhan199 commented 7 years ago

Development Machine is Ubuntu 16.04 amd64 and Target machine is Raspberry Pi 3, Please advise to solve the issue

export GOOS=linux export GOARCH=arm export CC=arm-linux-gnueabi-gcc export CGO_ENABLED=1

dmitshur commented 7 years ago

I know goxjs/gl does not support Raspberry Pi, see issue https://github.com/goxjs/gl/issues/13 that's tracking it. I don't know what the support status for x/mobile/gl is, but it seems more likely that it doesn't either. That support needs to be implemented by someone.

kivutar commented 5 years ago

How would you estimate the amount of work to add ARM support to go-gl/gl?

dmitshur commented 5 years ago

Most of the work would be figuring out why it doesn't work, and what needs to be done to make it work. It's hard to estimate it other by starting to do it and seeing how it goes.

I think most ARM-based platforms support only OpenGL ES, not OpenGL, so this is most likely only relevant to the github.com/go-gl/glfw/v3.1/gles2 package.

Also, in case it's helpful, see https://hackernoon.com/barriers-to-effective-software-effort-estimation-and-how-to-avoid-them-4abd39f09f26.

kivutar commented 5 years ago

@dmitshur I've been able to compile a go-gl/gl + go-gl/glfw app yesterday on the raspberry without issue.

I've not yet been able to get it display something yet, I still have to learn how to configure the context properly (RPi only support OpenGL up to 2.1).

But I can tell that the issue with CFLAGS -m64 only happens when cross compiling. So the amount of work may not be too important.

pwaller commented 5 years ago

Thanks for the update. Please keep letting us know, I'll keep this issue open until someone reports success at getting this working.

kivutar commented 5 years ago

It's working. This is a working example https://github.com/libretro/ludo/blob/master/.travis.yml#L37-L59

pwaller commented 5 years ago

@kivutar - great news. Is there any action to take over on this repository?

kivutar commented 5 years ago

@pwaller No, as you can see in my go.mod I'm using the unmodified go-gl code. I think that installing the right dependencies for the right architecture is what made the difference for the cross compilation.

Building directly on an ARM system was straightforward.