Compiling ToME4 (Linux)

Everything about ToME 4.x.x. No spoilers, please

Moderator: Moderator

Message
Author
madmonk
Reaper
Posts: 2257
Joined: Wed Dec 12, 2007 12:21 am
Location: New Zealand

Compiling ToME4 (Linux)

#1 Post by madmonk »

Please note this is only for Linux!

If you find that your download does not work and you have to get the source and compile it, a small set of useful things to do...

You may have to install some additional SDL stuff, but the compilation should let you know about that.

1) Get premake (from here)
2) Put it in the top level of the source directory
3) Run this command: ./premake4 --lua=jitx86 gmake
4) Run make
5) To launch ToME4 enter this: ./bin/Debug/t-engine
6) You can, if you want to be really helpful and capture the output do this: ./bin/Debug/t-engine > stdout 2>stderr. This will create two files and one will contain lots of really useful info for DG.

Enjoy!
Regards

Jon.

Canderel
Sher'Tul
Posts: 1252
Joined: Mon Nov 24, 2003 2:31 pm
Location: South Africa

Re: Compiling ToME4 (Linux)

#2 Post by Canderel »

Can windows users also somehow run the program to create both log files?

madmonk
Reaper
Posts: 2257
Joined: Wed Dec 12, 2007 12:21 am
Location: New Zealand

Re: Compiling ToME4 (Linux)

#3 Post by madmonk »

I don't have Windows, but I don't see why not.

Try it and see if you get the output in the named file (stdout!)

You would have to run from a DOS prompt or add it as a parameter to the executable.
Regards

Jon.

darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: Compiling ToME4 (Linux)

#4 Post by darkgod »

The windows verison automatically generates the logs in stdout.txt file
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

greycat
Sher'Tul
Posts: 1396
Joined: Tue May 11, 2010 11:51 pm

Re: Compiling ToME4 (Linux)

#5 Post by greycat »

Alternative compile instructions (worked for me on i386 Debian 5.0):
  1. Unpack premake source.
  2. Code: Select all

    cd premake-4.2.1/build/gmake.unix
    make
    cd ../../bin/release
    sudo cp premake4 /usr/local/bin
  3. (Optional) delete the premake source.
  4. Unpack t-engine wherever you want it to stay forever. You'll be playing the game from here, rather than installing it like a regular application.
  5. Code: Select all

    cd t-engine4-src-1.0.0beta1
    premake4 gmake
    make
  6. To run the game: bin/Debug/t-engine
If you want to log the output (and errors) but also see them on the screen, you can run the game like this:

bin/Debug/t-engine 2>&1 | tee logfile

This assumes a Bourne-family (non-csh, non-tcsh) shell, as does madmonk's version.

forkbomb
Archmage
Posts: 332
Joined: Mon Jun 04, 2007 6:32 pm

Re: Compiling ToME4 (Linux)

#6 Post by forkbomb »

I got lazy just ran this (Fedora 12):

Code: Select all

yum install SDL*devel
That'll give you pretty much all the SDL packages in the repos even though all of it isn't needed for T4. Shouldn't be too huge of a DL. I also had lua-devel installed and god knows how many other libs installed.

Any other Fedora users curious about compiling it could just run

Code: Select all

yum groupinstall "Development Tools"
That'll give you a bunch of packages that aren't strictly needed for this particular compile job (though it is a nice group to have installed) but if you have a decent sized hard drive and a quick connection it shouldn't be earth-shattering. But, you'll still need to grab premake4 (I just dumped it in /usr/bin).

For totally overkill "god mode" also run...

Code: Select all

yum groupinstall "Development Libraries"
...to get the kitchen sink of source stuff in the repositories, but that will be a relatively large download (and continued large downloads to keep them up to date as upgrades hit the repositories).

Built clean for me.

Nerdanel
Sher'Tul
Posts: 1461
Joined: Mon Jul 07, 2003 5:22 pm
Location: Finland

Re: Compiling ToME4 (Linux)

#7 Post by Nerdanel »

Gentoo doesn't have premake in portage. Annoying...

Then it turns out that premake is majorly complicated to build by hand. Double annoying... It was easier the old way. Also, since premake has to be bootstrapped by itself, I'm (doubtless needlessly) reminded of the famous historical exploit in which a compiler was built to add a backdoor to things it compiled and add that feature to the compilers it compiled, and then the backdoor code was removed from the source but added indetectably back when the source was compiled with the version of itself with the backdoor in. I'm just feeling a little paranoid...

Anyway, since I'm supposed to be writing an article on my work in the ToME community, upon reflection I feel it's all right for me to check up the new beta so that I can write about it in an informed fashion.
Zothiqband -- still an Angband variant.

darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: Compiling ToME4 (Linux)

#8 Post by darkgod »

;)

The binaries provided by premake4 worked for me on all platforms I tested them.

And trust me it is NOT easier to maintain 10 separate makefiles ;)
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Nerdanel
Sher'Tul
Posts: 1461
Joined: Mon Jul 07, 2003 5:22 pm
Location: Finland

Re: Compiling ToME4 (Linux)

#9 Post by Nerdanel »

Once you get the file structure stabilized, you might to want to switch to the old style savefiles. That way everyone else in the world who needs to compile to play ToME 4 doesn't have to jump through multiple hoops.
Zothiqband -- still an Angband variant.

greycat
Sher'Tul
Posts: 1396
Joined: Tue May 11, 2010 11:51 pm

Re: Compiling ToME4 (Linux)

#10 Post by greycat »

Nerdanel is referring to Ken Thompson's infamous C compiler hack. (It's difficult to find an authoritative source for this, so I just picked one that looks reasonably concise.)

sindikat
Low Yeek
Posts: 8
Joined: Fri Apr 01, 2011 2:10 pm

Re: Compiling ToME4 (Linux)

#11 Post by sindikat »

Hi all! I did everything as said in http://te4.org/wiki/howtocompile, but installed premake from debian 6.0 official repositories. Now when i do "premake gmake" in t-engine source folder, it says:

Code: Select all

** premake.lua: build/options.lua:23: attempt to call global 'newoption' (a nil value)
** Script failed to run, ending.
What should i do?

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: Compiling ToME4 (Linux)

#12 Post by tiger_eye »

sindikat wrote:What should i do?
Install premake4 from here:

http://industriousone.com/premake

and run

Code: Select all

premake4 gmake
I think the official Debian repositories still only have premake version 3.7, and ToME needs version 4.

sindikat
Low Yeek
Posts: 8
Joined: Fri Apr 01, 2011 2:10 pm

Re: Compiling ToME4 (Linux)

#13 Post by sindikat »

SOLVED
:)

wobbly
Archmage
Posts: 400
Joined: Tue Jul 03, 2012 8:35 am

Re: Compiling ToME4 (Linux)

#14 Post by wobbly »

greycat wrote:Alternative compile instructions (worked for me on i386 Debian 5.0):
  1. Unpack premake source.
  2. Code: Select all

    cd premake-4.2.1/build/gmake.unix
    make
    cd ../../bin/release
    sudo cp premake4 /usr/local/bin
  3. (Optional) delete the premake source.
  4. Unpack t-engine wherever you want it to stay forever. You'll be playing the game from here, rather than installing it like a regular application.
  5. Code: Select all

    cd t-engine4-src-1.0.0beta1
    premake4 gmake
    make
  6. To run the game: bin/Debug/t-engine
If you want to log the output (and errors) but also see them on the screen, you can run the game like this:

bin/Debug/t-engine 2>&1 | tee logfile

This assumes a Bourne-family (non-csh, non-tcsh) shell, as does madmonk's version.
I get this (same with madmonks instructions) when running make (on Fedora 17 - 32 bit with SVN source code):

==== Building physfs (debug) ====
physfs.c
../src/physfs/physfs.c:74:5: warning: initialization from incompatible pointer type [enabled by default]
../src/physfs/physfs.c:74:5: warning: (near initialization for ‘supported_types[0]’) [enabled by default]
physfs_unicode.c
physfs_byteorder.c
physfsrwops.c
In file included from ../src/physfs/physfsrwops.h:27:0,
from ../src/physfs/physfsrwops.c:24:
../src/tSDL.h:7:17: fatal error: SDL.h: No such file or directory
compilation terminated.
make[1]: *** [../obj/Debug/physfs/physfsrwops.o] Error 1
make: *** [physfs] Error 2

Suslik
Spiderkin
Posts: 481
Joined: Wed Aug 22, 2012 4:41 pm

Re: Compiling ToME4 (Linux)

#15 Post by Suslik »

apparently compiler cant find SDL. check if it's present and accessible.

Post Reply