Building on Rasberry Pi

Discussion in 'Development General' started by ArchZombie, Jun 14, 2013.

  1. ArchZombie

    ArchZombie Member

    Joined:
    Aug 1, 2012
    Messages:
    65
    Likes Received:
    0
    PO Trainer Name:
    ArchZombie0x
    I was wondering if anyone else has a rasberry pi? Any sucess building?
     
  2. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    I ran server with ARM based Tonido Plug two years ago. It was hilarious since the compiler had different default types compared to desktop GCC. Everyone's favourite move was shell smash which made you have instantly +2 attacks and speed and +6 defences due to having unsigned integers.

    So be warned; it's not that different from PC and 512MB RAM raspi could definitely compile PO althought it would use more time. But there may be some differences if there have variables change their (un)signedness. PO could definitely use a commit which would fix those :x
     
  3. ArchZombie

    ArchZombie Member

    Joined:
    Aug 1, 2012
    Messages:
    65
    Likes Received:
    0
    PO Trainer Name:
    ArchZombie0x
    Humm, seems that isn't my only issue.

    Code (text):
    1. pi@raspberrypi's password:
    2. Linux raspberrypi 3.6.11+ #456 PREEMPT Mon May 20 17:42:15 BST 2013 armv6l
    3.  
    4. The programs included with the Debian GNU/Linux system are free software;
    5. the exact distribution terms for each program are described in the
    6. individual files in /usr/share/doc/*/copyright.
    7.  
    8. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
    9. permitted by applicable law.
    10. Last login: Sat Jun 15 03:10:19 2013
    11. pi@raspberrypi ~ $ cd pokemon-online/
    12. pi@raspberrypi ~/pokemon-online $ qmake "CONFIG += po_server po_client"
    13. Project MESSAGE: Following modules will be build: src/Utilities src/PokemonInfo src/BattleManager src/Teambuilder src/Server src/QJson src/QtWebsocket src/RelayStation
    14. pi@raspberrypi ~/pokemon-online $ make
    15. cd src/Utilities/ && make -f Makefile
    16. make[1]: Entering directory `/home/pi/pokemon-online/src/Utilities'
    17. g++ -c -pipe -std=c++0x -O2 -Wall -W -D_REENTRANT -fPIC -DQT_WEBKIT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -o ../../build/release/Utilities/contextswitch.o contextswitch.cpp
    18. In file included from contextswitch.h:5:0,
    19.                  from contextswitch.cpp:1:
    20. coro.h:227:1: error: ‘error’ does not name a type
    21. In file included from contextswitch.cpp:1:0:
    22. contextswitch.h:127:18: error: field ‘main_context’ has incomplete type
    23. In file included from contextswitch.cpp:1:0:
    24. contextswitch.h:186:18: error: field ‘context’ has incomplete type
    25. contextswitch.cpp: In destructor ‘virtual ContextSwitcher::~ContextSwitcher()’:
    26. contextswitch.cpp:19:26: error: ‘main_context’ was not declared in this scope
    27. contextswitch.cpp:19:38: error: ‘coro_destroy’ was not declared in this scope
    28. contextswitch.cpp: In member function ‘virtual void ContextSwitcher::run()’:
    29. contextswitch.cpp:40:21: error: ‘main_context’ was not declared in this scope
    30. contextswitch.cpp:94:38: error: ‘class ContextCallee’ has no member named ‘context’
    31. contextswitch.cpp: In member function ‘void ContextSwitcher::switch_context(ContextCallee*)’:
    32. contextswitch.cpp:121:20: error: ‘main_context’ was not declared in this scope
    33. contextswitch.cpp:121:52: error: ‘class ContextCallee’ has no member named ‘context’
    34. contextswitch.cpp:121:59: error: ‘coro_transfer’ was not declared in this scope
    35. contextswitch.cpp: In member function ‘void ContextSwitcher::yield()’:
    36. contextswitch.cpp:182:25: error: ‘class ContextCallee’ has no member named ‘context’
    37. contextswitch.cpp:182:35: error: ‘main_context’ was not declared in this scope
    38. contextswitch.cpp:182:47: error: ‘coro_transfer’ was not declared in this scope
    39. contextswitch.cpp: In destructor ‘virtual ContextCallee::~ContextCallee()’:
    40. contextswitch.cpp:212:26: error: ‘context’ was not declared in this scope
    41. contextswitch.cpp:212:33: error: ‘coro_destroy’ was not declared in this scope
    42. make[1]: *** [../../build/release/Utilities/contextswitch.o] Error 1
    43. make[1]: Leaving directory `/home/pi/pokemon-online/src/Utilities'
    44. make: *** [sub-src-Utilities-make_default-ordered] Error 2
    Bleh.
     
  4. ArchZombie

    ArchZombie Member

    Joined:
    Aug 1, 2012
    Messages:
    65
    Likes Received:
    0
    PO Trainer Name:
    ArchZombie0x
    Error above was from this:

    Code (text):
    1. #if !defined(CORO_LOSER) && !defined(CORO_UCONTEXT) \
    2.     && !defined(CORO_SJLJ) && !defined(CORO_LINUX) \
    3.     && !defined(CORO_IRIX) && !defined(CORO_ASM) \
    4.     && !defined(CORO_PTHREAD)
    5. # if defined(WINDOWS) || defined(__WIN32)
    6. #  define CORO_LOSER 1 /* you don't win with windoze */
    7. # elif (defined(__linux) || defined(linux)) && (defined(__x86) || defined (__amd64) || defined(i386) || defined(__i386))
    8. #  define CORO_ASM 1
    9. # elif defined(HAVE_UCONTEXT_H)
    10. #  define CORO_UCONTEXT 1
    11. # elif defined(HAVE_SETJMP_H) && defined(HAVE_SIGALTSTACK)
    12. #  define CORO_SJLJ 1
    13. # elif defined(__MACH__)
    14. #  define CORO_PTHREAD 1
    15. # else
    16. error unknown or unsupported architecture
    17. # endif
    18. #endif
    ._.

    Can we drop dependencies on the coro file?
    >error unknown or unsupported architecture
     
  5. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
    No, unfortunately coro is digged pretty deeply on Server. Fixing that should be easy.

    You should edit the file and add defines for your architechture. That is expected because server isn't tested well enough on ARM. IIRC I went with pthreads but not sure.