Building LAMMPS with USER-INTEL for Knights Landing (Xeon Phi)

Hi,

The HPC facility I am using has some Intel Knights Landing many-core nodes (64c/256t Intel Xeon Phi 7230 to be precise). I am trying to build and test LAMMPS for this CPU but am not sure if I am understanding everything correctly.

At first, I tried building it with -D INTEL_ARCH=knl like the documentation prescribes. The complete cmake command (minus unrelated packages) I used is as follows:

cmake -D BUILD_MPI=yes -D BUILD_OMP=yes -D CMAKE_C_COMPILER=icc -D CMAKE_CXX_COMPILER=icpc -D PKG_USER-OMP=on -D PKG_USER-INTEL=on -D INTEL_ARCH=knl -D CMAKE_CXX_FLAGS="-O3 -DNDEBUG" ../cmake

This resulted in the following configuration:

-- C++ Compiler:     /sw/arch/RedHatEnterpriseServer7/EB_production/2019/software/icc/2018.3.222-GCC-7.3.0-2.30/compilers_and_libraries_2018.3.222/linux/bin/intel64/icpc
      Type:          Intel
      Version:       18.0.3.20180410
      C++ Flags:    -O3 -DNDEBUG -restrict
      Defines:       LAMMPS_SMALLBIG;LAMMPS_MEMALIGN=64;LAMMPS_OMP_COMPAT=3;LAMMPS_JPEG;LAMMPS_PNG;LAMMPS_GZIP;LMP_USER_OMP;LMP_USER_INTEL;LMP_INTEL_USELRT;LMP_USE_MKL_RNG;LMP_INTEL_OFFLOAD
      Options:       -xHost;-xMIC-AVX512;-qoffload;-fno-alias;-ansi-alias;-restrict;-qoverride-limits;-qoffload-option,mic,compiler,"-fp-model fast=2 -mGLOB_default_function_attrs=\"gather_scatter_loop_unroll=4\""

However, this fails to compile:

the cmake scripts were written by people without access to hardware for testing. Please try the conventional build and consider submitting an issue at https://github.com/lammps/lammps/issues detailing the differences and successes/failures, so that a person with knowledge in CMake scripting can look into improving those scripts. also, we just went through a significant modernization of those scripts and there is a chance of some collateral damage, especially for cases, where testing is not easy.

thanks,
axel.