Difference between revisions of "Intel compilers"

From Peyton Hall Documentation
Jump to navigation Jump to search
(New page: {{oldfaq|NUM=152}} There are multiple versions of the Intel compilers installed. Depending on which version you want to run, add one of these sets of lines to your shell startup file (.ba...)
 
m (No more condor pool)
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{oldfaq|NUM=152}}
+
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.
  
There are multiple versions of the Intel compilers installed. Depending on which version you want to run, add one of these sets of lines to your shell startup file (.bashrc for bash users, .cshrc for tcsh users):
 
  
For version 8.1:
+
== Setup ==
For bash:
+
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.
  
source /usr/peyton/intel/8.1/icc/bin/iccvars.sh
 
source /usr/peyton/intel/8.1/ifc/bin/ifortvars.sh
 
source /usr/peyton/intel/8.1/idb/bin/idbvars.sh
 
  
For tcsh:
+
== Use ==
 +
The Intel compiler suite consists of the C (icc) and Fortran (ifort) compilers.
  
source /usr/peyton/intel/8.1/icc/bin/iccvars.csh
+
'''''NOTE:'''''
source /usr/peyton/intel/8.1/ifc/bin/ifortvars.csh
+
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 /usr/peyton/intel/8.1/idb/bin/idbvars.csh
 
  
For version 9.0:
 
For bash:
 
  
source /usr/peyton/intel/9.0/cc/bin/iccvars.sh
+
=== Source files ===
  source /usr/peyton/intel/9.0/fc/bin/ifortvars.sh
+
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 '<tt>.SUFFIXES : .f90</tt>' to your makefiles, as well as a rule such as '<tt>.f90.o:; ifc $(FFLAGS) -c $*.f90</tt>'.
source /usr/peyton/intel/9.0/idb/bin/idbvars.sh
 
  
For tcsh:
 
  
  source /usr/peyton/intel/9.0/cc/bin/iccvars.csh
+
=== Linking ===
source /usr/peyton/intel/9.0/fc/bin/ifortvars.csh
+
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.cThis may no longer be an issue, as I think the compiler version that was installed has since been upgraded.
  source /usr/peyton/intel/9.0/idb/bin/idbvars.csh
 
  
  
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.
+
=== 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.
  
The compilers may not run on all Linux machines in the building (should be at least RedHat 7.2). Also note that in the case of Hydra, 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.
+
'''You must compile your code using the proper compiler for the platform on which you will want to run your executable!
  
This information from Robert Lupton:
+
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.
  
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).
+
If you're not sure what platform you're using, run the following command:
  
Also, you'll need to add
+
<tt>uname -i</tt>
  
.SUFFIXES : .f90
+
Anything in the form of ix86 is 32-bit, x86_64 is 64-bit
  
to your makefiles, as well as a rule such as
+
[[Category:Software]]
 
 
.f90.o:; ifc $(FFLAGS) -c $*.f90
 
 
 
 
 
An addition from Hiranya Peiris:
 
 
 
I have a mixed code with f77 and f90 source files and the ifc compiler had no problem recognizing the f77 files and compiling them. However I had to use a linker flag called -Vaxlib. Otherwise it complained about iargc or get_arg functions.
 
 
 
 
 
A recent issue related to the Intel compilers use on Fedora Core 2 machines was tracked down by Robert Lupton, who points us to this webpage:
 
 
 
http://newweb.ices.utexas.edu/misc/ctype.c
 
 
 
This will do as a workaround until newer versions of the compiler suite can be tested for compatability on the network.
 

Latest revision as of 14:25, 13 March 2023

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