Linker error on AMD GPU

Hi there,
I am building lammps on AMD GPU gfx906. I am using lammps-15Apr20. All the makefiles are original.

In the lib/gpu, make -f Makefile.hip -j goes well. libgpu.a, hip_get_devices and Makefile.lammps are there.

Then in the src, make yes-GPU and make hip -j lead to the following error in the linker.

My modules are 1) compiler/devtoolset/7.3.1 2) compiler/rocm/2.9 3) compiler/cmake/3.15.6 4) mpi/hpcx/2.4.1/gcc-7.3.1.
So how can I solve this issue?

/lib/…/lib64/crt1.o: In function _start': (.text+0x20): undefined reference to main’
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [Makefile:95: …/lmp_hip] Error 1
make[1]: Leaving directory ‘/public/home/nsccsz_user14/source_lammps-15Apr20/src/Obj_hip’
make: *** [Makefile:207: hip] Error 2

Best,
Haidong

src/MAKE/OPTIONS/Makefile.hip needs to be updated for the changes in the build process in the 15 Apr 2020 patch release.
This is already done in the development version. You can download the updated file from here: https://github.com/lammps/lammps/blob/master/src/MAKE/OPTIONS/Makefile.hip

Axel.

Thanks, Axel. The makefile you provided works very well.

------------------ Original ------------------