Error while installing Lammps on gpu

Hello everybody,

I am trying to install with the GPU package.
I compiled the lib/gpu package.
After I compiled lammps with the gpu package.

make yes-gpu
make gpu -j 8

After I get this error:

mpicxx -g -O -std=c++11 main.o -L…/…/lib/gpu -L/usr/local/cuda/lib64 -L/usr/local/cuda/lib64/stubs -L. -llammps_gpu -lgpu -lcudart -lcuda -ldl -L /user/local/cuda/lib64 -lcudart -o …/lmp_gpu
/usr/bin/ld: ./liblammps_gpu.a(fix_gpu.o): in function LAMMPS_NS::FixGPU::FixGPU(LAMMPS_NS::LAMMPS*, int, char**)': /home/usuario/lammps-2Jun2022/src/Obj_gpu/../fix_gpu.cpp:234: undefined reference to lmp_init_device(ompi_communicator_t*, ompi_communicator_t*, int, int, int, double, int, double, char*, int, char*, int)’
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:94: …/lmp_gpu] Error 1
make[1]: Leaving directory ‘/home/usuario/lammps-2Jun2022/src/Obj_gpu’
make: *** [Makefile:393: gpu] Error 2

I don’t understand the problem. Could anyone help me?
I am using cuda V11.5.119 and Openmpi: Open MPI: 4.1.2 versions.

Regards,

Stefano

Did you compile the gpu library in the lib folder first?
Check out the manual about how to compile with the (old) build system.

Is there a specific reason you are not using the CMake build system. It. Should be easier to use for people with limited experience compiling software where you have to edit makefiles and know details about the installation of tools. CMake can automate most of those steps, if used according to the manual

Hello,

thanks, using CMAKE solved the problem.

Regards,

Stefano