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

Compilation fails on armv6l (Raspberry Pi) #416

Open
jextrevor opened this issue Aug 12, 2016 · 16 comments
Open

Compilation fails on armv6l (Raspberry Pi) #416

jextrevor opened this issue Aug 12, 2016 · 16 comments
Labels
cmake compilation-issue enhancement request/proposal to add a new feature

Comments

@jextrevor
Copy link

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
Copy link
Author

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

@feikname feikname reopened this Nov 24, 2016
@feikname
Copy link
Collaborator

feikname commented Nov 24, 2016

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
Copy link
Author

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
Copy link
Collaborator

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

@feikname feikname added the enhancement request/proposal to add a new feature label Nov 24, 2016
@feikname feikname changed the title Compilation fails on armv6l Compilation fails on armv6l (Raspberry Pi) Nov 30, 2016
@feikname feikname added the cmake label Nov 30, 2016
@ghost
Copy link

ghost commented Jan 1, 2017

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
Copy link
Author

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

@feikname
Copy link
Collaborator

feikname commented Jan 2, 2017

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

@jextrevor
Copy link
Author

@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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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

@feikname
Copy link
Collaborator

feikname commented Mar 6, 2017

@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
Copy link
Author

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
Copy link
Collaborator

@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
Copy link

tigercoding56 commented Nov 13, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmake compilation-issue enhancement request/proposal to add a new feature
Projects
None yet
Development

No branches or pull requests

4 participants