Xref: utzoo comp.lang.fortran:3969 comp.sys.sgi:6391 Path: utzoo!attcan!uunet!cs.utexas.edu!news-server.csri.toronto.edu!helios.physics.utoronto.ca!alchemy.chem.utoronto.ca!system From: system@alchemy.chem.utoronto.ca (System Admin (Mike Peterson)) Newsgroups: comp.lang.fortran,comp.sys.sgi Subject: Re: archiving block data subroutines... Message-ID: <1990Oct22.175000.1151@alchemy.chem.utoronto.ca> Date: 22 Oct 90 17:50:00 GMT References: <1990Oct22.033107.5159@ux1.cso.uiuc.edu> <1990Oct22.130143.29775@cs.dal.ca> Distribution: comp Organization: University of Toronto Chemistry Department Lines: 18 In article <1990Oct22.033107.5159@ux1.cso.uiuc.edu> jeffb@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@alchemy.chem.utoronto.ca Tel: (416) 978-7094 Fax: (416) 978-8775