The following dependencies are required and can either be installed with the operating system's package manager or pip (see below):
First, clone the repository and change into the cloned folder:
git clone https://github.com/comp-rob2b/kindyngen.git
cd kindynsyn
(Optional) To avoid cluttering the operating system's Python installation it is advisable to use a virtual environment:
python3 -m venv .venv
source ./.venv/bin/activate
Now, install the synthesizer via pip (the -e
flag indicates an editable installation to avoid repeated installation steps after changes to the code). This will also install the required dependencies:
pip3 install -e .
Note: the virtual environment can be deactivated again, at the very end, via:
deactivate
The following dependencies are required for the code generator:
- Java
- Apache Ant
- StringTemplate
- STSTv4 (from Git!)
- GNU Make
For convenience, we provide a step-by-step installation guide for the latter two dependencies. Note, that STSTv4 comes with a pre-bundled version of StringTemplate. Hence, the steps for StringTemplate can be considered optional and are only relevant if one plans to use a more recent StringTemplate version.
StringTemplate can either be installed from the pre-compiled version or it can be built from source:
- Download the latest version and extract it to a directory
<st>
- Change to the directory
cd <st>
- For version 4.3.3 execute
sed "s/1.6/1.8/g" -i build.xml
- Compile using
ant
- This creates a JAR file
<jar>
(e.g.ST-4.3.4.jar
) in the<st>/dist
folder
STSTv4 must be built from the Git version (to support nested JSON arrays):
- Clone the source code:
git clone https://github.com/jsnyders/STSTv4.git
- Change into the repository:
cd STSTv4
- Build with
ant
- Copy the launch script template:
cp stst.sh.init stst.sh
- Adapt the
STST_HOME
variable in the launch script - (Optional) To use StringTemplate from above adapt the
CP
variable:sed "s#\$STST_HOME/lib/ST-4.0.8.jar#<st>/dist/<jar>#g" -i stst.sh
- Fix the launch script:
sed "s#lib/stst.jar#build/jar/stst.jar#g" -i stst.sh
- Make the launch script executable:
chmod +x stst.sh
The following dependencies are required to build and execute the generated code:
Make sure that the latter dependencies are accessible to the generated CMake script. That can be achieved via a local or system-wide installation, but also using CMake's package registry (to avoid the installation). To this end, both projects can be configured with a -DENABLE_PACKAGE_REGISTRY=On
option.