IBM AIX on RS/6000 Systems
The following table lists the procedures to compile programs on IBM RS/6000 systems running AIX.
 
Compiler
Compiler Command Line
GCC C
gcc -g program.c
GCC C++
g++ -g program.cxx
IBM xlc C
xlc -g program.c
IBM xlC C++
xlC -g program.cxx
IBM xlf Fortran 77
xlf -g program.f
IBM xlf90 Fortran 90
xlf90 -g program.f90
You can set up to seven variables when debugging threaded applications. Here’s how you might set six of these variables within a C shell:
setenv AIXTHREAD_MNRATIO "1:1"
setenv AIXTHREAD_SLPRATIO "1:1"
setenv AIXTHREAD_SCOPE "S"
setenv AIXTHREAD_COND_DEBUG "ON"
setenv AIXTHREAD_MUTEX_DEBUG "ON"
setenv AIXTHREAD_RWLOCK_DEBUG "ON"
The first three variables must be set. Depending upon what you need to examine, you will also need to set one or more of the “DEBUG” variables.
The seventh variable, AIXTHREAD_DEBUG, should not be set. If it is, you should unset it before running TotalView
 
NOTE >> Setting these variables can slow down your application’s performance. None of them should be set when you are running non-debugging versions of your program.
When compiling with KCC, you must specify the -qnofullpath option; KCC is a preprocessor that passes its output to the IBM xlc C compiler. It will discard #line directives necessary for source-level debugging if you do not use the -qfullpath option. We also recommend that you use the +K0 option and not the -g option.
When compiling with guidef77, the -WG,-cmpo=i option may not be required on all versions because -g can imply these options.
When compiling Fortran programs with the C preprocessor, pass the -d option to the compiler driver. For example: xlf -d - program.F
If you will be moving any program compiled with any of the IBM xl compilers from its creation directory, or you do not want to set the search directory path during debugging, use the -qfullpath compiler option. For example:
xlf -qfullpath -g -c program.f