Creating a User Application Library


The following steps are required to create and configure a "user application" development library that references the Unix Sage-ST TM libraries. The Unix Sage-ST TM libraries are located in "/usr/sage/lo" and "/usr/sage/hi."

Create a Unix subdirectory for storing your Ada source code. This subdirectory will become your Ada development library.

      Example: /usr/joe/project
    

Change directory ("cd") to the new subdirectory.

        Example: cd /usr/joe/project
      

Create a new Ada library by typing the command:

      a.mklib i
    

Select option #1 (SELF_TARGET) by typing in a "1" and pressing return.

The following files should have been created in the "/usr/joe/project" directory:

        GVAS_table, ada.lib, gnrx.lib
      

The following subdirectories should have also been created:

        ..imports, .lines, .nets, .objects
      

We now need to modify your "ada path" variable. The "ada path" is used at compile time to resolve references to packages and routines that are not found in your local library (e.g., "/usr/joe/project")

Type the following commands (in the order given):

        a.path i /usr/sage/lo
        a.path i /usr/sage/hi
        aa.path
      

The results from typing the "a.path" command with no arguments should have generated the following:

        /usr/sage/hi
        /usr/sage/lo
        /usr/VADS_3b2/verdixlib
        /usr/VADS_3b2/standard
      

Note: The current working directory (e.g., "/usr/joe/project") is always the first element on the Ada search path, even though it is not displayed by the a.path command.

If your path is incorrect, you can use the following command to remove a subdirectory from your "ada path:" (See Verdix documentation for details.)

        a.path -r /subdirectory_name_here
      

Finally, you need to add "/usr/VADS_3b2/bin", "/usr/sage/bin", and "/usr/sage/cmds" to your Unix "path" variable. This "path" variable is probably initialized in your $HOME/.profile file. Remember that "path" elements are separated by colons. You must execute your .profile file before the new path will take effect. Type the following command:

        . $HOME/.profile
      
You should now be able to compile your first Ada specification file. Verdix expects source code files to be terminated with a ".a" file extension. You may want to adopt the following file naming convention for renaming your Alsys PC source files:
        
          Alsys Name
        
        
          Verdix Name
        
        
          Comments
        
        mytest.ads mytest_s.a   Ada specification file.
        mytest.adb   mytest_b.a    Ada body file.
        mytest.ada   mytest.a    Ada main program/procedure name.
      
As a side note, do not create an executable file that has the name "test", since the shell has a built in command called "test." If you type "test" on the command line, your "test" program will not be executed.

To link an application, you may use the Verdix a.ld command. An example link might be:

        a.ld main_ada_proced_name
      
where "main_ada_proced_name" is the name of your top level Ada procedure. As your program links, you should see a warning generated by the Verdix a.ld command. The warning states:
        a.ld: warning:  WITH1 in /usr/VADS_3b2/verdixlib hidden by
        WITH1 in /usr/sage/lo
        WITH1 in /usr/VADS_3b2/verdixlib IGNORED
      
The warning is not an error and can be ignored safely. It is caused by the custom "/usr/sage/lo/v_usr_conf_b.a" file that is used by Sage-ST TM .

The executable output file generated by the linker will always be named "a.out ." A link script called "ald" (i.e., Ada load) is supplied that can be used to create an executable that has the same name as the main Ada procedure name. Verdix also supplies a command line option to rename a.out. ("ald" is located in the /usr/sage/cmds subdirectory.)

Go Back To Sage-ST TABLE OF CONTENTS

warren.merrill@inl.gov , ftp://sage.inel.gov
Copyright © 1989-2006. Battelle Energy Alliance