For my recent testing of the BUILD_SHARED_LIBS=ON/ENABLE_DYNDRIVERS=OFF case
I noticed a peculiar stdout result for example 14 for f77 and f95 which was

Enter graphics output file name: Demo of multiple output streams via the psc
driver.
Running with the second stream as slave to the first.

Notice the "Enter graphics output file name:" output is first rather than
last as in the other examples.  That message is output via the C library and
is a result of the second plinit which occurs far after the fortran write
statements that produce "Demo of multiple output stream..." etc., messages.

The issue for this example is gfortran and the C library use independent
buffers to buffer what they send to stdout, and the C library finished its
output first under these circumstances. I suspect it is just by chance that
we haven't seen this issue for the default
BUILD_SHARED_LIBS=ON/ENABLE_DYNDRIVERS=ON case.

A gfortran workaround for this issue is to

export GFORTRAN_UNBUFFERED_PRECONNECTED=y

before running the fortran examples.  That confirms it has to do with the
stdout buffering, but the above is not a general fix.

I have committed (revision 9319) a general fix for this issue which involves
"call flush(6)".  I have checked in the appropriate documentation that the
flush routine is available in fortran support libraries for the g77,
gfortran, absoft, intel, and Portland group compilers so I think this fix
should probably be okay on most if not all platforms.  However, I don't know
whether "call flush(6)" works for the native Windows fortran compiler so I
hope those with access to that compiler will comment.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to