Obtaining and Compiling Exodus Source

The compilation process for Exodus has been designed to be as simple as possible. There are however a few steps involved in getting up and running the first time, especially if you don't currently have the required tools installed. The following article will walk you through the steps for obtaining the source code for Exodus, and compiling it on your own computer.

Please note that Windows is the only supported platform for compilation. Feel free to experiment with other platforms if you wish, but no support is currently provided for this.

Obtaining the Exodus Source Code

The sourcecode for Exodus is hosted Bitbucket at https://bitbucket.org/exodusemulator/exodus. You have two different options for downloading it to your computer: the quick and dirty way that'll get you the code in one step, but without any of the code revision history, and make it hard to pull in updates or contribute changes, or the slightly longer but proper way. I'd strongly recommend the latter. If you really just want the latest files with no fuss, the quick and dirty way is to grab the latest zip snapshot of the current development mainline from the downloads page of the Bitbucket repo.

As for the proper way, you need to have a Mercurial client installed, and clone the repository from Bitbucket. The steps below walk you through installing my recommended Mercurial client for Windows, and cloning the Exodus repository. If you already have a Mercurial client installed, and you're familiar with its use, you can perform this step in the way you're most comfortable with. Here's the step by step guide:

In the "Destination" field, browse to the folder where you want the source files to be placed. You'll probably want to make a new folder and select that (IE, "Exodus").

Press the "Clone" button to download the repository

With the source repository now properly cloned, you'll have access to the revision history for files in the repository, and you can pull in new changes to the repository as they are added. For information on how to do this, refer to the TortoiseHG Documentation.

Setting Up the Development Environment

Exodus currently uses Visual Studio 2013 as its development environment. Theoretically other IDE's could be used, as long as support exists for compiling MSBuild projects, but the only officially supported IDE is Visual Studio 2013. With the recently released Visual Studio 2013 Community Edition (note: This is different from the previous Visual Studio 2013 Express Edition), you get effectively the same IDE as Visual Studio 2013 Professional, but it's free for private and open-source development. If you don't have a license for a commercial version of Visual Studio 2013, I recommend using the Community Edition.

Select "Source Control -> Plug-in Selection" from the tree control on the panel

Choose "VisualHG" from the combobox as the current source control plugin, and press ok.

Obtaining Third Party Libraries

There are a few third party libraries that are currently required in order to build the Exodus repository. In order to obtain the required third party libraries, navigate to the "Third" directory in your local copy of the Exodus repository, and download the following files into the subdirectories that exist in that folder.

For each compressed file you've downloaded, you now need to extract each one directly into the folder it's in. IE, if the archive name was "SomeArchive.zip", and it contained a compressed folder called "SomeFolder", after you extract, you should have SomeFolder sitting in the same directory as SomeArchive.zip. (Note: Catch and htmlhelp are exceptions to this rule. Catch must appear in a subdirectory called "Catch", and htmlhelp must appear in a subdirectory called "htmlhelp".). Ensure that you fully extract ".tar.gz" files. You need to extract the contents of the .tar file within the .gz file too.

Compiling Exodus

With your development environment setup, you're ready to compile Exodus. This can be done on the command line with MSBuild, but the easiest way is within Visual Studio. To compile Exodus, do the following.

Open "ThirdPartyLibraries.sln" from the root of the Exodus repository in Visual Studio

Select "Build -> Batch Build" from the main menu

Click "Select All", then "Build". This will build all the different platform and build configuration variations of the third libraries, which makes things simpler.

Open "Exodus.sln" from the root of the Exodus repository in Visual Studio

Select "Build -> Configuration Manager" from the main menu

Pick the configuration and platform you want to build. Usually that'll be the "Release" configuration and the "x64" platform

Note that you can compile individual plugins under the "Debug" configuration and leave everything else as a release build. This is usually the way you'll want to work if you're developing a plugin. A full debug build runs very slowly, so you would generally compile just the individual components you want as debug, such as one or two plugins, and possibly the system itself, while leaving unrelated plugins as release builds.

Optional: Running Profile Guided Optimization

Official release builds of Exodus are given a speed boost through the use of Profile Guided Optimization. This technique involves instrumenting the code during compilation, and manually running the program with that instrumentation through a series of tasks, to gather information about what areas of the code are actually bottlenecks and runtime, then feeding that information back into the linker so that it can do a smarter optimization step. This has shown to increase average performance in Exodus by a modest 15% over a standard release build. If you do a normal build of Exodus on your local machine however, this optimization will not have been applied, so you can expect to see around a 15% performance degradation compared to the official release builds. If you want to optimize your own builds, you can do the following:

Switch to the "Release - PGORebuildOptimized" solution configuration

Do a full clean and build of the solution

Switch to the "Release - PGOInstrument" solution configuration

For each project you want to instrument, right click on that project in the solution explorer and select "Build".

Right click on the "Exodus" project and select "Profile Guided Optimization -> Run Instrumented/Optimized Application". If the compiler asks you if you want to rebuild out of date projects, say no.

Run the program through a series of test cases. These should be designed to stress-test the particular projects you're instrumenting.

Close Exodus when your test cases are complete

Switch to the "Release - PGOOptimize" solution configuration

For each project you instrumented, right click on that project and select "Project Only -> Link Only <ProjectName>".

If any projects fail with a message about timestamps not matching, switch to the "Release - PGOUpdate" solution configuration and attempt the link step on them again, and they should succeed.

As you can see, this is a fairly manual process, and takes some time to run through. I wouldn't recommend trying to instrument everything at once, because the performance will be heavily degraded and the performance profile of the emulation cores will change due to bottlenecks in the system and other cores, which will affect the usefulness of the profile data. The selection of the actual test runs is important too. If you're instrumenting a graphics core, you need to run a program which uses the features of that core, so that the various code paths can be explored and profiled at runtime. You should ideally only instrument individual assemblies, or small batches of assemblies, together in the same run. This allows you to make shorter, more focused test runs, and produces a better performance profile.

Optional: Building SDK Documentation

The Exodus SDK support documentation is build from XML documentation files within the repository itself. To build it yourself locally, do the following:

Open "ExodusDocumentation.sln" from the root of the Exodus repository in Visual Studio

Select "Build -> Build Solution" to create the documentation

The created documentation files will be in the "Documentation" folder in the root of the Exodus repository

Optional: Building Unit Tests

To compile the unit test projects for Exodus (only one right now), do the following:

Open "ExodusTests.sln" from the root of the Exodus repository in Visual Studio

Screenshots

If you wish to make a donation to show your appreciation for this project, you can do so here. Your donation may go towards the hosting costs of the website, or equipment or reference hardware to assist in the development of Exodus. It may also go towards a bunch of flowers for my beautiful wife, to say thanks for your support and patience all those nights I stayed up late working on this project.