Fix compilation issue for some pair styles using ewald_const.h #4077
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
When compiling the 7 Feb 2024 LAMMPS release using CMake there are compilation errors when some packages are installed (e.g. EXTRA-PAIR) but not KSPACE. This is due to the
ewald_const.h
header being part of the KSPACE package and the other packages installing (some) pair styles requiring KSPACE and the CMake scripting not excluding them from compilation. Rather than adding (complex) CMake code to remove those files from compilation, it is simpler to move the ewald_const.h file from src/KSPACE to src. This has the added benefit of enabling the use of it for pair styles with 'coul/dsf', for example, and thus further reducing the redundant definition of constant.This also adds OpenMP compatibility detection with CrayClang compilers for very new CMake versions that do not flag it as Clang anymore and thus it won't fall under the Clang version check.
The plan is to release this as version 7 Feb 2024 - Update 1. Since this only affects custom compilations from source code, only source code tarballs need to be updated.
Related Issue(s)
Fixes #4076 and also addresses the issue raised in https://matsci.org/t/error-when-compiling-ewald-const-h-no-such-file-or-directory/53510
Author(s)
Axel Kohlmeyer, Temple U
Licensing
By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under either the GNU General Public License version 2 (GPL v2) or the GNU Lesser General Public License version 2.1 (LGPL v2.1).
Post Submission Checklist