Chapter 3. Using Bocca: An Application Generator for CCA

$Revision: 1.15 $

$Date: 2007/08/23 15:17:49 $

Table of Contents

3.1. Creating a Bocca Project
3.2. Creating Ports and Components
3.3. Inserting Implementations into Bocca-Generated Components
3.3.1. Adding Methods to Ports
3.3.2. Language Specific Implementations of the Function, Integrator and Driver Components

While the CCA specification allows you to create components "by hand", it is much quicker to use an application generator that provides templated code for a components and a build system. Naturally Bocca cannot create your implementation for you, but all of the glue code that embodies the CCA is created in a few of commands. The advantage of the this approach is that a lot of build and component defaults have been chosen for you. The downside is that you don't get to pick these defaults for yourself.

3.1.  Creating a Bocca Project

If you followed the instructions in Chapter 2, Assembling and Running a CCA Application then bocca is already in your command path and you are ready to go. Find a safe place to begin your bocca project we recommend your home directory in a new directory called bocca:


$  cd $HOME
$  mkdir bocca
$  cd bocca
$  ls -a .


. ..
$  

The first thing to do is to create a project directory within which all of your components and ports will reside. Normally you would choose a relevant project name but for now we will just call it myProject. Create the project directory now:


$  bocca create project myProject --language=LANG
$  

Here "LANG" is the implementation language that your components will default to. Just choose the one of C, C++, and Fortran9X with which you are most comfortable. Now that the project is created, we see that bocca has created a lot of build scaffolding to support the componentized application we will write. The first thing you notice is that bocca has created a directory:


$  ls


myProject
$ 

feel free to poke around a bit:


$  ls myProject/


BOCCA     components    ports            python
Makefile  configure     project.make     utils
README    configure.in  project.make.in  xml_repository
$