Upgrade Guide > Upgrade Guide > Considerations for OpenVMS > Application Rebuilding > Building Member_Aligned Against Ingres 2.6 or 2006
Was this helpful?
Building Member_Aligned Against Ingres 2.6 or 2006
Note:  This section applies only to migrating from releases prior to Ingres II 2.0/0011 (axm.vms/00).
With the move to a member_aligned version of Ingres, some applications must be rebuilt. You must rebuild applications that connect directly to an installation located on the same node, or through Ingres Net on the client node.
Building Vision and Application-By-Forms applications member_aligned is the default behavior, with no further changes being required from the developer.
C
/MEMBER_ALIGNED
Pascal
/ALIGN=ALPHA_AXP
COBOL
/ALIGNMENT=PADDING
Fortran
/ALIGNMENT=ALL
If an application cannot be built using Alpha member alignment, it is possible to rebuild it with the Ingres components naturally aligned. The steps needed for C and COBOL applications are described in the following sections.
These changes require modification to the Ingres supplied files only and not the application code. Even by performing the steps listed here, you still must recompile all parts of the application that interface with Ingres or that use any structures declared in the Ingres header files.
By default, user applications are built using the same compiler options used to build the Ingres libraries and applications. If these options are not used, proceed carefully.
The introduction of the member_aligned version of Ingres occurred when alignment-related memory issues were encountered in Ingres II 2.0/9808 (axp.vms/00). If any applications are built using un-aligned structures with the communicating interface to Ingres, data corruption is likely to occur.
Modifications Required For C Applications
To build C applications byte-aligned with Ingres, a number of files require modification. Any modifications made may need to be re-applied following the installation of an Ingres patch.
The first files to modify are the C header files supplied in the following directories:
II_SYSTEM:[INGRES.DEMO.API.ASC]
II_SYSTEM:[INGRES.DEMO.UDADTS]
II_SYSTEM:[INGRES.FILES]
At this time, the only header files that contain Ingres structure definitions need modification, these are:
II_SYSTEM:[INGRES.DEMO.API.ASC]ASC.H
II_SYSTEM:[INGRES.DEMO.UDADTS]UDT.H
II_SYSTEM:[INGRES.FILES]ABFURTS.H,
II_SYSTEM:[INGRES.FILES]EQSQLCA.H,
II_SYSTEM:[INGRES.FILES]EQSQLDA.H,
II_SYSTEM:[INGRES.FILES]FRAME2.H,
II_SYSTEM:[INGRES.FILES]FRAME60.H,
II_SYSTEM:[INGRES.FILES]FRAME61.H,
II_SYSTEM:[INGRES.FILES]IIADD.H,
II_SYSTEM:[INGRES.FILES]IIAPI.H,
II_SYSTEM:[INGRES.FILES]OSLHDR.H,
II_SYSTEM:[INGRES.FILES]RAAT.H,
II_SYSTEM:[INGRES.FILES]SPATIAL.H
On the first line in each of the above files add:
#pragma member_alignment save
#pragma member_alignment
On the last line in each of the above files add:
#pragma member_alignment restore
Note:  The "#" of the #pragma instruction must be the first character on the line.
The purpose of these pragmas is to direct the compiler to naturally align the elements of the defined structures, then to restore the alignment strategy used before the header file was included.
One further change is required to allow Application-By-Forms and Vision applications to successfully build with unaligned code. In II_SYSTEM:[INGRES.FILES]DCC.COM, replace the line
$ cc/standard=vaxc/float=ieee_float/nooptimize/nolist
with:
$ cc/NOMEMBER_ALIGNMENT/GRANULARITY=BYTE -
/standard=vaxc/float=ieee_float/nooptimize/nolist
Modifications Required For COBOL Applications
To achieve the same result for embedded COBOL applications, the following statements must be added to these files:
II_SYSTEM:[INGRES.FILES]EQSQLCA.COB, II_SYSTEM:[INGRES.FILES]ESQLDA.COB
On the first line of the above files, add:
*DC SET ALIGNMENT
On the last line of the above files, add:
*DC END-SET ALIGNMENT
The II_SYSTEM:[INGRES.FILES]UTCOM.DEF file requires the removal of the qualifier "/alignment=padding" from the COBOL compile statements.
 
Last modified date: 01/30/2023