[UP]

Converting ASTERIX code from VMS to UNIX

[HOME] [NEXT]

The process of converting third party ASTERIX software is greatly facilitated by the use of the ADAM infrastructure software. It is quite possible to have source code compatability between VMS and UNIX versions of application software.

The following is a procedure for porting a hypothetical spectral analysis program which contains the following VMS components,

The first job is to make any required changes which are compatible with the VMS operation, but essential for UNIX. Once you have a "clean" program running on VMS, copy across all the files to a UNIX machine, putting the filenames in lower case and renaming all VMS files with extension FOR to .f. Rename any include files so that their UNIX filename is exactly the same as the name referenced in the INCLUDE statement (ie. including case). In the example above we'd now have the following files
   SAPPLIC_CMN
   sapplic.f     sapplic.ifl     sapp_1.f     sapp_2.f 
Now start up the ASTERIX development system.
   % astdev
The VMS style include file names must be converted to UNIX ones. An ASTERIX script is provided for this purpose.
   % v2u_include -l SAPPLIC_CMN sapplic.f
   % v2u_include -l SAPPLIC_CMN sapp_1.f
   % v2u_include -l SAPPLIC_CMN sapp_2.f
The -l option tells ASTERIX that the named include file is local and not a system include file. Compile the Fortran files using the following commands (the -c option tells the compiler not to generate an executable),
   % f77 -c sapplic.f
   % f77 -c sapp_1.f
   % f77 -c sapp_2.f
This generates three object files with extension .o which are now combined into an executable by the Starlink linking script alink.
   % alink sapplic.o sapp_1.o sapp_2.o `spec_link` `ast_link`
The last two arguments are linker options scripts which incorporate the spectral fitting library and the ASTERIX libraries respectively. These scripts correspond exactly to their VMS option file counterparts. The link command on VMS for the above would have been,
   $ ALINK SAPPLIC,SAPP_1,SAPP_2,SPECLIB/OPT,ASTOPT/OPT
Finally, compile the interface file and start your application,
   % compifl sapplic
   COMPIFL: Successful completion
   % sapplic


This page is maintained by Asterix, and last updated on 6th October 1997. If you have any comments, please contact asterix@star.sr.bham.ac.uk