How to install package in LAMMPS

Hello everyone!
I’d like to install ‘extra package’ and ‘granular package’ . The tutorial I have found is always start from the src folder. However, I can’t find the src folder in installation directory. I downloaded the latest version of LAMMPS and installed it again and there was still no src folder. So how to solve it?
Thank you for reading!

Look at the LAMMPS manual. It explains in great detail how to compile LAMMPS from source.

Thanks for your reply, but my question is I can’t find src folder in LAMMPS installation directory, I just want to install some packages so I can run my code. It is not my point to figure out the details of how LAMMPS compile.

You cannot add a LAMMPS package to a previously compiled LAMMPS executable.
Thus you must compile a new LAMMPS executable from source.

So you must figure out how to compile LAMMPS and study all the details of that. And to compile LAMMPS you must download the source code which does have a src folder.

If you had read the documentation as suggested, you would have learned that.

Thanks akohlmey! I have read the part 2.3. Download an executable for Windows — LAMMPS documentation3.6. Include packages in build — LAMMPS documentation and 3.7. Packages with extra build options — LAMMPS documentation. But I still did not get the point. I wonder if I read the right page? It will be very nice if you cite the right address about the details.

There are two serious problems here:

  1. It is common sense that you cannot jump into the middle of a documentation and expect that it conveys all the relevant information you are looking for or that everything makes sense. If you do it anyway and then discover that information is missing, you have to go back to the beginning and start over and read consecutively. Thus to understand what is in section 3.6 you have to start from section 3. at the minimum and then work your way up to 3.6 and 3.7. And if that isn’t sufficient, you start at 2. and read all of 2. and its subsections, too. When people suggest to you to “read the documentation” than they mean that you should start from the beginning and keep reading until you have learned what you need to learn. If they want you to jump ahead, they will tell you.

  2. You cannot get good advice if you do not provide crucial relevant information. What is missing here is for example which version of LAMMPS you have, what platform you are running on, and how exactly you installed LAMMPS. It is a mistake to assume that people will just know it or that “everybody” will do this. From your last remark it seems likely that you are running on Windows. Now if you installed LAMMPS from a pre-compiled installer package from LAMMPS Windows Installer Repository, then it will likely contain any package that can be compiled for Windows and if you really have the latest version (23 June 2022 currently) then all the packages you are referring to will be included. If you think differently, please run lmp -h > out.txt and provide the content of that file. It should contains something like this:

Large-scale Atomic/Molecular Massively Parallel Simulator - 23 Jun 2022
Git info (stable / stable_23Jun2022-1-g63b5e776aa)

[...]

OS: Windows 11 21H2, Windows ABI 6.2 (9200) on x86_64

Compiler: MinGW-w64 64bit 9.0 / GNU C++ 11.2.1 20210728 (Fedora MinGW 11.2.1-3.fc35) with OpenMP 4.5
C++ standard: C++14
MPI v1.0: LAMMPS MPI STUBS for LAMMPS version 23 Jun 2022

[...]

Installed packages:

ASPHERE ATC AWPMD BOCS BODY BPM BROWNIAN CG-DNA CG-SDK CLASS2 COLLOID COLVARS 
COMPRESS CORESHELL DIELECTRIC DIFFRACTION DIPOLE DPD-BASIC DPD-MESO DPD-REACT 
DPD-SMOOTH DRUDE EFF ELECTRODE EXTRA-COMPUTE EXTRA-DUMP EXTRA-FIX 
EXTRA-MOLECULE EXTRA-PAIR FEP GPU GRANULAR INTEL INTERLAYER KOKKOS KSPACE 
LATTE MACHDYN MANIFOLD MANYBODY MC MDI MEAM MESONT MGPT MISC ML-HDNNP ML-IAP 
ML-RANN ML-SNAP MOFFF MOLECULE MOLFILE OPENMP OPT ORIENT PERI PHONON PLUGIN 
POEMS PTM QEQ QTB REACTION REAXFF REPLICA RIGID SHOCK SMTBQ SPH SPIN SRD TALLY 
UEF VORONOI YAFF 

List of individual style options included in this LAMMPS executable
[...]

As you can see, the GRANULAR and all the EXTRA- packages are included, so it is unclear why you want to “install” them. Most likely you are making some other mistake somewhere and have drawn the wrong conclusion. If you installed LAMMPS from the Microsoft Store app then you will have to wait until that version has been updated and approved. Since this is a laborious and time consuming process, it will take some time after a release. Since this is an “installer package” with pre-compiled executables, there is no point in including the source code, so it is no surprise that you won’t find a src folder.

Thanks a lot! I will check my version.

Thanks a lot

Thanks a lot, it really helps