It is difficult but possible to build nwchem with MKL. However, You may not be going down the same path as I. First building mpich2 with ifort using FC=ifort.
Then using ifort indirectly by using the compiler wrappers with FC=mpif90 .
In my case mpich2 is installed at /usr/local/mpich2-ifort so I created a local file: /etc/ld.so.conf.d/mpich2-local.conf containing:
[code]
/usr/local/mpich2-ifort/lib
/usr/local/mpich2-ifort/lib/trace_rlog
[/code]
Remember to run ldconfig before trying to compile nwchem.
Here is my script for building on a RedHat 5 system:
#!/bin/bash
##
# By Anna Jonna Ármannsdóttir
## INTEL Fortran
## NWCHEM 6.0
# PATH=/usr/local/mpich2-ifort/bin:${PATH}
export CHEM="nwchem-6.0"
export LIBMPI="-L/usr/local/mpich2-ifort/lib -lmpich "
export PYTHONHOME=/usr
export PYTHONVERSION="2.4"
export USE_PYTHON64="y"
export PYTHONPATH=/usr
export NWCHEM_TOP="/scratch/$CHEM"
export SKRA="$NWCHEM_TOP"
export NWCHEM_MODULES="all python"
export NWCHEM_TARGET=LINUX64
export F77=mpif77
export FC=mpif90
export USE_MPI=y
export USE_MPIF=n
export MSG_COMMS=MPI
export LARGE_FILES=TRUE
export LIB_DEFINES=-DDFLT_TOT_MEM=16777216
export BLASOPT="-L/opt/intel/Compiler/11.1/073/mkl/lib/em64t -lguide -lmkl_lapack -lmkl_core -lmkl_sequential -lsvml -lirc"
cd /tmp && rm -rf ${SKRA} /nonexist && cd /scratch && \
( gzip -dc | tar xf - ) <$CHEM.tar.gz echo $NWCHEM_TOP echo $NWCHEM_MODULES echo $LIBMPI cd $NWCHEM_TOP/src/ && make nwchem_config 2>&1 | tee configure.log && make -j 4 2>&1 | tee make.log
# the commands call a program named smallversion.pl but the location of the program is not in the path. dot slash is the local path.
PATH="./:$PATH"
cd $NWCHEM_TOP/src/util && make smallversion && make
cd $NWCHEM_TOP/src && make link
# cd $NWCHEM_TOP/contrib getmem.nwchem
# cp /scratch/nwchem-6.0/bin/LINUX64/* /usr/local/mpich2-ifort/bin/