Hprc banner tamu.png

Difference between revisions of "Ada:Compile:Intro"

From TAMU HPRC
Jump to: navigation, search
(Getting Started)
(Getting Started)
Line 3: Line 3:
 
For developing code on ada we '''recommend''' using the Intel Cluster Toolkit Compiler Edition (ictce).This toolkit includes the intel compilers (icc/icpc/ifort), intel Math Kernel Library (MKL), and intel MPI stack. Additionally, the Intel compilers are the only compilers able to compile programs for the Phi coprocessors. Use the following command to load the ictce module:
 
For developing code on ada we '''recommend''' using the Intel Cluster Toolkit Compiler Edition (ictce).This toolkit includes the intel compilers (icc/icpc/ifort), intel Math Kernel Library (MKL), and intel MPI stack. Additionally, the Intel compilers are the only compilers able to compile programs for the Phi coprocessors. Use the following command to load the ictce module:
  
<pre>    module load ictce</pre>
+
<pre>    module load intel</pre>
  
This will set up the environment for the most recent ictce version. For more information about the module system on ada, please visit the [[Ada:Computing_Environment#Modules|modules]] page.
+
This will set up the environment for the most recent intel tool chain version. For more information about the module system on ada, please visit the [[Ada:Computing_Environment#Modules|modules]] page.
  
 
After initializing the compiler environment, you can use the &quot;man&quot; command to obtain a complete list of the available compilation options for the language you plan to use. For example:
 
After initializing the compiler environment, you can use the &quot;man&quot; command to obtain a complete list of the available compilation options for the language you plan to use. For example:

Revision as of 17:21, 5 February 2015

Getting Started

For developing code on ada we recommend using the Intel Cluster Toolkit Compiler Edition (ictce).This toolkit includes the intel compilers (icc/icpc/ifort), intel Math Kernel Library (MKL), and intel MPI stack. Additionally, the Intel compilers are the only compilers able to compile programs for the Phi coprocessors. Use the following command to load the ictce module:

    module load intel

This will set up the environment for the most recent intel tool chain version. For more information about the module system on ada, please visit the modules page.

After initializing the compiler environment, you can use the "man" command to obtain a complete list of the available compilation options for the language you plan to use. For example:

   
    man icc
    man icpc
    man ifort

will provide information on the C, the C++ and the Fortran compilers, respectively.

Each compiler requires appropriate file name extensions. These extensions are meant to identify files with different programming language contents, thereby enabling the compiler script to hand these files to the appropriate compiling subsystem: preprocessor, compiler, linker, etc. See table below for valid extensions for each language.

Extension Compiler Description
.c icc C source code passed to the compiler.
.C, .CC, .cc, .cpp, .cxx icpc C++ source code passed to the compiler.
.f, .for, .ftn ifort fixed form Fortran source code passd to the compiler.
.fpp ifort Fortran fixed form source code that can be preprocessed by the Intel Fortran preprocessor fpp.
.f90 ifort free form Fortran 90/95 source code passed to the compiler.
.F ifort Fortran fixed form source code, will be passed to preprocessor (fpp) and then passed to the Fortran compiler.
.o icc/icpc/ifort compiled object file--generated with the -c option--passed to the linker.


NOTE: The icpc command ("C++" compiler) uses the same compiler options as the icc ("C" compiler) command. Invoking the compiler using icpc compiles '.c', and '.i' files as C++. Invoking the compiler using icc compiles '.c' and '.i' files as C. Using icpc always links in C++ libraries. Using icc only links in C++ libraries if C++ source is provided on the command line.