![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
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
- Using The RCI: An Overview
- Software Components: An Overview
- Looking at an RCI View
- Using the Example VADS and GNAT RCI Customizations
Overview Of The RCIIntegrated 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:
- In some projects, software must run on a variety of target-hardware architectures and operating systems. Developing software separately (on different host environments) for each target could result in different program characteristics for each target. Using one development host is an effective way to organize development, standardize programs, provide a common user interface, and reduce duplication of effort.
- The host may be more effective than the target for producing well-engineered code on a tight schedule for large projects. The host's advantage may come from its specialization in development tasks or from limitations of the target —— or both.
- The target may be unavailable during some portion of the project. The ability to develop and test code on the host allows the project to proceed in a timely manner.
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 OverviewAfter 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.
- When code is developed entirely on Apex, the operations are different enough from a traditional cycle that we refer to the native Apex development cycle.
- When code is developed on the Apex host for execution on a different machine, the compilation processes on both host and remote machine make up the integrated development cycle.
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:
- Whether you will use the Apex native development cycle
- Whether you have target-independent code whose target-independence should be enforced by Apex facilities
- Whether you want to maintain an exact duplicate of all library structures, including releases, on the compilation platform or only the minimum required libraries
- The scope of the project and how it divides into logical subcomponents
The integrated development approach provides several advantages:
- Allows you to develop a project and test its code on the host, in a tightly-controlled environment without concern for file transfers and remote communication between host and remote machine, or consistency management across file systems between host and remote machine. This saves target resources and allows work to continue, if for some reason the target is unavailable.
Turnaround time for unit testing is much faster on the Apex host for a number of reasons, including optimal recompilation and shared-code generics.
- Encourages you to write portable, reusable code. By creating the majority of the project in portable views, you can maintain consistency across many targets, by modifying only those views that contain target-dependent code.
- Provides a common user interface to different target compilers. By using the RCI interface, you can use the same methods for each of your target compilers, without relearning each compiler's user interface.
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."
- Creating RCI Views: The File > New > New View dialog has a "Language" button which needs to be set to RCI, as well as tabs for "RCI options" and "other", both of which may be of interest to RCI developers. Use the host_only option for views where the Apex compiler should not invoke the target compiler. You should specify a target directory for host_only views which correspond to pre-compiled target libraries. Use the interface_only option for views which are specification only views. A more detailed description of these options is contained in the next section,Using Library Structures
- Creating/modifying Ada source: The facilities for producing Ada source are the same as for the native cycle. Typically, much of the code for the target is first developed in the native cycle and then ported to the integrated development cycle.
- Checking syntax and analyzing: The actions you take are the same as for the native cycle; there is some difference, however, between how Apex does semantic checking in native and RCI views, because the RCI checks target-dependent semantics.
- Coding: In interactive mode, in a non-host-only RCI view, coding a unit automatically transfers the Ada source to the target directory (and target compilation platform if necessary), invokes the target compiler, and produces an object module in the target directory. This module is ready to be linked.
Units may or may not actually be copied to the target; instead, source files visible in the target directory may be symbolic links to the source files in the native view. Check with your customizer or installer for information on how files are transferred to the target.
In batch mode, units may be copied but not compiled; you create a batch script, which controls the remote compilation when it is subsequently executed on the target compilation platform.
- Remote linking: After the closure of a main unit is coded, you can generate a target executable module. Linking the main unit on the host creates an executable module on the target from the compiled object modules.
- Initiating execution: Execution is performed directly on the target platform.
- Debugging: Debugging of a program is initiated directly on the target platform using the target debugging facilities.
- Maintaining consistency: Cross-system consistency management consists of RCI extensions to Apex Control facilities to maintain consistency between the host and target platform for libraries and Ada source files. Some operations are performed automatically; you must request others.
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:
- Ada source is maintained in (or downloaded to) the target directory.
- Ada source is compiled into the program library; that is, the program library contains a compiled representation of units.
- Remote import information, which can be maintained in the library list file, specifies the sublibraries or units (imports) to be used during compilation for some extensions. (Other approaches to imports include unit-by-unit definitions or hierarchical directory structures.)
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 OverviewBefore 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:
- Setting up the network and hardware
- Setting up the remote environment, including the remote operating system, file management, and target compilation system
- Setting up Apex
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:
- Create Target Library
- Delete Target Library
- Refresh Target Imports
- Compare To Target
- Accept Target Changes
- Create Script
- Copy to Target
- Shutdown
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:
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:
- Package Standard from your target compilation system for semantic checking. Your customizer creates this on the host.
- The predefined library units, such as Text_Io, are as specified in Annex C of the Ada LRM. The host environment needs access to LRM-defined packages for the target compilation system to use for semantic checking. Your customizer creates these packages on the host by entering the contents printed in the Ada LRM for your target compilation system.
- The library management and compilation executable scripts allow the customizer to program additional operations involving target library management (create and delete target libraries) and compilation.
- Several text files that specify:
- target-dependent semantics (including target-supported pragmas and attributes, and the contents of the target "package Standard").
- commands to be used for target operations
- Compiler and linker options for your target compilation system.
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:
- Target compilation system: This is the target compiler, which runs on the target compilation platform.
- Target linker: This is the part of the target compilation system that links object modules. It, too, runs on the target compilation platform.
Note: You must include the path to your target compiler's bin directory in your search path.
Looking at an RCI ViewDevelopment 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:
- A compiler key that identifies the target for which you develop code and determines what compilation system to use
- A switch file that defines how the Environment operates; this file defines the values for the /Policy/Switches file in your RCI view
- A set of imports that gives visibility to predefined Ada units that reside outside the subsystem
- A set of properties that specify the host and target architecture, whether the view is an RCI view or not, and the name of the RCI customization (for RCI views).
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:
$APEX_BASE/ada/model.ss/rci_sun4_solaris2_vads_sunos.ada83.3.0.0.relIf 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):
- comp_option_symbol:
<null> =>
<A> => -A<Arg1>
<a> => -a <Arg1>
<c> => -c
<D> => -D <Arg1>
<d> => -d
<E> => -E <Arg1>
<e> => -e
<Ef> => -Ef<Arg1>
<El> => -El
<el> => -el
- link_option_symbol:
<null> =>
<E> => -E <Arg1>
<F> => -F
<K> => -K
The structure of the compile and link commands is defined in the corresponding comp_options_line and link_options_line files in the same directory.
To override the defaults for a particular host view, specify your values in the view_name/comp_option_file (or view_name/link_option_file, as appropriate). You can assign compiler or linker options on a unit by unit basis by associating a value with a unit name, or you can assign values to <default> to use the option with all units in the view.
See Examining and Setting Switches for more information.
- 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:
- RCI_AUTO_TRANSFER: the value of this switch is meaningful only if the RCI_COMPILATION_MODE switch is set to batch. In batch mode, this switch controls whether or not units are automatically copied to the target when they are coded. This switch defaults to False.
- RCI_COMPILATION_MODE: if RCI operations in this view are to take place in batch mode, this switch should be set to batch. The default value for this switch is interactive.
- RCI_COMPILATION_PLATFORM: this switch identifies the machine used to perform operations (such as compilation) in the target directory for non-host-only views.
- RCI_HOST_ONLY: If set to True, this switch indicates that the RCI takes no action on the target compilation platform when the compiler is invoked on units in the view. Views with this switch set to True can still have target directories and target platforms specified, to enable operations which update target library hierarchies or search paths to locate the corresponding target library for all host view import relationships.
Its value is taken from the setting of the Host Only button in the RCI Options window that appears when File > New > New View or File > Copy Object is used to create an RCI view.
- RCI_TARGET_DIRECTORY: this switch identifies the target directory corresponding to the RCI view.
- INTERFACE_ONLY: strictly speaking, this is not an RCI switch, but it should be set to TRUE in the host_only RCI views which correspond to specification-only target API libraries.
Sample Switches entries follow:
RCI_HOST_ONLY: False
RCI_TARGET_DIRECTORY: /home/george/fred/rci_target_dir
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:
host_unit_name target_file_name
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.
- Host RCI view
../Test.ss/target_view.wrk .Rational/ Compilation/ Compilation.cfg Compilation.export_sets Compiler_Key.times hello.1.dna hello.2.dna program.50.lib Exports_Control/... Imports_Control/...
Locks_Control/... Rci/ imports --customization-specific hello.1.rci hello.2.rci target_names.sf Version_Control/... View_Control Model_Description.cfg View_Properties.prop Exports/... Imports/... Policy/ Switches comp_option_file hello.1.ada hello.2.ada link_option_file
- Target Directory
../Rci_Target_Dir .imports --customization-specific .lines --customization-specific .nets --customization-specific .objects --customization-specific .timestamp --customization-specific GVAS_table --customization-specific ada.lib --customization-specific gnrx.lib --customization-specific hello_1_s.ada@ hello_2_b.ada@
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. |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |