An official website of the United States government

Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.


Home

Compiling Threaded Programs

Compiling Threaded Programs

Several examples of commands used to compile code that uses pthreads are listed in the table below.

Compiler / PlatformCompiler CommandDescription
INTEL
Linux
icc -pthreadC
icpc -pthreadC++
PGI
Linux
pgcc -lpthreadC
pgCC -lpthreadC++
GNU
Linux, Blue Gene
gcc -pthreadGNU C
g++ -pthreadGNU C++
IBM
Blue Gene
bgxlc_r / bgcc_rC (ANSI / non-ANSI)
bgxlC_r, bgxlc++_rC++