Additional Notes for Linux OS
Introduction
This document is the user’s guide of Rhapsody Developer for Ada on Linux os.
Installation Notes
- Precompiled Libraries
-
As part of Rhapsody installation you are receiving the following files:
- Basic behavior services sources. These are compiled on installation.
- Animation C libraries.
These files have been tested against the following Ada compilers
- GNAT 6.0.2
- Atego ApexAda Developer compiler
GNAT Installation
- Manually rebuilding the behavior services for Gnat
-
Three behavioral frameworks are available for Gnat environment
- LangAda83 : framework for Ada83
- LangAda : old framework for Ada95 (not maintained any more)
- LangAda95 : framework for Ada95
- A scrpit helps building these frameworks:
-
<RhapsodyInstallDir>/Sodius/GNATForRiA.sh
This script is used by IBM Rhapsody installer. If install is not correct, or if user needs to build behavioral framework, this script can be used. Make sure that it contains the correct path for Gnat compiler.
- Ada code generation for Gnat environment
In order to generate Ada code, Rhapsody Developer for Ada should be launched. The following script can be used for that:
<RhapsodyInstallDir>/RhapsodyInAda
For more information about Ada code generation, please refer to Ada Code Generator guidelines.
Apex Installation
- Manually rebuilding the behavior services for Apex
-
If you are using Atego ApexAda Developer compiler, only NewFWK95 is available. The new behavior services should be installed in a view of a subsystem.
- As the FWK needs booch components and Rhpanim, some views must also be created for them. A script helps doing this:
-
<RhapsodyInstallDir>/Sodius/apexForRiA.sh [Apex_model_path][Apex_view_name]
This script is launched during install of Rhapsody. But it can be used to create other views of the FWK. It needs 2 parameters :
- Apex_model_path : an Apex model path to create the view
- Apex_view_name : name of the Apex view.
If no parameters are passed, then the default Apex model will be used and the name of the view will be “view”.
- This script will create view in the following subsystems :
-
<RhapsodyInstallDir>/Share/LangAda95/aom_new_95/aom_new_95.ss
- And if
<RhapsodyInstallDir>/Share/LangAda95/booch_ada_95
exists: -
<RhapsodyInstallDir>/Share/LangAda95/booch_ada_95/Booch.ss
Example :
<RhapsodyInstallDir>/Sodius/apexForRiA.sh /Home/Atego/Apex/base/ada/model.ss/i386_linux2.ada95.portable.4.4.0.rel i386_linux2.ada95.portable.4.4.0
If you need to update the FWK, you should open the FWK model /Share/LangAda95/Ada_FWK/Ada_FWK.rpy with Rhapsody, and create manually a new configuration:
-
Change the directory of the component Oxf:
- Create a new configuration called Apex
-
Set the path as followed:
- Delete manually all the ada files which are in the view (not the view itself)
- Regenerate the model for Apex configuration.
If the subsystem doesn’t exist, the compilation may not work, because some imports are missing. To create them, run the script /sodius/apexForRiA.sh.
If you want to create a new view with an updated FWK, you should update files of GNAT_win_32 configuration. For that, GNAT_win_32 configuration should be updated:
-
Change the path:
-
Set the property Ada_CG:Apex:compiler to “GNAT”:
- Regenerate the model for GNAT_Win_32 configuration
Run the script /sodius/apexForRiA.sh with correct parameters to create the new view. (the script uses the files generated for GNAT_Win_32 configuration in folder (LangAda95/src/RiA_Framework/Gnat_win_32)
- Manually rebuilding the animation C libraries
-
Rebuilding for Atego ApexAda Developer compiler
- The build is done using the native GCC compiler of Linux.
- If you are using Atego ApexAda Developer compiler, you might have to follow these steps :
- Open a shell terminal.
- Go to the <RhapsodyInstallDir>/Share/LangC directory.
Type:
make -f adaLinuxbuild.mak
The following files will be generated in the directory
<RhapsodyInAdaInstallDir>/Share/LangC/lib
:- adaLinuxaomanim.a
- adaLinuxomcomappl.a
- adaLinuxoxfinst.a
- Install Booch components
-
In some case code generator creates some dependencies to Booch components. Rhapsody doesn’t install Booch Components files. User must do it manually, by following the procedure above.
- Install Booch Components 95
- Get the files from the following URL for example:
- http://sourceforge.net/projects/booch95/files/
- Unzip the files
- Copy the folder “src” into <Rhapsody_install_folder>\Share\LangAda95\Booch_ada_95\src
Install Booch Components 83
- Get the files from the following URL for example:
- http://www.adapower.com/original_booch/original_booch.html
- Unzip the files
- Copy the folder “src” into
<Rhapsody_install_folder>\Share\LangAda83\Booch_ada_83\src
If you are using Atego ApexAda Developer compiler, a subsystem and a view must be created to be able to create a dependency between the Rhapsody project and Booch Components. The script
<RhapsodyInstallation>/Sodius/apexForRiA.sh
is able to create this view. A script like that can be also used.ApexPath="" # define the path of Apex rhpInstallDir="" # define the path of install of Rhapsody rhpShareBooch="" # define the path where the src folder of Booch Components is located modelName="" # define the Apex model used to create a view. Usually "" viewName="" # usually use "view" subsystemName="$rhpInstallDir/Share/LangAda95/Booch_ada_95/Booch.ss" if [ -d \$subsystemName ] then echo "*** subsystem \$subsystemName already exists" else $ApexPath/apexinit -batch create_subsystem $subsystemName fi viewBooch=$subsystemName/$viewName if [ -d $viewBooch.rel ] then echo "*** view $viewBooch.rel already exists" else $ApexPath/apexinit -batch create_release -model $modelName $viewBooch $ApexPath/apexinit -batch migrate $rhpShareBooch/src/*.ad* -into $viewBooch.rel $ApexPath/apexinit -batch code $viewBooch.rel #\$ApexPath/apexinit -batch remodel -release_kind frozen \$viewBooch.rel fi
Generating code for Apex
- Launch Rhapsody for Apex
-
Rhapsody must run in an Apex context in order to be able to use some Apex command.
The command to launch it is :
(Summit)Apexinit –exec <Rhp_Install_Dir>/RhapsodyInAda
(Clearcase)Apexinit –clearcase –exec <Rhp_Install_Dir>/RhapsodyInAda
Two scripts can execute this command :
<Rhp_Install_Dir>/RhapsodyInApex
(Summit)<Rhp_Install_Dir>/RhapsodyInApexCC
(Clearcase)When launching Rhapsody, the Apex IDE is also opened. User will then be able to use Apex functionality as he use to do.
It is possible to mask Apex Window by using the option “–S”.
- Generated code location
-
Apex projects are organized into subsystems. Each subsystem contains some views which describe compile configuration, and which contain Ada source files.
Ada code generator will generate files in a view of a subsystem or in a Rational subsystem. User needs to specify manually the path where the code should be generated in configuration settings. The path must end with
<subsystem_name>.ss/<view_name>.wrk
( or rel) or<Rational_subsystem_name>.rss/
The extensions are mandatory. If they are wrong or omitted, then code generation will stop.
- Recommended usage
-
Usually, Rhapsody generates a directory for each component, and a directory for each configuration. The default path is then <project_path>/<component_name>/<configuration_name>. The recommended usage is to affect a subsystem to a component and a view to a configuration, or a Rational subsystem to a configuration.
For Apex Summit, the path should be
<project_path>/<component_name>.ss/<configuration_name>.wrk
( or rel)For Apex Clearcase, the path should be
<project_path>/<component_name>/<configuration_name>.rss
All packages of the project will be generated in a view or a Rational subsystem, depending on component’s scope. If there is the need of defining only one package per subsystem, then one component per package must be created with a scope on this package only.
- Subsystem and view creation
-
Code generator will check if subsystem and view directory exist, and if they have been created by Apex. If the subsystem or the view has not been created by Apex, then they are deleted, and code generator will call an Apex command to create them.
A view is created, using a model which will import some predefined subsystems. If user wants to use a specific model, then he can do it by updating property Ada_CG:Apex:DefaultModel. This property should be filled with “-model <model path>”. This property should be updated before creating the view. If the view is already created, and the user wants to change its model, then he should use Apex tools.
If Apex is used in Clearcase context, then a Rational subsystem is created instead of Subsystem and view.
- Add imports
-
If a subsystem needs to import another subsystem, it is possible to add it in configuration settings. This will add a new Apex import command in the makefile. To do this the field “include path” of configuration settings must be filled with the path of the view to be imported. Several imports can be added, separated by an end of line.
- Use Apex editor
-
In order to use Apex editor instead of Rhapsody’s one, the project’s properties must be set like that:
- General::Model::ClassCodeEditor = CommandLine
- General::Model::EditorCommandLine = apex visit
Rhapsody with Apex limitations
- Only Ada95 and new FWK95 are supported.
- Rhapsody is only able to create subsystem, and view, and generate code in a view respecting Apex naming convention. Rhapsody can also run an Apex link command, with the build or rebuild item of Code menu. All other Apex commands are not available and may be used with Apex IDE.