check for compatible LAMMPS version when creating LAMMPS instance

This check must be done at runtime, since the LAMMPS shared library
may have been loaded dynamically and thus required library functions
may not be present or missing features with too only a LAMMPS version.
This commit is contained in:
Axel Kohlmeyer
2023-09-25 08:07:36 -04:00
parent 6ba94d1619
commit b21db641d9
3 changed files with 22 additions and 0 deletions

View File

@ -1170,6 +1170,14 @@ void LammpsGui::start_lammps()
lammps.open(narg, args);
lammpsstatus->show();
// must have at least 2 August 2023 version of LAMMPS
if (lammps.version() < 20230802) {
QMessageBox::critical(this, "Incompatible LAMMPS Version",
"LAMMPS-GUI version " LAMMPS_GUI_VERSION " requires\n"
"LAMMPS version 2 August 2023 or later");
exit(1);
}
// delete additional arguments again (3 were there initially
while (lammps_args.size() > initial_narg) {
delete lammps_args.back();