Closed MagaTailor closed 9 years ago
Could you please post the first few lines for the cmake output - and please run make with make VERBOSE=1
about the GLenum error: see src/modules/gfx/CMakeLists.txt - this is currently included if the platform is not android - because android is basically what you wanna compile it for, too (arm + gles).
That means we have several options - the best would maybe be to provide a dedicated toolchain file for cmake which exports a proper system name so I can identify it later on. Another option would also be to just skip the GL1Frontend code compilation if SDL_VIDEO_OPENGL is not 1
I'm going to provide the requested info shortly. For now I'd like to commend the idea of disabling the GL backend completely - even though this system has a software Mesa implementation, the only hardware accelerated option is GLES 1/2 coming from the Mali chip.
cmake says:
-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is GNU 4.9.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- C++ Compiler: GCC
-- Found TexturePacker: TEXTUREPACKER_BIN-NOTFOUND
-- Looking for __atomic_fetch_add_4
-- Looking for __atomic_fetch_add_4 - not found
-- Looking for __atomic_fetch_add_4 in atomic
-- Looking for __atomic_fetch_add_4 in atomic - found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- C++ Compiler: GCC
make -j4 VERBOSE=1 ends with:
[ 70%] Building CXX object src/modules/gfx/CMakeFiles/gfx.dir/GL1Frontend.cpp.o
cd src/modules/gfx && /usr/bin/c++ -pthread -Wcast-qual -Wcast-align -Wpointer-arith -Wshadow -Wall -Wextra -Wreturn-type -Wwrite-strings -Wno-unused-parameter -std=c++11 -Wnon-virtual-dtor -fno-rtti -fno-exceptions -O0 -DDEBUG=1 -ggdb -I../../../../src -I../../../../src/modules -I../../../../src/libs/gtest -I../../../../src/libs/gtest/include -I../../../../src/libs/SDL2_image -I../../../../src/libs/lua5.2 -I/usr/include/SDL2 -I../../../../src/libs/box2d -I../../../../src/libs/glm -D_REENTRANT -o CMakeFiles/gfx.dir/GL1Frontend.cpp.o -c ../../../../src/modules/gfx/GL1Frontend.cpp
In file included from ../../../../src/modules/network/IProtocolHandler.h:3:0,
from ../../../../src/modules/game/IGame.h:5,
from ../../../../src/modules/game/GameRegistry.h:4,
from ../../../../src/modules/gfx/SDLFrontend.cpp:11:
../../../../src/modules/common/ByteStream.h: In member function ‘int16_t ByteStream::readShort()’:
../../../../src/modules/common/ByteStream.h:211:68: warning: cast from ‘const uint8_t* {aka const unsigned char*}’ to ‘const int16_t* {aka const short int*}’ increases required alignment of target type [-Wcast-align]
const int16_t *word = reinterpret_cast<const int16_t*>(getBuffer());
^
../../../../src/modules/common/ByteStream.h: In member function ‘int32_t ByteStream::readInt()’:
../../../../src/modules/common/ByteStream.h:232:68: warning: cast from ‘const uint8_t* {aka const unsigned char*}’ to ‘const int32_t* {aka const int*}’ increases required alignment of target type [-Wcast-align]
const int32_t *word = reinterpret_cast<const int32_t*>(getBuffer());
^
In file included from ../../../../src/modules/network/IProtocolHandler.h:5:0,
from ../../../../src/modules/game/IGame.h:5,
from ../../../../src/modules/game/GameRegistry.h:4,
from ../../../../src/modules/gfx/SDLFrontend.cpp:11:
../../../../src/modules/network/IProtocolMessage.h: In destructor ‘virtual DisconnectMessage::Factory::~Factory()’:
../../../../src/modules/network/IProtocolMessage.h:19:89: warning: cast from ‘uint8_t* {aka unsigned char*}’ to ‘DisconnectMessage*’ increases required alignment of target type [-Wcast-align]
~Factory() { if (_initialized) { className* obj = reinterpret_cast<className*>(_memory); obj->~className(); } delete[] _memory; } \
^
../../../../src/modules/network/IProtocolMessage.h:33:4: note: in expansion of macro ‘PROTOCOL_CLASS_FACTORY’
PROTOCOL_CLASS_FACTORY(className); \
^
../../../../src/modules/network/IProtocolMessage.h:152:1: note: in expansion of macro ‘PROTOCOL_CLASS_SIMPLE’
PROTOCOL_CLASS_SIMPLE(DisconnectMessage, protocol::PROTO_DISCONNECT);
^
../../../../src/modules/network/IProtocolMessage.h: In destructor ‘virtual StartMapMessage::Factory::~Factory()’:
../../../../src/modules/network/IProtocolMessage.h:19:89: warning: cast from ‘uint8_t* {aka unsigned char*}’ to ‘StartMapMessage*’ increases required alignment of target type [-Wcast-align]
~Factory() { if (_initialized) { className* obj = reinterpret_cast<className*>(_memory); obj->~className(); } delete[] _memory; } \
^
../../../../src/modules/network/IProtocolMessage.h:33:4: note: in expansion of macro ‘PROTOCOL_CLASS_FACTORY’
PROTOCOL_CLASS_FACTORY(className); \
^
../../../../src/modules/network/IProtocolMessage.h:155:1: note: in expansion of macro ‘PROTOCOL_CLASS_SIMPLE’
PROTOCOL_CLASS_SIMPLE(StartMapMessage, protocol::PROTO_STARTMAP);
^
../../../../src/modules/network/IProtocolMessage.h: In destructor ‘virtual CloseMapMessage::Factory::~Factory()’:
../../../../src/modules/network/IProtocolMessage.h:19:89: warning: cast from ‘uint8_t* {aka unsigned char*}’ to ‘CloseMapMessage*’ increases required alignment of target type [-Wcast-align]
~Factory() { if (_initialized) { className* obj = reinterpret_cast<className*>(_memory); obj->~className(); } delete[] _memory; } \
^
../../../../src/modules/network/IProtocolMessage.h:33:4: note: in expansion of macro ‘PROTOCOL_CLASS_FACTORY’
PROTOCOL_CLASS_FACTORY(className); \
^
../../../../src/modules/network/IProtocolMessage.h:156:1: note: in expansion of macro ‘PROTOCOL_CLASS_SIMPLE’
PROTOCOL_CLASS_SIMPLE(CloseMapMessage, protocol::PROTO_CLOSEMAP);
^
../../../../src/modules/network/IProtocolMessage.h: In destructor ‘virtual PlayerListMessage::Factory::~Factory()’:
../../../../src/modules/network/IProtocolMessage.h:19:89: warning: cast from ‘uint8_t* {aka unsigned char*}’ to ‘PlayerListMessage*’ increases required alignment of target type [-Wcast-align]
~Factory() { if (_initialized) { className* obj = reinterpret_cast<className*>(_memory); obj->~className(); } delete[] _memory; } \
^
../../../../src/modules/network/IProtocolMessage.h:41:4: note: in expansion of macro ‘PROTOCOL_CLASS_FACTORY’
PROTOCOL_CLASS_FACTORY(className); \
^
../../../../src/modules/network/IProtocolMessage.h:158:1: note: in expansion of macro ‘PROTOCOL_CLASS_SIMPLE_LIST’
PROTOCOL_CLASS_SIMPLE_LIST(PlayerListMessage, protocol::PROTO_PLAYERLIST);
^
../../../../src/modules/network/IProtocolMessage.h: In destructor ‘virtual InitWaitingMapMessage::Factory::~Factory()’:
../../../../src/modules/network/IProtocolMessage.h:19:89: warning: cast from ‘uint8_t* {aka unsigned char*}’ to ‘InitWaitingMapMessage*’ increases required alignment of target type [-Wcast-align]
~Factory() { if (_initialized) { className* obj = reinterpret_cast<className*>(_memory); obj->~className(); } delete[] _memory; } \
^
../../../../src/modules/network/IProtocolMessage.h:33:4: note: in expansion of macro ‘PROTOCOL_CLASS_FACTORY’
PROTOCOL_CLASS_FACTORY(className); \
^
../../../../src/modules/network/IProtocolMessage.h:161:1: note: in expansion of macro ‘PROTOCOL_CLASS_SIMPLE’
PROTOCOL_CLASS_SIMPLE(InitWaitingMapMessage, protocol::PROTO_INITWAITING);
^
../../../../src/modules/network/IProtocolMessage.h: In destructor ‘virtual SpawnMessage::Factory::~Factory()’:
../../../../src/modules/network/IProtocolMessage.h:19:89: warning: cast from ‘uint8_t* {aka unsigned char*}’ to ‘SpawnMessage*’ increases required alignment of target type [-Wcast-align]
~Factory() { if (_initialized) { className* obj = reinterpret_cast<className*>(_memory); obj->~className(); } delete[] _memory; } \
^
../../../../src/modules/network/IProtocolMessage.h:33:4: note: in expansion of macro ‘PROTOCOL_CLASS_FACTORY’
PROTOCOL_CLASS_FACTORY(className); \
^
../../../../src/modules/network/IProtocolMessage.h:162:1: note: in expansion of macro ‘PROTOCOL_CLASS_SIMPLE’
PROTOCOL_CLASS_SIMPLE(SpawnMessage, protocol::PROTO_SPAWN);
^
../../../../src/modules/network/IProtocolMessage.h: In destructor ‘virtual StopFingerMovementMessage::Factory::~Factory()’:
../../../../src/modules/network/IProtocolMessage.h:19:89: warning: cast from ‘uint8_t* {aka unsigned char*}’ to ‘StopFingerMovementMessage*’ increases required alignment of target type [-Wcast-align]
~Factory() { if (_initialized) { className* obj = reinterpret_cast<className*>(_memory); obj->~className(); } delete[] _memory; } \
^
../../../../src/modules/network/IProtocolMessage.h:33:4: note: in expansion of macro ‘PROTOCOL_CLASS_FACTORY’
PROTOCOL_CLASS_FACTORY(className); \
^
../../../../src/modules/network/IProtocolMessage.h:163:1: note: in expansion of macro ‘PROTOCOL_CLASS_SIMPLE’
PROTOCOL_CLASS_SIMPLE(StopFingerMovementMessage, protocol::PROTO_STOPFINGERMOVEMENT);
^
/usr/bin/cmake -E cmake_progress_report /home/odroid/.phoronix-test-suite/caveexpress-master/build/CMakeFiles
[ 70%] Building CXX object src/modules/gfx/CMakeFiles/gfx.dir/BGFXFrontend.cpp.o
cd src/modules/gfx && /usr/bin/c++ -pthread -Wcast-qual -Wcast-align -Wpointer-arith -Wshadow -Wall -Wextra -Wreturn-type -Wwrite-strings -Wno-unused-parameter -std=c++11 -Wnon-virtual-dtor -fno-rtti -fno-exceptions -O0 -DDEBUG=1 -ggdb -I../../../../src -I../../../../src/modules -I../../../../src/libs/gtest -I../../../../src/libs/gtest/include -I../../../../src/libs/SDL2_image -I../../../../src/libs/lua5.2 -I/usr/include/SDL2 -I../../../../src/libs/box2d -I../../../../src/libs/glm -D_REENTRANT -o CMakeFiles/gfx.dir/BGFXFrontend.cpp.o -c ../../../../src/modules/gfx/BGFXFrontend.cpp
../../../../src/modules/gfx/GL1Frontend.cpp: In member function ‘virtual void GL1Frontend::makeScreenshot(const string&)’:
../../../../src/modules/gfx/GL1Frontend.cpp:377:18: error: ‘GLubyte’ was not declared in this scope
std::unique_ptr<GLubyte> pixels(new GLubyte[bytesPerPixel * _width * _height]);
^
../../../../src/modules/gfx/GL1Frontend.cpp:377:25: error: template argument 1 is invalid
std::unique_ptr<GLubyte> pixels(new GLubyte[bytesPerPixel * _width * _height]);
^
../../../../src/modules/gfx/GL1Frontend.cpp:377:25: error: template argument 2 is invalid
../../../../src/modules/gfx/GL1Frontend.cpp:377:33: error: invalid type in declaration before ‘(’ token
std::unique_ptr<GLubyte> pixels(new GLubyte[bytesPerPixel * _width * _height]);
^
../../../../src/modules/gfx/GL1Frontend.cpp:377:38: error: ‘GLubyte’ does not name a type
std::unique_ptr<GLubyte> pixels(new GLubyte[bytesPerPixel * _width * _height]);
^
../../../../src/modules/gfx/GL1Frontend.cpp:379:16: error: ‘GL_PACK_ALIGNMENT’ was not declared in this scope
glGetIntegerv(GL_PACK_ALIGNMENT, &rowPack);
^
../../../../src/modules/gfx/GL1Frontend.cpp:379:43: error: ‘glGetIntegerv’ was not declared in this scope
glGetIntegerv(GL_PACK_ALIGNMENT, &rowPack);
^
../../../../src/modules/gfx/GL1Frontend.cpp:380:36: error: ‘glPixelStorei’ was not declared in this scope
glPixelStorei(GL_PACK_ALIGNMENT, 1);
^
../../../../src/modules/gfx/GL1Frontend.cpp:381:38: error: ‘GL_RGB’ was not declared in this scope
glReadPixels(0, 0, _width, _height, GL_RGB, GL_UNSIGNED_BYTE, pixels.get());
^
../../../../src/modules/gfx/GL1Frontend.cpp:381:46: error: ‘GL_UNSIGNED_BYTE’ was not declared in this scope
glReadPixels(0, 0, _width, _height, GL_RGB, GL_UNSIGNED_BYTE, pixels.get());
^
../../../../src/modules/gfx/GL1Frontend.cpp:381:71: error: request for member ‘get’ in ‘pixels’, which is of non-class type ‘int’
glReadPixels(0, 0, _width, _height, GL_RGB, GL_UNSIGNED_BYTE, pixels.get());
^
../../../../src/modules/gfx/GL1Frontend.cpp:381:76: error: ‘glReadPixels’ was not declared in this scope
glReadPixels(0, 0, _width, _height, GL_RGB, GL_UNSIGNED_BYTE, pixels.get());
^
../../../../src/modules/gfx/GL1Frontend.cpp:395:75: error: request for member ‘get’ in ‘pixels’, which is of non-class type ‘int’
memcpy((uint8 *) surface->pixels + surface->pitch * y, (uint8 *) pixels.get() + pitch * (_height - y - 1), pitch);
^
make[2]: *** [src/modules/gfx/CMakeFiles/gfx.dir/GL1Frontend.cpp.o] Error 1
make[2]: Leaving directory `/media/odroid/78456063-ca3b-48c5-8b43-106bcfc3e27a/phoronix-test-suite-arm/caveexpress-master/build'
make[1]: *** [src/modules/gfx/CMakeFiles/gfx.dir/all] Error 2
make[1]: Leaving directory `/media/odroid/78456063-ca3b-48c5-8b43-106bcfc3e27a/phoronix-test-suite-arm/caveexpress-master/build'
make: *** [all] Error 2
That particular issue should be fixed now.
Indeed it builds fine now. I'm getting a crash on startup though - would you like to continue here or move to a new issue?
INFO: INFO (LOG_SERVER): initialize entity sizes
caveexpress: ../../../../src/libs/lua5.2/lapi.c:588: lua_getglobal: Assertion `(L->top <= L->ci->top) && "stack overflow"' failed.
Program received signal SIGABRT, Aborted.
__libc_do_syscall () at ../ports/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:44
44 ../ports/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S: No such file or directory.
#0 __libc_do_syscall () at ../ports/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:44
#1 0xb6baef0e in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#2 0xb6bb1766 in __GI_abort () at abort.c:89
#3 0xb6baa150 in __assert_fail_base (fmt=0x1 <error: Cannot access memory at address 0x1>, assertion=0x3eb9d0 "(L->top <= L->ci->top) && \"stack overflow\"", assertion@entry=0x0, file=0x3eb6a4 "../../../../src/libs/lua5.2/lapi.c", file@entry=0xb6996000 "\001", line=588, line@entry=3066482860, function=function@entry=0x3ec048 <__PRETTY_FUNCTION__.5584> "lua_getglobal") at assert.c:92
#4 0xb6baa1e6 in __GI___assert_fail (assertion=0x0, file=0xb6996000 "\001", line=3066482860, function=0x3ec048 <__PRETTY_FUNCTION__.5584> "lua_getglobal") at assert.c:101
#5 0x00367472 in lua_getglobal (L=0xa5f98a4, name=0x3e9734 "evalExpr") at ../../../../src/libs/lua5.2/lapi.c:588
#6 0x003538dc in LUA::getString (this=0xbeffeb10, expr="tree.width", defaultValue="") at ../../../../src/modules/common/LUA.cpp:241
#7 0x00353c36 in LUA::getFloatValue (this=0xbeffeb10, path="tree.width", defaultValue=1) at ../../../../src/modules/common/LUA.cpp:283
#8 0x002101e0 in caveexpress::Map::init (this=0xa548720, frontend=0xa572ce0, serviceProvider=...) at ../../../../src/caveexpress/server/map/Map.cpp:1831
#9 0x001f4eb0 in caveexpress::CaveExpress::init (this=0xa548708, frontend=0xa572ce0, serviceProvider=...) at ../../../../src/caveexpress/main/CaveExpress.cpp:349
#10 0x00268530 in SDLBackend::handleInit (this=0xbeffece4) at ../../../../src/modules/server/SDLBackend.cpp:253
#11 0x00268612 in SDLBackend::runFrame (this=0xbeffece4) at ../../../../src/modules/server/SDLBackend.cpp:288
#12 0x0026899c in SDLBackend::mainLoop (this=0xbeffece4, argc=1, argv=0xbeffef14) at ../../../../src/modules/server/SDLBackend.cpp:348
#13 0x002092ee in main (argc=1, argv=0xbeffef14) at ../../../../src/Main.cpp:28
No wait, the build process likes x86 too much :)
I tried a Release build but got:
g++-4.9.real: error: unrecognized command line option ‘-msse3’
You probably meant -mfpu=neon
;)
EDIT: Just as I thought the release build starts and works fine.
looks like the lua error is related to #18
Could you please reexecute cmake and attach the lines of this output:
message(STATUS "Target processor: ${CMAKE_SYSTEM_PROCESSOR}")
message(STATUS "Host processor: ${CMAKE_HOST_SYSTEM_PROCESSOR}")
(you need to pull to latest master)
-- Target processor: armv7l -- Host processor: armv7l
Thanks a lot - please give latest master a try. Should be fixed now.
Yeah, that's what I manually did yesterday - the release build is ok now. I've also built it on my old 32bit Athlon box which only has OpenGL 1 (and sse) - the game runs smoothly with nvidia binary drivers but it has to be started with -set frontend sdl the first time, otherwise it crashes after automatically choosing GL3.
The lua issue is also present on that 32bit x86.
Thanks!
The lua issue is also present there? I thought you are able to run it. What exactly is the output? segfault?
ah - amd64. no sse3 - there was this cmake module FindSSE.cmake - but I found this a little bit overkill. But as far as I can see there is no way around it if I wanna support more platforms and still use -msse3
The default debug build has the lua issue on both platforms whereas the release doesn't.
If you meant to see the GL3 segfault, here you are:
INFO: INFO (LOG_CLIENT): current desktop mode: 1280x1024@50Hz (SDL_PIXELFORMAT_RGB888)
INFO: INFO (LOG_CLIENT): doublebuffer: disabled
INFO: INFO (LOG_CLIENT): available driver: x11
INFO: INFO (LOG_CLIENT): available driver: dummy
INFO: INFO (LOG_CLIENT): driver: x11
INFO: INFO (LOG_CLIENT): found 1 display(s)
INFO: INFO (LOG_CLIENT): init opengl renderer
[New Thread 0xb7c84b40 (LWP 22707)]
Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
#0 0x00000000 in ?? ()
#1 0x082c917b in GL3Frontend::initRenderer (this=0x12611508) at ../../../../src/modules/gfx/GL3Frontend.cpp:377
#2 0x082c58ed in SDLFrontend::init (this=0x12611508, width=1280, height=1024, fullscreen=true, eventHandler=...) at ../../../../src/modules/gfx/SDLFrontend.cpp:589
#3 0x082ae6a5 in SDLBackend::handleInit (this=0xbfffe9f4) at ../../../../src/modules/server/SDLBackend.cpp:231
#4 0x082ae917 in SDLBackend::runFrame (this=0xbfffe9f4) at ../../../../src/modules/server/SDLBackend.cpp:288
#5 0x082aed7b in SDLBackend::mainLoop (this=0xbfffe9f4, argc=1, argv=0xbfffeb94) at ../../../../src/modules/server/SDLBackend.cpp:348
#6 0x082423d8 in main (argc=1, argv=0xbfffeb94) at ../../../../src/Main.cpp:28
I think issue can be closed then, I will take care of the lua stuff in issue #18
Removing all config files and typing ./caveexpress still segfaults after starting the opengl3 frontend in arm GLES-only SDL2 environment.
I switched back to sdl by default for now. This is currently the safest.
Build fails on Linux against a gles-only SDL2:
For some reason, even though LDFLAGS=-ldl is passed to make -j4 I'm getting these:
and afterwards the build finally fails with:
Doing a make -j4 and then after the above dlsym errors finishing with LDFLAGS=-ldl make ends with: