Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In this tutorial we will write and run example ACS modules in Python, Java and C++.. First we must  perform some configurations on ACS before coding our components.

Set $INTROOT environment variable

Visit ACS Directory Structure#INTROOT for full details. This directory is where our experimental components will be installed.

Code Block
languagebash
export INTROOT=~/workspace/introot
getTemplateForDirectory INTROOT $INTROOT

Pro tip: you can set $INTROOT in your ~/.bashrc to avoid setting $INTROOT manually in every new terminal.

Code Block
languagebash
echo INTROOT=~/workspace/introot >> ~/.bashrc

Set IDL

First we create the directory for the IDL:

Code Block
languagebash
getTemplateForDirectory MODROOT_WS idlHelloComp
cd idlHelloComp/src
touch ../idl/HelloComponent.idl
sudo nano ../idl/HelloComponent.idl

We fill the IDL with the following:

Code Block
languagecpp
titleidlHelloComp/idl/HelloComponent.idl
linenumberstrue
#ifndef _HELLOCOMPONENT_IDL_
#define _HELLOCOMPONENT_IDL_

#pragma prefix "acsws"

#include <acscomponent.idl>

module workshop {
    interface HelloComponent : ACS::ACSComponent {
        string printHello();
    };
};

#endif

We modify the Makefile:

Code Block
titleidlHelloComponent/src/Makefile
...
IDL_FILES = HelloComponent
HelloComponentStubs_LIBS = acscomponentStubs
...
COMPONENT_HELPERS=on
...


We then compile and install the IDL definitions:

Code Block
languagebash
make -j all install