Problem using LAMMPS shared library in python


when I run “import lammps” in python, seems like it is imported successfully but when I subsequently run “lammps.lammps()” I’m getting the error: “Illegal instruction”

  • I compiled lammps version 24 March 2022
  • It is compiled using intel oneapi
  • python version: 3.9.7
  • I used “make install-python” to install the lammps module
  • The shared library “” is both in the lammps folder in the site-packages of python and in the src directory of lammps. I have also added the …/lammps/src to the path.

Any ideas what the problem is?


That means when compiling LAMMPS either you were using compiler settings that were not suitable for your hardware, or one of the software packages you have installed was compiled/configured for a different hardware than you have. You can check for the former by trying to launch LAMMPS directly.

Thank you! yes you are right. I was using an HPC system an I was on an interactive job when compiling lammps. Does this mean I can only run lammps on that particular node that I compiled lammps with? (or other nodes that have similar CPU)?

You have to use compiler settings that are compatible with the lowest common denominator of the hardware you intend to use.

Thank you!