tar -zxvf g95-x86-linux.tgz
ln -s $PWD/g95-install/bin/*g95* ~/bin/g95
-c | Compile only, do not run the linker. |
-o | Specify the name of the output file, either an object file or the executable. |
Files ending in uppercase letters are preprocessed with the C preprocessor by default, files ending in lowercase letters are not preprocessed by default.
Files ending in ".f", ".F", ".for", and ".FOR" are assumed to be fixed form source compatible with old f77 files. Files ending in ".f90", ".F90", ".f95" and ".F95" are assumed to be free source form.
Simple examples:
g95 -c hello.f90 | Compiles hello.f90 to an object file named hello.o. |
g95 hello.f90 | Compiles hello.f90 and links it to produce an executable a.out. |
g95 -c h1.f90 h2.f90 h3.f90 | Compiles multiple source files. If all goes well, object files h1.o, h2.o and h3.o are created. |
g95 -o hello h1.f90 h2.f90 h3.f90 | Compiles multiple source files and links them together to an executable file named 'hello'. |
-cpp | Force the input files to be run through the C preprocessor |
-no-cpp | Prevent the input files from being preprocessed |
-Dname[=value] | Define a preprocessor macro |
-Uname | Undefine a preprocessor macro |
-E | Show preprocessed source only |
-Idirectory | Append 'directory' to the include and module files search path |
-Wall | Enable most warning messages |
-Wimplicit-none | Same as -fimplicit-none |
-Wline-truncation | Warn about truncated source lines |
-Wno=numbers | Disable a comma separated list of warning numbers |
-Wunused-vars | Warn about unused variables |
-Wunset-vars | Warn about unset variables |
-Wunused-module-vars | Warn about unused module variables. Useful for ONLY clauses |
-Wprecision-loss | Warn about precision loss in implicit type conversions |
-fbackslash | Interpret backslashes in character constants as escape codes. Use -fno-backslash to treat backslashes literally. |
-fdollar-ok | Allow dollar signs in entity names |
-ffixed-form | Assume that the source file is fixed form |
-ffixed-line-length-132 | 132 character line width in fixed mode |
-ffixed-line-length-80 | 80 character line width in fixed mode |
-ffree-form | Assume that the source file is free form |
-fimplicit-none | Specify that no implicit typing is allowed, unless overridden by explicit IMPLICIT statements |
-fmod=directory | Put module files in directory |
-fmodule-private | Set default accessibility of module-entities to PRIVATE |
-M | Produce a Makefile dependency line on standard output |
-std=F | Warn about non-F features |
-std=f2003 | Strict fortran 2003 checking |
-std=f95 | Strict fortran 95 checking |
-i8 | Set kinds of integers without kind specifications to double default precision |
-r8 | Set kinds of reals without kind specifications to double precision |
-d8 | Implies -i8 and -r8. |
-fcase-upper | Make all public symbols uppercase |
-fleading-underscore | Add a leading underscore to public names |
-fonetrip | Execute DO-loops at least once. (Buggy fortran 66) |
-fpack-derived | Try to layout derived types as compact as possible. Requires less memory, but may be slower |
-fqkind=n | Set the kind for a real with the 'q' exponent to n |
-fsecond-underscore | Append a second trailing underscore in names having an underscore (default). Use -fno-second-underscore to suppress. |
-funderscoring | Append a trailing underscore in global names (default). Use -fno-underscoring to suppress. |
-fstatic | Put local variables in static memory where possible. |
-max-frame-size=n | How large a single stack frame will get before arrays are allocated dynamically |
The values of the various variables are always strings, but the strings can be interpreted as integers or boolean truth values. Only the first character of a boolean is examined and must be 't', 'f', 'y', 'n', '1' or '0' (uppercase OK too). If a value is bad, no error is issued and the default is used.
G95_STDIN_UNIT | Integer | Unit number that will be preconnected to standard input. No preconnection if negative, default is 5. |
G95_STDOUT_UNIT | Integer | Unit number that will be preconnected to standard output. No preconnection if negative, default is 6. |
G95_STDERR_UNIT | Integer | Unit number that will be preconnected to standard error. No preconnection if negative, default is 0. |
G95_USE_STDERR | Boolean | Sends library output to standard error instead of standard output. Default is Yes. |
G95_ENDIAN | String | Endian format to use for I/O of unformatted data. Values are BIG, LITTLE or NATIVE. Default is BIG. |
G95_CR | Boolean | |
Output carriage returns for formatted sequential records. Default true on windows, false elsewhere. | ||
G95_IGNORE_ENDFILE | Boolean | Ignore attempts to read past the ENDFILE record in sequential access mode. Default false |
G95_TMPDIR | String | Directory for scratch files. Overrides the TMP environment variable. If TMP is not set /var/tmp is used. No default |
G95_UNBUFFERED_ALL | Boolean | If TRUE, all output is unbuffered. This will slow down large writes but can be useful for forcing data to be displayed immediately. Default is False. |
G95_SHOW_LOCUS | Boolean | If TRUE, print filename and line number where runtime errors happen. Default is Yes. |
G95_OPTIONAL_PLUS | Boolean | Print optional plus signs in numbers where permitted. Default FALSE. |
G95_DEFAULT_RECL | Integer | Default maximum record length for sequential files. Most useful for adjusting line length of preconnected units. Default is 50000000. |
G95_LIST_SEPARATOR | String | Separator to use when writing list output. May contain any number of spaces and at most one comma. Default is a single space. |
G95_EXPAND_UNPRINTABLE | Boolean | For formatted output, print otherwise unprintable characters with \-sequences. Default No. |
G95_QUIET | Boolean | Suppress bell characters (\a) in formatted output. Default No. |
G95_SYSTEM_CLOCK | Integer | Number of ticks per second reported by the SYSTEM_CLOCK() intrinsic in microseconds. Zero disables the clock. Default 100000. |
G95_SEED_RNG | Boolean | If true, seeds the random number generator with a new seed when the program is run. Default false. |
G95_MINUS_ZERO | Boolean | If true, allows minus zeros to be printed correctly, contrary to the standard. Default TRUE. |
G95_MEM_INIT | String | How to initialize allocated memory. Default value is NONE for no initialization (faster), NAN for a Not-a-Number with the mantissa 0x40f95 or a custom hexadecimal value. |
G95_MEM_SEGMENTS | Integer | Maximum number of still-allocated memory segments to display when program ends. 0 means show none, less than 0 means show all. Default 25 |
G95_MEM_MAXALLOC | Boolean | If true, shows the maximum number of bytes allocated in user memory during the program run. Default No. |
G95_MEM_MXFAST | Integer | Maximum request size for handing requests in from fastbins. Fastbins are quicker but fragment more easily. Default 64 bytes. |
G95_MEM_TRIM_THRESHOLD | Integer | Amount of top-most memory to keep around until it is returned to the operating system. -1 prevents returning memory to the system. Useful in long-lived programs. Default 262144. |
G95_MEM_TOP_PAD | Integer | Extra space to allocate when getting memory from the OS. Can speed up future requests. Default 0. |
G95_SIGHUP | String | Whether the program will IGNORE, ABORT or SUSPEND on SIGHUP. Default ABORT. |
G95_SIGINT | String | Whether the program will IGNORE or ABORT or SUSPEND on SIGINT. Default ABORT |
G95_FPU_ROUND | String | Set floating point rounding mode. Values are NEAREST, UP, DOWN, ZERO. Default is NEAREST. |
G95_FPU_PRECISION | String | Precision of intermediate results. Value can be 24, 53 and 64. Default 64. Only available on x86 and IA64 compatibles. |
G95_FPU_DENORMAL | Boolean | Raise a floating point exception when denormal numbers are encountered. Default no. |
G95_FPU_INVALID | Boolean | Raise a floating point exception on an invalid operation. Default No. |
G95_FPU_ZERODIV | Boolean | Raise a floating point exception when dividing by zero. Default No. |
G95_FPU_OVERFLOW | Boolean | Raise a floating point exception on overflow. Default No. |
G95_FPU_UNDERFLOW | Boolean | Raise a floating point exception on underflow. Default No. |
G95_FPU_INEXACT | Boolean | Raise a floating point exception on precision loss. Default No |
G95_FPU_EXCEPTIONS | Boolean | Whether masked floating point exceptions should be shown after the program ends. Default No |
G95_UNIT_x | String | Overrides the default unit name for unit x. |
G95_UNBUFFERED_x | Boolean | If true, unit x is unbuffered |
-2 | End of record |
-1 | End of file |
0 | Successful return |
Operating system errno codes (1 - 199) | |
200 | Conflicting statement options |
201 | Bad statement option |
202 | Missing statement option |
203 | File already opened in another unit |
204 | Unattached unit |
205 | FORMAT error |
206 | Incorrect ACTION specified |
207 | Read past ENDFILE record |
208 | Corrupt unformatted sequential file |
209 | Bad value during read |
210 | Numeric overflow on read |
211 | Out of memory |
212 | Array already allocated |
213 | Deallocated a bad pointer |
214 | Bad record read on input |