Error when compiling: bad value (knl) for -march= switch

Hi:

I am trying to compile LAMMPS (16Mar2018) with KOKKOS package installed, on a cluster with Xeon Phi 7210 (KNL) nodes.

What I did was simply:

cd lammps/src
module load intel/2018x
make clean-all
make yes-KOKKOS
make -j 10 kokkos_phi

And it gives the error:

cc1plus: error: bad value (knl) for -mtune= switch

I saw someone with the same error:
http://lammps.sandia.gov/threads/msg72006.html

I tried using make kokkos_omp as suggested in the post, but the performance was terrible on Xeon Phi nodes, not even as good as running on E5-2680v4 nodes ( the comparing was between 64 MPI * 4 OpenMP on one Phi node, 28 MPI * 1 OpenMP on one E5 node)

So please let me know what is wrong.

Thanks

Jianlan

Even though you are using the intel compiler, the underlying version of gcc also needs to support c++11.

Can you make sure your version of g++ supports c++11, i.e. is version 4.7.2 or later? However, the KOKKOS package uses thread atomics for thread safety, and atomics don’t perform well on KNL. I’d suggest using the USER-INTEL or USER-OMP package instead of KOKKOS on KNL for now. We are working on improving the performance of KOKKOS on KNL.

Stan