TOC PREV NEXT INDEX DOC LIST MASTER INDEX



Key Concepts

This chapter introduces the concept of integrated compilation, describes Apex and integrated development cycles, and outlines the software organization of the Rational Compilation Integrator (RCI).

Specifically, this chapter provides the following:


Overview Of The RCI

Integrated development is the process of designing, generating, and maintaining software on one machine (the development platform or host) that is compiled on another machine (the target compilation platform) under the control of the host for eventual execution on a predetermined machine (the target execution platform or target). The target execution platform can be the same machine as the target compilation platform (with a native compiler) or a different machine for which the code was compiled (with a cross-compiler). Similarly, the target compilation platform can be the same machine as the host (with a target compiler) or a different machine on which the code is compiled. For purposes of clarity, the discussion throughout the remainder of this chapter assumes that the host, the target compilation platform, and the target are separate machines.

Integrated development uses the process of remote compilation to control the target compiler and linker on the target compilation platform. The host platform and the target compilation platform (or remote platform) must be connected by sharing files through a network server using Network File System (NFS). This manual refers to the platform where compilation takes place as the target compilation platform when discussing compilation activities and as the remote machine when discussing network operations.

The RCI can operate in either interactive mode, where each unit is transferred to the target and compiled when it is coded on the host, or batch mode, where all units are transferred to the target, either individually (one at a time) or collectively, then compiled at the same time. Most target compilers support both interactive and batch mode, but some only support batch. In some cases, batch mode is more efficient.

To support this process, some sort of cross-system consistency management is also necessary to ensure that library structures and code are consistent between the host and the target compilation platform.

The RCI provides utilities to perform many aspects of integrated development automatically.

Integrated development can be very effective —— and sometimes necessary. Several cases lend themselves to this approach:

Rational's RCI products provide the means to develop and test a large portion of a project's software on Apex using its software development functionality. Target-dependent software can be developed and integrated on the Apex host and then tested on the target. The RCI's integrated approach is shown in Figure 1.

Figure 1 RCI Integrated-Development Approach

For source code that is either target-independent or target-dependent, modifications made on both the Apex development host and the target compilation platform can be managed efficiently for different targets.


Using The RCI: An Overview

After your system administrator and customizer have performed the appropriate setup steps, you can begin RCI development by creating and testing code on the host (the native Apex development cycle) and then move to the process of integrated development.

A development cycle is a repeated series of operations within the software-development process.

In an integrated development cycle, some of the operations or parts of them are carried out on the host, some on the host with changes based on the intended target, and some on the remote machine itself. In integrated development, the cycle includes additional communication operations: transferring units or script files from the host development platform to the remote compilation platform and vice-versa, and the transfer between host and remote machine of cross-system consistency-management information. The RCI automates these steps.

Using the Integrated Development Cycle

The recommended development cycle using the RCI begins with the native Apex development cycle —— that is, creating and testing code on Apex for target-independent operation. Then, when you are ready to test your code using the target compiler on the remote compilation platform, the integrated development cycle begins. You can repeat this process as you iteratively test your system. From the user's view, the integrated development cycle is very similar to the native cycle. Under the RCI integrated development cycle, you develop software in two roughly parallel library structures: one for the native Apex host (an Apex view) and one targeting the remote-compilation environment (an RCI view). The program library on the remote machine is associated with the RCI's remote-targeted library.

Views specify the environment in which code is developed. An Apex view has an Apex compiler key, which causes the Apex Compiler to use its built-in (host) semantics during analysis and to generate code during coding. Apex views provide an environment for host-based development and testing. An RCI view has an RCI compiler key, which causes the Apex Compiler to use the target semantics specified by the RCI Customization and to invoke the target compiler during coding. The compiler key provides the customization information and scripts which tailor the behavior of Apex to your development cycle.

For example, if you were to develop an Ada main unit called Unit_A, you might first create it and test it using Apex utilities in an Apex view. Later, you would use Apex tools to accept changes from the file into an RCI view, which would optionally create a copy of the file in a directory on the target compilation platform. RCI cross-system consistency-management tools would allow you to control consistency between the host and the target library.

Before creating library structures on either the host or target compilation platform, you should have some idea of:

The integrated development approach provides several advantages:

Designing and Creating Views for Code on the Host

To take full advantage of the RCI, use the following steps:

1 . Design your code so that you only have target dependencies in a small number of subsystems. To do this, you need to design an interface or set of interfaces which describe the services which are only available on the target. Rational recommends that you always isolate target-specific code to a small number of easily-managed views.

2 . Create two sets of views, one for the host (an Apex view) and a corresponding one for the target (an RCI view). In the subsystems which implement the target-specific code, only the interfaces, that is, the specifications, share a common history. The implementation code on the host will merely simulate the actual services provided on the target.

In a well-designed system, most code will not be target-specific and will be identical in both host and target views.

3 . Develop and test, as thoroughly as possible without target services, portable code for the project in the Apex views.

4 . Shift development to the RCI views, described in "Developing and Executing Code for the Target Machine," when the primary debugging involves the target-specific code. You then use the RCI to manage transfer of the code to the target compilation platform, remote compilation and linking, and cross-system consistency management from the RCI views. This transfer of code is described in Transferring Units to an RCI View.

Developing and Executing Code for the Target Machine

The steps in the integrated development cycle for the chosen target, the second phase of development, are very similar to those in the native Apex cycle. The following steps are described in more detail in Chapter 2, "Getting Started."

Using Library Structures

Using Apex and RCI Views

Apex and RCI views provide the structures for developing code for remote compilation. Use these views with the steps described in "Designing and Creating Views for Code on the Host" and "Developing and Executing Code for the Target Machine." The process of creating source code, checking semantics, installing, coding, executing, debugging code, and performing configuration management entirely on Apex is described in the Apex manual set.

Using Host-Only Views

Use host-only views when you want to do development but for some reason don't want the target compiler to be invoked when coding units in the view. For example, you can begin your development cycle using host-only views and later covert such views to host-target views. Another common reason to use host-only views is to represent pre-compiled target libraries.

Host-only views do not have a target compilation platform associated with them, but they can have a target directory (and should if the view corresponds to a target API). Target directories of host-only views provide information that is used by RCI to maintain consistency between the host view import relationships and the target library hierarchy to enable correct resolution of target unit dependencies.

Use a host-only view when you do not want an RCI view compiled on the target compilation platform. Host-only views allow you to check target-specific semantics, but when units in a host-only view are coded on Apex, RCI does not transfer them to or compile them on the target compilation platform.

Using Interface Views

Interface-only views are views which contain specifications only. Most target APIs will correspond to host-only, interface-only views. Interface-only views which are not host_only will enable target compiler invocation when units in the view are coded.

Mapping Views to Target Directories

The RCI library model is similar to the native Apex library model. It is limited, however, by the restrictions of the target compilation platform's library model.

The RCI maps RCI views to libraries on the compilation platform. Your customizer can extend RCI library-management operations to perform remote library-system operations so that you do not have to manage target libraries as a separate task from managing host libraries. Check your customization documentation for information about your library-mapping operations.

Apex and the RCI have the notion of a current working library, as do most library-management systems. Also, Apex has a way of defining static imports (Summit/CM maintains a list of imports for each RCI view on the host), and many library-management systems maintain an equivalent list of sublibraries to use when resolving external references on the target compilation platform.

When this manual refers to a target library, it includes a directory on the target compilation platform, a presumed associated or enclosed target-compiler program library, and, for some customizations, a remote import list. The RCI uses these parts of the target library as follows:

A Rational view is analogous to the target library: the directory of the view contains all of the source, and information about compiled units is an implicit or hidden part of the view.

The RCI supports a one-to-one mapping, shown in Figure 2, between a host view and a target directory.

Figure 2 Multiple subsystems with multiple target directories

For some customizations, you may need to map views from different subsystems, as shown in Figure 3, into a single target directory; this method is not recommended unless your target compilation system requires it.

Figure 3 Multiple subsystems with single target directory


Software Components: An Overview

Before you can use the RCI, the appropriate software components must be in place, and several environment variables, switches, and files must be set properly. The system administrator is responsible for some of the setup operations, and you, the user, for others. Your system administrator handles the following operations:

A remote compilation component is the software that carries out one or more operations under the control of the RCI. Remote compilation also uses other components, such as an editor, that are not particular to RCI operations but are components of Apex or the host or target operating system.

RCI-Specific Software Components

The following components are tools that are particular to the RCI and under the control of an RCI user or customizer:

RCI User Interface

The RCI provides commands through two user interfaces:

Graphical User Interface (GUI): use this interface through menus and dialog boxes from the Apex menu RCI for the following operations:

You can get more information about these operations through the Apex online help. Online Reference Summary in this guide contains a printed copy of the available online help for the RCI GUI entries.

Command-line interface: the following commands are available from the UNIX command line in an Apex shell:

actc - accept changes from a target file into a host unit
accepts changes from a target unit into a host unit
cmpt - compare host and target units
compares host and target units
cpto - transfers host units to the target
copies host units to the target
crscr - create batch compilation script
creates a batch compilation script
crtlib - create target Ada library
creates a target Ada library
deltlib - delete target library
deletes a target library
rftimp - refresh target imports
refreshes a target library's imports

You can get more information about these commands through the man command_name command from the command line. RCI Man Pages Summary in this guide contains a printed copy of the available man pages.

The Apex interface has additional user commands for RCI operations integrated into the Environment. For example, File > New > New View creates an RCI view, File > Copy Object copies a view, and File > Delete Object deletes an RCI view.

Customization Components

The RCI includes software components to allow your customizer to extend the RCI for your specific platform. As an RCI user, you do not need to work with these components. Your customizer provides information about your specific customization.

The customization components contain the following elements:

Non-Rational-Supplied Components

The following components are invoked by the RCI but are not supplied by Rational. They are assumed to exist on the target compilation platform as described in the RCI installation instructions:

Note: You must include the path to your target compiler's bin directory in your search path.


Looking at an RCI View

Development for the native Apex and integrated development cycles takes place in library structures (subsystems and views). For the RCI, subsystems are the highest level of Apex library structure, and development takes place in views within the subsystems. This section describes elements of an RCI view.

Model Views

When creating an RCI view, specifying a model view saves you from having to define every aspect of the view. The model view is already defined with defaults appropriate to your RCI customization. A model view provides:

When you create an RCI view using File > New > New View, you provide the pathname for the model to use. For example, the model for a Solaris RCI view may be:

If you plan to create RCI views only, you can change the environment variable, APEX_DEFAULT_MODEL, from its Apex default to the RCI model value. This causes the view creation commands to select it as the default model option during view creation operations.

RCI Switches

There are three general areas where switch values for a view can be found and modified:

1 . Switches that affect your particular session are specified using UNIX environment variables. Consult your Apex documentation for more information on session switches.

2 . Default compiler and linker options are specified by your customizer. The options available for your target compiler are defined in the keys directory for your customization. For example, the following files in the $APEX_BASE/ada/key.ss/rci_sun4_solaris2_vads_sunos.ada83.3.0.0.rel directory define the options (only a portion of each file is shown):

3 . Switches that affect a particular subsystem or view are located in subsystem_or_view_name/Policy/Switches. Among these switches are the COMPILER_KEY, which indicates which compiler the RCI uses to compile units in this view. This switch file takes its default values from the corresponding switch file in the model view.

Use Control > Show > Switches to display and edit these switches.

Currently, the RCI-specific switches are:

Note: Some of the above switches may not be present in the switch file for a specific view. If the RCI is unable to find an explicit definition for a particular switch, it uses the switch's default value.

Your customizer can establish default switch values for new views by defining those switches in the Policy/Switches file in the model view for your customization.

View Information

The RCI creates and maintains files in the view to store information about the state of the units involved in compilation. These files are found in the .Rational/Rci directory of the RCI view. Different customizations use this directory to store information; for example, the VADS customization stores a list of target library imports in .Rational/Rci/imports

The .Rational/Rci/target_names.sf file contains the name of each unit in the host view and the corresponding name of the unit in the target directory. Each entry in this file has the following general syntax:

You can edit this file to change the name used for a unit on the target.

View Example

The following example illustrates the view target_view.wrk in the subsystem Test.ss. This shows a VADS RCI view in interactive compilation mode and the corresponding target directory after you have compiled the units.

Using the Example VADS and GNAT RCI Customizations

There are two example RCI customizations included with the Apex RCI. One targets the VADS Self 6.2.3 compiler (SunOS), and the other targets the GNAT 3.07 Ada 95 compiler (SunOS).

Before you can use either customization, you must install the appropriate target compiler, modify your $PATH to include the target compiler's bin directory, and setup the customization so that it knows the location of the target compiler's library directory.

To setup either customization, follow the instructions in the README file included in the customization's compiler key directory ($APEX_BASE/ada/key.ss/customization view).

Now create a test view using the customization's model view ($APEX_BASE/ada/model.ss/customization view), provide suitable values for the RCI options in the File > New > New View dialog for the target directory and a SunOS target machine, and code a simple hello world program. If everything is properly set up, the target compiler is invoked.

For additional information about creating or modifying an RCI customization, please refer to the RCI Customization Guide. A postscript version of this document is also included and can be printed using the Help > Print Manuals command. The postscript files are an optional part of the installation. If your installation does not include these documents, please contact your Apex Administrator.


Rational Software Corporation 
http://www.rational.com
support@rational.com
techpubs@rational.com
Copyright © 1993-2002, Rational Software Corporation. All rights reserved.
TOC PREV NEXT INDEX DOC LIST MASTER INDEX TECHNOTES APEX TIPS