Commercial compilers expect that certain environment variables are set before they
are invoked, so setup scripts are provided by the vendors. Also listed
in the table are the commands that invoke the compilers.
What to type at the prompt:
|
Vendor Setup |
Compile |
| Gnu C/C++ |
|
gcc g++ |
| Gnu Fortran |
|
g77 |
| Intel C/C++ |
/opt/intel/cc/<ver>/bin/iccvars.[c]sh |
icc |
| Intel Fortran |
/opt/intel/fc/<ver>/bin/ifortvars.[c]sh |
ifort |
Once the setup script has been run, programs may be compiled directly from the command
line. If one has a simple "hello" program one may type:
> gcc hello.c -o hello
or
> ifort hello.f -o hello
and an executable named "hello" will be produced.
In principle any program can be compiled from the command line, but for more complex
programs a makefile is very convenient, if not essential.