MIRA
QuickStart


After you successfully finished installing and building MIRA by following the Installation you will have a fully operational middleware consisting of the following parts.

You can now try and start to implement your first Unit. Units are modules that form simple or complex, reusable parts of a large and complex applications.

You should first create your own project where you put all your software components. Projects are just directories that contain a build environment for building MIRA components.

Use the mirawizard to create a project

We use the MIRAWizard to create our own project:

  1. Start mirawizard
  2. Click on "Create a new External Project"
  3. Give it the name "MyFirstProject", check if the provided path is correct and click on continue.
  4. The wizard can automatically adapt your environment settings (Be sure the path to your project is added to the MIRA_PATH environment variable)

You have successfully created your own project. You can now go into your project directory and type make (linux) or nmake -f Makefile.nmake (windows).

Use the mirawizard to create a Unit

To create your first unit you need to decide in which domain your unit will reside. Domains are represented via the directory structure in the domains directory. So you will be able to change the domain of your unit later by moving it into a different one.

We use the MIRAWizard to create our unit:

  1. Start mirawizard
  2. Click on "Create a new Domain", give your domain the name "MyFirstDomain" and fill in the required fields.
  3. Put your domain in a subfolder of "MyFirstProject/domains/" (the wizard will provide you with a default path here).
  4. Click on OK to create your domain
  5. Click "Continue with another Task"
  6. Click on "Create a new Component"
  7. Chose Unit as type of your Component, give it the name "MyFirstUnit" and finish this step.

Now you have successfully created your first Unit. You can build your domain by running make or nmake -f Makefile.nmake in your project directory.

If your Unit is not being built you may need to give CMake a hint that there is something new to be built. On linux type touch CMakeList.txt in your project folder followed by make.

Use your unit in an application

Building your domain creates a shared library "libMyFirstUnit.so" or "MyFirstUnit.dll" containing your unit's class "MyFirstUnit". To use your unit in an application you need to include it in a configuration file.

A minimal configuration for an application that uses your unit could look like this:

<root>
<unit id="MyUnitsName" class="myfirstdomain::MyFirstUnit" />
</root>

You can save that file as MyFirstUnit.xml in the "etc" directory of your domain. To start an application with this config file you can either use mira or miracenter.

Type

miracenter domains/MyFirstDomain/etc/MyFirstUnit.xml

in your project directory.

At this stage your unit will do nothing. You need to fill it with life. You can edit the source file of your unit to fill in some functionality. The source file can be found in the "src" folder of your domain directory e.g. "MyFirstProject/domains/MyFirstDomain/src/MyFirstUnit.C" See UnitCodeExplainedPage for an explanation of the unit's source code.

From here on it would be good to make yourself more familiar with the Concepts of MIRA.

Have fun!