Skip to content

Instantly share code, notes, and snippets.

@stevehenderson
Last active September 11, 2022 20:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevehenderson/102d3299cb82056ca5e9ca2961a1c24b to your computer and use it in GitHub Desktop.
Save stevehenderson/102d3299cb82056ca5e9ca2961a1c24b to your computer and use it in GitHub Desktop.
Installing Harmony

So I'm playing around with Harmony @ cs.cornell.edu.

Install steps (Ubuntu 20) [Should work on WSL]

Install Prequisites

You need to have build-essential, clang, python3 + dev headers, and graphviz

I also always install anything python related in its own virtual environments, so I added the python3-venv package

sudo apt update
sudo apt install build-essential python python3-dev python3-venv graphviz 
sudo apt install clang

Create and source a virtual env

mkdir ~/some-project-folder
cd ~/some-project-folder
python3 -m venv ve-harmony
source ve-harmony/bin/activate
pip install --upgrade pip

Install Harmony:

pip install --upgrade harmony-model-checker

If everything goes right you should see:

.
.
.
Using legacy 'setup.py install' for antlr4-python3-runtime, since package 'wheel' is not installed.
Building wheels for collected packages: harmony-model-checker
  Building wheel for harmony-model-checker (pyproject.toml) ... done
  Created wheel for harmony-model-checker: filename=harmony_model_checker-1.2.2400-cp38-cp38-linux_x86_64.whl size=397517 sha256=d0e3c3fc71a4f50c00f21b6e8bde56e804c88ddbaf3f18569956631a0aa8607a
  Stored in directory: /home/henderso/.cache/pip/wheels/8f/52/37/3d964bdf0d5ad23aaf74a8c77076518685daf52f462340000b
Successfully built harmony-model-checker
Installing collected packages: antlr4-python3-runtime, urllib3, pyparsing, networkx, idna, charset-normalizer, certifi, antlr-denter, requests, pydot, automata-lib, harmony-model-checker
  Running setup.py install for antlr4-python3-runtime ... done
Successfully installed antlr-denter-1.3.1 antlr4-python3-runtime-4.9.3 automata-lib-6.0.2 certifi-2022.6.15.1 charset-normalizer-2.1.1 harmony-model-checker-1.2.2400 idna-3.3 networkx-2.8.6 pydot-1.4.2 pyparsing-3.0.9 requests-2.28.1 urllib3-1.26.12

Check help and version

harmony -h
harmony -v

Make a quick copy of the python requirements:

pip freeze > requirements.txt

Run some models

wget https://raw.githubusercontent.com/harmonylang/harmony/master/code/Peterson.hny

Go:

harmony Peterson.hny
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment