Universal LAMMPS binaries for Linux

It should not be if you use CMake. But you will likely also want to load the proper environment modules so that you have recent enough versions of CMake, GCC, and OpenMPI or MPICH.

As someone who learned to compile LAMMPS with the former make procedure, the use of cmake makes it a breeze and is very well documented in the LAMMPS manual.

You can really start compiling a package-less vanilla version of the code with 4 commands, assuming you have a compiler and libraries correctly installed and linked, which should be the case on any working CentOS distribution, and incrementally build the version you need one step at a time. @akohlmey mentioned the bare minimum needed which is easy to install from standard repos.

By the way:

mpirun -srun lmp -i tip3p.in -l out.logā€

This command is bogus as far as I can see. There is no srun option for mpirun, srun is a Slurm command that wraps mpi so that it is executed according to the job specification. On the other hand srun has a --mpi= option which allows to check for MPI installation and pass some options.

1 Like

Dear Axel and Clavier,
Thank you both for your willingness to help. Alas, cmake, was ecactly the way how I tried. I tried using GCC and Intel, loaded modules for various versions of them to no avail.
Clavier: I agree that the submit line could be bogus, as you said - I probably picked it somewhere ā€œfrom the googleā€, and I admit that I am not ā€œa profiā€ and walk along my stoney path blindly helping myself with a stick. You could call me ā€œMe Unadventurousā€ or ā€œMr Impatientā€ if you wish, but I only wanted to compile an executable following the instructions, nothing more. On a Linux frontend with ā€œCentOS Linux release 7.9.2009 (Core)ā€ I loaded the following modules:
module load intel/18.0.3
module add intel/mpi/18.0.3
module add intel/mkl/18.0.3
module add CMake/3.26.3-GCCcore-12.3.0
and verified with ā€œmodule listā€. In the source ā€œlammps-17Apr2024ā€ directory I created a ā€œbuild_intelā€, cd to it and executed ā€œcmake …/cmakeā€, which completed, complaining only about ffmpeg (I could live without it, have VMD), and missing ClangFormat_EXECUTABLE (no comment on that).
Then, I called ā€œcmake --build .ā€, which, according to 3.1. Build LAMMPS with CMake — LAMMPS documentation should bring me the desired executable, but it did not. The build was aborted with the message:
/apps20/sw/eb/software/GCCcore/12.3.0/include/c++/12.3.0/x86_64-pc-linux-gnu/bits/c++config.h(521): error: function call is not allowed in a constant expression
#elif __cplusplus >= 201103L && __has_builtin(__builtin_is_constant_evaluated), pointing to angle.cpp(14).
Using different Intel versions I obtained different reasons why Lammps would not be built, but the result was the same. I also tried GCC, where the progress (in %) was different, and the errors were different, but in all cases Cmake failed to compile Lamms. My point is that with proper documentation even a monkey like myself should be able to type simple commands and compile the code. For example, with DL_POLY, I compiled the executable with a click. And it worked. I know, the problem is myself, but it is too late to reload the Bulba.
Kind regards, and many thanks for your attempts to help,
Taras

This discussion has now nothing to do with the original topic, so please delete it and post a new topic in the LAMMPS Installation category.

1 Like

Hello @akohlmey , I just tested the binaries and they work as expected on my machine running Ubuntu 22.04.

I just thought it might be useful for new users to have these static libraries highlighted as a first choice, either by pinning this thread on the mailing list or by having them listed with priority on the downloads page.

They (and corresponding packages with LAMMPS-GUI included) are the only precompiled options available for download on GitHub,. See e.g. Release Feature release 17 April 2024 Ā· lammps/lammps Ā· GitHub

They are also mentioned in the manual at: 2.1. Download an executable for Linux — LAMMPS documentation

The download page on the LAMMPS homepage is organized a bit different.

Please keep in mind that the primary way that we expect people access LAMMPS executables is that they compile them from source by themselves. If you are on any HPC or supercomputing facility that is almost a necessity if you want to take maximum advantage of the hardware. Sometimes staff at those centers provide pre-compiled versions. If you need training in that, most of the centers have user support staff that get paid to help you and you can learn from them.

1 Like