3dLAbs GLSL compiler

Hello,
I want to know if someone have successfully compiled this open compiler, because I’ve a lot of troubles. I’m with gentoo amd64 unstable. Also tested with archlinux on intel 32bit, and the results are very similar.

So everyone succeeded running the glsl compiler is welcome to share its experience, distribution, compilation steps.

Best Regards,
Teodor

I managed to compile it by removing all the custom stl allocators. I’ll see if I still have the code around…

Thanks for the quick reply :slight_smile:

Can you tell me, what is your distribution/compiler/flex/bison? And what version of the glsl compiler you have tested, I’m trying the latest one?
Because I have problems with flex. The output when parsing glslang.l file is wrong and when I comment the wrong line, and edit makefiles I’m able to reach the linking of StandAlone binary but the lib is not compiled correctly.
And don’t know what to do:(

I’ve managed to compile it for the Shader Designer. You can obtain the compiler and the project files (Visual Studio 2003 .NET) from the Shader Designer sources, but the compiler I’ve used is not the latest version.

Originally posted by Ffelagund:
I’ve managed to compile it for the Shader Designer. You can obtain the compiler and the project files (Visual Studio 2003 .NET) from the Shader Designer sources, but the compiler I’ve used is not the latest version.
I’ve just tried it, and again no success :frowning:
Can’t you tell the distro you are using and compiler and steps to compile it. Have you tweeked the code?

what kind of errors are you getting? what’s going wrong?

:confused:

Here is the output with the latest one (no modifications to the code applied)

 
obfuscated@localhost ~/projects/OpenGLCompilerSept202005/StandAlone $ make
g++ -c StandAlone.cpp
cd ./../glslang/MachineIndependent; make all
make[1]: Entering directory `/home/obfuscated/projects/OpenGLCompilerSept202005/glslang/MachineIndependent'
Generating Gen_glslang.cpp
dos2unix: converting file glslang.l to UNIX format ...
flex glslang.l
stdin:3890: /usr/bin/m4: Warning: Excess arguments to built-in `m4_ifdef' ignored
Generating Gen_glslang_tab.cpp
dos2unix: converting file glslang.y to UNIX format ...
bison -t -v -d glslang.y
mv glslang.tab.c Gen_glslang_tab.cpp
mv glslang.tab.h glslang_tab.h
g++ -c -I. -I.. -I../.. -I../Include -I../Public -I../OSDependent/Linux -I../../OGLCompilersDLL Gen_glslang.cpp -o Gen_glslang.o
glslang.l:70: error: redefinition of `TSourceLoc yylineno'
Gen_glslang.cpp:350: error: `int yylineno' previously defined here
make[1]: *** [Gen_glslang.o] Error 1
make[1]: Leaving directory `/home/obfuscated/projects/OpenGLCompilerSept202005/glslang/MachineIndependent'
make: *** [SHAREDOBJECT] Error 2

This is on gentoo amd64 bit profile, and I’m sure that without modifications to the Makefiles it won’t go :frowning: There are defined I386 so it tries to compile 32bit but don’t know how to find includes and libs.

I’ve found some info, but haven’t tried it: Gentoo arch specific guide

Now I’ll test it on 32bit archlinux, and will post the error if fail again.
edit: the error is the same on arch too.

edit2: the older compiler has problems with the too new gcc

 quartz@evil ~/tosh/sd/OpenGLCompilerJune252004/StandAlone $ make
g++    -c -o StandAlone.o StandAlone.cpp
./../glslang/Include/../Include/Common.h: In constructor 'TMap<K, D, CMP>::TMap(const pool_allocator<std::pair<_T1, _T2> >&)':
./../glslang/Include/../Include/Common.h:232: error: there are no arguments to 'key_compare' that depend on a template parameter, so a declaration of 'key_compare' must be available
./../glslang/Include/../Include/Common.h:232: error: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
make: *** [StandAlone.o] Error 1

Now I’m going to follow the gentoo guide to see what will happen.

Any other suggestions what to do?

edit3: back on gentoo.

After commenting line 350:

glslang.l:70: error: redefinition of `TSourceLoc yylineno'
Gen_glslang.cpp:350: error: `int yylineno' previously defined here

The error seems to be fixed. I’ve done some modifications in the Makefile files and here is the make output:

obfuscated@localhost ~/projects/OpenGLCompilerSept202005_m3/StandAlone $ make
g++ -m32 -L/emul/linux/x86/lib -L/emul/linux/usr/lib  -c StandAlone.cpp
cd ./../glslang/MachineIndependent; make all
make[1]: Entering directory `/home/obfuscated/projects/OpenGLCompilerSept202005_m3/glslang/MachineIndependent'
Generating Gen_glslang_tab.cpp
dos2unix: converting file glslang.y to UNIX format ...
bison -t -v -d glslang.y
mv glslang.tab.c Gen_glslang_tab.cpp
mv glslang.tab.h glslang_tab.h
g++ -m32 -c -I. -I.. -I../.. -I../Include -I../Public -I../OSDependent/Linux -I../../OGLCompilersDLL -I/usr/include/gentoo-multilib/x86/ Gen_glslang.cpp -o Gen_glslang.o
g++ -m32 -c -I. -I.. -I../.. -I../Include -I../Public -I../OSDependent/Linux -I../../OGLCompilersDLL -I/usr/include/gentoo-multilib/x86/ Gen_glslang_tab.cpp -o Gen_glslang_tab.o
g++ -m32  -I. -I.. -I../.. -I../Include -I../Public -I../OSDependent/Linux -I../../OGLCompilersDLL -I/usr/include/gentoo-multilib/x86/ -c Initialize.cpp
g++ -m32  -I. -I.. -I../.. -I../Include -I../Public -I../OSDependent/Linux -I../../OGLCompilersDLL -I/usr/include/gentoo-multilib/x86/ -c IntermTraverse.cpp
g++ -m32  -I. -I.. -I../.. -I../Include -I../Public -I../OSDependent/Linux -I../../OGLCompilersDLL -I/usr/include/gentoo-multilib/x86/ -c Intermediate.cpp
g++ -m32  -I. -I.. -I../.. -I../Include -I../Public -I../OSDependent/Linux -I../../OGLCompilersDLL -I/usr/include/gentoo-multilib/x86/ -c ParseHelper.cpp
g++ -m32  -I. -I.. -I../.. -I../Include -I../Public -I../OSDependent/Linux -I../../OGLCompilersDLL -I/usr/include/gentoo-multilib/x86/ -c PoolAlloc.cpp
g++ -m32  -I. -I.. -I../.. -I../Include -I../Public -I../OSDependent/Linux -I../../OGLCompilersDLL -I/usr/include/gentoo-multilib/x86/ -c QualifierAlive.cpp
g++ -m32  -I. -I.. -I../.. -I../Include -I../Public -I../OSDependent/Linux -I../../OGLCompilersDLL -I/usr/include/gentoo-multilib/x86/ -c RemoveTree.cpp
g++ -m32  -I. -I.. -I../.. -I../Include -I../Public -I../OSDependent/Linux -I../../OGLCompilersDLL -I/usr/include/gentoo-multilib/x86/ -c ShaderLang.cpp
g++ -m32  -I. -I.. -I../.. -I../Include -I../Public -I../OSDependent/Linux -I../../OGLCompilersDLL -I/usr/include/gentoo-multilib/x86/ -c intermOut.cpp
g++ -m32  -I. -I.. -I../.. -I../Include -I../Public -I../OSDependent/Linux -I../../OGLCompilersDLL -I/usr/include/gentoo-multilib/x86/ -c parseConst.cpp
g++ -m32  -I. -I.. -I../.. -I../Include -I../Public -I../OSDependent/Linux -I../../OGLCompilersDLL -I/usr/include/gentoo-multilib/x86/ -c SymbolTable.cpp
g++ -m32  -I. -I.. -I../.. -I../Include -I../Public -I../OSDependent/Linux -I../../OGLCompilersDLL -I/usr/include/gentoo-multilib/x86/ -c InfoSink.cpp
cd ./preprocessor; make 
make[2]: Entering directory `/home/obfuscated/projects/OpenGLCompilerSept202005_m3/glslang/MachineIndependent/preprocessor'
gcc -m32 -c atom.c
gcc -m32 -c cpp.c
gcc -m32 -c cppstruct.c
gcc -m32 -c memory.c
gcc -m32 -c scanner.c
gcc -m32 -c symbols.c
gcc -m32 -c tokens.c
ar rvu libPreprocessor.a atom.o cpp.o cppstruct.o memory.o scanner.o symbols.o tokens.o
ar: creating libPreprocessor.a
a - atom.o
a - cpp.o
a - cppstruct.o
a - memory.o
a - scanner.o
a - symbols.o
a - tokens.o
ranlib libPreprocessor.a
make[2]: Leaving directory `/home/obfuscated/projects/OpenGLCompilerSept202005_m3/glslang/MachineIndependent/preprocessor'
cd ./../GenericCodeGen; make 
make[2]: Entering directory `/home/obfuscated/projects/OpenGLCompilerSept202005_m3/glslang/GenericCodeGen'
g++ -m32 -c CodeGen.cpp
g++ -m32 -c Link.cpp
ar rvu libCodeGen.a CodeGen.o Link.o
ar: creating libCodeGen.a
a - CodeGen.o
a - Link.o
ranlib libCodeGen.a
make[2]: Leaving directory `/home/obfuscated/projects/OpenGLCompilerSept202005_m3/glslang/GenericCodeGen'
cd ./../OSDependent/Linux/; make 
make[2]: Entering directory `/home/obfuscated/projects/OpenGLCompilerSept202005_m3/glslang/OSDependent/Linux'
g++ -m32 -g -Wno-deprecated -D_ALT_NS=1  -Dlinux -D__i386__ -I. -I../.. -I../../Include -I../../../OGLCompilersDLL -I/usr/include/gentoo-multilib/x86/ -c ossource.cpp
ar rcs libOssource.a ossource.o 
make[2]: Leaving directory `/home/obfuscated/projects/OpenGLCompilerSept202005_m3/glslang/OSDependent/Linux'
cd ./../../OGLCompilersDLL/; make 
make[2]: Entering directory `/home/obfuscated/projects/OpenGLCompilerSept202005_m3/OGLCompilersDLL'
g++ -m32  -g -Wno-deprecated -D_ALT_NS=1  -Dlinux -D__i386__ -I. -I../glslang -I../glslang/Include -I../glslang/OSDependent/Linux -I../glslang/MachineIndependent -I/usr/include/gentoo-multilib/x86/ -c InitializeDll.cpp
ar rcs libInitializeDll.a InitializeDll.o 
make[2]: Leaving directory `/home/obfuscated/projects/OpenGLCompilerSept202005_m3/OGLCompilersDLL'
g++ -m32 -m elf_i386 -fPIC -shared -lc -L/usr/lib32 -L/lib32 -L/emul/linux/x86/lib -L/emul/linux/X86/usr/lib -o lib/libglslang.so Initialize.o IntermTraverse.o Intermediate.o ParseHelper.o PoolAlloc.o QualifierAlive.o RemoveTree.o ShaderLang.o intermOut.o parseConst.o SymbolTable.o InfoSink.o \
                ./preprocessor/libPreprocessor.a ./../GenericCodeGen/libCodeGen.a ./../OSDependent/Linux/libOssource.a \
                ./../../OGLCompilersDLL/libInitializeDll.a \
                Gen_glslang.o Gen_glslang_tab.o
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.6/../../../../x86_64-pc-linux-gnu/bin/ld: warning: creating a DT_TEXTREL in object.
make[1]: Leaving directory `/home/obfuscated/projects/OpenGLCompilerSept202005_m3/glslang/MachineIndependent'
g++ -m32 -L/emul/linux/x86/lib -L/emul/linux/usr/lib  -g -o StandAlone StandAlone.o -L/usr/lib32 -L/lib32 -L/emul/linux/x86/lib -L/emul/linux/X86/usr/lib -L ./../glslang/MachineIndependent/lib -lglslang -lpthread \
        -lm -lstdc++
./../glslang/MachineIndependent/lib/libglslang.so: undefined reference to `updateExtensionBehavior'
./../glslang/MachineIndependent/lib/libglslang.so: undefined reference to `PaParseStrings(char**, int*, int, TParseContext&)'
./../glslang/MachineIndependent/lib/libglslang.so: undefined reference to `IncLineNumber'
./../glslang/MachineIndependent/lib/libglslang.so: undefined reference to `StoreStr'
./../glslang/MachineIndependent/lib/libglslang.so: undefined reference to `PaParseComment(int&, TParseContext&)'
./../glslang/MachineIndependent/lib/libglslang.so: undefined reference to `CPPWarningToInfoLog'
./../glslang/MachineIndependent/lib/libglslang.so: undefined reference to `PaIdentOrType(std::basic_string&lt;char, std::char_traits&lt;char&gt;, pool_allocator&lt;char&gt; &gt;&, TParseContext&, TSymbol*&)'
./../glslang/MachineIndependent/lib/libglslang.so: undefined reference to `GetLineNumber'
./../glslang/MachineIndependent/lib/libglslang.so: undefined reference to `DecLineNumber'
./../glslang/MachineIndependent/lib/libglslang.so: undefined reference to `HandlePragma'
./../glslang/MachineIndependent/lib/libglslang.so: undefined reference to `yyerror(char*)'
./../glslang/MachineIndependent/lib/libglslang.so: undefined reference to `yy_input(char*, int)'
./../glslang/MachineIndependent/lib/libglslang.so: undefined reference to `SetStringNumber'
./../glslang/MachineIndependent/lib/libglslang.so: undefined reference to `setInitialState()'
./../glslang/MachineIndependent/lib/libglslang.so: undefined reference to `CPPShInfoLogMsg'
./../glslang/MachineIndependent/lib/libglslang.so: undefined reference to `GetStrfromTStr'
./../glslang/MachineIndependent/lib/libglslang.so: undefined reference to `ResetTString'
./../glslang/MachineIndependent/lib/libglslang.so: undefined reference to `CPPDebugLogMsg'
./../glslang/MachineIndependent/lib/libglslang.so: undefined reference to `CPPErrorToInfoLog'
./../glslang/MachineIndependent/lib/libglslang.so: undefined reference to `PaReservedWord()'
./../glslang/MachineIndependent/lib/libglslang.so: undefined reference to `GetStringNumber'
./../glslang/MachineIndependent/lib/libglslang.so: undefined reference to `SetLineNumber'
collect2: ld returned 1 exit status
make: *** [StandAlone] Error 1
obfuscated@localhost ~/projects/OpenGLCompilerSept202005_m3/StandAlone $ 

Sorryyyyyy for the mess up there :frowning:

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.