Installation

Installation #

The below instructions are for first time users only. Existing users can upgrade using:

cpt upgrade --mode s

GitHub Release #

Download the tarball corresponding to your system from the latest release page. Extract the executable from the archive and follow the instructions given below, according to your OS.

Linux/MacOS

Zsh users may need to use .zshrc instead of .bashrc.

Move the executable to the following directory,

/home/<username>/.local/bin

where <username> is your system username.

To add the above directory to the system PATH, follow this.

Move the executable to the following directory,

/usr/local/bin

You may require sudo access to do this.

Move the executable to the following directory,

C:\Program Files\

To add the above directory to the system PATH, follow this.

Source Build #

To build from source, execute the following commands.

git clone https://github.com/cp-tools/cpt.git
cd cpt/
go install -ldflags "-s -w"

Ensure that the $GOBIN directory is present in the system PATH.

Verification #

You may need to re-login to your desktop session, for the command to be picked up from the system PATH.

A successful installation would output text similar to

cpt version vX.Y.Z

on running the command cpt --version.

Checkers #

Checkers are used by the test module to validate a solution output against the expected output. This step can be omitted, if you instead wish to use your set of custom checkers.

A set of default checkers are available at cp-tools/cpt-checker. To install/upgrade the checkers:

cpt upgrade --mode c