ArmarX Setup
Setup and maintenance tools for ArmarX and its dependencies.
Setup
This setup was tested on a fresh Ubuntu 18 installation.
If not done yet, install git and virtualenv for python 3:
# If not installed yet.
sudo apt install git python3-venv
Then clone the repository:
cd ~ # Or another directory of your choice.
git clone git@gitlab.com:ArmarX/meta/setup.git armarx-setup
cd armarx-setup/
Create the virtual python environment by either (1) or (2):
# (1) Using pip and virtalenv
python3 -m venv .venv
source .venv/bin/activate
pip3 install -r requirements.txt
# (2) Using Python Poetry
poetry install
Optional: See Module Graph Visualization below for how to enable graph plotting.
Usage
See which commands are available:
./bin/armarx-setup --help
./bin/armarx-setup
is a bash script which first activates the python environment, then calls the python script./armarx-setup
in the root directory if this repository (.
).If you have activated the python environment, you can also directly call
./armarx-setup
.
To be able to run armarx-setup from anywhere, add this line to your ~/.bashrc
and re-source or it open a new console:
export PATH=~/armarx-setup/bin:$PATH
Initialize a new workspace:
armarx-setup init
If you chose to export the
ARMARX_WORKSPACE
variable in your~/.bashrc
during the workspace initialization, open a new console for this to take effect.
Show information about the current workspace:
armarx-setup show
Use the upgrade command to
- install required apt packages (you are asked beforehand),
- clone/update repositories,
- prepare (e.g., run cmake),
- build (e.g., run cmake --build),
- install,
all modules and their (direct and indirect) dependencies.
armarx-setup upgrade
To add or remove modules:
armarx-setup add module/path
armarx-setup remove module/path
# Examples:
armarx-setup add armarx/ArmarXCore
armarx-setup add armarx_integration/robots/armar6
Modules paths are paths to .json
files in the data/modules
directory.
Use Ninja instead of Unix Makefiles
To use Ninja as cmake generator, set the environment variable CMAKE_GENERATOR
when running upgrade
:
CMAKE_GENERATOR=Ninja armarx-setup upgrade
If you ran upgrade or prepare before, wipe all build directories first:
armarx-setup clean
Use Ccache
The setup scripts detects whether the Ccache system packages is installed.
If Ccache is installed, the script automatically sets the respective
CC and CXX compilers (e.g. CXX=ccache g++
).
For CMake projects, this must be done the first time cmake
is run.
Install Ccache:
sudo apt install ccache
# (Optional) Define the cache size
ccache -M 100G
When you ran armarx-setup ugprade
before, first run
armarx-setup clean
Then, just run
armarx-setup update
Module Graph Visualization
You can visualize the module graph encoding the dependencies of modules in the workspace by
passing the --graph
flag to the show
command:
armarx-setup show --graph
This requires some additional packages:
pip install matplotlib PyQt5
In addition, to enable more sophisticated graph layout and styling, you can install these packages:
pip install numpy # Used for edge coloring
pip install pygraphviz # Graphviz layouting.
pip install python-igraph # igraph layouting.
PyGraphviz also requires some system packages:
sudo apt-get install graphviz graphviz-dev