yvt / openspades

Compatible client of Ace of Spades 0.75
http://openspades.yvt.jp/
GNU General Public License v3.0
1.14k stars 218 forks source link

Compilation fails on armv6l (Raspberry Pi) #416

Open jextrevor opened 8 years ago

jextrevor commented 8 years ago

Trying to compile on my Raspberry Pi causes make to fail:

../lib/libAngelscript.a(as_callfunc.cpp.o): In function `CallSystemFunction(int, asCContext*, void*)':
as_callfunc.cpp:(.text+0x754): undefined reference to `CallSystemFunctionNative(asCContext*, asCScriptFunction*, void*, unsigned long*, void*, unsigned long long&)'
collect2: error: ld returned 1 exit status
Sources/CMakeFiles/OpenSpades.dir/build.make:5424: recipe for target 'bin/openspades' failed
make[2]: *** [bin/openspades] Error 1
CMakeFiles/Makefile2:168: recipe for target 'Sources/CMakeFiles/OpenSpades.dir/all' failed
make[1]: *** [Sources/CMakeFiles/OpenSpades.dir/all] Error 2
Makefile:137: recipe for target 'all' failed
make: *** [all] Error 2

This git project solves the problem by using a newer version of Angelscript. Any chance this is possible for openspades?

jextrevor commented 7 years ago

It is true that the version of Angel Script has been updated, however compilation still seems to fail on armv6l.

feikname commented 7 years ago

I know very little about how to use CMake or how compilers work at all, but after reading a bit about the changes that SuperTuxKart made to compile on ARM, I think CMake is the culprit.

Just see the difference between the OpenSpades CMakeLists.txt and the SuperTuxKart CMakeLists.txt

Specially this:

+if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm")
+    enable_language(ASM)
+    if(CMAKE_ASM_COMPILER_WORKS)
+        set(ANGELSCRIPT_SOURCE ${ANGELSCRIPT_SOURCE} ../../source/as_callfunc_arm.cpp ../../source/as_callfunc_arm_gcc.S)
+        set_property(SOURCE ../../source/as_callfunc_arm_gcc.S APPEND PROPERTY COMPILE_FLAGS " -Wa,-mimplicit-it=always")
+    else()
+        message(FATAL ERROR "ARM target requires a working assembler")
+    endif()
+ endif()

I made a simple Gist diff here.

jextrevor commented 7 years ago

Yes, I saw the same thing. I'll try to edit the CMakeLists.txt to get compilation to work, then I might submit a pull request.

feikname commented 7 years ago

@jextrevor Great! It'd be very cool to have OpenSpades running on Raspberry Pi.

ghost commented 7 years ago

jextrevor please explain here what you did and how you got it running because im having this error on pi 3B with armv7 here

jextrevor commented 7 years ago

@Tapmemer see above message from feikname. I did manage to compile it, but didn't manage to get it running.

feikname commented 7 years ago

@jextrevor could please post the 'SystemMessages.log' and the crash dump, if it exists, of when you tried to run it?

jextrevor commented 7 years ago

@feikname where might I find the SystemMessages.log?

Here is the output of the program when I try to run it:

terminate called after throwing an instance of 'spades::Exception'
  what():  Invalid argument: index
at /home/pi/openspades/Sources/Gui/StartupScreenHelper.cpp:721
void spades::ScriptContextUtils::ExecuteChecked() at ScriptManager.cpp:338
void spades::ScriptContextHandle::ExecuteChecked() at ScriptManager.cpp:277
void spades::gui::StartupScreen::DoInit() at StartupScreen.cpp:224
spades::gui::StartupScreen::StartupScreen(spades::client::IRenderer*, spades::client::IAudioDevice*, spades::gui::StartupScreenHelper*, spades::client::FontManager*) at StartupScreen.cpp:44
void spades::gui::SDLRunner::Run(int, int) at SDLRunner.cpp:403
int main(int, char**) at Main.cpp:312

Aborted
jextrevor commented 7 years ago

The problem seems to be with the GetReportLineColor function. Somehow this function is being called with an "invalid index". I'm going to see if I can find where this function is being called, and why an invalid index is being passed.

jextrevor commented 7 years ago

I was able to recompile the project so that it would skip the start screen altogether, however, now I run into this error:

2017/03/06 10:53:16 [Runner.cpp:48] [!] Unhandled exception in SDLRunner:
GL error Invalid Value in virtual void spades::gui::SDLGLDevice::TexImage2D(spades::draw::IGLDevice::Enum, spades::draw::IGLDevice::Integer, spades::draw::IGLDevice::Enum, spades::draw::IGLDevice::Sizei, spades::draw::IGLDevice::Sizei, spades::draw::IGLDevice::Integer, spades::draw::IGLDevice::Enum, spades::draw::IGLDevice::Enum, const void*) at /home/pi/openspades/Sources/Gui/SDLGLDevice.cpp:873
jextrevor commented 7 years ago

Recompiled yet again to use the software renderer by default. Main screen starts fine, albeit very slowly. All text is a blue-ish color. I'm able to change settings and select a game, but when I try to actually connect, OpenSpades segfaults.

jextrevor commented 7 years ago

I'm trying with release 0.1.1-c, instead of latest.

feikname commented 7 years ago

@Jextrevor The SystemMessages.log file in inside the user resource directory, which should be located at $XDG_DATA_HOME/openspades/Resources

If XDG_DATA_HOME is not set (you can see this by looking at the output of echo $XDG_DATA_HOME), then the file is located at the ~/.local/share/openspades/Resources folder (If I'm not mistaken)

jextrevor commented 7 years ago

Software rendering is working great on a Raspberry Pi 3. Still segfaults when placing blocks. I've found 640x480 to work the best (at fullscreen) with no undersampling.

2017-03-06-130823_640x480_scrot

feikname commented 7 years ago

@TapMemer sorry for the late response.

If you're atill interested in running OpenSpades on arm, take a look at the OpenPides fork master branch.

tigercoding56 commented 2 years ago

really why dont we just take the code from openspides clean it up and then add it to openspades so that we do not have to worry about it anymore ?

@TapMemer sorry for the late response.

If you're atill interested in running OpenSpades on arm, take a look at the OpenPides fork master branch.