From: Alan W. I. <ir...@be...> - 2018-01-07 21:54:22
|
On 2018-01-07 11:03-0000 Arjen Markus wrote: > There is a small issue though with the gfortran compiler under Cygwin. I do not understand it (*) but here is the output to screen if I use the -h option: > $ ./x01f -h > pl_parse_dynamic = T > argv before call to plparseopts(..., PL_PARSE_SKIP) > i = 0, argument = ./x01f > i = 1, argument = -h > /bin/sh: C:\Program: command not found > > > This does not happen for Intel Fortran - then I get an overview of all the options that are available. > > (*) From a closer look at the code I think this is due to the fragment: > > #ifdef HAVE_POPEN > > FILE *pager = NULL; > > if ( getenv( "PAGER" ) != NULL ) > > pager = (FILE *) popen( "$PAGER", "w" ); > > if ( pager == NULL ) > > pager = (FILE *) popen( "more", "w" ); > > if ( pager != NULL ) > > outfile = pager; > > #endif > > It is probably trying to run a pager program like "more" but that does not quite work on Cygwin. Hi Arjen: Since both x01c and x01f have special command-line parsing, I suggest the first thing you should do is try other C and Fortran examples (e.g., x00c or x00f) to see if the -h option works in those less special cases. My guess is it won't work, i.e., the problem you discovered with the -h option on Cygwin is a general one for our standard C and Fortran examples rather than specific to just x01f. I looked up the popen man page on Linux which states it "opens a process by creating a pipe, forking, and invoking the shell". So I assume what the above code fragment does is redirect the normal output of the -h option from stdout to whatever you have specified as the PAGER environment variable or the "more" pager as a fallback if you have not specified PAGER. So I suspect what has happened on your Cygwin platform is you don't have any pager installed. You should be able to fix that by installing "more" via the "util-linux" package and/or "less" via the "less" package (while setting your PAGER environment variable to "less"). Let me know whether one or the other of those two measures fixes the above -h issue. By the way, I highly recommend "less" as a much better pager than "more". So the developers of "less" used some self-deprecating humor when they picked the name of their pager. :-) 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); the Time Ephemerides project (timeephem.sf.net); PLplot scientific plotting software package (plplot.sf.net); 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 __________________________ |