please test CMake support in 2 August 2018 version (or later)

hi everybody,

as we are closing in on a new stable LAMMPS release, here is an opportunity to help shaping the future of LAMMPS: please test compiling LAMMPS with CMake instead of the traditional build system and let us know your impressions, and tell us where things could be improved and how.

with this release, the cmake build system is able to support all kinds of build features, that are also available with the conventional build system. so any discrepancy would be a bug.

if you are aware of other bugs or issues, now is the best time to report them at:
https://github.com/lammps/lammps/issues

thanks in advance for any support from you,
axel

Hi Axel (and LAMMPS team),

Thank you very much for this effort! I have started testing this out. Some points I found out with roughly an hour or two playing with lammps/cmake:

  1. OpenMP seems to be turned on by default: see https://pastebin.com/rUKskDxm. And that’s without turning BUILD_OMP on (even though it should be OFF as default per https://github.com/lammps/lammps/tree/master/cmake).
  2. Similar issue with MPI - it seems like somehow CMake will default both of these on without using BUILD_MPI or BUILD_OMP. Even after I removed everything inside build directory: see https://pastebin.com/1qdRQxtt
  3. Turnig BUILD_MPI on, however, does not trigger LAMMPS to compile with mpicc/mpicxx: see https://pastebin.com/ybDSEDxx

That’s all I found so far after roughly playing on it - will spend more time on it in due course.

Thanks,
QT

This is more of an aesthetic issue; KOKKOS_GMAKE_DEVICES gets overwritten to Serial every time configure is run. I don’t know if that is because you are not supposed to touch it or if this is a real issue. The correct target devices get properly inferred from the KOKKOS_ARCH flag because at the end of the configure step Kokkos_ENABLE_Cuda and Kokkos_ENABLE_OpenMP get defined anyway.

A secondary issue is that kokkos seems to fail to compile with Serial defined, and it always gets defined. Should I file that as a separate bug report? I will check if that problem persists with the manual configuration of Kokkos.

For what it’s worth if I add “Serial” to the list of devices in the Kokkos Makefile everything still compiles with the regular old Makefiles. Is this an issue with the CMake configuration for Kokkos not working? The CMake build chokes on compiling fix_momentum_kokkos.cpp with errors regarding Few<double, 3> being passed to an operator that returns a non-const reference (specifically for DeviceType=Serial). I don’t understand why the regular build does not see this issue. This might be more of a Kokkos issue than a CMake issue.