Please have a look at this thread for posting guidelines which will make your code readable. It is nearly impossible to help you as is.
As I suspected the error comes from code you added to LAMMPS and segfault indicates that this comes from reading of data that has not been allocated. In other libraries using the molatom
properties some verification is made to insure that the atom style actually sets such properties (look for lines like atom->molecular == Atom::MOLECULAR
). molatom
is set to nullptr by default, I suspect that checks in your code are insufficient.
Also note that segfault is a run-time error, not a compile error. Knowing what settings your simulation/test-case use would be of great help to give more meaningful insights.