Ada:Compile:Intro
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. Use the following command to load the ictce module:
module load icte
This will set up the environment for the most recent ictce version. For more information about the module system on ada, please visit 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. The default output file name is a.out but can be changed using compiler flags. 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. |