[Previous]
[Next]
NAME:
olb
PURPOSE:
Recompile all F77 subroutines and functions, and create object library
libgen.a from the object files
CALLING SEQUENCE:
olb
olb module (where 'module' is an F77 module, e.g. forgen)
INPUTS:
Fortran files selected from a number of subdirectories (see PROCEDURE).
OPTIONAL INPUTS:
-g77 use g77 compiler
-intel use Intel Fortran compiler
-pgi use Portland compiler
-absoft or $ABSOFT set
use Absoft compiler
-dir=<dir> destination directory for static library
If neither keyword or environment variable is set then g77 or Intel
compiler is used (whichever is found first using 'which')
OUTPUTS:
New or updated object library libgen.a in $for (when executed on
the '$SMEI_ACCOUNT' software account) or $myfor (when executed on a
user account).
CALLS:
mk, tine.run_cmd, tiny.args, tiny.is_there
SIDE EFFECTS:
A compilation status line is added to $sys/olb.log
RESTRICTIONS:
Can only be executed from the software account (i.e. $USER=$SMEI_ACCOUNT).
A line is added to $sys/olb.log with the time of compilation and
the module updated (if present)
PROCEDURE:
> If no explicit module is specified then a hardcoded list of
Fortran files is used from $for and $SMEI_FOR, mostly from
subdirectories 'lib' and 'os' (containing OS-dependent files)
> If an explicit module with name 'module' is specified then the
file 'module.f' is processed after looking for it in directories
$myfor, $for and $SMEI_FOR, respectively.
> Object files are created in $temp and deleted after use
> The library is created in $for (on the software account) or $myfor
(on a user account).
> The compilation command looks for include files in the directories
$for/h, $SMEI_FOR/h and $SMEI_FOR/h/linux.
> Two other switches are included:
-ffixed-line-length-none -> extended fortran
-c -> suppresses linking into executable
Some of the fortran files are compiled with the -w switch added to
suppress warning messages, mostly about unimplemented intrinsics such
as cosd, sind, etc.
An earlier version also used switches to be able to use our old
'signal' subroutine (signal is a unix function included in the
badu77 group and the unix group of intrinsics):
-fbadu77-intrinsic-hide
-funix-intrinsic-hide
Since 'signal' has been renamed 'say' we don't need these anymore.
> For gcc the machine type is determined with gcc -dumpmachine and
the version number with gcc -dumpversion.
For the Intel compilers -dumpmachine doesn't work, and -dumpversion
only works for version 8.0. ifc -dumpversion is used to determine
the version number. If it doesn't work version 6.0 is assumed (this
is the only version of ifc prior to 8.0 that we used).
MODIFICATION HISTORY:
FEB-2001, Paul Hick (UCSD/CASS)
SEP-2002, Paul Hick (UCSD/CASS)
Removed -fdollar-ok option from g77 compilations (all dollar
signs in variable names should have been removed by now).
SEP-2004, Paul Hick (UCSD/CASS)
The name of the libgen library now tries to code
compiler information into the file name.
For g77 the name now is libgen_<machine>_gnu_<version>.a
For Intel ifc it is libgen_intel_<version>
On the software account the library is now created in
$SMEI_LIB instead of $for.
OCT-2004, Paul Hick (UCSD/CASS)
Added Portland compiler.
JAN-2004, Paul Hick (UCSD/CASS)
Converted from bash to Python.
SEP-2007, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Added get_compiler_intel.f and get_compiler_gnu.f
to list of files to be skipped.
[Previous]
[Next]
NAME:
options_set_key
PURPOSE:
Processing a piece of the options specified on the
command line.
CALLING SEQUENCE:
options_set_key <cmd-line-chunk>
INPUTS:
cmd-line-chunk piece of cmd line (e.g. '--dry-run').
The piece starts with '-' or '--',
and continues upto the next space or '='.
OUTPUTS:
Up to 6 global bash variables are set:
__one_name__, __one_control__, __one_argument__, __one_type__,
__one_range__, __one_default__.
__one_name__
If the cmd line chunk is not recognized as a valid
key in __OPTION__ it is set to the whole input chunk
(this becomes a 'depth_charge' option)
In this case __one_type__='__depth_charge__'.
If the chunk is recognized as a valid option,
it is set to the matching __OPTION__ key.
example: '--dry-run,-n'.
In this case __one_type__ is one of 'b'(ool), 'i'(nteger),
's'(tring) or 'a'(rray)
__one_type__
one of: 'b','i','s','a' or '__depth_charge__'
See description of '__one_name__' above.
For an unrecognized 'depth_charge' chunk no other global vars
are set.
For a recognized option from __OPTION__, two additial
global var are always set:
__one_control__
the bash control variable that will be assigned the value
specified on the cmd line
example: DRYRUN (must contain at least one uppercase char
to differentiate it from '__one_argument__')
__one_argument__
The lowercase version of '__one_control__'. This receives
a string describing the option as specified on the cmd line,
example: '--dry-run', '--verbose 2'.
Two more global vars may or may not be defind:
__one_range__
An integer range of values if __one_type__='i', or a
list of string, separated by a comma or vertical bar,
if __one_type__='s'.
__one_default__
Default value for 'string' or 'array' types.
The default for 'integer' is zero. This is used if the
option is not specified on the cmd line.
RESTRICTIONS:
The function will abort if one of these conditions is met:
- the specified chunk matches more than one valid option
- if the chunk cannot be matched to a valid option
(unless __DEPTH_CHARGE__ is set).
- if the chunk matches a valid option for which no control
variable is specified in __OPTION__
- if the chunk matches a valid option for which an invalid
type is specified in __OPTION__.
- if the control variable does not contain any uppercase chars
MODIFICATION HISTORY:
JAN-2013, Paul Hick (UCSD/CAIDA; pphick@caida.org)
Added documentation.
[Previous]
[Next]
NAME:
options_set_value
PURPOSE:
CALLING SEQUENCE:
options_set_value <cmd-line-chunk>
INPUTS:
<cmd-line-chunk> piece of cmd line following
an equal sign or a space, and
representing the value for an option
<other-chunk> the cmd-line chunk before the equal
sign or space
(is it not better to use a piece of '__one_name__'
here?? Preferably the long option def??)
In addition, up to 6 global bash variables set
by the last call to options_set_key are available:
__one_name__, __one_control__, __one_argument__, __one_type__, __one_range__, __one_default__
MODIFICATION HISTORY:
JAN-2013, Paul Hick (UCSD/CAIDA; pphick@caida.org)
Added documentation.