Next: Interface Files
Up: Compiling and Linking
Previous: Include Files
ADAM Link Scripts
Two shell scripts are provided to link ADAM programs.
alink is used to link A-tasks and A-task monoliths, and
ilink to link I-tasks.
The executable images produced may be run either from a suitable user-interface
such as
ICL,
or directly from the shell.
The following description uses alink in examples; ilink is
used in the same way.
To link an ADAM program, ensure that /star/bin is added to your
environment variable PATH, then type:
% alink [-xdbx] file [arguments]
Where:
- -xdbx
- optional (but must be the first argument if used),
overcomes some problems with debugging ADAM tasks, notably with xdbx
and ups on SunOS, by supplying dummy source files for required ADAM
system routines. It also has the effect of inserting a -g option into
the argument list. For more details, see Appendix
.
- prog_module
- specifies a file containing the task's main
subroutine. The filename should be of the form
path/name.f, path/name.c,
path/name.o or path/name.
The path/ component is optional but
name must be the name of the program's main subroutine and will
be the name of the executable file produced in the current working directory.
If the file extension is .f or .c, the file will be compiled
appropriately; if none of the permitted extensions is given,
.o is appended.
Note that after a .f file has been compiled, on some platforms the
.o file will be retained in the current working directory so that
subsequent alinks with an unchanged .f file may specify the
name with no extension ( or .o).
The object files for any compiled C files will always be retained.
- arguments
- optional, is any additional arguments (library
specifications, compiler options etc.) legal for the Fortran
compiler, or any C files to be compiled separately and linked in.
The list of Starlink libraries automatically included in the link is given in
Appendix
; the method of including other Starlink libraries in ADAM
programs will be specified in the relevant Starlink User Note.
In most cases it will be:
% alink prog_module `pkg_link_adam`
where pkg is the specific software item name e.g.
ndf.
Appendix
gives details of the command used within
alink/ilink to compile and/or link the tasks.
This may assist users who wish to alter the standard behaviour.
By default, programs are statically linked with the Starlink libraries.
On platforms where shared libraries are installed, programs may be linked with
them by setting the environment variable ALINK_FLAGS1 appropriately.
On currently supported systems it should be set to -L/star/share.
(See Appendix
for more details.)
Next: Interface Files
Up: Compiling and Linking
Previous: Include Files
ADAM
Starlink User Note 144
A J Chipperfield
17 August 2001
E-mail:ussc@star.rl.ac.uk
Copyright © 2000 Council for the Central Laboratory of the Research Councils