PROCEDURE install_lib99 (
  status)

"  This procedure installs lib99 vector or lib99 scalar
"  based on the processor model number.  The list of model
"  numbers of vector processors was taken from
"  PMT$PROCESSOR_MODEL_NUMBER deck.  There is a note in that
"  deck to update this procedure if the list changes.

VAR
  command_file: file = $local//$name($unique)
  high_cycle: integer
  ignore_status: status

  lib99_library: file
  lib99_file: file
  local_status: status
  model_number: string

  name_lib99_file: name = lib99
  name_lib99_vector_180 : name = lib99_vector_180
  name_lib99_vector_2000: name = lib99_vector_2000
  name_lib99_scalar: name = lib99_scalar

  rav$installation_defaults: (XREF) rat$installation_defaults
  rav$installation_environment: (XREF) rat$installation_environment
  rav$subproduct_information: (XREF) rat$subproduct_information


VAREND


  install_block: ..
    BLOCK

"  Install for both correction and release.

  model_number = $processor(model_number, 0)
  IF (model_number = '990') OR (model_number = '990E') OR (model_number = '9923') ..
        OR (model_number = '9943') THEN
    " This is a 180 vector processor.
    lib99_library = ..
      rav$subproduct_information.actual_installation_path//name_lib99_vector_180
  ELSEIF (model_number = '20V1') OR (model_number = '20U1') THEN
    " This is a 2000 vector processor.
    lib99_library = ..
      rav$subproduct_information.actual_installation_path//name_lib99_vector_2000
  ELSE
    " This is a scalar processor.
    lib99_library = ..
      rav$subproduct_information.actual_installation_path//name_lib99_scalar
  IFEND

  IF NOT $file(lib99_library permanent) THEN
    local_status = $status(FALSE, 'PF', pfe$unknown_permanent_file, $string(lib99_library))
    EXIT install_block WHEN NOT local_status.normal
  IFEND

  lib99_file = ..
    rav$subproduct_information.actual_installation_path//name_lib99_file

  $system.put_line l=' Installing '//$string(lib99_file) o=$job_log
  install_file f=lib99_library t=lib99_file status=local_status
  EXIT install_block WHEN NOT local_status.normal

  $system.create_file_permit f=lib99_file g=public am=(read execute) ..
    sm=(read execute)

  BLOCKEND install_block

  EXIT procedure WITH local_status WHEN NOT local_status.normal

PROCEND install_lib99

