How to build a serial and no optimization version to debugger?

Dear Alex and LAMMPS users:
I would like to ask how can I build a LAMMPS version without any optimization and without the MPI framework.
I want to execute the code step by step. And now I use the BUILD_MPI=off flag, but still the output and variable cannot match the line I keep pace with. And some functions and variables also say “optimized out”.
My target is to find out the whole control flow of LAMMPS, learn how a good molecular simulation software works in practice. So I can add some a little complex fix command in it.

Thanks in advance if you can give me a guide!

Roy Kid
University of science and technology of China

Dear Alex and LAMMPS users:
I would like to ask how can I build a LAMMPS version without any optimization and without the MPI framework.

add -D CMAKE_BUILD_TYPE=Debug when running cmake.

I want to execute the code step by step. And now I use the BUILD_MPI=off flag, but still the output and variable cannot match the line I keep pace with. And some functions and variables also say “optimized out”.

please note that this message also applies to variables that are not yet in scope.

My target is to find out the whole control flow of LAMMPS, learn how a good molecular simulation software works in practice.

a debugger is not that good a tool for that. You’ll be better served by first reading through the developer guide: https://lammps.sandia.gov/doc/Developer.pdf

axel.