How to install Intel Compilers (icc, icpc, ifort)

Related: Use Intel compilers with cmake, make and load libraries


The Intel Parallel Studio XE 2019 suite includes the ifort, icc and icpc: the Fortran, C and C++ compilers among many other optional components. Here are the minimal options for use on a typical desktop PC.

  1. Download the Parallel Studio XE Cluster Edition/ Composer Suite (online/custom installer, not the entire 4 GB file). Get the CLUSTER / “all tools” version, NOT just the Fortran version or you will NOT have MPI!
  2. Extract and run ./install_GUI.sh. If on a Linux system, be sure it’s to a permissions based drive (e.g. Ext4) and NOT a non-permissions filesystem like ExFAT, or the compiler will silently fail to install. If you still can’t run it, try just using the command-line (non-graphical) installer ./install.sh You do NOT have to use sudo–it will simply install under ~/intel without sudo.
  3. Select options below. These options take 555 MB to download, versus downloading the entire suite with things you may never use. They take about 20 minutes to download on a modest internet connection.

    • architecture: Intel64 (IA-32 not used)
    • Intel C++ Compiler
    • Intel Fortran Compiler
    • Intel MKL for C/C++
    • Intel MKL for Fortran
    • LAPACK 95
    • Intel MPI Library
    • GNU GDB
  4. Under ~/intel/bin you’ll see the executables like ifort and icc. Rather than always load the libraries, I create a file ~/intel.sh with contents:
    . ~/intel/bin/compilervars.sh intel64
    . ~/intel/mkl/bin/mklvars.sh intel64
    
  5. Enable the Intel compilers each time you want to use them with:
    . ~/intel.sh
    

mpiifort should be active – not just mpifort. If not, you must not have MPI installed correctly.

Intel MKL

If you installed MKL prior to the Intel Compiler, be sure to select Intel MKL or it will uninstall your preexisting MKL! The Intel MKL options you may want for a desktop PC include

  • Intel MKL core libraries for C/C++
  • Intel TBB threading support
  • GNU C/C++ compiler support

  • Intel MKL core libraries for Fortran
  • GNU Fortran compiler support
  • Fortran 95 interfaces for BLAS and LAPACK

CMake Intel compilers

FC=ifort CC=icc CXX=icpc cmake ..

To switch back to GNU or other compiler, you have to remove the CMake cached files. Using Intel compilers and libraries with CMake is quite straightforward and easy to switch between compilers.

Why use Intel compilers

To understand what Intel compilers can do for scaling your program from the desktop to supercomputer–or merely improve performance on your laptop, see Intel Compiler new user guide

Tags: , , , , , ,

Categories:

Written by Michael Hirsch, Ph.D. //

Comments