Intel compilers

From Peyton Hall Documentation
Jump to navigation Jump to search

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: 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. 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