Oracle® Solaris Studio 12.4: Thread Analyzer User's Guide

Exit Print View

Updated: December 2014
 
 

Compile the Source Code

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