-
Download Boost 1.64
-
cd
to the Boost directory and build the system library by running./bootstrap.sh --prefix=. --with-libraries=system && ./b2 install
-
git clone --recursive https://github.com/delta/codecharacter-simulator.git
-
Install CMake (> v3.9.6)
-
Install Protobuf
-
mkdir build && cd build
-
export LD_LIBRARY_PATH=<your_install_location>/lib
-
cmake .. -DCMAKE_INSTALL_PREFIX=<your_install_location> -DBOOST_ROOT=<boost_download_location>
-
make
-
make install
-
To run the simulator,
<your_install_location>/bin/simulator
To run the unit tests, <your_install_location>/bin/test
Pass -DBUILD_PROJECT=<project_name>
to cmake to build only a specific module. Passing no_tests
as the project name builds everything but the unit tests.
The compiler image takes player code and compiles it into player1 and player2 libraries.
The runner image takes a player1 library and a player2 library, simulates a game, and dumps the game.log.
To setup these images -
-
Install Docker (preferably enable non-root usage)
-
Run
./docker_build.sh
to build the images -
docker run -v <input_source_dir>:/root/codecharacter/src/player_code/src -v <output_libs_dir>:/root/output_libs -i deltanitt/codecharacter-runner
to compiple, where<input_source_dir>
contains the fileplayer_code.cpp
. -
docker run -v <input_libs_dir>:/root/input_libs -v <output_log_dir>:/root/output_log -i deltanitt/codecharacter-runner
to run a game, where<input_libs_dir>
contains the fileslibplayer_1_code.so
andlibplayer_2_code.so
.