Memory issue coupling with C++ code

I am able to run LAMMPS from a C++ program and do everything I need, but I can't seem to exit LAMMPS gracefully. Here is my example (call it test.cpp):

works for me:

[[email protected]…3785… Downloads] mpicxx -Wall -O -I ~/compile/lammps-icms/src test.cpp ~/compile/lammps-icms/src/liblammps.so -o lmp.x [[email protected] Downloads] ./lmp.x
LAMMPS (24 Dec 2015-ICMS)
WARNING: OMP_NUM_THREADS environment is not set. (…/comm.cpp:90)
using 1 OpenMP thread(s) per MPI task
This is a test

If you can do this:

lmp = new …

delete lmp

print(“This is a test”)

and you see the This is a test message before

the crash (which is what your output above shows), it indicates LAMMPS did in fact get

created and deleted correctly before whatever caused

the crash …

Steve