LAMMPS GUI Test version for macOS, Windows and Linux

Dear LAMMPS users,

[Update 2023-08-03:
LAMMPS GUI has been included in the stable 2 August 2023 release.
Binary packages are now available for download directly on GitHub

I am *still looking for a collaborator with Qt programming experience (better than mine, which is rather minimal and outdated) to improve the little LAMMPS GUI app, that I have been working over the last couple of weeks:

But what is now also needed is feedback on what can be improved with the current version. In particular what can help is, since developers are horrible at knowing how to explain things to non-developers:

  • Suggestions for improving the “Quick help text”
  • Suggestions for improving the documentation in the LAMMPS manual
  • A short mini-tutorial or LAMMPS GUI Howto for the LAMMPS manual
  • Suggestions for settings that should be added to the Preferences dialog
  • Suggestions for added features, but please see first.

Thanks, Axel.

1 Like

In the last couple of days there has been quite a bit of progress. I have compiled Qt from source myself, so that I have now a version that is compatible with both, arm64 and x86_64 and thus can build multi-arch binaries. After some hacking and lots of time spent searching on Google plus adaption the work of some colleagues, there is now a much improved DMG file at:

This disk image:

  • should be compatible with any mac running macOS 11 or later.
  • has a proper “drag-n-drop” installer with a nice background image created by LAMMPS developer Richard Berger
  • includes the command line version of LAMMPS (as lmp) and a few more tools (e.g. msi2lmp or binary2txt) and allows to launch the GUI from the command line as well (as lammps-gui).
  • includes a README file with instructions for the (manual) changes required to make the command line executables available
  • a much improved version of the LAMMPS GUI (still work in progress, though), many changes are usability improvements (e.g. you can drag-n-drop files into the editor window to open them, it shows whether a file has been modified, the progress of run commands is indicated with a progress bar, the log window is continuously update during a run - not just at the end)
  • the command line version of LAMMPS has been compiled with OpenMP support, but the GUI does not yet support it.

There is a bit more to come (and the code urgently needs some cleaning up, and more defensive programming to avoid crashes), but for mac users this should be quite usable to playing around with LAMMPS and provide feedback. That can be done either by replying to to this message here or by adding comments on GitHub: Add simple LAMMPS GUI using Qt library by akohlmey · Pull Request #3870 · lammps/lammps · GitHub

1 Like

The version uploaded yesterday had some issue, but there is now a new version that is significantly improved.

Now there is also a ZIP file with Windows binaries: It is lacking a fancy installer, but it should be possible to just unzip the archive, cd into the LAMMPS_GUI folder and then launch lammps-gui.exe. I can do the same on my Linux(!) desktop using the “wine” program for running Windows executables.

… and finally a precompiled executable for Linux:

This was compiled on Ubuntu 20.04LTS and is supposed to be portable to all more recent Linux installations. For example, I can run these binaries on Fedora Linux 38. To make this work, there is some trickery with providing compatible shared libraries required, so please let me know if there are problems.

Same as with the windows archive, you should unpack the tar file and then cd into the LAMMPS_GUI folder and execute the programs there. Those are actually not the real executables, but a wrapper script that sets up the environment and then executes the binaries. You could rename the LAMMPS_GUI folder or move it anywhere and then add that folder to your $PATH environment and you should be able to use lmp, lammps-gui, msi2lmp and so on. Please note that these executables are compiled without MPI.

If these are not portable enough, you can always use the static packages, like
Those, however, do not contain the GUI and Ubuntu 20.04LTS was the olders Linux where I could make compiling them work without having to recompile a whole lot of software myself, since the versions bundled with those Linux distributions would have been too old.

Here are several issues I found on the Windows version:

  1. clicking the “Quick help” and the message box looks like this (I’m on a 4K monitor with 200% dpi scaling);

  2. when trying to run lammps through GUI there is an error like “entry point not found _ZN3fmt6v9_lmp7vformatB5cxx11ENS0_17basic_string_viewlcEENS0… in C:\path\to\lmp_15Jun2023-MSMPI\plugins\”. The simulation proceeds anyway.

  3. this is probably the fault of Qt, but the menu bar feels too compact and is uncomfortably small.

It worked on macOS.

This is already fixed in the source code. I will upload an updated package later today.

This is harmless and a side effect from your system having a “full” LAMMPS version installed with an installer. This new binary has a LAMMPS library dll file that is not compatible with yours and thus trying to load the plugin from a different compilation will fail.

I would say that rather the font in the text buffer is too large. Font sizes at an absolute and relative scale and also with high/low dpi screens are tricky business. There are issues with macOS as well. Some of that can be addressed by setting the QT_FONT_DPI environment variable, but the ultimate solution is to add a preferences tab where users can choose font family and size to their liking.

Considering the level of complications I have to deal with by building a binary package including a graphical library, I am actually pleased how well it works (fortunately, the Qt library provides suitable tools for macOS and Windows that take away a lot of the guesswork. Linux has been more of a challenge). Distributing source code is so much simpler in comparison (and not that simple a task either). But then again, for working on this for less than a couple of weeks and with not having programmed a graphical application in over a decade, it is quite surprising how well this is working already.


Thanks for the feedback. We have this far spent most time on building the package for macOS. So it is no surprise that is is working smoothly. The learning curve to compile executables for two architectures instead of one is not quite as steep, although some tweaks to the CMake scripting in LAMMPS was required.

Originally this was without the GUI in preparation for the tutorials session at the upcoming LAMMPS workshop. In previous years we were using a VirtualBox virtual machine image, but those could only be used on x86 CPUs. So now we are looking for alternate ways of having a no-compile consistent availability of LAMMPS executables for all tutorial participants. The GUI app was only an afterthought since there was no consistent way to use a “native” text editor with the same behavior on the macOS, Windows and Linux platforms.

Is this an Intel or an Apple CPU? and what version of macOS?

To further explain this: the GUI binary has to be compiled with Visual Studio on Windows (in a virtual machine) with the Visual C++ compiler. The installer is compiled on Linux with a GCC cross-compiler. VC++ and GCC have different implementations of the C++ runtime and STL. The dynamic load of the plugin fails because it is looking for functions that only exist in the GCC compiler runtime.

Thank you for all the hard work.
The system is OS: Darwin 22.5.0 x86_64
macOS: Ventura 13

All three packages have just been updated with the latest version.

I am particularly curious about the portability of the Linux version. If there are problems, you may need to run that in a container. It has been compiled on Ubuntu 20.04LTS.

This looks nice! It works on Mint 21.1, but there is an error if I try to run it on my ancient Centos 7:
./bin/lammps-gui: error while loading shared libraries: cannot open shared object file: No such file or directory

If I run command ldd lib/, I got a bunch of errors, so I guess Centos 7 is too old to have this work ;):

./ /lib64/ version `GLIBC_2.29' not found (required by ./
./ /lib64/ version `GLIBC_2.25' not found (required by ./
./ /lib64/ version `GLIBC_2.28' not found (required by ./
./ /lib64/ version `CXXABI_1.3.8' not found (required by ./
./ /lib64/ version `GLIBCXX_3.4.21' not found (required by ./
./ /lib64/ version `CXXABI_1.3.9' not found (required by ./

I was curious why there is the No such file or directory error although the file is right there. It appears that this is a problem with the kernel, which needs to be in version at least 3.15. For more details see here: virtualbox - Ubuntu 18.4 cannot open shared object file: No such file or directory - Ask Ubuntu
Using the workaround from the link, I was able to get past the No such file error. Now there is a bunch of errors about too old libraries:

./lammps-gui: /lib64/ version `GLIBCXX_3.4.21' not found (required by ./lammps-gui)
./lammps-gui: /lib64/ version `GLIBCXX_3.4.20' not found (required by ./lammps-gui)
./lammps-gui: /lib64/ version `GLIBC_2.27' not found (required by /home/michal/LAMMPS_GUI/bin/
./lammps-gui: /lib64/ version `GLIBC_2.29' not found (required by /home/michal/LAMMPS_GUI/bin/
./lammps-gui: /lib64/ version `CXXABI_1.3.8' not found (required by /home/michal/LAMMPS_GUI/bin/
./lammps-gui: /lib64/ version `GLIBCXX_3.4.20' not found (required by /home/michal/LAMMPS_GUI/bin/
./lammps-gui: /lib64/ version `GLIBCXX_3.4.21' not found (required by /home/michal/LAMMPS_GUI/bin/
./lammps-gui: /lib64/ version `GLIBC_2.29' not found (required by /home/michal/LAMMPS_GUI/bin/
./lammps-gui: /lib64/ version `CXXABI_1.3.9' not found (required by /home/michal/LAMMPS_GUI/bin/
./lammps-gui: /lib64/ version `GLIBC_2.29' not found (required by /home/michal/LAMMPS_GUI/bin/
./lammps-gui: /lib64/ version `CXXABI_1.3.9' not found (required by /home/michal/LAMMPS_GUI/bin/
./lammps-gui: /lib64/ version `GLIBC_2.29' not found (required by /home/michal/LAMMPS_GUI/bin/
./lammps-gui: /lib64/ version `GLIBC_2.25' not found (required by /home/michal/LAMMPS_GUI/bin/
./lammps-gui: /lib64/ version `GLIBC_2.28' not found (required by /home/michal/LAMMPS_GUI/bin/
./lammps-gui: /lib64/ version `CXXABI_1.3.8' not found (required by /home/michal/LAMMPS_GUI/bin/
./lammps-gui: /lib64/ version `GLIBCXX_3.4.21' not found (required by /home/michal/LAMMPS_GUI/bin/
./lammps-gui: /lib64/ version `CXXABI_1.3.9' not found (required by /home/michal/LAMMPS_GUI/bin/
./lammps-gui: /lib64/ version `GLIBC_2.29' not found (required by /home/michal/LAMMPS_GUI/bin/
./lammps-gui: /lib64/ version `CXXABI_1.3.8' not found (required by /home/michal/LAMMPS_GUI/bin/
./lammps-gui: /lib64/ version `GLIBC_2.29' not found (required by /home/michal/LAMMPS_GUI/bin/
./lammps-gui: /lib64/ version `GLIBC_2.29' not found (required by /home/michal/LAMMPS_GUI/bin/
./lammps-gui: /lib64/ version `CXXABI_1.3.8' not found (required by /home/michal/LAMMPS_GUI/bin/
./lammps-gui: /lib64/ version `GLIBC_2.28' not found (required by /home/michal/LAMMPS_GUI/bin/

I also noticed a small bug, if the input script is really short, for example it has only one line with atom_style full, the program will hang after executing the script.

If I find the time, I can probably build Qt5.15LTS for CentOS7 and then have a more universal binary. This is always the challenge with portable binaries, you want recent tools because they have more features and are easier to use, but only on very old systems, you can build binaries that have a chance to work in more places.

Thankfully, there is now an alternate way: use a container! You can run a modern Linux in a container on top of an old one.

That is an interesting one. This is due to a “feature” in the class capturing the output (not an easy feat, BTW, to do on different platforms). There needs to be at least one character worth of output. I have moved the “clear” command to be issued after the capturing is started (that was a reasonable thing to do after some refactoring that is not yet public). So, thanks for the report. It helped to not only fix the issue, but also made the source code better. :wink:

1 Like

There is a new version (v1.1) of the LAMMPS GUI available that can now also capture the thermodynamic output from a run and display it as a chart. The chart is updated dynamically during the run.

The data can be exported to text files in simple space separated columns suitable for most plotting program (e.g. gnuplot or xmgrace) or in CSV format so it can be easily imported into excel or with pandas etc. It is also possible to save pictures like the one attached here. Downloads of packages for all supported platforms are (again) available at: LAMMPS Static Linux and GUI Binary Download Repository: .


FYI, I have posted new binaries with some more improvements. There are more options that can be changed in the preferences dialog and that are stored between runs. There is a list of (up to) 5 recent files in the File menu that can be opened directly. Fonts can be customized.

All changes since the stable release can be seen in the pending pull request LAMMPS GUI improvements by akohlmey · Pull Request #3883 · lammps/lammps · GitHub

New binaries have been uploaded. Several bugs are fixed and the following new major features were added:

  • the Run menu offers a “Set Variables” dialog. This allows to enter the equivalent of the -var name value(s) command line flag. The dialog is populated with variables defined in the input as index style (those may be overridden from the command line, see bench/in.lj for example and variables that seem to be used but for which no definition was found (those must be set, if the parser detected them correctly).
  • The text editor now has the ability of query the online manual. For any line that has a LAMMPS command right clicking will open a context dialog, where a website for that specific command (or style) can be opened.This feature is also connected to the CTRL-? hotkey.
1 Like

This might be a bit of a stretch as a suggestion, but would not it be more suitable/simple to link the context box to the source file of the documentation of the LAMMPS related command? It could be directly opened in a tab of the editor or a new window. That way, the user might get the documentation of the version shipped with the binary without having to compile the doc or using an internet connection.

But again, this is just a suggestion or an open question. I don’t know how complicated this would be to implement.

(Shout out for your work on this project.)

I am still working on the low hanging fruit and items with the largest “hack value™”, and in the process am teaching myself a lot of things (in other words, I am having fun with this and am still amazed how far this has come in such a short time and while we were preparing/executing the LAMMPS workshop, too). In this case the main challenge was in how to establish the context of what command to look up. The “back end” is then more a technical problem (nearly 3000 pages worth of documentation is quite a chunk of data).

Also, I am adjusting the target a bit, since I found it quite useful myself for some of my own work. So I am also looking into adding features that have appeal to myself (e.g. like attaching a debugger to the running executable or capturing valgrind output, if at all possible).

There are also idea that are floating around for LAMMPS itself that may be helpful in combination with the GUI, like the idea of a framework of identifying atom types with element (e.g. from potential files, or guessed from their mass), which in turn would make the color assignment for dump image more in line with other visualization tools. Indeed, dump image has so many options, and many of them are hard and non-intuitive to use, I am thinking of ways to introduce some abstractions to the Image Viewer and expose those to dialogs or radioboxes or checkboxes or the preferences.

The Qt libraries have a way to use a built-in help system based on compressed html files: The Qt Help Framework | Qt Help 5.15.14, but I have not yet tried it out. My main concern is that we make extensive use of MathJAX in the documentation and that may be asking a bit too much.

That said, there is a way to translate the LAMMPS documentation for epub (and convert it to .mobi) where all the embedded LaTeX code is converted to pictures. There might be a way to set that up for regular html output. However, that is currently producing a bunch of error from the conversion (could probably be debugged and fixed). So those need to be fixed first.


Version 1.2 is now available at: LAMMPS Static Linux and GUI Binary Download Repository: .
This version has all problems that I know of addressed and will likely be included as is in the next feature release.
Now there is also some documentation: Once the feature release is out, it can be directly loaded from the web.

1 Like