User avatar
Davespice
Forum Moderator
Forum Moderator
Posts: 1662
Joined: Fri Oct 14, 2011 8:06 pm
Location: The Netherlands
Contact: Twitter

Experimental Building of Oolite source on Raspberry Pi

Wed Nov 21, 2012 1:33 pm

Ladies and gents, I’m sure the Elite fans among you will be aware of the open source game Oolite (object oriented elite). This is very full featured game which had enormous scope for user modification and creation of content. I also think the Raspberry Pi probably has enough grunt to run it at a decent frame rate. The issue might be memory footprint but we’ll see.

I am trying to evaluate how much work it would be to port the graphics engine from standard Open GL to Open GL ES, I have had a look around in their SVN and the code does look quite well compartmentalised. I would like to get to the stage where I can build it on a Pi itself and start seeing the build errors that result from not having standard Open GL. The Oolite developers are unable to help me here because they have too much work going on themselves with getting the next version of the game done. So I would like to enlist some help from the clever people who browse these forums, if you have the time.

I have got as far as checking out the trunk and trying to get the dependencies to build. One of the dependencies is spidermonkey which, it seems, doesn’t like being built on ARM.

First problem I had was that I couldn’t get it past the configure stage, with the error Your compiler does not follow the C++ specification for temporary object destruction order

Code: Select all

checking for __attribute__((always_inline))... yes
checking for __attribute__((malloc))... yes
checking for __attribute__((warn_unused_result))... yes
checking for __attribute__((noreturn))... yes
checking for LC_MESSAGES... yes
checking for localeconv... yes
checking for nspr-config... /usr/bin/nspr-config
checking for NSPR - version >= 4.7.0... yes
checking for valid optimization flags... yes
checking for __cxa_demangle... no
checking for unwind.h... yes
checking for _Unwind_Backtrace... no
checking for gcc -pipe support... yes
checking whether C compiler supports -fprofile-generate... yes
checking whether C++ compiler has -pedantic long long bug... no
checking for correct temporary object destruction order... no
configure: error: Your compiler does not follow the C++ specification for temporary object destruction order.
make[1]: *** [deps/Cross-platform-deps/mozilla/js/src/build-release/config_stamp] Error 1
make[1]: Leaving directory `/home/pi/Oolite-dev/trunk'
make: *** [LIBJS] Error 2
So I then spent a whole afternoon Google whacking and came up with this page.

The gentleman who posted mentions some makefile settings and I am unfortunately not 100% sure where to put these. The building of spidermonkey is part of the overall build script for Oolite so, ideally, it would be good if I could put these in the correct place for the entire build process.

I have had a go at trying to find the correct place to put it myself. I edited the libjs.make file (in the root Oolite trunk folder) and added the CFLAGS line to the LIBJS_CONFIG_GLAGS global variable and that allowed the configure stage to complete successfully. However then I got loads of build errors from the spidermonkey source itself (see below). So I’ve probably not done this correctly.

Code: Select all

../assembler/assembler/ARMAssembler.h: In member function "void JSC::ARMAssembler::fcpyd_r(int, int, JSC::ARMAssembler::Condition)":
../assembler/assembler/ARMAssembler.h:528:13: error: "JaegerSpew" is not a member of "js"
../assembler/assembler/ARMAssembler.h:528:28: error: "JSpew_Insns" is not a member of "js"
../assembler/assembler/ARMAssembler.h: In member function "void JSC::ARMAssembler::faddd_r(int, int, int, JSC::ARMAssembler::Condition)":
../assembler/assembler/ARMAssembler.h:537:13: error: "JaegerSpew" is not a member of "js"
../assembler/assembler/ARMAssembler.h:537:28: error: "JSpew_Insns" is not a member of "js"
../assembler/assembler/ARMAssembler.h: In member function "void JSC::ARMAssembler::fnegd_r(int, int, JSC::ARMAssembler::Condition)":
../assembler/assembler/ARMAssembler.h:546:13: error: "JaegerSpew" is not a member of "js"
../assembler/assembler/ARMAssembler.h:546:28: error: "JSpew_Insns" is not a member of "js"
../assembler/assembler/ARMAssembler.h: In member function "void JSC::ARMAssembler::fdivd_r(int, int, int, JSC::ARMAssembler::Condition)":
I’ll now list all the steps I have taken to get to this stage if anyone wants to try themselves, any help would be greatly greatly appreciated.

Install dependencies;

Code: Select all

sudo apt-get install gobjc gnustep-core-devel libsdl-1.2dev libsdl-mixer1.2-dev subversion libespeak-dev libnspr4-dev curl
Setup GNUstep environment variables
Edit the ".bashrc" file, located in your home directory, and append the related environment libraries.
Locate the "GNUstep.sh" file (e.g. /usr/share/GNUstep/Makefiles/GNUstep.sh) and append it at your ".bashrc". In that way you will get all the GNUstep environment variables into your profile.

Code: Select all

#GNUSTEP Environment vars
. /usr/share/GNUstep/Makefiles/GNUstep.sh
Note; The path above is preceded by a dot and a space character!

Get the source

Code: Select all

mkdir Oolite-dev
cd Oolite-dev
svn co http://svn.berlios.de/svnroot/repos/oolite-linux/trunk/
Try the build;

Code: Select all

make -f Makefile release
You'll see this will error out with the object destruction order problem mentioned above.

To fix this I edited libjs.make and made the following changes to the top of the file;

Code: Select all

LIBJS_CONFIG_FLAGS               = --disable-shared-js
to
LIBJS_CONFIG_FLAGS               = --disable-shared-js CFLAGS="-O2 -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard"
So when you try the build with that change then the spidermonkey configure passes and it starts compiling some files, only to error out later on with the is not a member of "js" messages. So that is as far as I have got, any help would be fantastic - I know there I some boffins on here who can probably point me right.

Cheers!
Dave

User avatar
Davespice
Forum Moderator
Forum Moderator
Posts: 1662
Joined: Fri Oct 14, 2011 8:06 pm
Location: The Netherlands
Contact: Twitter

Re: Experimental Building of Oolite source on Raspberry Pi

Tue Nov 27, 2012 11:53 am

Hey folks, from the lack of replies I think I might have to go and cry in a corner for a while :(

Nevertheless I thought I should post any progress that I have made since it might give other people some more ideas. I think I have got to a stage where I am fairly sure the problem is to do with the path it’s taking through the configure script.

So looking at the code you can see that the method names that its complaining are not a member of js could only be absent from the code if JS_TRACER and JS_METHODJIT global variables were not defined.

So as a dirty hack I went into deps\Cross-platform-deps\mozilla\js\src\build-release and edited the file js-confdefs.h and added the following two lines;

Code: Select all

#define JS_TRACER 1
#define JS_METHODJIT 1
This then cures the “is not a member of js” errors, however there are now further errors to do with not being able to find certain source code files.

Code: Select all

tracejit\Writer.h
nanojit\nanojit.h
This looks like it’s just not specified the path to these files correctly, this is the error the compiler gives;

Code: Select all

In file included from ../jsapi.cpp:84:0:
../jstracer.h:56:20: fatal error: Writer.h: No such file or directory
compilation terminated.
So I am reckoning that if I can fix something which is going wrong with the Spidermonkey configure script then things may well fall into place. Any further help would be greatly appreciated.

I ate all the Pi
Posts: 2
Joined: Fri Dec 07, 2012 8:20 pm
Location: Merthyr Tydfil S.Wales

Re: Experimental Building of Oolite source on Raspberry Pi

Tue Dec 11, 2012 6:20 pm

I LOVE this game (oolite), currently ranked 'Deadly', having this on the Raspi would be AWESOME. I cant help with your problem with spidermonkey, but I am posting to offer 'moral support' and encouragement to keep going. :D

Randa
Posts: 2
Joined: Fri Jan 11, 2013 8:35 am

Re: Experimental Building of Oolite source on Raspberry Pi

Fri Jan 11, 2013 8:52 am

Hi, i'm trying to compile a software that depend on SpiderMonkey (libmozjs185) with no success in compile SpiderMonkey from source.
I'm trying now with the debian package: apt-get install libmozjs185-dev
We'll see.
Best regards.

Markodius
Posts: 134
Joined: Fri Jan 04, 2013 11:14 pm

Re: Experimental Building of Oolite source on Raspberry Pi

Mon Mar 11, 2013 3:10 am

Hi Davespice. Just to say that I hope you haven't given up. Fantastic game - I couldn't believe the realism that has been achieved with the add-ons. More than once I was almost reduced to tears as it was like playing the game as I'd imagined it to be on the BBC B.

[EDIT] I see that Oolite has turned up in the Raspbian repository.. yaay! :) but it breaks with a broken symbol.. boo! :( I'll keep my fingers crossed ;) [/EDIT]
“In the modern age, to call a man unelectable means he cannot be bought”

colo
Posts: 1
Joined: Tue Mar 19, 2013 11:47 am

Re: Experimental Building of Oolite source on Raspberry Pi

Tue Mar 19, 2013 11:55 am

Same problem here:
./oolite: symbol lookup error: ./oolite: udefined symbol: main

It will be fine to have oolite running on raspi.
I hope you will not give up !

User avatar
theoB610
Posts: 233
Joined: Sat Jan 05, 2013 12:40 pm
Location: Devon

Re: Experimental Building of Oolite source on Raspberry Pi

Thu Jun 13, 2013 10:45 am

Have you looked in to running an original Elite through an emulator? I know that there are Archimedes and NES emulators out there for the pi and it would be easy to download elite onto one of them..
And then you can feel SUPER RETRO!

I guess that oolite does actually have advantages over arc elite, for example, as the graphics are better, more support etc

But it isn't as cool :P

EDIT: Does ArcEm work on the pi running raspbian?

davedude0
Posts: 16
Joined: Sun Jul 15, 2012 10:20 pm

Re: Experimental Building of Oolite source on Raspberry Pi

Tue Jun 18, 2013 9:56 pm

A bit of a late bump but arcem does work (on riscos pi, not raspbian or anything else really) with the right ROM and elite runs great with it - it's all in a nice easy tutorial in issue #13 if the Magpi!
Happy trading!

motorheadabega
Posts: 1
Joined: Sat Aug 03, 2013 5:35 pm

Re: Experimental Building of Oolite source on Raspberry Pi

Sat Aug 03, 2013 5:50 pm

I have followed the instructions to check out oolite source code on my rpi running latest raspbian. My only deviation from these instructions was to install zip (not sure why this wasn't installed by default).

I made the change to LIBJS_CONFIG_FLAGS, which worked as advertised.

However, modifying deps/Cross-platform-deps/mozilla/js/src/build-release/js-confdefs.h to #define JS_TRACER and JS_METHODJIT did not resolve the "not a member of js" errors.

I noticed that you used backslashes in deps\Cross-platform-deps\mozilla\js\src\build-release, so perhaps you are cross-compiling on a Windows system? Anyway, I tried creating a symbolic link as follows (since I am compiling on Raspbian):

Code: Select all

ln -s deps/Cross-platform-deps/mozilla deps/Linux-deps/mozilla
Which didn't help either.

I am about to embark on a more thorough reading of the code and will update if I find anything.

Thank you Davespice for starting this thread.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5306
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Experimental Building of Oolite source on Raspberry Pi

Sun Aug 04, 2013 3:24 am

There is hope for the opengl side of things too.
http://www.raspberrypi.org/phpBB3/viewt ... 48#p394521
https://github.com/lunixbochs/glshim

So if we get oolite to build, the graphics may be accelerated too.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5306
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Experimental Building of Oolite source on Raspberry Pi

Sun Aug 04, 2013 5:33 am

Actually, it seems to be in the raspbian repos and I don't see any debdiffs for it, so it 'should' build just fine.
http://archive.raspbian.org/raspbian/po ... /o/oolite/

I'll try building it on Arch.

Edit: Nope, no luck. Running into the same problems as you. Will need to corner plugwash on IRC later and see how he managed it. >.>

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5306
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Experimental Building of Oolite source on Raspberry Pi

Sun Aug 04, 2013 8:21 am

Gentoo has some very promising looking patches.
http://sources.gentoo.org/cgi-bin/viewv ... key/files/

I'll see how the ARM ones go.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5306
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Experimental Building of Oolite source on Raspberry Pi

Sun Aug 04, 2013 10:19 am

Sorry to keep spamming the thread, but... progress.

To eliminate the possibility of the build failing because of something the oolite folks have done to spidermonkey, I have downloaded plain js-1.8.5. When compiling, I got exactly the same errors as Davespice described.

However, applying this patch ( http://sources.gentoo.org/cgi-bin/viewv ... gs-3.patch ) then running autoconf and configure again fixed everything. No need to mess around with CFLAGS either. So yeah, spidermonkey compiles fine with gentoo's patch. So that's that hurdle solved. I've applied the patch to oolite's js source and compiling now to see how it goes.

Edit: To avoid spamming I'll just add this as an edit.
js compiled fine, but the compile chocked because of some nonsense in OOCPUInfo.h. The fix is this patch here http://patch-tracker.debian.org/patch/s ... aram.patch ... compiling on to see how far it gets now.

Edit 2:
Image

Edit 3: Got it running with glshim, but I am only getting about 0.5-1 FPS. I am not sure if it's because the shim isn't working properly or if it actually loads the GPU that much.

Methanoid
Posts: 61
Joined: Thu Feb 28, 2013 12:02 pm

Re: Experimental Building of Oolite source on Raspberry Pi

Sun Jul 19, 2015 10:51 am

Is this project dead? viewtopic.php?f=28&t=45252 seems to indicate some progress with OpenGL on Pi.. but I'm no programmer....

Would love to see Oolite on Pi (or GLFrontier)

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5306
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Experimental Building of Oolite source on Raspberry Pi

Sun Jul 19, 2015 5:44 pm

Could be worth trying with anholt's drivers, but I don't have that set up.

Micha1982
Posts: 261
Joined: Wed Oct 03, 2012 11:18 am

Re: Experimental Building of Oolite source on Raspberry Pi

Sat Mar 24, 2018 3:04 am

Runs fine from repos now when driver is activated.
Just add

Code: Select all

<key>max-texture-size</key>
    <integer>512</integer>
to /home/pi/GNUstep/Defaults/oolite.plist.

Only problem is that speech-output is very very sloppy, same as in Mathematica. There must be a general problem with speech-output somewhere...

And here and there it lags a bit, when launching from spacestation for example...does not affect gaameplay very much, but does someone has any idea how to fix this little lag maybe?
Alles, was schiefgehen kann, wird auch schiefgehen.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5306
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Experimental Building of Oolite source on Raspberry Pi

Sat Apr 21, 2018 10:36 pm

Micha1982 wrote:
Sat Mar 24, 2018 3:04 am
Runs fine from repos now when driver is activated.
Just add

Code: Select all

<key>max-texture-size</key>
    <integer>512</integer>
to /home/pi/GNUstep/Defaults/oolite.plist.
That fixes the texture glitches on planets?

Return to “General programming discussion”

Who is online

Users browsing this forum: No registered users and 4 guests