Euclid software development notes

This page contains my personal notes on Euclid software development. I am putting concise summaries of the Wiki content and links to longer documents here, since the Euclid Redmine website is currently a bit of a rat’s nest.

The EuclidRun Tool

The utility, EuclidRun (equivalently, E-Run and ERun) sets up environment variables and then runs a specified command. The basic syntax is:

ERun [options] [name=value] ProjectName Version [command [arguments for command]]

For example, to set up the environment for EuclidImgUtils version 0.5, and then launch IPython:

ERun EuclidImgUtils 0.5 ipython

Assuming that EuclidImgUtils, version 0.5 is installed, you can then import EuclidImageBinding (the python bindings for EuclidImageUtils). Note: running the following command enables autocompletion when the program is called as ERun:

ERun_autocompletion.sh

so that ERun [TAB] lists the available projects.

Creating and expanding a new project with Elements

Main reference. Assuming that we are using Elements 4.0, to create a new project named testproject with a version number of 0.1, we do this:

$ ERun Elements 4.0 CreateElementsProject testproject 0.1

To create a module, cd into a project directory and use the AddElementsModule sub-command / helper script, like this:

$ cd /home/user/Work/Projects/testmodule/0.1
$ ERun Elements 4.0 AddElementsModule Module_Name

To create a C++ class, cd into a module and then use the AddCppClass sub-command / helper script:

$ cd Module_Name
$ ERun Elements 4.0 AddCppClass TestClass

This will create several template files in the src/, test/, and Module_Name/ subdirectories of the main module directory. To create a C++ program, make sure that you are in the desired module directory and then use the AddCppProgram sub-command:

$ pwd
# output should be: /home/user/Work/Projects/tstproject/0.1/Module_Name

$ ERun Elements 4.0 AddCppProgram Program_Name

This creates a template of the program’s main function in the src/program/ subdirectory. To create a Python module, use the AddPythonModule sub-command:

$ ERun Elements 4.0 AddPythonModule Python_Module_Name

This creates a new python/ subdirectory, a tests/python/ directory, and template files. To create a Python program, use the AddPythonProgram sub-command:

$ ERun Elements 4.0 AddPythonProgram Python_Program_Name

This creates a template file in python/Module_Name/. For more information about the required command line parameters for Python programs: go here. To build and install your project:

$ cd /home/user/Work/Projects/tstproject/0.1/
$ make all
$ make install

Then you can run the Python program like this:

$ ERun Module_Name 0.1 Python_Program_Name

The default parameters will already be filled in, using the contents of the corresponding .conf file at /home/user/Work/Projects/tstproject/0.1/Module_Name/conf/ To run quality check on the code: Navigate into the project’s directory (/home/user/Work/Projects/testmodule/0.1/) and run checkQuality -e to make sure that the environment is set up right, then do checkQuality -L c++ or checkQuality -L python:

$ cd /home/user/Work/Projects/tstproject/0.1/
$ checkQuality -e
$ checkQuality -L c++ # check C++ quality
$ checkQuality -L python #check Python quality
$ checkQuality # check quality of all code

Once the code anlysis is complete, a summary is printed and a hyperlink to the SonarQube output is provided.

Git