Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/lammps-gui-flatpak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ jobs:
- name: Build flatpak
run: |
mkdir flatpack-state
sed -i -e 's/branch:.*/branch: develop/' cmake/packaging/org.lammps.lammps-gui.yml
sed -i -e 's/branch:.*/branch: develop/' tools/lammps-gui/org.lammps.lammps-gui.yml
flatpak-builder --force-clean --verbose --repo=flatpak-repo \
--install-deps-from=flathub --state-dir=flatpak-state \
--user --ccache --default-branch=${{ github.ref_name }} \
flatpak-build cmake/packaging/org.lammps.lammps-gui.yml
flatpak-build tools/lammps-gui/org.lammps.lammps-gui.yml
flatpak build-bundle --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo \
--verbose flatpak-repo LAMMPS-Linux-x86_64-GUI.flatpak \
org.lammps.lammps-gui ${{ github.ref_name }}
Expand Down
20 changes: 0 additions & 20 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,3 @@ and then merged to `stable` and published as "updates". For a new
stable release the `stable` branch is updated to the corresponding state
of the `release` branch and a new stable tag is applied in addition to
the release tag.

# Integrity of Downloaded Archives

For *all* files that can be downloaded from the "lammps.org" web server
we provide SHA-256 checksum data in files named SHA256SUM. These
checksums can be used to validate the integrity of the downloaded
archives. Please note that we also use symbolic links to point to
the latest or stable releases and the checksums for those files
*will* change (and so their checksums) because the symbolic links
will be updated for new releases.

# Immutable GitHub Releases

Starting with LAMMPS version 10 Sep 2025 the LAMMPS releases published
on GitHub are configured as `immutable`. This means that after the
release is published the release tag cannot be changed or any of the
uploaded assets, i.e. the source tarball, the static Linux executable
tarball and the pre-compiled packages of LAMMPS with LAMMPS-GUI included.
GitHub will generate a release attestation JSON file which can be
used to verify the integrity of the files provided with the release.
75 changes: 48 additions & 27 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
########################################
# CMake build system
# This file is part of LAMMPS
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.16)
########################################
# initialize version variables with project command
if(POLICY CMP0048)
Expand Down Expand Up @@ -140,26 +140,25 @@ if((PKG_KOKKOS) AND (Kokkos_ENABLE_CUDA) AND (LAMMPS_CXX_COMPILER_NAME STREQUAL
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xcudafe --diag_suppress=unrecognized_pragma,--diag_suppress=128,--diag_suppress=186")
endif()

# We *require* C++17 without extensions
# Kokkos also requires at least C++17 (currently)
# we *require* C++11 without extensions but prefer C++17.
# Kokkos requires at least C++17 (currently)
if(NOT CMAKE_CXX_STANDARD)
# uncomment in case we plan to switch to C++20 as minimum standard
# if(cxx_std_20 IN_LIST CMAKE_CXX_COMPILE_FEATURES)
# set(CMAKE_CXX_STANDARD 20)
# else()
if(cxx_std_17 IN_LIST CMAKE_CXX_COMPILE_FEATURES)
set(CMAKE_CXX_STANDARD 17)
# endif()
else()
set(CMAKE_CXX_STANDARD 11)
endif()
endif()
if(CMAKE_CXX_STANDARD LESS 17)
message(FATAL_ERROR "C++ standard must be set to at least 17")
if(CMAKE_CXX_STANDARD LESS 11)
message(FATAL_ERROR "C++ standard must be set to at least 11")
endif()
if(PKG_KOKKOS AND (CMAKE_CXX_STANDARD LESS 17))
set(CMAKE_CXX_STANDARD 17)
endif()
# turn off C++20 check in lmptype.h
#if(LAMMPS_CXX17)
# add_compile_definitions(LAMMPS_CXX17)
#endif()
# turn off C++17 check in lmptype.h
if(LAMMPS_CXX11)
add_compile_definitions(LAMMPS_CXX11)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF CACHE BOOL "Use compiler extensions")
# ugly hacks for MSVC which by default always reports an old C++ standard in the __cplusplus macro
Expand All @@ -179,9 +178,15 @@ endif()
# warn about potentially problematic GCC compiler versions
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if (CMAKE_CXX_STANDARD GREATER_EQUAL 17)
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.3)
message(WARNING "Using the GNU compilers version ${CMAKE_CXX_COMPILER_VERSION} with C++17 "
"or later is not recommended. Please use the GNU compilers version 9.3 or later")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
message(WARNING "Using ${CMAKE_CXX_COMPILER_ID} compiler version ${CMAKE_CXX_COMPILER_VERSION} "
"with C++17 is not recommended. Please use ${CMAKE_CXX_COMPILER_ID} compiler version 9.x or later")
endif()
endif()
if (CMAKE_CXX_STANDARD GREATER_EQUAL 11)
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
message(WARNING "Using ${CMAKE_CXX_COMPILER_ID} compiler version ${CMAKE_CXX_COMPILER_VERSION} "
"with C++11 is not recommended. Please use ${CMAKE_CXX_COMPILER_ID} compiler version 5.x or later")
endif()
endif()
endif()
Expand Down Expand Up @@ -237,13 +242,6 @@ file(GLOB MAIN_SOURCES CONFIGURE_DEPENDS ${LAMMPS_SOURCE_DIR}/main.cpp)
list(REMOVE_ITEM ALL_SOURCES ${MAIN_SOURCES})
add_library(lammps ${ALL_SOURCES})

# add extra libraries for std::filesystem with older compilers
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.1)
target_link_libraries(lammps PRIVATE stdc++fs)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
target_link_libraries(lammps PRIVATE c++fs)
endif()

# tell CMake to export all symbols to a .dll on Windows with MinGW cross-compilers
if(BUILD_SHARED_LIBS AND (CMAKE_SYSTEM_NAME STREQUAL "Windows") AND CMAKE_CROSSCOMPILING)
set_target_properties(lammps PROPERTIES LINK_FLAGS "-Wl,--export-all-symbols")
Expand All @@ -265,6 +263,8 @@ set(STANDARD_PACKAGES
AMOEBA
APIP
ASPHERE
ATC
AWPMD
BOCS
BODY
BPM
Expand Down Expand Up @@ -325,6 +325,7 @@ set(STANDARD_PACKAGES
PHONON
PLUGIN
PLUMED
POEMS
PTM
PYTHON
QEQ
Expand Down Expand Up @@ -437,6 +438,7 @@ endif()
# "hard" dependencies between packages resulting
# in an error instead of skipping over files
pkg_depends(ML-IAP ML-SNAP)
pkg_depends(ATC MANYBODY)
pkg_depends(LATBOLTZ MPI)
pkg_depends(SCAFACOS MPI)
pkg_depends(AMOEBA KSPACE)
Expand Down Expand Up @@ -514,7 +516,7 @@ if((CMAKE_CXX_COMPILER_ID STREQUAL "Intel") AND (CMAKE_CXX_STANDARD GREATER_EQUA
PROPERTIES COMPILE_OPTIONS "-std=c++14")
endif()

if(PKG_ML-QUIP OR PKG_ML-POD OR PKG_ELECTRODE OR PKG_RHEO OR BUILD_TOOLS)
if(PKG_ATC OR PKG_AWPMD OR PKG_ML-QUIP OR PKG_ML-POD OR PKG_ELECTRODE OR PKG_RHEO OR BUILD_TOOLS)
if (NOT USE_INTERNAL_LINALG)
find_package(LAPACK)
find_package(BLAS)
Expand Down Expand Up @@ -675,15 +677,17 @@ endforeach()
##############################################
# add lib sources of (simple) enabled packages
############################################
foreach(PKG_LIB H5MD)
foreach(PKG_LIB POEMS ATC AWPMD H5MD)
if(PKG_${PKG_LIB})
string(TOLOWER "${PKG_LIB}" PKG_LIB)
file(GLOB_RECURSE ${PKG_LIB}_SOURCES CONFIGURE_DEPENDS
${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.c ${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.cpp)
add_library(${PKG_LIB} STATIC ${${PKG_LIB}_SOURCES})
set_target_properties(${PKG_LIB} PROPERTIES OUTPUT_NAME lammps_${PKG_LIB}${LAMMPS_MACHINE})
target_link_libraries(lammps PRIVATE ${PKG_LIB})
if(PKG_LIB STREQUAL "h5md")
if(PKG_LIB STREQUAL "awpmd")
target_include_directories(awpmd PUBLIC ${LAMMPS_LIB_SOURCE_DIR}/awpmd/systems/interact ${LAMMPS_LIB_SOURCE_DIR}/awpmd/ivutils/include)
elseif(PKG_LIB STREQUAL "h5md")
target_include_directories(h5md PUBLIC ${LAMMPS_LIB_SOURCE_DIR}/h5md/include ${HDF5_INCLUDE_DIRS})
else()
target_include_directories(${PKG_LIB} PUBLIC ${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB})
Expand All @@ -695,6 +699,23 @@ if(PKG_ELECTRODE OR PKG_ML-POD)
target_link_libraries(lammps PRIVATE ${LAPACK_LIBRARIES})
endif()

if(PKG_AWPMD)
target_link_libraries(awpmd PRIVATE ${LAPACK_LIBRARIES})
endif()

if(PKG_ATC)
if(LAMMPS_SIZES STREQUAL "BIGBIG")
message(FATAL_ERROR "The ATC Package is not compatible with -DLAMMPS_BIGBIG")
endif()
if(BUILD_MPI)
target_link_libraries(atc PRIVATE ${LAPACK_LIBRARIES} MPI::MPI_CXX)
else()
target_link_libraries(atc PRIVATE ${LAPACK_LIBRARIES} mpi_stubs)
endif()
target_include_directories(atc PRIVATE ${LAMMPS_SOURCE_DIR})
target_compile_definitions(atc PRIVATE -DLAMMPS_${LAMMPS_SIZES})
endif()

if(PKG_H5MD)
include(Packages/H5MD)
endif()
Expand Down
24 changes: 12 additions & 12 deletions cmake/Modules/LAMMPSInterfacePlugin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,26 @@ if(MSVC)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
endif()

# We *require* C++17 without extensions
# Kokkos also requires at least C++17 (currently)
if(NOT CMAKE_CXX_STANDARD)
# uncomment in case we plan to switch to C++20 as minimum standard
# if(cxx_std_20 IN_LIST CMAKE_CXX_COMPILE_FEATURES)
# set(CMAKE_CXX_STANDARD 20)
# else()
if(cxx_std_17 IN_LIST CMAKE_CXX_COMPILE_FEATURES)
set(CMAKE_CXX_STANDARD 17)
# endif()
else()
set(CMAKE_CXX_STANDARD 11)
endif()
endif()
if(CMAKE_CXX_STANDARD LESS 11)
message(FATAL_ERROR "C++ standard must be set to at least 11")
endif()
if(CMAKE_CXX_STANDARD LESS 17)
message(FATAL_ERROR "C++ standard must be set to at least 17")
message(WARNING "Selecting C++17 standard is preferred over C++${CMAKE_CXX_STANDARD}")
endif()
if(PKG_KOKKOS AND (CMAKE_CXX_STANDARD LESS 17))
set(CMAKE_CXX_STANDARD 17)
endif()
# turn off C++20 check in lmptype.h
#if(LAMMPS_CXX17)
# add_compile_definitions(LAMMPS_CXX17)
#endif()
# turn off C++17 check in lmptype.h
if(LAMMPS_CXX11)
add_compile_definitions(LAMMPS_CXX11)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Need -restrict with Intel compilers
Expand Down
2 changes: 0 additions & 2 deletions cmake/Modules/OpenCLUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ function(WriteOpenCLHeader varname outfile files)
separate_arguments(files)

foreach(filename ${files})
# In case ${filename} would have blanks, CMake will have replaced them with ';'. Revert:
string(REPLACE ";" " " filename "${filename}")
file(READ ${filename} content)
string(REGEX REPLACE "\\s*//[^\n]*\n" "\n" content "${content}")
string(REGEX REPLACE "\\\\" "\\\\\\\\" content "${content}")
Expand Down
10 changes: 5 additions & 5 deletions cmake/Modules/Packages/INTEL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ string(TOUPPER ${INTEL_ARCH} INTEL_ARCH)

find_package(Threads QUIET)
if(Threads_FOUND)
set(INTEL_LRT_MODE "threads" CACHE STRING "Long-range threads mode (none, threads, or c++17)")
set(INTEL_LRT_MODE "threads" CACHE STRING "Long-range threads mode (none, threads, or c++11)")
else()
set(INTEL_LRT_MODE "none" CACHE STRING "Long-range threads mode (none, threads, or c++17)")
set(INTEL_LRT_MODE "none" CACHE STRING "Long-range threads mode (none, threads, or c++11)")
endif()
set(INTEL_LRT_VALUES none threads c++17)
set(INTEL_LRT_VALUES none threads c++11)
set_property(CACHE INTEL_LRT_MODE PROPERTY STRINGS ${INTEL_LRT_VALUES})
validate_option(INTEL_LRT_MODE INTEL_LRT_VALUES)
string(TOUPPER ${INTEL_LRT_MODE} INTEL_LRT_MODE)
Expand All @@ -29,9 +29,9 @@ if(INTEL_LRT_MODE STREQUAL "THREADS")
message(FATAL_ERROR "Must have working threads library for Long-range thread support")
endif()
endif()
if(INTEL_LRT_MODE STREQUAL "C++17")
if(INTEL_LRT_MODE STREQUAL "C++11")
if(Threads_FOUND)
target_compile_definitions(lammps PRIVATE -DLMP_INTEL_USELRT -DLMP_INTEL_LRT17)
target_compile_definitions(lammps PRIVATE -DLMP_INTEL_USELRT -DLMP_INTEL_LRT11)
target_link_libraries(lammps PRIVATE Threads::Threads)
else()
message(FATAL_ERROR "Must have working threads library for Long-range thread support")
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/Packages/VORONOI.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if(DOWNLOAD_VORO)
ExternalProject_Add(voro_build
URL ${VORO_URL}
URL_MD5 ${VORO_MD5}
PATCH_COMMAND patch -b -p0 < ${LAMMPS_DIR}/cmake/patches/voro-make.patch
PATCH_COMMAND patch -b -p0 < ${LAMMPS_LIB_SOURCE_DIR}/voronoi/voro-make.patch
CONFIGURE_COMMAND ""
BUILD_COMMAND make ${VORO_BUILD_OPTIONS}
BUILD_IN_SOURCE 1
Expand Down
Loading