Compiling ToME4 (Linux)
Moderator: Moderator
Compiling ToME4 (Linux)
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!
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.
Jon.
Re: Compiling ToME4 (Linux)
Can windows users also somehow run the program to create both log files?
Re: Compiling ToME4 (Linux)
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.
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.
Jon.
Re: Compiling ToME4 (Linux)
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
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning

Re: Compiling ToME4 (Linux)
Alternative compile instructions (worked for me on i386 Debian 5.0):
bin/Debug/t-engine 2>&1 | tee logfile
This assumes a Bourne-family (non-csh, non-tcsh) shell, as does madmonk's version.
- Unpack premake source.
Code: Select all
cd premake-4.2.1/build/gmake.unix make cd ../../bin/release sudo cp premake4 /usr/local/bin
- (Optional) delete the premake source.
- 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.
Code: Select all
cd t-engine4-src-1.0.0beta1 premake4 gmake make
- To run the game: bin/Debug/t-engine
bin/Debug/t-engine 2>&1 | tee logfile
This assumes a Bourne-family (non-csh, non-tcsh) shell, as does madmonk's version.
Re: Compiling ToME4 (Linux)
I got lazy just ran this (Fedora 12):
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 runThat'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......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.
Code: Select all
yum install SDL*devel
Any other Fedora users curious about compiling it could just run
Code: Select all
yum groupinstall "Development Tools"
For totally overkill "god mode" also run...
Code: Select all
yum groupinstall "Development Libraries"
Built clean for me.
Re: Compiling ToME4 (Linux)
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.
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.
Re: Compiling ToME4 (Linux)

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
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning

Re: Compiling ToME4 (Linux)
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.
Re: Compiling ToME4 (Linux)
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.)
Re: Compiling ToME4 (Linux)
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:
What should i do?
Code: Select all
** premake.lua: build/options.lua:23: attempt to call global 'newoption' (a nil value)
** Script failed to run, ending.
Re: Compiling ToME4 (Linux)
Install premake4 from here:sindikat wrote:What should i do?
http://industriousone.com/premake
and run
Code: Select all
premake4 gmake
Re: Compiling ToME4 (Linux)
I get this (same with madmonks instructions) when running make (on Fedora 17 - 32 bit with SVN source code):greycat wrote:Alternative compile instructions (worked for me on i386 Debian 5.0):
If you want to log the output (and errors) but also see them on the screen, you can run the game like this:
- Unpack premake source.
Code: Select all
cd premake-4.2.1/build/gmake.unix make cd ../../bin/release sudo cp premake4 /usr/local/bin
- (Optional) delete the premake source.
- 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.
Code: Select all
cd t-engine4-src-1.0.0beta1 premake4 gmake make
- To run the game: bin/Debug/t-engine
bin/Debug/t-engine 2>&1 | tee logfile
This assumes a Bourne-family (non-csh, non-tcsh) shell, as does madmonk's version.
==== 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
Re: Compiling ToME4 (Linux)
apparently compiler cant find SDL. check if it's present and accessible.