Date of last revision: 10/5/1999

We have compilers for the following languages listed below:

Language:	Cmd. to run:	Installed on:

Ada             See "helpme programming"
C		cc              All Unix machines
C++		CC              All Unix machines
GNU C           gcc             HP Unix machines [ See below ]
GNU C++         g++             HP Unix machines [ See below ]
Visual C++                      ALL Windows NT machines [ See below ]
Fortran-77	f77             HP Unix machines
Fortran-90	f90             SGI Unix machines
Pascal          pc              All Unix machines
Prolog		prolog          All HP Unix machines
Scheme		scheme		All HP Unix machines

Each Unix compiler has a man page associated with it -- see the man page on that command for more information (except for scheme).

The Unix compilers, by default, will compile to a file a.out unless you specify otherwise with the "-o filename" switch. If you find you can not execute this file by simply typing it's name at your unix prompt, try typing ./filename and see if that works. If it still doesn't work, ask a lab assistant for help.

Note: Our newest HP Unix workstations feature the new PA-8000 series processors. These processors are much faster than those on the older workstations, but by default programs compiled on the new workstations will not run on the old workstations. The compiler will usually print a warning message if your are on one of the newer workstations, or you can use the command /usr/local/sbin/ecss-sysident -arch-detail command to check what machine you are on: If it's PA2.0 or higher, you are on a newer workstation; anything lower is an old workstation. You can use the compiler flag +DA1.1 to produce programs that will run on the older workstations.


Note about HP Unix 'cc' compiler

The standard HP Unix 'cc' compiler does not understand ANSI conventions as its default behaviour. By passing it certain command line options, it will act like a standard ANSI compiler. To compile a program in ANSI, invoke 'cc' as follows:

cc -Aa -D_HPUX_SOURCE ansi-prog.c

Where ansi-prog.c is the name of your C program.

Examples:

cc prog1.c -o prog1
Compiles prog1.c with the C compiler. The executable will be called prog1.
CC assign5.cpp
Compiles assign5.cpp with the Softbench C++ compiler. The executable will be called a.out as none was specified.
pc assign2.p -o assign2
Compiles assign2.p with the Pascal compiler. The executable will be called assign2.
f77 old.f -o old
Compiles old.f with the Fortran-77 compiler. The exectuable will be called old.

Click here to return to the Helpme menu.