Leviathan  0.8.0.0
Leviathan game engine
Compiling Leviathan
Note
Before the latest setup script the prerequisites section described manual setup for all required libraries. But now that has been replaced with the automatic setup script. If you want to read the old version checkout an older commit of Leviathan, bba062c07a952c170a16c5f9e2608896d3d09821 for example.

Make sure you have installed Prerequisites first.

Cloning Leviathan

If you haven't used git to clone the Leviathan repository yet. Run this command to clone Leviathan to a new folder:

git clone https://github.com/hhyyrylainen/Leviathan.git
cd Leviathan
git submodule init

Windows tip: shift right-click in a folder and select "Open command prompt here" or "Open powershell here" to open a cmd window to the folder where you want to build Leviathan. If building fails you should try a path without a space in it.

Running Setup

Now move to the Leviathan folder and run the setup script:

cd Leviathan
ruby Setup.rb

If the script runs correctly you can move to the next section. Otherwise see Troubleshooting.

Done

You can run tests on linux by running make check -j numberofcores in the build folder. And on Windows by running the LeviathanTest project in visual studio debugger. Note: when you open build/Leviathan.sln make sure you select RelWithDebInfo as the active configuration as the debug builds are known to be broken very often.

For a tutorial on what to do next see Running the samples. Now, if the samples runs correctly, you are all set to start your own project.

See also
Tutorials

Troubleshooting

Here are some common fixes for issues you might have with the setup script.

If none of these work please open an issue here: Leviathan repository.

Submodules out of date

If you have pulled updates or changed branches your downloaded submodules might be out of date. To fix this run:

cd Leviathan
git submodule update

Missing command `pr`

If you get an error about pr being an unkown command or missing try installing Cygwin64 'coreutils' package. If that doesn't work either install the default set of cygwin packages.

Incorrect ffmpeg makefile line endings

If you get an error "missing separator. Stop" in common.mak when trying to build ffmpeg on windows, this is probably caused by line endings being incorrect.

To fix these change to the FFMPEG FOLDER and run these commands to fix the line endings:

git config core.autocrlf false

Delete all files except ".git" folder. And then:

git checkout .

Warning: this will discard all changes in the git repo this is ran in, so make sure you are in the right folder.

It is also possible to globally change the autocrlf setting but that isn't recommended to avoid accidentally committing windows line endings.

Issues compiling ffmpeg

First, make sure that you are using the standard Windows command prompt. Using a MinGW shell or equivalent is known to cause issues. You may need to delete the ffmpeg folder after this to make sure that there are no cached values or other things messing things up.

Then make sure that nothing is overriding the programs in cygwin. You should start by making sure cygwin is the first thing in PATH. And then that the specific programs are from cygwin. This can be done by renaming the executables in cygwin/bin, for example renaming awk.exe or make.exe to testawk.exe and then verifying that the setup script starts complaining about missing that specific program. If it doesn't start complaining then this confirms that something is messing with your PATH and overriding the cygwin tools. Either delete the offending things (MSYS, MinGW) or remove them from PATH (and make sure once again that you are using plain cmd.exe to run the setup and not some other shell).

ffmpeg build is still failing

For other ffmpeg building issues see these guides: windows guide, all guides

LeviathanTest or sample games don't find files

Make sure you are running them in the correct directory (build/bin). On Windows check the debugging startup directory in Visual Studio project settings.

Manually Compiling

This is very much not recommended as the dependencies need to be built with complex options and additional dependencies. Then the resulting files need to be installed into Leviathan/build/ThirdParty. Then running the main cmake configure should succeed and you can try building. You will still need ruby for generating some C++ files so you can't skip the ruby dependency even with trying to build manually.

For a good starting point see the note at the top of this page about older setup instructions.

The old instructions will most likely not work anymore but provide a good starting point for building some of the Leviathan dependencies.