How to compile from source in Linux?

For discussion of ports to POSIX based systems, especially using GNUStep.

Moderators: winston, another_commander, Getafix

User avatar
Wolfwood
---- E L I T E ----
---- E L I T E ----
Posts: 735
Joined: Wed Mar 29, 2006 9:53 am
Location: Finland
Contact:

How to compile from source in Linux?

Post 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?
Author of Tales from the Frontier - official Elite 4 anthology.
Author of Marcan Rayger adventures - unofficial fan-fic novellas set in the Frontier universe.
User avatar
docwild
Dangerous
Dangerous
Posts: 64
Joined: Thu Mar 29, 2007 1:36 pm

Post 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
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post 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.
drumz
Competent
Competent
Posts: 36
Joined: Thu Jan 18, 2007 6:18 am

Post 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.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

BerliOS is up again at the time of writing, with no obvious comment on what happened.
Danny
Harmless
Harmless
Posts: 1
Joined: Sun May 13, 2007 7:16 pm

Post 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?
User avatar
Rxke
Retired Assassin
Retired Assassin
Posts: 1760
Joined: Thu Aug 12, 2004 4:54 pm
Location: Belgium

Post 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?
User avatar
Wolfwood
---- E L I T E ----
---- E L I T E ----
Posts: 735
Joined: Wed Mar 29, 2006 9:53 am
Location: Finland
Contact:

Post 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... :(
Author of Tales from the Frontier - official Elite 4 anthology.
Author of Marcan Rayger adventures - unofficial fan-fic novellas set in the Frontier universe.
chadlongstaff
Average
Average
Posts: 9
Joined: Wed May 30, 2007 8:04 am

Compiling dev-source release and SVN

Post 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.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6682
Joined: Wed Feb 28, 2007 7:54 am

Post 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.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post 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.
User avatar
Shade
Above Average
Above Average
Posts: 31
Joined: Sun Jun 24, 2007 7:29 pm

Re: Compiling dev-source release and SVN

Post 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....
chadlongstaff
Average
Average
Posts: 9
Joined: Wed May 30, 2007 8:04 am

-ljs to -lmozjs worked

Post 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.
jynx
Poor
Poor
Posts: 7
Joined: Wed Sep 19, 2007 5:42 pm

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

Post 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
jynx
Poor
Poor
Posts: 7
Joined: Wed Sep 19, 2007 5:42 pm

Ran dpkg-buildpackage in trunk/

Post 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?
Last edited by jynx on Sat Sep 22, 2007 12:58 pm, edited 1 time in total.
Post Reply