Skip title Accessibility statement: we seek to make the HPC web pages accessible to all users. If you encounter accessibility issues with HPC web pages please send a description of the problem by email to eric_sills@ncsu.edu - thank you.

High Performance and Grid Computing
   
Skip menu side bar
Home
About

OpNews

Help/Accounts

Staff

Partners

User Projects


Services

Hardware

Software

Grid

Monitor


HowTo/FAQ

Docs & Pubs

Courses

Other Resources

Intel Compilers
    To use the Intel compilers it is necessary to properly configure some environment variables and paths. As a convenience an alias - add - has been created for tcsh users to set up the environment for various software packages. To use the Intel compilers the command
    add intel
    
    will set the necessary environment variables.

    Currently the command 'add intel' will set up the environment for version 8.1 of the Intel compiler. To use the earlier 7.1 version of the Intel compilers use the command 'add intel-71'.

    Once one of these files have been executed, the Intel compilers may be invoked with the icc, icpc, and ifort commands for the C, C++, and Fortran77/90 compilers respectively.

    Intel 7.1 compilers were invoked with icc for the C/C++ compiler and ifc for the Fortran compiler.

    Compiling a Serial Program
    The following command would generate an executable named 'exec' from the Fortran source code file named 'code.f' with a moderately high level of optimization.

    ifort -O3 -axW -o exec code.f
    

    Compiling a Parallel Program
    Intel compilers can generate shared memory parallel executables. However, the cluster nodes have only two processors, so shared memory parallelization is unlikely to provide benefit on the henry2 Linux cluster.

    Distributed memory parallel programs written with MPI function calls are currently the most appropriate programming model to achieve good performance from commodity clusters such as henry2.

    MPI parallel programs compiled with the Intel compilers should use the mpif77, mpif90, mpicc, or mpiCC commands to link with the MPICH libraries.

    The following command line would compile an MPI code with a high level of optimization:

    mpif90 -o exec -O3 -axW code.f
    

    The MPICH MPI library is used when the mpi* commands are invoked with the Intel compiler environments.

    When C and Fortran object files are linked together, the -static-libcxa flag avoids a run-time error. For example, the executable pring produced by

    ifort -c ring.f
    icc -c host.c 
    mpif90 -o pring host.o ring.o -static-libcxa 
    
    ran successfully, while leaving out the flag gave a run-time error "error while loading shared libraries: libcxa.so.5".

    Any of these compilers (and in particular the mpiCC) compiler are prone to run-time errors when shared libraries are used. Using a -static flag is therefore recommended. For example,

    mpiCC greetings2.c -o greetings2 -static
    
    avoids a run-time error which frequently occurs when the -static flag is omitted.

Copyright © 2003-2007 by NC State University and others, All Rights Reserved.
HPC & Grid (Version 1.4 / Site access count: 754069) - Site/Content Notice

Site contact: Eric Sills, E-mail: eric_sills at ncsu dot edu , Tel: 919-513-0324, Fax: 919-513-1893, HPC and Grid Operations, Information Technology Division, Box 7109, North Carolina State University, Raleigh, NC27695-7914, USA