Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build on Ubuntu 18.04 #2

Closed
JavadocMD opened this issue May 18, 2019 · 5 comments
Closed

Build on Ubuntu 18.04 #2

JavadocMD opened this issue May 18, 2019 · 5 comments

Comments

@JavadocMD
Copy link

Hello! New to Go, but super interested in your project. Can you help me troubleshoot the setup for Ubuntu 18.04? Thanks!

I've got the project checked out in ~/go/src, installed Go 1.12.5 from the official site, and through trial-and-error with go get ./..., installed the following packages via apt-get:

  • build-essential
  • xorg-dev
  • libgl1-mesa-dev
  • libgtk-3-dev

Now get and build both produce the following output, which I'm afraid is beyond my ability to interpret.

$ go get ./...
# github.com/go-gl/glfw/v3.2/glfw
In file included from ../github.com/go-gl/glfw/v3.2/glfw/c_glfw_linbsd.go:24:0:
../github.com/go-gl/glfw/v3.2/glfw/glfw/src/linux_joystick.c: In function ‘_glfwInitJoysticksLinux’:
../github.com/go-gl/glfw/v3.2/glfw/glfw/src/linux_joystick.c:224:42: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 9 [-Wformat-truncation=]
             snprintf(path, sizeof(path), "%s/%s", dirname, entry->d_name);
                                          ^~~~~~~
In file included from /usr/include/stdio.h:862:0,
                 from /usr/include/X11/Xcursor/Xcursor.h:26,
                 from ../github.com/go-gl/glfw/v3.2/glfw/glfw/src/x11_platform.h:39,
                 from ../github.com/go-gl/glfw/v3.2/glfw/glfw/src/internal.h:169,
                 from ../github.com/go-gl/glfw/v3.2/glfw/glfw/src/x11_init.c:28,
                 from ../github.com/go-gl/glfw/v3.2/glfw/c_glfw_linbsd.go:19:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:64:10: note: ‘__builtin___snprintf_chk’ output between 12 and 267 bytes into a destination of size 20
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@MauriceGit
Copy link
Owner

Good morning,

thats awesome :)

The packages all look good so far. I think I also install mesa-common-dev. But this is not the issue.

I found an existing ticket for this exact issue (and if I remember correctly, might have stumbled upon this one as well at some point): go-gl/glfw#213

Conclusion: It seems to be just a warning and note which can savely be ignored until this is fixed in the next release of glfw.

If you really don't like the warning, you can fix it manually (see the issue, last comment):

  • find your local file github.com/go-gl/glfw/v3.2/glfw/glfw/src/linux_joystick.c , open it
  • change char path[20]; to char path[512];
  • then go get -u github.com/go-gl/glfw/v3.2/glfw

Are all other packages loaded correctly?

And maybe just to be sure, it seems like (by mistake), I am still using OpenGL 4.3 functionality. Cou can check your supported version by running glxinfo | grep "OpenGL version"

Good luck and please report back, if it works

@JavadocMD
Copy link
Author

Ha, stumbled on a warning, oops. So I found the executable (in ~/go/bin). If I run it (via relative path) from the project directory, it fires up, gives me the image window and controls window, but the image window is black, even if I open a new image and mess around with controls. Seems like a graphics driver issue to me.

$ glxinfo | grep OpenGL
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 5500 (Broadwell GT2) 
OpenGL core profile version string: 4.5 (Core Profile) Mesa 18.2.8
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 18.2.8
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 18.2.8
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
OpenGL ES profile extensions:

It looks like the card should be okay as far as version support, but I'm confused by the difference in "core profile version" vs. "version string".

@MauriceGit
Copy link
Owner

OK, that looks good! OpenGL and drivers are all fine.

Did you run go build within the projects folder? Otherwise try copying the executable from ~/go/bin to inside the project folder and run again. It may have some issue with not finding the image "Images/apple.png". Any output on the console?

I think we're almost there :)

@JavadocMD
Copy link
Author

Copied the executable, same result. Just this in the console:

$ ./Voronoi_Image_Manipulation 
Points: 125

@MauriceGit
Copy link
Owner

OK that's fine.

I just compared your glxinfo to mine. You are right, the OpenGL version string is weird and probably the cause of the black window (lots of functionality of OpenGL 3.3).

I found this on Stackoverflow: https://stackoverflow.com/questions/20779242/core-profile-vs-version-string-only-getting-glsl-1-3-ogl-3-0-in-mesa-10-0-1
I do request a core profile though...

According to this (https://stackoverflow.com/questions/43288180/why-wont-mesa-let-me-use-opengl-4-5-or-anything-but-3-0) it should work.

Context creation is in glView.go at line 789. I'll have another look later, but I am not really sure where the issue might come from...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants