Supports precompiling binaries for usage on the scrimmage server.
Usage guide:
-
Make sure that you have
docker
installed on your machine for command line usage https://docs.docker.com/install/Docker on Windows Subsystem for Linux (WSL) requires a special installation (Google is your friend).
Also make sure that you have
make
installed on your command line environment:$ make --version
should not fail.
-
Clone this repository into a convenient working directory.
-
Create a subdirectory named
scrimmage
which contains a working engine game you would like to use to precompile your code.scrimmage
should containengine.py
andconfig.py
, as well as pokerbot(s) to play a game against each other (or the same pokerbot against itself, described inconfig.py
). -
Run
$ make prebuild
in this directory. The first run will be very slow in order to download all the dependencies, but subsequent runs will cache the results to speed it up. Alternatively, you may delete dependencies you do not need to speed up the first run.
The above command will create a directory called
built
which contains the prebuilt pokerbot.Run
$ make clean
in this directory to prep the directory for another pokerbot precompilation.
-
Change
commands.json
in thebuilt
directory to have no build command:"build": [],
-
Zip your pokerbot and upload it to the scrimmage server.
Note: There is a bug within python's unzip utility: python/cpython#17790
As a workaround, you should have your build command be a python program which sets the correct file permissions for your compiled program.
commands.json
:
{
"build": ["python3.7", "permissions.py"],
"run": ["./cppbot"]
}
permissions.py
:
import os
os.system("chmod +x ./cppbot")