[Linux/server] compiling ottd

OpenTTD is a fully open-sourced reimplementation of TTD, written in C++, boasting improved gameplay and many new features.

Moderator: OpenTTD Developers

Post Reply
johnobo
Engineer
Engineer
Posts: 5
Joined: 24 Jul 2006 21:24

[Linux/server] compiling ottd

Post by johnobo »

hey guys,

first of all, i am from germany and i like english as long i just have to read it (; but i gotta problem making it neccesary to register. ^^

now, i rented a server last week, running with linx suse and apache, i nver worked with linux befor, and upped the source file *.bz.tgz [or something like this] extracted it by the command tar.pxz [or something liek this] and got now, the files in a dir: ../mydir/opentd-0.4.3 [or something like this ^^]

but i don't know how to compile it, i bought now a book about dedicated servers, and there's also a little tutorial for linux systems, but i don't understand how to use the 'make' command in the right way to compile ottd.

it would be nice if someone understands me, and can help ^^

thank you guys.
Sacro
Tycoon
Tycoon
Posts: 1145
Joined: 18 Jun 2005 21:08
Location: Here
Contact:

Post by Sacro »

1st - Download the tar.bz2 file

2nd -

Code: Select all

ottdversion=VERSION_OF_OPENTTD
Where VERSION_OF_OPENTTD is whichever version your compiliing (0.4.7, 0.4.8-RC1, etc...)

3rd -

Code: Select all

tar -xjf openttd-$(ottdversion)
4th -

Code: Select all

cd openttd-$(ottdversion)
5th -
It differs here as to whether you want a dedicated server
for yes:

Code: Select all

./configure --dedicated
for normal (needs sdl!)

Code: Select all

./configure
6th

Code: Select all

make

This should give you a binary file called "openttd", you can run it from where it is, or move it to another folder, specify that using

Code: Select all

ottdinstalldir=/path/to/install

Code: Select all

cp openttd data/*.* lang/*.lng  $(ottdinstalldir)
- may need to be root for this

This should work, though i havent tested it yet...my next trick is to make a shell script that will do it all for you :)
We Am De Best

Host of ThroughTheTube site
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

you should be aware that it would still need the TTD files.

Another thing. Are you allowed to use as much CPU power as a server would need? It's not just a fileserver you know :wink:
johnobo
Engineer
Engineer
Posts: 5
Joined: 24 Jul 2006 21:24

Post by johnobo »

ok, thx.

i'll try it in a few minutes.
but all in all, a shell script wouldbe wonderfull as usefull ^^

edit:

Code: Select all

./configure --dedicated
doesn't work:

Code: Select all

./configure --dedicated
-bash: ./configure no such file or directonary
-.-
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post by gigajum »

You need to do that in the openttd directory.

If you have no idea about linux, you should not run a linux server (IMO). I hope you did not rent a root server.

Edit:
to compile it try "make DEDICATED=1" in the openttd directory
Last edited by gigajum on 26 Jul 2006 17:42, edited 1 time in total.
qse-koffer
Engineer
Engineer
Posts: 5
Joined: 26 Jul 2006 17:06
Contact:

Post by qse-koffer »

Well, I'm running Linux Servers in Datacenters for many years now, and I've encoutered the same problem. There is no configure script and I found none.

I did it with make DEDICATED=1 instead of ./configure --dedicated.

But now it crashes when compiling saveload.c:
smarthost:~/openttd-0.4.7# make dedicated=1
===> Compiling saveload.c
saveload.c:956:18: zlib.h: Datei oder Verzeichnis nicht gefunden
saveload.c:958: error: Syntaxfehler before "_z"
saveload.c:958: Warnung: type defaults to `int' in declaration of `_z'
...
I guess I'll have to install a zlib package, but which one? Didn't found anything in the readme.

Greets
Real programmers don't comment their code. It was hard to write, it should be hard to understand.
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post by gigajum »

Did i miss something or is ther really no linux binary out of the 0.4.7?

http://wiki.openttd.org/index.php/Compiling_on_Linux take a look here about compiling openttd under linux.

Edit: Ok only a debian package :(
qse-koffer
Engineer
Engineer
Posts: 5
Joined: 26 Jul 2006 17:06
Contact:

Post by qse-koffer »

This was the missing package: zlib1g-dev ;) Thank you!

I didn't find a dedicated server binary?!

cu
qse-koffer

edit: i'm running debian, as this is the only real linux - in my opinion :P
Real programmers don't comment their code. It was hard to write, it should be hard to understand.
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post by gigajum »

The nightly builds exist as i386,i686 and amd64 dedicated server for linux. That's why i wonder.

And strange but true the source files on sf.net do not contain a configure file.
Last edited by gigajum on 26 Jul 2006 17:23, edited 1 time in total.
qse-koffer
Engineer
Engineer
Posts: 5
Joined: 26 Jul 2006 17:06
Contact:

Post by qse-koffer »

Strange but true :twisted:

As I'm comming from the Windows world, I prefer to run _stable_ releases on _servers_ rather than nightly builds 8)
Real programmers don't comment their code. It was hard to write, it should be hard to understand.
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post by gigajum »

The point is that it looks like the nightly build are more supported then release builds like the 0.4.7 or the comming 0.4.8. That's what i wonder about. Ok the linux guys can compile the game theirself, but then not having a configure file? That's a bit too much.
qse-koffer
Engineer
Engineer
Posts: 5
Joined: 26 Jul 2006 17:06
Contact:

Post by qse-koffer »

hm well, the server is now running here. without a configure file. does it set-up anything necessary?

edit: what do you mean... "more supported"? i was playing on a 0.4.7 server recently and anything worked fine. how is client/server compatibility with different versions?
Real programmers don't comment their code. It was hard to write, it should be hard to understand.
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post by gigajum »

If you run it to compile a client, may be. You can set the sound, video and music driver there. To compile a server only the dedicated flag is necessary (IIRC).

Edit: more suppoted -> the nightlys get compiled as:

GUI (client)
source (bz2 - gz - zip)
source-doc (bz2 - gz - zip)
linux-amd64 (bz2 - gz)
linux-i386 (bz2 - gz)
linux-i686 (bz2 - gz)
macosx (zip)
macosx-intel (zip)
macosx-powerpc (zip)
morphos (lha)
win32 (zip)

Dedicated server (console)
linux-amd64 (bz2 - gz)
linux-i386 (bz2 - gz)
linux-i686 (bz2 - gz)
macosx (zip)
macosx-intel (zip)
macosx-powerpc (zip)
morphos (lha)

for the 0.4.7 list see sf.net
User avatar
Brianetta
Tycoon
Tycoon
Posts: 2567
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

Post by Brianetta »

qse-koffer wrote:edit: what do you mean... "more supported"? i was playing on a 0.4.7 server recently and anything worked fine. how is client/server compatibility with different versions?
More supported - if you have a problem in stable which is fixed in the trunk you'll be encouraged to use the trunk (or a nightly build of it).

Compatibility - none. If the version doesn't match, it will refuse to connect. If you force it to match, you'll disconnect as soon as the client and the server do something different.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

gigajum wrote:The point is that it looks like the nightly build are more supported then release builds like the 0.4.7 or the comming 0.4.8. That's what i wonder about. Ok the linux guys can compile the game theirself, but then not having a configure file? That's a bit too much.
The configure script is made for the compilerfarm only (the one, that crosscompiles all the nightly builds) and is not needed for people, who compile for their own computer.

OpenTTD uses no autotools, hence no reason to use configure scripts

The first time the user runs make, the makefile itself will learn what OS it is on and store some parameters in Makefile.config. Usually this is what the user wants, so simply make will do. Otherwise edit Makefile.config and type "make" again.
johnobo
Engineer
Engineer
Posts: 5
Joined: 24 Jul 2006 21:24

Post by johnobo »

ok, thanks up to now for y'all help.
compilingsworks now.
but, after compiling:

Code: Select all

someshit/myDir/openttd-0.4.7 # openttd -D
-bash: openttd: command not found
*cry* why? i got now a binary file in this dir.
ok later, i need of course gnu screen, but it looks a lot
more complicated, so i'll stay connected first time to
test ottd.
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

it appears that "." is not in your path (that's generally a good idea), so you have to type

Code: Select all

./openttd -D
./ means that instead of searching your path for a file to execute, you will use the dir that you are in right now.
johnobo
Engineer
Engineer
Posts: 5
Joined: 24 Jul 2006 21:24

Post by johnobo »

edit: works.
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: No registered users and 10 guests