LAMMPS from scratch · 15 min
Getting LAMMPS without compiling
Ready-made LAMMPS programs exist for Windows, macOS and Linux. You install one, ask it which version and packages it has, run the melt example, and prove the installation works by matching its first line to the hand calculation.
- The ready-made ways to install LAMMPS on each system, and what they limit
- How to read lmp -h: the version and the installed packages
- Check an installation by matching the melt step-0 line to a hand calculation
1 · Understand: two ways to get LAMMPS
Someone has to compile LAMMPS (page 0.1). Either the LAMMPS developers do it and you download the program (this page), or you compile it yourself (page 0.4). Downloading is quicker; compiling lets you choose the version and packages, and is the only way to change the code.
| Download a program | Compile it yourself | |
|---|---|---|
| time to first run | minutes | 15–30 minutes the first time, including installing the tools |
| version | whatever was packaged | any release, including the newest |
| packages | chosen by the packager | exactly the ones you need |
| change the C++ code | not possible | yes (Part E) |
No installation at all is also possible: the Start page runs LAMMPS inside your browser.
2 · Install for your system
Steps follow the official LAMMPS installation pages (sources at the end). The program may be called lmp, lmp_serial, lmp_mpi or lmp.exe depending on the installer; use your name wherever this course writes lmp.
3 · Observe: ask LAMMPS about itself
lmp -h prints help. Its first lines say which version you have, and further down it lists the installed packages. Here is the start of ours, on the 2-processor computer used for this course:
| Version line says | What it means |
|---|---|
| 30 Sep 2026 | the newest stable release (the one running in your browser on these pages) |
| 22 Jul 2025 | the previous stable release (the source code quoted in this course) |
| a date with no "stable" tag | a feature release: newer features, less tested |
A command from a package that is not installed stops LAMMPS with a clear message. Ours, asked for pair_style tersoff:
4 · Match: prove your installation works
Run the melt example (it comes with every installer, in examples/melt/, or copy it from the Start page):
Its first thermo line is fixed by the crystal and the starting temperature, so every correct installation of every version must print exactly the numbers we computed by hand on the Start page. Paste your line below.
Later lines (step 50, 100, …) may differ slightly between versions, compilers and numbers of processors: tiny rounding differences grow in a chaotic liquid. Step 0 has no such freedom.
Your turn
1. Your lmp -h lists KSPACE MANYBODY MOLECULE RIGID. Can you use pair_style tersoff? And pair_style reaxff?
2. A student's hand calculation gives TotEng = −2.2733681 instead of −2.2744931. What did they forget?
3. Two correct installations print the same step 0 but different numbers at step 250. Is one of them broken?
Sources
- LAMMPS download page (stable releases 30 Sep 2026 and 22 Jul 2025)
- LAMMPS manual: Windows, macOS, conda
- LAMMPS-GUI installation