Build and setup
Prerequisites
The recommended development is a native Ubuntu 24.04 machine or WSL 2 with an Ubuntu 24.04 image.
Download the code
Ensure you have both
gitandgit-lfspre-installed on your machine:$ git lfs --version
Clone the root repository:
$ git clone https://github.com/synaptics-torq/torq-compiler.git
Go to the directory that was cloned:
$ cd torq-compiler
Clone the required submodules (some submodules are not necessary for the build):
$ scripts/checkout_submodules.sh
Install required system packages
If you are using an Ubunutu 24.04 environment you can install system packages required for the build with the following command:
$ scripts/install_dependencies.sh
If you are using a different environment you can use a Docker image:
Log-in to the GitHub docker registry
$ docker login ghcr.io
Use your Github username and a Github personal access token as password. Please refer to Github documentation for the creation and usage of a personal access token.
Start a development container with access to the current directory and your ssh configuration:
Note: To build and mount volumes correctly, Docker needs access to the entire
torq-compilerproject directory. Running this command from the parent directory allows Docker to mount the full project directory inside the container.$ cd .. && torq-compiler/scripts/dev.sh
Inside the container, go to the
torq-compilerdirectory and continue with the build steps:$ cd torq-compiler
Build compiler and runtime for host
Setup a python virtual environment with the packages required for development:
$ scripts/configure_python.sh ../venv ../iree-build
The first parameter is the location of the venv and the second is the location where the build will be performed so that the build outputs can be pre-enabled in the environment.
Activate the environment:
$ source ../venv/bin/activate
(optional but strongly suggested) Setup
ccacheas follows::$ ccache --max-size=20G
Setup the build system with the following command line:
$ scripts/configure_build.sh ../iree-build
Build the Torq compiler and the runtime:
$ cmake --build ../iree-build/ --target torq
Building IREE from source may take several hours, especially on a typical laptop, due to the project’s size and complexity.
Build runtime for target
In order to cross-compile the runtime for an embedded target use the following commands:
Build the host version of the compiler as explained in the previous section (some host tools are required for the cross-build)
Configure the cross-compile build:
$ scripts/configure_soc_build.sh ../iree-build-soc ../iree-build
Run the cross-compile build:
$ cmake --build ../iree-build-soc/ --target iree-run-module
The statically linked iree-run-module is available in ../iree-build-soc/third_party/iree/tools/iree-run-module.