Merge branch 'master' into feature-pair-cossq

This commit is contained in:
Eugen Rožić 2019-08-07 19:19:16 +02:00
commit b084ad519d
2865 changed files with 165813 additions and 44090 deletions

21
.github/ISSUE_TEMPLATE/generic.md vendored Normal file
View File

@ -0,0 +1,21 @@
---
name: Generic Issue
about: For issues that do not fit any of the other categories
title: "_Replace With a Descriptive Title_"
labels:
assignees: ''
---
**Summary**
_Please provide a clear and concise description of what this issue report is about._
**LAMMPS Version and Platform**
_Please specify precisely which LAMMPS version this issue was detected with (the first line of the output) and what platform (operating system and its version, hardware) you are running on. If possible, test with the most recent LAMMPS patch version_
**Details**
_Please explain the issue in detail here_

15
.github/ISSUE_TEMPLATE/help_request.md vendored Normal file
View File

@ -0,0 +1,15 @@
---
name: Request for Help
about: "Don't post help requests here, email the lammps-users mailing list"
title: ""
labels: invalid
assignees: ''
---
Please **do not** post requests for help (e.g. with installing or using LAMMPS) here.
Instead send an e-mail to the lammps-users mailing list.
This issue tracker is for tracking LAMMPS development related issues only.
Thanks for your cooperation.

View File

@ -4,22 +4,19 @@ _Briefly describe the new feature(s), enhancement(s), or bugfix(es) included in
**Related Issues**
__If this addresses an open GitHub Issue, mention the issue number here. Use the phrases `fixes #221` or `closes #135`, when you want those issues to be automatically closed when the pull request is merged_
_If this addresses an open GitHub issue for this project, please mention the issue number here, and describe the relation. Use the phrases `fixes #221` or `closes #135`, when you want an issue to be automatically closed when the pull request is merged_
**Author(s)**
_Please state name and affiliation of the author or authors that should be credited with the changes in this pull request. If this pull request adds new files to the distribution, please also provide a suitable "long-lived" e-mail address (e.g. from gmail, yahoo, outlook, etc.) for the *corresponding* author, i.e. the person the LAMMPS developers can contact directly with questions and requests related to maintenance and support of this code. now and in the future_
_Please state name and affiliation of the author or authors that should be credited with the changes in this pull request. If this pull request adds new files to the distribution, please also provide a suitable "long-lived" e-mail address (ideally something that can outlive your institution's e-mail, in case you change jobs) for the *corresponding* author, i.e. the person the LAMMPS developers can contact directly with questions and requests related to maintenance and support of this contributed code._
**Licensing**
By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under the GNU General Public License version 2.
_Please complete the following statement by adding "yes" or "no":_
My contribution may be re-licensed as LGPL (for use of LAMMPS as a library linked to proprietary software):
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).
**Backward Compatibility**
_Please state whether any changes in the pull request break backward compatibility for inputs, and - if yes - explain what has been changed and why_
_Please state whether any changes in the pull request will break backward compatibility for inputs, and - if yes - explain what has been changed and why_
**Implementation Notes**
@ -27,7 +24,7 @@ _Provide any relevant details about how the changes are implemented, how correct
**Post Submission Checklist**
_Please check the fields below as they are completed **after** the pull request has been submitted_
_Please check the fields below as they are completed **after** the pull request has been submitted. Delete lines that don't apply_
- [ ] The feature or features in this pull request is complete
- [ ] Licensing information is complete

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,28 @@
###############################################################################
# Coverage
#
# Requires latest gcovr (for GCC 8.1 support):#
# pip install git+https://github.com/gcovr/gcovr.git
###############################################################################
if(ENABLE_COVERAGE)
find_program(GCOVR_BINARY gcovr)
find_package_handle_standard_args(GCOVR DEFAULT_MSG GCOVR_BINARY)
if(GCOVR_FOUND)
get_filename_component(ABSOLUTE_LAMMPS_SOURCE_DIR ${LAMMPS_SOURCE_DIR} ABSOLUTE)
add_custom_target(
gen_coverage_xml
COMMAND ${GCOVR_BINARY} -s -x -r ${ABSOLUTE_LAMMPS_SOURCE_DIR} --object-directory=${CMAKE_BINARY_DIR} -o coverage.xml
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Generating XML Coverage Report..."
)
add_custom_target(
gen_coverage_html
COMMAND ${GCOVR_BINARY} -s --html --html-details -r ${ABSOLUTE_LAMMPS_SOURCE_DIR} --object-directory=${CMAKE_BINARY_DIR} -o coverage.html
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Generating HTML Coverage Report..."
)
endif()
endif()

View File

@ -0,0 +1,59 @@
###############################################################################
# Build documentation
###############################################################################
option(BUILD_DOC "Build LAMMPS documentation" OFF)
if(BUILD_DOC)
include(ProcessorCount)
ProcessorCount(NPROCS)
find_package(PythonInterp 3 REQUIRED)
set(VIRTUALENV ${PYTHON_EXECUTABLE} -m virtualenv)
file(GLOB DOC_SOURCES ${LAMMPS_DOC_DIR}/src/[^.]*.txt)
file(GLOB PDF_EXTRA_SOURCES ${LAMMPS_DOC_DIR}/src/lammps_commands*.txt ${LAMMPS_DOC_DIR}/src/lammps_support.txt ${LAMMPS_DOC_DIR}/src/lammps_tutorials.txt)
list(REMOVE_ITEM DOC_SOURCES ${PDF_EXTRA_SOURCES})
add_custom_command(
OUTPUT docenv
COMMAND ${VIRTUALENV} docenv
)
set(DOCENV_BINARY_DIR ${CMAKE_BINARY_DIR}/docenv/bin)
add_custom_command(
OUTPUT requirements.txt
DEPENDS docenv
COMMAND ${CMAKE_COMMAND} -E copy ${LAMMPS_DOC_DIR}/utils/requirements.txt requirements.txt
COMMAND ${DOCENV_BINARY_DIR}/pip install -r requirements.txt --upgrade
COMMAND ${DOCENV_BINARY_DIR}/pip install --upgrade ${LAMMPS_DOC_DIR}/utils/converters
)
set(RST_FILES "")
set(RST_DIR ${CMAKE_BINARY_DIR}/rst)
file(MAKE_DIRECTORY ${RST_DIR})
foreach(TXT_FILE ${DOC_SOURCES})
get_filename_component(FILENAME ${TXT_FILE} NAME_WE)
set(RST_FILE ${RST_DIR}/${FILENAME}.rst)
list(APPEND RST_FILES ${RST_FILE})
add_custom_command(
OUTPUT ${RST_FILE}
DEPENDS requirements.txt docenv ${TXT_FILE}
COMMAND ${DOCENV_BINARY_DIR}/txt2rst -o ${RST_DIR} ${TXT_FILE}
)
endforeach()
add_custom_command(
OUTPUT html
DEPENDS ${RST_FILES}
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LAMMPS_DOC_DIR}/src ${RST_DIR}
COMMAND ${DOCENV_BINARY_DIR}/sphinx-build -j ${NPROCS} -b html -c ${LAMMPS_DOC_DIR}/utils/sphinx-config -d ${CMAKE_BINARY_DIR}/doctrees ${RST_DIR} html
)
add_custom_target(
doc ALL
DEPENDS html
SOURCES ${LAMMPS_DOC_DIR}/utils/requirements.txt ${DOC_SOURCES}
)
install(DIRECTORY ${CMAKE_BINARY_DIR}/html DESTINATION ${CMAKE_INSTALL_DOCDIR})
endif()

View File

@ -0,0 +1,59 @@
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the Common Development
# and Distribution License Version 1.0 (the "License").
#
# You can obtain a copy of the license at
# http://www.opensource.org/licenses/CDDL-1.0. See the License for the
# specific language governing permissions and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each file and
# include the License file in a prominent location with the name LICENSE.CDDL.
# If applicable, add the following below this CDDL HEADER, with the fields
# enclosed by brackets "[]" replaced with your own identifying information:
#
# Portions Copyright (c) [yyyy] [name of copyright owner]. All rights reserved.
#
# CDDL HEADER END
#
#
# Copyright (c) 2013--2019, Regents of the University of Minnesota.
# All rights reserved.
#
# Contributors:
# Richard Berger
# Christoph Junghans
# Ryan S. Elliott
#
# - Find KIM-API
#
# sets standard pkg_check_modules variables plus:
#
# KIM-API-CMAKE_C_COMPILER
# KIM-API-CMAKE_CXX_COMPILER
# KIM-API-CMAKE_Fortran_COMPILER
#
if(KIM-API_FIND_QUIETLY)
set(REQ_OR_QUI "QUIET")
else()
set(REQ_OR_QUI "REQUIRED")
endif()
find_package(PkgConfig ${REQ_OR_QUI})
include(FindPackageHandleStandardArgs)
pkg_check_modules(KIM-API ${REQ_OR_QUI} libkim-api>=2.0)
if(KIM-API_FOUND)
pkg_get_variable(KIM-API-CMAKE_C_COMPILER libkim-api CMAKE_C_COMPILER)
pkg_get_variable(KIM-API-CMAKE_CXX_COMPILER libkim-api CMAKE_CXX_COMPILER)
pkg_get_variable(KIM-API_CMAKE_Fortran_COMPILER libkim-api CMAKE_Fortran_COMPILER)
endif()
# handle the QUIETLY and REQUIRED arguments and set KIM-API_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(KIM-API REQUIRED_VARS KIM-API_LIBRARIES)

View File

@ -1,22 +0,0 @@
# - Find kim
# Find the native KIM headers and libraries.
#
# KIM_INCLUDE_DIRS - where to find kim.h, etc.
# KIM_LIBRARIES - List of libraries when using kim.
# KIM_FOUND - True if kim found.
#
find_path(KIM_INCLUDE_DIR KIM_API.h PATH_SUFFIXES kim-api-v1)
find_library(KIM_LIBRARY NAMES kim-api-v1)
set(KIM_LIBRARIES ${KIM_LIBRARY})
set(KIM_INCLUDE_DIRS ${KIM_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set KIM_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(KIM DEFAULT_MSG KIM_LIBRARY KIM_INCLUDE_DIR)
mark_as_advanced(KIM_INCLUDE_DIR KIM_LIBRARY )

View File

@ -0,0 +1,71 @@
# Utility functions
function(list_to_bulletpoints result)
list(REMOVE_AT ARGV 0)
set(temp "")
foreach(item ${ARGV})
set(temp "${temp}* ${item}\n")
endforeach()
set(${result} "${temp}" PARENT_SCOPE)
endfunction(list_to_bulletpoints)
function(validate_option name values)
string(TOLOWER ${${name}} needle_lower)
string(TOUPPER ${${name}} needle_upper)
list(FIND ${values} ${needle_lower} IDX_LOWER)
list(FIND ${values} ${needle_upper} IDX_UPPER)
if(${IDX_LOWER} LESS 0 AND ${IDX_UPPER} LESS 0)
list_to_bulletpoints(POSSIBLE_VALUE_LIST ${${values}})
message(FATAL_ERROR "\n########################################################################\n"
"Invalid value '${${name}}' for option ${name}\n"
"\n"
"Possible values are:\n"
"${POSSIBLE_VALUE_LIST}"
"########################################################################")
endif()
endfunction(validate_option)
function(get_lammps_version version_header variable)
file(READ ${version_header} line)
set(MONTHS x Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec)
string(REGEX REPLACE "#define LAMMPS_VERSION \"([0-9]+) ([A-Za-z]+) ([0-9]+)\"" "\\1" day "${line}")
string(REGEX REPLACE "#define LAMMPS_VERSION \"([0-9]+) ([A-Za-z]+) ([0-9]+)\"" "\\2" month "${line}")
string(REGEX REPLACE "#define LAMMPS_VERSION \"([0-9]+) ([A-Za-z]+) ([0-9]+)\"" "\\3" year "${line}")
string(STRIP ${day} day)
string(STRIP ${month} month)
string(STRIP ${year} year)
list(FIND MONTHS "${month}" month)
string(LENGTH ${day} day_length)
string(LENGTH ${month} month_length)
if(day_length EQUAL 1)
set(day "0${day}")
endif()
if(month_length EQUAL 1)
set(month "0${month}")
endif()
set(${variable} "${year}${month}${day}" PARENT_SCOPE)
endfunction()
function(check_for_autogen_files source_dir)
message(STATUS "Running check for auto-generated files from make-based build system")
file(GLOB SRC_AUTOGEN_FILES ${source_dir}/style_*.h)
file(GLOB SRC_AUTOGEN_PACKAGES ${source_dir}/packages_*.h)
list(APPEND SRC_AUTOGEN_FILES ${SRC_AUTOGEN_PACKAGES} ${source_dir}/lmpinstalledpkgs.h ${source_dir}/lmpgitversion.h)
foreach(_SRC ${SRC_AUTOGEN_FILES})
get_filename_component(FILENAME "${_SRC}" NAME)
if(EXISTS ${source_dir}/${FILENAME})
message(FATAL_ERROR "\n########################################################################\n"
"Found header file(s) generated by the make-based build system\n"
"\n"
"Please run\n"
"make -C ${source_dir} purge\n"
"to remove\n"
"########################################################################")
endif()
endforeach()
endfunction()
macro(pkg_depends PKG1 PKG2)
if(PKG_${PKG1} AND NOT (PKG_${PKG2} OR BUILD_${PKG2}))
message(FATAL_ERROR "${PKG1} package needs LAMMPS to be build with ${PKG2}")
endif()
endmacro()

View File

@ -6,7 +6,7 @@ function(GenerateOpenCLHeader varname outfile files)
foreach(IDX RANGE 2 ${ARG_END})
list(GET ARGV ${IDX} filename)
file(READ ${filename} content)
string(REGEX REPLACE "\\s*//[^\n]*\n" "" content "${content}")
string(REGEX REPLACE "\\s*//[^\n]*\n" "\n" content "${content}")
string(REGEX REPLACE "\\\\" "\\\\\\\\" content "${content}")
string(REGEX REPLACE "\"" "\\\\\"" content "${content}")
string(REGEX REPLACE "([^\n]+)\n" "\"\\1\\\\n\"\n" content "${content}")

View File

@ -0,0 +1,5 @@
if(PKG_COMPRESS)
find_package(ZLIB REQUIRED)
include_directories(${ZLIB_INCLUDE_DIRS})
list(APPEND LAMMPS_LINK_LIBS ${ZLIB_LIBRARIES})
endif()

View File

@ -0,0 +1,13 @@
if(PKG_CORESHELL)
set(CORESHELL_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/CORESHELL)
set(CORESHELL_SOURCES)
set_property(GLOBAL PROPERTY "CORESHELL_SOURCES" "${CORESHELL_SOURCES}")
# detects styles which have a CORESHELL version
RegisterStylesExt(${CORESHELL_SOURCES_DIR} cs CORESHELL_SOURCES)
get_property(CORESHELL_SOURCES GLOBAL PROPERTY CORESHELL_SOURCES)
list(APPEND LIB_SOURCES ${CORESHELL_SOURCES})
include_directories(${CORESHELL_SOURCES_DIR})
endif()

View File

@ -0,0 +1,194 @@
if(PKG_GPU)
if (CMAKE_VERSION VERSION_LESS "3.1")
message(FATAL_ERROR "For the GPU package you need at least cmake-3.1")
endif()
set(GPU_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/GPU)
set(GPU_SOURCES ${GPU_SOURCES_DIR}/gpu_extra.h
${GPU_SOURCES_DIR}/fix_gpu.h
${GPU_SOURCES_DIR}/fix_gpu.cpp)
set(GPU_API "opencl" CACHE STRING "API used by GPU package")
set(GPU_API_VALUES opencl cuda)
set_property(CACHE GPU_API PROPERTY STRINGS ${GPU_API_VALUES})
validate_option(GPU_API GPU_API_VALUES)
string(TOUPPER ${GPU_API} GPU_API)
set(GPU_PREC "mixed" CACHE STRING "LAMMPS GPU precision")
set(GPU_PREC_VALUES double mixed single)
set_property(CACHE GPU_PREC PROPERTY STRINGS ${GPU_PREC_VALUES})
validate_option(GPU_PREC GPU_PREC_VALUES)
string(TOUPPER ${GPU_PREC} GPU_PREC)
if(GPU_PREC STREQUAL "DOUBLE")
set(GPU_PREC_SETTING "DOUBLE_DOUBLE")
elseif(GPU_PREC STREQUAL "MIXED")
set(GPU_PREC_SETTING "SINGLE_DOUBLE")
elseif(GPU_PREC STREQUAL "SINGLE")
set(GPU_PREC_SETTING "SINGLE_SINGLE")
endif()
file(GLOB GPU_LIB_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cpp)
file(MAKE_DIRECTORY ${LAMMPS_LIB_BINARY_DIR}/gpu)
if(GPU_API STREQUAL "CUDA")
find_package(CUDA REQUIRED)
find_program(BIN2C bin2c)
if(NOT BIN2C)
message(FATAL_ERROR "Could not find bin2c, use -DBIN2C=/path/to/bin2c to help cmake finding it.")
endif()
option(CUDPP_OPT "Enable CUDPP_OPT" ON)
option(CUDA_MPS_SUPPORT "Enable tweaks to support CUDA Multi-process service (MPS)" OFF)
if(CUDA_MPS_SUPPORT)
set(GPU_CUDA_MPS_FLAGS "-DCUDA_PROXY")
endif()
set(GPU_ARCH "sm_30" CACHE STRING "LAMMPS GPU CUDA SM primary architecture (e.g. sm_60)")
file(GLOB GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cu ${CMAKE_CURRENT_SOURCE_DIR}/gpu/[^.]*.cu)
list(REMOVE_ITEM GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_pppm.cu)
cuda_include_directories(${LAMMPS_LIB_SOURCE_DIR}/gpu ${LAMMPS_LIB_BINARY_DIR}/gpu)
if(CUDPP_OPT)
cuda_include_directories(${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini)
file(GLOB GPU_LIB_CUDPP_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini/[^.]*.cpp)
file(GLOB GPU_LIB_CUDPP_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini/[^.]*.cu)
endif()
# build arch/gencode commands for nvcc based on CUDA toolkit version and use choice
# --arch translates directly instead of JIT, so this should be for the preferred or most common architecture
set(GPU_CUDA_GENCODE "-arch=${GPU_ARCH} ")
# Fermi (GPU Arch 2.x) is supported by CUDA 3.2 to CUDA 8.0
if((CUDA_VERSION VERSION_GREATER "3.1") AND (CUDA_VERSION VERSION_LESS "9.0"))
string(APPEND GPU_CUDA_GENCODE "-gencode arch=compute_20,code=[sm_20,compute_20] ")
endif()
# Kepler (GPU Arch 3.x) is supported by CUDA 5 and later
if(CUDA_VERSION VERSION_GREATER "4.9")
string(APPEND GPU_CUDA_GENCODE "-gencode arch=compute_30,code=[sm_30,compute_30] -gencode arch=compute_35,code=[sm_35,compute_35] ")
endif()
# Maxwell (GPU Arch 5.x) is supported by CUDA 6 and later
if(CUDA_VERSION VERSION_GREATER "5.9")
string(APPEND GPU_CUDA_GENCODE "-gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52] ")
endif()
# Pascal (GPU Arch 6.x) is supported by CUDA 8 and later
if(CUDA_VERSION VERSION_GREATER "7.9")
string(APPEND GPU_CUDA_GENCODE "-gencode arch=compute_60,code=[sm_60,compute_60] -gencode arch=compute_61,code=[sm_61,compute_61] ")
endif()
# Volta (GPU Arch 7.0) is supported by CUDA 9 and later
if(CUDA_VERSION VERSION_GREATER "8.9")
string(APPEND GPU_CUDA_GENCODE "-gencode arch=compute_70,code=[sm_70,compute_70] ")
endif()
# Turing (GPU Arch 7.5) is supported by CUDA 10 and later
if(CUDA_VERSION VERSION_GREATER "9.9")
string(APPEND GPU_CUDA_GENCODE "-gencode arch=compute_75,code=[sm_75,compute_75] ")
endif()
cuda_compile_fatbin(GPU_GEN_OBJS ${GPU_LIB_CU} OPTIONS
-DUNIX -O3 --use_fast_math -Wno-deprecated-gpu-targets -DNV_KERNEL -DUCL_CUDADR ${GPU_CUDA_GENCODE} -D_${GPU_PREC_SETTING})
cuda_compile(GPU_OBJS ${GPU_LIB_CUDPP_CU} OPTIONS ${CUDA_REQUEST_PIC}
-DUNIX -O3 --use_fast_math -Wno-deprecated-gpu-targets -DUCL_CUDADR ${GPU_CUDA_GENCODE} -D_${GPU_PREC_SETTING})
foreach(CU_OBJ ${GPU_GEN_OBJS})
get_filename_component(CU_NAME ${CU_OBJ} NAME_WE)
string(REGEX REPLACE "^.*_lal_" "" CU_NAME "${CU_NAME}")
add_custom_command(OUTPUT ${LAMMPS_LIB_BINARY_DIR}/gpu/${CU_NAME}_cubin.h
COMMAND ${BIN2C} -c -n ${CU_NAME} ${CU_OBJ} > ${LAMMPS_LIB_BINARY_DIR}/gpu/${CU_NAME}_cubin.h
DEPENDS ${CU_OBJ}
COMMENT "Generating ${CU_NAME}_cubin.h")
list(APPEND GPU_LIB_SOURCES ${LAMMPS_LIB_BINARY_DIR}/gpu/${CU_NAME}_cubin.h)
endforeach()
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${LAMMPS_LIB_BINARY_DIR}/gpu/*_cubin.h")
add_library(gpu STATIC ${GPU_LIB_SOURCES} ${GPU_LIB_CUDPP_SOURCES} ${GPU_OBJS})
target_link_libraries(gpu ${CUDA_LIBRARIES} ${CUDA_CUDA_LIBRARY})
target_include_directories(gpu PRIVATE ${LAMMPS_LIB_BINARY_DIR}/gpu ${CUDA_INCLUDE_DIRS})
target_compile_definitions(gpu PRIVATE -D_${GPU_PREC_SETTING} -DMPI_GERYON -DUCL_NO_EXIT ${GPU_CUDA_MPS_FLAGS})
if(CUDPP_OPT)
target_include_directories(gpu PRIVATE ${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini)
target_compile_definitions(gpu PRIVATE -DUSE_CUDPP)
endif()
list(APPEND LAMMPS_LINK_LIBS gpu)
add_executable(nvc_get_devices ${LAMMPS_LIB_SOURCE_DIR}/gpu/geryon/ucl_get_devices.cpp)
target_compile_definitions(nvc_get_devices PRIVATE -DUCL_CUDADR)
target_link_libraries(nvc_get_devices PRIVATE ${CUDA_LIBRARIES} ${CUDA_CUDA_LIBRARY})
target_include_directories(nvc_get_devices PRIVATE ${CUDA_INCLUDE_DIRS})
elseif(GPU_API STREQUAL "OPENCL")
find_package(OpenCL REQUIRED)
set(OCL_TUNE "generic" CACHE STRING "OpenCL Device Tuning")
set(OCL_TUNE_VALUES intel fermi kepler cypress generic)
set_property(CACHE OCL_TUNE PROPERTY STRINGS ${OCL_TUNE_VALUES})
validate_option(OCL_TUNE OCL_TUNE_VALUES)
string(TOUPPER ${OCL_TUNE} OCL_TUNE)
include(OpenCLUtils)
set(OCL_COMMON_HEADERS ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_preprocessor.h ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_aux_fun1.h)
file(GLOB GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/[^.]*.cu)
list(REMOVE_ITEM GPU_LIB_CU
${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_gayberne.cu
${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_gayberne_lj.cu
${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_re_squared.cu
${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_re_squared_lj.cu
${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_tersoff.cu
${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_tersoff_zbl.cu
${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_tersoff_mod.cu
)
foreach(GPU_KERNEL ${GPU_LIB_CU})
get_filename_component(basename ${GPU_KERNEL} NAME_WE)
string(SUBSTRING ${basename} 4 -1 KERNEL_NAME)
GenerateOpenCLHeader(${KERNEL_NAME} ${CMAKE_CURRENT_BINARY_DIR}/gpu/${KERNEL_NAME}_cl.h ${OCL_COMMON_HEADERS} ${GPU_KERNEL})
list(APPEND GPU_LIB_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/gpu/${KERNEL_NAME}_cl.h)
endforeach()
GenerateOpenCLHeader(gayberne ${CMAKE_CURRENT_BINARY_DIR}/gpu/gayberne_cl.h ${OCL_COMMON_HEADERS} ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_ellipsoid_extra.h ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_gayberne.cu)
GenerateOpenCLHeader(gayberne_lj ${CMAKE_CURRENT_BINARY_DIR}/gpu/gayberne_lj_cl.h ${OCL_COMMON_HEADERS} ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_ellipsoid_extra.h ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_gayberne_lj.cu)
GenerateOpenCLHeader(re_squared ${CMAKE_CURRENT_BINARY_DIR}/gpu/re_squared_cl.h ${OCL_COMMON_HEADERS} ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_ellipsoid_extra.h ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_re_squared.cu)
GenerateOpenCLHeader(re_squared_lj ${CMAKE_CURRENT_BINARY_DIR}/gpu/re_squared_lj_cl.h ${OCL_COMMON_HEADERS} ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_ellipsoid_extra.h ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_re_squared_lj.cu)
GenerateOpenCLHeader(tersoff ${CMAKE_CURRENT_BINARY_DIR}/gpu/tersoff_cl.h ${OCL_COMMON_HEADERS} ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_tersoff_extra.h ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_tersoff.cu)
GenerateOpenCLHeader(tersoff_zbl ${CMAKE_CURRENT_BINARY_DIR}/gpu/tersoff_zbl_cl.h ${OCL_COMMON_HEADERS} ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_tersoff_zbl_extra.h ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_tersoff_zbl.cu)
GenerateOpenCLHeader(tersoff_mod ${CMAKE_CURRENT_BINARY_DIR}/gpu/tersoff_mod_cl.h ${OCL_COMMON_HEADERS} ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_tersoff_mod_extra.h ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_tersoff_mod.cu)
list(APPEND GPU_LIB_SOURCES
${CMAKE_CURRENT_BINARY_DIR}/gpu/gayberne_cl.h
${CMAKE_CURRENT_BINARY_DIR}/gpu/gayberne_lj_cl.h
${CMAKE_CURRENT_BINARY_DIR}/gpu/re_squared_cl.h
${CMAKE_CURRENT_BINARY_DIR}/gpu/re_squared_lj_cl.h
${CMAKE_CURRENT_BINARY_DIR}/gpu/tersoff_cl.h
${CMAKE_CURRENT_BINARY_DIR}/gpu/tersoff_zbl_cl.h
${CMAKE_CURRENT_BINARY_DIR}/gpu/tersoff_mod_cl.h
)
add_library(gpu STATIC ${GPU_LIB_SOURCES})
target_link_libraries(gpu ${OpenCL_LIBRARIES})
target_include_directories(gpu PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/gpu ${OpenCL_INCLUDE_DIRS})
target_compile_definitions(gpu PRIVATE -D_${GPU_PREC_SETTING} -D${OCL_TUNE}_OCL -DMPI_GERYON -DUCL_NO_EXIT)
target_compile_definitions(gpu PRIVATE -DUSE_OPENCL)
list(APPEND LAMMPS_LINK_LIBS gpu)
add_executable(ocl_get_devices ${LAMMPS_LIB_SOURCE_DIR}/gpu/geryon/ucl_get_devices.cpp)
target_compile_definitions(ocl_get_devices PRIVATE -DUCL_OPENCL)
target_link_libraries(ocl_get_devices PRIVATE ${OpenCL_LIBRARIES})
target_include_directories(ocl_get_devices PRIVATE ${OpenCL_INCLUDE_DIRS})
endif()
# GPU package
FindStyleHeaders(${GPU_SOURCES_DIR} FIX_CLASS fix_ FIX)
set_property(GLOBAL PROPERTY "GPU_SOURCES" "${GPU_SOURCES}")
# detects styles which have GPU version
RegisterStylesExt(${GPU_SOURCES_DIR} gpu GPU_SOURCES)
get_property(GPU_SOURCES GLOBAL PROPERTY GPU_SOURCES)
list(APPEND LIB_SOURCES ${GPU_SOURCES})
include_directories(${GPU_SOURCES_DIR})
endif()

View File

@ -0,0 +1,49 @@
if(PKG_KIM)
find_package(CURL)
if(CURL_FOUND)
include_directories(${CURL_INCLUDE_DIRS})
list(APPEND LAMMPS_LINK_LIBS ${CURL_LIBRARIES})
add_definitions(-DLMP_KIM_CURL)
endif()
find_package(KIM-API QUIET)
if(KIM-API_FOUND)
set(DOWNLOAD_KIM_DEFAULT OFF)
else()
if (NOT DOWNLOAD_KIM)
message(WARNING "KIM-API package not found. We will download and build our own")
endif()
set(DOWNLOAD_KIM_DEFAULT ON)
endif()
option(DOWNLOAD_KIM "Download KIM-API from OpenKIM instead of using an already installed one" ${DOWNLOAD_KIM_DEFAULT})
if(DOWNLOAD_KIM)
if(CMAKE_GENERATOR STREQUAL "Ninja")
message(FATAL_ERROR "Cannot build downloaded KIM-API library with Ninja build tool")
endif()
message(STATUS "KIM-API download requested - we will build our own")
include(CheckLanguage)
include(ExternalProject)
enable_language(C)
check_language(Fortran)
if(NOT CMAKE_Fortran_COMPILER)
message(FATAL_ERROR "Compiling the KIM-API library requires a Fortran compiler")
endif()
ExternalProject_Add(kim_build
URL https://s3.openkim.org/kim-api/kim-api-2.1.2.txz
URL_MD5 6ac52e14ef52967fc7858220b208cba5
BINARY_DIR build
CMAKE_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER}
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
)
ExternalProject_get_property(kim_build INSTALL_DIR)
set(KIM-API_INCLUDE_DIRS ${INSTALL_DIR}/include/kim-api)
set(KIM-API_LDFLAGS ${INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libkim-api${CMAKE_SHARED_LIBRARY_SUFFIX})
list(APPEND LAMMPS_DEPS kim_build)
else()
find_package(KIM-API REQUIRED)
endif()
list(APPEND LAMMPS_LINK_LIBS "${KIM-API_LDFLAGS}")
include_directories(${KIM-API_INCLUDE_DIRS})
endif()

View File

@ -0,0 +1,53 @@
if(PKG_KOKKOS)
set(LAMMPS_LIB_KOKKOS_SRC_DIR ${LAMMPS_LIB_SOURCE_DIR}/kokkos)
set(LAMMPS_LIB_KOKKOS_BIN_DIR ${LAMMPS_LIB_BINARY_DIR}/kokkos)
add_definitions(-DLMP_KOKKOS)
add_subdirectory(${LAMMPS_LIB_KOKKOS_SRC_DIR} ${LAMMPS_LIB_KOKKOS_BIN_DIR})
set(Kokkos_INCLUDE_DIRS ${LAMMPS_LIB_KOKKOS_SRC_DIR}/core/src
${LAMMPS_LIB_KOKKOS_SRC_DIR}/containers/src
${LAMMPS_LIB_KOKKOS_SRC_DIR}/algorithms/src
${LAMMPS_LIB_KOKKOS_BIN_DIR})
include_directories(${Kokkos_INCLUDE_DIRS})
list(APPEND LAMMPS_LINK_LIBS kokkos)
set(KOKKOS_PKG_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/KOKKOS)
set(KOKKOS_PKG_SOURCES ${KOKKOS_PKG_SOURCES_DIR}/kokkos.cpp
${KOKKOS_PKG_SOURCES_DIR}/atom_kokkos.cpp
${KOKKOS_PKG_SOURCES_DIR}/atom_vec_kokkos.cpp
${KOKKOS_PKG_SOURCES_DIR}/comm_kokkos.cpp
${KOKKOS_PKG_SOURCES_DIR}/comm_tiled_kokkos.cpp
${KOKKOS_PKG_SOURCES_DIR}/neighbor_kokkos.cpp
${KOKKOS_PKG_SOURCES_DIR}/neigh_list_kokkos.cpp
${KOKKOS_PKG_SOURCES_DIR}/neigh_bond_kokkos.cpp
${KOKKOS_PKG_SOURCES_DIR}/fix_nh_kokkos.cpp
${KOKKOS_PKG_SOURCES_DIR}/nbin_kokkos.cpp
${KOKKOS_PKG_SOURCES_DIR}/npair_kokkos.cpp
${KOKKOS_PKG_SOURCES_DIR}/domain_kokkos.cpp
${KOKKOS_PKG_SOURCES_DIR}/modify_kokkos.cpp)
if(PKG_KSPACE)
list(APPEND KOKKOS_PKG_SOURCES ${KOKKOS_PKG_SOURCES_DIR}/gridcomm_kokkos.cpp)
endif()
set_property(GLOBAL PROPERTY "KOKKOS_PKG_SOURCES" "${KOKKOS_PKG_SOURCES}")
# detects styles which have KOKKOS version
RegisterStylesExt(${KOKKOS_PKG_SOURCES_DIR} kokkos KOKKOS_PKG_SOURCES)
# register kokkos-only styles
RegisterNBinStyle(${KOKKOS_PKG_SOURCES_DIR}/nbin_kokkos.h)
RegisterNPairStyle(${KOKKOS_PKG_SOURCES_DIR}/npair_kokkos.h)
if(PKG_USER-DPD)
get_property(KOKKOS_PKG_SOURCES GLOBAL PROPERTY KOKKOS_PKG_SOURCES)
list(APPEND KOKKOS_PKG_SOURCES ${KOKKOS_PKG_SOURCES_DIR}/npair_ssa_kokkos.cpp)
RegisterNPairStyle(${KOKKOS_PKG_SOURCES_DIR}/npair_ssa_kokkos.h)
set_property(GLOBAL PROPERTY "KOKKOS_PKG_SOURCES" "${KOKKOS_PKG_SOURCES}")
endif()
get_property(KOKKOS_PKG_SOURCES GLOBAL PROPERTY KOKKOS_PKG_SOURCES)
list(APPEND LIB_SOURCES ${KOKKOS_PKG_SOURCES})
include_directories(${KOKKOS_PKG_SOURCES_DIR})
endif()

View File

@ -0,0 +1,42 @@
if(PKG_KSPACE)
option(FFT_SINGLE "Use single precision FFTs instead of double precision FFTs" OFF)
set(FFTW "FFTW3")
if(FFT_SINGLE)
set(FFTW "FFTW3F")
add_definitions(-DFFT_SINGLE)
endif()
find_package(${FFTW} QUIET)
if(${FFTW}_FOUND)
set(FFT "FFTW3" CACHE STRING "FFT library for KSPACE package")
else()
set(FFT "KISS" CACHE STRING "FFT library for KSPACE package")
endif()
set(FFT_VALUES KISS FFTW3 MKL)
set_property(CACHE FFT PROPERTY STRINGS ${FFT_VALUES})
validate_option(FFT FFT_VALUES)
string(TOUPPER ${FFT} FFT)
if(FFT STREQUAL "FFTW3")
find_package(${FFTW} REQUIRED)
add_definitions(-DFFT_FFTW3)
include_directories(${${FFTW}_INCLUDE_DIRS})
list(APPEND LAMMPS_LINK_LIBS ${${FFTW}_LIBRARIES})
elseif(FFT STREQUAL "MKL")
find_package(MKL REQUIRED)
add_definitions(-DFFT_MKL)
include_directories(${MKL_INCLUDE_DIRS})
list(APPEND LAMMPS_LINK_LIBS ${MKL_LIBRARIES})
else()
# last option is KISSFFT
add_definitions(-DFFT_KISS)
endif()
set(FFT_PACK "array" CACHE STRING "Optimization for FFT")
set(FFT_PACK_VALUES array pointer memcpy)
set_property(CACHE FFT_PACK PROPERTY STRINGS ${FFT_PACK_VALUES})
validate_option(FFT_PACK FFT_PACK_VALUES)
if(NOT FFT_PACK STREQUAL "array")
string(TOUPPER ${FFT_PACK} FFT_PACK)
add_definitions(-DFFT_PACK_${FFT_PACK})
endif()
endif()

View File

@ -0,0 +1,38 @@
if(PKG_LATTE)
enable_language(Fortran)
find_package(LATTE)
if(LATTE_FOUND)
set(DOWNLOAD_LATTE_DEFAULT OFF)
else()
set(DOWNLOAD_LATTE_DEFAULT ON)
endif()
option(DOWNLOAD_LATTE "Download the LATTE library instead of using an already installed one" ${DOWNLOAD_LATTE_DEFAULT})
if(DOWNLOAD_LATTE)
if (CMAKE_VERSION VERSION_LESS "3.7") # due to SOURCE_SUBDIR
message(FATAL_ERROR "For downlading LATTE you need at least cmake-3.7")
endif()
if(CMAKE_GENERATOR STREQUAL "Ninja")
message(FATAL_ERROR "Cannot build downloaded LATTE library with Ninja build tool")
endif()
message(STATUS "LATTE download requested - we will build our own")
include(ExternalProject)
ExternalProject_Add(latte_build
URL https://github.com/lanl/LATTE/archive/v1.2.1.tar.gz
URL_MD5 85ac414fdada2d04619c8f936344df14
SOURCE_SUBDIR cmake
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> ${CMAKE_REQUEST_PIC}
-DBLAS_LIBRARIES=${BLAS_LIBRARIES} -DLAPACK_LIBRARIES=${LAPACK_LIBRARIES}
-DCMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER} -DCMAKE_Fortran_FLAGS=${CMAKE_Fortran_FLAGS}
-DCMAKE_Fortran_FLAGS_${BTYPE}=${CMAKE_Fortran_FLAGS_${BTYPE}} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
)
ExternalProject_get_property(latte_build INSTALL_DIR)
set(LATTE_LIBRARIES ${INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/liblatte.a)
list(APPEND LAMMPS_DEPS latte_build)
else()
find_package(LATTE)
if(NOT LATTE_FOUND)
message(FATAL_ERROR "LATTE library not found, help CMake to find it by setting LATTE_LIBRARY, or set DOWNLOAD_LATTE=ON to download it")
endif()
endif()
list(APPEND LAMMPS_LINK_LIBS ${LATTE_LIBRARIES} ${LAPACK_LIBRARIES})
endif()

View File

@ -0,0 +1,29 @@
if(PKG_MESSAGE)
option(MESSAGE_ZMQ "Use ZeroMQ in MESSAGE package" OFF)
file(GLOB_RECURSE cslib_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.F
${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.c
${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.cpp)
add_library(cslib STATIC ${cslib_SOURCES})
if(BUILD_MPI)
target_compile_definitions(cslib PRIVATE -DMPI_YES)
set_target_properties(cslib PROPERTIES OUTPUT_NAME "csmpi")
else()
target_compile_definitions(cslib PRIVATE -DMPI_NO)
target_include_directories(cslib PRIVATE ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/src/STUBS_MPI)
set_target_properties(cslib PROPERTIES OUTPUT_NAME "csnompi")
endif()
if(MESSAGE_ZMQ)
target_compile_definitions(cslib PRIVATE -DZMQ_YES)
find_package(ZMQ REQUIRED)
target_include_directories(cslib PRIVATE ${ZMQ_INCLUDE_DIRS})
target_link_libraries(cslib PUBLIC ${ZMQ_LIBRARIES})
else()
target_compile_definitions(cslib PRIVATE -DZMQ_NO)
target_include_directories(cslib PRIVATE ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/src/STUBS_ZMQ)
endif()
list(APPEND LAMMPS_LINK_LIBS cslib)
include_directories(${LAMMPS_LIB_SOURCE_DIR}/message/cslib/src)
endif()

View File

@ -0,0 +1,45 @@
if(PKG_MSCG)
find_package(GSL REQUIRED)
find_package(MSCG QUIET)
if(MSGC_FOUND)
set(DOWNLOAD_MSCG_DEFAULT OFF)
else()
set(DOWNLOAD_MSCG_DEFAULT ON)
endif()
option(DOWNLOAD_MSCG "Download MSCG library instead of using an already installed one)" ${DOWNLOAD_MSCG_DEFAULT})
if(DOWNLOAD_MSCG)
if (CMAKE_VERSION VERSION_LESS "3.7") # due to SOURCE_SUBDIR
message(FATAL_ERROR "For downlading MSCG you need at least cmake-3.7")
endif()
if(CMAKE_GENERATOR STREQUAL "Ninja")
message(FATAL_ERROR "Cannot build downloaded MSCG library with Ninja build tool")
endif()
include(ExternalProject)
if(NOT LAPACK_FOUND)
set(EXTRA_MSCG_OPTS "-DLAPACK_LIBRARIES=${CMAKE_CURRENT_BINARY_DIR}/liblinalg.a")
endif()
ExternalProject_Add(mscg_build
URL https://github.com/uchicago-voth/MSCG-release/archive/1.7.3.1.tar.gz
URL_MD5 8c45e269ee13f60b303edd7823866a91
SOURCE_SUBDIR src/CMake
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> ${CMAKE_REQUEST_PIC} ${EXTRA_MSCG_OPTS}
BUILD_COMMAND make mscg INSTALL_COMMAND ""
)
ExternalProject_get_property(mscg_build BINARY_DIR)
set(MSCG_LIBRARIES ${BINARY_DIR}/libmscg.a)
ExternalProject_get_property(mscg_build SOURCE_DIR)
set(MSCG_INCLUDE_DIRS ${SOURCE_DIR}/src)
list(APPEND LAMMPS_DEPS mscg_build)
if(NOT LAPACK_FOUND)
file(MAKE_DIRECTORY ${MSCG_INCLUDE_DIRS})
add_dependencies(mscg_build linalg)
endif()
else()
find_package(MSCG)
if(NOT MSCG_FOUND)
message(FATAL_ERROR "MSCG not found, help CMake to find it by setting MSCG_LIBRARY and MSCG_INCLUDE_DIRS, or set DOWNLOAD_MSCG=ON to download it")
endif()
endif()
list(APPEND LAMMPS_LINK_LIBS ${MSCG_LIBRARIES} ${GSL_LIBRARIES} ${LAPACK_LIBRARIES})
include_directories(${MSCG_INCLUDE_DIRS})
endif()

View File

@ -0,0 +1,13 @@
if(PKG_OPT)
set(OPT_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/OPT)
set(OPT_SOURCES)
set_property(GLOBAL PROPERTY "OPT_SOURCES" "${OPT_SOURCES}")
# detects styles which have OPT version
RegisterStylesExt(${OPT_SOURCES_DIR} opt OPT_SOURCES)
get_property(OPT_SOURCES GLOBAL PROPERTY OPT_SOURCES)
list(APPEND LIB_SOURCES ${OPT_SOURCES})
include_directories(${OPT_SOURCES_DIR})
endif()

View File

@ -0,0 +1,6 @@
if(PKG_PYTHON)
find_package(PythonLibs REQUIRED)
add_definitions(-DLMP_PYTHON)
include_directories(${PYTHON_INCLUDE_DIR})
list(APPEND LAMMPS_LINK_LIBS ${PYTHON_LIBRARY})
endif()

View File

@ -0,0 +1,20 @@
# Fix qeq/fire requires MANYBODY (i.e. COMB and COMB3) to be installed
if(PKG_QEQ)
set(QEQ_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/QEQ)
file(GLOB QEQ_HEADERS ${QEQ_SOURCES_DIR}/fix*.h)
file(GLOB QEQ_SOURCES ${QEQ_SOURCES_DIR}/fix*.cpp)
if(NOT PKG_MANYBODY)
list(REMOVE_ITEM QEQ_HEADERS ${QEQ_SOURCES_DIR}/fix_qeq_fire.h)
list(REMOVE_ITEM QEQ_SOURCES ${QEQ_SOURCES_DIR}/fix_qeq_fire.cpp)
endif()
set_property(GLOBAL PROPERTY "QEQ_SOURCES" "${QEQ_SOURCES}")
foreach(MY_HEADER ${QEQ_HEADERS})
AddStyleHeader(${MY_HEADER} FIX)
endforeach()
get_property(QEQ_SOURCES GLOBAL PROPERTY QEQ_SOURCES)
list(APPEND LIB_SOURCES ${QEQ_SOURCES})
include_directories(${QEQ_SOURCES_DIR})
endif()

View File

@ -0,0 +1,8 @@
if(PKG_USER-H5MD)
enable_language(C)
find_package(HDF5 REQUIRED)
target_link_libraries(h5md ${HDF5_LIBRARIES})
target_include_directories(h5md PRIVATE ${HDF5_INCLUDE_DIRS})
include_directories(${HDF5_INCLUDE_DIRS})
endif()

View File

@ -0,0 +1,118 @@
if(PKG_USER-INTEL)
check_include_file_cxx(immintrin.h FOUND_IMMINTRIN)
if(NOT FOUND_IMMINTRIN)
message(FATAL_ERROR "immintrin.h header not found, Intel package won't work without it")
endif()
add_definitions(-DLMP_USER_INTEL)
set(INTEL_ARCH "cpu" CACHE STRING "Architectures used by USER-INTEL (cpu or knl)")
set(INTEL_ARCH_VALUES cpu knl)
set_property(CACHE INTEL_ARCH PROPERTY STRINGS ${INTEL_ARCH_VALUES})
validate_option(INTEL_ARCH INTEL_ARCH_VALUES)
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++11)")
else()
set(INTEL_LRT_MODE "none" CACHE STRING "Long-range threads mode (none, threads, or c++11)")
endif()
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)
if(INTEL_LRT_MODE STREQUAL "THREADS")
if(Threads_FOUND)
add_definitions(-DLMP_INTEL_USELRT)
list(APPEND LAMMPS_LINK_LIBS ${CMAKE_THREAD_LIBS_INIT})
else()
message(FATAL_ERROR "Must have working threads library for Long-range thread support")
endif()
endif()
if(INTEL_LRT_MODE STREQUAL "C++11")
add_definitions(-DLMP_INTEL_USERLRT -DLMP_INTEL_LRT11)
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16)
message(FATAL_ERROR "USER-INTEL needs at least a 2016 Intel compiler, found ${CMAKE_CXX_COMPILER_VERSION}")
endif()
else()
message(WARNING "USER-INTEL gives best performance with Intel compilers")
endif()
find_package(TBB QUIET)
if(TBB_FOUND)
list(APPEND LAMMPS_LINK_LIBS ${TBB_MALLOC_LIBRARIES})
else()
add_definitions(-DLMP_INTEL_NO_TBB)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
message(WARNING "USER-INTEL with Intel compilers should use TBB malloc libraries")
endif()
endif()
find_package(MKL QUIET)
if(MKL_FOUND)
add_definitions(-DLMP_USE_MKL_RNG)
list(APPEND LAMMPS_LINK_LIBS ${MKL_LIBRARIES})
else()
message(STATUS "Pair style dpd/intel will be faster with MKL libraries")
endif()
if((NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows") AND (NOT ${LAMMPS_MEMALIGN} STREQUAL "64") AND (NOT ${LAMMPS_MEMALIGN} STREQUAL "128") AND (NOT ${LAMMPS_MEMALIGN} STREQUAL "256"))
message(FATAL_ERROR "USER-INTEL only supports memory alignment of 64, 128 or 256 on this platform")
endif()
if(INTEL_ARCH STREQUAL "KNL")
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
message(FATAL_ERROR "Must use Intel compiler with USER-INTEL for KNL architecture")
endif()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -xHost -qopenmp -qoffload")
set(MIC_OPTIONS "-qoffload-option,mic,compiler,\"-fp-model fast=2 -mGLOB_default_function_attrs=\\\"gather_scatter_loop_unroll=4\\\"\"")
add_compile_options(-xMIC-AVX512 -qoffload -fno-alias -ansi-alias -restrict -qoverride-limits ${MIC_OPTIONS})
add_definitions(-DLMP_INTEL_OFFLOAD)
else()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
if(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.3 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.4)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -xCOMMON-AVX512")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -xHost")
endif()
include(CheckCXXCompilerFlag)
foreach(_FLAG -O2 -fp-model fast=2 -no-prec-div -qoverride-limits -qopt-zmm-usage=high -qno-offload -fno-alias -ansi-alias -restrict)
check_cxx_compiler_flag("${__FLAG}" COMPILER_SUPPORTS${_FLAG})
if(COMPILER_SUPPORTS${_FLAG})
add_compile_options(${_FLAG})
endif()
endforeach()
else()
add_compile_options(-O3 -ffast-math)
endif()
endif()
# collect sources
set(USER-INTEL_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/USER-INTEL)
set(USER-INTEL_SOURCES ${USER-INTEL_SOURCES_DIR}/fix_intel.cpp
${USER-INTEL_SOURCES_DIR}/fix_nh_intel.cpp
${USER-INTEL_SOURCES_DIR}/intel_buffers.cpp
${USER-INTEL_SOURCES_DIR}/nbin_intel.cpp
${USER-INTEL_SOURCES_DIR}/npair_intel.cpp)
set_property(GLOBAL PROPERTY "USER-INTEL_SOURCES" "${USER-INTEL_SOURCES}")
# detect styles which have a USER-INTEL version
RegisterStylesExt(${USER-INTEL_SOURCES_DIR} intel USER-INTEL_SOURCES)
RegisterNBinStyle(${USER-INTEL_SOURCES_DIR}/nbin_intel.h)
RegisterNPairStyle(${USER-INTEL_SOURCES_DIR}/npair_intel.h)
RegisterFixStyle(${USER-INTEL_SOURCES_DIR}/fix_intel.h)
get_property(USER-INTEL_SOURCES GLOBAL PROPERTY USER-INTEL_SOURCES)
if(PKG_KSPACE)
list(APPEND USER-INTEL_SOURCES ${USER-INTEL_SOURCES_DIR}/verlet_lrt_intel.cpp)
RegisterIntegrateStyle(${USER-INTEL_SOURCES_DIR}/verlet_lrt_intel.h)
endif()
list(APPEND LIB_SOURCES ${USER-INTEL_SOURCES})
include_directories(${USER-INTEL_SOURCES_DIR})
endif()

View File

@ -0,0 +1,10 @@
if(PKG_USER-MOLFILE)
set(MOLFILE_INCLUDE_DIRS "${LAMMPS_LIB_SOURCE_DIR}/molfile" CACHE STRING "Path to VMD molfile plugin headers")
add_library(molfile INTERFACE)
target_include_directories(molfile INTERFACE ${MOLFILE_INCLUDE_DIRS})
# no need to link with -ldl on windows
if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
target_link_libraries(molfile INTERFACE ${CMAKE_DL_LIBS})
endif()
list(APPEND LAMMPS_LINK_LIBS molfile)
endif()

View File

@ -0,0 +1,6 @@
if(PKG_USER-NETCDF)
find_package(NetCDF REQUIRED)
include_directories(${NETCDF_INCLUDE_DIRS})
list(APPEND LAMMPS_LINK_LIBS ${NETCDF_LIBRARIES})
add_definitions(-DLMP_HAS_NETCDF -DNC_64BIT_DATA=0x0020)
endif()

View File

@ -0,0 +1,42 @@
if(PKG_USER-OMP)
set(USER-OMP_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/USER-OMP)
set(USER-OMP_SOURCES ${USER-OMP_SOURCES_DIR}/thr_data.cpp
${USER-OMP_SOURCES_DIR}/thr_omp.cpp
${USER-OMP_SOURCES_DIR}/fix_omp.cpp
${USER-OMP_SOURCES_DIR}/fix_nh_omp.cpp
${USER-OMP_SOURCES_DIR}/fix_nh_sphere_omp.cpp
${USER-OMP_SOURCES_DIR}/domain_omp.cpp)
add_definitions(-DLMP_USER_OMP)
set_property(GLOBAL PROPERTY "OMP_SOURCES" "${USER-OMP_SOURCES}")
# detects styles which have USER-OMP version
RegisterStylesExt(${USER-OMP_SOURCES_DIR} omp OMP_SOURCES)
RegisterFixStyle(${USER-OMP_SOURCES_DIR}/fix_omp.h)
get_property(USER-OMP_SOURCES GLOBAL PROPERTY OMP_SOURCES)
# manually add package dependent source files from USER-OMP that do not provide styles
if(PKG_ASPHERE)
list(APPEND USER-OMP_SOURCES ${USER-OMP_SOURCES_DIR}/fix_nh_asphere_omp.cpp)
endif()
if(PKG_RIGID)
list(APPEND USER-OMP_SOURCES ${USER-OMP_SOURCES_DIR}/fix_rigid_nh_omp.cpp)
endif()
if(PKG_USER-REAXC)
list(APPEND USER-OMP_SOURCES ${USER-OMP_SOURCES_DIR}/reaxc_bond_orders_omp.cpp
${USER-OMP_SOURCES_DIR}/reaxc_hydrogen_bonds_omp.cpp
${USER-OMP_SOURCES_DIR}/reaxc_nonbonded_omp.cpp
${USER-OMP_SOURCES_DIR}/reaxc_bonds_omp.cpp
${USER-OMP_SOURCES_DIR}/reaxc_init_md_omp.cpp
${USER-OMP_SOURCES_DIR}/reaxc_torsion_angles_omp.cpp
${USER-OMP_SOURCES_DIR}/reaxc_forces_omp.cpp
${USER-OMP_SOURCES_DIR}/reaxc_multi_body_omp.cpp
${USER-OMP_SOURCES_DIR}/reaxc_valence_angles_omp.cpp)
endif()
list(APPEND LIB_SOURCES ${USER-OMP_SOURCES})
include_directories(${USER-OMP_SOURCES_DIR})
endif()

View File

@ -0,0 +1,91 @@
if(PKG_USER-PLUMED)
set(PLUMED_MODE "static" CACHE STRING "Linkage mode for Plumed2 library")
set(PLUMED_MODE_VALUES static shared runtime)
set_property(CACHE PLUMED_MODE PROPERTY STRINGS ${PLUMED_MODE_VALUES})
validate_option(PLUMED_MODE PLUMED_MODE_VALUES)
string(TOUPPER ${PLUMED_MODE} PLUMED_MODE)
set(PLUMED_LINK_LIBS "")
if(PLUMED_MODE STREQUAL "STATIC")
find_package(LAPACK REQUIRED)
find_package(BLAS REQUIRED)
find_package(GSL REQUIRED)
list(APPEND LAPACK_LIBRARIES ${BLAS_LIBRARIES})
list(APPEND PLUMED_LINK_LIBS ${LAPACK_LIBRARIES} ${GSL_LIBRARIES})
find_package(ZLIB QUIET)
if(ZLIB_FOUND)
list(APPEND PLUMED_LINK_LIBS ${ZLIB_LIBRARIES})
endif()
endif()
find_package(PkgConfig QUIET)
set(DOWNLOAD_PLUMED_DEFAULT ON)
if(PKG_CONFIG_FOUND)
pkg_check_modules(PLUMED QUIET plumed)
if(PLUMED_FOUND)
set(DOWNLOAD_PLUMED_DEFAULT OFF)
endif()
endif()
option(DOWNLOAD_PLUMED "Download Plumed package instead of using an already installed one" ${DOWNLOAD_PLUMED_DEFAULT})
if(DOWNLOAD_PLUMED)
if(CMAKE_GENERATOR STREQUAL "Ninja")
message(FATAL_ERROR "Cannot build downloaded Plumed library with Ninja build tool")
endif()
if(BUILD_MPI)
set(PLUMED_CONFIG_MPI "--enable-mpi")
set(PLUMED_CONFIG_CC ${CMAKE_MPI_C_COMPILER})
set(PLUMED_CONFIG_CXX ${CMAKE_MPI_CXX_COMPILER})
else()
set(PLUMED_CONFIG_MPI "--disable-mpi")
set(PLUMED_CONFIG_CC ${CMAKE_C_COMPILER})
set(PLUMED_CONFIG_CXX ${CMAKE_CXX_COMPILER})
endif()
if(BUILD_OMP)
set(PLUMED_CONFIG_OMP "--enable-openmp")
else()
set(PLUMED_CONFIG_OMP "--disable-openmp")
endif()
message(STATUS "PLUMED download requested - we will build our own")
include(ExternalProject)
ExternalProject_Add(plumed_build
URL https://github.com/plumed/plumed2/releases/download/v2.5.2/plumed-src-2.5.2.tgz
URL_MD5 bd2f18346c788eb54e1e52f4f6acf41a
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR>
${CONFIGURE_REQUEST_PIC}
--enable-modules=all
${PLUMED_CONFIG_MPI}
${PLUMED_CONFIG_OMP}
CXX=${PLUMED_CONFIG_CXX}
CC=${PLUMED_CONFIG_CC}
)
ExternalProject_get_property(plumed_build INSTALL_DIR)
set(PLUMED_INSTALL_DIR ${INSTALL_DIR})
list(APPEND LAMMPS_DEPS plumed_build)
if(PLUMED_MODE STREQUAL "STATIC")
add_definitions(-D__PLUMED_WRAPPER_CXX=1)
list(APPEND LAMMPS_LINK_LIBS ${PLUMED_INSTALL_DIR}/lib/libplumed.a ${PLUMED_LINK_LIBS} ${CMAKE_DL_LIBS})
elseif(PLUMED_MODE STREQUAL "SHARED")
list(APPEND LAMMPS_LINK_LIBS ${PLUMED_INSTALL_DIR}/lib/libplumed${CMAKE_SHARED_LIBRARY_SUFFIX} ${PLUMED_INSTALL_DIR}/lib/libplumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_DL_LIBS})
elseif(PLUMED_MODE STREQUAL "RUNTIME")
add_definitions(-D__PLUMED_HAS_DLOPEN=1 -D__PLUMED_DEFAULT_KERNEL=${PLUMED_INSTALL_DIR}/lib/libplumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX})
list(APPEND LAMMPS_LINK_LIBS ${PLUMED_INSTALL_DIR}/lib/libplumedWrapper.a -rdynamic ${CMAKE_DL_LIBS})
endif()
set(PLUMED_INCLUDE_DIRS "${PLUMED_INSTALL_DIR}/include")
else()
find_package(PkgConfig REQUIRED)
pkg_check_modules(PLUMED REQUIRED plumed)
if(PLUMED_MODE STREQUAL "STATIC")
add_definitions(-D__PLUMED_WRAPPER_CXX=1)
include(${PLUMED_LIBDIR}/plumed/src/lib/Plumed.cmake.static)
elseif(PLUMED_MODE STREQUAL "SHARED")
include(${PLUMED_LIBDIR}/plumed/src/lib/Plumed.cmake.shared)
elseif(PLUMED_MODE STREQUAL "RUNTIME")
add_definitions(-D__PLUMED_HAS_DLOPEN=1 -D__PLUMED_DEFAULT_KERNEL=${PLUMED_LIBDIR}/libplumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX})
include(${PLUMED_LIBDIR}/plumed/src/lib/Plumed.cmake.runtime)
endif()
list(APPEND LAMMPS_LINK_LIBS ${PLUMED_LOAD})
endif()
include_directories(${PLUMED_INCLUDE_DIRS})
endif()

View File

@ -0,0 +1,9 @@
if(PKG_USER-QMMM)
enable_language(Fortran)
enable_language(C)
message(WARNING "Building QMMM with CMake is still experimental")
find_package(QE REQUIRED)
include_directories(${QE_INCLUDE_DIRS})
list(APPEND LAMMPS_LINK_LIBS ${QE_LIBRARIES})
endif()

View File

@ -0,0 +1,5 @@
if(PKG_USER-QUIP)
enable_language(Fortran)
find_package(QUIP REQUIRED)
list(APPEND LAMMPS_LINK_LIBS ${QUIP_LIBRARIES} ${LAPACK_LIBRARIES})
endif()

View File

@ -0,0 +1,62 @@
if(PKG_USER-SCAFACOS)
enable_language(Fortran)
enable_language(C)
find_package(GSL REQUIRED)
find_package(PkgConfig QUIET)
set(DOWNLOAD_SCAFACOS_DEFAULT ON)
if(PKG_CONFIG_FOUND)
pkg_check_modules(SCAFACOS QUIET scafacos)
if(SCAFACOS_FOUND)
set(DOWNLOAD_SCAFACOS_DEFAULT OFF)
endif()
endif()
option(DOWNLOAD_SCAFACOS "Download ScaFaCoS library instead of using an already installed one" ${DOWNLOAD_SCAFACOS_DEFAULT})
if(DOWNLOAD_SCAFACOS)
if(CMAKE_GENERATOR STREQUAL "Ninja")
message(FATAL_ERROR "Cannot build downloaded ScaFaCoS library with Ninja build tool")
endif()
message(STATUS "ScaFaCoS download requested - we will build our own")
include(ExternalProject)
ExternalProject_Add(scafacos_build
URL https://github.com/scafacos/scafacos/releases/download/v1.0.1/scafacos-1.0.1.tar.gz
URL_MD5 bd46d74e3296bd8a444d731bb10c1738
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --disable-doc
--enable-fcs-solvers=fmm,p2nfft,direct,ewald,p3m
--with-internal-fftw --with-internal-pfft
--with-internal-pnfft ${CONFIGURE_REQUEST_PIC}
FC=${CMAKE_MPI_Fortran_COMPILER}
CXX=${CMAKE_MPI_CXX_COMPILER}
CC=${CMAKE_MPI_C_COMPILER}
F77=
)
ExternalProject_get_property(scafacos_build INSTALL_DIR)
set(SCAFACOS_BUILD_DIR ${INSTALL_DIR})
set(SCAFACOS_INCLUDE_DIRS ${SCAFACOS_BUILD_DIR}/include)
list(APPEND LAMMPS_DEPS scafacos_build)
# list and order from pkg_config file of ScaFaCoS build
list(APPEND LAMMPS_LINK_LIBS ${SCAFACOS_BUILD_DIR}/lib/libfcs.a)
list(APPEND LAMMPS_LINK_LIBS ${SCAFACOS_BUILD_DIR}/lib/libfcs_direct.a)
list(APPEND LAMMPS_LINK_LIBS ${SCAFACOS_BUILD_DIR}/lib/libfcs_ewald.a)
list(APPEND LAMMPS_LINK_LIBS ${SCAFACOS_BUILD_DIR}/lib/libfcs_fmm.a)
list(APPEND LAMMPS_LINK_LIBS ${SCAFACOS_BUILD_DIR}/lib/libfcs_p2nfft.a)
list(APPEND LAMMPS_LINK_LIBS ${SCAFACOS_BUILD_DIR}/lib/libfcs_p3m.a)
list(APPEND LAMMPS_LINK_LIBS ${GSL_LIBRARIES})
list(APPEND LAMMPS_LINK_LIBS ${SCAFACOS_BUILD_DIR}/lib/libfcs_near.a)
list(APPEND LAMMPS_LINK_LIBS ${SCAFACOS_BUILD_DIR}/lib/libfcs_gridsort.a)
list(APPEND LAMMPS_LINK_LIBS ${SCAFACOS_BUILD_DIR}/lib/libfcs_resort.a)
list(APPEND LAMMPS_LINK_LIBS ${SCAFACOS_BUILD_DIR}/lib/libfcs_redist.a)
list(APPEND LAMMPS_LINK_LIBS ${SCAFACOS_BUILD_DIR}/lib/libfcs_common.a)
list(APPEND LAMMPS_LINK_LIBS ${SCAFACOS_BUILD_DIR}/lib/libfcs_pnfft.a)
list(APPEND LAMMPS_LINK_LIBS ${SCAFACOS_BUILD_DIR}/lib/libfcs_pfft.a)
list(APPEND LAMMPS_LINK_LIBS ${SCAFACOS_BUILD_DIR}/lib/libfcs_fftw3_mpi.a)
list(APPEND LAMMPS_LINK_LIBS ${SCAFACOS_BUILD_DIR}/lib/libfcs_fftw3.a)
list(APPEND LAMMPS_LINK_LIBS ${MPI_Fortran_LIBRARIES})
list(APPEND LAMMPS_LINK_LIBS ${MPI_C_LIBRARIES})
else()
find_package(PkgConfig REQUIRED)
pkg_check_modules(SCAFACOS REQUIRED scafacos)
list(APPEND LAMMPS_LINK_LIBS ${SCAFACOS_LDFLAGS})
endif()
include_directories(${SCAFACOS_INCLUDE_DIRS})
endif()

View File

@ -0,0 +1,13 @@
# Fix rigid/meso requires RIGID to be installed
if(PKG_USER-SDPD)
set(USER-SDPD_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/USER-SDPD)
get_property(hlist GLOBAL PROPERTY FIX)
if(NOT PKG_RIGID)
list(REMOVE_ITEM hlist ${USER-SDPD_SOURCES_DIR}/fix_rigid_meso.h)
list(REMOVE_ITEM LIB_SOURCES ${USER-SDPD_SOURCES_DIR}/fix_rigid_meso.cpp)
endif()
set_property(GLOBAL PROPERTY FIX "${hlist}")
include_directories(${USER-SDPD_SOURCES_DIR})
endif()

View File

@ -0,0 +1,28 @@
if(PKG_USER-SMD)
find_package(Eigen3 NO_MODULE)
if(EIGEN3_FOUND)
set(DOWNLOAD_EIGEN3_DEFAULT OFF)
else()
set(DOWNLOAD_EIGEN3_DEFAULT ON)
endif()
option(DOWNLOAD_EIGEN3 "Download Eigen3 instead of using an already installed one)" ${DOWNLOAD_EIGEN3_DEFAULT})
if(DOWNLOAD_EIGEN3)
message(STATUS "Eigen3 download requested - we will build our own")
include(ExternalProject)
ExternalProject_Add(Eigen3_build
URL http://bitbucket.org/eigen/eigen/get/3.3.7.tar.gz
URL_MD5 f2a417d083fe8ca4b8ed2bc613d20f07
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
)
ExternalProject_get_property(Eigen3_build SOURCE_DIR)
set(EIGEN3_INCLUDE_DIR ${SOURCE_DIR})
list(APPEND LAMMPS_DEPS Eigen3_build)
else()
find_package(Eigen3 NO_MODULE)
mark_as_advanced(Eigen3_DIR)
if(NOT EIGEN3_FOUND)
message(FATAL_ERROR "Eigen3 not found, help CMake to find it by setting EIGEN3_INCLUDE_DIR, or set DOWNLOAD_EIGEN3=ON to download it")
endif()
endif()
include_directories(${EIGEN3_INCLUDE_DIR})
endif()

View File

@ -0,0 +1,6 @@
if(PKG_USER-VTK)
find_package(VTK REQUIRED NO_MODULE)
include(${VTK_USE_FILE})
add_definitions(-DLAMMPS_VTK)
list(APPEND LAMMPS_LINK_LIBS ${VTK_LIBRARIES})
endif()

View File

@ -0,0 +1,45 @@
if(PKG_VORONOI)
find_package(VORO)
if(VORO_FOUND)
set(DOWNLOAD_VORO_DEFAULT OFF)
else()
set(DOWNLOAD_VORO_DEFAULT ON)
endif()
option(DOWNLOAD_VORO "Download and compile the Voro++ library instead of using an already installed one" ${DOWNLOAD_VORO_DEFAULT})
if(DOWNLOAD_VORO)
if(CMAKE_GENERATOR STREQUAL "Ninja")
message(FATAL_ERROR "Cannot build downloaded Voro++ library with Ninja build tool")
endif()
message(STATUS "Voro++ download requested - we will build our own")
include(ExternalProject)
if(BUILD_SHARED_LIBS)
set(VORO_BUILD_CFLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS} ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${BTYPE}}")
else()
set(VORO_BUILD_CFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${BTYPE}}")
endif()
if(APPLE)
get_filename_component(VORO_CXX ${CMAKE_CXX_COMPILER} NAME_WE)
set(VORO_BUILD_OPTIONS CXX=${VORO_CXX} CFLAGS=${VORO_BUILD_CFLAGS})
else()
set(VORO_BUILD_OPTIONS CXX=${CMAKE_CXX_COMPILER} CFLAGS=${VORO_BUILD_CFLAGS})
endif()
ExternalProject_Add(voro_build
URL https://download.lammps.org/thirdparty/voro++-0.4.6.tar.gz
URL_MD5 2338b824c3b7b25590e18e8df5d68af9
CONFIGURE_COMMAND "" BUILD_COMMAND make ${VORO_BUILD_OPTIONS} BUILD_IN_SOURCE 1 INSTALL_COMMAND ""
)
ExternalProject_get_property(voro_build SOURCE_DIR)
set(VORO_LIBRARIES ${SOURCE_DIR}/src/libvoro++.a)
set(VORO_INCLUDE_DIRS ${SOURCE_DIR}/src)
list(APPEND LAMMPS_DEPS voro_build)
else()
find_package(VORO)
if(NOT VORO_FOUND)
message(FATAL_ERROR "Voro++ library not found. Help CMake to find it by setting VORO_LIBRARY and VORO_INCLUDE_DIR, or set DOWNLOAD_VORO=ON to download it")
endif()
endif()
include_directories(${VORO_INCLUDE_DIRS})
list(APPEND LAMMPS_LINK_LIBS ${VORO_LIBRARIES})
endif()

View File

@ -91,6 +91,10 @@ function(RegisterFixStyle path)
AddStyleHeader(${path} FIX)
endfunction(RegisterFixStyle)
function(RegisterIntegrateStyle path)
AddStyleHeader(${path} INTEGRATE)
endfunction(RegisterIntegrateStyle)
function(RegisterStyles search_path)
FindStyleHeaders(${search_path} ANGLE_CLASS angle_ ANGLE ) # angle ) # force
FindStyleHeaders(${search_path} ATOM_CLASS atom_vec_ ATOM_VEC ) # atom ) # atom atom_vec_hybrid
@ -177,3 +181,88 @@ function(DetectBuildSystemConflict lammps_src_dir)
endforeach()
endif()
endfunction(DetectBuildSystemConflict)
function(FindPackagesHeaders path style_class file_pattern headers)
file(GLOB files "${path}/${file_pattern}*.h")
get_property(plist GLOBAL PROPERTY ${headers})
foreach(file_name ${files})
file(STRINGS ${file_name} is_style LIMIT_COUNT 1 REGEX ${style_class})
if(is_style)
list(APPEND plist ${file_name})
endif()
endforeach()
set_property(GLOBAL PROPERTY ${headers} "${plist}")
endfunction(FindPackagesHeaders)
function(RegisterPackages search_path)
FindPackagesHeaders(${search_path} ANGLE_CLASS angle_ PKGANGLE ) # angle ) # force
FindPackagesHeaders(${search_path} ATOM_CLASS atom_vec_ PKGATOM_VEC ) # atom ) # atom atom_vec_hybrid
FindPackagesHeaders(${search_path} BODY_CLASS body_ PKGBODY ) # body ) # atom_vec_body
FindPackagesHeaders(${search_path} BOND_CLASS bond_ PKGBOND ) # bond ) # force
FindPackagesHeaders(${search_path} COMMAND_CLASS "[^.]" PKGCOMMAND ) # command ) # input
FindPackagesHeaders(${search_path} COMPUTE_CLASS compute_ PKGCOMPUTE ) # compute ) # modify
FindPackagesHeaders(${search_path} DIHEDRAL_CLASS dihedral_ PKGDIHEDRAL ) # dihedral ) # force
FindPackagesHeaders(${search_path} DUMP_CLASS dump_ PKGDUMP ) # dump ) # output write_dump
FindPackagesHeaders(${search_path} FIX_CLASS fix_ PKGFIX ) # fix ) # modify
FindPackagesHeaders(${search_path} IMPROPER_CLASS improper_ PKGIMPROPER ) # improper ) # force
FindPackagesHeaders(${search_path} INTEGRATE_CLASS "[^.]" PKGINTEGRATE ) # integrate ) # update
FindPackagesHeaders(${search_path} KSPACE_CLASS "[^.]" PKGKSPACE ) # kspace ) # force
FindPackagesHeaders(${search_path} MINIMIZE_CLASS min_ PKGMINIMIZE ) # minimize ) # update
FindPackagesHeaders(${search_path} NBIN_CLASS nbin_ PKGNBIN ) # nbin ) # neighbor
FindPackagesHeaders(${search_path} NPAIR_CLASS npair_ PKGNPAIR ) # npair ) # neighbor
FindPackagesHeaders(${search_path} NSTENCIL_CLASS nstencil_ PKGNSTENCIL ) # nstencil ) # neighbor
FindPackagesHeaders(${search_path} NTOPO_CLASS ntopo_ PKGNTOPO ) # ntopo ) # neighbor
FindPackagesHeaders(${search_path} PAIR_CLASS pair_ PKGPAIR ) # pair ) # force
FindPackagesHeaders(${search_path} READER_CLASS reader_ PKGREADER ) # reader ) # read_dump
FindPackagesHeaders(${search_path} REGION_CLASS region_ PKGREGION ) # region ) # domain
endfunction(RegisterPackages)
function(CreatePackagesHeader path filename)
set(temp "")
if(ARGC GREATER 2)
list(REMOVE_AT ARGV 0 1)
foreach(FNAME ${ARGV})
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${FNAME}")
get_filename_component(DNAME ${FNAME} DIRECTORY)
get_filename_component(DNAME ${DNAME} NAME)
get_filename_component(FNAME ${FNAME} NAME)
set(temp "${temp}#undef PACKAGE\n#define PACKAGE \"${DNAME}\"\n")
set(temp "${temp}#include \"${DNAME}/${FNAME}\"\n")
endforeach()
endif()
message(STATUS "Generating ${filename}...")
file(WRITE "${path}/${filename}.tmp" "${temp}" )
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${path}/${filename}.tmp" "${path}/${filename}")
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${path}/${filename}")
endfunction(CreatePackagesHeader)
function(GeneratePackagesHeader path property style)
get_property(files GLOBAL PROPERTY ${property})
CreatePackagesHeader("${path}" "packages_${style}.h" ${files})
endfunction(GeneratePackagesHeader)
function(GeneratePackagesHeaders output_path)
GeneratePackagesHeader(${output_path} PKGANGLE angle ) # force
GeneratePackagesHeader(${output_path} PKGATOM_VEC atom ) # atom atom_vec_hybrid
GeneratePackagesHeader(${output_path} PKGBODY body ) # atom_vec_body
GeneratePackagesHeader(${output_path} PKGBOND bond ) # force
GeneratePackagesHeader(${output_path} PKGCOMMAND command ) # input
GeneratePackagesHeader(${output_path} PKGCOMPUTE compute ) # modify
GeneratePackagesHeader(${output_path} PKGDIHEDRAL dihedral ) # force
GeneratePackagesHeader(${output_path} PKGDUMP dump ) # output write_dump
GeneratePackagesHeader(${output_path} PKGFIX fix ) # modify
GeneratePackagesHeader(${output_path} PKGIMPROPER improper ) # force
GeneratePackagesHeader(${output_path} PKGINTEGRATE integrate ) # update
GeneratePackagesHeader(${output_path} PKGKSPACE kspace ) # force
GeneratePackagesHeader(${output_path} PKGMINIMIZE minimize ) # update
GeneratePackagesHeader(${output_path} PKGNBIN nbin ) # neighbor
GeneratePackagesHeader(${output_path} PKGNPAIR npair ) # neighbor
GeneratePackagesHeader(${output_path} PKGNSTENCIL nstencil ) # neighbor
GeneratePackagesHeader(${output_path} PKGNTOPO ntopo ) # neighbor
GeneratePackagesHeader(${output_path} PKGPAIR pair ) # force
GeneratePackagesHeader(${output_path} PKGREADER reader ) # read_dump
GeneratePackagesHeader(${output_path} PKGREGION region ) # domain
endfunction(GeneratePackagesHeaders)

View File

@ -0,0 +1,52 @@
###############################################################################
# Testing
###############################################################################
option(ENABLE_TESTING "Enable testing" OFF)
if(ENABLE_TESTING AND BUILD_EXE)
enable_testing()
option(LAMMPS_TESTING_SOURCE_DIR "Location of lammps-testing source directory" "")
option(LAMMPS_TESTING_GIT_TAG "Git tag of lammps-testing" "master")
mark_as_advanced(LAMMPS_TESTING_SOURCE_DIR LAMMPS_TESTING_GIT_TAG)
if (CMAKE_VERSION VERSION_GREATER "3.10.3" AND NOT LAMMPS_TESTING_SOURCE_DIR)
include(FetchContent)
FetchContent_Declare(lammps-testing
GIT_REPOSITORY https://github.com/lammps/lammps-testing.git
GIT_TAG ${LAMMPS_TESTING_GIT_TAG}
)
FetchContent_GetProperties(lammps-testing)
if(NOT lammps-testing_POPULATED)
message(STATUS "Downloading tests...")
FetchContent_Populate(lammps-testing)
endif()
set(LAMMPS_TESTING_SOURCE_DIR ${lammps-testing_SOURCE_DIR})
elseif(NOT LAMMPS_TESTING_SOURCE_DIR)
message(WARNING "Full test-suite requires CMake >= 3.11 or copy of\n"
"https://github.com/lammps/lammps-testing in LAMMPS_TESTING_SOURCE_DIR")
endif()
add_test(ShowHelp ${CMAKE_BINARY_DIR}/${LAMMPS_BINARY} -help)
if(EXISTS ${LAMMPS_TESTING_SOURCE_DIR})
message(STATUS "Running test discovery...")
file(GLOB_RECURSE TEST_SCRIPTS ${LAMMPS_TESTING_SOURCE_DIR}/tests/core/*/in.*)
foreach(script_path ${TEST_SCRIPTS})
get_filename_component(TEST_NAME ${script_path} EXT)
get_filename_component(SCRIPT_NAME ${script_path} NAME)
get_filename_component(PARENT_DIR ${script_path} DIRECTORY)
string(SUBSTRING ${TEST_NAME} 1 -1 TEST_NAME)
string(REPLACE "-" "_" TEST_NAME ${TEST_NAME})
string(REPLACE "+" "_" TEST_NAME ${TEST_NAME})
set(TEST_NAME "test_core_${TEST_NAME}_serial")
add_test(${TEST_NAME} ${CMAKE_BINARY_DIR}/${LAMMPS_BINARY} -in ${SCRIPT_NAME})
set_tests_properties(${TEST_NAME} PROPERTIES WORKING_DIRECTORY ${PARENT_DIR})
endforeach()
list(LENGTH TEST_SCRIPTS NUM_TESTS)
message(STATUS "Found ${NUM_TESTS} tests.")
endif()
endif()

View File

@ -0,0 +1,30 @@
set(temp "#ifndef LMP_GIT_VERSION_H\n#define LMP_GIT_VERSION_H\n")
set(temp_git_commit "(unknown)")
set(temp_git_branch "(unknown)")
set(temp_git_describe "(unknown)")
set(temp_git_info "false")
if(GIT_FOUND AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../.git)
set(temp_git_info "true")
execute_process(COMMAND ${GIT_EXECUTABLE} -C ${CMAKE_CURRENT_SOURCE_DIR}/.. rev-parse HEAD
OUTPUT_VARIABLE temp_git_commit
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${GIT_EXECUTABLE} -C ${CMAKE_CURRENT_SOURCE_DIR}/.. rev-parse --abbrev-ref HEAD
OUTPUT_VARIABLE temp_git_branch
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${GIT_EXECUTABLE} -C ${CMAKE_CURRENT_SOURCE_DIR}/.. describe --dirty=-modified
OUTPUT_VARIABLE temp_git_describe
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
set(temp "${temp}const bool LAMMPS_NS::LAMMPS::has_git_info = ${temp_git_info};\n")
set(temp "${temp}const char LAMMPS_NS::LAMMPS::git_commit[] = \"${temp_git_commit}\";\n")
set(temp "${temp}const char LAMMPS_NS::LAMMPS::git_branch[] = \"${temp_git_branch}\";\n")
set(temp "${temp}const char LAMMPS_NS::LAMMPS::git_descriptor[] = \"${temp_git_describe}\";\n")
set(temp "${temp}#endif\n\n")
message(STATUS "Generating lmpgitversion.h...")
file(WRITE "${LAMMPS_STYLE_HEADERS_DIR}/lmpgitversion.h.tmp" "${temp}" )
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${LAMMPS_STYLE_HEADERS_DIR}/lmpgitversion.h.tmp" "${LAMMPS_STYLE_HEADERS_DIR}/lmpgitversion.h")

View File

@ -33,12 +33,17 @@ tasks, act as a reference and provide examples of typical use cases.
* [Package-Specific Configuration Options](#package-specific-configuration-options)
* [KSPACE Package](#kspace-package)
* [MKL](#mkl)
* [FFTW2](#fftw2)
* [FFTW3](#fftw3)
* [BLAS](#blas)
* [LAPACK](#lapack)
* [PYTHON Package](#python-package)
* [GPU Package](#gpu-package)
* [MESSAGE Package](#message-package)
* [MSCG Package](#mscg-package)
* [VORONOI Package](#voronoi-package)
* [USER-LATTE Package](#user-latte-package)
* [USER-PLUMED Package](#user-plumed-package)
* [USER-SCAFACOS Package](#user-scafacos-package)
* [USER-SMD Package](#user-smd-package)
* [Optional Features](#optional-features)
* [zlib support](#zlib-support)
@ -50,8 +55,6 @@ tasks, act as a reference and provide examples of typical use cases.
* [Building with GNU Compilers](#building-with-gnu-compilers)
* [Building with Intel Compilers](#building-with-intel-compilers)
* [Building with LLVM/Clang Compilers](#building-with-llvmclang-compilers)
* [Examples](#examples)
## Quick Start for the Impatient
If you want to skip ahead and just run the compilation using `cmake`, please
@ -155,11 +158,13 @@ make
The CMake build exposes a lot of different options. In the old build system
some of the package selections were possible by using special make target like
`make yes-std` or `make no-lib`. Achieving the same result with cmake requires
`make yes-std` or `make no-lib`. Achieving a similar result with cmake requires
specifying all options manually. This can quickly become a very long command
line that is hard to handle. While these could be stored in a simple script
file, there is another way of defining "presets" to compile LAMMPS in a certain
way.
way. Since the cmake build process - contrary to the conventional build system -
includes the compilation of the bundled libraries into the standard build process,
the grouping of those presets is somewhat different.
A preset is a regular CMake script file that can use constructs such as
variables, lists and for-loops to manipulate configuration options and create
@ -171,10 +176,10 @@ Such a file can then be passed to cmake via the `-C` flag. Several examples of
presets can be found in the `cmake/presets` folder.
```bash
# build LAMMPS with all "standard" packages which don't use libraries and enable GPU package
# build LAMMPS with all packages enabled which don't use external libraries and enable GPU package
mkdir build
cd build
cmake -C ../cmake/presets/std_nolib.cmake -D PKG_GPU=on ../cmake
cmake -C ../cmake/presets/all_on.cmake -C ../cmake/presets/nolib.cmake -D PKG_GPU=on ../cmake
```
# Reference
@ -203,13 +208,15 @@ cmake -C ../cmake/presets/std_nolib.cmake -D PKG_GPU=on ../cmake
<td>Controls if debugging symbols are added to the generated binaries</td>
<td>
<dl>
<dt><code>Release</code> (default)</dt>
<dt><code>RelWithDebInfo (default)</code></dt>
<dt><code>Release</code></dt>
<dt><code>Debug</code></dt>
<dt><code>MinSizeRel</code></dt>
</dl>
</td>
</tr>
<tr>
<td><code><CMAKE_VERBOSE_MAKEFILE/code></td>
<td><code>CMAKE_VERBOSE_MAKEFILE</code></td>
<td>Enable verbose output from Makefile builds (useful for debugging), the same can be achived by adding `VERBOSE=1` to the `make` call.</td>
<td>
<dl>
@ -247,6 +254,16 @@ cmake -C ../cmake/presets/std_nolib.cmake -D PKG_GPU=on ../cmake
</dl>
</td>
</tr>
<tr>
<td><code>LAMMPS_LONGLONG_TO_LONG</code></td>
<td>Workaround if your system or MPI version does not recognize <code>long long</code> data types</td>
<td>
<dl>
<dt><code>off</code> (default)</dt>
<dt><code>on</code></dt>
</dl>
</td>
</tr>
<tr>
<td><code>LAMMPS_MEMALIGN</code></td>
<td>controls the alignment of blocks of memory allocated by LAMMPS</td>
@ -269,7 +286,16 @@ cmake -C ../cmake/presets/std_nolib.cmake -D PKG_GPU=on ../cmake
</tr>
<tr>
<td><code>LAMMPS_MACHINE</code></td>
<td>allows appending a machine suffix to the generate LAMMPS binary</td>
<td>allows appending a machine suffix to the generated LAMMPS binary</td>
<td>
<dl>
<dt>*none* (default)</dt>
</dl>
</td>
</tr>
<tr>
<td><code>LAMMPS_LIB_SUFFIX</code></td>
<td>allows appending a suffix to the generated LAMMPS library</td>
<td>
<dl>
<dt>*none* (default)</dt>
@ -317,8 +343,8 @@ cmake -C ../cmake/presets/std_nolib.cmake -D PKG_GPU=on ../cmake
</td>
</tr>
<tr>
<td><code>LAMMPS_LONGLONG_TO_LONG</code></td>
<td>Workaround if your system or MPI version does not recognize <code>long long</code> data types</td>
<td><code>BUILD_TOOLS</code></td>
<td>control whether to build LAMMPS tools</td>
<td>
<dl>
<dt><code>off</code> (default)</dt>
@ -559,23 +585,6 @@ cmake -C ../cmake/presets/std_nolib.cmake -D PKG_GPU=on ../cmake
</dl>
</td>
</tr>
<tr>
<td><code>PKG_MEAM</code></td>
<td>
<p>A pair style for the modified embedded atom (MEAM) potential.</p>
<p><strong>Please note that the MEAM package has been superseded by the USER-MEAMC package,
which is a direct translation of the MEAM package to C++. USER-MEAMC contains
additional optimizations making it run faster than MEAM on most machines, while
providing the identical features and USER interface.</strong></p>
</td>
<td>
<dl>
<dt><code>off</code> (default)</dt>
<dt><code>on</code></dt>
</dl>
</td>
</tr>
<tr>
<td><code>PKG_MISC</code></td>
<td>
@ -632,21 +641,6 @@ providing the identical features and USER interface.</strong></p>
</dl>
</td>
</tr>
<tr>
<td><code>PKG_REAX</code></td>
<td>
A pair style which wraps a Fortran library which implements the ReaxFF
potential, which is a universal reactive force field. See the USER-REAXC
package for an alternate implementation in C/C++. Also a fix reax/bonds
command for monitoring molecules as bonds are created and destroyed.
</td>
<td>
<dl>
<dt><code>off</code> (default)</dt>
<dt><code>on</code></dt>
</dl>
</td>
</tr>
<tr>
<td><code>PKG_REPLICA</code></td>
<td>
@ -693,6 +687,16 @@ providing the identical features and USER interface.</strong></p>
</dl>
</td>
</tr>
<tr>
<td><code>PKG_SPIN</code></td>
<td>Model atomic magnetic spins classically, coupled to atoms moving in the usual manner via MD. Various pair, fix, and compute styles.</td>
<td>
<dl>
<dt><code>off</code> (default)</dt>
<dt><code>on</code></dt>
</dl>
</td>
</tr>
<tr>
<td><code>PKG_SNAP</code></td>
<td>
@ -755,6 +759,16 @@ providing the identical features and USER interface.</strong></p>
</dl>
</td>
</tr>
<tr>
<td><code>PKG_MESSAGE</code></td>
<td>Commands to use LAMMPS as either a client or server and couple it to another application.</td>
<td>
<dl>
<dt><code>off</code> (default)</dt>
<dt><code>on</code></dt>
</dl>
</td>
</tr>
<tr>
<td><code>PKG_MSCG</code></td>
<td>
@ -809,6 +823,18 @@ providing the identical features and USER interface.</strong></p>
</dl>
</td>
</tr>
<tr>
<td><code>PKG_VORONOI</code></td>
<td>
A compute command which calculates the Voronoi tesselation of a collection of atoms by wrapping the Voro++ library. This can be used to calculate the local volume or each atoms or its near neighbors.
</td>
<td>
<dl>
<dt><code>off</code> (default)</dt>
<dt><code>on</code></dt>
</dl>
</td>
</tr>
</tbody>
</table>
@ -823,6 +849,16 @@ providing the identical features and USER interface.</strong></p>
</tr>
</thead>
<tbody>
<tr>
<td><code>PKG_USER-ADIOS</code></td>
<td>ADIOS is a high-performance I/O library. This package implements the dump “atom/adios” and dump “custom/adios” commands to write data using the ADIOS library.</td>
<td>
<dl>
<dt><code>off</code> (default)</dt>
<dt><code>on</code></dt>
</dl>
</td>
</tr>
<tr>
<td><code>PKG_USER-ATC</code></td>
<td>
@ -851,6 +887,18 @@ providing the identical features and USER interface.</strong></p>
</dl>
</td>
</tr>
<tr>
<td><code>PKG_USER-BOCS</code></td>
<td>
This package provides fix bocs, a modified version of fix npt which includes the pressure correction to the barostat as outlined in: N. J. H. Dunn and W. G. Noid, “Bottom-up coarse-grained models that accurately describe the structure, pressure, and compressibility of molecular liquids,” J. Chem. Phys. 143, 243148 (2015).
</td>
<td>
<dl>
<dt><code>off</code> (default)</dt>
<dt><code>on</code></dt>
</dl>
</td>
</tr>
<tr>
<td><code>PKG_USER-CGDNA</code></td>
<td>
@ -1140,6 +1188,30 @@ providing the identical features and USER interface.</strong></p>
</dl>
</td>
</tr>
<tr>
<td><code>PKG_USER-PLUMED</code></td>
<td>
The fix plumed command allows you to use the PLUMED free energy plugin for molecular dynamics to analyze and bias your LAMMPS trajectory on the fly. The PLUMED library is called from within the LAMMPS input script by using the <code>fix plumed</code> command.
</td>
<td>
<dl>
<dt><code>off</code> (default)</dt>
<dt><code>on</code></dt>
</dl>
</td>
</tr>
<tr>
<td><code>PKG_USER-PTM</code></td>
<td>
A <code>compute ptm/atom</code> command that calculates local structure characterization using the Polyhedral Template Matching methodology.
</td>
<td>
<dl>
<dt><code>off</code> (default)</dt>
<dt><code>on</code></dt>
</dl>
</td>
</tr>
<tr>
<td><code>PKG_USER-QTB</code></td>
<td>
@ -1195,6 +1267,33 @@ providing the identical features and USER interface.</strong></p>
</dl>
</td>
</tr>
<tr>
<td><code>PKG_USER-SCAFACOS</code></td>
<td>
A KSpace style which wraps the ScaFaCoS Coulomb solver library to compute long-range Coulombic interactions.
</td>
<td>
<dl>
<dt><code>off</code> (default)</dt>
<dt><code>on</code></dt>
</dl>
</td>
</tr>
<tr>
<td><code>PKG_USER-SDPD</code></td>
<td>
A pair style for smoothed dissipative particle dynamics (SDPD), which is an
extension of smoothed particle hydrodynamics (SPH) to mesoscale where thermal
fluctuations are important (see the USER-SPH package). Also two fixes for
moving and rigid body integration of SPH/SDPD particles (particles of
<code>atom_style meso</code>).</td>
<td>
<dl>
<dt><code>off</code> (default)</dt>
<dt><code>on</code></dt>
</dl>
</td>
</tr>
<tr>
<td><code>PKG_USER-SMD</code></td>
<td>
@ -1278,6 +1377,23 @@ providing the identical features and USER interface.</strong></p>
</dl>
</td>
</tr>
<tr>
<td><code>PKG_USER-YAFF</code></td>
<td>
Some potentials that are also implemented in the Yet Another Force Field (YAFF) code.
The expressions and their use are discussed in the following papers:
<ul>
<li><a href="http://dx.doi.org/10.1002/jcc.23877" target="_blank">Vanduyfhuys et al., J. Comput. Chem., 36 (13), 1015-1027 (2015)</a></li>
<li><a href="http://dx.doi.org/10.1002/jcc.25173" target="_blank">Vanduyfhuys et al., J. Comput. Chem., 39 (16), 999-1011 (2018)</a></li>
</ul>
</td>
<td>
<dl>
<dt><code>off</code> (default)</dt>
<dt><code>on</code></dt>
</dl>
</td>
</tr>
</tbody>
</table>
@ -1298,14 +1414,27 @@ providing the identical features and USER interface.</strong></p>
<td><code>FFT</code></td>
<td>
<p>FFT library for KSPACE package</p>
<p>If either MKL or FFTW is selected <code>cmake</code> will try to locate these libraries automatically. To control which one should be used please see the options below for each FFT library.</p>
<p>If either MKL or FFTW is selected <code>cmake</code> will try to locate
these libraries automatically. To control which one should be used please see
the options below for each FFT library. Otherwise it will default to KISS
FFT.</p>
</td>
<td>
<dl>
<dt><code>KISS</code></dt>
<dt><code>FFTW3</code></dt>
<dt><code>FFTW2</code></dt>
<dt><code>MKL</code></dt>
<dt><code>KISS</code> (default)</dt>
</dl>
</td>
</tr>
<tr>
<td><code>FFT_SINGLE</code></td>
<td>Use single-precision floating-point in FFT</td>
<td>
<dl>
<dt><code>off</code> (default = double precision)</dt>
<dt><code>on</code></dt>
</dl>
</td>
</tr>
@ -1323,60 +1452,6 @@ providing the identical features and USER interface.</strong></p>
</tbody>
</table>
### MKL
<table>
<thead>
<tr>
<th>Option</th>
<th>Description</th>
<th>Values</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>MKL_INCLUDE_DIRS</code></td>
<td></td>
<td>
</td>
</tr>
<tr>
<td><code>MKL_LIBRARIES</code></td>
<td></td>
<td>
</td>
</tr>
</tbody>
</table>
TODO static vs dynamic linking
### FFTW2
<table>
<thead>
<tr>
<th>Option</th>
<th>Description</th>
<th>Values</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>FFTW2_INCLUDE_DIRS</code></td>
<td></td>
<td>
</td>
</tr>
<tr>
<td><code>FFTW2_LIBRARIES</code></td>
<td></td>
<td>
</td>
</tr>
</tbody>
</table>
### FFTW3
<table>
@ -1390,24 +1465,57 @@ TODO static vs dynamic linking
<tbody>
<tr>
<td><code>FFTW3_INCLUDE_DIRS</code></td>
<td></td>
<td>path to FFTW3 include files</td>
<td>
</td>
</tr>
<tr>
<td><code>FFTW3_LIBRARIES</code></td>
<td></td>
<td>list of paths to FFTW3 libraries</td>
<td>
</td>
</tr>
</tbody>
</table>
### MKL
<table>
<thead>
<tr>
<th>Option</th>
<th>Description</th>
<th>Values</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>MKL_INCLUDE_DIRS</code></td>
<td>path to MKL include files</td>
<td>
</td>
</tr>
<tr>
<td><code>MKL_LIBRARIES</code></td>
<td>list of paths to MKL libraries</td>
<td>
</td>
</tr>
</tbody>
</table>
### BLAS
See [FindBLAS documentation](https://cmake.org/cmake/help/latest/module/FindBLAS.html)
### LAPACK
TODO
See [FindLAPACK documentation](https://cmake.org/cmake/help/latest/module/FindLAPACK.html)
### PYTHON Package
See [FindPYTHON documentation](https://cmake.org/cmake/help/latest/module/FindPython.html)
### USER-INTEL Package
<table>
@ -1429,6 +1537,17 @@ TODO
</dl>
</td>
</tr>
<tr>
<td><code>INTEL_LRT_MODE</code></td>
<td>How to support Long-range thread mode in Verlet integration</td>
<td>
<dl>
<dt><code>threads</code> (default, if pthreads available)</dt>
<dt><code>none</code> (default, if pthreads not available)</dt>
<dt><code>c++11</code></dt>
</dl>
</td>
</tr>
</tbody>
</table>
@ -1486,10 +1605,11 @@ target API.
<td>
<dl>
<dt><code>sm_20</code> (Fermi)</dt>
<dt><code>sm_30</code> (Kepler)</dt>
<dt><code>sm_30</code> (Kepler) (default)</dt>
<dt><code>sm_50</code> (Maxwell)</dt>
<dt><code>sm_60</code> (Pascal)</dt>
<dt><code>sm_70</code> (Volta)</dt>
<dt><code>sm_75</code> (Turing)</dt>
</dl>
</td>
</tr>
@ -1503,6 +1623,16 @@ target API.
</dl>
</td>
</tr>
<tr>
<td><code>CUDA_MPS_SUPPORT</code> (CUDA only)</td>
<td>Enable tweaks for running with Nvidia CUDA Multi-process services daemon</td>
<td>
<dl>
<dt><code>on</code></dt>
<dt><code>off</code> (default)</dt>
</dl>
</td>
</tr>
<tr>
<td><code>BIN2C</code> (CUDA only)</td>
<td>Path to bin2c executable, will automatically pick up the first one in your $PATH.</td>
@ -1511,13 +1641,14 @@ target API.
</tbody>
</table>
### VORONOI Package
### KIM Package
TODO
Requires installation of the KIM library with API v2
### USER-SMD Package
Requires a Eigen3 installation
If `DOWNLOAD_KIM` is set, the KIM library will be downloaded and built inside
the CMake build directory. If the KIM library is already on your system (in a
location CMake cannot find it), set the `PKG_CONFIG_PATH` environment variable
so that `libkim-api` can be found.
<table>
<thead>
@ -1528,9 +1659,323 @@ Requires a Eigen3 installation
</tr>
</thead>
<tbody>
<tr>
<td><code>DOWNLOAD_KIM</code></td>
<td>Download KIM API v2 and compile it as part of the build.</td>
<td>
<dl>
<dt><code>off</code> (default)</dt>
<dt><code>on</code></dt>
</dl>
</td>
</tr>
</tbody>
</table>
### MESSAGE Package
This package can optionally include support for messaging via sockets, using the open-source [ZeroMQ library](http://zeromq.org/), which must be installed on your system.
<table>
<thead>
<tr>
<th>Option</th>
<th>Description</th>
<th>Values</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>MESSAGE_ZMQ</code></td>
<td>Build with ZeroMQ support</td>
<td>
<dl>
<dt><code>off</code> (default)</dt>
<dt><code>on</code></dt>
</dl>
</td>
</tr>
<tr>
<td><code>ZMQ_LIBRARY</code></td>
<td>
ZMQ library file (only needed if at custom location)
</td>
<td>
</td>
</tr>
<tr>
<td><code>ZMG_INCLUDE_DIR</code></td>
<td>
Provide include directory of existing ZMQ installation (only needed if at custom location)
</td>
<td>
</td>
</tr>
</tbody>
</table>
### MSCG Package
Requires installation of the MSCG library
<table>
<thead>
<tr>
<th>Option</th>
<th>Description</th>
<th>Values</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>DOWNLOAD_MSCG</code></td>
<td>Download MSCG and compile it as part of the build</td>
<td>
<dl>
<dt><code>off</code> (default)</dt>
<dt><code>on</code></dt>
</dl>
</td>
</tr>
<tr>
<td><code>MSCG_LIBRARY</code></td>
<td>
MSCG library file (only needed if at custom location)
</td>
<td>
</td>
</tr>
<tr>
<td><code>MSCG_INCLUDE_DIR</code></td>
<td>
Provide include directory of existing MSCG installation (only needed if at custom location)
</td>
<td>
</td>
</tr>
</tbody>
</table>
### VORONOI Package
Requires installation of the Voro++ library
<table>
<thead>
<tr>
<th>Option</th>
<th>Description</th>
<th>Values</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>DOWNLOAD_VORO</code></td>
<td>Download Voro++ and compile it as part of the build</td>
<td>
<dl>
<dt><code>off</code> (default)</dt>
<dt><code>on</code></dt>
</dl>
</td>
</tr>
<tr>
<td><code>VORO_LIBRARY</code></td>
<td>
Voro++ library file (only needed if at custom location)
</td>
<td>
</td>
</tr>
<tr>
<td><code>VORO_INCLUDE_DIR</code></td>
<td>
Provide include directory of existing Voro++ installation (only needed if at custom location)
</td>
<td>
</td>
</tr>
</tbody>
</table>
### USER-LATTE Package
Requires installation of the LATTE library
<table>
<thead>
<tr>
<th>Option</th>
<th>Description</th>
<th>Values</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>DOWNLOAD_LATTE</code></td>
<td>Download LATTE and compile it as part of the build</td>
<td>
<dl>
<dt><code>off</code> (default)</dt>
<dt><code>on</code></dt>
</dl>
</td>
</tr>
<tr>
<td><code>LATTE_LIBRARY</code></td>
<td>
LATTE library file (only needed if at custom location)
</td>
<td>
</td>
</tr>
</tbody>
</table>
### USER-PLUMED Package
Requires installation of the PLUMED library
<table>
<thead>
<tr>
<th>Option</th>
<th>Description</th>
<th>Values</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>DOWNLOAD_PLUMED</code></td>
<td>Download PLUMED and compile it as part of the build</td>
<td>
<dl>
<dt><code>off</code> (default)</dt>
<dt><code>on</code></dt>
</dl>
</td>
</tr>
<tr>
<td><code>PLUMED_MODE</code></td>
<td>
Determines the linkage mode for the PLUMED library.
</td>
<td>
<dl>
<dt><code>static</code> (default)</dt>
<dt><code>shared</code></dt>
<dt><code>runtime</code></dt>
</dl>
</td>
</tr>
</tbody>
</table>
### USER-LATTE Package
Requires installation of the LATTE library
<table>
<thead>
<tr>
<th>Option</th>
<th>Description</th>
<th>Values</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>DOWNLOAD_LATTE</code></td>
<td>Download LATTE and compile it as part of the build</td>
<td>
<dl>
<dt><code>off</code> (default)</dt>
<dt><code>on</code></dt>
</dl>
</td>
</tr>
<tr>
<td><code>LATTE_LIBRARY</code></td>
<td>
LATTE library file (only needed if at custom location)
</td>
<td>
</td>
</tr>
</tbody>
</table>
### USER-SMD Package
Requires installation of the Eigen3 library
<table>
<thead>
<tr>
<th>Option</th>
<th>Description</th>
<th>Values</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>DOWNLOAD_EIGEN3</code></td>
<td>Download Eigen3 and compile it as part of the build</td>
<td>
<dl>
<dt><code>off</code> (default)</dt>
<dt><code>on</code></dt>
</dl>
</td>
</tr>
<tr>
<td><code>EIGEN3_INCLUDE_DIR</code></td>
<td></td>
<td>
Provide include directory of existing Eigen3 installation (only needed if at custom location)
</td>
<td>
</td>
</tr>
</tbody>
</table>
### USER-SCAFACOS Package
To build with this package, you must download and build the [ScaFaCoS Coulomb solver library](http://www.scafacos.de/)
<table>
<thead>
<tr>
<th>Option</th>
<th>Description</th>
<th>Values</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>DOWNLOAD_SCAFACOS</code></td>
<td>Download SCAFACOS and compile it as part of the build</td>
<td>
<dl>
<dt><code>off</code> (default)</dt>
<dt><code>on</code></dt>
</dl>
</td>
</tr>
<tr>
<td><code>SCAFACOS_LIBRARY</code></td>
<td>
SCAFACOS library file (only needed if at custom location)
</td>
<td>
</td>
</tr>
<tr>
<td><code>SCAFACOS_INCLUDE_DIR</code></td>
<td>
SCAFACOS include directory (only needed if at custom location)
</td>
<td>
</td>
</tr>
@ -1768,5 +2213,82 @@ cmake -D CMAKE_C_COMPILER=icc -D CMAKE_CXX_COMPILER=icpc -D CMAKE_Fortran_COMPIL
cmake -D CMAKE_C_COMPILER=clang -D CMAKE_CXX_COMPILER=clang++ -D CMAKE_Fortran_COMPILER=flang ../cmake
```
## LAMMPS Developer Options
## Examples
<table>
<thead>
<tr>
<th>Option</th>
<th>Description</th>
<th>Values</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>ENABLE_TESTING</code></td>
<td>Control wheather to add tests via CTest</td>
<td>
<dl>
<dt><code>off</code> (default)</dt>
<dt><code>on</code></dt>
</dl>
</td>
</tr>
<tr>
<td><code>LAMMPS_TESTING_SOURCE_DIR</code></td>
<td>Custom location of lammps-testing repository (optional). If not specified it will download it via Git</td>
<td>
</td>
</tr>
<tr>
<td><code>LAMMPS_TESTING_GIT_TAG</code></td>
<td>If lammps-testing repository is cloned, this is the tag/commit that will be checked out</td>
<td>
<dl>
<dt><code>master</code> (default)</dt>
</dl>
</td>
</tr>
<tr>
<td><code>ENABLE_COVERAGE</code></td>
<td>Enables code coverage support via gcov and adds a gcovr build target to generate a coverage report.</td>
<td>
<dl>
<dt><code>off</code> (default)</dt>
<dt><code>on</code></dt>
</dl>
</td>
</tr>
<tr>
<td><code>ENABLE_SANITIZE_ADDRESS</code></td>
<td>Enables Address Sanitizer support when compiling using GCC or Clang for detecting memory leaks in binaries while running them. See https://clang.llvm.org/docs/AddressSanitizer.html</td>
<td>
<dl>
<dt><code>off</code> (default)</dt>
<dt><code>on</code></dt>
</dl>
</td>
</tr>
<tr>
<td><code>ENABLE_SANITIZE_UNDEFINED</code></td>
<td>Enables Undefined Behavior Sanitizer support when compiling using GCC or Clang for detecting code that is running into undefined behavior of the language. See https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html</td>
<td>
<dl>
<dt><code>off</code> (default)</dt>
<dt><code>on</code></dt>
</dl>
</td>
</tr>
<tr>
<td><code>ENABLE_SANITIZE_THREAD</code></td>
<td>Enables Thread Sanitizer support when compiling using GCC or Clang for detecting data races in binaries while running them. See https://clang.llvm.org/docs/ThreadSanitizer.html</td>
<td>
<dl>
<dt><code>off</code> (default)</dt>
<dt><code>on</code></dt>
</dl>
</td>
</tr>
</tbody>
</table>

View File

@ -1,2 +1,4 @@
# set environment for LAMMPS executables to find potential files
if ( "$?LAMMPS_POTENTIALS" == 0 ) setenv LAMMPS_POTENTIALS @LAMMPS_POTENTIALS_DIR@
# set environment for LAMMPS and msi2lmp executables
# to find potential and force field files
if ( "$?LAMMPS_POTENTIALS" == 0 ) setenv LAMMPS_POTENTIALS @LAMMPS_INSTALL_DATADIR@/potentials
if ( "$?MSI2LMP_LIBRARY" == 0 ) setenv MSI2LMP_LIBRARY @LAMMPS_INSTALL_DATADIR@/frc_files

View File

@ -1,2 +1,5 @@
# set environment for LAMMPS executables to find potential files
export LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS-@LAMMPS_POTENTIALS_DIR@}
# set environment for LAMMPS and msi2lmp executables
# to find potential and force field files
LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS-@LAMMPS_INSTALL_DATADIR@/potentials}
MSI2LMP_LIBRARY=${MSI2LMP_LIBRARY-@LAMMPS_INSTALL_DATADIR@/frc_files}
export LAMMPS_POTENTIALS MSI2LMP_LIBRARY

View File

@ -1,21 +1,17 @@
set(STANDARD_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU
GRANULAR KIM KOKKOS KSPACE LATTE MANYBODY MC MEAM MISC
MOLECULE MPIIO MSCG OPT PERI POEMS
PYTHON QEQ REAX REPLICA RIGID SHOCK SNAP SRD VORONOI)
# preset that turns on all existing packages off. can be used to reset
# an existing package selection without losing any other settings
set(USER_PACKAGES USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS
USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD
USER-INTEL USER-LB USER-MANIFOLD USER-MEAMC USER-MESO
USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE
USER-NETCDF USER-OMP USER-PHONON USER-QMMM USER-QTB
USER-QUIP USER-REAXC USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY
USER-UEF USER-VTK)
set(PACKAGES_WITH_LIB COMPRESS GPU KIM KOKKOS LATTE MEAM MPIIO MSCG POEMS PYTHON REAX VORONOI
USER-ATC USER-AWPMD USER-COLVARS USER-H5MD USER-LB USER-MOLFILE
USER-NETCDF USER-PLUMED USER-QMMM USER-QUIP USER-SMD USER-VTK)
set(ALL_PACKAGES ${STANDARD_PACKAGES} ${USER_PACKAGES})
set(ALL_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU
GRANULAR KIM KOKKOS KSPACE LATTE MANYBODY MC MISC MESSAGE MOLECULE
MPIIO MSCG OPT PERI POEMS PYTHON QEQ REPLICA RIGID SHOCK SNAP SPIN
SRD VORONOI
USER-ADIOS USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK
USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP
USER-H5MD USER-INTEL USER-LB USER-MANIFOLD USER-MEAMC USER-MESO
USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF USER-OMP
USER-PHONON USER-PLUMED USER-PTM USER-QMMM USER-QTB USER-QUIP
USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ USER-SPH
USER-TALLY USER-UEF USER-VTK USER-YAFF)
foreach(PKG ${ALL_PACKAGES})
set(PKG_${PKG} OFF CACHE BOOL "" FORCE)

View File

@ -1,21 +1,19 @@
set(STANDARD_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU
GRANULAR KIM KOKKOS KSPACE LATTE MANYBODY MC MEAM MISC
MOLECULE MPIIO MSCG OPT PERI POEMS
PYTHON QEQ REAX REPLICA RIGID SHOCK SNAP SRD VORONOI)
# preset that turns on all existing packages. using the combination
# this preset followed by the nolib.cmake preset should configure a
# LAMMPS binary, with as many packages included, that can be compiled
# with just a working C++ compiler and an MPI library.
set(USER_PACKAGES USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS
USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD
USER-INTEL USER-LB USER-MANIFOLD USER-MEAMC USER-MESO
USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE
USER-NETCDF USER-OMP USER-PHONON USER-QMMM USER-QTB
USER-QUIP USER-REAXC USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY
USER-UEF USER-VTK)
set(PACKAGES_WITH_LIB COMPRESS GPU KIM KOKKOS LATTE MEAM MPIIO MSCG POEMS PYTHON REAX VORONOI
USER-ATC USER-AWPMD USER-COLVARS USER-H5MD USER-LB USER-MOLFILE
USER-NETCDF USER-PLUMED USER-QMMM USER-QUIP USER-SMD USER-VTK)
set(ALL_PACKAGES ${STANDARD_PACKAGES} ${USER_PACKAGES})
set(ALL_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU
GRANULAR KIM KOKKOS KSPACE LATTE MANYBODY MC MISC MESSAGE MOLECULE
MPIIO MSCG OPT PERI POEMS PYTHON QEQ REPLICA RIGID SHOCK SNAP SPIN
SRD VORONOI
USER-ADIOS USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK
USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP
USER-H5MD USER-INTEL USER-LB USER-MANIFOLD USER-MEAMC USER-MESO
USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF USER-OMP
USER-PHONON USER-PLUMED USER-PTM USER-QMMM USER-QTB USER-QUIP
USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ USER-SPH
USER-TALLY USER-UEF USER-VTK USER-YAFF)
foreach(PKG ${ALL_PACKAGES})
set(PKG_${PKG} ON CACHE BOOL "" FORCE)

17
cmake/presets/clang.cmake Normal file
View File

@ -0,0 +1,17 @@
# preset that will enable clang/clang++ with support for MPI and OpenMP (on Linux boxes)
set(CMAKE_CXX_COMPILER "clang++" CACHE STRING "" FORCE)
set(CMAKE_C_COMPILER "clang" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS "-Wall -Wextra -g -O2 -DNDEBG" CACHE STRING "" FORCE)
set(MPI_CXX "clang++" CACHE STRING "" FORCE)
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
unset(HAVE_OMP_H_INCLUDE CACHE)
set(OpenMP_C "clang" CACHE STRING "" FORCE)
set(OpenMP_C_FLAGS "-fopenmp" CACHE STRING "" FORCE)
set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE)
set(OpenMP_CXX "clang++" CACHE STRING "" FORCE)
set(OpenMP_CXX_FLAGS "-fopenmp" CACHE STRING "" FORCE)
set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "" FORCE)
set(OpenMP_omp_LIBRARY "/usr/lib64/libomp.so" CACHE PATH "" FORCE)

View File

@ -1,71 +0,0 @@
set(PKG_ASPHERE OFF CACHE BOOL "" FORCE)
set(PKG_BODY OFF CACHE BOOL "" FORCE)
set(PKG_CLASS2 OFF CACHE BOOL "" FORCE)
set(PKG_COLLOID OFF CACHE BOOL "" FORCE)
set(PKG_COMPRESS OFF CACHE BOOL "" FORCE)
set(PKG_CORESHELL OFF CACHE BOOL "" FORCE)
set(PKG_DIPOLE OFF CACHE BOOL "" FORCE)
set(PKG_GPU OFF CACHE BOOL "" FORCE)
set(PKG_GRANULAR OFF CACHE BOOL "" FORCE)
set(PKG_KIM OFF CACHE BOOL "" FORCE)
set(PKG_KOKKOS OFF CACHE BOOL "" FORCE)
set(PKG_KSPACE OFF CACHE BOOL "" FORCE)
set(PKG_LATTE OFF CACHE BOOL "" FORCE)
set(PKG_LIB OFF CACHE BOOL "" FORCE)
set(PKG_MANYBODY OFF CACHE BOOL "" FORCE)
set(PKG_MC OFF CACHE BOOL "" FORCE)
set(PKG_MEAM OFF CACHE BOOL "" FORCE)
set(PKG_MISC OFF CACHE BOOL "" FORCE)
set(PKG_MOLECULE OFF CACHE BOOL "" FORCE)
set(PKG_MPIIO OFF CACHE BOOL "" FORCE)
set(PKG_MSCG OFF CACHE BOOL "" FORCE)
set(PKG_OPT OFF CACHE BOOL "" FORCE)
set(PKG_PERI OFF CACHE BOOL "" FORCE)
set(PKG_POEMS OFF CACHE BOOL "" FORCE)
set(PKG_PYTHOFF OFF CACHE BOOL "" FORCE)
set(PKG_QEQ OFF CACHE BOOL "" FORCE)
set(PKG_REAX OFF CACHE BOOL "" FORCE)
set(PKG_REPLICA OFF CACHE BOOL "" FORCE)
set(PKG_RIGID OFF CACHE BOOL "" FORCE)
set(PKG_SHOCK OFF CACHE BOOL "" FORCE)
set(PKG_SNAP OFF CACHE BOOL "" FORCE)
set(PKG_SRD OFF CACHE BOOL "" FORCE)
set(PKG_VOROFFOI OFF CACHE BOOL "" FORCE)
set(PKG_USER OFF CACHE BOOL "" FORCE)
set(PKG_USER-ATC OFF CACHE BOOL "" FORCE)
set(PKG_USER-AWPMD OFF CACHE BOOL "" FORCE)
set(PKG_USER-BOCS OFF CACHE BOOL "" FORCE)
set(PKG_USER-CGDNA OFF CACHE BOOL "" FORCE)
set(PKG_USER-CGSDK OFF CACHE BOOL "" FORCE)
set(PKG_USER-COLVARS OFF CACHE BOOL "" FORCE)
set(PKG_USER-DIFFRACTIOFF OFF CACHE BOOL "" FORCE)
set(PKG_USER-DPD OFF CACHE BOOL "" FORCE)
set(PKG_USER-DRUDE OFF CACHE BOOL "" FORCE)
set(PKG_USER-EFF OFF CACHE BOOL "" FORCE)
set(PKG_USER-FEP OFF CACHE BOOL "" FORCE)
set(PKG_USER-H5MD OFF CACHE BOOL "" FORCE)
set(PKG_USER-INTEL OFF CACHE BOOL "" FORCE)
set(PKG_USER-LB OFF CACHE BOOL "" FORCE)
set(PKG_USER-MANIFOLD OFF CACHE BOOL "" FORCE)
set(PKG_USER-MEAMC OFF CACHE BOOL "" FORCE)
set(PKG_USER-MESO OFF CACHE BOOL "" FORCE)
set(PKG_USER-MGPT OFF CACHE BOOL "" FORCE)
set(PKG_USER-MISC OFF CACHE BOOL "" FORCE)
set(PKG_USER-MOFFF OFF CACHE BOOL "" FORCE)
set(PKG_USER-MOLFILE OFF CACHE BOOL "" FORCE)
set(PKG_USER-NETCDF OFF CACHE BOOL "" FORCE)
set(PKG_USER-OMP OFF CACHE BOOL "" FORCE)
set(PKG_USER-PHONON OFF CACHE BOOL "" FORCE)
set(PKG_USER-PLUMED OFF CACHE BOOL "" FORCE)
set(PKG_USER-QMMM OFF CACHE BOOL "" FORCE)
set(PKG_USER-QTB OFF CACHE BOOL "" FORCE)
set(PKG_USER-QUIP OFF CACHE BOOL "" FORCE)
set(PKG_USER-REAXC OFF CACHE BOOL "" FORCE)
set(PKG_USER-SDPD OFF CACHE BOOL "" FORCE)
set(PKG_USER-SMD OFF CACHE BOOL "" FORCE)
set(PKG_USER-SMTBQ OFF CACHE BOOL "" FORCE)
set(PKG_USER-SPH OFF CACHE BOOL "" FORCE)
set(PKG_USER-TALLY OFF CACHE BOOL "" FORCE)
set(PKG_USER-UEF OFF CACHE BOOL "" FORCE)
set(PKG_USER-VTK OFF CACHE BOOL "" FORCE)

View File

@ -0,0 +1,17 @@
set(WIN_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU
GRANULAR KSPACE MANYBODY MC MISC MOLECULE OPT PERI POEMS QEQ
REPLICA RIGID SHOCK SNAP SPIN SRD VORONOI USER-ATC USER-AWPMD
USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS USER-DIFFRACTION
USER-DPD USER-DRUDE USER-EFF USER-FEP USER-INTEL USER-MANIFOLD
USER-MEAMC USER-MESO USER-MISC USER-MGPT USER-MOFFF USER-MOLFILE
USER-OMP USER-PHONON USER-PTM USER-QTB USER-REAXC USER-SDPD
USER-SMD USER-SMTBQ USER-SPH USER-TALLY USER-UEF USER-YAFF)
foreach(PKG ${WIN_PACKAGES})
set(PKG_${PKG} ON CACHE BOOL "" FORCE)
endforeach()
set(DOWNLOAD_VORO ON CACHE BOOL "" FORCE)
set(DOWNLOAD_EIGEN3 ON CACHE BOOL "" FORCE)
set(LAMMPS_MEMALIGN "0" CACHE STRING "" FORCE)
set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/lammps-installer")

View File

@ -0,0 +1,8 @@
# preset that turns on just a few, frequently used packages
# this will be compiled quickly and handle a lot of common inputs.
set(ALL_PACKAGES KSPACE MANYBODY MOLECULE RIGID)
foreach(PKG ${ALL_PACKAGES})
set(PKG_${PKG} ON CACHE BOOL "" FORCE)
endforeach()

15
cmake/presets/most.cmake Normal file
View File

@ -0,0 +1,15 @@
# preset that turns on a wide range of packages, some of which require
# external libraries. Compared to all_on.cmake some more unusual packages
# are removed. The resulting binary should be able to run most inputs.
set(ALL_PACKAGES ASPHERE CLASS2 COLLOID CORESHELL DIPOLE
GRANULAR KSPACE MANYBODY MC MISC MOLECULE OPT PERI
PYTHON QEQ REPLICA RIGID SHOCK SRD VORONOI
USER-CGDNA USER-CGSDK USER-COLVARS USER-DIFFRACTION USER-DPD
USER-DRUDE USER-FEP USER-MEAMC USER-MESO
USER-MISC USER-MOFFF USER-OMP USER-PLUMED USER-PHONON USER-REAXC
USER-SPH USER-SMD USER-UEF USER-YAFF)
foreach(PKG ${ALL_PACKAGES})
set(PKG_${PKG} ON CACHE BOOL "" FORCE)
endforeach()

View File

@ -1,21 +1,10 @@
set(STANDARD_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU
GRANULAR KIM KOKKOS KSPACE LATTE MANYBODY MC MEAM MISC
MOLECULE MPIIO MSCG OPT PERI POEMS
PYTHON QEQ REAX REPLICA RIGID SHOCK SNAP SRD VORONOI)
# preset that turns off all packages that require some form of external
# library or special compiler (fortran or cuda) or equivalent.
set(USER_PACKAGES USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS
USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD
USER-INTEL USER-LB USER-MANIFOLD USER-MEAMC USER-MESO
USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE
USER-NETCDF USER-OMP USER-PHONON USER-QMMM USER-QTB
USER-QUIP USER-REAXC USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY
USER-UEF USER-VTK)
set(PACKAGES_WITH_LIB COMPRESS GPU KIM KOKKOS LATTE MEAM MPIIO MSCG POEMS PYTHON REAX VORONOI
USER-ATC USER-AWPMD USER-COLVARS USER-H5MD USER-LB USER-MOLFILE
USER-NETCDF USER-PLUMED USER-QMMM USER-QUIP USER-SMD USER-VTK)
set(ALL_PACKAGES ${STANDARD_PACKAGES} ${USER_PACKAGES})
set(PACKAGES_WITH_LIB COMPRESS GPU KIM KOKKOS LATTE MPIIO MSCG PYTHON
VORONOI USER-ADIOS USER-ATC USER-AWPMD USER-H5MD USER-LB
USER-MOLFILE USER-NETCDF USER-PLUMED USER-QMMM USER-QUIP
USER-SCAFACOS USER-SMD USER-VTK)
foreach(PKG ${PACKAGES_WITH_LIB})
set(PKG_${PKG} OFF CACHE BOOL "" FORCE)

View File

@ -1,22 +0,0 @@
set(STANDARD_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU
GRANULAR KIM KOKKOS KSPACE LATTE MANYBODY MC MEAM MISC
MOLECULE MPIIO MSCG OPT PERI POEMS
PYTHON QEQ REAX REPLICA RIGID SHOCK SNAP SRD VORONOI)
set(USER_PACKAGES USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS
USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD
USER-INTEL USER-LB USER-MANIFOLD USER-MEAMC USER-MESO
USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE
USER-NETCDF USER-OMP USER-PHONON USER-QMMM USER-QTB
USER-QUIP USER-REAXC USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY
USER-UEF USER-VTK)
set(PACKAGES_WITH_LIB COMPRESS GPU KIM KOKKOS LATTE MEAM MPIIO MSCG POEMS PYTHON REAX VORONOI
USER-ATC USER-AWPMD USER-COLVARS USER-H5MD USER-LB USER-MOLFILE
USER-NETCDF USER-QMMM USER-QUIP USER-SMD USER-VTK)
set(ALL_PACKAGES ${STANDARD_PACKAGES} ${USER_PACKAGES})
foreach(PKG ${STANDARD_PACKAGES})
set(PKG_${PKG} ON CACHE BOOL "" FORCE)
endforeach()

View File

@ -1,26 +0,0 @@
set(STANDARD_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU
GRANULAR KIM KOKKOS KSPACE LATTE MANYBODY MC MEAM MISC
MOLECULE MPIIO MSCG OPT PERI POEMS
PYTHON QEQ REAX REPLICA RIGID SHOCK SNAP SRD VORONOI)
set(USER_PACKAGES USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS
USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD
USER-INTEL USER-LB USER-MANIFOLD USER-MEAMC USER-MESO
USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE
USER-NETCDF USER-OMP USER-PHONON USER-QMMM USER-QTB
USER-QUIP USER-REAXC USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY
USER-UEF USER-VTK)
set(PACKAGES_WITH_LIB COMPRESS GPU KIM KOKKOS LATTE MEAM MPIIO MSCG POEMS PYTHON REAX VORONOI
USER-ATC USER-AWPMD USER-COLVARS USER-H5MD USER-LB USER-MOLFILE
USER-NETCDF USER-QMMM USER-QUIP USER-SMD USER-VTK)
set(ALL_PACKAGES ${STANDARD_PACKAGES} ${USER_PACKAGES})
foreach(PKG ${STANDARD_PACKAGES})
set(PKG_${PKG} ON CACHE BOOL "" FORCE)
endforeach()
foreach(PKG ${PACKAGES_WITH_LIB})
set(PKG_${PKG} OFF CACHE BOOL "" FORCE)
endforeach()

View File

@ -1,22 +0,0 @@
set(STANDARD_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU
GRANULAR KIM KOKKOS KSPACE LATTE MANYBODY MC MEAM MISC
MOLECULE MPIIO MSCG OPT PERI POEMS
PYTHON QEQ REAX REPLICA RIGID SHOCK SNAP SRD VORONOI)
set(USER_PACKAGES USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS
USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD
USER-INTEL USER-LB USER-MANIFOLD USER-MEAMC USER-MESO
USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE
USER-NETCDF USER-OMP USER-PHONON USER-QMMM USER-QTB
USER-QUIP USER-REAXC USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY
USER-UEF USER-VTK)
set(PACKAGES_WITH_LIB COMPRESS GPU KIM KOKKOS LATTE MEAM MPIIO MSCG POEMS PYTHON REAX VORONOI
USER-ATC USER-AWPMD USER-COLVARS USER-H5MD USER-LB USER-MOLFILE
USER-NETCDF USER-PLUMED USER-QMMM USER-QUIP USER-SMD USER-VTK)
set(ALL_PACKAGES ${STANDARD_PACKAGES} ${USER_PACKAGES})
foreach(PKG ${USER_PACKAGES})
set(PKG_${PKG} ON CACHE BOOL "" FORCE)
endforeach()

1
doc/.gitignore vendored
View File

@ -1,3 +1,4 @@
/old
/html
/latex
/spelling

View File

@ -39,7 +39,7 @@ help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html create HTML doc pages in html dir"
@echo " pdf create Developer.pdf and Manual.pdf in this dir"
@echo " old create old-style HTML doc pages in old dir"
@echo " old create old-style HTML doc pages and Manual.pdf in old dir"
@echo " fetch fetch HTML and PDF files from LAMMPS web site"
@echo " epub create ePUB format manual for e-book readers"
@echo " mobi convert ePUB to MOBI format manual for e-book readers (e.g. Kindle)"
@ -56,7 +56,7 @@ clean-all: clean
rm -rf $(BUILDDIR)/* utils/txt2html/txt2html.exe
clean:
rm -rf $(RSTDIR) html old epub
rm -rf $(RSTDIR) html old epub latex
rm -rf spelling
clean-spelling:
@ -115,21 +115,44 @@ mobi: epub
@ebook-convert LAMMPS.epub LAMMPS.mobi
@echo "Conversion finished. The MOBI manual file is created."
pdf: utils/txt2html/txt2html.exe
pdf: $(OBJECTS) $(ANCHORCHECK)
@(\
set -e; \
cd src/Developer; \
pdflatex developer; \
pdflatex developer; \
mv developer.pdf ../../Developer.pdf; \
cd ..; \
../utils/txt2html/txt2html.exe -b *.txt; \
htmldoc --batch lammps.book; \
for s in `echo *.txt | sed -e 's/ \(pairs\|bonds\|angles\|dihedrals\|impropers\|commands_list\|fixes\|computes\).txt/ /g' | sed -e 's,\.txt,\.html,g'` ; \
do grep -q ^$$s lammps.book || \
echo WARNING: doc file $$s missing in src/lammps.book; done; \
rm *.html; \
cd ../../; \
)
@(\
. $(VENV)/bin/activate ;\
cp -r src/* $(RSTDIR)/ ;\
sphinx-build $(SPHINXEXTRA) -b latex -c utils/sphinx-config -d $(BUILDDIR)/doctrees $(RSTDIR) latex ;\
echo "############################################" ;\
doc_anchor_check src/*.txt ;\
echo "############################################" ;\
deactivate ;\
)
@cd latex && \
sed 's/latexmk -pdf -dvi- -ps-/pdflatex/g' Makefile > temp && \
mv temp Makefile && \
sed 's/\\begin{equation}//g' LAMMPS.tex > tmp.tex && \
mv tmp.tex LAMMPS.tex && \
sed 's/\\end{equation}//g' LAMMPS.tex > tmp.tex && \
mv tmp.tex LAMMPS.tex && \
make && \
make && \
mv LAMMPS.pdf ../Manual.pdf && \
cd ../;
@rm -rf latex/_sources
@rm -rf latex/PDF
@rm -rf latex/USER
@cp -r src/PDF latex/PDF
@cp -r src/USER latex/USER
@rm -rf latex/PDF/.[sg]*
@rm -rf latex/USER/.[sg]*
@rm -rf latex/USER/*/.[sg]*
@rm -rf latex/USER/*/*.[sg]*
@echo "Build finished. Manual.pdf and Developer.pdf are in this directory."
old: utils/txt2html/txt2html.exe
@rm -rf old
@ -139,6 +162,18 @@ old: utils/txt2html/txt2html.exe
cp Eqs/*.jpg ../old/Eqs; \
cp JPG/* ../old/JPG; \
cp PDF/* ../old/PDF;
@( set -e;\
cd src/Developer; \
pdflatex developer; \
pdflatex developer; \
mv developer.pdf ../../old/Developer.pdf; \
cd ../../old; \
for s in `echo ../src/*.txt | sed -e 's,\.\./src/,,g' -e 's/ \(pairs\|bonds\|angles\|dihedrals\|impropers\|commands_list\|fixes\|computes\).txt/ /g' | sed -e 's,\.txt,\.html,g'` ; \
do grep -q ^$$s ../src/lammps.book || \
echo WARNING: doc file $$s missing in src/lammps.book; done; \
htmldoc --batch ../src/lammps.book; \
)
fetch:
@rm -rf html_www Manual_www.pdf Developer_www.pdf

View File

@ -0,0 +1,133 @@
# Outline of include file conventions in LAMMPS
This purpose of this document is to provide a point of reference
for LAMMPS developers and contributors as to what include files
and definitions to put where into LAMMPS source.
Last change 2019-07-05
## Table of Contents
* [Motivation](#motivation)
* [Rules](#rules)
* [Tools](#tools)
* [Legacy Code](#legacy-code)
## Motivation
The conventions outlined in this document are supposed to help make
maintenance of the LAMMPS software easier. By trying to achieve
consistency across files contributed by different developers, it will
become easier for the code maintainers to modify and adjust files and,
overall, the chance for errors or portability issues will be reduced.
The rules employed are supposed to minimize naming conflicts and
simplify dependencies between files and thus speed up compilation. They
may, as well, make otherwise hidden dependencies visible.
## Rules
Below are the various rules that are applied. Not all are enforced
strictly and automatically. If there are no significant side effects,
exceptions may be possible for cases where a full compliance to the
rules may require a large effort compared to the benefit.
### Core Files Versus Package Files
All rules listed below are most strictly observed for core LAMMPS files,
which are the files that are not part of a package, and the files of the
packages MOLECULE, MANYBODY, KSPACE, and RIGID. On the other end of
the spectrum are USER packages and legacy packages that predate these
rules and thus may not be fully compliant. Also, new contributions
will be checked more closely, while existing code will be incrementally
adapted to the rules as time and required effort permits.
### System Versus Local Header Files
All system- or library-provided include files are included with angular
brackets (examples: `#include <cstring>` or `#include <mpi.h>`) while
include files provided with LAMMPS are included with double quotes
(examples: `#include "pointers.h"` or `#include "compute_temp.h"`).
For headers declaring functions of the C-library, the corresponding
C++ versions should be included (examples: `#include <cstdlib>` or
`#include <cctypes>`). However, these includes are limited to those defined
in the C++98 standard. Some files thus must use the older style until
the minimum C++ standard requirement of LAMMPS is lifted to C++11 or
even beyond (examples: `#include <stdint.h>` versus `#include <cstdint>`
or `#include <inttypes.h>` versus `#include <cinttypes>`).
### C++ Standard Compliance
LAMMPS core files currently correspond to the C++98 standard. Files
requiring C++11 or later are only permitted in (optional) packages
and particularly packages that are not part of the list of commonly
used packages such as MOLECULE, KSPACE, MANYBODY, or RIGID.
Also, LAMMPS uses the C-style stdio library for I/O instead of iostreams.
Since using both at the same time can cause problems, iostreams should
be avoided where possible.
### Lean Header Files
Header files will typically contain the definition of a (single) class.
These header files should have as few include statements as possible.
This is particularly important for classes that implement a "style" and
thus use a macro of the kind `SomeStyle(some/name,SomeName)`. These will
all be included in the auto-generated `"some_style.h"` files which
results in a high potential for direct or indirect symbol name clashes.
In the ideal case, the header would only include one file defining the
parent class. That would typically be either `#include "pointers.h"` for
the `Pointers` class, or a header of a class derived from it like
`#include "pair.h"` for the `Pair` class and so on. References to other
classes inside the class should be make through pointers, for which forward
declarations (inside the `LAMMPS_NS` or the new class' namespace) can
be employed. The full definition will then be included into the corresponding
implementation file. In the given example from above, the header file
would be called `some_name.h` and the implementation `some_name.cpp` (all
lower case with underscores, while the class itself would be in camel case
and no underscores `SomeName`, and the style name with lower case names separated by
a forward slash).
### Implementation Files
In the implementation files (typically, those would have the same base name
as the corresponding header with a .cpp extension instead of .h) include
statements should follow the "include what you use" principle.
### Order of Include Statements
Include files should be included in this order:
* the header matching the implementation (`some_class.h` for file `some_class.cpp`)
* mpi.h
* system and library headers (anything that is using angular brackets; C-library headers first, then C++)
* LAMMPS local headers (preferably in alphabetical order)
### Special Cases and Exceptions
#### pointers.h
The `pointer.h` header file also includes `cstdio` and `lmptype.h`
(and through it `stdint.h`, `intttypes.h`, cstdlib, and `climits`).
This means any header including `pointers.h` can assume that `FILE`,
`NULL`, `INT_MAX` are defined.
## Tools
The [Include What You Use tool](https://include-what-you-use.org/)
can be used to provide supporting information about compliance with
the rules listed here. There are some limitations and the IWYU tool
may give incorrect advice. The tools is activated by setting the
CMake variable `CMAKE_CXX_INCLUDE_WHAT_YOU_USE` variable to the
path of the `include-what-you-use` command. When activated, the
tool will be run after each compilation and provide suggestions for
which include files should be added or removed.
## Legacy Code
A lot of code predates the application of the rules in this document
and the rules themselves are a moving target. So there are going to be
significant chunks of code that do not fully comply. This applies
for example to the USER-REAXC, or the USER-ATC package. The LAMMPS
developers are dedicated to make an effort to improve the compliance
and welcome volunteers wanting to help with the process.

View File

@ -1,40 +1,259 @@
.TH LAMMPS "2018-08-22"
.TH LAMMPS "7 August 2019" "2019-08-07"
.SH NAME
.B LAMMPS
\- Molecular Dynamics Simulator.
.SH SYNOPSIS
.B lmp
-in in.file
.B lmp
\-in <input file> [OPTIONS] ...
or
mpirun \-np 2
.B lmp
-in in.file
mpirun \-np 2
.B lmp
<input file> [OPTIONS] ...
or
.B lmp
\-r2data file.restart file.data
.SH DESCRIPTION
.B LAMMPS
LAMMPS is a classical molecular dynamics code, and an acronym for Large-scale
Atomic/Molecular Massively Parallel Simulator. LAMMPS has potentials for soft
materials (biomolecules, polymers) and solid-state materials (metals,
semiconductors) and coarse-grained or mesoscopic systems. It can be used to
model atoms or, more generically, as a parallel particle simulator at the
.B LAMMPS
is a classical molecular dynamics code, and an acronym for \fBL\fRarge-scale
\fBA\fRtomic/\fBM\fRolecular \fBM\fRassively \fBP\fRarallel \fBS\fRimulator.
.B LAMMPS
has potentials for soft
materials (bio-molecules, polymers) and solid-state materials (metals,
semiconductors) and coarse-grained or mesoscopic systems. It can be used to
model atoms or, more generically, as a parallel particle simulator at the
atomic, meso, or continuum scale.
See http://lammps.sandia.gov/ for documentation.
See https://lammps.sandia.gov/ for more information and documentation.
.SH EXECUTABLE NAME
The
.B LAMMPS
executable can have different names depending on how it was configured,
compiled and installed. It will be either
.B lmp
or
.B lmp_<machine name>.
The <machine name> suffix corresponds to the (machine specific) makefile
used to compile
.B LAMMPS
when using the conventional build process. When building
.B LAMMPS
using
.B CMake
this <machine name> parameter can be chosen arbitrarily at configuration
time, but more common is to just use
.B lmp
without a suffix. In this manpage we will use
.B lmp
to represent any of those names.
.SH OPTIONS
See https://lammps.sandia.gov/doc/Run_options.html for details on
command-line options.
.SH COPYRIGHT
© 2003--2018 Sandia Corporation
.TP
\fB\-h\fR or \fB\-help\fR
Print a brief help summary and a list of settings and options compiled
into this executable. It also explicitly lists all LAMMPS styles
(atom_style, fix, compute, pair_style, bond_style, etc) available in
the specific executable. This can tell you if the command you want to
use was included via the appropriate package at compile time.
LAMMPS will print the info and immediately exit if this switch is used.
.TP
\fB\-e\fR or \fB\-echo\fR
Set the style of command echoing. The style can be
.B none
or
.B screen
or
.B log
or
.B both.
Depending on the style, each command read from the input script will
be echoed to the screen and/or logfile. This can be useful to figure
out which line of your script is causing an input error.
The default value is
.B log.
.TP
\fB\-i <input file>\fR or \fB\-in <input file>\fR
Specify a file to use as an input script. If it is not specified,
LAMMPS reads its script from standard input. This is a required
switch when running LAMMPS in multi-partition mode.
.TP
\fB\-k on/off [keyword value]\fR or \fB\-kokkos on/off [keyword value]\fR
Enable or disable general KOKKOS support, as provided by the KOKKOS
package. Even if LAMMPS is built with this package, this switch must
be set to \fBon\fR to enable running with KOKKOS-enabled styles. More
details on this switch and its optional keyword value pairs are discussed
at: https://lammps.sandia.gov/doc/Run_options.html
.TP
\fB\-l <log file>\fR or \fB\-log <log file>\fR
Specify a log file for LAMMPS to write status information to.
The default value is "log.lammps". If the file name "none" is used,
\fBLAMMPS\fR will not write a log file. In multi-partition mode only
some high-level all-partition information is written to the "<log file>"
file, the remainder is written in a per-partition file "<log file>.N"
with "N" being the respective partition number, unless overridden
by the \-plog flag (see below).
.TP
\fB\-m <number>\fR or \fB\-mpicolor <number>\fR
If used, this must be the first command-line argument after the
.B LAMMPS
executable name. It is only used when
.B LAMMPS
is launched by an mpirun command which also launches one or more
other executable(s) at the same time.
.B LAMMPS
and the other executable(s) perform an MPI_Comm_split(), each with
their own different colors, to split the MPI_COMM_WORLD communicator
for each executable to the subset of processors they are supposed to
be actually running on. Currently, this is only used in
.B LAMMPS
to perform client/server messaging with another application.
.B LAMMPS
can act as either a client or server (or both).
.TP
\fB\-nc\fR or \fB\-nocite\fR
Disable writing the "log.cite" file which is normally written to
list references for specific cite-able features used during a
.B LAMMPS
run.
.TP
\fB\-pk <style> [options]\fR or \fB\-package <style> [options]\fR
Invoke the \fBpackage\R command with <style> and optional arguments.
The syntax is the same as if the command appeared in an input script.
For example "-pk gpu 2" is the same as "package gpu 2" in the input
script. The possible styles and options are discussed in the
.B LAMMPS
manual for the "package" command. This switch can be used multiple
times, e.g. to set options for the USER-INTEL and USER-OMP packages
when used together. Along with the "-sf" or "-suffix" switch, this
is a convenient mechanism for invoking accelerator packages and their
options without having to edit an input script.
.TP
\fB\-p\fR or \fB\-partition\fR
Invoke
.B LAMMPS
in multi-partition mode. Without this,
.B LAMMPS
uses all P processors allocated via MPI to run a single simulation.
If this switch is used, the P processors are split into separate
partitions and each partition runs its own simulation. The arguments
to the switch specify the number of processors in each partition.
Arguments of the form "MxN" mean M partitions, each with N processors.
Arguments of the form "N" mean a single partition with N processors.
The sum of processors in all partitions must be equal P. Thus the
command “-partition 8x2 4 5” has 10 partitions and runs on a total
of 25 processors. Running with multiple partitions is required for
multi-replica simulations, where each replica runs on on one or more
few processors.
.TP
\fB\-pl <basename>\fR or \fB\-plog <basename>\fR
Specify the base name for the per-partition log files in multi-partition
runs, where partition N writes log information to <basename>.N.
If basename is set to "none", then no per-partition log files are created.
This overrides the name specified in the \-log command-line option.
.TP
\fB\-ps <basename>\fR or \fB\-pscreen <basename>\fR
Specify the base name for the per-partition screen files in multi-partition
runs, where partition N writes screen output to <basename>.N.
If basename is set to "none", then no per-partition screen files are created.
The default value is "screen" or whatever is set by the \-screen flag.
.TP
\fB\-r2data <restart file> [remap] <data file>\fR or
\fB\-restart2data <restart file> [remap] <data file>\fR
Convert <restart file> previously written by
.B LAMMPS
into a data file and immediately exit. This option has replaced the
external restart2data executable. Following <restart file>
argument, the optional word "remap" may be used. This has the
same effect like adding it to a "read_restart" command.
The syntax following the <data file> name is identical to the
arguments of the "write_data" command. See the
.B LAMMPS
manual for details on either of the two commands.
.TP
\fB\-r2dump <restart file> [remap] <dump file>\fR or
\fB\-restart2dump <restart file> [remap] <dump file>\fR
Convert <restart file> previously written by
.B LAMMPS
into a dump file and immediately exit. Following <restart file>
argument, the optional word "remap" may be used. This has the
same effect like adding it to a "read_restart" command.
The syntax following the <dump file> name is identical to the
arguments of the "dump" command. See the
.B LAMMPS
manual for details on either of the two commands.
.TP
\fB\-sc <file name>\fR or \fB\-screen <file name>\fR
Specify a file for
.B LAMMPS
to write its screen information to. By default, this will be
the standard output. If <file name> is "none", (most) screen
output will be suppressed. In multi-partition mode only
some high-level all-partition information is written to the
screen or "<file name>" file, the remainder is written in a
per-partition file "screen.N" or "<file name>.N"
with "N" being the respective partition number, and unless
overridden by the \-pscreen flag (see above).
.TP
\fB\-sf <suffix>\fR or \fB\-suffix <suffix>\fR
Use variants of various styles in the input, if they exist. This is
achieved by transparently trying to convert a style named <my/style>
into <my/style/suffix> if that latter style exists, but otherwise
fall back to the former. The most useful suffixes are "gpu",
"intel", "kk", "omp", "opt", or "hybrid". These refer to styles from
optional packages that LAMMPS can be built with. The hybrid suffix is
special, as it enables, having two suffixes tried (e.g. first "intel"
and then "omp") and thus requires two arguments. Along with the
"-package" command-line switch, this is a convenient mechanism for
invoking styles from accelerator packages and setting their options
without having to edit an input script.
See https://lammps.sandia.gov/doc/Run_options.html for additional
details and discussions on command-line options.
.SH LAMMPS BASICS
LAMMPS executes by reading commands from a input script (text file),
one line at a time. When the input script ends, LAMMPS exits. Each
command causes LAMMPS to take some action. It may set or change an
internal, read and parse a file, or run a simulation. Most commands
have default settings, which means you only need to use the command
if you wish to change the default.
The ordering of commands in an input script is usually not very important
unless a command like "run" is encountered, which starts some calculation
using the current internal state. Also, if a "pair_style" or "bond_style"
other similar style command is issued that has a different name from what
was previously active, it will replace the previous style and wipe out
all corresponding "pair_coeff" or "bond_coeff" or equivalent settings.
Some commands are only valid when they follow other commands. For
example you cannot set the temperature of a group of atoms until atoms
have been defined and a group command is used to define which atoms
belong to the group of a given name. Sometimes command B will use values
that can be set by command A. This means command A must precede command
B in the input to have the desired effect. Some commands must be issued
.B before
the simulation box is defined and others can only be issued
.B after.
Many input script errors are detected by
.B LAMMPS
and an ERROR or WARNING message is printed. The documentation for
each command lists restrictions on how the command can be used, and
the chapter on errors in the
.B LAMMPS
manual gives some additional information about error messages, if possible.
.SH COPYRIGHT
© 2003--2019 Sandia Corporation
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of

111
doc/msi2lmp.1 Normal file
View File

@ -0,0 +1,111 @@
.TH MSI2LMP "v3.9.9" "2018-11-05"
.SH NAME
.B MSI2LMP
\- Converter for Materials Studio files to LAMMPS
.SH SYNOPSIS
.B msi2lmp
<ROOTNAME> [-class <I|1|II|2|O|0>] [-frc <path to frc file>] [-print #] [-ignore] [-nocenter] [-oldstyle] [-shift <x> <y> <z>]
.SH DESCRIPTION
.PP
.B MSI2LMP
is a tool bundled with LAMMPS to aide in the conversion of simulation
inputs from Biovia's Materials Studio software for use with LAMMPS.
It is a standalone program that generates a LAMMPS data file based on
the information in an MS .car file (atom coordinates), an .mdf file
(molecular topology and atom types) and an .frc (forcefield parameters)
file. The .car and .mdf files are specific to a molecular system while
the .frc file is specific to a forcefield (variant). The only coherency
needed between .frc and .car/.mdf files are the atom types.
.PP
.SH OPTIONS
.TP
\fB\<ROOTNAME>\fR
This has to be the first argument and is a
.B mandatory
argument. It defines the root of the file names; i.e. for a
.B <ROOTNAME>
of benzene, you have to provide the files 'benzene.car' and 'benzene.mdf'
in the current working directory.
.B msi2lmp
will then read and process those files according to its remaining settings.
All other settins are optional and have defaults as listed.
.TP
\fB\-c <I,1,II,2,O,0>\fR, \fB\-class <I,1,II,2,O,0>\fR
The \-c or \-class option selects the force field class, i.e which pair
styles and bond styles and so on are required in the LAMMPS input file.
Class I or class 1 uses similar combination of functional forms as Amber
and Charmm force field and support the force fields
.B cvff
and
.B clayff.
Class II or class 2 corresponds to the more complex force fields
.B COMPASS
and
.B pcff.
Class O or class 0 finally is an experimental and incomplete extension
and supports generating output for
.B OPLS-AA
.TP
\fB\-f <ffname>\fR, \fB\-frc <ffname>\fR
The \-c or \-frc option allows the selection of the force field parameter
file
.B<ffname>.frc.
Valid names for <ffname> with this distribution are: cvff, clayff, cvff_aug,
pcff, compass_published, cff91, and oplsaa. If the argument is a pathname,
i.e. it starts with a '.' or a '/', then this absolute path is used to read
the force field, otherwise
.B msi2lmp
will look in the folder pointed to by the environment variable
$MSI2LMP_LIBRARY. If the variable is not set, then it will look in the current
directory. The extension '.frc' is appended, if missing.
Default is to look for the cvff.frc force field file.
.TP
\fB\-p <loglevel>\fR, \fB\-print <loglevel>\fR,
Selects the amount of information messages about the progress of the
conversion printed to the screen.
.B <loglevel>
can be a number from 0 (silent except for errors) to 3 (very detailed).
.TP
\fB\-i\fR, \fB\-ignore\fR,
Ignore errors about missing parameters and use 0.0 for the respective
force constants making these no-ops. Is correct to be used for a few
molecules and settings, but often an indication, that either the atom
type assignment have errors, or the force field file is missing entries.
.TP
\fB\-n\fR, \fB\-nocenter\fR,
Do not center the box around the (geometrical) center of the atoms,
but around the origin. Default is to recenter.
.TP
\fB\-o\fR, \fB\-oldstyle\fR,
Write out a data file without style hint comments to be compatible
with old LAMMPS versions. Default is to write out those comments.
.TP
\fB-s <x> <y> <z>\fR, \fB-shift <x> <y> <z>\fR,
Shift the entire system (box and coordinates) by a vector
(default: 0.0 0.0 0.0).
.TP
.SH EXAMPLES
msi2lmp benzene -c 2 -p 1 -f ../frc_files/pcff.frc
msi2lmp benzene-class1 -c I
msi2lmp decane -c 0 -f oplsaa
.SH COPYRIGHT
© 2003--2019 Sandia Corporation
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

View File

@ -29,6 +29,7 @@ as described on the "Install"_Install.html doc page.
Build_package
Build_extras
Build_windows
Build_development
END_RST -->
@ -41,7 +42,8 @@ END_RST -->
"Optional build settings"_Build_settings.html
"Include packages in build"_Build_package.html
"Packages with extra build options"_Build_extras.html
"Notes for building LAMMPS on Windows"_Build_windows.html :all(b)
"Notes for building LAMMPS on Windows"_Build_windows.html
"Development build options (CMake only)"_Build_development.html :all(b)
If you have problems building LAMMPS, it is often due to software
issues on your local machine. If you can, find a local expert to

View File

@ -235,12 +235,16 @@ running LAMMPS from Python via its library interface.
-D BUILD_EXE=value # yes (default) or no
-D BUILD_LIB=value # yes or no (default)
-D BUILD_SHARED_LIBS=value # yes or no (default) :pre
-D BUILD_SHARED_LIBS=value # yes or no (default)
-D LAMMPS_LIB_SUFFIX=name # name = mpi, serial, mybox, titan, laptop, etc
# no default value :pre
Setting BUILD_EXE=no will not produce an executable. Setting
BUILD_LIB=yes will produce a static library named liblammps.a.
Setting both BUILD_LIB=yes and BUILD_SHARED_LIBS=yes will produce a
shared library named liblammps.so.
shared library named liblammps.so. If LAMMPS_LIB_SUFFIX is set the generated
libraries will be named liblammps_name.a or liblammps_name.so instead.
[Traditional make]:
@ -310,6 +314,30 @@ current LAMMPS version (HTML and PDF files), from the website
:line
Build LAMMPS tools :h4,link(tools)
Some tools described in "Auxiliary tools"_Tools.html can be built directly
using CMake or Make.
[CMake variable]:
-D BUILD_TOOLS=value # yes or no (default) :pre
The generated binaries will also become part of the LAMMPS installation (see below)
[Traditional make]:
cd lammps/tools
make all # build all binaries of tools
make binary2txt # build only binary2txt tool
make chain # build only chain tool
make micelle2d # build only micelle2d tool
make thermo_extract # build only thermo_extract tool
:pre
:line
Install LAMMPS after a build :h4,link(install)
After building LAMMPS, you may wish to copy the LAMMPS executable of

View File

@ -28,26 +28,41 @@ Makefile(s). Example:
cd lammps # change to the LAMMPS distribution directory
mkdir build; cd build # create a new directory (folder) for build
cmake ../cmake \[options ...\] # configuration with (command-line) cmake
cmake \[options ...\] ../cmake # configuration with (command-line) cmake
make # compilation :pre
The cmake command will detect available features, enable selected
packages and options, and will generate the build environment. The make
command will then compile and link LAMMPS, producing (by default) an
executable called "lmp" and a library called "liblammps.a" in the
"build" folder.
packages and options, and will generate the build environment. By default
this build environment will be created for "Unix Makefiles" on most
platforms and particularly on Linux. However, alternate build tools
(e.g. Ninja) and support files for Integrated Development Environments
(IDE) like Eclipse, CodeBlocks, or Kate can be generated, too. This is
selected via the "-G" command line flag. For the rest of the documentation
we will assume that the build environment is generated for makefiles
and thus the make command will be used to compile and link LAMMPS as
indicated above, producing (by default) an executable called "lmp" and
a library called "liblammps.a" in the "build" folder. When generating
a build environment for the "Ninja" build tool, the build command would
be "ninja" instead of "make".
If your machine has multiple CPU cores (most do these days), using a
command like "make -jN" (with N being the number of available local
CPU cores) can be much faster. If you plan to do development on
LAMMPS or need to re-compile LAMMPS repeatedly, installation of the
ccache (= Compiler Cache) software may speed up compilation even more.
ccache (= Compiler Cache) software may speed up repeated compilation
even more.
After compilation, you can optionally copy the LAMMPS executable and
library into your system folders (by default under $HOME/.local) with:
After compilation, you may optionally install the LAMMPS executable into
your system with:
make install # optional, copy LAMMPS executable & library elsewhere :pre
This will install the lammps executable and library (if requested), some
tools (if configured) and additional files like library API headers,
manpages, potential and force field files. The location of the installation
tree is set by the CMake variable "CMAKE_INSTALL_PREFIX" which defaults
to $\{HOME\}/.local
:line
There are 3 variants of CMake: a command-line version (cmake), a text mode
@ -105,10 +120,11 @@ The argument can be preceeded or followed by various CMake
command-line options. Several useful ones are:
-D CMAKE_INSTALL_PREFIX=path # where to install LAMMPS executable/lib if desired
-D CMAKE_BUILD_TYPE=type # type = Release or Debug
-D CMAKE_BUILD_TYPE=type # type = RelWithDebInfo (default), Release, MinSizeRel, or Debug
-G output # style of output CMake generates
-DVARIABLE=value # setting for a LAMMPS feature to enable
-D VARIABLE=value # ditto, but cannot come after CMakeLists.txt dir :pre
-D VARIABLE=value # ditto, but cannot come after CMakeLists.txt dir
-C path/to/preset/file # load some CMake settings before configuring :pre
All the LAMMPS-specific -D variables that a LAMMPS build supports are
described on the pages linked to from the "Build"_Build.html doc page.

View File

@ -0,0 +1,86 @@
"Higher level section"_Build.html - "LAMMPS WWW Site"_lws - "LAMMPS
Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Commands_all.html)
:line
Development build options (CMake only) :h3
The CMake build of LAMMPS has a few extra options which are useful during
development, testing or debugging.
:line
Verify compilation flags :h4,link(compilation)
Sometimes it is necessary to verify the complete sequence of compilation flags
generated by the CMake build. To enable a more verbose output during
compilation you can use the following option.
-D CMAKE_VERBOSE_MAKEFILE=value # value = no (default) or yes :pre
Another way of doing this without reconfiguration is calling make with variable VERBOSE set to 1:
make VERBOSE=1 :pre
:line
Address, Undefined Behavior, and Thread Sanitizer Support :h4,link(sanitizer)
Compilers such as GCC and Clang support generating binaries which use different
sanitizers to detect problems in code during run-time. They can detect "memory leaks"_https://clang.llvm.org/docs/AddressSanitizer.html,
code that runs into "undefined behavior"_https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html of the
language and "data races"_https://clang.llvm.org/docs/ThreadSanitizer.html in threaded code.
The following settings allow you enable these features if your compiler supports
it. Please note that they come with a performance hit. However, they are
usually faster than using tools like Valgrind.
-D ENABLE_SANITIZE_ADDRESS=value # enable Address Sanitizer, value = no (default) or yes
-D ENABLE_SANITIZE_UNDEFINED=value # enable Undefined Behaviour Sanitizer, value = no (default) or yes
-D ENABLE_SANITIZE_THREAD=value # enable Thread Sanitizer, value = no (default) or yes
:pre
:line
Code Coverage and Testing :h4,link(testing)
We do extensive regression testing of the LAMMPS code base on a continuous
basis. Some of the logic to do this has been added to the CMake build so
developers can run the tests directly on their workstation.
NOTE: this is incomplete and only represents a small subset of tests that we run
-D ENABLE_TESTING=value # enable simple run tests of LAMMPS, value = no (default) or yes
-D LAMMPS_TESTING_SOURCE_DIR=path # path to lammps-testing repository (option if in custom location)
-D LAMMPS_TESTING_GIT_TAG=value # version of lammps-testing repository that should be used, value = master (default) or custom git commit or tag
:pre
If you enable testing in the CMake build it will create an additional target called "test". You can run them with:
make test
:pre
The test cases used come from the lammps-testing repository. They are
derivatives of the examples folder with some modifications to make the run
faster.
You can also collect code coverage metrics while running the tests by enabling
coverage support during building.
-D ENABLE_COVERAGE=value # enable coverage measurements, value = no (default) or yes :pre
This will also add the following targets to generate coverage reports after running the LAMMPS executable:
make test # run tests first!
make gen_coverage_html # generate coverage report in HTML format
make gen_coverage_xml # generate coverage report in XML format
:pre
These reports require GCOVR to be installed. The easiest way to do this to install it via pip:
pip install git+https://github.com/gcovr/gcovr.git :pre
:pre

View File

@ -30,13 +30,13 @@ This is the list of packages that may require additional steps.
"KIM"_#kim,
"KOKKOS"_#kokkos,
"LATTE"_#latte,
"MEAM"_#meam,
"MESSAGE"_#message,
"MSCG"_#mscg,
"OPT"_#opt,
"POEMS"_#poems,
"PYTHON"_#python,
"VORONOI"_#voronoi,
"USER-ADIOS"_#user-adios,
"USER-ATC"_#user-atc,
"USER-AWPMD"_#user-awpmd,
"USER-COLVARS"_#user-colvars,
@ -81,17 +81,19 @@ which GPU hardware to build for.
[CMake build]:
-D GPU_API=value # value = opencl (default) or cuda
-D GPU_PREC=value # precision setting
# value = double or mixed (default) or single
-D OCL_TUNE=value # hardware choice for GPU_API=opencl
# generic (default) or intel (Intel CPU) or fermi, kepler, cypress (NVIDIA)
-D GPU_ARCH=value # primary GPU hardware choice for GPU_API=cuda
# value = sm_XX, see below
# default is Cuda-compiler dependent, but typically sm_20
-D CUDPP_OPT=value # optimization setting for GPU_API=cuda
# enables CUDA Performance Primitives Optimizations
# yes (default) or no :pre
-D GPU_API=value # value = opencl (default) or cuda
-D GPU_PREC=value # precision setting
# value = double or mixed (default) or single
-D OCL_TUNE=value # hardware choice for GPU_API=opencl
# generic (default) or intel (Intel CPU) or fermi, kepler, cypress (NVIDIA)
-D GPU_ARCH=value # primary GPU hardware choice for GPU_API=cuda
# value = sm_XX, see below
# default is sm_30
-D CUDPP_OPT=value # optimization setting for GPU_API=cuda
# enables CUDA Performance Primitives Optimizations
# value = yes (default) or no
-D CUDA_MPS_SUPPORT=value # enables some tweaks required to run with active nvidia-cuda-mps daemon
# value = yes or no (default) :pre
GPU_ARCH settings for different GPU hardware is as follows:
@ -168,39 +170,28 @@ used to build the GPU library.
KIM package :h4,link(kim)
To build with this package, the KIM library must be downloaded and
built on your system. It must include the KIM models that you want to
use with LAMMPS.
To build with this package, the KIM library with API v2 must be downloaded
and built on your system. It must include the KIM models that you want to
use with LAMMPS. If you want to use the "kim_query"_kim_commands.html
command, you also need to have libcurl installed with the matching
development headers and the curl-config tool.
Note that in LAMMPS lingo, a KIM model driver is a pair style
(e.g. EAM or Tersoff). A KIM model is a pair style for a particular
element or alloy and set of parameters, e.g. EAM for Cu with a
specific EAM potential file. Also note that installing the KIM API
library with all its models, may take around 30 min to build. Of
course you only need to do that once.
See "Obtaining KIM Models"_http://openkim.org/doc/usage/obtaining-models to
learn how to install a pre-build binary of the OpenKIM Repository of Models.
See the list of all KIM models here: https://openkim.org/browse/models
See the list of KIM model drivers here:
https://openkim.org/kim-items/model-drivers/alphabetical
See the list of all KIM models here:
https://openkim.org/kim-items/models/by-model-drivers
See the list of example KIM models included by default here:
https://openkim.org/kim-api on the "What is in the KIM API source
package?" page.
(Also note that when downloading and installing from source
the KIM API library with all its models, may take a long time (tens of
minutes to hours) to build. Of course you only need to do that once.)
[CMake build]:
-D DOWNLOAD_KIM=value # download OpenKIM API v1 for build, value = no (default) or yes
-D KIM_LIBRARY=path # KIM library file (only needed if a custom location)
-D KIM_INCLUDE_DIR=path # KIM include directory (only needed if a custom location) :pre
-D DOWNLOAD_KIM=value # download OpenKIM API v2 for build, value = no (default) or yes :pre
If DOWNLOAD_KIM is set, the KIM library will be downloaded and built
inside the CMake build directory. If the KIM library is already on
your system (in a location CMake cannot find it), KIM_LIBRARY is the
filename (plus path) of the KIM library file, not the directory the
library file is in. KIM_INCLUDE_DIR is the directory the KIM include
file is in.
your system (in a location CMake cannot find it), set the PKG_CONFIG_PATH
environment variable so that libkim-api can be found.
[Traditional make]:
@ -214,8 +205,8 @@ make lib-kim args="-b " # (re-)install KIM API lib with only example models
make lib-kim args="-b -a Glue_Ercolessi_Adams_Al__MO_324507536345_001" # ditto plus one model
make lib-kim args="-b -a everything" # install KIM API lib with all models
make lib-kim args="-n -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # add one model or model driver
make lib-kim args="-p /usr/local/kim-api" # use an existing KIM API installation at the provided location
make lib-kim args="-p /usr/local/kim-api -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # ditto but add one model or driver :pre
make lib-kim args="-p /usr/local" # use an existing KIM API installation at the provided location
make lib-kim args="-p /usr/local -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # ditto but add one model or driver :pre
:line
@ -250,7 +241,10 @@ Maxwell50 = NVIDIA Maxwell generation CC 5.0
Maxwell52 = NVIDIA Maxwell generation CC 5.2
Maxwell53 = NVIDIA Maxwell generation CC 5.3
Pascal60 = NVIDIA Pascal generation CC 6.0
Pascal61 = NVIDIA Pascal generation CC 6.1 :ul
Pascal61 = NVIDIA Pascal generation CC 6.1
Volta70 = NVIDIA Volta generation CC 7.0
Volta72 = NVIDIA Volta generation CC 7.2
Turing75 = NVIDIA Turing generation CC 7.5 :ul
[CMake build]:
@ -351,49 +345,6 @@ the compiler you use on your system to build LATTE.
:line
MEAM package :h4,link(meam)
NOTE: the use of the MEAM package is discouraged, as it has been
superseded by the USER-MEAMC package, which is a direct translation of
the Fortran code in the MEAM library to C++. The code in USER-MEAMC
should be functionally equivalent to the MEAM package, fully supports
use of "pair_style hybrid"_pair_hybrid.html (the MEAM package does
not), and has optimizations that make it significantly faster than the
MEAM package.
[CMake build]:
No additional settings are needed besides "-D PKG_MEAM=yes".
[Traditional make]:
Before building LAMMPS, you must build the MEAM library in lib/meam.
You can build the MEAM library manually if you prefer; follow the
instructions in lib/meam/README. You can also do it in one step from
the lammps/src dir, using a command like these, which simply invoke
the lib/meam/Install.py script with the specified args:
make lib-meam # print help message
make lib-meam args="-m mpi" # build with default Fortran compiler compatible with your MPI library
make lib-meam args="-m serial" # build with compiler compatible with "make serial" (GNU Fortran)
make lib-meam args="-m ifort" # build with Intel Fortran compiler using Makefile.ifort :pre
NOTE: You should test building the MEAM library with both the Intel
and GNU compilers to see if a simulation runs faster with one versus
the other on your system.
The build should produce two files: lib/meam/libmeam.a and
lib/meam/Makefile.lammps. The latter is copied from an existing
Makefile.lammps.* and has settings needed to link C++ (LAMMPS) with
Fortran (MEAM library). Typically the two compilers used for LAMMPS
and the MEAM library need to be consistent (e.g. both Intel or both
GNU compilers). If necessary, you can edit/create a new
lib/meam/Makefile.machine file for your system, which should define an
EXTRAMAKE variable to specify a corresponding Makefile.lammps.machine
file.
:line
MESSAGE package :h4,link(message)
This package can optionally include support for messaging via sockets,
@ -403,6 +354,9 @@ be installed on your system.
[CMake build]:
-D MESSAGE_ZMQ=value # build with ZeroMQ support, value = no (default) or yes
-D ZMQ_LIBRARY=path # ZMQ library file (only needed if a custom location)
-D ZMQ_INCLUDE_DIR=path # ZMQ include directory (only needed if a custom location)
:pre
[Traditional make]:
@ -415,6 +369,7 @@ simply invoke the lib/message/Install.py script with the specified args:
make lib-message # print help message
make lib-message args="-m -z" # build with MPI and socket (ZMQ) support
make lib-message args="-s" # build as serial lib with no ZMQ support
:pre
The build should produce two files: lib/message/cslib/src/libmessage.a
and lib/message/Makefile.lammps. The latter is copied from an
@ -576,6 +531,32 @@ the lib/voronoi/Makefile.lammps file.
:line
USER-ADIOS package :h4,link(user-adios)
The USER-ADIOS package requires the "ADIOS I/O library"_https://github.com/ornladios/ADIOS2,
version 2.3.1 or newer. Make sure that you have ADIOS built either with or
without MPI to match if you build LAMMPS with or without MPI.
ADIOS compilation settings for LAMMPS are automatically detected, if the PATH
and LD_LIBRARY_PATH environment variables have been updated for the local ADIOS
installation and the instructions below are followed for the respective build systems.
[CMake build]:
-D ADIOS2_DIR=path # path is where ADIOS 2.x is installed
-D PKG_USER-ADIOS=yes :pre
[Traditional make]:
Turn on the USER-ADIOS package before building LAMMPS. If the ADIOS 2.x software is installed in PATH, there is nothing else to do:
make yes-user-adios :pre
otherwise, set ADIOS2_DIR environment variable when turning on the package:
ADIOS2_DIR=path make yes-user-adios # path is where ADIOS 2.x is installed :pre
:line
USER-ATC package :h4,link(user-atc)
The USER-ATC package requires the MANYBODY package also be installed.
@ -836,23 +817,34 @@ file.
USER-INTEL package :h4,link(user-intel)
To build with this package, you must choose which hardware you want to
build for, either Intel CPUs or Intel KNLs. You should also typically
"install the USER-OMP package"_#user-omp, as it can be used in tandem
with the USER-INTEL package to good effect, as explained on the "Speed
intel"_Speed_intel.html doc page.
build for, either x86 CPUs or Intel KNLs in offload mode. You should
also typically "install the USER-OMP package"_#user-omp, as it can be
used in tandem with the USER-INTEL package to good effect, as explained
on the "Speed intel"_Speed_intel.html doc page.
[CMake build]:
-D INTEL_ARCH=value # value = cpu (default) or knl
-D BUILD_OMP=yes # also required to build with the USER-INTEl package :pre
-D INTEL_LRT_MODE=value # value = threads, none, or c++11 :pre
Requires an Intel compiler as well as the Intel TBB and MKL libraries.
In Long-range thread mode (LRT) a modified verlet style is used, that
operates the Kspace calculation in a separate thread concurrently to
other calculations. This has to be enabled in the "package intel"_package.html
command at runtime. With the setting "threads" it used the pthreads
library, while c++11 will use the built-in thread support of C++11
compilers. The option "none" skips compilation of this feature. The
default is to use "threads" if pthreads is available and otherwise "none".
Best performance is achieved with Intel hardware, Intel compilers, as well as
the Intel TBB and MKL libraries. However, the code also compiles, links, and
runs with other compilers and without TBB and MKL.
[Traditional make]:
Choose which hardware to compile for in Makefile.machine via the
following settings. See src/MAKE/OPTIONS/Makefile.intel_cpu* and
Makefile.knl files for examples.
Makefile.knl files for examples. and src/USER-INTEL/README for
additional information.
For CPUs:
@ -874,7 +866,17 @@ USER-MOLFILE package :h4,link(user-molfile)
[CMake build]:
No additional settings are needed besides "-D PKG_USER-MOLFILE=yes".
-D MOLFILE_INCLUDE_DIRS=path # (optional) path where VMD molfile plugin headers are installed
-D PKG_USER-MOLFILE=yes :pre
Using "-D PKG_USER-MOLFILE=yes" enables the package, and setting
"-D MOLFILE_INCLUDE DIRS" allows to provide a custom location for
the molfile plugin header files. These should match the ABI of the
plugin files used, and thus one typically sets them to include
folder of the local VMD installation in use. LAMMPS ships with a
couple of default header files that correspond to a popular VMD
version, usually the latest release.
[Traditional make]:
@ -883,7 +885,11 @@ loading library libdl.a that is typically present on all systems. It
is required for LAMMPS to link with this package. If the setting is
not valid for your system, you will need to edit the Makefile.lammps
file. See lib/molfile/README and lib/molfile/Makefile.lammps for
details.
details. It is also possible to configure a different folder with
the VMD molfile plugin header files. LAMMPS ships with a couple of
default headers, but these are not compatible with all VMD versions,
so it is often best to change this setting to the location of the
same include files of the local VMD installation in use.
:line

View File

@ -41,13 +41,13 @@ packages:
"KIM"_Build_extras.html#kim,
"KOKKOS"_Build_extras.html#kokkos,
"LATTE"_Build_extras.html#latte,
"MEAM"_Build_extras.html#meam,
"MESSAGE"_Build_extras.html#message,
"MSCG"_Build_extras.html#mscg,
"OPT"_Build_extras.html#opt,
"POEMS"_Build_extras.html#poems,
"PYTHON"_Build_extras.html#python,
"VORONOI"_Build_extras.html#voronoi,
"USER-ADIOS"_Build_extras.html#user-adios,
"USER-ATC"_Build_extras.html#user-atc,
"USER-AWPMD"_Build_extras.html#user-awpmd,
"USER-COLVARS"_Build_extras.html#user-colvars,
@ -148,26 +148,41 @@ system. Using these files you can enable/disable portions of the
available packages in LAMMPS. If you need a custom preset you can take
one of them as a starting point and customize it to your needs.
cmake -C ../cmake/presets/all_on.cmake \[OPTIONS\] ../cmake | enable all packages
cmake -C ../cmake/presets/all_off.cmake \[OPTIONS\] ../cmake | disable all packages
cmake -C ../cmake/presets/std.cmake \[OPTIONS\] ../cmake | enable standard packages
cmake -C ../cmake/presets/user.cmake \[OPTIONS\] ../cmake | enable user packages
cmake -C ../cmake/presets/std_nolib.cmake \[OPTIONS\] ../cmake | enable standard packages that do not require extra libraries
cmake -C ../cmake/presets/nolib.cmake \[OPTIONS\] ../cmake | disable all packages that do not require extra libraries
cmake -C ../cmake/presets/manual_selection.cmake \[OPTIONS\] ../cmake | example of how to create a manual selection of packages :tb(s=|,a=l)
cmake -C ../cmake/presets/all_on.cmake \[OPTIONS\] ../cmake |
enable all packages |
cmake -C ../cmake/presets/all_off.cmake \[OPTIONS\] ../cmake |
disable all packages |
cmake -C ../cmake/presets/minimal.cmake \[OPTIONS\] ../cmake |
enable just a few core packages |
cmake -C ../cmake/presets/most.cmake \[OPTIONS\] ../cmake |
enable most common packages |
cmake -C ../cmake/presets/nolib.cmake \[OPTIONS\] ../cmake |
disable packages that do require extra libraries or tools |
cmake -C ../cmake/presets/clang.cmake \[OPTIONS\] ../cmake |
change settings to use the Clang compilers by default |
cmake -C ../cmake/presets/mingw.cmake \[OPTIONS\] ../cmake |
enable all packages compatible with MinGW compilers :tb(c=2,s=|,a=l)
NOTE: Running cmake this way manipulates the variable cache in your
current build directory. You can combine presets and options with
multiple cmake runs.
current build directory. You can combine multiple presets and options
in a single cmake run, or change settings incrementally by running
cmake with new flags.
[Example:]
# build LAMMPS with all "standard" packages which don't
# use libraries and enable GPU package
# build LAMMPS with most commonly used packages, but then remove
# those requiring additional library or tools, but still enable
# GPU package and configure it for using CUDA. You can run.
mkdir build
cd build
cmake -C ../cmake/presets/std_nolib.cmake -D PKG_GPU=on ../cmake :pre
cmake -C ../cmake/presets/most.cmake -C ../cmake/presets/nolib.cmake -D PKG_GPU=on -D GPU_API=cuda ../cmake :pre
# to add another package, say BODY to the previous configuration you can run:
cmake -D PKG_BODY=on . :pre
# to reset the package selection from above to the default of no packages
# but leaving all other settings untouched. You can run:
cmake -C ../cmake/presets/no_all.cmake . :pre
:line
[Make shortcuts for installing many packages]:

View File

@ -57,10 +57,10 @@ FFT_INC = -DFFT_SINGLE # do not specify for double precision
FFT_INC = -DFFT_PACK_ARRAY # or -DFFT_PACK_POINTER or -DFFT_PACK_MEMCPY :pre
# default is FFT_PACK_ARRAY if not specified
FFT_INC = -I/usr/local/include
FFT_INC = -I/usr/local/include
FFT_PATH = -L/usr/local/lib
FFT_LIB = -lfftw3 # FFTW3 double precision
FFT_LIB = -lfftw3 -lfftw3f # FFTW3 single precision
FFT_LIB = -lfftw3 # FFTW3 double precision
FFT_LIB = -lfftw3 -lfftw3f # FFTW3 single precision
FFT_LIB = -lmkl_intel_lp64 -lmkl_sequential -lmkl_core # MKL with Intel compiler
FFT_LIB = -lmkl_gf_lp64 -lmkl_sequential -lmkl_core # MKL with GNU compier :pre
@ -179,8 +179,11 @@ e.g. from 511 to -512, which can cause diagnostics like the
mean-squared displacement, as calculated by the "compute
msd"_compute_msd.html command, to be faulty.
Note that the USER-ATC package is not currently compatible with the
"bigbig" setting.
Note that the USER-ATC package and the USER-INTEL package are currently
not compatible with the "bigbig" setting. Also, there are limitations
when using the library interface. Some functions with known issues
have been replaced by dummy calls printing a corresponding error rather
than crashing randomly or corrupting data.
Also note that the GPU package requires its lib/gpu library to be
compiled with the same size setting, or the link will fail. A CMake

View File

@ -51,11 +51,10 @@ provides a unix/linux interface to low-level Windows functions, so LAMMPS
can be compiled on Windows. The necessary (minor) modifications to LAMMPS
are included, but may not always up-to-date for recently added functionality
and the corresponding new code. A machine makefile for using cygwin for
the old build system is provided. The CMake build system is untested
for this; you will have to request that makefiles are generated and
manually set the compiler.
the old build system is provided. Using CMake for this mode of compilation
is untested and not likely to work.
When compiling for Windows [not] set the -DLAMMPS_MEMALIGN define
When compiling for Windows do [not] set the -DLAMMPS_MEMALIGN define
in the LMP_INC makefile variable and add -lwsock32 -lpsapi to the linker
flags in LIB makefile variable. Try adding -static-libgcc or -static or
both to the linker flags when your resulting LAMMPS Windows executable
@ -79,7 +78,13 @@ probably the currently best tested and supported way to build LAMMPS
executables for Windows. There are makefiles provided for the
traditional build system, but CMake has also been successfully tested
using the mingw32-cmake and mingw64-cmake wrappers that are bundled
with the cross-compiler environment on Fedora machines.
with the cross-compiler environment on Fedora machines. A CMake preset
selecting all packages compatible with this cross-compilation build
is provided. You likely need to disable the GPU package unless you
download and install the contents of the pre-compiled "OpenCL ICD loader
library"_https://download.lammps.org/thirdparty/opencl-win-devel.tar.gz
into your MinGW64 cross-compiler environment. The cross-compilation
currently will only produce non-MPI serial binaries.
Please keep in mind, though, that this only applies to compiling LAMMPS.
Whether the resulting binaries do work correctly is no tested by the

View File

@ -33,6 +33,11 @@ commands in it are used to define a LAMMPS simulation.
Commands_bond
Commands_kspace
.. toctree::
:maxdepth: 1
Commands_removed
END_RST -->
<!-- HTML_ONLY -->
@ -49,5 +54,7 @@ END_RST -->
"Bond, angle, dihedral, improper commands"_Commands_bond.html
"KSpace solvers"_Commands_kspace.html :all(b)
"Removed commands and packages"_Commands_removed.html :all(b)
<!-- END_HTML_ONLY -->

View File

@ -48,12 +48,14 @@ An alphabetic list of all general LAMMPS commands.
"dimension"_dimension.html,
"displace_atoms"_displace_atoms.html,
"dump"_dump.html,
"dump adios"_dump_adios.html,
"dump image"_dump_image.html,
"dump_modify"_dump_modify.html,
"dump movie"_dump_image.html,
"dump netcdf"_dump_netcdf.html,
"dump netcdf/mpiio"_dump_netcdf.html,
"dump vtk"_dump_vtk.html,
"dump_modify"_dump_modify.html,
"dynamical_matrix"_dynamical_matrix.html,
"echo"_echo.html,
"fix"_fix.html,
"fix_modify"_fix_modify.html,
@ -66,6 +68,9 @@ An alphabetic list of all general LAMMPS commands.
"improper_style"_improper_style.html,
"include"_include.html,
"jump"_jump.html,
"kim_init"_kim_commands.html,
"kim_interactions"_kim_commands.html,
"kim_query"_kim_commands.html,
"kspace_modify"_kspace_modify.html,
"kspace_style"_kspace_style.html,
"label"_label.html,
@ -76,9 +81,11 @@ An alphabetic list of all general LAMMPS commands.
"minimize"_minimize.html,
"min_modify"_min_modify.html,
"min_style"_min_style.html,
"min_style spin"_min_spin.html,
"molecule"_molecule.html,
"ndx2group"_group2ndx.html,
"neb"_neb.html,
"neb/spin"_neb_spin.html,
"neigh_modify"_neigh_modify.html,
"neighbor"_neighbor.html,
"newton"_newton.html,

View File

@ -28,8 +28,12 @@ OPT.
"none"_bond_none.html,
"zero"_bond_zero.html,
"hybrid"_bond_hybrid.html :tb(c=3,ea=c)
"hybrid"_bond_hybrid.html,
,
,
,
,
,
"class2 (ko)"_bond_class2.html,
"fene (iko)"_bond_fene.html,
"fene/expand (o)"_bond_fene_expand.html,
@ -56,8 +60,12 @@ OPT.
"none"_angle_none.html,
"zero"_angle_zero.html,
"hybrid"_angle_hybrid.html :tb(c=3,ea=c)
"hybrid"_angle_hybrid.html,
,
,
,
,
,
"charmm (iko)"_angle_charmm.html,
"class2 (ko)"_angle_class2.html,
"class2/p6"_angle_class2.html,
@ -89,8 +97,12 @@ OPT.
"none"_dihedral_none.html,
"zero"_dihedral_zero.html,
"hybrid"_dihedral_hybrid.html :tb(c=3,ea=c)
"hybrid"_dihedral_hybrid.html,
,
,
,
,
,
"charmm (iko)"_dihedral_charmm.html,
"charmmfsw"_dihedral_charmm.html,
"class2 (ko)"_dihedral_class2.html,
@ -117,8 +129,12 @@ OPT.
"none"_improper_none.html,
"zero"_improper_zero.html,
"hybrid"_improper_hybrid.html :tb(c=3,ea=c)
"hybrid"_improper_hybrid.html,
,
,
,
,
,
"class2 (ko)"_improper_class2.html,
"cossq (o)"_improper_cossq.html,
"cvff (io)"_improper_cvff.html,

View File

@ -116,6 +116,7 @@ Actions:
"minimize"_minimize.html,
"neb"_neb.html,
"neb_spin"_neb_spin.html,
"prd"_prd.html,
"rerun"_rerun.html,
"run"_run.html,

View File

@ -66,6 +66,7 @@ KOKKOS, o = USER-OMP, t = OPT.
"group/group"_compute_group_group.html,
"gyration"_compute_gyration.html,
"gyration/chunk"_compute_gyration_chunk.html,
"gyration/shape"_compute_gyration_shape.html,
"heat/flux"_compute_heat_flux.html,
"heat/flux/tally"_compute_tally.html,
"hexorder/atom"_compute_hexorder_atom.html,
@ -80,6 +81,7 @@ KOKKOS, o = USER-OMP, t = OPT.
"meso/e/atom"_compute_meso_e_atom.html,
"meso/rho/atom"_compute_meso_rho_atom.html,
"meso/t/atom"_compute_meso_t_atom.html,
"momentum"_compute_momentum.html,
"msd"_compute_msd.html,
"msd/chunk"_compute_msd_chunk.html,
"msd/nongauss"_compute_msd_nongauss.html,

View File

@ -61,6 +61,7 @@ OPT.
"edpd/source"_fix_dpd_source.html,
"efield"_fix_efield.html,
"ehex"_fix_ehex.html,
"electron/stopping"_fix_electron_stopping.html,
"enforce2d (k)"_fix_enforce2d.html,
"eos/cv"_fix_eos_cv.html,
"eos/table"_fix_eos_table.html,
@ -106,6 +107,7 @@ OPT.
"mvv/edpd"_fix_mvv_dpd.html,
"mvv/tdpd"_fix_mvv_dpd.html,
"neb"_fix_neb.html,
"neb_spin"_fix_neb_spin.html,
"nph (ko)"_fix_nh.html,
"nph/asphere (o)"_fix_nph_asphere.html,
"nph/body"_fix_nph_body.html,
@ -224,7 +226,7 @@ OPT.
"wall/body/polyhedron"_fix_wall_body_polyhedron.html,
"wall/colloid"_fix_wall.html,
"wall/ees"_fix_wall_ees.html,
"wall/gran (o)"_fix_wall_gran.html,
"wall/gran"_fix_wall_gran.html,
"wall/gran/region"_fix_wall_gran_region.html,
"wall/harmonic"_fix_wall.html,
"wall/lj1043"_fix_wall.html,

View File

@ -27,8 +27,11 @@ OPT.
"none"_pair_none.html,
"zero"_pair_zero.html,
"hybrid (k)"_pair_hybrid.html,
"hybrid/overlay (k)"_pair_hybrid.html :tb(c=4,ea=c)
"hybrid/overlay (k)"_pair_hybrid.html,
,
,
,
,
"adp (o)"_pair_adp.html,
"agni (o)"_pair_agni.html,
"airebo (io)"_pair_airebo.html,
@ -80,6 +83,8 @@ OPT.
"dpd/fdt/energy (k)"_pair_dpd_fdt.html,
"dpd/tstat (go)"_pair_dpd.html,
"dsmc"_pair_dsmc.html,
"e3b"_pair_e3b.html,
"drip"_pair_drip.html,
"eam (gikot)"_pair_eam.html,
"eam/alloy (gikot)"_pair_eam.html,
"eam/cd (o)"_pair_eam.html,
@ -98,6 +103,7 @@ OPT.
"gran/hertz/history (o)"_pair_gran.html,
"gran/hooke (o)"_pair_gran.html,
"gran/hooke/history (ko)"_pair_gran.html,
"granular"_pair_granular.html,
"gw"_pair_gw.html,
"gw/zbl"_pair_gw.html,
"hbond/dreiding/lj (o)"_pair_hbond_dreiding.html,
@ -216,6 +222,8 @@ OPT.
"sph/rhosum"_pair_sph_rhosum.html,
"sph/taitwater"_pair_sph_taitwater.html,
"sph/taitwater/morris"_pair_sph_taitwater_morris.html,
"spin/dipole/cut"_pair_spin_dipole.html,
"spin/dipole/long"_pair_spin_dipole.html,
"spin/dmi"_pair_spin_dmi.html,
"spin/exchange"_pair_spin_exchange.html,
"spin/magelec"_pair_spin_magelec.html,

View File

@ -0,0 +1,66 @@
"Higher level section"_Commands.html - "LAMMPS WWW Site"_lws - "LAMMPS
Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Commands.html)
:line
Removed commands and packages :h3
This page lists LAMMPS commands and packages that have been removed from
the distribution and provides suggestions for alternatives or replacements.
LAMMPS has special dummy styles implemented, that will stop LAMMPS and
print a suitable error message in most cases, when a style/command is used
that has been removed.
Fix ave/spatial and fix ave/spatial/sphere :h4
The fixes ave/spatial and ave/spatial/sphere have been removed from LAMMPS
since they were superseded by the more general and extensible "chunk
infrastructure". Here the system is partitioned in one of many possible
ways through the "compute chunk/atom"_compute_chunk_atom.html command
and then averaging is done using "fix ave/chunk"_fix_ave_chunk.html.
Please refer to the "chunk HOWTO"_Howto_chunk.html section for an overview.
MEAM package :h4
The MEAM package has been removed since it was superseded by the
"USER-MEAMC package"_Package_details.html#PKG-USER-MEAMC. The code in
the USER-MEAMC package is a translation of the Fortran code of MEAM into C++,
which removes several restrictions (e.g. there can be multiple instances
in hybrid pair styles) and allows for some optimizations leading
to better performance. The new pair style "meam/c"_pair_meamc.html has
the exact same syntax as the old "meam" pair style and thus pair style
"meam"_pair_meamc.html is an alias to the new style and backward
compatibility of old inputs is preserved.
REAX package :h4
The REAX package has been removed since it was superseded by the
"USER-REAXC package"_Package_details.html#PKG-USER-REAXC. The USER-REAXC
package has been tested to yield equivalent results to the REAX package,
offers better performance, supports OpenMP multi-threading via USER-OMP,
and GPU and threading parallelization through KOKKOS. The new pair styles
are not syntax compatible with the removed reax pair style, so input
files will have to be adapted.
USER-CUDA package :h4
The USER-CUDA package had been removed, since it had been unmaintained
for a long time and had known bugs and problems. Significant parts of
the design were transferred to the
"KOKKOS package"_Package_details.html#PKG-KOKKOS, which has similar
performance characteristics on Nvidia GPUs. Both, the KOKKOS
and the "GPU package"_Package_details.html#PKG-GPU are maintained
and allow running LAMMPS with GPU acceleration.
restart2data tool :h4
The functionality of the restart2data tool has been folded into the
LAMMPS executable directly instead of having a separate tool. A
combination of the commands "read_restart"_read_restart.html and
"write_data"_write_data.html can be used to the same effect. For added
convenience this conversion can also be triggered by "command line
flags"_Run_options.html

View File

@ -0,0 +1,15 @@
\documentclass[12pt]{article}
\pagestyle{empty}
\begin{document}
$$
E_{a} = K_2\left(\theta - \theta_0\right)^2 + K_3\left(\theta - \theta_0\right)^3 + K_4\left(\theta - \theta_0\right)^4 + K_5\left(\theta - \theta_0\right)^5 + K_6\left(\theta - \theta_0\right)^6
$$
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:

View File

@ -0,0 +1,15 @@
\documentclass[12pt]{article}
\pagestyle{empty}
\begin{document}
$$
E = K \left[ 1 + \cos(n\theta - \theta_0)\right]
$$
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@ -0,0 +1,13 @@
\documentclass[12pt]{article}
\pagestyle{empty}
\begin{document}
\begin{eqnarray*}
c = l_z - 0.5(l_y+l_x) \\
b = l_y - l_x \\
k = \frac{3}{2} \frac{l_x^2+l_y^2+l_z^2}{(l_x+l_y+l_z)^2} - \frac{1}{2}
\end{eqnarray*}
\end{document}

BIN
doc/src/Eqs/e3b.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

15
doc/src/Eqs/e3b.tex Normal file
View File

@ -0,0 +1,15 @@
\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
E =& E_2 \sum_{i,j}e^{-k_2 r_{ij}} + E_A \sum_{\substack{i,j,k,\ell \\\in \textrm{type A}}} f(r_{ij})f(r_{k\ell}) + E_B \sum_{\substack{i,j,k,\ell \\\in \textrm{type B}}} f(r_{ij})f(r_{k\ell}) + E_C \sum_{\substack{i,j,k,\ell \\\in \textrm{type C}}} f(r_{ij})f(r_{k\ell}) \\
f(r) =& e^{-k_3 r}s(r) \\
s(r) =& \begin{cases}
1 & r<R_s \\
\displaystyle\frac{(R_f-r)^2(R_f-3R_s+2r)}{(R_f-R_s)^3} & R_s\leq r\leq R_f \\
0 & r>R_f\\
\end{cases}
\end{align*}
\end{document}

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@ -0,0 +1,21 @@
\documentclass[preview]{standalone}
\usepackage{varwidth}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath,amssymb,amsthm,bm}
\begin{document}
\begin{varwidth}{50in}
\begin{equation}
\bm{H}_{cubic} = -\sum_{{ i}=1}^{N} K_{1}
\Big[
\left(\vec{s}_{i} \cdot \vec{n1} \right)^2
\left(\vec{s}_{i} \cdot \vec{n2} \right)^2 +
\left(\vec{s}_{i} \cdot \vec{n2} \right)^2
\left(\vec{s}_{i} \cdot \vec{n3} \right)^2 +
\left(\vec{s}_{i} \cdot \vec{n1} \right)^2
\left(\vec{s}_{i} \cdot \vec{n3} \right)^2 \Big]
+K_{2}^{(c)} \left(\vec{s}_{i} \cdot \vec{n1} \right)^2
\left(\vec{s}_{i} \cdot \vec{n2} \right)^2
\left(\vec{s}_{i} \cdot \vec{n3} \right)^2 \nonumber
\end{equation}
\end{varwidth}
\end{document}

View File

@ -0,0 +1,15 @@
\documentclass[12pt]{article}
\pagestyle{empty}
\begin{document}
$$
E = K \left(\theta - \theta_0\right)^2
$$
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

@ -0,0 +1,13 @@
\documentclass[preview]{standalone}
\usepackage{varwidth}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath, amssymb, graphics, setspace}
\begin{document}
\begin{varwidth}{50in}
\begin{equation}
\frac{d \vec{s}_{i}}{dt} = \lambda\, \vec{s}_{i} \times\left( \vec{\omega}_{i} \times\vec{s}_{i} \right)
\nonumber
\end{equation}
\end{varwidth}
\end{document}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@ -0,0 +1,14 @@
\documentclass[preview]{standalone}
\usepackage{varwidth}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath, amssymb, graphics, setspace}
\begin{document}
\begin{varwidth}{50in}
\begin{equation}
{\Delta t}_{\rm max} = \frac{2\pi}{\kappa
\left|\vec{\omega}_{\rm max} \right|}
\nonumber
\end{equation}
\end{varwidth}
\end{document}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@ -0,0 +1,15 @@
\documentclass[preview]{standalone}
\usepackage{varwidth}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath, amssymb, graphics, setspace}
\begin{document}
\begin{varwidth}{50in}
\begin{equation}
\omega_i^{\nu} =
(\nu - 1) \Delta \omega_i
{\rm ~~and~~} \Delta \omega_i = \frac{\omega_i}{Q-1}
, \nonumber
\end{equation}
\end{varwidth}
\end{document}

BIN
doc/src/Eqs/neb_spin_k.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

View File

@ -0,0 +1,16 @@
\documentclass[preview]{standalone}
\usepackage{varwidth}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath, amssymb, graphics, setspace}
\begin{document}
\begin{varwidth}{50in}
\begin{equation}
\vec{k}_i =
\frac{\vec{m}_i^I \times \vec{m}_i^F}{\left|\vec{m}_i^I
\times \vec{m}_i^F\right|}
%&{\rm ~if~}& \vec{m}_i^I \times \vec{m}_i^F
, \nonumber
\end{equation}
\end{varwidth}
\end{document}

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -0,0 +1,16 @@
\documentclass[preview]{standalone}
\usepackage{varwidth}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath, amssymb, graphics, setspace}
\begin{document}
\begin{varwidth}{50in}
\begin{equation}
\vec{m}_i^{\nu} = \vec{m}_i^{I} \cos(\omega_i^{\nu})
+ (\vec{k}_i \times \vec{m}_i^{I}) \sin(\omega_i^{\nu})
+ (1.0-\cos(\omega_i^{\nu})) \vec{k}_i (\vec{k}_i\cdot
\vec{m}_i^{I})
, \nonumber
\end{equation}
\end{varwidth}
\end{document}

18
doc/src/Eqs/pair_agni.tex Normal file
View File

@ -0,0 +1,18 @@
\documentclass[12pt]{article}
\pagestyle{empty}
\begin{document}
\begin{eqnarray*}
F_i^u & = & \sum_t^{N_t}\alpha_t \cdot \exp\left[-\frac{\left(d_{i,t}^u\right)^2}{2l^2}\right] \\
d_{i,t}^u & = & \left|\left| V_i^u(\eta) - V_t^u(\eta) \right|\right| \\
V_i^u(\eta) & = & \sum_{j \neq i}\frac{r^u_{ij}}{r_{ij}} \cdot e^{-\left(\frac{r_{ij}}{\eta} \right)^2} \cdot f_d\left(r_{ij}\right) \\
f_d\left(r_{ij}\right) & = & \frac{1}{2} \left[\cos\left(\frac{\pi r_{ij}}{R_c}\right) + 1 \right]
\end{eqnarray*}
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:

View File

@ -1,6 +1,7 @@
\documentclass[12pt]{article}
\begin{document}
\pagestyle{empty}
\begin{eqnarray*}
E = A e^{-\kappa r} - \frac{C}{r^6} \cdot \frac{1}{1 + D r^{14}} \qquad r < r_c \\

View File

@ -0,0 +1,15 @@
\documentclass[12pt]{article}
\pagestyle{empty}
\begin{document}
$$
E = \frac{C_{q_i q_j}}{\epsilon r_{ij}}\,\, \textrm{erf}\left(\alpha_{ij} r_{ij}\right)\quad\quad\quad r < r_c
$$
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:

BIN
doc/src/Eqs/pair_drip.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

14
doc/src/Eqs/pair_drip.tex Normal file
View File

@ -0,0 +1,14 @@
\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{bm}
\begin{document}
\begin{eqnarray*}
E &=& \frac{1}{2} \sum_{i} \sum_{j\notin\text{layer}\,i} \phi_{ij} \\\phi_{ij} &=& f_\text{c}(x_r) \left[ e^{-\lambda(r_{ij} - z_0 )} \left[C+f(\rho_{ij})+ g(\rho_{ij}, \{\alpha_{ij}^{(m)}\}) \right]- A\left (\frac{z_0}{r_{ij}} \right)^6 \right] \\
\end{eqnarray*}
\end{document}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 178 KiB

After

Width:  |  Height:  |  Size: 49 KiB

View File

@ -27,7 +27,7 @@
V_{ij} & = & e^{-\lambda (r_{ij} -z_0)} \left [ C + f(\rho_{ij}) + f(\rho_{ji}) - A \left ( \frac{r_{ij}}{z_0}\right )^{-6} \right ] \\
\rho_{ij}^2 & = & r_{ij}^2 - ({\bf r}_{ij}\cdot {\bf n}_{i})^2 \\[15pt]
\rho_{ji}^2 & = & r_{ij}^2 - ({\bf r}_{ij}\cdot {\bf n}_{j})^2 \\[15pt]
f(\rho) & = & e^{-(\rho/\delta)^2} \sum_{n=0}^2 C_{2n} { \rho/\delta }^{2n}
f(\rho) & = & e^{-(\rho/\delta)^2} \sum_{n=0}^2 C_{2n} { (\rho/\delta) }^{2n}
\end{eqnarray*}
\endgroup
\end{document}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Some files were not shown because too many files have changed in this diff Show More