INTEL compilation

In this document we go through the installation of the software stack required by Regcm and RegCm itself for Intel compiler version 14.01

First check your enviroment is well set to use intel compilers ( icc / ifort):

>cd /opt/intel/bin
>. compilervars.sh intel64

THIS WILL MAKE icc and ifort available at command line..

It is advisable to create a module for the intel compiler suite. Here below a template that could be adapted:

#%Modules
proc ModulesHelp { } {
        puts stderr "\tThis module provides the path for the Intel  C/C++/Fortran Compilers\n";
        puts stderr "\tVersion 14.0\n";
}

conflict gnu

set             home    "/opt/intel/"
prepend-path    PATH            "$home/bin"
prepend-path    LD_LIBRARY_PATH "$home/lib/intel64:$home/ipp/lib/intel64"
prepend-path    LIBRARY_PATH    "$home/lib/intel64:$home/ipp/lib/intel64"
prepend-path    MANPATH         "$home/man/en_US"
prepend-path    INCLUDE          "$home/include:$home/ipp/include:$home/tbb/include"
prepend-path    CPATH            "$home/include:$home/ipp/include:$home/tbb/include"

setenv          TBBROOT         $home/tbb
setenv          IPPROOT         $home/ipp
setenv  INTEL_LICENSE_FILE      /opt/intel/licenses/licenses13.lic

Once done the file should be placed in the following dir:

/opt/Modules/3.2.10/compilers/intel

and then named with the version number

HDF installation

Trivial with the only notable exception you have to tell configure to use icc and not gcc:

>wget  http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-1.8.12.tar.gz
>tar -xvzf hdf5-1.8.12.tar.gz
>cd hdf5-1.8.12
>./configure CC=icc --prefix=/opt/hdf/1.8.12/intel
> make
> make check
> make install

and then a module can be setup, just copying and adapting the one done for gnu compiler

NetCDF installation

As usual with the only difference of the compiler:

>cd netcdf-4.3.0
>./configure CC=icc --prefix=/opt/netcdf/4.3.0/intel --enable-netcdf-4 --enable-dap  CPPFLAGS=-I/opt/hdf/1.8.12/intel/include/ LDFLAGS=-L/opt/hdf/1.8.12/intel/lib/
>make
>make check
>make install

Netcdf fortran

A few simple steps:

>tar -xvzf netcdf-fortran-4.2.tar.gz
> cd netcdf-fortran-4.2
> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/netcdf/4.3.0/intel/lib/
>  ./configure --prefix=/opt/netcdf/4.3.0/intel CC=icc FC=ifort      CPPFLAGS="-I/opt//hdf/1.8.12/intel/include/  -I/opt/netcdf/4.3.0/intel/include " LDFLAGS="-L/opt/hdf/1.8.12/lib -L/opt/netcdf/4.3.0/intel/lib"
 >make
 >make check
 >make install

let us setup a module for netcdf just copying again the one prepared for gnu and adapting it...

OPENMPI

nothing different from gnu case apart the name of variables:

>tar -xvzf openmpi-1.6.5.tar.gz
>cd openmpi-1.6.5
>. /opt/intel/bin/compilervars.sh intel64
>./configure --prefix=/opt/cozzini FC=ifort CC=icc --with-tm=/opt/torque/4.2.6/ --disable-vt
>make -j 12
>make check
>make install

we now create a module.

RegCM4 compilation

And finally:

> cd RegCM-4.4-rc16
> /opt/intel/bin/compilervars.sh intel64
>export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/netcdf/4.3.0/lib/
> ./configure --prefix=/opt/RegCM/4.4rc16/intel CC=icc Fc=ifort    MPIFC=/opt/openmpi/intel/torque/bin/mpif90  --with-netcdf=/opt/netcdf/4.3.0/intel/
> make
> make install

set-up a module for regcm as well from this template:

proc ModulesHelp { } {
      puts stderr "\tThis module provides the path for RegCM4 executables\n";
      puts stderr "\tThis REGCM  version was compiled with Intel compiler\n";
      puts stderr "\tAll required modules will be automatically loaded\n";
}

if { ! [is-loaded openmpi/1.6.5/intel/14.0 ]}  {
     module load openmpi/1.6.5/intel/14.0;
}

if { ! [is-loaded netcdf/4.3.0/intel/ ]}  {
     module load netcdf/4.3.0/intel;
}

prereq openmpi/1.6.5/intel/14.0 netcdf/4.3.0/intel
conflict regcm/gnu

prepend-path PATH               "/opt/regcm/VERSION/bin"