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

Arch Linux shaderc does not compile #304

Closed
zet4 opened this issue Mar 21, 2015 · 16 comments
Closed

Arch Linux shaderc does not compile #304

zet4 opened this issue Mar 21, 2015 · 16 comments

Comments

@zet4
Copy link

zet4 commented Mar 21, 2015

Hi, currently working from Arch Linux x64, and decided to try BGFX again for an idea.
And here I endup being.
I tracked down this issue to be mesa glsl implementation or something like this.
I am running mesa-10.5.1-2, my libgl is nvidia-340xx-libgl.76-2 (I am not feeling like risking breaking my stuff by replacing it to mesa-liblg)

[zeta:....build/projects/gmake-linux]$ make shaderc                                  (master✱) 
==== Building shaderc (debug32) ====
Linking shaderc
../../linux32_gcc/obj/x32/Debug/shaderc/3rdparty/glsl-optimizer/src/glsl/glcpp/pp.o: In function `glcpp_preprocess':
/home/zeta/projects/hexon/bgfx/.build/projects/gmake-linux/../../../3rdparty/glsl-optimizer/src/glsl/glcpp/pp.c:227: undefined reference to `glcpp_parser_parse'
../../linux32_gcc/obj/x32/Debug/shaderc/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.o: In function `yyparse':
/home/zeta/projects/hexon/bgfx/.build/projects/gmake-linux/y.tab.c:1705: undefined reference to `yylex'
collect2: error: ld returned 1 exit status
shaderc.make:912: recipe for target '../../linux32_gcc/bin/shadercDebug' failed
make[1]: *** [../../linux32_gcc/bin/shadercDebug] Error 1
Makefile:136: recipe for target 'shaderc' failed
make: *** [shaderc] Error 2

What would be the advised solution?

@neni
Copy link

neni commented Mar 21, 2015

All compile fine here with mesa on Archlinux x64 (intel gpu).
Perhaps you could try build for 64 bits target (make linux-debug64) or install lib32-nvidia-libgl.

@bkaradzic
Copy link
Owner

Try:

make shaderc config=release64

@zet4
Copy link
Author

zet4 commented Mar 22, 2015

I've tried both now, even installed mesa-libgl and tried again, had to reinstall nvidia-340xx-libgl thou because steam for some weird reason stopped working.

@bkaradzic
Copy link
Owner

You should not need anything like that to build glsl-optimizer. Make sure you don't have any modified files in bgfx repo.

@zet4
Copy link
Author

zet4 commented Mar 22, 2015

I don't, its a clean folder with fresh newest bgfx and ../bx, I guess if I can't get bgfx to work again I will end up turning the idea into a web app and use webgl.

@bkaradzic
Copy link
Owner

Can you try building just stand alone glsl-optimizer on your machine? https://github.com/aras-p/glsl-optimizer

@zet4
Copy link
Author

zet4 commented Mar 23, 2015

Hi, I just tried compiling glsl-optimizer, and got this kind of issue with it aras-p/glsl-optimizer#92

@bkaradzic
Copy link
Owner

Did you figure out what's wrong with building on Arch?

@zet4
Copy link
Author

zet4 commented Apr 10, 2015

Alas, I did not.

@bkaradzic
Copy link
Owner

Do you see 3rdparty/glsl-optimizer/src/glsl/glcpp/pp.c compiling?

@zet4
Copy link
Author

zet4 commented Apr 11, 2015

$ git pull
$ make
$ cd .build/projects/gmake-linux/
$ make clean && make >> buildlog
$ cat buildlog | grep pp.c

Seem to return pp.c so I'd presume it did compile.
But it still failed on shaderc target.

@bkaradzic
Copy link
Owner

I can't reproduce it on Linux (Mint), OSX or Windows. Something about Arch or your setup is messed up. You'll have to figure it out, and let me know what causing it.

@zet4
Copy link
Author

zet4 commented Apr 13, 2015

Okay this is very weird, I tried to compile on my work laptop and it went perfectly even thou it has optimus graphics, at any rate, it seems like the issue is with my main workstation...

Thanks for the help, I will go look into how the heck can it be fixed. 👍

@zet4 zet4 closed this as completed Apr 13, 2015
@zao
Copy link
Contributor

zao commented Apr 13, 2015

I set up a fresh Arch machine and reproduced the output mentioned in the original post, as well as a warning about use of implicit declaration of 'yylex' in the generated source file. The same problem occurs on my reasonably stock Ubuntu Trusty (14.04) server.

Search results around this seems a bit vague and mostly talks about differences between Bison's YACC mode and Berkeley's YACC, not helped by my complete ignorance around yacc and lexx interactions. Bison versions I have are 3.0.2 (on Ubuntu) and 3.0.4 (on Arch).

Is there perhaps something in the build that's regenerated on some of these configurations, but not on the ones that appear to work?

@bkaradzic
Copy link
Owner

Try calling this script to generate those files:
https://github.com/bkaradzic/bgfx/blob/master/3rdparty/glsl-optimizer/generateParsers.sh

@zao
Copy link
Contributor

zao commented Apr 13, 2015

It compiles and links successfully after running the script, on both Arch and Ubuntu.

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

4 participants