Hello,
I’m trying to build the latest LAMMPS 27 Aug code with USER-CUDA package and experience some errors during the build. I generally solved them for my machine but don’t know how universal this solution is. My config is Suse Linux Enterprise 11 SP1 + Intel Compilers + MPICH2 + Tesla M2050.
So, I built the library liblammpscuda.a with default settings in lammps/lib/cuda, set “make yes-USER-CUDA”, modified lammps/src/MAKE/Makefile.linux with paths to MPICH2 and launch “make linux”.
Typical errors during the make process are undefined identifiers and references like
cuda.cpp(74): error: identifier “CUDA_ARCH” is undefined
if(shared_data.compile_settings.arch!=CUDA_ARCH) printf("\n\n # CUDA WARNING: Compile Settings of cuda and cpp code differ! \n # CUDA WARNING: arch: cuda %i cpp %i\n\n",shared_data.compile_settings.cufft, CUDA_ARCH);
…/…/lib/cuda/liblammpscuda.a(atom_vec_cuda_cu.o): In function global constructors keyed to _Z26AtomVecCuda _CountDataItemsj': tmpxft_00000ca0_00000000-1_atom_vec_cuda.cudafe1.cpp:(.text+0xfe): undefined reference to
cudaCreateChannelD
esc’
Researching the cause, I found the misprint in the file ./lib/cuda/Makefile.lammps. Instead of “CUDA_INSATLL_PATH = /usr/local/cuda” there should be “CUDA_INSTALL_PATH = /usr/local/cuda”. That misprint causes a lot of make errors.
Next, as stated here (http://lammps.sandia.gov/threads/msg22446.html) lammps/lib/cuda/Makefile.common should be included in lammps/src/Makefile.package but actually it is not, so I added to lammps/src/Makefile.package the lines
include /opt/lammps-27Aug11/lib/cuda/Makefile.lammps
include /opt/lammps-27Aug11/lib/cuda/Makefile.common
After that I was able to build LAMMPS with USER-CUDA.
Next possible error (it disappeared when I fixed the other ones so I’m not sure that it is the error) is that in ./src/USER-CUDA/fft3d_cuda.h line 92 you should add the else condition
#else
typedef struct {
float re;
float im;
} FFT_DATA;
#endif
Otherwise, there will be errors like “identifier “FFT_DATA” is undefined” in the case you don’t use Cuda FFT realization (-DFFT_CUFFT).
Don’t forget to reinstall the USER-CUDA package after changing the source:
make no-USER-CUDA
make yes-USER-CUDA
Hope this will help to someone to build LAMMPS with USER-CUDA package.
Nikita Tropin | Scientist