-
Notifications
You must be signed in to change notification settings - Fork 1
Compiling
Compiling the visualizer is pretty straight forward. Currently development is more or less restricted to Linux, but it should be possible to work on Windows or Mac OSX if you are familiar with QT4 compilation on those OSes.
Note: This guide is for Linux only, but if you figure out how to do everything on Windows or OSX update this guide!
To keep the project as easy to compile as possible, we try to keep all of our dependencies restricted to Qt-related stuff. You’ll need:
- git
- g++
- libqt4-dev
- libqt4-opengl-dev
On Ubuntu, you’ll install them like so
sudo apt-get install git g++ libqt4-dev libqt4-opengl-dev
Make sure you have followed the megaminer-core:GitGuide and you can
check out repositories from the SIG-GAME server. The visualizer has a
core that is reusable between MegaMinerAIs, and plugins for each game to
visualize. You’ll want to find some folder to work in, most commonly
/home/USER/siggame/ is where our devs like to check out their repos.
git clone [email protected]:siggame/cppVis.git
The visualizer works with any number of plugins, but some are out of date and need updating. So let’s check out MegaMinerAI 13 for this example.
git clone [email protected]:siggame/MegaMinerAI-13.git
You should now have two repos: /home/USER/siggame/visualizer/ and
/home/USER/siggame/megaminer13/ checkout out and ready to compile.
By default the Visualizer Core and the plugins do not know where each other exists, so we have to set up symbolic links to them.
The visualizer core just needs to know where the plugin (s) are. Plugins
are set up with megaminer#/plugins/ and megaminer#/visualizer/
directories. You just need to create a sym link to the
megaminer#/plugins/ directory in the visualizer core’s root directory
called plugins. So, if you have been following this guide and have the
core and megaminer13 checked out in /home/USER/siggame/ then:
cd ~/siggame/visualizer/
Now, that you are in the visualizer folder set up the sym link as follows
ln -s ../megaminer13/plugins ./plugins
The plugins need to know where Core for them to compile. They need the
interfaces and common directories to compile.
Navigate to the root directory of the plugin you checked out. If you have been following this guide then:
cd ~/megaminer13/
And make two sym links to the interfaces and common directories:
ln -s ../visualizer/common ./common
ln -s ../visualizer/interfaces ./interfaces
Inside the visualizer core repository, Simply run:
qmake or qmake-qt4
make
Once you’ve compiled the core, the next thing you’ll need are the plugins. Go to the plugin’s visualizer directory, so if you’ve been following the example in this guide go to
cd ~/megaminer13/visualizer
Once you are in your plugin’s visualizer directory compile it just as you did the core:
qmake or qmake-qt4
make
This will output the plugin binaries to ../plugins.
The plugins themselves cannot be run, but instead are loaded into the core at run-time. To run the visualizer go to the visualizer core directory and run it:
./visualizer
Additionally, you can auto load a game log as follows
./visualizer /path/to.glog
If you ever compile the visualizer the you get errors from .o or .so
files just do the following:
make clean
That should clean up all the files make makes and hopefully fix those
errors.
-
/opt/mxe/usr/i686-pc-mingw32/qt/bin/qmake -spec win32-x-g++ -
make -
the exe should be in the release folder