A problem in compiling lammps with kokkos_cuda

Hi, lammps developers

I was trying to compile LAMMPS with kokkos cuda package.
I have tried several different versions of lammps:
LAMMPS-10Aug15, LAMMS-16Feb16 and LAMMPS-14Mar16.
gcc 4.7.2, 4.9.0, 5.2.0 were tested. CUDA7.5 was insalled.
The error messages are the same.
Hopefully, you can help me.

My Makefile.kokkos_cuda was listed as follows:

Hi, lammps developers

I was trying to compile LAMMPS with kokkos cuda package.
I have tried several different versions of lammps:
LAMMPS-10Aug15, LAMMS-16Feb16 and LAMMPS-14Mar16.
gcc 4.7.2, 4.9.0, 5.2.0 were tested. CUDA7.5 was insalled.
The error messages are the same.
Hopefully, you can help me.

My Makefile.kokkos_cuda was listed as follows:
__________________________________________________________________________
# kokkos_cuda = KOKKOS package with CUDA support, OpenMPI, nvcc/mpicxx
compiler
SHELL = /bin/sh
#export OMPI_CXX = ../../lib/config/nvcc_wrapper
export OMPI_CXX = ../../lib/kokkos/config/nvcc_wrapper
# ---------------------------------------------------------------------
# compiler/linker settings
# specify flags and libraries needed for your compiler
CC = nvcc

​it makes no sense to have "nvcc" here. it should be mpicxx, which is what
recently distributed version have (quoted below).

axel.

# kokkos_cuda = KOKKOS package with CUDA support, OpenMPI, nvcc/mpicxx
compiler

SHELL = /bin/sh

KOKKOS_ABSOLUTE_PATH = \(shell cd (KOKKOS_PATH); pwd)
export OMPI_CXX = $(KOKKOS_ABSOLUTE_PATH)/config/nvcc_wrapper

# ---------------------------------------------------------------------
# compiler/linker settings
# specify flags and libraries needed for your compiler

CC = mpicxx
CCFLAGS = -g -O3
SHFLAGS = -fPIC
DEPFLAGS = -M

LINK = mpicxx
LINKFLAGS = -g -O
LIB =
SIZE = size

ARCHIVE = ar
ARFLAGS = -rc
SHLIBFLAGS = -shared
KOKKOS_DEVICES = Cuda, OpenMP
KOKKOS_ARCH = Kepler35

Hi, Axel

Actually, I have tried to ‘make’ with the setting ‘CC = mpicxx’. And it turned to be error as well.
The error messages are as follows:

Hi, Axel

Actually, I have tried to 'make' with the setting 'CC = mpicxx'. And it
turned to be error as well.
The error messages are as follows:
_________________________________________________________
g++: error: unrecognized command line option '-arch=sm_35'
g++: error: unrecognized command line option '-Xcompiler'
_________________________________________________________

​that means, your mpi wrapper doesn't properly execute. are you by any
chance using MPICH or MVAPICH?

the kokkos_cuda makefile *clearly* indicates that it was made for OpenMPI
hence ​these two lines:

KOKKOS_ABSOLUTE_PATH = \(shell cd (KOKKOS_PATH); pwd)
export OMPI_CXX = $(KOKKOS_ABSOLUTE_PATH)/config/nvcc_wrapper

these *only* work with OpenMPI. for MPICH you would have to do something
similar and a little bit of googling finds
http://www.mpich.org/static/docs/v3.2/www1/mpicc.html which shows that you
may need to try the following.

CC = mpicxx -cc=$(KOKKOS_ABSOLUTE_PATH)/config/nvcc_wrapper

​and​

LINK = mpicxx

-cc=$(KOKKOS_ABSOLUTE_PATH)/config/nvcc_wrapper​

​so that the MPI compiler​ wrapper gets redirected to the special wrapper
for calling the cuda compiler.

To correct this problem, I revise the Makefile.kokkos_cuda in light of the

LAMMPS manual. I quoted some useful description from the website with the
link: http://lammps.sandia.gov/doc/accelerate_kokkos.html

It says:
If KOKKOS_DEVICES=Cuda, then the lo-level Makefile in the src/MAKE
directory must use “nvcc” as its compiler, via its CC setting. For best
performance its CCFLAGS setting should use -O3 and have a KOKKOS_ARCH
setting that matches the compute capability of your NVIDIA hardware and
software installation, e.g. KOKKOS_ARCH=Kepler30.

​this is outdated information.​

​axel.​