******Please Note******

If you are having problems compiling or running a program, make sure you set your path and LD_LIBRARY_PATH correctly in .tcshrc file
 

Paths needed to use a compiler:

The following are that paths that you will need in your PATH variable to be able to access a compiler:

For cc Compiler:

/usr/bin/cc

For gcc Compiler:

/usr/local/bin/gcc

For g++ Compiler:

/usr/local/bin/g++

For f77 Compiler:

/usr/bin/f77
Compiling a Program

To compile a program you use a compiler. Here is a list of compilers available on our system:

The simplest way to compile a program is to type:
compiler fname
where compiler is the name of the compiler and fname is the name of the file that contains your program. Hence to compile a C program you would type:
gcc program1.c
Doing so will create an executable called a.out. To run the program you would just type a.out

To compile a bunch of files called fname1, fname2, fname3 you would type:

compiler fname1 fname2 fname3
To write the executable to another file besides a.out you use the "-o" option of the compiler, for example:
compiler -o outfile fname1
will create an executable called outfile.
 
  • Example of a Makefile.


  • CS Consultants
    consult@cs.uic.edu
    Department of CS

     

    Last Update: 09/10/2002