# lammps-build-and-install > This skill should be used when users ask about build and install in lammps; it prioritizes documentation references and then source inspection only for unresolved details. - Author: Tao E. Li - Repository: TEL-Research-Group/lammps - Version: 20260207223556 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-08 - Source: https://github.com/TEL-Research-Group/lammps - Web: https://mule.run/skillshub/@@TEL-Research-Group/lammps~lammps-build-and-install:20260207223556 --- --- name: lammps-build-and-install description: This skill should be used when users ask about build and install in lammps; it prioritizes documentation references and then source inspection only for unresolved details. --- # lammps: Build and Install ## High-Signal Playbook ### Route the request - Use `lammps-getting-started` for first-run script layout and launch basics. - Use `lammps-parallel-hpc` for runtime MPI/OpenMP/GPU performance tuning. - Use `lammps-api-and-scripting` for Python module/shared-library workflows. - Use `lammps-troubleshooting` for compiler/link/runtime failure diagnosis. ### Triage questions - Are you building from source (CMake/make) or using distribution binaries? - Which accelerators are needed: `OPENMP`, `GPU`, `KOKKOS`, `INTEL`? - Which optional styles/packages must be present for your input deck? - Is the Python module required in this environment? - Are there existing `src` make artifacts that conflict with CMake? ### Canonical workflow - Prefer CMake out-of-source builds (`doc/src/Build_cmake.rst`). - If switching from make to CMake, clean `src` with `make no-all purge` (`doc/src/Build_cmake.rst`). - Configure compilers and package flags (`doc/src/Build_basics.rst`, `doc/src/Build_package.rst`). - Build with parallel jobs and run `lmp -help` to verify enabled styles (`doc/src/Run_options.rst`). - Run a smoke test from `examples` before production usage (`doc/src/Run_basics.rst`). - Install optionally with `cmake --install` and update linker cache for system installs (`doc/src/Build_cmake.rst`). ### Minimal working examples - Baseline CMake build (`doc/src/Build_cmake.rst`): ```bash cmake -S cmake -B build cmake --build build --parallel 8 build/lmp -help ``` - Package-enabled build (`doc/src/Build_package.rst`): ```bash cmake -S cmake -B build \ -D PKG_MOLECULE=yes \ -D PKG_KSPACE=yes \ -D PKG_MANYBODY=yes cmake --build build --parallel 8 ``` ### Pitfalls - Mixing make-installed packages in `src` with CMake configuration (`doc/src/Build_cmake.rst`). - Assuming package changes take effect without rebuilding (`doc/src/Build_package.rst`). - Missing package support for styles used by the input (`doc/src/Build_package.rst`, `doc/src/Run_options.rst`). - Building serial-only binaries when MPI execution is intended (`doc/src/Build_basics.rst`). - Forgetting runtime library updates (`ldconfig`) after system-wide install (`doc/src/Build_cmake.rst`). ### Validation checklist - Confirm executable name/path and architecture (`lmp`, `lmp_`). - Confirm required styles appear in `lmp -help` output. - Run one short example input successfully on target hardware. - Record exact LAMMPS version and build options for reproducibility. ## Scope - Handle questions about build, installation, compilation, and environment setup. - Keep responses abstract and architectural for large codebases; avoid exhaustive per-function documentation unless requested. ## Primary documentation references - `doc/src/Build_basics.rst` - `doc/src/Build_cmake.rst` - `doc/src/Build_make.rst` - `doc/src/Build_package.rst` - `doc/src/Build_extras.rst` - `doc/src/Install.rst` - `doc/src/Install_linux.rst` - `doc/src/Speed_omp.rst` - `doc/src/Speed_gpu.rst` - `doc/src/Speed_kokkos.rst` - `doc/src/Python_install.rst` - `doc/src/Run_options.rst` ## Workflow - Start with the primary references above. - If details are missing, inspect `references/doc_map.md` for additional topic documents (generated inventory plus curated anchors). - Use tutorials/examples as executable usage patterns when available. - Use tests as behavior or regression references when available. - If ambiguity remains after docs, inspect `references/source_map.md` and start with the ranked source entry points. - Cite exact documentation file paths in responses. ## Tutorials and examples - `examples` ## Test references - None discovered. ## Optional deeper inspection - `cmake` - `fortran` - `lib` - `python` - `src` ## Source entry points for unresolved issues - `cmake/CMakeLists.txt` - `cmake/Modules/LAMMPSUtils.cmake` - `cmake/Modules/Packages/GPU.cmake` - `cmake/Modules/Packages/KOKKOS.cmake` - `cmake/Modules/Packages/OPENMP.cmake` - `cmake/Modules/Packages/PYTHON.cmake` - `cmake/LAMMPSConfig.cmake.in` - `src/Makefile` - `lib/kokkos/CMakeLists.txt` - Prefer targeted source search (for example: `rg -n "" cmake fortran lib python src`).