Overloaded Function

Hi There,

We tried to compile lammps with cuda, but get the following error:

/scratch/jzhang8/LAMMPS/lammps/lib/gpu/cudpp_mini/cudpp_maximal_launch.cpp(12): error: function “min(unsigned long, unsigned long)” has already been defined

/scratch/jzhang8/LAMMPS/lammps/lib/gpu/cudpp_mini/cudpp_maximal_launch.cpp(17): error: function “max(unsigned long, unsigned long)” has already been defined

/scratch/jzhang8/LAMMPS/lammps/lib/gpu/cudpp_mini/cudpp_maximal_launch.cpp(68): error: more than one instance of overloaded function “min” matches the argument list:

function “min(unsigned int, unsigned int)”

function “min(int, unsigned int)”

function “min(unsigned long, unsigned long)”

function “min(unsigned long, long)”

argument types are: (size_t, const unsigned int)

/scratch/jzhang8/LAMMPS/lammps/lib/gpu/cudpp_mini/cudpp_maximal_launch.cpp(83): warning: integer conversion resulted in a change of sign

/scratch/jzhang8/LAMMPS/lammps/lib/gpu/cudpp_mini/cudpp_maximal_launch.cpp(88): warning: integer conversion resulted in a change of sign

/scratch/jzhang8/LAMMPS/lammps/lib/gpu/cudpp_mini/cudpp_maximal_launch.cpp(93): warning: integer conversion resulted in a change of sign

3 errors detected in the compilation of “/tmp/tmpxft_0001663b_00000000-6_cudpp_maximal_launch.cpp1.ii”.

make[2]: *** [CMakeFiles/gpu.dir/scratch/jzhang8/LAMMPS/lammps/lib/gpu/cudpp_mini/cudpp_maximal_launch.cpp.o] Error 1

make[1]: *** [CMakeFiles/gpu.dir/all] Error 2

make: *** [all] Error 2

The Lammp I downloaded was from git. Compiled with CUDA version is 9.2.148.1 and intel 2017.u2 and Open MPI-3.0.0

Any help will be appreciated.

Cheers

Jin

you could do one or more of the following steps:
- use gcc instead of intel compilers (if you are running on the GPU,
there is little to gain from different host compilers)
- compile the gpu library with OpenCL support instead of CUDA
- modify the CUDPP_OPT variable in Makefile.linux to remove the define
and include for the CUDPP library when compiling the gpu library

axel.