Using Environment Modules with Intel Development Tools

Por Kenneth M Craft,

Publicado:06/09/2015   Última actualización:06/09/2015

What are Environment Modules

The Environment Modules utility allows dynamic modification of a user environment (shell environment variables such as PATH, LD_LIBRARY_PATH, etc). The Environment Module utility works with a set of system or user configure "modulefiles" which specify the necessary environment settings necessary to use a particular development tool or toolset, such as Intel® Parallel Studio XE.   More information on the Environment Utility and modulefiles can be found here

Each modulefile contains the information needed to configure the shell environment for a specific version of a development tool or toolset. Once the Modules utility has a modulefile configured for a particular tool, typically by the system administrator, the system user's environment can be modified using the 'module' command which interprets modulefiles. Typically modulefiles instruct the module command to alter or set shell environment variables such as PATH, MANPATH, etc. modulefiles may be shared by many users on a system and users may have their own collection to supplement or replace the shared modulefiles.  This utility and collection of modulefiles allows users to test code with different versions of the tools such as compilers quickly and easily. 

Environment modules give you control over your environment by keeping track of what variables are changed giving you the ability to remove those same entries, preventing variable bloat.

Supported Platforms

Linux* and OS X*

How to create a module file for Intel Software Development tools

First, install the Intel Development Tools on your system or cluster. Note that the Intel Development Tools ( Parallel Studio XE, Cluster Edition, Composer Edition, etc) do NOT come packaged with modulefiles.  Instead the bash or tcsh/csh script files, named '*' or '*vars.csh' (VARS scripts) are installed to the installation 'bin' directory (directories).  To use the tools, first of all set up the environment using the 'source' command. i.e.
source [install-dir]composer_xe_2015.x.yyy/bin/ intel64

There are two ways you can create modulefiles, the obvious way is by hand, using the provided script files *vars.[sh | csh] as reference.  DO NOT DO IT THIS WAY, the VARS script files usually call a series of other dependent scripts.  Also some scripts take arguments, such as the '' scripts, while others do not.  Unraveling this nest of scripts is nearly impossible and error prone.

Alternatively you can use a utility 'env2' to automate the process.  The 'env2' utility executes a script, capturing the changes it makes to the environment, and echoes those env vars and settings in a format suitable for a modulefile.  This output can be captured to create your module file. in order to get the correct information you will need to redirect the output from stdout to a file. 

The 'env2' utility can be found at

Creating a module file for any Intel Development Tool:

  1. First you place a special comment at the beginning of the file so that module will recognize it as a module file with following command:
    echo "#%Module" > my_module_file
  2. then you will need to use the env2 command like below, for example:
    perl env2 -from bash -to modulecmd "[install-dir]/parallel_studio_xe_201m.0.nnn/ <intel64|ia-32>" >> my_module_file 
    This will create a module file that has all the correct information need to run the compiler and tools correctly. 
  3. Now following the 'module' instructions to use the compiler tools through module file.

Note:You can find more information about Environment modules here


Información sobre productos y desempeño


Los compiladores Intel pueden o no optimizar al mismo nivel para los microprocesadores que no son Intel en optimizaciones que no son exclusivas de los microprocesadores Intel. Estas optimizaciones incluyen los conjuntos de instrucciones SSE2, SSE3 y SSSE3, y otras optimizaciones. Intel no garantiza la disponibilidad, funcionalidad o eficacia de ninguna optimización en microprocesadores que no sean fabricados por Intel. Las optimizaciones dependientes del microprocesador en este producto fueron diseñadas para usarse con microprocesadores Intel. Ciertas optimizaciones no específicas de la microarquitectura Intel se reservan para los microprocesadores Intel. Consulte las guías de referencia y para el usuario para obtener más información acerca de los conjuntos de instrucciones específicos cubiertos por este aviso.

Revisión del aviso n.° 20110804