Ufmenu is a utility script/command file that provides
you with the ability to edit, compile, link and run your Open C API programs.
This is only supported on non-Windows workstations.
NOTE: The environment variable/logical UGII_USERFCN must be set to point to the
directory where the Open C API library file(s) reside before you use the link
option. If the environment variable is not set, then uflink
defaults to the standard installation directory.
Ufmenu is invoked when you select the UGOPEN-API
option from UGMENU. After you invoke ufmenu the User
function development environment menu option displays.
+--------------------------------------+
|USER FUNCTION DEVELOPMENT ENVIRONMENT |
+--------------------------------------+
1) Edit 5) change Directory
2) Compile 6) liSt directory
3) Link 7) Non-menu activities
4) Run (external user function) q) Quit
Enter option (1-7, q) [q]:
UFMENU Options
The following paragraphs describe the options found on ufmenu.
You can select options by entering the number of the option or by entering the
capitalized letter in each option name as it appears in the main ufmenu. For example, to list the contents of your current
directory, you can either enter option number 6 or the letter S (liSt directory).
The intent of this section of the manual is to familiarize you with the general
features of the ufmenu utility which apply to all
non-Windows platforms. Compile switches vary from platform to platform. We use
"<path>" to indicate a directory path; in general, this is
specific to your
particular site..
Edit
Allows you to edit a file with the currently specified operating system
editor (for example, vi). The
default editor is specified by the UGII_EDITOR variable. If the file does not
reside in
your current directory, enter the full file specification. You can include the
file extension or use a
wildcard.
Enter option (1-7,q) [q]: 1
Enter file(s) to edit (vi) [block1.c block2.c block3.c bounded_plane.c
testopen.c]: bounded_plane.c
Compile
Invokes the C or C++ compiler which converts the statements of your C or
C++ source file into an
object file. You can specify a file template, such as *.c. This compiles all
the files in your current
directory with the appropriate file extension.
You must include the file extension for your programs. You can compile more
than one file by
delimiting your file names with a space. The compile option automatically
determines the
appropriate compile options for your platform. A list of all the files with a
".c" extension appears
within square brackets. For example:
Enter option (1-7,q) [q]: 2
Enter file(s) (separated by " ") to compile [block1.c block2.c
block3.c bounded_plane.c testopen.c]:
bounded_plane.c
Compiling... bounded_plane.c
Default C compile options: -c -KPIC -Xc -I.
-I<path>
Change compile options (y/n) [n]: n
bounded_plane.c compiled successfully.
Hit <RETURN> to continue.
How to Change Compile Options
The default compile option switches are for both internal and external Open
C API programs. If
you wish to change any of the default options, enter y to the prompt:
"Change compile options (y/n)
[n]:".
The ufmenu script prompts you for the mode (internal
or external), and which compile options to
remove. It then prompts you for options to add to the compile command line. In
the following
example we show how to change compile options.
Enter option (1-7,q) [q]: 2
Enter file(s) (separated by " ") to compile [block1.c block2.c
block3.c bounded_plane.c testopen.c]:
testopen.c block1.c block2.c block3.c
Compiling... testopen.c block1.c block2.c block3.c
Default C compile options: -c +Z -Aa -I.
-I<path>
Change compile options (y/n) [n]: y
Compile internal/external user function (i/e) [i]: e
Remove +Z (y/n) [n]:
Remove -Aa (y/n) [n]:
Remove -I. (y/n) [n]:
Remove -I<path> (y/n) [n]:
Add new options: -g -I/user1/include
New compile options: -c -Z -Aa -I. -I<path> -g
-I<path>
testopen.c compiled successfully.
block1.c compiled successfully.
block2.c compiled successfully.
block3.c compiled successfully.
Hit <RETURN> to continue.
error log file
If your compile should fail, ufmenu creates an
error log file in the current directory. The name of
log file is of the form "username<pid>.complog". Error messages are appended to the log file.
The script displays a message similar to the following:
block1.c did not compile. Refer to username6370.complog for error message.
Link
Links the object file of a primary C or C++ program with the object files
of any subprograms
which can be referenced. The link option calls the uflink
utility . The main object file must reside in your
current directory. You can use a file specification for your subroutines. Ufmenu automatically invokes the uflink
script. The environment variable UGII_USERFCN must be defined and point to the
Open C API library; otherwise, the script defaults to the installation
directory. The following example links an external Open C API image in debug
mode.
Enter option (1-7,q) [q]: 3
Link internal/external user function (i/e) [i]: e
Link a C++ image (y/n) [n]:
Default uflink options: -m
Change uflink options (y/n) [n]: y
Remove -m (y/n) [n]:
Add new options: -d
New uflink options: -m -d
Enter program to link => testopen
Enter any subroutines => block1.o block2.o block3.o
Enter any libraries =>
uflink:WARNING - UGII_USERFCN variable not set.
Using libraries in <path> as a default.
Linking with: block1.o block2.o block3.o.
/bin/cc options: -Wl,-q,-E,-B,immediate,+s,-L,<path> -g
Linking... testopen for external execution.
uflink:link SUCCESSFUL - Wed
Oct 15 10:33:07 PDT 2007
Hit <RETURN> to continue.
Run
Allows you to run an external Open C API program. The following example
shows how an
argument is passed to the program.
Enter option (1-7,q) [q]: 4
Enter external user function to run [testopen]:
Run debug mode (y/n) [n]: n
Enter arguments to pass to testopen []: newbox
Hit <RETURN> to continue.
The next example shows the prompts when you run in debug mode.
Enter option (1-7,q) [q]: 4
Enter external user function to run [testopen]:
Run debug mode (y/n) [n]: y
>
From here, you can now enter debug commands. The debugger and debugger prompt
are platform
specific.
Change Directory
Allows you to change the current directory by entering a new directory
pathname.
Enter option (1-7,q) [q]: 5
Current directory => /users/test/ugopen/test
Enter new directory [.]: /users/test/ugopen
New directory => /users/test/ugopen
List Directory
Lists the contents of the current directory. You can specify a file
template. When you choose this
option, ufmenu displays your current directory and
prompts you for a template of the files to list.
The default template is to list all files. You can enter any valid wildcard
specification.
Current directory => /users/test/ufun
Enter file(s) to list [*]:
Non-menu Activities
Spawns a child process. The script prompts you for
the shell type as follows:
Enter Shell Type (sh/csh/ksh) [ksh]:
The default value is the Korn shell (ksh). You can spawn a Bourne shell (sh)
or a C-shell (csh) by
entering the appropriate value. For example, enter csh
to spawn a C-shell.