NERSC logo National Energy Research Scientific Computing Center
  A DOE Office of Science User Facility
  at Lawrence Berkeley National Laboratory
 

PGI C and C++ Compilers on Franklin

The Portland Group C and C++ compilers are available on Franklin. Users should call the Cray wrappers cc and CC directly for compilation on the compute nodes. We do not recommend directly calling pgcc and pgCC.

Contents


Invoking the compiler

Franklin has two kinds of nodes. The compute nodes run a limited functionality OS called Catamount and the service and login nodes run Linux. To compile code for the compute nodes use the Cray wrapper to the PGI compilers 'cc' and 'CC'. The most basic form being:

franklin% cc source.c
franklin% CC source.C

Running either of these commands will produce an executable named a.out.

Similar to most Unix compilers, the compilation process can be stopped before linking by using "-c", and specifying ".o" files on the command line will cause them to be linked:

Source Files and language dialects

The Portland Group compilers supports the following file extensions

.c, .C, .cc, .cpp, .i

Optimization

Using the optimization flags when compiling with the Portland Group compilers can significantly increase the performance of your programs.

We recommend the following basic optimizations.
franklin% cc -fastsse filename.c

  • If you use Interprocedural Analysis (IPA) -Mipa=fast,inline must be included on the link line as well as the compile line.
  • C and C++ codes can also greatly benefit from function inlining (-Minline option)
  • PGI7 family compiler has -fast setting same as -fastsse, which is different from PGI6 family. Use "pgf95 -help -fast" or "pgf95 -help -fastsse" to find out the detailed settings.
  • See Important Portland Group Compiler Options for a detailed description of the most useful compiler options.

Related Information


LBNL Home
Page last modified: Tue, 30 Oct 2007 20:43:54 GMT
Page URL: http://www.nersc.gov/nusers/resources/franklin/software/CC.php
Web contact: webmaster@nersc.gov
Computing questions: consult@nersc.gov

Privacy and Security Notice
DOE Office of Science