From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 16c06c,dd479f019343c772 X-Google-Attributes: gid16c06c,public X-Google-Thread: fee84,dd479f019343c772 X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-08-05 04:29:52 PST Path: bga.com!news.sprintlink.net!uunet!usc!elroy.jpl.nasa.gov!decwrl!purdue!news.bu.edu!taco.cc.ncsu.edu!news From: csh@eos.ncsu.edu (Chuck Henkel) Newsgroups: comp.unix.osf.osf1,ncsu.eos Subject: Fortran Block Data statements not recognized in libraries Date: 04 Aug 1994 15:12:58 GMT Organization: NCSU Nuclear Engineering Distribution: world Message-ID: Reply-To: csh@eos.ncsu.edu (Chuck Henkel) NNTP-Posting-Host: ners6k4.ne.ncsu.edu X-Attribution: csh Context: DEC AXP 3000 model 300 OSF/1 v 2.0 DEC Fortran v3.4 Problem: When I bundle my block data routines into a library, the initializations are not performed. Outside of a library, things appear to work, but I'm not crazy about the prospect of having to restructure my makefiles. The release notes contain the following statement: o The following changes were made to the decfort compiler since DFAO V3.3: [...] - Make named block data in library work. What am I missing? Is it generally advisable to avoid using libraries and just string out all the .o's on the link line? Illustration: c=== main.f common /waa/ foo real foo write (*,*) 'before sub, foo=',foo call sub write (*,*) 'after sub, foo=',foo end c=== sub.f subroutine sub common /waa/ foo real foo foo = 2.0 end c=== bd.f block data bd common /waa/ foo real foo data foo / 1.0 / end ==== WORKS ==== % f77 -o waa main.f sub.f bd.f % ./waa before sub, foo= 1.000000 after sub, foo= 2.000000 ==== WORKS ==== ==== FAILS ==== % f77 -c main.f % f77 -c sub.f % f77 -c bd.f % ar rv waa.a sub.o bd.o % f77 -o waa main.o waa.a % ./waa before sub, foo= 0.0000000E+00 after sub, foo= 2.000000 ==== FAILS ==== -- Chuck Henkel NCSU Nuclear Engineering