Overview of Getting Help, Editors, Compilers and Debuggers
Tom G. (dragon@slac.stanford.edu), SLAC, 23 August 1994
Return to: SLAC Home Page --> BABAR Home Page --> Computing Home Page --> Programmimg Page
Getting help
Most UNIX machines support the "man xxx" command to get information about the "xxx" command. (Here man stands for "manual", i.e. those large printed books we all like so well). Thus, "man emacs" should cause some help information
about the emacs command to be displayed on your terminal screen. A special form of man, called "apropos" is designed to help you find commands related to a certain topic, e.g. "apropos fortran". A variation on the man command is
"xman" which is an X-window version containing a command browser. For GNU software there is also the "xinfo" command, the entry into help files for many GNU products.
Many UNIX vendors also provide a slick X-window help system which, unfortunately, is different on each machine. For example, IBM supplies the command "info" for the RS/6000 workstations, which brings up a fancy window allowing you to request
information on any command or even to browse entire "printed" manuals. (Note that on the IBM, the info command is a complete replacement for man, at least for most basic operating system commands like "ls".)
At SLAC we also have a special command called "aid" (written by Dennis Wisinski) which is designed to give you useful information as well as pointers to the right command(s), e.g. "aid fortran". The SLAC aid command allows users to create
their own simple databases of useful memory-joggers. Type "aid aid" to find out more.
Other sources of information:
Editors
Emacs is available on all SLAC UNIX machines as well as most UNIX machines around the world, thus making knowledge of its use highly portable. It is a text-editor driven by control characters, although most machines support, for example, arrow keys for
moving the cursor. Emacs is invoked with the command:
emacs filename
Once within emacs, typing Ctrl-h (i.e. holding down the Control key while typing "h") will invoke an interactive help system. The command "man emacs" will give you help relating to the invocation of emacs on the command
line. The "xinfo" command is another way to browse the emacs help system. There is additional information at SLAC in /usr/local/doc/FAQ/Emacs.
In the directory /usr/local/src/emacs/current-src/etc you will find:
TUTORIAL a quick tutorial for new emacs users
refcard.ps a handy reference card (6pp, PostScript)
refcard.tex TeX version of the refcard
(which can be printed in 3 column format)
Other editors you may encounter (some only on certain machines):
vi rudimentary screen-mode editor on _all_ UNIX machines
ne "nice editor" screen-mode
xedit very simple X-window text editor
xe XEDIT from those good old VM days
Compilers
Compilers are typically invoked to compile and link a simple program like this:
gcc myprog.c
which compiles and links the C program myprog.c (using the GNU compiler) and creates an executable called a.out in your current directory.
gcc -g -o myprog myprog.c
will compile (with debugger symbols) and link myproc.c and create an executable called "myprog". Use "man" or other help command for more complete details. Here are some of the currently available compilers at SLAC.
Machine FORTRAN77 Fortran 90 C C++
------------------------------------------------------------------
NeXT f77 f90 gcc g++
cc
Sun f77 f90 gcc g++
cc
IBM f77 f90 gcc g++
xlf fort90 xlc xlC
cc
Note that compilers on the various systems may have some extremely useful options, such as creating a listing file or load map, or specifying ANSI C (rather than pre-ANSI "K&R" C), etc. Use the appropriate help facility on your machine to investigate
these and other options. Also, at the moment, all of the Fortran 90 compilers are really translators produced by the Numerical Analysis Group, NAG. Soon, the xlf command on the IBMs will invoke a true optimizing Fortran 90 compiler.
There are some excellent on-line tutorials for C and C++. That for C is located in $BFROOT/doc/Miscellaneous/C/Coronado_tutorial, and that for C++ is in $BFROOT/doc/Miscellaneous/C++/Coronado_tutorial/v2.2. These provide text along with code
examples.
Debuggers
Once you have compiled and linked (using the "-g" compiler option to get symbol information) a program, invoke a debugger with one of the following commands. Gdb is a line-mode debugger which can be run stand-alone or from within emacs! This debugger has
the virtue of being available on all platforms at SLAC. If you are concentrating on the rs/6000 platform, however, the xfdb debugger provides a very nice X window alternative. Here are some of the debuggers on SLAC platforms.
Machine Debugger Comment
-------------------------------------------------------------------
NeXT gdb GNU line-mode debugger
Sun gdb GNU line-mode debugger
mxgdb X-window version of gdb
dbx "standard" UNIX line-mode debugger
dbxtool SunView version of dbx
IBM gdb GNU line-mode debugger
mxgdb X-window version of gdb
dbx "standard" UNIX line-mode debugger
xde X-window version of dbx (don't bother!)
xfdb X-window, very nice debugger!!
|