Compiling Gromacs-2019.3 with Intel 2018 MKL and AVX-512

Prerequisites

GCC-6.5 Compilers and associates libraries
m4-1.4.18
mpfr-3.1.4
cmake-3.15.1
gmp-6.1.0
mpc-1.0.3

Intel Compilers and Prerequisites

source /usr/local/intel/2018u3/bin/compilervars.sh intel64
source /usr/local/intel/2018u3/impi/2018.3.222/bin64/mpivars.sh intel64
source /usr/local/intel/2018u3/mkl/bin/mklvars.sh intel64
source /usr/local/intel/2018u3/parallel_studio_xe_2018/bin/psxevars.sh intel64
MKLROOT=/usr/local/intel/2018u3/mkl

Create a setup file

touch gromacs_cpu.sh

Put the following into the gromacs_cpu.sh

CC=mpicc CXX=mpicxx cmake .. -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx
-DGMX_MPI=on -DGMX_FFT_LIBRARY=mkl -DCMAKE_INSTALL_PREFIX=/usr/local/gromacs-2019.3_intel18_mkl 
-DREGRESSIONTEST_DOWNLOAD=ON -DCMAKE_C_FLAGS:STRING="-cc=icc -O3 -xHost -ip" 
-DCMAKE_CXX_FLAGS:STRING="-cxx=icpc -O3 -xHost -ip" -DGMX_GPU=off -DCMAKE_BUILD_TYPE=Release -DGMX_SIMD=AVX_512

SIMD Support can be found at http://manual.gromacs.org/current/install-guide/index.html#simd-support

./gromacs_cpu.sh
make
make install

Testing and Verification

$ source /your/installation/prefix/here/bin/GMXRC
./gmxtest.pl all -np 2