% cc -g -c c_program.c % cc -g -o run_prog c_program.o -lmCode that has been compiled with the -g flag will be slow - so don't use it for production runs. On the Suns, acc/cc (for SunOS/Solaris) will allow -g to be used along with optimization flags, on the SGIs you should look at the man pages for debugging flags that do optimization. No such feature exists for the IBMs and the othe Sun compilers where -g overrides any optimization flags. It is recommended that you compile with -g and no optimization and then test your code on small test problems where run time is not a concern. This will enable you to find the bugs that are due to your code alone - optimization can cause additional problems that will obscure the source of your bugs. Of course if you are having problems with your code working on large datasets after a long time, then you may very well need to compile with both debugging and optimization flags.
% lint -I/usr/local/mpich/include mpi.clint detects features of C program files which are likely to be bugs, non-portable, or wasteful. It also checks type usage more strictly than the compiler. lint issues error and warning messages. Among the things it detects are unreachable statements, loops not entered at the top, automatic variables declared and not used, and logical expressions whose value is constant. lint checks for functions that return values in some places and not in others, functions called with varying numbers or types of arguments, and functions whose values are not used or whose values are used but none returned. For more information look at the man page where this paragraph was taken from.