archiving block data subroutines...

System Admin Mike Peterson system at alchemy.chem.utoronto.ca
Tue Oct 23 03:50:00 AEST 1990


In article <1990Oct22.033107.5159 at ux1.cso.uiuc.edu> jeffb at aquifer.las.uiuc.edu (Jeffrey Biesiadecki) writes:
>We have a library written in Fortran77 which includes a block data
>subroutine.  If we use "ar" to archive the object files of the library,
>and then try to compile a program using the resulting "lib???.a" file,
>everything works fine EXCEPT the block data subroutine is never executed
>(that is, the initializations are not made). ...

You can make this work properly on most normal systems (Sun, DEC/Ultrix,
Cray/UNICOS, IBM RS/6000, SGI) by:
- giving the BLOCK DATA routine a unique name.
- putting an 'EXTERNAL blockdataname' statement in the subroutine(s)
  that want the COMMON block to be loaded.

Note that this technique will NOT work reliably on Apollo systems :-(.
-- 
Mike Peterson, System Administrator, U/Toronto Department of Chemistry
E-mail: system at alchemy.chem.utoronto.ca
Tel: (416) 978-7094                  Fax: (416) 978-8775



More information about the Comp.sys.sgi mailing list