-
Notifications
You must be signed in to change notification settings - Fork 6
HowToBuild.wiki
SimulationCraft is a C++ project based on C++11 / GNU compiler GCC 4.6 and uses some Boost ( http://www.boost.org ) libraries.
The graphical user interface is based on Qt and requires at least version 4.7.4 libraries, version 4.8.0 is recommended.
While we try to make it as easy for new and inexperienced developers to join the project, we choose to have such "steep" requirements to allow us to use the more sophisticated methods provided by C++11 and the boost library. Since coding time is always sparse, this enables us to use a very rich tool set without having to re-do all the work on basic mechanics.
We hope you manage to at least build the command line to begin with. If there are any problems, just contact us and we'll gladly help you.
- Downloading via GIT
- If you don't already have a GIT client, go to http://git-scm.com/ and get git. (See what I did there?)
- Create a new parent folder with a name of your choice
- Use the 'git clone' command found on the checkout page. For example,
git clone https://code.google.com/p/simulationcraft-swtor/will create a new subfolder/simulationcraft-swtorwith the sources from the currentmasterbranch in the repository.
- If you don't already have a GIT client, go to http://git-scm.com/ and get git. (See what I did there?)
- Building the command line interface (CLI) is very easy on all platforms
- Building the graphical user interface (GUI) is considerably harder
- The GUI was built using Qt
- Building the GUI requires that the Qt SDK or Framework be downloaded and installed
- Qt DLLs are used at runtime, so a subset must be copied into the build area
- Refer to platform-specific directions below
You will need the MinGW compiler to build either the command line or graphical interfaces.
- Use these instructions to download the MinGW compiler (a distribution of GCC that compiles native Windows executables).
- I recommend using the
mingw-get-instgraphical user interface installer. Add the C++ Compiler to the install list. - After installed, you need to update your
PATHenvironment variable- Right-Click My Computer and choose Properties
- Click Advanced tab
- Click Environment Variables button
- Scroll System Variables and select Path
- Click Edit button
- Add the directory where your MinGW binaries are at the end of the
PATH, separated by;. Typically;c:\mingw\bin.
- I recommend using the
- Open command prompt window and run
cd your_simc_source_dir\enginemingw32-make
- Creates executable
your_simc_source_dir\engine\simc.exe
- Install QtSDK.
- The SDK includes the QtCreator IDE, and optionally a ton of modules for writing applications on environments ranging from desktops to smart phones.
- You really only need the IDE and Desktop QT for MinGW (4.8.0 as of this writing). The docs for QtCreator, the SDK, and Qt itself will come in handy of you intend to work on the actual GUI.
- Edit
your_simc_source_dir/mingw_qt_dll_setup.bat- Change the
qt_dir=andmingw_dir=lines to point at the folders where you installed the QtSDK and MinGW respectively. - If you install in default locations, no editing should be necessary.
- Change the
- Run
your_simc_source_dir/mingw_qt_dll_setup.batto copy DLLs from Qt and MinGW into your build area - Open the
simcqt.proproject file with QTCreator; it will prompt you to setup Debug & Release build configurations:- Be sure to specify the external MinGW toolchain for building, and not the older 4.4 version of MinGW that you may have installed as part of the SDK.
- Build All (From the build menu, click the hammer icon in the lower left, or hit Control-B)
- Creates executable
your_simc_source_dir\release\SimulationCraft.exeoryour_simc_source_dir\debug\SimulationCraft.exedepending on whether you have the Release or Debug build selected. - Clicking the computer icon in the lower left (Control-T) pops up the target selector that lets you pick Debug or Release config.
- You can run from inside IDE with the green triangle icon (Control-R). If you want to be able to run your
SimulationCraft.exefrom outside the IDE, you need to move it from thedebugorreleasefolder into the top-level source folder where you copied all of those DLLs many steps ago.
- Creates executable
Your Linux distro should have come with git and g++ by default. Check that your g++ is at least version 4.6 with g++ --version at the command line. If you do not have git or g++, or your g++ is an older version, use your distribution's software update mechanism to download and install the most current versions.
cd your_simc_source_dir/enginemake OS=UNIX- This builds an optimized executable named
simcinyour_simc_source_dir/engine. - If and when you get tired of remembering to add
OS=UNIXto the make command line, putOS=UNIXin the fileyour_simc_source_dir/build.conf.
- Download and install the Qt SDK for Linux at Qt
- Start QTCreator (
qtcreator) - Open the project file
your_simc_source_dir/simcqt.pro - Choose a target of Desktop
- Build and run
Warning: OS X build instructions may be outdated since we currently do not have an active Mac developer.
- same as for Linux above.
- Get and install Sparkle
- Install Sparkle.framework to
/Library/Frameworks
- Install Sparkle.framework to
- Get and install Qt
- Open
your_simc_source_dir/simc.xcodeproj - Build
libsimctarget - Build "Generate Qt Project" target
- Build
simctarget - You should now have
-
your_simc_source_dir/simc, the command line simulator, and -
your_simc_source_dir/simcqt.app, the simulator GUI.
-
- Compiler Options:
- Add -j n where n is the number of threads used for compiling
- The GCC flag -dM will stop the compiler after the preprocessing pass and make it dump all #defines
Mingw-w64 is a MinGW version intended to build x64 targets. A 32bit version of SimC is usually more than enough and there is no significant gain in a 64bit version, but there might be circumstances where you need to allocate more memory than the amount allowed with a 32bit executable. For example if you want to simulate many players simultaneously and collect more than the default amount of data ( statistics_level > 1 ).
- I recommend getting rubenvb's personal build, it offers gcc 4.7.0 and everything is configured.
- Unzip it to your desired target, eg. C:\mingw64\ so that you have a folder structure C:\mingw64\bin
- If necessary add C:\mingw64\bin to your PATH variable and remove C:\mingw\bin
Here I want to share some information about the endeavour of trying to build the QT libraries from source ( for example the 4.8.0 libraries with mingw-w64 ).
- I recommend a 64bit version of mingw-w64 since there are some memory-intensive linkings necessary when building the qt gui. There are options to reduce that by reducing certain optimizations, but I can't help you there.
- Get the QT 4.8.0 libraries from the QT download page.
- Get Perl ( for example ActiveState Perl )
- Patch this bug: patch for javascript core
- warning: webkit cannot be built with -static linking, so don't even try it. See here
- Go the the QT libraries source folder and run 'configure -platform win32-g++ -release -nomake demos -nomake examples'. There are no demos and examples for 4.8.0, so those options are necessary.
- after the configuration process finished correctly, run 'set MAKE_COMMAND=mingw32-make -jn where n is the number of threads and then run 'mingw32-make'. This is necessary so that sub-makefiles get option as well and spawn more than 1 thread.
notes:
how to: http://binshi.typepad.com/blog/2012/01/compile-qt-480-with-mingw.html