For more details, and talks in past semesters, consult the full schedule of talks.
Past topics can (and should) be repeated occasionally. In addition, here are some topics people might like to hear about:
To give a talk, please contact swig@math.arizona.edu.
acc, cc, gcc
f77,
g77
acc, cc, and gcc. The cc
compiler is the Kernighan & Ritchie (K&R)-style C
compiler, whereas acc compiles ANSI C code.
K&R and ANSI C differ significantly, and if you try to use
the wrong compiler for your code you may be bombarded with
error messages. Make sure you know which type of C you are
programming in and use the corresponding compiler.
In addition we have gcc, the GNU C compiler
which can compile both K&R and ANSI C programs. The
advantage of using gcc is that it is pretty much
uniform across architectures (SUN, LINUX, Slowaris, DEC,
etc.), so if you write code that will compile and run with
gcc on the SUNs, chances are that it will
compile and run on, say, a Linux machine using
gcc. This is not necessarily the case with
acc and cc.
All three compilers have several "options" or "flags", which are of the form -flagname. These flags allow us to turn on (or off) various options of the compiler in question. All the flags are described in the man pages. We will see several examples of flags below.
goof.c
(all the C compilers listed above assume the suffix
".c" for C code). If the code is in ANSI C you can
use either
acc goof.c
or
gcc -ansi goof.c
If the program is in K&R C you can use either
cc goof.c
or
gcc goof.c
Any/all of these commands will compile/link your program
goof.c and produce a file called
a.out (the executable version of your program
goof.c). Now to run your program, at the Unix
prompt type
a.out
If you are compiling several different programs in one
directory, then having them all named a.out
could be disastrous! In general it is a good idea to add the
-o name option, which writes the
executable file to name instead of a.out.
So to compile our program goof.c and give the
executable the name goof, we would type
acc goof.c -o goof
The -o name option works with acc,
cc, and gcc.
"lib" and suffix ".a"). Some examples
of libraries on our system are in the directory
/usr/local/lang/SC1.0. To include a library
libname.a we would type
acc goof.c -o goof
-lname
The -lname option works with acc,
cc, and gcc.
Here are some commonly used optimizaton flags for the various C compilers on the SUNs:
acc -cg89 -fast -fnonstd -libmil -O2
cc -Bstatic -cg89 -fast -fnonstd -libmil -O2
gcc -O3 -msupersparc (and lots more! see
man page)
To use debuggers such as
xdbx or gdb, you need to compile
with the -g option (works with acc,
cc, and gcc).
In addition, gcc has some great flags to help find
bugs/errors. In particular, the -Wall is very
useful. What does it do? According to the gcc
man page.....
-Wall
Issue warnings for conditions which pertain to usage
that we recommend avoiding and that we believe is easy
to avoid, even in conjunction with macros.
f77 and g77. The f77
compiler is the SUN Fortran 77 compiler, and g77
is the GNU version of the Fortran 77 compiler.
As with the gcc compiler the advantage of
g77 is its uniformity across different
architectures, as the f77 compiler can vary
wildly from SUNs to DECs to SGIs, etc., etc..
Both compilers have several "options" or "flags", which are of the form -flagname. These flags allow us to turn on (or off) various options of the compiler in question. All the flags are described in the man pages. We will see several examples of flags below.
goof.f (both the Fortran compilers listed above
assume a ".f" suffix for Fortran code). To compile
goof.f you can use either
f77 goof.f
or
g77 goof.f
Both of these commands will compile/link your program
goof.f and produce a file called
a.out (the executable version of your program
goof.f). Now to run your program, at the Unix
prompt type
a.out
If you are compiling several different programs in one
directory, then having them all named a.out
could be disastrous! In general it is a good idea to add the
-o name option, which writes the
executable file to name instead of a.out.
So to compile our program goof.c and give the
executable the name goof, we would type
f77 goof.f -o goof
The -o name option works with both
f77 and g77.
"lib" and suffix ".a"). Some examples
of libraries on our system are in the directory
/usr/local/lang/SC1.0. To include a library
libname.a we would type
f77 goof.f -o goof -lname
The -lname option works with both
f77 and g77.
Some commonly used optimizaton flags for f77 on
the SUNS are -Bstatic, -cg89, -O2, -fast, -fnonstd,
-libmil, O2. One particular optimization flag for
g77 is -O. For more details and
information on what combinations of optimizers work well with
each other, consult the man pages.
To use debuggers such as
xdbx or gdb, you need to compile
with the -g option (works with both
f77 and g77).
In addition, g77 has some great flags to help find
bugs/errors. In particular, the -Wall is very
useful. What does it do? According to the g77
man page.....
-Wall
Issue warnings for conditions which pertain to usage
that we recommend avoiding and that we believe is easy
to avoid, even in conjunction with macros.
As you will discover from its man page, g77 has
a barrage of options, some of which are helpful and some that are
not. You will need to sort through them to determine which flags
sound useful for your purposes.