Hello Alan, On Mon, 23 Jan 2012 11:45:22 -0800 (PST) "Alan W. Irwin" <[email protected]> wrote: > Hi Arjen: > > I just spotted something of interest in the >gfortran-4.4.5 documentation > with respect to command-line parsing and the Fortran >2003 standard. > > To review the current status of Fortran command-line >parsing, > bindings/f95/configurable.f90 uses iargc and getarg to >parse the > command line. These two routines are gfortran >extensions to be > backwards compatible with the g77 compiler and most >other Fortran > compilers. However, iargc and getarg apparently were >never part of > any standard, and the implementation sometimes sucks for >some > platforms. (As can be seen by the problems on Cygwin >with them, and > the fact that they only work in static libraries for the >Windows > case.) > ... > > So here is the key question: > > Are COMMAND_ARGUMENT_COUNT and GET_COMMAND_ARGUMENT also >available on ifort > and also native Windows Fortran compilers? >
Yes, I think it is - I know for sure it is implemented in Ifort (from version 10.x onwards or at the very least 11.x). I would guess that any maintained compiler implements these routines. > If your tests show that is true, then I think we should >update > configurable.f90 to use those routines since they are in >the Fortran > 2003 standard (unlike iargc and getarg). > > I think that "in the Fortran 2003 standard" argument is >already enough > motivation for making the switch. However, I am also >hoping the > standards-compliant COMMAND_ARGUMENT_COUNT and >GET_COMMAND_ARGUMENT > routines will be properly implemented on Windows so it >will no longer > be necessary to always place configurable.f90 in a >static library on that > platform even when the rest of the Fortran libraries are >shared. > I have seen some problems with the combination of programs and dynamic libraries on both Windows and Linux, but that may be due to the fact that the dynamic library in question was dynamically loaded (that is: not as part of the link step, but by means of dlopen() and the like). I will experiment with this set-up to make sure there are no problems. (For compilers that do not implement the F2003 intrinsics there is actually a workaround possible that does not effect the others. It relies on a little used but completely standard feature of Fortran - the use and non-use of the external statement. But let us go that route only when it is clear that there are compilers around that do NOT implement these new intrinsics) Regards, Arjen DISCLAIMER: This message is intended exclusively for the addressee(s) and may contain confidential and privileged information. If you are not the intended recipient please notify the sender immediately and destroy this message. Unauthorized use, disclosure or copying of this message is strictly prohibited. The foundation 'Stichting Deltares', which has its seat at Delft, The Netherlands, Commercial Registration Number 41146461, is not liable in any way whatsoever for consequences and/or damages resulting from the improper, incomplete and untimely dispatch, receipt and/or content of this e-mail. ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ Plplot-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/plplot-devel
