You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

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.

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.

echo INTROOT=~/workspace/introot >> ~/.bashrc

Set IDL (Interface Definition Language) for our hello-world components

For any given component we have to follow 3 steps:

  1. Implement component's IDL
  2. Implement component
  3. Install component in ACS

For step #1,  we create the component's IDL directory and file:

cd ~/workspace
getTemplateForDirectory MODROOT_WS idlHelloComp
cd idlHelloComp/src
touch ../idl/HelloComponent.idl
sudo vim ../idl/HelloComponent.idl

We fill the IDL with the following:

idlHelloComp/idl/HelloComponent.idl
#ifndef _HELLOCOMPONENT_IDL_
#define _HELLOCOMPONENT_IDL_

#pragma prefix "acsws"

#include <acscomponent.idl>

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

#endif

We add our component's IDL to the Makefile:

idlHelloComponent/src/Makefile
...
IDL_FILES = HelloComponent
HelloComponentStubs_LIBS = acscomponentStubs
...
COMPONENT_HELPERS=on
...

We then compile and install the IDL definitions:

make -j all install
  • No labels