Couldn't install lammps in CentOS machine using cmake

Sir, Usually when I install lammps in Ubuntu Linux, I follow

$mkdir build
$cd build
$cmake …/cmake
edit the CMakeCache.txt file for required packages
$make

But now I am trying in CentOS, here it is not following the CMakeCache.txt file and it is not installing the specified packages from it.

I have tried using the
$cmake -D PKG_package=on …/cmake
$make
but then I am getting another error saying
No rule to make target liblammps_linalg.a', needed by lmp’.
which didn’t come earlier when I did in Ubuntu.

please tell me what I should do. And what is the liblammps_linalg.a error and how to overcome it?

I am using:
CentOS 7.3.1611,
Cmake 3.24 (installed from source code)
Lammps-27May2021 (earlier worked in Ubuntu).

Thanking You
Harkishan Dua
PhD Scholar
Dept. of Physics
Assam University Silchar, India.

Please use LAMMPS version 23 June 2022 or provide a good reason why you need to use an older, non-stable version when you are compiling from source.

Also, please do not edit the CMakeCache.txt file, but rather place all your choices on the command line or use ccmake or cmake-gui to make incremental selections. For debugging purposes, however, it would be preferred to have a single cmake command line.

Please provide this single command line and the entire screen output that comes with it.

The difference to Ubuntu is likely due to having a compatible BLAS/LAPACK library installed or enabled there, but not on CentOS. However, the error messages you get should not be possible unless you are encountering a bug that has been fixed since or a using an incorrectly modified LAMMPS version.