Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* Fortran Block Data statements not recognized in libraries
@ 1994-08-04 15:12 Chuck Henkel
  1994-08-04 16:55 ` James Tappin
  1994-08-05 14:09 ` Dennis Murphy
  0 siblings, 2 replies; 5+ messages in thread
From: Chuck Henkel @ 1994-08-04 15:12 UTC (permalink / 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1994-08-08 18:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-08-04 15:12 Fortran Block Data statements not recognized in libraries Chuck Henkel
1994-08-04 16:55 ` James Tappin
1994-08-05  7:53   ` David L Terrett
1994-08-05 14:09 ` Dennis Murphy
1994-08-08 18:00   ` Dave Eklund

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox