Compile your code and be sure to specify –g. Do not specify a high-level of optimization because information such as line numbers and call stacks, might be reported incorrectly at a high optimization level. Compile an OpenMP program with –g –xopenmp=noopt, and compile a POSIX threads program with just –g –mt.
See cc(1), CC(1), or f95(1) man pages for more information about these compiler options.
For this tutorial, compile the code using the following command:
% cc -g -o din_philo din_philo.c