Skip to content

Orcc command line scripts

Antoine Lorence edited this page Jul 1, 2014 · 6 revisions

Use Orcc in command line

Orcc has been developed on top of Eclipse framework, with the help of Xtext SDK for code edition and generation and Graphiti SDK for networks edition.

It cannot be used as a fully standalone application, but can be run on the command line (even on servers without GUI). This page describes how to compile and run Orcc in command line.

Prerequisites

All scripts used to run Orcc in command-line are stored in the folder headless_build.

Clone projects source

This set of scripts will build Open RVC-CAL Compiler. To do so you have to clone Orcc repository (in addition to ci-server-scripts). You can clone it anywhere on your computer, the build script will copy needed elements into the right place before building.

As an example, we will clone all projects in /home/my_user/projects

mkdir ~/projects
cd ~/projects
git clone https://github.com/orcc/ci-server-scripts.git
git clone https://github.com/orcc/orcc.git

Working directory

Before using the scripts from headless_build folder, you have to create a working directory with write permission somewhere in the system. In the next steps, we will use shell variables to store path to headless_build and working directory folders:

mkdir /opt/working_dir
export SCRIPTS_DIR=~/projects/ci-server-scripts/headless_build
export WORK_DIR=/opt/working_dir

Maven version

To use headless scripts, you have to install Maven 3 on your computer and check it is in your $PATH. To verify that:

⇒  mvn --version
Apache Maven 3.0.5
Maven home: /usr/share/maven
Java version: 1.7.0_55, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
Default locale: fr_FR, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-24-generic", arch: "amd64", family: "unix"

In ubuntu, the last maven version can be installed with the package maven (please do not use maven2 package which is an older version)

Checkout submodules

The git repository contains a submodule to p2-admin, a tool used to manage p2 repositories after builds. Once you have cloned the repository ci-server-script, don't forget to update submodules:

cd ci-server-scripts
git submodule init
git submodule update

Then from time to time, you can re-run the git submodule update to check for eventual changes in the remote project.

Scripts usage

Once your working directory has been created, you can run the command line scripts in this order. Click on links below to obtain detailed information:

  1. orcc_eclipse_setup to build a basic build & run environment
  2. orcc_build to build Orcc from source and generate installable plugins
  3. orcc_run_compilation executes a back-end to produce source code or directly orcc_run_simulation to execute CAL design directly

Note

Headless scripts are written in Bash. They run under GNU/Linux systems but some issues have been reported under Mac OS.