Compiling and building EnhSim

EnhSim is programmed in C++ and it can be built to other platforms, as well as Windows. By default, EnhSim package includes Windows executables, which are ready to run. These ready built executables need SSE2 support from CPU. If you need to build EnhSim yourself, this page might be of some use to you.

Compile flags


SFMT will make use of SSE2 instructions if defined.


SFMT will make use of AltiVec instructions if defined.


EnhSim executable will output combatlog.


Disable multithreading. This way you can avoid using ZThreads.

3rd party libraries

EnhSim uses ZThreads, SFMT and Boost Pool libraries. You need to build ZThreads and link it with EnhSim to succesfully build EnhSim. SFMT and Boost Pool are include only libraries. SFMT is already included in the EnhSim source, so you need to download Boost library and setup your compiler to find it.






This method uses the NOTHREADS compile flag, so you will get the single threaded version. If you know how to build with ZThreads, go ahead and be sure to contact me with the information :). This guide is courtesy of Malan.

  • Invoke xCode (install from OS X cds under Developer Tools if you don't have it).
  • Start a new project(Command Line Utility -> C++ Tool) (the name of the project will by default be the name of the binary that you have to run, so be concise). Immediately delete the main.cpp file when the project appears.
  • Right click in the left panel of xCode on the name of the project and choose Add -> Existing Files, then browse to the source code for EnhSim and choose all the files, including the SFMT subdirectory.
  • In the list of source files in xCode, un-check the box in the right-most column next to the test.c and SFMT.c files so that these are not included in the build.
  • Edit the file enhsim.h (double click it) and add the text "#define NOTHREADS", then save the file. (CMD-S).
  • In finder, unpack and then copy Boost (Should appear as something like 'boost_1_37_0' when unpacked) directly to the project path that you created in xCode. Do not do this *in* xCode, do it in Finder.
  • In the main menu choose Project -> Edit Project Settings then the Build tab. Scroll down till you see the header that says "Search Paths". Double click the entry for "Header Search Paths", and in the dialog use the + button to add a new path. You must ensure that the 'Recursive' checkbox is cleared or the build will fail. Type in the relative path to the Boost folder you copied, it should look like: "boost_1_37_0" and then close the menu.
  • In xCode choose Build. When its complete your binary executable for the sim will appear in [path to project]/[project name]/build/Release. You can copy the binary file to anywhere else in the system so that you can run it in Terminal with your config file.

Add a New Comment
or Sign in as Wikidot user
(will not be published)
- +
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License