Page 1 of 3

How to compile from source in Linux?

Posted: Mon Apr 23, 2007 8:53 am
by Wolfwood
I've got a Windows laptop where I can play the latest version of Oolite, but there doesn't seem to be a working build for Linux (Ubuntu 7.04 in my case). How would one actually go about building it from the source? Should I even bother thinking about it when my past experiences include only such situations where I've followed someone else's instructions to the letter?

Posted: Mon Apr 23, 2007 11:09 am
by docwild
You need a ful GNUStep dev install and I'm not sure about feisty but when I attempted it on edgy I found that my libc pakage was too old and would need compiling too... I never got round to it.

I intend to though... when I'm bored enough. If you want to go ahead and need help give me a shout. I'm a little out of practice but I'm sure we'll manage :P

Posted: Mon Apr 23, 2007 12:38 pm
by JensAyton
An up-to-date walkthrough for building under Linux would be very welcome. I’d reccomend starting with the 1.68 or even 1.65 tag rather than the trunk, though.

A slight problem will be that BerliOS is currently down, so you can’t actually get at the source.

Posted: Mon Apr 23, 2007 5:31 pm
by drumz
I think you just need the development SDL stuff and GNUStep. It compiles fine here, and I think the only extra stuff I installed was GNUStep. Then just go to oolite/trunk and type "make." The binary is oolite/trunk/oolite.app/oolite.

Posted: Mon Apr 23, 2007 10:22 pm
by JensAyton
BerliOS is up again at the time of writing, with no obvious comment on what happened.

Posted: Sun May 13, 2007 7:21 pm
by Danny
Guys I'm a bit of a Linux newbie, but really want to play this game. Running Ubuntu. Is there anywhere I can find the procedure to build/install this - like a dummy's guide?

Posted: Mon May 14, 2007 8:16 am
by Rxke
Ubuntu Feisty has oolite in Multiverse : http://packages.ubuntulinux.org/feisty/games/oolite

so you might be able to just get it via synaptic?

Posted: Mon May 14, 2007 12:21 pm
by Wolfwood
Just note that the repository version is an old version of Oolite and that newer ones exist...

My own attempt to play Ooline on my Ubuntu laptop seems to be failing due to stupid ATI driver issues... :(

Compiling dev-source release and SVN

Posted: Sun Jul 22, 2007 5:20 pm
by chadlongstaff
I'm having the same problem using dpkg-buildpackage and make on both SVN and the 1.69.1 source release. Seems to go fine till this stage:

Code: Select all

 Linking objc_program oolite ...
./shared_obj/OOJSScript.o: In function `-[OOJSScript initWithPath:andContext:]':
/home/chaddy/trunk/src/Core/Scripting/OOJSScript.m:91: undefined reference to `JS_GetGlobalObject'
/home/chaddy/trunk/src/Core/Scripting/OOJSScript.m:91: undefined reference to `JS_NewObject'
/home/chaddy/trunk/src/Core/Scripting/OOJSScript.m:96: undefined reference to `JS_AddRoot'
after which I got a screed of undefined references to 'JS_blah'

Any ideas what I'm missing gratefully received.

Posted: Mon Jul 23, 2007 9:05 am
by another_commander
You seem to be missing a recent enough version of the javascript library or you may not have the javascript import library installed at all. If you already have libjs.a (I believe that's what it's called, in Windows it is libjs32.a), make sure that the compiler is actually able to see inside the folder where it resides. In gcc, you need to pass to the linker the option -L[path to libjs.a] to make this happen. You can do this by editing the GNUmakefile and adding the option to the oolite_LIB_DIRS += line.

Also, make sure you have the most up to date headers for libjs.

Hope this helps.

Posted: Mon Jul 23, 2007 5:41 pm
by JensAyton
The current repo/source tarball includes a version of libjs (sometimes known as libmozjs) in deps/Linux-x86-deps/oolite-deps/lib/libmozjs.so. For non-x86 targets, you’ll still have to find it or build it yourself. I had nolittle trouble getting it and building it for OS X.

Re: Compiling dev-source release and SVN

Posted: Tue Jul 24, 2007 3:40 am
by Shade
chadlongstaff wrote:
I'm having the same problem using dpkg-buildpackage and make on both SVN and the 1.69.1 source release. Seems to go fine till this stage:

Code: Select all

 Linking objc_program oolite ...
./shared_obj/OOJSScript.o: In function `-[OOJSScript initWithPath:andContext:]':
/home/chaddy/trunk/src/Core/Scripting/OOJSScript.m:91: undefined reference to `JS_GetGlobalObject'
/home/chaddy/trunk/src/Core/Scripting/OOJSScript.m:91: undefined reference to `JS_NewObject'
/home/chaddy/trunk/src/Core/Scripting/OOJSScript.m:96: undefined reference to `JS_AddRoot'
after which I got a screed of undefined references to 'JS_blah'

Any ideas what I'm missing gratefully received.
I just got trunk to build vs. debian unstable. I didn't have to do anything funky, except, rename the reference to -ljs to -lmozjs in the GNUMakefile. So my problems of the other day are moot. :) Now let's just see how stable trunk is....

-ljs to -lmozjs worked

Posted: Tue Jul 24, 2007 5:23 pm
by chadlongstaff
Thanks for the help. Now it builds fine, and even runs. Still having some problems with OXPs, the current set I have are causing a Segmentation Fault, so I'll trawl round for some more up to date versions.

Using a truncated set of OXPs: Assassins.oxp, halsis.oxp, thargoidcarrier.oxp, BlackMonks.oxp, hOopyCasino.oxp, thargoid_wars.oxp, Cargo_wrecks_teaser.oxp, military.oxp, Thorgorn_Threat.oxp, dwcobra3.oxp, nuke.oxp, x-ships.oxp, Freaky Thargoids 3.oxp, Ore_processor.oxp, Fuel Tank v2.0.oxp, Python Class Cruiser 2.6.oxp
Working perfectly, actually more stable for me than 1.65 has been.

Don't forget to use apt-get build-dep oolite oolite-data

Posted: Wed Sep 19, 2007 6:00 pm
by jynx
That'll (in theory) install all the required tools (for 1.65-- have they changed for 1.69.1?) I'm on Debian 4.0 (Etch) on AMD64. The distribution version seems to have built OK, though there were some warnings and I haven't tested if it installs, works, etc. I haven't got the trunk to build yet, but I'll be trying that next.

The commands I used were

fakeroot apt-get --build source oolite
fakeroot apt-get --build source oolite-data

Ran dpkg-buildpackage in trunk/

Posted: Thu Sep 20, 2007 12:20 am
by jynx
It told me I needed gnustep-core-devel and libmozjs-dev, so I ran
aptitude install gnustep-core-devel libmozjs-dev
Started to compile (with a few warnings), but then I got

Code: Select all

 Compiling file src/Core/Scripting/OOScript.m ...
 Compiling file src/Core/Scripting/OOJSScript.m ...
src/Core/Scripting/OOJSScript.m: In function ‘-[OOJSScript initWithPath:properties:context:]’:
src/Core/Scripting/OOJSScript.m:184: warning: pointer type mismatch in conditional expression
 Compiling file src/Core/Scripting/OOJavaScriptEngine.m ...
src/Core/Scripting/OOJavaScriptEngine.m: In function ‘-[OOJavaScriptEngine init]’:
src/Core/Scripting/OOJavaScriptEngine.m:167: error: ‘JSVERSION_1_7’ undeclared (first use in this function)
src/Core/Scripting/OOJavaScriptEngine.m:167: error: (Each undeclared identifier is reported only once
src/Core/Scripting/OOJavaScriptEngine.m:167: error: for each function it appears in.)
make[2]: *** [shared_obj/OOJavaScriptEngine.o] Error 1
make[1]: *** [oolite.all.objc-program.variables] Error 2
make[1]: Leaving directory `/home/user/software_products/oolite/trunk'
make: *** [build] Error 2
Edited GNUmakefile, changed -ljs to -lmozjs as Shade suggested, and removed ../oolite_1.69* in case this was preventing my change from taking effect. Same error.

I found a libjs.a in the package libjs0-dev, so I installed it and changed -lmozjs back to -ljs, but that didn't seem to help either.

libmozjs-dev in Etch is version 1.8.0.13-pre070702 Is this not backwards compatible with 1.7?