3.1 Creating a Bocca Project

If your CCA environment is configured properly (Section E) then the bocca command is already in your command path and you are ready to go. Find a safe place to begin your Bocca project, such as your WORKDIR:

$ cd $WORKDIR

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 demo. Create the project directory now:

$ bocca create project demo --language=LANG

The project was created successfully in /home/livetau/workshop-acts/cca/WORK/tutorial-src/doc/scratch/cxx/demo

Here LANG specifies the default implementation language for components in this project, if you don't specifically indicate a language when creating the component (a project can contain components in any mixture of Babel -supported languages). For this exercise, choose the one of  c,  cxx,  f90,  java, or  python with which you are most comfortable (some of these choices may not be available if your Babel installation is not configured for them, but these are the languages for which this Guide has detailed instructions). If you don't specify a default language when creating the project, Bocca will use C++.

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 -F

demo/

Feel free to poke around a bit:

$ ls -F demo

BOCCA/
buildutils/
components/
config/
configure*
configure.ac*
configure.ac1
depl/
external/
install/
Makefile
make.project
make.project.in
make.rules.user
make.vars.user
ports/
README
utils/

Before using a new Bocca project or working with an existing project just checked out from a source code repository, you will need to configure it for the details of your local environment. For a new project this is easy: ./configure from within your new project directory.

$ cd demo && ./configure

checking for bash... /bin/sh
checking for GNU make... make
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for openpty in -lutil... yes
checking for bocca... /usr/local/ACTS/cca/bin/bocca
c cxx f90 f77 python java
configure: Configuring with languages: c cxx f90 f77 python java
configure: Project source dir apparently /home/livetau/workshop-acts/cca/WORK/tutorial-src/doc/scratch/cxx/demo
configure: Using 4 processe(s) in calls to make.
checking whether make sets $(MAKE)... yes
configure: creating ./config.status
config.status: creating make.project
config.status: creating buildutils/make.vars.common
config.status: creating utils/run-gui.sh
config.status: creating utils/bocca-gui-backend.sh
config.status: creating utils/demo-config
config.status: creating utils/config-data
config.status: creating utils/demo-config.h
config.status: executing outmsg commands

2010-08-11