6 COMPILING AND RUNNING PROGRAMS

Compiling and linking a simple program is very straight-forward. If your program source file is named prog.f, then the commands:

  % star_dev
  % alink prog.f -L/star/lib ‘img_link_adam‘

will compile the source and link it against IMG (you should replace the /star with where your system is installed on non-Starlink machines). The final product is an executable called prog, that you run by typing:
  % prog

(note the % is the shell-prompt and should not be typed, and the are grave signs that execute the command img_link_adam). If you have a program that has several modules that are compiled independently then you could use a command like:
  % alink prog.f mysub1.o mysub2.o ‘img_link_adam‘

The star_dev command only needs to be run once, as it creates a permanent soft link for accessing the include file SAE_PAR. The alink command is described more fully in SUN/144.