Coder Social home page Coder Social logo

Fix Linux build errors about frequensea HOT 19 OPEN

fdb avatar fdb commented on June 3, 2024
Fix Linux build errors

from frequensea.

Comments (19)

fdb avatar fdb commented on June 3, 2024

Hi Yuval,

I’m kinda busy today, but I’ll try to get a Linux box so I can test this properly. PRs are also welcome :-)

Best,

F

On 13 Mar 2015 at 11:51:40, Yuval Adam ([email protected]) wrote:

[ 82%] Building C object CMakeFiles/frequensea.dir/src/nim.c.o
/home/yuval/dev/archlinux-packages/aur/frequensea-git/src/frequensea/src/nim.c: In function ‘nim_png_write’:
/home/yuval/dev/archlinux-packages/aur/frequensea-git/src/frequensea/src/nim.c:40:9: error: ‘channels’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
int channels;
^
cc1: all warnings being treated as errors
CMakeFiles/frequensea.dir/build.make:123: recipe for target 'CMakeFiles/frequensea.dir/src/nim.c.o' failed
make[2]: *** [CMakeFiles/frequensea.dir/src/nim.c.o] Error 1
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/frequensea.dir/all' failed
make[1]: *** [CMakeFiles/frequensea.dir/all] Error 2
Makefile:76: recipe for target 'all' failed
make: *** [all] Error 2
==> ERROR: A failure occurred in build().


Reply to this email directly or view it on GitHub.

from frequensea.

yuvadm avatar yuvadm commented on June 3, 2024

I see some other errors popping up as well. I'll try to send some patches your way :)

from frequensea.

altercation avatar altercation commented on June 3, 2024

Were there any patches for this issue? I'm hitting the same problem under Arch.

from frequensea.

fdb avatar fdb commented on June 3, 2024

@yuvadm has posted a PR which solves some of the first errors. I still have to find the time to get everything working.

I'll try to do this next week.

from frequensea.

fdb avatar fdb commented on June 3, 2024

Using the current master, Frequensea should now build (although not without warnings, most of them caused by including the GLFW source).

However, on my testing machine (Chromebook with Ubuntu 14.04) only the ../lua/empty.lua script works correctly. This has probably to do with support for OpenGL ES. Somebody with a OpenGL Desktop system, please test this.

from frequensea.

yuvadm avatar yuvadm commented on June 3, 2024

Getting:

[ 55%] Building C object CMakeFiles/frequensea.dir/src/nosc.c.o
/home/yuval/dev/archlinux-packages/aur/frequensea-git/src/frequensea/src/nosc.c: In function ‘_nosc_server_start’:
/home/yuval/dev/archlinux-packages/aur/frequensea-git/src/frequensea/src/nosc.c:259:17: warning: implicit declaration of function ‘nanosleep’ [-Wimplicit-function-declaration]
                 nanosleep((struct timespec[]){{0, 1 * MILLIS_TO_NANOS}}, NULL);
                 ^
/home/yuval/dev/archlinux-packages/aur/frequensea-git/src/frequensea/src/nosc.c:259:35: error: array type has incomplete element type
                 nanosleep((struct timespec[]){{0, 1 * MILLIS_TO_NANOS}}, NULL);
                                   ^
CMakeFiles/frequensea.dir/build.make:169: recipe for target 'CMakeFiles/frequensea.dir/src/nosc.c.o' failed
make[2]: *** [CMakeFiles/frequensea.dir/src/nosc.c.o] Error 1
CMakeFiles/Makefile2:61: recipe for target 'CMakeFiles/frequensea.dir/all' failed
make[1]: *** [CMakeFiles/frequensea.dir/all] Error 2
Makefile:116: recipe for target 'all' failed
make: *** [all] Error 2

from frequensea.

altercation avatar altercation commented on June 3, 2024

Confirming identical result as @yuvadm here (building on arch surface pro 3)

from frequensea.

yuvadm avatar yuvadm commented on June 3, 2024

Per http://stackoverflow.com/questions/14415465/why-do-i-get-in-my-timespec-array-the-error-array-type-has-incomplete-element-t this should fix the problem:

#if __STDC_VERSION__ >= 199901L
#define _XOPEN_SOURCE 600
#else
#define _XOPEN_SOURCE 500
#endif /* __STDC_VERSION__ */
#include <time.h>

However the error, and even the warning about implicit use of nanosleep, still exist. Is there some other time.h in use here?

from frequensea.

fdb avatar fdb commented on June 3, 2024

I found out that I already fixed the issue in nrf.c -- so I moved the implementation to the nut utility module. The code should build now.

Since the code also includes glfw as externals, it tries to build GLFW's examples and fails. However, the frequensea binary should still build.

from frequensea.

yuvadm avatar yuvadm commented on June 3, 2024

@fdb awesome! Is there any way to disable the GLFW examples? Locally it's fine, but I can't package something that fails a build. If it's not required I'd just like to disable it.

from frequensea.

yuvadm avatar yuvadm commented on June 3, 2024

I'm also getting this:

$ ./frequensea ../lua/empty.lua 
GLFW ERROR 65543: GLX: Failed to create context: GLXBadFBConfig

Happens on all the scripts. Here's my glxinfo https://gist.github.com/yuvadm/1a5c870ef0a406039281

from frequensea.

fdb avatar fdb commented on June 3, 2024

Hmm have you been able to run other OpenGL stuff? Do you have other apps that use GLFW?

Maybe I should switch back to the GLFW packaged release. I believe Arch has a recent GLFW 3 package, no?

from frequensea.

yuvadm avatar yuvadm commented on June 3, 2024

@fdb yes, there's no reason to bundle GLFW, any proper distribution should have it packaged separately. If you do decide to keep it, at least provide a flag for package maintainers to disable it.

As for other OpenGL stuff, I'll test some more and see what I come up with.

from frequensea.

fdb avatar fdb commented on June 3, 2024

@yuvadm you're right, of course. I did this because Ubuntu 14.04 doesn't have GLFW3 in its repository, only GLFW2.

from frequensea.

fdb avatar fdb commented on June 3, 2024

I removed GLFW3 from source and uses the one that should be pre-installed. I had to use pkg-config to include all relevant X11 libraries.

from frequensea.

fdb avatar fdb commented on June 3, 2024

As for the GLXBadFBConfig, it's because you're using OpenGL 2.1 (Mesa) drivers. We require at least OpenGL 3.2 (See nwm.c).

Depending on your video card, proprietary drivers might include a more recent version of OpenGL.

from frequensea.

yuvadm avatar yuvadm commented on June 3, 2024

@fdb build seems to finish successfully, thanks for the updates! I'll go ahead and test on a machine with better OpenGL support.

I think we can close this issue now that all build errors are resolved.

from frequensea.

altercation avatar altercation commented on June 3, 2024

Package builds under arch but I get an immediate segfault when running frequensea on any of the test lua files. I'll investigate further as well. OpenGL supported fine on this machine so there's something else happening. Any tips on diagnosing or information I can provide?

Here's relevant info from glxinfo dump:

% glxinfo | grep OpenGL
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Haswell Mobile 
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.5.2
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 10.5.2
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 10.5.2
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
OpenGL ES profile extensions:

from frequensea.

fdb avatar fdb commented on June 3, 2024

Try running using gdb:

gdb --args ./frequensea ../lua/static.lua
> run
> backtrace full

Thanks for helping me debug this issue!

from frequensea.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.