Difference between revisions of "Intel compilers"

From Peyton Hall Documentation
Jump to navigation Jump to search
(Removed the warning about having to use older compilers on some machines; modified the note about -static to suggest it for both condor and hydra)
m (Use Modules)
Line 3: Line 3:
  
 
== Setup ==
 
== Setup ==
There are multiple versions of the Intel compilers installed.  Depending on which version you want to run, you'll need to source some scripts to get all your paths setup properly.  Add one of these sets of lines to your shell startup file (.bashrc for bash users, .cshrc for tcsh users).
+
There are multiple versions of the Intel compilers installed.  Depending on which version you want to run, you'll need to load the appropriate [[Modules|module]] with the command <tt>module load intel</tt>. This sets up both the C and Fortran compilers for the appropriate architecture on which you're running the command; see the output of <tt>module help intel</tt> for information about cross-compiling.
* Version 11.0
 
*: Starting with version 11.0, the Intel Compiler directory structure has changed a bit. The C++ compiler, Fortran compiler, and Intel Debugger are all within the same directory tree. The new method for calling the setup script is as follows (replace <arch> with one of ia32 for 32-bit machines, or intel64 for 64-bit machines):
 
** bash
 
*** C/C++ Compiler & Debugger
 
***: <tt>source /usr/peyton/intel/11.0/bin/iccvars.sh <arch></tt>
 
*** Fortran Compiler & Debugger
 
***: <tt>source /usr/peyton/intel/11.0/bin/ifortvars.sh <arch></tt>
 
** csh/tcsh
 
*** C/C++ Compiler & Debugger
 
***: <tt>source /usr/peyton/intel/11.0/bin/iccvars.csh <arch></tt>
 
*** Fortran Compiler & Debugger
 
***: <tt>source /usr/peyton/intel/11.0/bin/ifortvars.sch <arch></tt>
 
  
* Version 10.1
 
** 32-bit
 
*** bash
 
***: <tt>source /usr/peyton/intel/10.1/cc32/bin/iccvars.sh</tt>
 
***: <tt>source /usr/peyton/intel/10.1/fc32/bin/ifortvars.sh</tt>
 
***: <tt>source /usr/peyton/intel/10.1/idb32/bin/idbvars.sh</tt>
 
*** tcsh
 
***: <tt>source /usr/peyton/intel/10.1/cc32/bin/iccvars.csh</tt>
 
***: <tt>source /usr/peyton/intel/10.1/fc32/bin/ifortvars.csh</tt>
 
***: <tt>source /usr/peyton/intel/10.1/idb32/bin/idbvars.csh</tt>
 
** 64-bit
 
*** bash
 
***: <tt>source /usr/peyton/intel/10.1/cc64/bin/iccvars.sh</tt>
 
***: <tt>source /usr/peyton/intel/10.1/fc64/bin/ifortvars.sh</tt>
 
***: <tt>source /usr/peyton/intel/10.1/idb64/bin/idbvars.sh</tt>
 
*** tcsh
 
***: <tt>source /usr/peyton/intel/10.1/cc64/bin/iccvars.csh</tt>
 
***: <tt>source /usr/peyton/intel/10.1/fc64/bin/ifortvars.csh</tt>
 
***: <tt>source /usr/peyton/intel/10.1/idb64/bin/idbvars.csh</tt>
 
  
 
== Use ==
 
== Use ==
The Intel compiler suite is installed in /usr/peyton/intel, consisting of the C (icc) and Fortran (ifort) compilers as well as a debugger from Intel.
+
The Intel compiler suite consists of the C (icc) and Fortran (ifort) compilers.
  
 
'''''NOTE:'''''
 
'''''NOTE:'''''

Revision as of 19:38, 31 October 2011

Many have found that the compilers from Intel generate faster code than the standard GNU compilers. We try to keep up with the licensing from Intel so we have somewhat recent versions of the compilers installed, and below you'll find more information about them.


Setup

There are multiple versions of the Intel compilers installed. Depending on which version you want to run, you'll need to load the appropriate module with the command module load intel. This sets up both the C and Fortran compilers for the appropriate architecture on which you're running the command; see the output of module help intel for information about cross-compiling.


Use

The Intel compiler suite consists of the C (icc) and Fortran (ifort) compilers.

NOTE: If compiling code for use on Hydra or condor, you should probably build statically linked binaries to ensure the libraries needed to execute the program are available on the compute nodes (linker option '-static'). The license we have for the compilers allows for 2 users to compile code simultaneously; if you get an error about compiling, try waiting a few minutes and running the command again.


Source files

The Fortran compiler assumes that the source files are called *.f90 (or else it tries to compile f77, or at least I think that that's what happens). Also, you'll need to add '.SUFFIXES : .f90' to your makefiles, as well as a rule such as '.f90.o:; ifc $(FFLAGS) -c $*.f90'.


Linking

Some users have had to use the linker flag -Vaxlib, otherwise the compiler complained about iargc or get_arg functions. Another issue related to the Intel compilers use on Fedora Core 2 machines is described on the page http://newweb.ices.utexas.edu/misc/ctype.c. This may no longer be an issue, as I think the compiler version that was installed has since been upgraded.


32 vs. 64-bit

As of version 10 of the Intel compiler we have both x86 and x86_64 versions of the compiler installed. The 32-bit version will make 32-bit executables and the 64-bit version will make 64-bit executables.

You must compile your code using the proper compiler for the platform on which you will want to run your executable!

While the 32-bit compiler might compile code on a 64-bit machine, there's no guarantee that all the necessary 32-bit libraries will be available on all machines... especially if you intend to use condor. Stick with the 64-bit compiler and you'll save yourself a lot of headaches.

If you're not sure what platform you're using, run the following command:

uname -i

Anything in the form of ix86 is 32-bit, x86_64 is 64-bit