| copyright | Copyright (c) Runtime Verification, Inc. All Rights Reserved. |
|---|
The preferred way to install K is the kup tool, which is based on Nix.
No knowledge of Nix is required to use kup.
Install kup and K by running the following:
bash <(curl https://kframework.org/install)
kup install kList available versions with:
kup list kIf kup indicates that there's a newer version, you can update by simply running:
kup install kTo install a specific version, run:
kup install k --version v6.3.11Note that the versions marked as ✅ are cached in Runtime Verification's Nix binary cache and thus are the fastest to install.
We currently strive to provide packages for the following platforms:
- Ubuntu Jammy Jellyfish (22.04)
- macOS Ventura (13) via Homebrew
- Docker Images
-
We do not currently support running K natively on Windows. To use K on Windows 10, you are encouraged to install the Windows Subsystem for Linux (version 2) and follow the instructions for installing Ubuntu Jammy.
If you have already installed WSL, before proceeding, you will need to enter the WSL environment. You can do this by:
- opening up the command prompt (accessible by searching
cmdorcommand promptfrom the start menu); - using the
wsl.execommand to access the WSL environment.
- opening up the command prompt (accessible by searching
-
To use K in other non-linux environments (e.g. Windows 8 or earlier), you will need to use a virtual machine (VM) software. We assume you have:
- Created a virtual machine
- Installed a Linux distribution (e.g. Ubuntu Jammy Jellyfish) on your virtual machine
Consult your virtual machine software if you need help with the above steps. We recommend the free VirtualBox virtual machine software.
Before proceeding, follow the virtual machine softare UI to start your Linux virtual machine and enter the command line environment.
-
WSL and virtual machine users should be aware that, if you use your web browser to download the package, you will need to make it accessible to the command line environment. For this reason, we recommend downloading the package from the command line directly using a tool like
wget. For example, you could copy the package download URL and then type:wget <package-download-url>where
<package-download-url>is replaced by the URL you just copied. -
K depends on version 4.8.15 of Z3, which may not be supplied by package managers. If this is the case, it should be built and installed from source following the instructions in the Z3 repository. Other versions (older and newer) are not supported by K, and may lead to incorrect behaviour or performance issues.
Download the appropriate package from the GitHub, via the
Releases page.
Releases are generated as often as possible from master build.
For version X.Y.Z, distribution DISTRO, and package ID ID, the following
instructions tell you how to install on each system. Note that this typically
requires about ~1.4GB of dependencies and will take some time.
- On Linux systems, K will typically be installed under
/usr. - On macOS/brew, K will typically be installed under
/usr/local.
sudo apt install ./kframework_amd64_ubuntu_jammy.debHomebrew (or just brew) is a third-party package manager for MacOS. If you have not installed brew, you must do so before installing the K Framework brew package.
With brew installed, do the following to install the K Framework brew package
(with build number BN):
brew install kframework--X.Y.Z.ID.bottle.BN.tar.gz -vTo directly install the latest K Framework brew package without needing to download it separately, do the following:
brew install runtimeverification/k/kframeworkOr, to streamline future K Framework upgrades, you can tap the K Framework
package repository. This lets future installations/upgrades/etc... use the
unprefixed package name.
brew tap runtimeverification/k
brew install kframeworkDocker images with K pre-installed are available at the runtimeverification/kframework-k Docker Hub repository.
Each release at COMMIT_ID has an image associated with it at
runtimeverificationinc/kframework-k:ubuntu-jammy-COMMIT_ID.
To run the image directly:
docker run -it runtimeverificationinc/kframework-k:ubuntu-jammy-COMMIT_IDand to make a Docker Image based on it, use the following line in your
Dockerfile:
FROM runtimeverificationinc/kframework-k:ubuntu-jammy-COMMIT_IDWe also create Ubuntu 22.04 images with the ubuntu-jammy-COMMIT_ID tags.
The easiest way to test the K package is to copy a K tutorial language and check if you can compile and run an included example.
-
Start by cloning the K tutorial from the K PL Tutorial. This command typically will be like:
$ git clone https://www.github.com/runtimeverification/pl-tutorial
-
Now you can try to run some programs:
$ cd pl-tutorial/2_languages/1_simple/1_untyped $ make kompile $ krun tests/diverse/factorial.simple