From: csh@eos.ncsu.edu (Chuck Henkel)
Subject: Fortran Block Data statements not recognized in libraries
Date: 04 Aug 1994 15:12:58 GMT [thread overview]
Message-ID: <CSH.94Aug4111259@ners6k4.eos.ncsu.edu> (raw)
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
next reply other threads:[~1994-08-04 15:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1994-08-04 15:12 Chuck Henkel [this message]
1994-08-04 16:55 ` Fortran Block Data statements not recognized in libraries James Tappin
1994-08-05 7:53 ` David L Terrett
1994-08-05 14:09 ` Dennis Murphy
1994-08-08 18:00 ` Dave Eklund
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox