B Link Script Details

The link scripts firstly have to create a subroutine, DTASK_APPLIC, which is called by the ADAM fixed part and in turn calls the user’s top-level routine. The difference between alink and ilink is just that the template DTASK_APPLIC for alink contains a call to close down the parameter system after each invocation of the task unless the environment variable ADAM_TASK_TYPE is set to ‘I’.

If the user’s main routine is written in C, a temporary routine, DTASK_WRAP is created as a Fortran-callable wrapper for the user’s routine. DTASK_APPLIC will call DTASK_WRAP, which in turn calls the user’s routine.

During installation (as part of the DTASK library in the PCS package), the actual compile/link command within alink/ilink is edited depending upon the platform and setting of various environment variables. The template command is:

  F77 $FFLAGS -o $EXENAME \
  $XDBX \
  /star/lib/dtask_main.o \
  dtask_applic.f \
  $ALINK_FLAGS1 \
  $ARGS \
  -L/star/lib \
  -lhdspar_adam \
  -lpar_adam \
  ‘dtask_link_adam‘ \
  $ALINK_FLAGS2 \
  Additional system libraries

Notes:

The -xdbx argument is provided to overcome some awkward problems which can arise when debugging ADAM applications. Usually it is sufficient to include -g in the arguments of alink/ilink but sometimes, notably when using xdbx and ups on SunOS, the debuggers do not behave sensibly if required source files are missing so the -xdbx argument should be used instead. The effects of the argument are: