Skip to content

Supports precompiling binaries for usage on the scrimmage server.

Notifications You must be signed in to change notification settings

mitpokerbots/precompile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

precompile

Supports precompiling binaries for usage on the scrimmage server.

Usage guide:

  1. 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.

  2. Clone this repository into a convenient working directory.

  3. Create a subdirectory named scrimmage which contains a working engine game you would like to use to precompile your code. scrimmage should contain engine.py and config.py, as well as pokerbot(s) to play a game against each other (or the same pokerbot against itself, described in config.py).

  4. 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.

  5. Change commands.json in the built directory to have no build command:

    "build": [],

  6. 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")

About

Supports precompiling binaries for usage on the scrimmage server.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published