Merge branch 'master' into bond/react-new-examples-and-package
2
.github/CONTRIBUTING.md
vendored
@ -73,7 +73,7 @@ Here is a checklist of steps you need to follow to submit a single file or user
|
|||||||
* If you want your contribution to be added as a user-contributed feature, and it is a single file (actually a `<name>.cpp` and `<name>.h` file) it can be rapidly added to the USER-MISC directory. Include the one-line entry to add to the USER-MISC/README file in that directory, along with the 2 source files. You can do this multiple times if you wish to contribute several individual features.
|
* If you want your contribution to be added as a user-contributed feature, and it is a single file (actually a `<name>.cpp` and `<name>.h` file) it can be rapidly added to the USER-MISC directory. Include the one-line entry to add to the USER-MISC/README file in that directory, along with the 2 source files. You can do this multiple times if you wish to contribute several individual features.
|
||||||
* If you want your contribution to be added as a user-contribution and it is several related features, it is probably best to make it a user package directory with a name like USER-FOO. In addition to your new files, the directory should contain a README text file. The README should contain your name and contact information and a brief description of what your new package does. If your files depend on other LAMMPS style files also being installed (e.g. because your file is a derived class from the other LAMMPS class), then an Install.sh file is also needed to check for those dependencies. See other README and Install.sh files in other USER directories as examples. Send us a tarball of this USER-FOO directory.
|
* If you want your contribution to be added as a user-contribution and it is several related features, it is probably best to make it a user package directory with a name like USER-FOO. In addition to your new files, the directory should contain a README text file. The README should contain your name and contact information and a brief description of what your new package does. If your files depend on other LAMMPS style files also being installed (e.g. because your file is a derived class from the other LAMMPS class), then an Install.sh file is also needed to check for those dependencies. See other README and Install.sh files in other USER directories as examples. Send us a tarball of this USER-FOO directory.
|
||||||
* Your new source files need to have the LAMMPS copyright, GPL notice, and your name and email address at the top, like other user-contributed LAMMPS source files. They need to create a class that is inside the LAMMPS namespace. If the file is for one of the USER packages, including USER-MISC, then we are not as picky about the coding style (see above). I.e. the files do not need to be in the same stylistic format and syntax as other LAMMPS files, though that would be nice for developers as well as users who try to read your code.
|
* Your new source files need to have the LAMMPS copyright, GPL notice, and your name and email address at the top, like other user-contributed LAMMPS source files. They need to create a class that is inside the LAMMPS namespace. If the file is for one of the USER packages, including USER-MISC, then we are not as picky about the coding style (see above). I.e. the files do not need to be in the same stylistic format and syntax as other LAMMPS files, though that would be nice for developers as well as users who try to read your code.
|
||||||
* You **must** also create or extend a documentation file for each new command or style you are adding to LAMMPS. For simplicity and convenience, the documentation of groups of closely related commands or styles may be combined into a single file. This will be one file for a single-file feature. For a package, it might be several files. These are files in the [reStructuredText](https://docutils.sourceforge.io/rst.html) markup language, that are then converted to HTML and PDF. The tools for this conversion are included in the source distribution, and the translation can be as simple as doing "make html pdf" in the doc folder. Thus the documentation source files must be in the same format and style as other `<name>.rst` files in the lammps/doc/src directory for similar commands and styles; use one or more of them as a starting point. An introduction to reStructuredText can be found at [https://docutils.sourceforge.io/docs/user/rst/quickstart.html](https://docutils.sourceforge.io/docs/user/rst/quickstart.html). As appropriate, the text files can include mathematical expressions in MathJAX markup or links to equations (see doc/Eqs/*.tex for examples, we auto-create the associated JPG files), or figures (see doc/JPG for examples), or even additional PDF files with further details (see doc/PDF for examples). The doc page should also include literature citations as appropriate; see the bottom of doc/fix_nh.rst for examples and the earlier part of the same file for how to format the cite itself. The "Restrictions" section of the doc page should indicate that your command is only available if LAMMPS is built with the appropriate USER-MISC or USER-FOO package. See other user package doc files for examples of how to do this. The prerequisite for building the HTML format files are Python 3.x and virtualenv. Please run at least `make html` and `make spelling` and carefully inspect and proofread the resulting HTML format doc page as well as the output produced to the screen. Make sure that all spelling errors are fixed or the necessary false positives are added to the `doc/utils/sphinx-config/false_positives.txt` file. For new styles, those usually also need to be added to lists on the respective overview pages. This can be checked for also with `make style_check`.
|
* You **must** also create or extend a documentation file for each new command or style you are adding to LAMMPS. For simplicity and convenience, the documentation of groups of closely related commands or styles may be combined into a single file. This will be one file for a single-file feature. For a package, it might be several files. These are files in the [reStructuredText](https://docutils.sourceforge.io/rst.html) markup language, that are then converted to HTML and PDF. The tools for this conversion are included in the source distribution, and the translation can be as simple as doing "make html pdf" in the doc folder. Thus the documentation source files must be in the same format and style as other `<name>.rst` files in the lammps/doc/src directory for similar commands and styles; use one or more of them as a starting point. An introduction to reStructuredText can be found at [https://docutils.sourceforge.io/docs/user/rst/quickstart.html](https://docutils.sourceforge.io/docs/user/rst/quickstart.html). The text files can include mathematical expressions and symbol in ".. math::" sections or ":math:" expressions or figures (see doc/JPG for examples), or even additional PDF files with further details (see doc/PDF for examples). The doc page should also include literature citations as appropriate; see the bottom of doc/fix_nh.rst for examples and the earlier part of the same file for how to format the cite itself. The "Restrictions" section of the doc page should indicate that your command is only available if LAMMPS is built with the appropriate USER-MISC or USER-FOO package. See other user package doc files for examples of how to do this. The prerequisite for building the HTML format files are Python 3.x and virtualenv. Please run at least `make html`, `make pdf` and `make spelling` and carefully inspect and proofread the resulting HTML format doc page as well as the output produced to the screen. Make sure that all spelling errors are fixed or the necessary false positives are added to the `doc/utils/sphinx-config/false_positives.txt` file. For new styles, those usually also need to be added to lists on the respective overview pages. This can be checked for also with `make style_check`.
|
||||||
* For a new package (or even a single command) you should include one or more example scripts demonstrating its use. These should run in no more than a couple minutes, even on a single processor, and not require large data files as input. See directories under examples/USER for examples of input scripts other users provided for their packages. These example inputs are also required for validating memory accesses and testing for memory leaks with valgrind
|
* For a new package (or even a single command) you should include one or more example scripts demonstrating its use. These should run in no more than a couple minutes, even on a single processor, and not require large data files as input. See directories under examples/USER for examples of input scripts other users provided for their packages. These example inputs are also required for validating memory accesses and testing for memory leaks with valgrind
|
||||||
* If there is a paper of yours describing your feature (either the algorithm/science behind the feature itself, or its initial usage, or its implementation in LAMMPS), you can add the citation to the *.cpp source file. See src/USER-EFF/atom_vec_electron.cpp for an example. A LaTeX citation is stored in a variable at the top of the file and a single line of code that references the variable is added to the constructor of the class. Whenever a user invokes your feature from their input script, this will cause LAMMPS to output the citation to a log.cite file and prompt the user to examine the file. Note that you should only use this for a paper you or your group authored. E.g. adding a cite in the code for a paper by Nose and Hoover if you write a fix that implements their integrator is not the intended usage. That kind of citation should just be in the doc page you provide.
|
* If there is a paper of yours describing your feature (either the algorithm/science behind the feature itself, or its initial usage, or its implementation in LAMMPS), you can add the citation to the *.cpp source file. See src/USER-EFF/atom_vec_electron.cpp for an example. A LaTeX citation is stored in a variable at the top of the file and a single line of code that references the variable is added to the constructor of the class. Whenever a user invokes your feature from their input script, this will cause LAMMPS to output the citation to a log.cite file and prompt the user to examine the file. Note that you should only use this for a paper you or your group authored. E.g. adding a cite in the code for a paper by Nose and Hoover if you write a fix that implements their integrator is not the intended usage. That kind of citation should just be in the doc page you provide.
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
# CMake build system
|
# CMake build system
|
||||||
# This file is part of LAMMPS
|
# This file is part of LAMMPS
|
||||||
# Created by Christoph Junghans and Richard Berger
|
# Created by Christoph Junghans and Richard Berger
|
||||||
cmake_minimum_required(VERSION 2.8.12)
|
cmake_minimum_required(VERSION 3.10)
|
||||||
|
|
||||||
project(lammps CXX)
|
project(lammps CXX)
|
||||||
set(SOVERSION 0)
|
set(SOVERSION 0)
|
||||||
@ -36,7 +36,6 @@ get_lammps_version(${LAMMPS_SOURCE_DIR}/version.h LAMMPS_VERSION)
|
|||||||
include(PreventInSourceBuilds)
|
include(PreventInSourceBuilds)
|
||||||
|
|
||||||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS)
|
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS)
|
||||||
#release comes with -O3 by default
|
|
||||||
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
|
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
|
||||||
endif(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS)
|
endif(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS)
|
||||||
string(TOUPPER "${CMAKE_BUILD_TYPE}" BTYPE)
|
string(TOUPPER "${CMAKE_BUILD_TYPE}" BTYPE)
|
||||||
@ -53,16 +52,19 @@ include(CheckCCompilerFlag)
|
|||||||
include(CheckIncludeFileCXX)
|
include(CheckIncludeFileCXX)
|
||||||
|
|
||||||
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
|
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
|
||||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -restrict -std=c++11")
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -restrict")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
option(DISABLE_CXX11_REQUIREMENT "Disable check that requires C++11 for compiling LAMMPS" OFF)
|
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
||||||
if(DISABLE_CXX11_REQUIREMENT)
|
if(NOT ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug"))
|
||||||
add_definitions(-DLAMMPS_CXX98)
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffast-math -ftree-vectorize -fexpensive-optimizations")
|
||||||
# else()
|
endif()
|
||||||
# set(CMAKE_CXX_STANDARD 11)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# we require C++11
|
||||||
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
# GNU compiler features
|
# GNU compiler features
|
||||||
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
||||||
option(ENABLE_COVERAGE "Enable code coverage" OFF)
|
option(ENABLE_COVERAGE "Enable code coverage" OFF)
|
||||||
@ -179,6 +181,7 @@ option(BUILD_MPI "Build MPI version" ${MPI_FOUND})
|
|||||||
if(BUILD_MPI)
|
if(BUILD_MPI)
|
||||||
find_package(MPI REQUIRED)
|
find_package(MPI REQUIRED)
|
||||||
include_directories(${MPI_CXX_INCLUDE_PATH})
|
include_directories(${MPI_CXX_INCLUDE_PATH})
|
||||||
|
add_definitions(-DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1)
|
||||||
list(APPEND LAMMPS_LINK_LIBS ${MPI_CXX_LIBRARIES})
|
list(APPEND LAMMPS_LINK_LIBS ${MPI_CXX_LIBRARIES})
|
||||||
option(LAMMPS_LONGLONG_TO_LONG "Workaround if your system or MPI version does not recognize 'long long' data types" OFF)
|
option(LAMMPS_LONGLONG_TO_LONG "Workaround if your system or MPI version does not recognize 'long long' data types" OFF)
|
||||||
if(LAMMPS_LONGLONG_TO_LONG)
|
if(LAMMPS_LONGLONG_TO_LONG)
|
||||||
@ -356,9 +359,6 @@ endforeach(HEADER)
|
|||||||
set(MATH_LIBRARIES "m" CACHE STRING "math library")
|
set(MATH_LIBRARIES "m" CACHE STRING "math library")
|
||||||
mark_as_advanced( MATH_LIBRARIES )
|
mark_as_advanced( MATH_LIBRARIES )
|
||||||
include(CheckLibraryExists)
|
include(CheckLibraryExists)
|
||||||
if (CMAKE_VERSION VERSION_LESS "3.4")
|
|
||||||
enable_language(C) # check_library_exists isn't supported without a C compiler before v3.4
|
|
||||||
endif()
|
|
||||||
# RB: disabled this check because it breaks with KOKKOS CUDA enabled
|
# RB: disabled this check because it breaks with KOKKOS CUDA enabled
|
||||||
#foreach(FUNC sin cos)
|
#foreach(FUNC sin cos)
|
||||||
# check_library_exists(${MATH_LIBRARIES} ${FUNC} "" FOUND_${FUNC}_${MATH_LIBRARIES})
|
# check_library_exists(${MATH_LIBRARIES} ${FUNC} "" FOUND_${FUNC}_${MATH_LIBRARIES})
|
||||||
@ -420,7 +420,7 @@ endforeach()
|
|||||||
##############################################
|
##############################################
|
||||||
# add lib sources of (simple) enabled packages
|
# add lib sources of (simple) enabled packages
|
||||||
############################################
|
############################################
|
||||||
foreach(SIMPLE_LIB POEMS USER-ATC USER-AWPMD USER-H5MD USER-QMMM)
|
foreach(SIMPLE_LIB POEMS USER-ATC USER-AWPMD USER-H5MD)
|
||||||
if(PKG_${SIMPLE_LIB})
|
if(PKG_${SIMPLE_LIB})
|
||||||
string(REGEX REPLACE "^USER-" "" PKG_LIB "${SIMPLE_LIB}")
|
string(REGEX REPLACE "^USER-" "" PKG_LIB "${SIMPLE_LIB}")
|
||||||
string(TOLOWER "${PKG_LIB}" PKG_LIB)
|
string(TOLOWER "${PKG_LIB}" PKG_LIB)
|
||||||
@ -682,7 +682,7 @@ endforeach()
|
|||||||
|
|
||||||
get_directory_property(CPPFLAGS DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS)
|
get_directory_property(CPPFLAGS DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS)
|
||||||
include(FeatureSummary)
|
include(FeatureSummary)
|
||||||
feature_summary(DESCRIPTION "The following packages have been found:" WHAT PACKAGES_FOUND)
|
feature_summary(DESCRIPTION "The following tools and libraries have been found and configured:" WHAT PACKAGES_FOUND)
|
||||||
message(STATUS "<<< Build configuration >>>
|
message(STATUS "<<< Build configuration >>>
|
||||||
Build type ${CMAKE_BUILD_TYPE}
|
Build type ${CMAKE_BUILD_TYPE}
|
||||||
Install path ${CMAKE_INSTALL_PREFIX}
|
Install path ${CMAKE_INSTALL_PREFIX}
|
||||||
@ -702,7 +702,7 @@ if (${_index} GREATER -1)
|
|||||||
endif()
|
endif()
|
||||||
list (FIND LANGUAGES "C" _index)
|
list (FIND LANGUAGES "C" _index)
|
||||||
if (${_index} GREATER -1)
|
if (${_index} GREATER -1)
|
||||||
message(STATUS "C Compiler ${CMAKE_C_COMPILER}
|
message(STATUS "C compiler ${CMAKE_C_COMPILER}
|
||||||
Type ${CMAKE_C_COMPILER_ID}
|
Type ${CMAKE_C_COMPILER_ID}
|
||||||
Version ${CMAKE_C_COMPILER_VERSION}
|
Version ${CMAKE_C_COMPILER_VERSION}
|
||||||
C Flags ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${BTYPE}}")
|
C Flags ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${BTYPE}}")
|
||||||
@ -712,22 +712,22 @@ if(CMAKE_EXE_LINKER_FLAGS)
|
|||||||
Executable ${CMAKE_EXE_LINKER_FLAGS}")
|
Executable ${CMAKE_EXE_LINKER_FLAGS}")
|
||||||
endif()
|
endif()
|
||||||
if(BUILD_SHARED_LIBS)
|
if(BUILD_SHARED_LIBS)
|
||||||
message(STATUS "Shared libraries ${CMAKE_SHARED_LINKER_FLAGS}")
|
message(STATUS "Shared library flags: ${CMAKE_SHARED_LINKER_FLAGS}")
|
||||||
else()
|
else()
|
||||||
message(STATUS "Static libraries ${CMAKE_STATIC_LINKER_FLAGS}")
|
message(STATUS "Static library flags: ${CMAKE_STATIC_LINKER_FLAGS}")
|
||||||
endif()
|
endif()
|
||||||
message(STATUS "Link libraries: ${LAMMPS_LINK_LIBS}")
|
message(STATUS "Link libraries: ${LAMMPS_LINK_LIBS}")
|
||||||
if(BUILD_MPI)
|
if(BUILD_MPI)
|
||||||
message(STATUS "Using mpi with headers in ${MPI_CXX_INCLUDE_PATH} and ${MPI_CXX_LIBRARIES}")
|
message(STATUS "Using MPI with headers in ${MPI_CXX_INCLUDE_PATH} and ${MPI_CXX_LIBRARIES}")
|
||||||
endif()
|
endif()
|
||||||
if(PKG_GPU)
|
if(PKG_GPU)
|
||||||
message(STATUS "GPU Api: ${GPU_API}")
|
message(STATUS "GPU API: ${GPU_API}")
|
||||||
if(GPU_API STREQUAL "CUDA")
|
if(GPU_API STREQUAL "CUDA")
|
||||||
message(STATUS "GPU Arch: ${GPU_ARCH}")
|
message(STATUS "GPU architecture: ${GPU_ARCH}")
|
||||||
elseif(GPU_API STREQUAL "OPENCL")
|
elseif(GPU_API STREQUAL "OPENCL")
|
||||||
message(STATUS "OCL Tune: ${OCL_TUNE}")
|
message(STATUS "OpenCL parameter tuning: ${OCL_TUNE}")
|
||||||
endif()
|
endif()
|
||||||
message(STATUS "GPU Precision: ${GPU_PREC}")
|
message(STATUS "GPU precision: ${GPU_PREC}")
|
||||||
endif()
|
endif()
|
||||||
if(PKG_KOKKOS)
|
if(PKG_KOKKOS)
|
||||||
message(STATUS "Kokkos Arch: ${KOKKOS_ARCH}")
|
message(STATUS "Kokkos Arch: ${KOKKOS_ARCH}")
|
||||||
|
|||||||
@ -1,29 +0,0 @@
|
|||||||
# - Find quantum-espresso
|
|
||||||
# Find the native QE headers and libraries.
|
|
||||||
#
|
|
||||||
# QE_INCLUDE_DIRS - where to find quantum-espresso.h, etc.
|
|
||||||
# QE_LIBRARIES - List of libraries when using quantum-espresso.
|
|
||||||
# QE_FOUND - True if quantum-espresso found.
|
|
||||||
#
|
|
||||||
|
|
||||||
find_path(QE_INCLUDE_DIR libqecouple.h PATH_SUFFIXES COUPLE/include)
|
|
||||||
|
|
||||||
find_library(QECOUPLE_LIBRARY NAMES qecouple)
|
|
||||||
find_library(PW_LIBRARY NAMES pw)
|
|
||||||
find_library(QEMOD_LIBRARY NAMES qemod)
|
|
||||||
find_library(QEFFT_LIBRARY NAMES qefft)
|
|
||||||
find_library(QELA_LIBRARY NAMES qela)
|
|
||||||
find_library(CLIB_LIBRARY NAMES clib)
|
|
||||||
find_library(IOTK_LIBRARY NAMES iotk)
|
|
||||||
|
|
||||||
|
|
||||||
set(QE_LIBRARIES ${QECOUPLE_LIBRARY} ${PW_LIBRARY} ${QEMOD_LIBRARY} ${QEFFT_LIBRARY} ${QELA_LIBRARY} ${CLIB_LIBRARY} ${IOTK_LIBRARY})
|
|
||||||
set(QE_INCLUDE_DIRS ${QE_INCLUDE_DIR})
|
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
|
||||||
# handle the QUIETLY and REQUIRED arguments and set QE_FOUND to TRUE
|
|
||||||
# if all listed variables are TRUE
|
|
||||||
|
|
||||||
find_package_handle_standard_args(QE DEFAULT_MSG QECOUPLE_LIBRARY PW_LIBRARY QEMOD_LIBRARY QEFFT_LIBRARY QELA_LIBRARY CLIB_LIBRARY IOTK_LIBRARY QE_INCLUDE_DIR)
|
|
||||||
|
|
||||||
mark_as_advanced(QE_INCLUDE_DIR QECOUPLE_LIBRARY PW_LIBRARY QEMOD_LIBRARY QEFFT_LIBRARY QELA_LIBRARY CLIB_LIBRARY IOTK_LIBRARY)
|
|
||||||
@ -1,7 +1,4 @@
|
|||||||
if(PKG_GPU)
|
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_DIR ${LAMMPS_SOURCE_DIR}/GPU)
|
||||||
set(GPU_SOURCES ${GPU_SOURCES_DIR}/gpu_extra.h
|
set(GPU_SOURCES ${GPU_SOURCES_DIR}/gpu_extra.h
|
||||||
${GPU_SOURCES_DIR}/fix_gpu.h
|
${GPU_SOURCES_DIR}/fix_gpu.h
|
||||||
|
|||||||
@ -8,9 +8,6 @@ if(PKG_LATTE)
|
|||||||
endif()
|
endif()
|
||||||
option(DOWNLOAD_LATTE "Download the LATTE library instead of using an already installed one" ${DOWNLOAD_LATTE_DEFAULT})
|
option(DOWNLOAD_LATTE "Download the LATTE library instead of using an already installed one" ${DOWNLOAD_LATTE_DEFAULT})
|
||||||
if(DOWNLOAD_LATTE)
|
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")
|
if(CMAKE_GENERATOR STREQUAL "Ninja")
|
||||||
message(FATAL_ERROR "Cannot build downloaded LATTE library with Ninja build tool")
|
message(FATAL_ERROR "Cannot build downloaded LATTE library with Ninja build tool")
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@ -8,9 +8,6 @@ if(PKG_MSCG)
|
|||||||
endif()
|
endif()
|
||||||
option(DOWNLOAD_MSCG "Download MSCG library instead of using an already installed one)" ${DOWNLOAD_MSCG_DEFAULT})
|
option(DOWNLOAD_MSCG "Download MSCG library instead of using an already installed one)" ${DOWNLOAD_MSCG_DEFAULT})
|
||||||
if(DOWNLOAD_MSCG)
|
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")
|
if(CMAKE_GENERATOR STREQUAL "Ninja")
|
||||||
message(FATAL_ERROR "Cannot build downloaded MSCG library with Ninja build tool")
|
message(FATAL_ERROR "Cannot build downloaded MSCG library with Ninja build tool")
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@ -1,8 +1,4 @@
|
|||||||
if(PKG_USER-MOLFILE)
|
if(PKG_USER-MOLFILE)
|
||||||
if (CMAKE_VERSION VERSION_LESS "3.10") # due to INTERFACE without a library
|
|
||||||
message(FATAL_ERROR "For configuring USER-MOLFILE you need CMake 3.10 or later")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(MOLFILE_INCLUDE_DIRS "${LAMMPS_LIB_SOURCE_DIR}/molfile" CACHE STRING "Path to VMD molfile plugin headers")
|
set(MOLFILE_INCLUDE_DIRS "${LAMMPS_LIB_SOURCE_DIR}/molfile" CACHE STRING "Path to VMD molfile plugin headers")
|
||||||
add_library(molfile INTERFACE)
|
add_library(molfile INTERFACE)
|
||||||
target_include_directories(molfile INTERFACE ${MOLFILE_INCLUDE_DIRS})
|
target_include_directories(molfile INTERFACE ${MOLFILE_INCLUDE_DIRS})
|
||||||
|
|||||||
@ -1,9 +1,13 @@
|
|||||||
if(PKG_USER-QMMM)
|
if(PKG_USER-QMMM)
|
||||||
enable_language(Fortran)
|
|
||||||
enable_language(C)
|
enable_language(C)
|
||||||
|
|
||||||
message(WARNING "Building QMMM with CMake is still experimental")
|
if(NOT BUILD_LIB)
|
||||||
find_package(QE REQUIRED)
|
message(FATAL_ERROR "Building a QM/MM executable with USER-QMMM requires BUILD_LIB=yes")
|
||||||
include_directories(${QE_INCLUDE_DIRS})
|
endif()
|
||||||
list(APPEND LAMMPS_LINK_LIBS ${QE_LIBRARIES})
|
if(NOT BUILD_SHARED_LIBS)
|
||||||
|
message(WARNING "It is recommended to use BUILD_SHARED_LIBS=yes with USER-QMMM")
|
||||||
|
endif()
|
||||||
|
add_library(qmmm STATIC ${LAMMPS_LIB_SOURCE_DIR}/qmmm/libqmmm.c)
|
||||||
|
list(APPEND LAMMPS_LINK_LIBS qmmm)
|
||||||
|
target_include_directories(qmmm PUBLIC ${LAMMPS_LIB_SOURCE_DIR}/qmmm)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
2
doc/.gitignore
vendored
@ -1,6 +1,8 @@
|
|||||||
/old
|
/old
|
||||||
/html
|
/html
|
||||||
|
/html-offline
|
||||||
/latex
|
/latex
|
||||||
|
/mathjax
|
||||||
/spelling
|
/spelling
|
||||||
/LAMMPS.epub
|
/LAMMPS.epub
|
||||||
/LAMMPS.mobi
|
/LAMMPS.mobi
|
||||||
|
|||||||
34
doc/Makefile
@ -4,6 +4,7 @@ SHELL = /bin/bash
|
|||||||
BUILDDIR = ${CURDIR}
|
BUILDDIR = ${CURDIR}
|
||||||
RSTDIR = $(BUILDDIR)/src
|
RSTDIR = $(BUILDDIR)/src
|
||||||
VENV = $(BUILDDIR)/docenv
|
VENV = $(BUILDDIR)/docenv
|
||||||
|
MATHJAX = $(BUILDDIR)/mathjax
|
||||||
TXT2RST = $(VENV)/bin/txt2rst
|
TXT2RST = $(VENV)/bin/txt2rst
|
||||||
ANCHORCHECK = $(VENV)/bin/rst_anchor_check
|
ANCHORCHECK = $(VENV)/bin/rst_anchor_check
|
||||||
|
|
||||||
@ -28,7 +29,7 @@ endif
|
|||||||
|
|
||||||
SPHINXEXTRA = -j $(shell $(PYTHON) -c 'import multiprocessing;print(multiprocessing.cpu_count())')
|
SPHINXEXTRA = -j $(shell $(PYTHON) -c 'import multiprocessing;print(multiprocessing.cpu_count())')
|
||||||
|
|
||||||
.PHONY: help clean-all clean epub mobi rst html pdf venv spelling anchor_check style_check
|
.PHONY: help clean-all clean clean-spelling epub mobi rst html pdf spelling anchor_check style_check
|
||||||
|
|
||||||
# ------------------------------------------
|
# ------------------------------------------
|
||||||
|
|
||||||
@ -44,34 +45,32 @@ help:
|
|||||||
@echo " clean-all reset the entire build environment"
|
@echo " clean-all reset the entire build environment"
|
||||||
@echo " anchor_check scan for duplicate anchor labels"
|
@echo " anchor_check scan for duplicate anchor labels"
|
||||||
@echo " style_check check for complete and consistent style lists"
|
@echo " style_check check for complete and consistent style lists"
|
||||||
|
@echo " package_check check for complete and consistent package lists"
|
||||||
@echo " spelling spell-check the manual"
|
@echo " spelling spell-check the manual"
|
||||||
|
|
||||||
# ------------------------------------------
|
# ------------------------------------------
|
||||||
|
|
||||||
clean-all: clean
|
clean-all: clean
|
||||||
rm -rf $(BUILDDIR)/docenv $(BUILDDIR)/doctrees
|
rm -rf $(BUILDDIR)/docenv $(BUILDDIR)/doctrees $(BUILDDIR)/mathjax
|
||||||
|
|
||||||
clean:
|
clean: clean-spelling
|
||||||
rm -rf html epub latex
|
rm -rf html epub latex
|
||||||
rm -rf spelling
|
|
||||||
|
|
||||||
clean-spelling:
|
clean-spelling:
|
||||||
rm -rf spelling
|
rm -rf spelling
|
||||||
|
|
||||||
rst: clean $(ANCHORCHECK)
|
html: $(ANCHORCHECK) $(MATHJAX)
|
||||||
|
|
||||||
html: $(ANCHORCHECK)
|
|
||||||
@(\
|
@(\
|
||||||
. $(VENV)/bin/activate ;\
|
. $(VENV)/bin/activate ;\
|
||||||
sphinx-build $(SPHINXEXTRA) -b html -c utils/sphinx-config -d $(BUILDDIR)/doctrees $(RSTDIR) html ;\
|
sphinx-build $(SPHINXEXTRA) -b html -c utils/sphinx-config -d $(BUILDDIR)/doctrees $(RSTDIR) html ;\
|
||||||
echo "############################################" ;\
|
echo "############################################" ;\
|
||||||
rst_anchor_check src/*.rst ;\
|
rst_anchor_check src/*.rst ;\
|
||||||
|
python utils/check-packages.py -s ../src -d src ;\
|
||||||
env LC_ALL=C grep -n '[^ -~]' $(RSTDIR)/*.rst ;\
|
env LC_ALL=C grep -n '[^ -~]' $(RSTDIR)/*.rst ;\
|
||||||
python utils/check-styles.py -s ../src -d src ;\
|
python utils/check-styles.py -s ../src -d src ;\
|
||||||
echo "############################################" ;\
|
echo "############################################" ;\
|
||||||
deactivate ;\
|
deactivate ;\
|
||||||
)
|
)
|
||||||
-rm html/searchindex.js
|
|
||||||
@rm -rf html/_sources
|
@rm -rf html/_sources
|
||||||
@rm -rf html/PDF
|
@rm -rf html/PDF
|
||||||
@rm -rf html/USER
|
@rm -rf html/USER
|
||||||
@ -84,9 +83,11 @@ html: $(ANCHORCHECK)
|
|||||||
@rm -rf html/USER/.[sg]*
|
@rm -rf html/USER/.[sg]*
|
||||||
@rm -rf html/USER/*/.[sg]*
|
@rm -rf html/USER/*/.[sg]*
|
||||||
@rm -rf html/USER/*/*.[sg]*
|
@rm -rf html/USER/*/*.[sg]*
|
||||||
|
@mkdir -p html/_static/mathjax
|
||||||
|
@cp -r $(MATHJAX)/es5 html/_static/mathjax/
|
||||||
@echo "Build finished. The HTML pages are in doc/html."
|
@echo "Build finished. The HTML pages are in doc/html."
|
||||||
|
|
||||||
spelling: utils/sphinx-config/false_positives.txt
|
spelling: $(VENV) utils/sphinx-config/false_positives.txt
|
||||||
@(\
|
@(\
|
||||||
. $(VENV)/bin/activate ;\
|
. $(VENV)/bin/activate ;\
|
||||||
pip install sphinxcontrib-spelling ;\
|
pip install sphinxcontrib-spelling ;\
|
||||||
@ -96,7 +97,7 @@ spelling: utils/sphinx-config/false_positives.txt
|
|||||||
)
|
)
|
||||||
@echo "Spell check finished."
|
@echo "Spell check finished."
|
||||||
|
|
||||||
epub:
|
epub: $(VENV)
|
||||||
@mkdir -p epub/JPG
|
@mkdir -p epub/JPG
|
||||||
@rm -f LAMMPS.epub
|
@rm -f LAMMPS.epub
|
||||||
@cp src/JPG/lammps-logo.png epub/
|
@cp src/JPG/lammps-logo.png epub/
|
||||||
@ -128,6 +129,7 @@ pdf: $(ANCHORCHECK)
|
|||||||
sphinx-build $(SPHINXEXTRA) -b latex -c utils/sphinx-config -d $(BUILDDIR)/doctrees $(RSTDIR) latex ;\
|
sphinx-build $(SPHINXEXTRA) -b latex -c utils/sphinx-config -d $(BUILDDIR)/doctrees $(RSTDIR) latex ;\
|
||||||
echo "############################################" ;\
|
echo "############################################" ;\
|
||||||
rst_anchor_check src/*.rst ;\
|
rst_anchor_check src/*.rst ;\
|
||||||
|
python utils/check-packages.py -s ../src -d src ;\
|
||||||
env LC_ALL=C grep -n '[^ -~]' $(RSTDIR)/*.rst ;\
|
env LC_ALL=C grep -n '[^ -~]' $(RSTDIR)/*.rst ;\
|
||||||
python utils/check-styles.py -s ../src -d src ;\
|
python utils/check-styles.py -s ../src -d src ;\
|
||||||
echo "############################################" ;\
|
echo "############################################" ;\
|
||||||
@ -171,13 +173,20 @@ anchor_check : $(ANCHORCHECK)
|
|||||||
deactivate ;\
|
deactivate ;\
|
||||||
)
|
)
|
||||||
|
|
||||||
style_check :
|
style_check : $(VENV)
|
||||||
@(\
|
@(\
|
||||||
. $(VENV)/bin/activate ;\
|
. $(VENV)/bin/activate ;\
|
||||||
python utils/check-styles.py -s ../src -d src ;\
|
python utils/check-styles.py -s ../src -d src ;\
|
||||||
deactivate ;\
|
deactivate ;\
|
||||||
)
|
)
|
||||||
|
|
||||||
|
package_check : $(VENV)
|
||||||
|
@(\
|
||||||
|
. $(VENV)/bin/activate ;\
|
||||||
|
python utils/check-packages.py -s ../src -d src ;\
|
||||||
|
deactivate ;\
|
||||||
|
)
|
||||||
|
|
||||||
# ------------------------------------------
|
# ------------------------------------------
|
||||||
|
|
||||||
$(VENV):
|
$(VENV):
|
||||||
@ -190,6 +199,9 @@ $(VENV):
|
|||||||
deactivate;\
|
deactivate;\
|
||||||
)
|
)
|
||||||
|
|
||||||
|
$(MATHJAX):
|
||||||
|
@git clone --depth 1 https://github.com/mathjax/MathJax.git mathjax
|
||||||
|
|
||||||
$(TXT2RST) $(ANCHORCHECK): $(VENV)
|
$(TXT2RST) $(ANCHORCHECK): $(VENV)
|
||||||
@( \
|
@( \
|
||||||
. $(VENV)/bin/activate; \
|
. $(VENV)/bin/activate; \
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
.TH LAMMPS "18 February 2020" "2020-02-18"
|
.TH LAMMPS "3 March 2020" "2020-03-03"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
.B LAMMPS
|
.B LAMMPS
|
||||||
\- Molecular Dynamics Simulator.
|
\- Molecular Dynamics Simulator.
|
||||||
|
|||||||
@ -19,94 +19,115 @@ CMake and make:
|
|||||||
Serial vs parallel build
|
Serial vs parallel build
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
|
|
||||||
LAMMPS can be built to run in parallel using the ubiquitous `MPI (message-passing interface) <https://en.wikipedia.org/wiki/Message_Passing_Interface>`_
|
LAMMPS is written to use the ubiquitous `MPI (Message Passing Interface)
|
||||||
library. Or it can built to run on a single processor (serial)
|
<https://en.wikipedia.org/wiki/Message_Passing_Interface>`_ library API
|
||||||
without MPI. It can also be built with support for OpenMP threading
|
for distributed memory parallel computation. You need to have such a
|
||||||
(see more discussion below).
|
library installed for building and running LAMMPS in parallel using a
|
||||||
|
domain decomposition parallelization. It is compatible with the MPI
|
||||||
|
standard version 2.x and later. LAMMPS can also be built into a
|
||||||
|
"serial" executable for use with a single processor using the bundled
|
||||||
|
MPI STUBS library.
|
||||||
|
|
||||||
**CMake variables**\ :
|
Independent of the distributed memory MPI parallelization, parts of
|
||||||
|
LAMMPS are also written with support for shared memory parallelization
|
||||||
|
using the OpenMP threading standard. A more detailed discussion of that
|
||||||
|
is below.
|
||||||
|
|
||||||
|
**CMake build**\ :
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D BUILD_MPI=value # yes or no, default is yes if CMake finds MPI, else no
|
-D BUILD_MPI=value # yes or no, default is yes if CMake finds MPI, else no
|
||||||
-D BUILD_OMP=value # yes or no (default)
|
-D BUILD_OMP=value # yes or no, default is yes if a compatible compiler is detected
|
||||||
-D LAMMPS_MACHINE=name # name = mpi, serial, mybox, titan, laptop, etc
|
-D LAMMPS_MACHINE=name # name = mpi, serial, mybox, titan, laptop, etc
|
||||||
# no default value
|
# no default value
|
||||||
|
|
||||||
The executable created by CMake (after running make) is lmp\_name. If
|
The executable created by CMake (after running make) is named *lmp* unless
|
||||||
the LAMMPS\_MACHINE variable is not specified, the executable is just
|
the LAMMPS\_MACHINE option is set. When setting `LAMMPS_MACHINE=name`
|
||||||
lmp. Using BUILD\_MPI=no will produce a serial executable.
|
the executable will be named *lmp\_name*\. Using `BUILD\_MPI=no` will
|
||||||
|
enforce building a serial executable using the MPI STUBS library.
|
||||||
|
|
||||||
**Traditional make**\ :
|
**Traditional make**\ :
|
||||||
|
|
||||||
|
The build with traditional makefiles has to be done inside the source folder `src`.
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
cd lammps/src
|
|
||||||
make mpi # parallel build, produces lmp_mpi using Makefile.mpi
|
make mpi # parallel build, produces lmp_mpi using Makefile.mpi
|
||||||
make serial # serial build, produces lmp_serial using Makefile/serial
|
make serial # serial build, produces lmp_serial using Makefile/serial
|
||||||
make mybox # uses Makefile.mybox to produce lmp_mybox
|
make mybox # uses Makefile.mybox to produce lmp_mybox
|
||||||
|
|
||||||
Serial build (see src/MAKE/Makefile.serial):
|
|
||||||
|
|
||||||
|
Any "make machine" command will look up the make settings from a file
|
||||||
|
Makefile.machine, create a folder Obj\_machine with all objects and
|
||||||
|
generated files and an executable called *lmp\_machine*\ . The standard
|
||||||
|
parallel build with `make mpi` assumes a standard MPI installation with
|
||||||
|
MPI compiler wrappers where all necessary compiler and linker flags to
|
||||||
|
get access and link with the suitable MPI headers and libraries are set
|
||||||
|
by the wrapper programs. For other cases or the serial build, you have
|
||||||
|
to adjust the make file variables MPI\_INC, MPI\_PATH, MPI\_LIB as well
|
||||||
|
as CC and LINK. To enable OpenMP threading usually a compiler specific
|
||||||
|
flag needs to be added to the compile and link commands. For the GNU
|
||||||
|
compilers, this is *-fopenmp*\ , which can be added to the CC and LINK
|
||||||
|
makefile variables.
|
||||||
|
|
||||||
.. parsed-literal::
|
For the serial build the following make variables are set (see src/MAKE/Makefile.serial):
|
||||||
|
|
||||||
|
.. code-block:: make
|
||||||
|
|
||||||
|
CC = g++
|
||||||
|
LINK = g++
|
||||||
MPI_INC = -I../STUBS
|
MPI_INC = -I../STUBS
|
||||||
MPI_PATH = -L../STUBS
|
MPI_PATH = -L../STUBS
|
||||||
MPI_LIB = -lmpi_stubs
|
MPI_LIB = -lmpi_stubs
|
||||||
|
|
||||||
For a parallel build, if MPI is installed on your system in the usual
|
You also need to build the STUBS library for your platform before making
|
||||||
place (e.g. under /usr/local), you do not need to specify the 3
|
LAMMPS itself. A "make serial" build does this for you automatically,
|
||||||
variables MPI\_INC, MPI\_PATH, MPI\_LIB. The MPI wrapper on the compiler
|
otherwise, type "make mpi-stubs" from the src directory, or "make" from
|
||||||
(e.g. mpicxx, mpiCC) knows where to find the needed include and
|
the src/STUBS dir. If the build fails, you will need to edit the
|
||||||
library files. Failing this, these 3 variables can be used to specify
|
STUBS/Makefile for your platform. The stubs library does not provide
|
||||||
where the mpi.h file (MPI\_INC), and the MPI library files (MPI\_PATH)
|
MPI/IO functions required by some LAMMPS packages, e.g. MPIIO or USER-LB,
|
||||||
are found, and the name of the library files (MPI\_LIB).
|
and thus is not compatible with those packages.
|
||||||
|
|
||||||
For a serial build, you need to specify the 3 variables, as shown
|
.. note::
|
||||||
above.
|
|
||||||
|
|
||||||
For a serial LAMMPS build, use the dummy MPI library provided in
|
The file STUBS/mpi.c provides a CPU timer function called
|
||||||
src/STUBS. You also need to build the STUBS library for your platform
|
MPI\_Wtime() that calls gettimeofday() . If your operating system
|
||||||
before making LAMMPS itself. A "make serial" build does this for.
|
does not support gettimeofday() , you will need to insert code to
|
||||||
Otherwise, type "make mpi-stubs" from the src directory, or "make"
|
call another timer. Note that the ANSI-standard function clock()
|
||||||
from the src/STUBS dir. If the build fails, you will need to edit the
|
rolls over after an hour or so, and is therefore insufficient for
|
||||||
STUBS/Makefile for your platform.
|
timing long LAMMPS simulations.
|
||||||
|
|
||||||
The file STUBS/mpi.c provides a CPU timer function called MPI\_Wtime()
|
**MPI and OpenMP support info**\ :
|
||||||
that calls gettimeofday() . If your system doesn't support
|
|
||||||
gettimeofday() , you'll need to insert code to call another timer.
|
|
||||||
Note that the ANSI-standard function clock() rolls over after an hour
|
|
||||||
or so, and is therefore insufficient for timing long LAMMPS
|
|
||||||
simulations.
|
|
||||||
|
|
||||||
**CMake and make info**\ :
|
If you are installing MPI yourself to build a parallel LAMMPS
|
||||||
|
executable, we recommend either MPICH or OpenMPI which are regularly
|
||||||
|
used and tested with LAMMPS by the LAMMPS developers. MPICH can be
|
||||||
|
downloaded from the `MPICH home page <https://www.mpich.org>`_ and
|
||||||
|
OpenMPI can be downloaded correspondingly from the `OpenMPI home page
|
||||||
|
<https://www.open-mpi.org>`_. Other MPI packages should also work. No
|
||||||
|
specific vendor provided and standard compliant MPI library is currently
|
||||||
|
known to be incompatible with LAMMPS. If you are running on a large
|
||||||
|
parallel machine, your system admins or the vendor should have already
|
||||||
|
installed a version of MPI, which is likely to be faster than a
|
||||||
|
self-installed MPICH or OpenMPI, so you should study the provided
|
||||||
|
documentation to find out how to build and link with it.
|
||||||
|
|
||||||
If you are installing MPI yourself, we recommend MPICH2 from Argonne
|
The majority of OpenMP (threading) support in LAMMPS is provided by the
|
||||||
National Laboratory or OpenMPI. MPICH can be downloaded from the
|
USER-OMP package; see the :doc:`Speed omp <Speed_omp>` doc page for
|
||||||
`Argonne MPI site <http://www.mcs.anl.gov/research/projects/mpich2/>`_.
|
details. The USER-INTEL package also includes OpenMP threading (it is
|
||||||
OpenMPI can be downloaded from the `OpenMPI site <http://www.open-mpi.org>`_. Other MPI packages should also work.
|
|
||||||
If you are running on a large parallel machine, your system admins or
|
|
||||||
the vendor should have already installed a version of MPI, which is
|
|
||||||
likely to be faster than a self-installed MPICH or OpenMPI, so find
|
|
||||||
out how to build and link with it.
|
|
||||||
|
|
||||||
The majority of OpenMP (threading) support in LAMMPS is provided by
|
|
||||||
the USER-OMP package; see the :doc:`Speed omp <Speed_omp>` doc page for
|
|
||||||
details. The USER-INTEL package also provides OpenMP support (it is
|
|
||||||
compatible with USER-OMP) and adds vectorization support when compiled
|
compatible with USER-OMP) and adds vectorization support when compiled
|
||||||
with the Intel compilers on top of that. Also, the KOKKOS package can
|
with compatible compilers, in particular the Intel compilers on top of
|
||||||
be compiled for using OpenMP threading.
|
OpenMP. Also, the KOKKOS package can be compiled to include OpenMP
|
||||||
|
threading.
|
||||||
|
|
||||||
However, there are a few commands in LAMMPS that have native OpenMP
|
In addition, there are a few commands in LAMMPS that have native OpenMP
|
||||||
support. These are commands in the MPIIO, SNAP, USER-DIFFRACTION, and
|
support included as well. These are commands in the MPIIO, SNAP,
|
||||||
USER-DPD packages. In addition some packages support OpenMP threading
|
USER-DIFFRACTION, and USER-DPD packages. In addition some packages
|
||||||
indirectly through the libraries they interface to: e.g. LATTE and
|
support OpenMP threading indirectly through the libraries they interface
|
||||||
USER-COLVARS. See the :doc:`Packages details <Packages_details>` doc
|
to: e.g. LATTE and USER-COLVARS. See the :doc:`Packages details
|
||||||
page for more info on these packages and the doc pages for their
|
<Packages_details>` doc page for more info on these packages and the doc
|
||||||
respective commands for OpenMP threading info.
|
pages for their respective commands for OpenMP threading info.
|
||||||
|
|
||||||
For CMake, if you use BUILD\_OMP=yes, you can use these packages and
|
For CMake, if you use BUILD\_OMP=yes, you can use these packages and
|
||||||
turn on their native OpenMP support and turn on their native OpenMP
|
turn on their native OpenMP support and turn on their native OpenMP
|
||||||
@ -143,22 +164,37 @@ Choice of compiler and compile/link options
|
|||||||
---------------------------------------------------------
|
---------------------------------------------------------
|
||||||
|
|
||||||
The choice of compiler and compiler flags can be important for
|
The choice of compiler and compiler flags can be important for
|
||||||
performance. Vendor compilers can produce faster code than
|
performance. Vendor provided compilers for a specific hardware can
|
||||||
open-source compilers like GNU. On boxes with Intel CPUs, we suggest
|
produce faster code than open-source compilers like the GNU compilers.
|
||||||
trying the `Intel C++ compiler <intel_>`_.
|
On x86 hardware most popular compilers are quite similar in performance
|
||||||
|
of C/C++ code at high optimization levels. When using the USER-INTEL
|
||||||
|
package, there is a distinct advantage in using the `Intel C++ compiler
|
||||||
|
<intel_>`_ due to much improved vectorization through SSE and AVX
|
||||||
|
instructions on compatible hardware as the source code includes changes
|
||||||
|
and compiler directives to enable high degrees of vectorization.
|
||||||
|
|
||||||
.. _intel: https://software.intel.com/en-us/intel-compilers
|
.. _intel: https://software.intel.com/en-us/intel-compilers
|
||||||
|
|
||||||
|
On parallel clusters or supercomputers which use "environment modules"
|
||||||
|
for their compile/link environments, you can often access different
|
||||||
|
compilers by simply loading the appropriate module before building
|
||||||
|
LAMMPS.
|
||||||
|
|
||||||
|
**CMake build**\ :
|
||||||
|
|
||||||
On parallel clusters or supercomputers which use "modules" for their
|
By default CMake will use a compiler it finds and it will add
|
||||||
compile/link environments, you can often access different compilers by
|
optimization flags appropriate to that compiler and any
|
||||||
simply loading the appropriate module before building LAMMPS.
|
:doc:`accelerator packages <Speed_packages>` you have included in the
|
||||||
|
build.
|
||||||
|
|
||||||
**CMake variables**\ :
|
You can tell CMake to look for a specific compiler with these variable
|
||||||
|
settings. Likewise you can specify the FLAGS variables if you want to
|
||||||
|
experiment with alternate optimization flags. You should specify all
|
||||||
|
3 compilers, so that the small number of LAMMPS source files written
|
||||||
|
in C or Fortran are built with a compiler consistent with the one used
|
||||||
|
for all the C++ files:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
.. parsed-literal::
|
|
||||||
|
|
||||||
-D CMAKE_CXX_COMPILER=name # name of C++ compiler
|
-D CMAKE_CXX_COMPILER=name # name of C++ compiler
|
||||||
-D CMAKE_C_COMPILER=name # name of C compiler
|
-D CMAKE_C_COMPILER=name # name of C compiler
|
||||||
@ -168,42 +204,42 @@ simply loading the appropriate module before building LAMMPS.
|
|||||||
-D CMAKE_C_FLAGS=string # flags to use with C compiler
|
-D CMAKE_C_FLAGS=string # flags to use with C compiler
|
||||||
-D CMAKE_Fortran_FLAGS=string # flags to use with Fortran compiler
|
-D CMAKE_Fortran_FLAGS=string # flags to use with Fortran compiler
|
||||||
|
|
||||||
By default CMake will use a compiler it finds and it will add
|
|
||||||
optimization flags appropriate to that compiler and any :doc:`accelerator packages <Speed_packages>` you have included in the build.
|
|
||||||
|
|
||||||
You can tell CMake to look for a specific compiler with these variable
|
A few example command lines are:
|
||||||
settings. Likewise you can specify the FLAGS variables if you want to
|
|
||||||
experiment with alternate optimization flags. You should specify all
|
|
||||||
3 compilers, so that the small number of LAMMPS source files written
|
|
||||||
in C or Fortran are built with a compiler consistent with the one used
|
|
||||||
for all the C++ files:
|
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
.. parsed-literal::
|
# Building with GNU Compilers:
|
||||||
|
|
||||||
Building with GNU Compilers:
|
|
||||||
cmake ../cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_Fortran_COMPILER=gfortran
|
cmake ../cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_Fortran_COMPILER=gfortran
|
||||||
Building with Intel Compilers:
|
# Building with Intel Compilers:
|
||||||
cmake ../cmake -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc -DCMAKE_Fortran_COMPILER=ifort
|
cmake ../cmake -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc -DCMAKE_Fortran_COMPILER=ifort
|
||||||
Building with LLVM/Clang Compilers:
|
# Building with LLVM/Clang Compilers:
|
||||||
cmake ../cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_Fortran_COMPILER=flang
|
cmake ../cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_Fortran_COMPILER=flang
|
||||||
|
|
||||||
|
For compiling with the Clang/LLVM compilers a special CMake preset is
|
||||||
|
included that can be loaded with `-C ../cmake/presets/clang.cmake`.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
When the cmake command completes, it prints info to the screen
|
When the cmake command completes, it prints a summary to the screen
|
||||||
as to which compilers it is using, and what flags will be used in the
|
which compilers it is using and what flags and settings will be used
|
||||||
compilation. Note that if the top-level compiler is mpicxx, it is
|
for the compilation. Note that if the top-level compiler is mpicxx,
|
||||||
simply a wrapper on a real compiler. The underlying compiler info is
|
it is simply a wrapper on a real compiler. The underlying compiler
|
||||||
what will be listed in the CMake output. You should check to insure
|
info is what CMake will try to determine and report. You should check
|
||||||
you are using the compiler and optimization flags are the ones you
|
to confirm you are using the compiler and optimization flags you want.
|
||||||
want.
|
|
||||||
|
|
||||||
**Makefile.machine settings**\ :
|
**Makefile.machine settings for traditional make**\ :
|
||||||
|
|
||||||
|
The "compiler/linker settings" section of a Makefile.machine lists
|
||||||
|
compiler and linker settings for your C++ compiler, including
|
||||||
|
optimization flags. For a parallel build it is recommended to use
|
||||||
|
mpicxx or mpiCC, since these compiler wrappers will include a variety of
|
||||||
|
settings appropriate for your MPI installation and thus avoiding the
|
||||||
|
guesswork of finding the right flags.
|
||||||
|
|
||||||
Parallel build (see src/MAKE/Makefile.mpi):
|
Parallel build (see src/MAKE/Makefile.mpi):
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
.. parsed-literal::
|
|
||||||
|
|
||||||
CC = mpicxx
|
CC = mpicxx
|
||||||
CCFLAGS = -g -O3
|
CCFLAGS = -g -O3
|
||||||
@ -212,33 +248,26 @@ Parallel build (see src/MAKE/Makefile.mpi):
|
|||||||
|
|
||||||
Serial build (see src/MAKE/Makefile.serial):
|
Serial build (see src/MAKE/Makefile.serial):
|
||||||
|
|
||||||
|
.. code-block:: make
|
||||||
.. parsed-literal::
|
|
||||||
|
|
||||||
CC = g++
|
CC = g++
|
||||||
CCFLAGS = -g -O3
|
CCFLAGS = -g -O3
|
||||||
LINK = g++
|
LINK = g++
|
||||||
LINKFLAGS = -g -O
|
LINKFLAGS = -g -O
|
||||||
|
|
||||||
The "compiler/linker settings" section of a Makefile.machine lists
|
|
||||||
compiler and linker settings for your C++ compiler, including
|
|
||||||
optimization flags. You should always use mpicxx or mpiCC for
|
|
||||||
a parallel build, since these compiler wrappers will include
|
|
||||||
a variety of settings appropriate for your MPI installation.
|
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
If you build LAMMPS with any :doc:`accelerator packages <Speed_packages>` included, they have specific
|
If you build LAMMPS with any :doc:`accelerator packages <Speed_packages>`
|
||||||
optimization flags that are either required or recommended for optimal
|
included, there may be specific optimization flags that are either
|
||||||
performance. You need to include these in the CCFLAGS and LINKFLAGS
|
required or recommended to enable required features and to achieve
|
||||||
settings above. For details, see the individual package doc pages
|
optimal performance. You need to include these in the CCFLAGS and
|
||||||
listed on the :doc:`Speed packages <Speed_packages>` doc page. Or
|
LINKFLAGS settings above. For details, see the individual package
|
||||||
examine these files in the src/MAKE/OPTIONS directory. They
|
doc pages listed on the :doc:`Speed packages <Speed_packages>` doc
|
||||||
correspond to each of the 5 accelerator packages and their hardware
|
page. Or examine these files in the src/MAKE/OPTIONS directory.
|
||||||
variants:
|
They correspond to each of the 5 accelerator packages and their
|
||||||
|
hardware variants:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
.. parsed-literal::
|
|
||||||
|
|
||||||
Makefile.opt # OPT package
|
Makefile.opt # OPT package
|
||||||
Makefile.omp # USER-OMP package
|
Makefile.omp # USER-OMP package
|
||||||
@ -249,10 +278,8 @@ a variety of settings appropriate for your MPI installation.
|
|||||||
Makefile.kokkos_omp # KOKKOS package for CPUs (OpenMP)
|
Makefile.kokkos_omp # KOKKOS package for CPUs (OpenMP)
|
||||||
Makefile.kokkos_phi # KOKKOS package for KNLs (OpenMP)
|
Makefile.kokkos_phi # KOKKOS package for KNLs (OpenMP)
|
||||||
|
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
|
||||||
.. _exe:
|
.. _exe:
|
||||||
|
|
||||||
Build LAMMPS as an executable or a library
|
Build LAMMPS as an executable or a library
|
||||||
@ -265,10 +292,13 @@ page for more info on coupling LAMMPS to other codes. See the
|
|||||||
:doc:`Python <Python_head>` doc page for more info on wrapping and
|
:doc:`Python <Python_head>` doc page for more info on wrapping and
|
||||||
running LAMMPS from Python via its library interface.
|
running LAMMPS from Python via its library interface.
|
||||||
|
|
||||||
**CMake variables**\ :
|
**CMake build**\ :
|
||||||
|
|
||||||
|
For CMake builds, you can select through setting CMake variables which
|
||||||
|
files the compilation produces during the configuration step. If none
|
||||||
|
are set, defaults are applied.
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D BUILD_EXE=value # yes (default) or no
|
-D BUILD_EXE=value # yes (default) or no
|
||||||
-D BUILD_LIB=value # yes or no (default)
|
-D BUILD_LIB=value # yes or no (default)
|
||||||
@ -277,24 +307,32 @@ running LAMMPS from Python via its library interface.
|
|||||||
# no default value
|
# no default value
|
||||||
|
|
||||||
Setting BUILD\_EXE=no will not produce an executable. Setting
|
Setting BUILD\_EXE=no will not produce an executable. Setting
|
||||||
BUILD\_LIB=yes will produce a static library named liblammps.a.
|
BUILD\_LIB=yes will produce a static library named *liblammps.a*\ .
|
||||||
Setting both BUILD\_LIB=yes and BUILD\_SHARED\_LIBS=yes will produce a
|
Setting both BUILD\_LIB=yes and BUILD\_SHARED\_LIBS=yes will produce a
|
||||||
shared library named liblammps.so. If LAMMPS\_LIB\_SUFFIX is set the generated
|
shared library named *liblammps.so* instead. If LAMMPS\_LIB\_SUFFIX is
|
||||||
libraries will be named liblammps\_name.a or liblammps\_name.so instead.
|
set to *name* in addition, the name of the generated libraries will be
|
||||||
|
changed to either *liblammps\_name.a* or *liblammps\_name.so*\ ,
|
||||||
|
respectively.
|
||||||
|
|
||||||
**Traditional make**\ :
|
**Traditional make**\ :
|
||||||
|
|
||||||
|
With the traditional makefile based build process, the choice of
|
||||||
|
the generated executable or library depends on the "mode" setting.
|
||||||
|
Several options are available and "mode=exe" is the default.
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
cd lammps/src
|
|
||||||
make machine # build LAMMPS executable lmp_machine
|
make machine # build LAMMPS executable lmp_machine
|
||||||
|
mkae mode=exe machine # same as "make machine"
|
||||||
make mode=lib machine # build LAMMPS static lib liblammps_machine.a
|
make mode=lib machine # build LAMMPS static lib liblammps_machine.a
|
||||||
make mode=shlib machine # build LAMMPS shared lib liblammps_machine.so
|
make mode=shlib machine # build LAMMPS shared lib liblammps_machine.so
|
||||||
|
make mode=shexe machine # same as "mode=exe" but uses objects from "mode=shlib"
|
||||||
|
|
||||||
The two library builds also create generic soft links, named
|
The two "exe" builds will generate and executable *lmp\_machine*\ ,
|
||||||
liblammps.a and liblammps.so, which point to the liblammps\_machine
|
while the two library builds will create a file *liblammps\_machine.a*
|
||||||
files.
|
or *liblammps\_machine.so*\ . They will also create generic soft links,
|
||||||
|
named *liblammps.a* and *liblammps.so*\ , which point to the specific
|
||||||
|
*liblammps\_machine.a/so* files.
|
||||||
|
|
||||||
**CMake and make info**\ :
|
**CMake and make info**\ :
|
||||||
|
|
||||||
@ -302,32 +340,40 @@ Note that for a shared library to be usable by a calling program, all
|
|||||||
the auxiliary libraries it depends on must also exist as shared
|
the auxiliary libraries it depends on must also exist as shared
|
||||||
libraries. This will be the case for libraries included with LAMMPS,
|
libraries. This will be the case for libraries included with LAMMPS,
|
||||||
such as the dummy MPI library in src/STUBS or any package libraries in
|
such as the dummy MPI library in src/STUBS or any package libraries in
|
||||||
the lib/packages directory, since they are always built as shared
|
the lib/packages directory, since they are always built in a shared
|
||||||
libraries using the -fPIC switch. However, if a library like MPI or
|
library compatible way using the -fPIC switch. However, if a library
|
||||||
FFTW does not exist as a shared library, the shared library build will
|
like MPI or FFTW does not exist as a shared library, the shared library
|
||||||
generate an error. This means you will need to install a shared
|
build may generate an error. This means you will need to install a
|
||||||
library version of the auxiliary library. The build instructions for
|
shared library version of the auxiliary library. The build instructions
|
||||||
the library should tell you how to do this.
|
for the library should tell you how to do this.
|
||||||
|
|
||||||
As an example, here is how to build and install the `MPICH library <mpich_>`_, a popular open-source version of MPI, distributed by
|
|
||||||
Argonne National Lab, as a shared library in the default
|
|
||||||
/usr/local/lib location:
|
|
||||||
|
|
||||||
.. _mpich: http://www-unix.mcs.anl.gov/mpi
|
|
||||||
|
|
||||||
|
|
||||||
|
As an example, here is how to build and install the `MPICH library
|
||||||
|
<mpich_>`_, a popular open-source version of MPI, as a shared library
|
||||||
|
in the default /usr/local/lib location:
|
||||||
|
|
||||||
|
.. _mpich: https://www.mpich.org
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
./configure --enable-shared
|
./configure --enable-shared
|
||||||
make
|
make
|
||||||
make install
|
make install
|
||||||
|
|
||||||
You may need to use "sudo make install" in place of the last line if
|
You may need to use "sudo make install" in place of the last line if you
|
||||||
you do not have write privileges for /usr/local/lib. The end result
|
do not have write privileges for /usr/local/lib. The end result should
|
||||||
should be the file /usr/local/lib/libmpich.so.
|
be the file /usr/local/lib/libmpich.so. On many Linux installations the
|
||||||
|
folder "${HOME}/.local" is an alternative to using /usr/local and does
|
||||||
|
not require superuser or sudo access. In that case the configuration
|
||||||
|
step becomes:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
./configure --enable-shared --prefix=${HOME}/.local
|
||||||
|
|
||||||
|
Avoiding using "sudo" for custom software installation (i.e. from source
|
||||||
|
and not through a package manager tool provided by the OS) is generally
|
||||||
|
recommended to ensure the integrity of the system software installation.
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
@ -337,30 +383,39 @@ should be the file /usr/local/lib/libmpich.so.
|
|||||||
Build the LAMMPS documentation
|
Build the LAMMPS documentation
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
|
|
||||||
**CMake variable**\ :
|
The LAMMPS manual is written in `reStructuredText <rst_>`_ format which
|
||||||
|
can be translated to different output format using the `Sphinx <sphinx_>`_
|
||||||
|
document generator tool. Currently the translation to HTML and PDF (via
|
||||||
|
LaTeX) are supported. For that to work a Python 3 interpreter and
|
||||||
|
internet access is required. For the documentation build a python
|
||||||
|
based virtual environment is set up in the folder doc/docenv and various
|
||||||
|
python packages are installed into that virtual environment via the pip
|
||||||
|
tool. The actual translation is then done via make commands.
|
||||||
|
|
||||||
|
.. _rst: https://docutils.readthedocs.io/en/sphinx-docs/user/rst/quickstart.html
|
||||||
|
.. _sphinx: https://sphinx-doc.org
|
||||||
|
|
||||||
|
**Documentation make option**\ :
|
||||||
|
|
||||||
|
The following make commands can be issued in the doc folder of the
|
||||||
|
LAMMPS source distribution.
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
make html # create HTML doc pages in html directory
|
||||||
|
make pdf # create Developer.pdf and Manual.pdf in this directory
|
||||||
|
make fetch # fetch HTML and PDF files from LAMMPS web site
|
||||||
|
make clean # remove all intermediate files
|
||||||
|
make clean-all # reset the entire doc build environment
|
||||||
|
make anchor_check # scan for duplicate anchor labels
|
||||||
|
make style_check # check for complete and consistent style lists
|
||||||
|
make package_check # check for complete and consistent package lists
|
||||||
|
make spelling # spell-check the manual
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
Thus "make html" will create a "doc/html" directory with the HTML format
|
||||||
|
manual pages so that you can browse them with a web browser locally on
|
||||||
-D BUILD_DOC=value # yes or no (default)
|
your system.
|
||||||
|
|
||||||
This will create the HTML doc pages within the CMake build directory.
|
|
||||||
The reason to do this is if you want to "install" LAMMPS on a system
|
|
||||||
after the CMake build via "make install", and include the doc pages in
|
|
||||||
the install.
|
|
||||||
|
|
||||||
**Traditional make**\ :
|
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
|
||||||
|
|
||||||
cd lammps/doc
|
|
||||||
make html # html doc pages
|
|
||||||
make pdf # single Manual.pdf file
|
|
||||||
|
|
||||||
This will create a lammps/doc/html dir with the HTML doc pages so that
|
|
||||||
you can browse them locally on your system. Type "make" from the
|
|
||||||
lammps/doc dir to see other options.
|
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@ -369,6 +424,19 @@ lammps/doc dir to see other options.
|
|||||||
`download page <http://lammps.sandia.gov/download.html>`_.
|
`download page <http://lammps.sandia.gov/download.html>`_.
|
||||||
|
|
||||||
|
|
||||||
|
**CMake build option**\ :
|
||||||
|
|
||||||
|
It is also possible to create the HTML version of the manual within
|
||||||
|
the :doc:`CMake build directory <Build_cmake>`. The reason for this
|
||||||
|
option is to include the installation of the HTML manual pages into
|
||||||
|
the "install" step when installing LAMMPS after the CMake build via
|
||||||
|
"make install".
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
-D BUILD_DOC=value # yes or no (default)
|
||||||
|
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
|
||||||
@ -380,19 +448,20 @@ Build LAMMPS tools
|
|||||||
Some tools described in :doc:`Auxiliary tools <Tools>` can be built directly
|
Some tools described in :doc:`Auxiliary tools <Tools>` can be built directly
|
||||||
using CMake or Make.
|
using CMake or Make.
|
||||||
|
|
||||||
**CMake variable**\ :
|
**CMake build3**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D BUILD_TOOLS=value # yes or no (default)
|
-D BUILD_TOOLS=value # yes or no (default)
|
||||||
|
|
||||||
The generated binaries will also become part of the LAMMPS installation (see below)
|
The generated binaries will also become part of the LAMMPS installation
|
||||||
|
(see below).
|
||||||
|
|
||||||
**Traditional make**\ :
|
**Traditional make**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
cd lammps/tools
|
cd lammps/tools
|
||||||
make all # build all binaries of tools
|
make all # build all binaries of tools
|
||||||
@ -416,10 +485,10 @@ a globally visible place on your system, for others to access. Note
|
|||||||
that you may need super-user privileges (e.g. sudo) if the directory
|
that you may need super-user privileges (e.g. sudo) if the directory
|
||||||
you want to copy files to is protected.
|
you want to copy files to is protected.
|
||||||
|
|
||||||
**CMake variable**\ :
|
**CMake build**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
cmake -D CMAKE_INSTALL_PREFIX=path [options ...] ../cmake
|
cmake -D CMAKE_INSTALL_PREFIX=path [options ...] ../cmake
|
||||||
make # perform make after CMake command
|
make # perform make after CMake command
|
||||||
|
|||||||
@ -20,7 +20,7 @@ make command to build LAMMPS, which uses the created
|
|||||||
Makefile(s). Example:
|
Makefile(s). Example:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
cd lammps # change to the LAMMPS distribution directory
|
cd lammps # change to the LAMMPS distribution directory
|
||||||
mkdir build; cd build # create a new directory (folder) for build
|
mkdir build; cd build # create a new directory (folder) for build
|
||||||
@ -52,7 +52,7 @@ After compilation, you may optionally install the LAMMPS executable into
|
|||||||
your system with:
|
your system with:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
make install # optional, copy LAMMPS executable & library elsewhere
|
make install # optional, copy LAMMPS executable & library elsewhere
|
||||||
|
|
||||||
@ -95,10 +95,8 @@ this directory or sub-directories within it that CMake creates.
|
|||||||
directory to un-install all packages. The purge removes all the \*.h
|
directory to un-install all packages. The purge removes all the \*.h
|
||||||
files auto-generated by make.
|
files auto-generated by make.
|
||||||
|
|
||||||
You must have CMake version 2.8 or later on your system to build
|
You must have CMake version 3.10 or later on your system to build
|
||||||
LAMMPS. A handful of LAMMPS packages (KOKKOS, LATTE, MSCG) require a
|
LAMMPS. Installation instructions for CMake are below.
|
||||||
later version. CMake will print a message telling you if a later
|
|
||||||
version is required. Installation instructions for CMake are below.
|
|
||||||
|
|
||||||
After the initial build, if you edit LAMMPS source files, or add your
|
After the initial build, if you edit LAMMPS source files, or add your
|
||||||
own new files to the source directory, you can just re-type make from
|
own new files to the source directory, you can just re-type make from
|
||||||
@ -115,7 +113,7 @@ folder, recreate the directory and start over.
|
|||||||
**Command-line version of CMake**\ :
|
**Command-line version of CMake**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
cmake [options ...] /path/to/lammps/cmake # build from any dir
|
cmake [options ...] /path/to/lammps/cmake # build from any dir
|
||||||
cmake [options ...] ../cmake # build from lammps/build
|
cmake [options ...] ../cmake # build from lammps/build
|
||||||
@ -127,7 +125,7 @@ The argument can be preceeded or followed by various CMake
|
|||||||
command-line options. Several useful ones are:
|
command-line options. Several useful ones are:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D CMAKE_INSTALL_PREFIX=path # where to install LAMMPS executable/lib if desired
|
-D CMAKE_INSTALL_PREFIX=path # where to install LAMMPS executable/lib if desired
|
||||||
-D CMAKE_BUILD_TYPE=type # type = RelWithDebInfo (default), Release, MinSizeRel, or Debug
|
-D CMAKE_BUILD_TYPE=type # type = RelWithDebInfo (default), Release, MinSizeRel, or Debug
|
||||||
@ -177,7 +175,7 @@ directory.
|
|||||||
**Curses version (terminal-style menu) of CMake**\ :
|
**Curses version (terminal-style menu) of CMake**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
ccmake ../cmake
|
ccmake ../cmake
|
||||||
|
|
||||||
@ -195,7 +193,7 @@ more information.
|
|||||||
**GUI version of CMake**\ :
|
**GUI version of CMake**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
cmake-gui ../cmake
|
cmake-gui ../cmake
|
||||||
|
|
||||||
@ -216,7 +214,7 @@ for more information.
|
|||||||
Check if your machine already has CMake installed:
|
Check if your machine already has CMake installed:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
which cmake # do you have it?
|
which cmake # do you have it?
|
||||||
which cmake3 # version 3 may have this name
|
which cmake3 # version 3 may have this name
|
||||||
@ -226,10 +224,10 @@ On clusters or supercomputers which use environment modules to manage
|
|||||||
software packages, do this:
|
software packages, do this:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
module list # is a cmake module already loaded?
|
module list # is a module for cmake already loaded?
|
||||||
module avail # is a cmake module available?
|
module avail # is a module for cmake available?
|
||||||
module load cmake3 # load cmake module with appropriate name
|
module load cmake3 # load cmake module with appropriate name
|
||||||
|
|
||||||
Most Linux distributions offer pre-compiled cmake packages through
|
Most Linux distributions offer pre-compiled cmake packages through
|
||||||
|
|||||||
@ -18,14 +18,14 @@ generated by the CMake build. To enable a more verbose output during
|
|||||||
compilation you can use the following option.
|
compilation you can use the following option.
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D CMAKE_VERBOSE_MAKEFILE=value # value = no (default) or yes
|
-D CMAKE_VERBOSE_MAKEFILE=value # value = no (default) or yes
|
||||||
|
|
||||||
Another way of doing this without reconfiguration is calling make with variable VERBOSE set to 1:
|
Another way of doing this without reconfiguration is calling make with variable VERBOSE set to 1:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
make VERBOSE=1
|
make VERBOSE=1
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ it. Please note that they come with a performance hit. However, they are
|
|||||||
usually faster than using tools like Valgrind.
|
usually faster than using tools like Valgrind.
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D ENABLE_SANITIZE_ADDRESS=value # enable Address Sanitizer, value = no (default) or yes
|
-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_UNDEFINED=value # enable Undefined Behaviour Sanitizer, value = no (default) or yes
|
||||||
@ -72,7 +72,7 @@ developers can run the tests directly on their workstation.
|
|||||||
this is incomplete and only represents a small subset of tests that we run
|
this is incomplete and only represents a small subset of tests that we run
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D ENABLE_TESTING=value # enable simple run tests of LAMMPS, value = no (default) or yes
|
-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_SOURCE_DIR=path # path to lammps-testing repository (option if in custom location)
|
||||||
@ -81,7 +81,7 @@ developers can run the tests directly on their workstation.
|
|||||||
If you enable testing in the CMake build it will create an additional target called "test". You can run them with:
|
If you enable testing in the CMake build it will create an additional target called "test". You can run them with:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
make test
|
make test
|
||||||
|
|
||||||
@ -93,14 +93,14 @@ You can also collect code coverage metrics while running the tests by enabling
|
|||||||
coverage support during building.
|
coverage support during building.
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D ENABLE_COVERAGE=value # enable coverage measurements, value = no (default) or yes
|
-D ENABLE_COVERAGE=value # enable coverage measurements, value = no (default) or yes
|
||||||
|
|
||||||
This will also add the following targets to generate coverage reports after running the LAMMPS executable:
|
This will also add the following targets to generate coverage reports after running the LAMMPS executable:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
make test # run tests first!
|
make test # run tests first!
|
||||||
make gen_coverage_html # generate coverage report in HTML format
|
make gen_coverage_html # generate coverage report in HTML format
|
||||||
@ -109,6 +109,6 @@ This will also add the following targets to generate coverage reports after runn
|
|||||||
These reports require GCOVR to be installed. The easiest way to do this to install it via pip:
|
These reports require GCOVR to be installed. The easiest way to do this to install it via pip:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
pip install git+https://github.com/gcovr/gcovr.git
|
pip install git+https://github.com/gcovr/gcovr.git
|
||||||
|
|||||||
@ -5,10 +5,15 @@ When building with some packages, additional steps may be required,
|
|||||||
in addition to:
|
in addition to:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D PKG_NAME=yes # CMake
|
$ cmake -D PKG_NAME=yes
|
||||||
make yes-name # make
|
|
||||||
|
or
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
$ make yes-name
|
||||||
|
|
||||||
as described on the :doc:`Build\_package <Build_package>` doc page.
|
as described on the :doc:`Build\_package <Build_package>` doc page.
|
||||||
|
|
||||||
@ -20,18 +25,35 @@ You may need to tell LAMMPS where it is found on your system.
|
|||||||
|
|
||||||
This is the list of packages that may require additional steps.
|
This is the list of packages that may require additional steps.
|
||||||
|
|
||||||
+----------------------------------+----------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+
|
.. table_from_list::
|
||||||
| :ref:`COMPRESS <compress>` | :ref:`GPU <gpu>` | :ref:`KIM <kim>` | :ref:`KOKKOS <kokkos>` | :ref:`LATTE <latte>` | :ref:`MESSAGE <message>` |
|
:columns: 6
|
||||||
+----------------------------------+----------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+
|
|
||||||
| :ref:`MSCG <mscg>` | :ref:`OPT <opt>` | :ref:`POEMS <poems>` | :ref:`PYTHON <python>` | :ref:`VORONOI <voronoi>` | :ref:`USER-ADIOS <user-adios>` |
|
|
||||||
+----------------------------------+----------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+
|
|
||||||
| :ref:`USER-ATC <user-atc>` | :ref:`USER-AWPMD <user-awpmd>` | :ref:`USER-COLVARS <user-colvars>` | :ref:`USER-H5MD <user-h5md>` | :ref:`USER-INTEL <user-intel>` | :ref:`USER-MOLFILE <user-molfile>` |
|
|
||||||
+----------------------------------+----------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+
|
|
||||||
| :ref:`USER-NETCDF <user-netcdf>` | :ref:`USER-PLUMED <user-plumed>` | :ref:`USER-OMP <user-omp>` | :ref:`USER-QMMM <user-qmmm>` | :ref:`USER-QUIP <user-quip>` | :ref:`USER-SCAFACOS <user-scafacos>` |
|
|
||||||
+----------------------------------+----------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+
|
|
||||||
| :ref:`USER-SMD <user-smd>` | :ref:`USER-VTK <user-vtk>` | | | | |
|
|
||||||
+----------------------------------+----------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+
|
|
||||||
|
|
||||||
|
* :ref:`COMPRESS <compress>`
|
||||||
|
* :ref:`GPU <gpu>`
|
||||||
|
* :ref:`KIM <kim>`
|
||||||
|
* :ref:`KOKKOS <kokkos>`
|
||||||
|
* :ref:`LATTE <latte>`
|
||||||
|
* :ref:`MESSAGE <message>`
|
||||||
|
* :ref:`MSCG <mscg>`
|
||||||
|
* :ref:`OPT <opt>`
|
||||||
|
* :ref:`POEMS <poems>`
|
||||||
|
* :ref:`PYTHON <python>`
|
||||||
|
* :ref:`VORONOI <voronoi>`
|
||||||
|
* :ref:`USER-ADIOS <user-adios>`
|
||||||
|
* :ref:`USER-ATC <user-atc>`
|
||||||
|
* :ref:`USER-AWPMD <user-awpmd>`
|
||||||
|
* :ref:`USER-COLVARS <user-colvars>`
|
||||||
|
* :ref:`USER-H5MD <user-h5md>`
|
||||||
|
* :ref:`USER-INTEL <user-intel>`
|
||||||
|
* :ref:`USER-MOLFILE <user-molfile>`
|
||||||
|
* :ref:`USER-NETCDF <user-netcdf>`
|
||||||
|
* :ref:`USER-PLUMED <user-plumed>`
|
||||||
|
* :ref:`USER-OMP <user-omp>`
|
||||||
|
* :ref:`USER-QMMM <user-qmmm>`
|
||||||
|
* :ref:`USER-QUIP <user-quip>`
|
||||||
|
* :ref:`USER-SCAFACOS <user-scafacos>`
|
||||||
|
* :ref:`USER-SMD <user-smd>`
|
||||||
|
* :ref:`USER-VTK <user-vtk>`
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
@ -49,15 +71,15 @@ available on your system.
|
|||||||
If CMake cannot find the library, you can set these variables:
|
If CMake cannot find the library, you can set these variables:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D ZLIB_INCLUDE_DIR=path # path to zlib.h header file
|
-D ZLIB_INCLUDE_DIR=path # path to zlib.h header file
|
||||||
-D ZLIB_LIBRARIES=path # path to libz.a (.so) file
|
-D ZLIB_LIBRARIES=path # path to libz.a (.so) file
|
||||||
|
|
||||||
**Traditional make**\ :
|
**Traditional make**\ :
|
||||||
|
|
||||||
If make cannot find the library, you can edit the
|
If make cannot find the library, you can edit the file
|
||||||
lib/compress/Makefile.lammps file to specify the paths and library
|
lib/compress/Makefile.lammps to specify the paths and library
|
||||||
name.
|
name.
|
||||||
|
|
||||||
|
|
||||||
@ -75,7 +97,7 @@ which GPU hardware to build for.
|
|||||||
**CMake build**\ :
|
**CMake build**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D GPU_API=value # value = opencl (default) or cuda
|
-D GPU_API=value # value = opencl (default) or cuda
|
||||||
-D GPU_PREC=value # precision setting
|
-D GPU_PREC=value # precision setting
|
||||||
@ -125,12 +147,12 @@ using a command like these, which simply invoke the lib/gpu/Install.py
|
|||||||
script with the specified args:
|
script with the specified args:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
make lib-gpu # print help message
|
$ make lib-gpu # print help message
|
||||||
make lib-gpu args="-b" # build GPU library with default Makefile.linux
|
$ make lib-gpu args="-b" # build GPU library with default Makefile.linux
|
||||||
make lib-gpu args="-m xk7 -p single -o xk7.single" # create new Makefile.xk7.single, altered for single-precision
|
$ make lib-gpu args="-m xk7 -p single -o xk7.single" # create new Makefile.xk7.single, altered for single-precision
|
||||||
make lib-gpu args="-m mpi -a sm_60 -p mixed -b" # build GPU library with mixed precision and P100 using other settings in Makefile.mpi
|
$ make lib-gpu args="-m mpi -a sm_60 -p mixed -b" # build GPU library with mixed precision and P100 using other settings in Makefile.mpi
|
||||||
|
|
||||||
Note that this procedure starts with a Makefile.machine in lib/gpu, as
|
Note that this procedure starts with a Makefile.machine in lib/gpu, as
|
||||||
specified by the "-m" switch. For your convenience, machine makefiles
|
specified by the "-m" switch. For your convenience, machine makefiles
|
||||||
@ -181,7 +203,8 @@ use with LAMMPS. If you want to use the :doc:`kim_query <kim_commands>`
|
|||||||
command, you also need to have libcurl installed with the matching
|
command, you also need to have libcurl installed with the matching
|
||||||
development headers and the curl-config tool.
|
development headers and the curl-config tool.
|
||||||
|
|
||||||
See `Obtaining KIM Models <http://openkim.org/doc/usage/obtaining-models>`_ to
|
See the `Obtaining KIM Models <http://openkim.org/doc/usage/obtaining-models>`_
|
||||||
|
web page to
|
||||||
learn how to install a pre-build binary of the OpenKIM Repository of Models.
|
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 all KIM models here: https://openkim.org/browse/models
|
||||||
|
|
||||||
@ -192,7 +215,7 @@ minutes to hours) to build. Of course you only need to do that once.)
|
|||||||
**CMake build**\ :
|
**CMake build**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D DOWNLOAD_KIM=value # download OpenKIM API v2 for build, value = no (default) or yes
|
-D DOWNLOAD_KIM=value # download OpenKIM API v2 for build, value = no (default) or yes
|
||||||
-D LMP_DEBUG_CURL=value # set libcurl verbose mode on/off, value = off (default) or on
|
-D LMP_DEBUG_CURL=value # set libcurl verbose mode on/off, value = off (default) or on
|
||||||
@ -203,7 +226,7 @@ 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
|
your system (in a location CMake cannot find it), set the PKG\_CONFIG\_PATH
|
||||||
environment variable so that libkim-api can be found.
|
environment variable so that libkim-api can be found.
|
||||||
|
|
||||||
For using OpenKIM web queries in LAMMPS.
|
*For using OpenKIM web queries in LAMMPS*\ :
|
||||||
|
|
||||||
If LMP\_DEBUG\_CURL is set, the libcurl verbose mode will be on, and any
|
If LMP\_DEBUG\_CURL is set, the libcurl verbose mode will be on, and any
|
||||||
libcurl calls within the KIM web query display a lot of information about
|
libcurl calls within the KIM web query display a lot of information about
|
||||||
@ -229,16 +252,23 @@ step from the lammps/src dir, using a command like these, which simply
|
|||||||
invoke the lib/kim/Install.py script with the specified args.
|
invoke the lib/kim/Install.py script with the specified args.
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
make lib-kim # print help message
|
$ make lib-kim # print help message
|
||||||
make lib-kim args="-b " # (re-)install KIM API lib with only example models
|
$ 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 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="-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="-n -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # add one model or model driver
|
||||||
make lib-kim args="-p /usr/local" # use an existing KIM API installation at the provided location
|
$ 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
|
$ make lib-kim args="-p /usr/local -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # ditto but add one model or driver
|
||||||
|
|
||||||
|
Settings for OpenKIM web queries discussed above need to be applied by adding
|
||||||
|
them to the LMP\_INC variable through editing the Makefile.machine you are
|
||||||
|
using. For example:
|
||||||
|
|
||||||
|
.. code-block:: make
|
||||||
|
|
||||||
|
LMP_INC = -DLMP_NO_SSL_CHECK
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
@ -257,22 +287,29 @@ KOKKOS\_ARCH settings described below. Note that for CMake, these are
|
|||||||
really Kokkos variables, not LAMMPS variables. Hence you must use
|
really Kokkos variables, not LAMMPS variables. Hence you must use
|
||||||
case-sensitive values, e.g. BDW, not bdw.
|
case-sensitive values, e.g. BDW, not bdw.
|
||||||
|
|
||||||
|
* AMDAVX = AMD 64-bit x86 CPUs
|
||||||
|
* EPYC = AMD EPYC Zen class CPUs
|
||||||
* ARMv80 = ARMv8.0 Compatible CPU
|
* ARMv80 = ARMv8.0 Compatible CPU
|
||||||
* ARMv81 = ARMv8.1 Compatible CPU
|
* ARMv81 = ARMv8.1 Compatible CPU
|
||||||
* ARMv8-ThunderX = ARMv8 Cavium ThunderX CPU
|
* ARMv8-ThunderX = ARMv8 Cavium ThunderX CPU
|
||||||
* BGQ = IBM Blue Gene/Q CPUs
|
* ARMv8-TX2 = ARMv8 Cavium ThunderX2 CPU
|
||||||
* Power8 = IBM POWER8 CPUs
|
* WSM = Intel Westmere CPUs
|
||||||
* Power9 = IBM POWER9 CPUs
|
|
||||||
* SNB = Intel Sandy/Ivy Bridge CPUs
|
* SNB = Intel Sandy/Ivy Bridge CPUs
|
||||||
* HSW = Intel Haswell CPUs
|
* HSW = Intel Haswell CPUs
|
||||||
* BDW = Intel Broadwell Xeon E-class CPUs
|
* BDW = Intel Broadwell Xeon E-class CPUs
|
||||||
* SKX = Intel Sky Lake Xeon E-class HPC CPUs (AVX512)
|
* SKX = Intel Sky Lake Xeon E-class HPC CPUs (AVX512)
|
||||||
* KNC = Intel Knights Corner Xeon Phi
|
* KNC = Intel Knights Corner Xeon Phi
|
||||||
* KNL = Intel Knights Landing Xeon Phi
|
* KNL = Intel Knights Landing Xeon Phi
|
||||||
|
* BGQ = IBM Blue Gene/Q CPUs
|
||||||
|
* Power7 = IBM POWER8 CPUs
|
||||||
|
* Power8 = IBM POWER8 CPUs
|
||||||
|
* Power9 = IBM POWER9 CPUs
|
||||||
|
* Kepler = NVIDIA Kepler default (generation CC 3.5)
|
||||||
* Kepler30 = NVIDIA Kepler generation CC 3.0
|
* Kepler30 = NVIDIA Kepler generation CC 3.0
|
||||||
* Kepler32 = NVIDIA Kepler generation CC 3.2
|
* Kepler32 = NVIDIA Kepler generation CC 3.2
|
||||||
* Kepler35 = NVIDIA Kepler generation CC 3.5
|
* Kepler35 = NVIDIA Kepler generation CC 3.5
|
||||||
* Kepler37 = NVIDIA Kepler generation CC 3.7
|
* Kepler37 = NVIDIA Kepler generation CC 3.7
|
||||||
|
* Maxwell = NVIDIA Maxwell default (generation CC 5.0)
|
||||||
* Maxwell50 = NVIDIA Maxwell generation CC 5.0
|
* Maxwell50 = NVIDIA Maxwell generation CC 5.0
|
||||||
* Maxwell52 = NVIDIA Maxwell generation CC 5.2
|
* Maxwell52 = NVIDIA Maxwell generation CC 5.2
|
||||||
* Maxwell53 = NVIDIA Maxwell generation CC 5.3
|
* Maxwell53 = NVIDIA Maxwell generation CC 5.3
|
||||||
@ -287,7 +324,7 @@ case-sensitive values, e.g. BDW, not bdw.
|
|||||||
For multicore CPUs using OpenMP, set these 2 variables.
|
For multicore CPUs using OpenMP, set these 2 variables.
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D KOKKOS_ARCH=archCPU # archCPU = CPU from list above
|
-D KOKKOS_ARCH=archCPU # archCPU = CPU from list above
|
||||||
-D KOKKOS_ENABLE_OPENMP=yes
|
-D KOKKOS_ENABLE_OPENMP=yes
|
||||||
@ -295,7 +332,7 @@ For multicore CPUs using OpenMP, set these 2 variables.
|
|||||||
For Intel KNLs using OpenMP, set these 2 variables:
|
For Intel KNLs using OpenMP, set these 2 variables:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D KOKKOS_ARCH=KNL
|
-D KOKKOS_ARCH=KNL
|
||||||
-D KOKKOS_ENABLE_OPENMP=yes
|
-D KOKKOS_ENABLE_OPENMP=yes
|
||||||
@ -303,7 +340,7 @@ For Intel KNLs using OpenMP, set these 2 variables:
|
|||||||
For NVIDIA GPUs using CUDA, set these 4 variables:
|
For NVIDIA GPUs using CUDA, set these 4 variables:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D KOKKOS_ARCH="archCPU;archGPU" # archCPU = CPU from list above that is hosting the GPU
|
-D KOKKOS_ARCH="archCPU;archGPU" # archCPU = CPU from list above that is hosting the GPU
|
||||||
# archGPU = GPU from list above
|
# archGPU = GPU from list above
|
||||||
@ -316,7 +353,7 @@ Kokkos library: lib/kokkos/bin/nvcc\_wrapper. The setting should
|
|||||||
include the full path name to the wrapper, e.g.
|
include the full path name to the wrapper, e.g.
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D CMAKE_CXX_COMPILER=/home/username/lammps/lib/kokkos/bin/nvcc_wrapper
|
-D CMAKE_CXX_COMPILER=/home/username/lammps/lib/kokkos/bin/nvcc_wrapper
|
||||||
|
|
||||||
@ -329,7 +366,7 @@ src/MAKE/OPTIONS/Makefile.kokkos\* files for examples.
|
|||||||
For multicore CPUs using OpenMP:
|
For multicore CPUs using OpenMP:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: make
|
||||||
|
|
||||||
KOKKOS_DEVICES = OpenMP
|
KOKKOS_DEVICES = OpenMP
|
||||||
KOKKOS_ARCH = archCPU # archCPU = CPU from list above
|
KOKKOS_ARCH = archCPU # archCPU = CPU from list above
|
||||||
@ -337,7 +374,7 @@ For multicore CPUs using OpenMP:
|
|||||||
For Intel KNLs using OpenMP:
|
For Intel KNLs using OpenMP:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: make
|
||||||
|
|
||||||
KOKKOS_DEVICES = OpenMP
|
KOKKOS_DEVICES = OpenMP
|
||||||
KOKKOS_ARCH = KNL
|
KOKKOS_ARCH = KNL
|
||||||
@ -345,7 +382,7 @@ For Intel KNLs using OpenMP:
|
|||||||
For NVIDIA GPUs using CUDA:
|
For NVIDIA GPUs using CUDA:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: make
|
||||||
|
|
||||||
KOKKOS_DEVICES = Cuda
|
KOKKOS_DEVICES = Cuda
|
||||||
KOKKOS_ARCH = archCPU,archGPU # archCPU = CPU from list above that is hosting the GPU
|
KOKKOS_ARCH = archCPU,archGPU # archCPU = CPU from list above that is hosting the GPU
|
||||||
@ -360,7 +397,7 @@ compiling CUDA files and use a C++ compiler for non-Kokkos, non-CUDA
|
|||||||
files.
|
files.
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: make
|
||||||
|
|
||||||
KOKKOS_ABSOLUTE_PATH = $(shell cd $(KOKKOS_PATH); pwd)
|
KOKKOS_ABSOLUTE_PATH = $(shell cd $(KOKKOS_PATH); pwd)
|
||||||
export OMPI_CXX = $(KOKKOS_ABSOLUTE_PATH)/config/nvcc_wrapper
|
export OMPI_CXX = $(KOKKOS_ABSOLUTE_PATH)/config/nvcc_wrapper
|
||||||
@ -381,7 +418,7 @@ library.
|
|||||||
**CMake build**\ :
|
**CMake build**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D DOWNLOAD_LATTE=value # download LATTE for build, value = no (default) or yes
|
-D DOWNLOAD_LATTE=value # download LATTE for build, value = no (default) or yes
|
||||||
-D LATTE_LIBRARY=path # LATTE library file (only needed if a custom location)
|
-D LATTE_LIBRARY=path # LATTE library file (only needed if a custom location)
|
||||||
@ -401,12 +438,12 @@ simply invokes the lib/latte/Install.py script with the specified
|
|||||||
args:
|
args:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
make lib-latte # print help message
|
$ make lib-latte # print help message
|
||||||
make lib-latte args="-b" # download and build in lib/latte/LATTE-master
|
$ make lib-latte args="-b" # download and build in lib/latte/LATTE-master
|
||||||
make lib-latte args="-p $HOME/latte" # use existing LATTE installation in $HOME/latte
|
$ make lib-latte args="-p $HOME/latte" # use existing LATTE installation in $HOME/latte
|
||||||
make lib-latte args="-b -m gfortran" # download and build in lib/latte and
|
$ make lib-latte args="-b -m gfortran" # download and build in lib/latte and
|
||||||
# copy Makefile.lammps.gfortran to Makefile.lammps
|
# copy Makefile.lammps.gfortran to Makefile.lammps
|
||||||
|
|
||||||
Note that 3 symbolic (soft) links, "includelink" and "liblink" and
|
Note that 3 symbolic (soft) links, "includelink" and "liblink" and
|
||||||
@ -431,7 +468,7 @@ be installed on your system.
|
|||||||
**CMake build**\ :
|
**CMake build**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D MESSAGE_ZMQ=value # build with ZeroMQ support, value = no (default) or yes
|
-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_LIBRARY=path # ZMQ library file (only needed if a custom location)
|
||||||
@ -446,11 +483,11 @@ one step from the lammps/src dir, using a command like these, which
|
|||||||
simply invoke the lib/message/Install.py script with the specified args:
|
simply invoke the lib/message/Install.py script with the specified args:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
make lib-message # print help message
|
$ make lib-message # print help message
|
||||||
make lib-message args="-m -z" # build with MPI and socket (ZMQ) support
|
$ 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
|
$ make lib-message args="-s" # build as serial lib with no ZMQ support
|
||||||
|
|
||||||
The build should produce two files: lib/message/cslib/src/libmessage.a
|
The build should produce two files: lib/message/cslib/src/libmessage.a
|
||||||
and lib/message/Makefile.lammps. The latter is copied from an
|
and lib/message/Makefile.lammps. The latter is copied from an
|
||||||
@ -475,7 +512,7 @@ lib/mscg/README and MSCG/Install files for more details.
|
|||||||
**CMake build**\ :
|
**CMake build**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D DOWNLOAD_MSCG=value # download MSCG for build, value = no (default) or yes
|
-D DOWNLOAD_MSCG=value # download MSCG for build, value = no (default) or yes
|
||||||
-D MSCG_LIBRARY=path # MSCG library file (only needed if a custom location)
|
-D MSCG_LIBRARY=path # MSCG library file (only needed if a custom location)
|
||||||
@ -496,14 +533,14 @@ step from the lammps/src dir, using a command like these, which simply
|
|||||||
invoke the lib/mscg/Install.py script with the specified args:
|
invoke the lib/mscg/Install.py script with the specified args:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
make lib-mscg # print help message
|
$ make lib-mscg # print help message
|
||||||
make lib-mscg args="-b -m serial" # download and build in lib/mscg/MSCG-release-master
|
$ make lib-mscg args="-b -m serial" # download and build in lib/mscg/MSCG-release-master
|
||||||
# with the settings compatible with "make serial"
|
# with the settings compatible with "make serial"
|
||||||
make lib-mscg args="-b -m mpi" # download and build in lib/mscg/MSCG-release-master
|
$ make lib-mscg args="-b -m mpi" # download and build in lib/mscg/MSCG-release-master
|
||||||
# with the settings compatible with "make mpi"
|
# with the settings compatible with "make mpi"
|
||||||
make lib-mscg args="-p /usr/local/mscg-release" # use the existing MS-CG installation in /usr/local/mscg-release
|
$ make lib-mscg args="-p /usr/local/mscg-release" # use the existing MS-CG installation in /usr/local/mscg-release
|
||||||
|
|
||||||
Note that 2 symbolic (soft) links, "includelink" and "liblink", will
|
Note that 2 symbolic (soft) links, "includelink" and "liblink", will
|
||||||
be created in lib/mscg to point to the MS-CG src/installation dir.
|
be created in lib/mscg to point to the MS-CG src/installation dir.
|
||||||
@ -552,12 +589,12 @@ dir, using a command like these, which simply invoke the
|
|||||||
lib/poems/Install.py script with the specified args:
|
lib/poems/Install.py script with the specified args:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
make lib-poems # print help message
|
$ make lib-poems # print help message
|
||||||
make lib-poems args="-m serial" # build with GNU g++ compiler (settings as with "make serial")
|
$ make lib-poems args="-m serial" # build with GNU g++ compiler (settings as with "make serial")
|
||||||
make lib-poems args="-m mpi" # build with default MPI C++ compiler (settings as with "make mpi")
|
$ make lib-poems args="-m mpi" # build with default MPI C++ compiler (settings as with "make mpi")
|
||||||
make lib-poems args="-m icc" # build with Intel icc compiler
|
$ make lib-poems args="-m icc" # build with Intel icc compiler
|
||||||
|
|
||||||
The build should produce two files: lib/poems/libpoems.a and
|
The build should produce two files: lib/poems/libpoems.a and
|
||||||
lib/poems/Makefile.lammps. The latter is copied from an existing
|
lib/poems/Makefile.lammps. The latter is copied from an existing
|
||||||
@ -584,7 +621,7 @@ lib/python/README for more details.
|
|||||||
**CMake build**\ :
|
**CMake build**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D PYTHON_EXECUTABLE=path # path to Python executable to use
|
-D PYTHON_EXECUTABLE=path # path to Python executable to use
|
||||||
|
|
||||||
@ -620,7 +657,7 @@ To build with this package, you must download and build the `Voro++ library <vor
|
|||||||
**CMake build**\ :
|
**CMake build**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D DOWNLOAD_VORO=value # download Voro++ for build, value = no (default) or yes
|
-D DOWNLOAD_VORO=value # download Voro++ for build, value = no (default) or yes
|
||||||
-D VORO_LIBRARY=path # Voro++ library file (only needed if at custom location)
|
-D VORO_LIBRARY=path # Voro++ library file (only needed if at custom location)
|
||||||
@ -642,12 +679,12 @@ simply invoke the lib/voronoi/Install.py script with the specified
|
|||||||
args:
|
args:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
make lib-voronoi # print help message
|
$ make lib-voronoi # print help message
|
||||||
make lib-voronoi args="-b" # download and build the default version in lib/voronoi/voro++-<version>
|
$ make lib-voronoi args="-b" # download and build the default version in lib/voronoi/voro++-<version>
|
||||||
make lib-voronoi args="-p $HOME/voro++" # use existing Voro++ installation in $HOME/voro++
|
$ make lib-voronoi args="-p $HOME/voro++" # use existing Voro++ installation in $HOME/voro++
|
||||||
make lib-voronoi args="-b -v voro++0.4.6" # download and build the 0.4.6 version in lib/voronoi/voro++-0.4.6
|
$ make lib-voronoi args="-b -v voro++0.4.6" # download and build the 0.4.6 version in lib/voronoi/voro++-0.4.6
|
||||||
|
|
||||||
Note that 2 symbolic (soft) links, "includelink" and "liblink", are
|
Note that 2 symbolic (soft) links, "includelink" and "liblink", are
|
||||||
created in lib/voronoi to point to the Voro++ src dir. When LAMMPS
|
created in lib/voronoi to point to the Voro++ src dir. When LAMMPS
|
||||||
@ -673,7 +710,7 @@ installation and the instructions below are followed for the respective build sy
|
|||||||
**CMake build**\ :
|
**CMake build**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D ADIOS2_DIR=path # path is where ADIOS 2.x is installed
|
-D ADIOS2_DIR=path # path is where ADIOS 2.x is installed
|
||||||
-D PKG_USER-ADIOS=yes
|
-D PKG_USER-ADIOS=yes
|
||||||
@ -683,16 +720,16 @@ installation and the instructions below are followed for the respective build sy
|
|||||||
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:
|
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:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
make yes-user-adios
|
$ make yes-user-adios
|
||||||
|
|
||||||
otherwise, set ADIOS2\_DIR environment variable when turning on the package:
|
otherwise, set ADIOS2\_DIR environment variable when turning on the package:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
ADIOS2_DIR=path make yes-user-adios # path is where ADIOS 2.x is installed
|
$ ADIOS2_DIR=path make yes-user-adios # path is where ADIOS 2.x is installed
|
||||||
|
|
||||||
|
|
||||||
----------
|
----------
|
||||||
@ -719,12 +756,12 @@ dir, using a command like these, which simply invoke the
|
|||||||
lib/atc/Install.py script with the specified args:
|
lib/atc/Install.py script with the specified args:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
make lib-atc # print help message
|
$ make lib-atc # print help message
|
||||||
make lib-atc args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
|
$ make lib-atc args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
|
||||||
make lib-atc args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
|
$ make lib-atc args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
|
||||||
make lib-atc args="-m icc" # build with Intel icc compiler
|
$ make lib-atc args="-m icc" # build with Intel icc compiler
|
||||||
|
|
||||||
The build should produce two files: lib/atc/libatc.a and
|
The build should produce two files: lib/atc/libatc.a and
|
||||||
lib/atc/Makefile.lammps. The latter is copied from an existing
|
lib/atc/Makefile.lammps. The latter is copied from an existing
|
||||||
@ -741,12 +778,12 @@ lib/linalg. In the latter case you also need to build the library in
|
|||||||
lib/linalg with a command like these:
|
lib/linalg with a command like these:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
make lib-linalg # print help message
|
$ make lib-linalg # print help message
|
||||||
make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial")
|
$ make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial")
|
||||||
make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi")
|
$ make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi")
|
||||||
make lib-linalg args="-m gfortran" # build with GNU Fortran compiler
|
$ make lib-linalg args="-m gfortran" # build with GNU Fortran compiler
|
||||||
|
|
||||||
|
|
||||||
----------
|
----------
|
||||||
@ -770,12 +807,12 @@ dir, using a command like these, which simply invoke the
|
|||||||
lib/awpmd/Install.py script with the specified args:
|
lib/awpmd/Install.py script with the specified args:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
make lib-awpmd # print help message
|
$ make lib-awpmd # print help message
|
||||||
make lib-awpmd args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
|
$ make lib-awpmd args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
|
||||||
make lib-awpmd args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
|
$ make lib-awpmd args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
|
||||||
make lib-awpmd args="-m icc" # build with Intel icc compiler
|
$ make lib-awpmd args="-m icc" # build with Intel icc compiler
|
||||||
|
|
||||||
The build should produce two files: lib/awpmd/libawpmd.a and
|
The build should produce two files: lib/awpmd/libawpmd.a and
|
||||||
lib/awpmd/Makefile.lammps. The latter is copied from an existing
|
lib/awpmd/Makefile.lammps. The latter is copied from an existing
|
||||||
@ -792,12 +829,12 @@ provided in lib/linalg. In the latter case you also need to build the
|
|||||||
library in lib/linalg with a command like these:
|
library in lib/linalg with a command like these:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
make lib-linalg # print help message
|
$ make lib-linalg # print help message
|
||||||
make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial")
|
$ make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial")
|
||||||
make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi")
|
$ make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi")
|
||||||
make lib-linalg args="-m gfortran" # build with GNU Fortran compiler
|
$ make lib-linalg args="-m gfortran" # build with GNU Fortran compiler
|
||||||
|
|
||||||
|
|
||||||
----------
|
----------
|
||||||
@ -844,12 +881,12 @@ command like these, which simply invoke the lib/colvars/Install.py script with
|
|||||||
the specified args:
|
the specified args:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
make lib-colvars # print help message
|
$ make lib-colvars # print help message
|
||||||
make lib-colvars args="-m serial" # build with GNU g++ compiler (settings as with "make serial")
|
$ make lib-colvars args="-m serial" # build with GNU g++ compiler (settings as with "make serial")
|
||||||
make lib-colvars args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
|
$ make lib-colvars args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
|
||||||
make lib-colvars args="-m g++-debug" # build with GNU g++ compiler and colvars debugging enabled
|
$ make lib-colvars args="-m g++-debug" # build with GNU g++ compiler and colvars debugging enabled
|
||||||
|
|
||||||
The "machine" argument of the "-m" flag is used to find a Makefile.machine to
|
The "machine" argument of the "-m" flag is used to find a Makefile.machine to
|
||||||
use as build recipe. If it does not already exist in lib/colvars, it will be
|
use as build recipe. If it does not already exist in lib/colvars, it will be
|
||||||
@ -858,8 +895,10 @@ core LAMMPS makefiles.
|
|||||||
|
|
||||||
Optional flags may be specified as environment variables:
|
Optional flags may be specified as environment variables:
|
||||||
|
|
||||||
COLVARS\_DEBUG=yes make lib-colvars args="-m machine" # Build with debug code (much slower)
|
.. code-block:: bash
|
||||||
COLVARS\_LEPTON=no make lib-colvars args="-m machine" # Build without Lepton (included otherwise)
|
|
||||||
|
$ COLVARS_DEBUG=yes make lib-colvars args="-m machine" # Build with debug code (much slower)
|
||||||
|
$ COLVARS_LEPTON=no make lib-colvars args="-m machine" # Build without Lepton (included otherwise)
|
||||||
|
|
||||||
The build should produce two files: the library lib/colvars/libcolvars.a
|
The build should produce two files: the library lib/colvars/libcolvars.a
|
||||||
(which also includes Lepton objects if enabled) and the specification file
|
(which also includes Lepton objects if enabled) and the specification file
|
||||||
@ -921,7 +960,7 @@ your environment. There are then two additional commands that control
|
|||||||
the manner in which PLUMED is obtained and linked into LAMMPS.
|
the manner in which PLUMED is obtained and linked into LAMMPS.
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D DOWNLOAD_PLUMED=value # download PLUMED for build, value = no (default) or yes
|
-D DOWNLOAD_PLUMED=value # download PLUMED for build, value = no (default) or yes
|
||||||
-D PLUMED_MODE=value # Linkage mode for PLUMED, value = static (default), shared, or runtime
|
-D PLUMED_MODE=value # Linkage mode for PLUMED, value = static (default), shared, or runtime
|
||||||
@ -957,12 +996,12 @@ Download/compilation/configuration of the plumed library can be done
|
|||||||
from the src folder through the following make args:
|
from the src folder through the following make args:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
make lib-plumed # print help message
|
$ make lib-plumed # print help message
|
||||||
make lib-plumed args="-b" # download and build PLUMED in lib/plumed/plumed2
|
$ make lib-plumed args="-b" # download and build PLUMED in lib/plumed/plumed2
|
||||||
make lib-plumed args="-p $HOME/.local" # use existing PLUMED installation in $HOME/.local
|
$ make lib-plumed args="-p $HOME/.local" # use existing PLUMED installation in $HOME/.local
|
||||||
make lib-plumed args="-p /usr/local -m shared" # use existing PLUMED installation in
|
$ make lib-plumed args="-p /usr/local -m shared" # use existing PLUMED installation in
|
||||||
# /usr/local and use shared linkage mode
|
# /usr/local and use shared linkage mode
|
||||||
|
|
||||||
Note that 2 symbolic (soft) links, "includelink" and "liblink" are
|
Note that 2 symbolic (soft) links, "includelink" and "liblink" are
|
||||||
@ -973,10 +1012,10 @@ mode. After this step is completed, you can install the USER-PLUMED
|
|||||||
package and compile LAMMPS in the usual manner:
|
package and compile LAMMPS in the usual manner:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
make yes-user-plumed
|
$ make yes-user-plumed
|
||||||
make machine
|
$ make machine
|
||||||
|
|
||||||
Once this compilation completes you should be able to run LAMMPS in the
|
Once this compilation completes you should be able to run LAMMPS in the
|
||||||
usual way. For shared linkage mode, libplumed.so must be found by the
|
usual way. For shared linkage mode, libplumed.so must be found by the
|
||||||
@ -1024,10 +1063,10 @@ dir, using a command like these, which simply invoke the
|
|||||||
lib/h5md/Install.py script with the specified args:
|
lib/h5md/Install.py script with the specified args:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
make lib-h5md # print help message
|
$ make lib-h5md # print help message
|
||||||
make lib-h5md args="-m h5cc" # build with h5cc compiler
|
$ make lib-h5md args="-m h5cc" # build with h5cc compiler
|
||||||
|
|
||||||
The build should produce two files: lib/h5md/libch5md.a and
|
The build should produce two files: lib/h5md/libch5md.a and
|
||||||
lib/h5md/Makefile.lammps. The latter is copied from an existing
|
lib/h5md/Makefile.lammps. The latter is copied from an existing
|
||||||
@ -1055,7 +1094,7 @@ on the :doc:`Speed intel <Speed_intel>` doc page.
|
|||||||
**CMake build**\ :
|
**CMake build**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D INTEL_ARCH=value # value = cpu (default) or knl
|
-D INTEL_ARCH=value # value = cpu (default) or knl
|
||||||
-D INTEL_LRT_MODE=value # value = threads, none, or c++11
|
-D INTEL_LRT_MODE=value # value = threads, none, or c++11
|
||||||
@ -1082,7 +1121,7 @@ additional information.
|
|||||||
For CPUs:
|
For CPUs:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: make
|
||||||
|
|
||||||
OPTFLAGS = -xHost -O2 -fp-model fast=2 -no-prec-div -qoverride-limits -qopt-zmm-usage=high
|
OPTFLAGS = -xHost -O2 -fp-model fast=2 -no-prec-div -qoverride-limits -qopt-zmm-usage=high
|
||||||
CCFLAGS = -g -qopenmp -DLAMMPS_MEMALIGN=64 -no-offload -fno-alias -ansi-alias -restrict $(OPTFLAGS)
|
CCFLAGS = -g -qopenmp -DLAMMPS_MEMALIGN=64 -no-offload -fno-alias -ansi-alias -restrict $(OPTFLAGS)
|
||||||
@ -1092,7 +1131,7 @@ For CPUs:
|
|||||||
For KNLs:
|
For KNLs:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: make
|
||||||
|
|
||||||
OPTFLAGS = -xMIC-AVX512 -O2 -fp-model fast=2 -no-prec-div -qoverride-limits
|
OPTFLAGS = -xMIC-AVX512 -O2 -fp-model fast=2 -no-prec-div -qoverride-limits
|
||||||
CCFLAGS = -g -qopenmp -DLAMMPS_MEMALIGN=64 -no-offload -fno-alias -ansi-alias -restrict $(OPTFLAGS)
|
CCFLAGS = -g -qopenmp -DLAMMPS_MEMALIGN=64 -no-offload -fno-alias -ansi-alias -restrict $(OPTFLAGS)
|
||||||
@ -1111,7 +1150,7 @@ USER-MOLFILE package
|
|||||||
**CMake build**\ :
|
**CMake build**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D MOLFILE_INCLUDE_DIRS=path # (optional) path where VMD molfile plugin headers are installed
|
-D MOLFILE_INCLUDE_DIRS=path # (optional) path where VMD molfile plugin headers are installed
|
||||||
-D PKG_USER-MOLFILE=yes
|
-D PKG_USER-MOLFILE=yes
|
||||||
@ -1191,9 +1230,9 @@ See src/MAKE/OPTIONS/Makefile.omp for an example.
|
|||||||
|
|
||||||
.. parsed-literal::
|
.. parsed-literal::
|
||||||
|
|
||||||
CCFLAGS: -fopenmp # for GNU Compilers
|
CCFLAGS: -fopenmp # for GNU and Clang Compilers
|
||||||
CCFLAGS: -qopenmp -restrict # for Intel compilers on Linux
|
CCFLAGS: -qopenmp -restrict # for Intel compilers on Linux
|
||||||
LINKFLAGS: -fopenmp # for GNU Compilers
|
LINKFLAGS: -fopenmp # for GNU and Clang Compilers
|
||||||
LINKFLAGS: -qopenmp # for Intel compilers on Linux
|
LINKFLAGS: -qopenmp # for Intel compilers on Linux
|
||||||
|
|
||||||
For other platforms and compilers, please consult the documentation
|
For other platforms and compilers, please consult the documentation
|
||||||
@ -1209,25 +1248,40 @@ how to address compatibility :ref:`issues with the 'default(none)' directive <de
|
|||||||
USER-QMMM package
|
USER-QMMM package
|
||||||
---------------------------------
|
---------------------------------
|
||||||
|
|
||||||
.. note::
|
For using LAMMPS to do QM/MM simulations via the USER-QMMM package you
|
||||||
|
need to build LAMMPS as a library. A LAMMPS executable with fix qmmm
|
||||||
The LAMMPS executable these steps produce is not yet functional
|
included can be built, but will not be able to do a QM/MM simulation
|
||||||
for a QM/MM simulation. You must also build Quantum ESPRESSO and
|
on as such. You must also build a QM code - currently only Quantum
|
||||||
create a new executable (pwqmmm.x) which links LAMMPS and Quantum
|
ESPRESSO (QE) is supported - and create a new executable which links
|
||||||
ESPRESSO together. These are steps 3 and 4 described in the
|
LAMMPS and the QM code together. Details are given in the
|
||||||
lib/qmmm/README file. Unfortunately, the Quantum ESPRESSO developers
|
lib/qmmm/README file. It is also recommended to read the instructions
|
||||||
have been breaking the interface that the QM/MM code in LAMMPS is using,
|
for :doc:`linking with LAMMPS as a library <Build_link>` for
|
||||||
so that currently (Summer 2018) using this feature requires either
|
background information. This requires compatible Quantum Espresso
|
||||||
correcting the library interface feature in recent Quantum ESPRESSO
|
and LAMMPS versions. The current interface and makefiles have last
|
||||||
releases, or using an outdated version of QE. The last version of
|
been verified to work in February 2020 with Quantum Espresso versions
|
||||||
Quantum ESPRESSO known to work with this QM/MM interface was version
|
6.3 to 6.5.
|
||||||
5.4.1 from 2016.
|
|
||||||
|
|
||||||
**CMake build**\ :
|
**CMake build**\ :
|
||||||
|
|
||||||
The CMake build system currently does not support building the full
|
When using CMake, building a LAMMPS library is required and it is
|
||||||
QM/MM-capable hybrid executable of LAMMPS and QE called pwqmmm.x.
|
recommended to build a shared library, since any libraries built from
|
||||||
You must use the traditional make build for this package.
|
the sources in the *lib* folder (including the essential libqmmm.a)
|
||||||
|
are not included in the static LAMMPS library and (currently) not
|
||||||
|
installed, while their code is included in the shared LAMMPS library.
|
||||||
|
Thus a typical command line to configure building LAMMPS for USER-QMMM
|
||||||
|
would be:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
cmake -C ../cmake/presets/minimal.cmake -D PKG_USER-QMMM=yes \
|
||||||
|
-D BUILD_LIB=yes -DBUILD_SHARED_LIBS=yes ../cmake
|
||||||
|
|
||||||
|
After completing the LAMMPS build and also configuring and compiling
|
||||||
|
Quantum ESPRESSO with external library support (via "make couple"),
|
||||||
|
go back to the lib/qmmm folder and follow the instructions on the
|
||||||
|
README file to build the combined LAMMPS/QE QM/MM executable
|
||||||
|
(pwqmmm.x) in the lib/qmmm folder. You need to make certain, that
|
||||||
|
|
||||||
|
|
||||||
**Traditional make**\ :
|
**Traditional make**\ :
|
||||||
|
|
||||||
@ -1238,12 +1292,12 @@ lammps/src dir, using a command like these, which simply invoke the
|
|||||||
lib/qmmm/Install.py script with the specified args:
|
lib/qmmm/Install.py script with the specified args:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
make lib-qmmm # print help message
|
$ make lib-qmmm # print help message
|
||||||
make lib-qmmm args="-m serial" # build with GNU Fortran compiler (settings as in "make serial")
|
$ make lib-qmmm args="-m serial" # build with GNU Fortran compiler (settings as in "make serial")
|
||||||
make lib-qmmm args="-m mpi" # build with default MPI compiler (settings as in "make mpi")
|
$ make lib-qmmm args="-m mpi" # build with default MPI compiler (settings as in "make mpi")
|
||||||
make lib-qmmm args="-m gfortran" # build with GNU Fortran compiler
|
$ make lib-qmmm args="-m gfortran" # build with GNU Fortran compiler
|
||||||
|
|
||||||
The build should produce two files: lib/qmmm/libqmmm.a and
|
The build should produce two files: lib/qmmm/libqmmm.a and
|
||||||
lib/qmmm/Makefile.lammps. The latter is copied from an existing
|
lib/qmmm/Makefile.lammps. The latter is copied from an existing
|
||||||
@ -1255,10 +1309,10 @@ a corresponding Makefile.lammps.machine file.
|
|||||||
|
|
||||||
You can then install QMMM package and build LAMMPS in the usual
|
You can then install QMMM package and build LAMMPS in the usual
|
||||||
manner. After completing the LAMMPS build and compiling Quantum
|
manner. After completing the LAMMPS build and compiling Quantum
|
||||||
ESPRESSO with external library support, go back to the lib/qmmm folder
|
ESPRESSO with external library support (via "make couple"), go back to
|
||||||
and follow the instructions on the README file to build the combined
|
the lib/qmmm folder and follow the instructions in the README file to
|
||||||
LAMMPS/QE QM/MM executable (pwqmmm.x) in the lib/qmmm folder.
|
build the combined LAMMPS/QE QM/MM executable (pwqmmm.x) in the
|
||||||
|
lib/qmmm folder.
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
@ -1277,7 +1331,7 @@ lib/quip/README file for details on how to do this.
|
|||||||
**CMake build**\ :
|
**CMake build**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D QUIP_LIBRARY=path # path to libquip.a (only needed if a custom location)
|
-D QUIP_LIBRARY=path # path to libquip.a (only needed if a custom location)
|
||||||
|
|
||||||
@ -1313,7 +1367,7 @@ To build with this package, you must download and build the `ScaFaCoS Coulomb so
|
|||||||
**CMake build**\ :
|
**CMake build**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D DOWNLOAD_SCAFACOS=value # download ScaFaCoS for build, value = no (default) or yes
|
-D DOWNLOAD_SCAFACOS=value # download ScaFaCoS for build, value = no (default) or yes
|
||||||
-D SCAFACOS_LIBRARY=path # ScaFaCos library file (only needed if at custom location)
|
-D SCAFACOS_LIBRARY=path # ScaFaCos library file (only needed if at custom location)
|
||||||
@ -1358,7 +1412,7 @@ Eigen3 is a template library, so you do not need to build it.
|
|||||||
**CMake build**\ :
|
**CMake build**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D DOWNLOAD_EIGEN3 # download Eigen3, value = no (default) or yes
|
-D DOWNLOAD_EIGEN3 # download Eigen3, value = no (default) or yes
|
||||||
-D EIGEN3_INCLUDE_DIR=path # path to Eigen library (only needed if a custom location)
|
-D EIGEN3_INCLUDE_DIR=path # path to Eigen library (only needed if a custom location)
|
||||||
@ -1376,11 +1430,11 @@ the lammps/src dir, using a command like these, which simply invoke
|
|||||||
the lib/smd/Install.py script with the specified args:
|
the lib/smd/Install.py script with the specified args:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
make lib-smd # print help message
|
$ make lib-smd # print help message
|
||||||
make lib-smd args="-b" # download to lib/smd/eigen3
|
$ make lib-smd args="-b" # download to lib/smd/eigen3
|
||||||
make lib-smd args="-p /usr/include/eigen3" # use existing Eigen installation in /usr/include/eigen3
|
$ make lib-smd args="-p /usr/include/eigen3" # use existing Eigen installation in /usr/include/eigen3
|
||||||
|
|
||||||
Note that a symbolic (soft) link named "includelink" is created in
|
Note that a symbolic (soft) link named "includelink" is created in
|
||||||
lib/smd to point to the Eigen dir. When LAMMPS builds it will use
|
lib/smd to point to the Eigen dir. When LAMMPS builds it will use
|
||||||
|
|||||||
@ -3,62 +3,228 @@ Link LAMMPS as a library to another code
|
|||||||
|
|
||||||
LAMMPS can be used as a library by another application, including
|
LAMMPS can be used as a library by another application, including
|
||||||
Python scripts. The files src/library.cpp and library.h define the
|
Python scripts. The files src/library.cpp and library.h define the
|
||||||
C-style API for using LAMMPS as a library. See the :doc:`Howto library <Howto_library>` doc page for a description of the
|
C-style API for using LAMMPS as a library. See the :doc:`Howto
|
||||||
interface and how to extend it for your needs.
|
library <Howto_library>` doc page for a description of the interface
|
||||||
|
and how to extend it for your needs.
|
||||||
|
|
||||||
The :doc:`Build basics <Build_basics>` doc page explains how to build
|
The :doc:`Build basics <Build_basics>` doc page explains how to build
|
||||||
LAMMPS as either a shared or static library. This results in one of
|
LAMMPS as either a shared or static library. This results in one of
|
||||||
these 2 files:
|
these 2 files:
|
||||||
|
|
||||||
liblammps.so # shared library
|
.. parsed-literal::
|
||||||
liblammps.a # static library
|
|
||||||
|
|
||||||
|
liblammps.so # shared library
|
||||||
|
liblammps.a # static library
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
Care should be taken to use the same MPI library for the calling
|
||||||
|
code and the LAMMPS library. The library.h file includes mpi.h and
|
||||||
|
uses definitions from it so those need to be available and
|
||||||
|
consistent. When LAMMPS is compiled with the MPI STUBS library,
|
||||||
|
then its mpi.h file needs to be included. While it is technically
|
||||||
|
possible to use a full MPI library in the calling code and link to
|
||||||
|
a serial LAMMPS library compiled with MPI STUBS, it is recommended
|
||||||
|
to use the *same* MPI library for both, and then use MPI\_Comm\_split()
|
||||||
|
in the calling code to pass a suitable communicator with a subset
|
||||||
|
of MPI ranks to the function creating the LAMMPS instance.
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
|
||||||
**Link with LAMMPS as a static library**\ :
|
**Link with LAMMPS as a static library**\ :
|
||||||
|
|
||||||
The calling application can link to LAMMPS as a static library with a
|
The calling application can link to LAMMPS as a static library with
|
||||||
link command like this:
|
compilation and link commands as in the examples shown below. These
|
||||||
|
are examples for a code written in C in the file *caller.c*.
|
||||||
|
The benefit of linking to a static library is, that the resulting
|
||||||
|
executable is independent of that library since all required
|
||||||
|
executable code from the library is copied into the calling executable.
|
||||||
|
|
||||||
g++ caller.o -L/home/sjplimp/lammps/src -llammps -o caller
|
*CMake build*\ :
|
||||||
|
|
||||||
The -L argument is the path to where the liblammps.a file is. The
|
This assumes that LAMMPS has been configured with "-D BUILD_LIB=yes"
|
||||||
-llammps argument is shorthand for the file liblammps.a.
|
and installed with "make install" and the PKG\_CONFIG\_PATH environment
|
||||||
|
variable updated to include the *liblammps.pc* file installed into the
|
||||||
|
configured destination folder, if needed. The commands to compile and
|
||||||
|
link the coupled executable are then:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
mpicc -c -O $(pkgconf liblammps --cflags) caller.c
|
||||||
|
mpicxx -o caller caller.o -$(pkgconf liblammps --libs)
|
||||||
|
|
||||||
|
|
||||||
|
*Traditional make*\ :
|
||||||
|
|
||||||
|
This assumes that LAMMPS has been compiled in the folder
|
||||||
|
"${HOME}/lammps/src" with "make mode=lib mpi". The commands to compile
|
||||||
|
and link the coupled executable are then:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
mpicc -c -O -I${HOME}/lammps/src caller.c
|
||||||
|
mpicxx -o caller caller.o -L${HOME}/lammps/src -llammps
|
||||||
|
|
||||||
|
The *-I* argument is the path to the location of the *library.h*
|
||||||
|
header file containing the interface to the LAMMPS C-style library
|
||||||
|
interface. The *-L* argument is the path to where the *liblammps.a*
|
||||||
|
file is located. The *-llammps* argument is shorthand for telling the
|
||||||
|
compiler to link the file *liblammps.a*\ .
|
||||||
|
|
||||||
|
However, it is only as simple as shown above for the case of a plain
|
||||||
|
LAMMPS library without any optional packages that depend on libraries
|
||||||
|
(bundled or external). Otherwise, you need to include all flags,
|
||||||
|
libraries, and paths for the coupled executable, that are also
|
||||||
|
required to link the LAMMPS executable.
|
||||||
|
|
||||||
|
*CMake build*\ :
|
||||||
|
|
||||||
|
When using CMake, additional libraries with sources in the lib folder
|
||||||
|
are built, but not included in liblammps.a and (currently) not
|
||||||
|
installed with "make install" and not included in the *pkgconfig*
|
||||||
|
configuration file. They can be found in the top level build folder,
|
||||||
|
but you have to determine the necessary link flags manually. It is
|
||||||
|
therefore recommended to either use the traditional make procedure to
|
||||||
|
build and link with a static library or build and link with a shared
|
||||||
|
library instead.
|
||||||
|
|
||||||
|
*Traditional make*\ :
|
||||||
|
|
||||||
|
After you have compiled a static LAMMPS library using the conventional
|
||||||
|
build system for example with "make mode=lib serial". And you also
|
||||||
|
have installed the POEMS package after building its bundled library in
|
||||||
|
lib/poems. Then the commands to build and link the coupled executable
|
||||||
|
change to:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
gcc -c -O -I${HOME}/lammps/src/STUBS -I${HOME}/lammps/src -caller.c
|
||||||
|
g++ -o caller caller.o -L${HOME}/lammps/lib/poems \
|
||||||
|
-L${HOME}/lammps/src/STUBS -L${HOME}/lammps/src -llammps -lpoems -lmpi_stubs
|
||||||
|
|
||||||
|
Note, that you need to link with "g++" instead of "gcc", since LAMMPS
|
||||||
|
is C++ code. You can display the currently applied settings for building
|
||||||
|
LAMMPS for the "serial" machine target by using the command:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
make mode=print serial
|
||||||
|
|
||||||
|
Which should output something like:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
# Compiler:
|
||||||
|
CXX=g++
|
||||||
|
# Linker:
|
||||||
|
LD=g++
|
||||||
|
# Compilation:
|
||||||
|
CXXFLAGS=-g -O3 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -I${HOME}/lammps/lib/poems -I${HOME}/lammps/src/STUBS
|
||||||
|
# Linking:
|
||||||
|
LDFLAGS=-g -O
|
||||||
|
# Libraries:
|
||||||
|
LDLIBS=-L${HOME}/lammps/lib/poems -L${HOME}/lammps/src/STUBS -lpoems -lmpi_stubs
|
||||||
|
|
||||||
|
From this you can gather the necessary paths and flags. With
|
||||||
|
makefiles for other *machine* configurations you need to do the
|
||||||
|
equivalent and replace "serial" with the corresponding *machine* name
|
||||||
|
of the makefile.
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
|
||||||
**Link with LAMMPS as a shared library**\ :
|
**Link with LAMMPS as a shared library**\ :
|
||||||
|
|
||||||
If you wish to link to liblammps.so, the operating system finds shared
|
When linking to LAMMPS built as a shared library, the situation
|
||||||
libraries to load at run-time using the environment variable
|
becomes much simpler, as all dependent libraries and objects are
|
||||||
LD\_LIBRARY\_PATH. To enable this you can do one of two things:
|
included in the shared library, which is - technically speaking -
|
||||||
|
effectively a regular LAMMPS executable that is missing the `main()`
|
||||||
|
function. Thus those libraries need not to be specified when linking
|
||||||
|
the calling executable. Only the *-I* flags are needed. So the
|
||||||
|
example case from above of the serial version static LAMMPS library
|
||||||
|
with the POEMS package installed becomes:
|
||||||
|
|
||||||
(1) Copy the liblammps.so file to a location the system can find it,
|
*CMake build*\ :
|
||||||
such as /usr/local/lib. I.e. a directory already listed in your
|
|
||||||
LD\_LIBRARY\_PATH variable. You can type
|
|
||||||
|
|
||||||
|
The commands with a shared LAMMPS library compiled with the CMake
|
||||||
|
build process are the same as for the static library.
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
|
mpicc -c -O $(pkgconf liblammps --cflags) caller.c
|
||||||
|
mpicxx -o caller caller.o -$(pkgconf --libs)
|
||||||
|
|
||||||
|
*Traditional make*\ :
|
||||||
|
|
||||||
|
The commands with a shared LAMMPS library compiled with the
|
||||||
|
traditional make build using "make mode=shlib serial" becomes:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
gcc -c -O -I${HOME}/lammps/src/STUBS -I${HOME}/lammps/src -caller.c
|
||||||
|
g++ -o caller caller.o -L${HOME}/lammps/src -llammps
|
||||||
|
|
||||||
|
*Locating liblammps.so at runtime*\ :
|
||||||
|
|
||||||
|
However, now the `liblammps.so` file is required at runtime and needs
|
||||||
|
to be in a folder, where the shared linker program of the operating
|
||||||
|
system can find it. This would be either a folder like "/usr/local/lib64"
|
||||||
|
or "${HOME}/.local/lib64" or a folder pointed to by the LD\_LIBRARY\_PATH
|
||||||
|
environment variable. You can type
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
printenv LD_LIBRARY_PATH
|
printenv LD_LIBRARY_PATH
|
||||||
|
|
||||||
to see what directories are in that list.
|
to see what directories are in that list.
|
||||||
|
|
||||||
(2) Add the LAMMPS src directory (or the directory you perform CMake
|
Or you can add the LAMMPS src directory (or the directory you performed
|
||||||
build in) to your LD\_LIBRARY\_PATH, so that the current version of the
|
a CMake style build in) to your LD\_LIBRARY\_PATH, so that the current
|
||||||
shared library is always available to programs that use it.
|
version of the shared library is always available to programs that use it.
|
||||||
|
|
||||||
For the csh or tcsh shells, you would add something like this to your
|
For the Bourne or Korn shells (/bin/sh, /bin/ksh, /bin/bash etc.), you
|
||||||
~/.cshrc file:
|
would add something like this to your ~/.profile file:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
LD_LIBRARY_PATH ${LD_LIBRARY_PATH-/usr/lib64}:${HOME}/lammps/src
|
||||||
|
export LD_LIBRARY_PATH
|
||||||
|
|
||||||
|
For the csh or tcsh shells, you would equivalently add something like this
|
||||||
|
to your ~/.cshrc file:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: csh
|
||||||
|
|
||||||
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/sjplimp/lammps/src
|
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${HOME}/lammps/src
|
||||||
|
|
||||||
|
You can verify whether all required shared libraries are found with the
|
||||||
|
`ldd` tool. Example:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
$ LD_LIBRARY_PATH=/home/user/lammps/src ldd caller
|
||||||
|
linux-vdso.so.1 (0x00007ffe729e0000)
|
||||||
|
liblammps.so => /home/user/lammps/src/liblammps.so (0x00007fc91bb9e000)
|
||||||
|
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fc91b984000)
|
||||||
|
libm.so.6 => /lib64/libm.so.6 (0x00007fc91b83e000)
|
||||||
|
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fc91b824000)
|
||||||
|
libc.so.6 => /lib64/libc.so.6 (0x00007fc91b65b000)
|
||||||
|
/lib64/ld-linux-x86-64.so.2 (0x00007fc91c094000)
|
||||||
|
|
||||||
|
|
||||||
|
If a required library is missing, you would get a 'not found' entry:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
$ ldd caller
|
||||||
|
linux-vdso.so.1 (0x00007ffd672fe000)
|
||||||
|
liblammps.so => not found
|
||||||
|
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fb7c7e86000)
|
||||||
|
libm.so.6 => /usr/lib64/libm.so.6 (0x00007fb7c7d40000)
|
||||||
|
libgcc_s.so.1 => /usr/lib64/libgcc_s.so.1 (0x00007fb7c7d26000)
|
||||||
|
libc.so.6 => /usr/lib64/libc.so.6 (0x00007fb7c7b5d000)
|
||||||
|
/lib64/ld-linux-x86-64.so.2 (0x00007fb7c80a2000)
|
||||||
|
|
||||||
|
|
||||||
----------
|
----------
|
||||||
@ -67,18 +233,20 @@ For the csh or tcsh shells, you would add something like this to your
|
|||||||
**Calling the LAMMPS library**\ :
|
**Calling the LAMMPS library**\ :
|
||||||
|
|
||||||
Either flavor of library (static or shared) allows one or more LAMMPS
|
Either flavor of library (static or shared) allows one or more LAMMPS
|
||||||
objects to be instantiated from the calling program.
|
objects to be instantiated from the calling program. When used from a
|
||||||
|
C++ program, most of the symbols and functions in LAMMPS are wrapped
|
||||||
|
in a LAMMPS\_NS namespace; you can safely use any of its classes and
|
||||||
|
methods from within the calling code, as needed, and you will not incur
|
||||||
|
conflicts with functions and variables in your code that share the name.
|
||||||
|
This, however, does not extend to all additional libraries bundled with
|
||||||
|
LAMMPS in the lib folder and some of the low-level code of some packages.
|
||||||
|
|
||||||
When used from a C++ program, all of LAMMPS is wrapped in a LAMMPS\_NS
|
To be compatible with C, Fortran, Python programs, the library has a simple
|
||||||
namespace; you can safely use any of its classes and methods from
|
|
||||||
within the calling code, as needed.
|
|
||||||
|
|
||||||
When used from a C or Fortran program, the library has a simple
|
|
||||||
C-style interface, provided in src/library.cpp and src/library.h.
|
C-style interface, provided in src/library.cpp and src/library.h.
|
||||||
|
|
||||||
See the :doc:`Python library <Python_library>` doc page for a
|
See the :doc:`Python library <Python_library>` doc page for a
|
||||||
description of the Python interface to LAMMPS, which wraps the C-style
|
description of the Python interface to LAMMPS, which wraps the C-style
|
||||||
interface.
|
interface from a shared library through the ctypes python module.
|
||||||
|
|
||||||
See the sample codes in examples/COUPLE/simple for examples of C++ and
|
See the sample codes in examples/COUPLE/simple for examples of C++ and
|
||||||
C and Fortran codes that invoke LAMMPS through its library interface.
|
C and Fortran codes that invoke LAMMPS through its library interface.
|
||||||
|
|||||||
@ -7,18 +7,33 @@ src/MAKE/MACHINES, src/MAKE/OPTIONS, or src/MAKE/MINE directory (see
|
|||||||
below). It can include various options for customizing your LAMMPS
|
below). It can include various options for customizing your LAMMPS
|
||||||
build with a number of global compilation options and features.
|
build with a number of global compilation options and features.
|
||||||
|
|
||||||
|
Those makefiles are written for and tested with GNU make and may not
|
||||||
|
be compatible with other make programs. In most cases, if the "make"
|
||||||
|
program is not GNU make, then there will be a GNU make program
|
||||||
|
available under the name "gmake". If GNU make or a compatible make is
|
||||||
|
not available, you may have to first install it or switch to building
|
||||||
|
with :doc:`CMake <Build_cmake>`. The makefiles of the traditional
|
||||||
|
make based build process and the scripts they are calling expect a few
|
||||||
|
additional tools to be available and functioning.
|
||||||
|
|
||||||
|
* a Bourne shell compatible "Unix" shell program (often this is bash)
|
||||||
|
* a few shell utilities: ls, mv, ln, rm, grep, sed, tr, cat, touch, diff, dirname
|
||||||
|
* python (optional, required for "make lib-XXX" in the src folder)
|
||||||
|
|
||||||
To include LAMMPS packages (i.e. optional commands and styles) you
|
To include LAMMPS packages (i.e. optional commands and styles) you
|
||||||
must install them first, as discussed on the :doc:`Build package <Build_package>` doc page. If the packages require
|
must enable them first, as discussed on the :doc:`Build package
|
||||||
provided or external libraries, you must build those libraries before
|
<Build_package>` doc page. If a packages requires (provided or
|
||||||
building LAMMPS. Building :doc:`LAMMPS with CMake <Build_cmake>` can
|
external) libraries, you must configure and build those libraries
|
||||||
automate all of this for many types of machines, especially
|
**before** building LAMMPS itself and especially **before** enabling
|
||||||
workstations, desktops and laptops, so we suggest you try it first.
|
such a package with "make yes-<package>". Building :doc:`LAMMPS
|
||||||
|
with CMake <Build_cmake>` can automate much of this for many types of
|
||||||
|
machines, especially workstations, desktops, and laptops, so we suggest
|
||||||
|
you try it first when building LAMMPS in those cases.
|
||||||
|
|
||||||
These commands perform a default LAMMPS build, producing the LAMMPS
|
The commands below perform a default LAMMPS build, producing the LAMMPS
|
||||||
executable lmp\_serial or lmp\_mpi in lammps/src:
|
executable lmp\_serial and lmp\_mpi in lammps/src:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
.. parsed-literal::
|
|
||||||
|
|
||||||
cd lammps/src
|
cd lammps/src
|
||||||
make serial # build a serial LAMMPS executable
|
make serial # build a serial LAMMPS executable
|
||||||
@ -42,18 +57,21 @@ re-compiled.
|
|||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
When you build LAMMPS for the first time, a long list of \*.d
|
Before the actual compilation starts, LAMMPS will perform several
|
||||||
files will be printed out rapidly. This is not an error; it is the
|
steps to collect information from the configuration and setup that
|
||||||
Makefile doing its normal creation of dependencies.
|
is then embedded into the executable. When you build LAMMPS for
|
||||||
|
the first time, it will also compile a tool to quickly assemble
|
||||||
|
a list of dependencies, that are required for the make program to
|
||||||
|
correctly detect which parts need to be recompiled after changes
|
||||||
|
were made to the sources.
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
The lammps/src/MAKE tree contains the Makefile.machine files included
|
||||||
The lammps/src/MAKE tree contains all the Makefile.machine files
|
in the LAMMPS distribution. Typing "make machine" uses
|
||||||
included in the LAMMPS distribution. Typing "make machine" uses
|
*Makefile.machine*\ . Thus the "make serial" or "make mpi" lines above
|
||||||
Makefile.machine. Thus the "make serial" or "make mpi" lines above
|
use Makefile.serial and Makefile.mpi, respectively. Other makefiles
|
||||||
use Makefile.serial and Makefile.mpi. Others are in these dirs:
|
are in these directories:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. parsed-literal::
|
||||||
@ -64,7 +82,7 @@ use Makefile.serial and Makefile.mpi. Others are in these dirs:
|
|||||||
|
|
||||||
Typing "make" lists all the available Makefile.machine files. A file
|
Typing "make" lists all the available Makefile.machine files. A file
|
||||||
with the same name can appear in multiple folders (not a good idea).
|
with the same name can appear in multiple folders (not a good idea).
|
||||||
The order the dirs are searched is as follows: src/MAKE/MINE,
|
The order the directories are searched is as follows: src/MAKE/MINE,
|
||||||
src/MAKE, src/MAKE/OPTIONS, src/MAKE/MACHINES. This gives preference
|
src/MAKE, src/MAKE/OPTIONS, src/MAKE/MACHINES. This gives preference
|
||||||
to a customized file you put in src/MAKE/MINE.
|
to a customized file you put in src/MAKE/MINE.
|
||||||
|
|
||||||
@ -76,7 +94,7 @@ compilers, OS configurations, and LAMMPS itself keep changing, their
|
|||||||
settings may become outdated:
|
settings may become outdated:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
make mac # build serial LAMMPS on a Mac
|
make mac # build serial LAMMPS on a Mac
|
||||||
make mac_mpi # build parallel LAMMPS on a Mac
|
make mac_mpi # build parallel LAMMPS on a Mac
|
||||||
|
|||||||
@ -14,10 +14,13 @@ package. In general there is no need to include a package if you
|
|||||||
never plan to use its features.
|
never plan to use its features.
|
||||||
|
|
||||||
If you get a run-time error that a LAMMPS command or style is
|
If you get a run-time error that a LAMMPS command or style is
|
||||||
"Unknown", it is often because the command is contained in a package,
|
"unknown", it is often because the command is contained in a package,
|
||||||
and your build did not include that package. Running LAMMPS with the
|
and your build did not include that package. If the command or style
|
||||||
:doc:`-h command-line switch <Run_options>` will print all the included
|
*is* available in a package included in the LAMMPS distribution,
|
||||||
packages and commands for that executable.
|
the error message will indicate which package would be needed.
|
||||||
|
Running LAMMPS with the :doc:`-h command-line switch <Run_options>`
|
||||||
|
will print *all* optional commands and packages that were enabled
|
||||||
|
when building that executable.
|
||||||
|
|
||||||
For the majority of packages, if you follow the single step below to
|
For the majority of packages, if you follow the single step below to
|
||||||
include it, you can then build LAMMPS exactly the same as you would
|
include it, you can then build LAMMPS exactly the same as you would
|
||||||
@ -42,17 +45,17 @@ packages:
|
|||||||
The mechanism for including packages is simple but different for CMake
|
The mechanism for including packages is simple but different for CMake
|
||||||
versus make.
|
versus make.
|
||||||
|
|
||||||
**CMake variables**\ :
|
**CMake build**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D PKG_NAME=value # yes or no (default)
|
-D PKG_NAME=value # yes or no (default)
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D PKG_MANYBODY=yes
|
-D PKG_MANYBODY=yes
|
||||||
-D PKG_USER-INTEL=yes
|
-D PKG_USER-INTEL=yes
|
||||||
@ -74,7 +77,7 @@ once with CMake.
|
|||||||
**Traditional make**\ :
|
**Traditional make**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
cd lammps/src
|
cd lammps/src
|
||||||
make ps # check which packages are currently installed
|
make ps # check which packages are currently installed
|
||||||
@ -85,7 +88,7 @@ once with CMake.
|
|||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
make no-rigid
|
make no-rigid
|
||||||
make yes-user-intel
|
make yes-user-intel
|
||||||
@ -119,7 +122,7 @@ are already included. Likewise, if a package is excluded, other files
|
|||||||
dependent on that package are also excluded.
|
dependent on that package are also excluded.
|
||||||
|
|
||||||
When you download a LAMMPS tarball or download LAMMPS source files
|
When you download a LAMMPS tarball or download LAMMPS source files
|
||||||
from the Git or SVN repositories, no packages are pre-installed in the
|
from the git repository, no packages are pre-installed in the
|
||||||
src directory.
|
src directory.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
@ -136,9 +139,10 @@ src directory.
|
|||||||
**CMake shortcuts for installing many packages**\ :
|
**CMake shortcuts for installing many packages**\ :
|
||||||
|
|
||||||
Instead of specifying all the CMake options via the command-line,
|
Instead of specifying all the CMake options via the command-line,
|
||||||
CMake allows initializing the variable cache using script files. These
|
CMake allows initializing its settings cache using script files.
|
||||||
are regular CMake files which can manipulate and set variables, and
|
These are regular CMake files which can manipulate and set CMake
|
||||||
can also contain control flow constructs.
|
variables (which represent selected options), and can also contain
|
||||||
|
control flow constructs for more complex operations.
|
||||||
|
|
||||||
LAMMPS includes several of these files to define configuration
|
LAMMPS includes several of these files to define configuration
|
||||||
"presets", similar to the options that exist for the Make based
|
"presets", similar to the options that exist for the Make based
|
||||||
@ -146,25 +150,19 @@ system. Using these files you can enable/disable portions of the
|
|||||||
available packages in LAMMPS. If you need a custom preset you can take
|
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.
|
one of them as a starting point and customize it to your needs.
|
||||||
|
|
||||||
+-------------------------------------------------------------+-----------------------------------------------------------+
|
.. code-block:: bash
|
||||||
| cmake -C ../cmake/presets/all\_on.cmake [OPTIONS] ../cmake | enable all packages |
|
|
||||||
+-------------------------------------------------------------+-----------------------------------------------------------+
|
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/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/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/most.cmake [OPTIONS] ../cmake | enable most common packages |
|
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
|
||||||
| 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 |
|
|
||||||
+-------------------------------------------------------------+-----------------------------------------------------------+
|
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
Running cmake this way manipulates the variable cache in your
|
Running cmake this way manipulates the CMake settings cache in your
|
||||||
current build directory. You can combine multiple presets and options
|
current build directory. You can combine multiple presets and options
|
||||||
in a single cmake run, or change settings incrementally by running
|
in a single cmake run, or change settings incrementally by running
|
||||||
cmake with new flags.
|
cmake with new flags.
|
||||||
@ -172,7 +170,7 @@ one of them as a starting point and customize it to your needs.
|
|||||||
**Example:**
|
**Example:**
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
# build LAMMPS with most commonly used packages, but then remove
|
# build LAMMPS with most commonly used packages, but then remove
|
||||||
# those requiring additional library or tools, but still enable
|
# those requiring additional library or tools, but still enable
|
||||||
@ -200,37 +198,30 @@ Just type "make" in lammps/src to see a one-line summary.
|
|||||||
|
|
||||||
These commands install/un-install sets of packages:
|
These commands install/un-install sets of packages:
|
||||||
|
|
||||||
+-----------------------------------+-----------------------------------------------------+
|
.. code-block:: bash
|
||||||
| make yes-all | install all packages |
|
|
||||||
+-----------------------------------+-----------------------------------------------------+
|
make yes-all # install all packages
|
||||||
| make no-all | un-install all packages |
|
make no-all # uninstall all packages
|
||||||
+-----------------------------------+-----------------------------------------------------+
|
make yes-standard or make yes-std # install standard packages
|
||||||
| make yes-standard or make yes-std | install standard packages |
|
make no-standard or make no-std # uninstall standard packages
|
||||||
+-----------------------------------+-----------------------------------------------------+
|
make yes-user # install user packages
|
||||||
| make no-standard or make no-std | un-install standard packages |
|
make no-user # uninstall user packages
|
||||||
+-----------------------------------+-----------------------------------------------------+
|
make yes-lib # install packages that require extra libraries
|
||||||
| make yes-user | install user packages |
|
make no-lib # uninstall packages that require extra libraries
|
||||||
+-----------------------------------+-----------------------------------------------------+
|
make yes-ext # install packages that require external libraries
|
||||||
| make no-user | un-install user packages |
|
make no-ext # uninstall packages that require external libraries
|
||||||
+-----------------------------------+-----------------------------------------------------+
|
|
||||||
| make yes-lib | install packages that require extra libraries |
|
|
||||||
+-----------------------------------+-----------------------------------------------------+
|
|
||||||
| make no-lib | un-install packages that require extra libraries |
|
|
||||||
+-----------------------------------+-----------------------------------------------------+
|
|
||||||
| make yes-ext | install packages that require external libraries |
|
|
||||||
+-----------------------------------+-----------------------------------------------------+
|
|
||||||
| make no-ext | un-install packages that require external libraries |
|
|
||||||
+-----------------------------------+-----------------------------------------------------+
|
|
||||||
|
|
||||||
which install/un-install various sets of packages. Typing "make
|
which install/un-install various sets of packages. Typing "make
|
||||||
package" will list all the these commands.
|
package" will list all the these commands.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
Installing or un-installing a package works by simply copying
|
Installing or un-installing a package for the make based build process
|
||||||
files back and forth between the main src directory and
|
works by simply copying files back and forth between the main source
|
||||||
sub-directories with the package name (e.g. src/KSPACE, src/USER-ATC),
|
directory src and the sub-directories with the package name (e.g.
|
||||||
so that the files are included or excluded when LAMMPS is built.
|
src/KSPACE, src/USER-ATC), so that the files are included or excluded
|
||||||
|
when LAMMPS is built. Only source files in the src folder will be
|
||||||
|
compiled.
|
||||||
|
|
||||||
The following make commands help manage files that exist in both the
|
The following make commands help manage files that exist in both the
|
||||||
src directory and in package sub-directories. You do not normally
|
src directory and in package sub-directories. You do not normally
|
||||||
@ -257,4 +248,4 @@ Type "make package-overwrite" to overwrite files in the package
|
|||||||
sub-directories with src files.
|
sub-directories with src files.
|
||||||
|
|
||||||
Type "make package-diff" to list all differences between pairs of
|
Type "make package-diff" to list all differences between pairs of
|
||||||
files in both the src dir and a package dir.
|
files in both the source directory and the package directory.
|
||||||
|
|||||||
@ -4,16 +4,15 @@ Optional build settings
|
|||||||
LAMMPS can be built with several optional settings. Each sub-section
|
LAMMPS can be built with several optional settings. Each sub-section
|
||||||
explain how to do this for building both with CMake and make.
|
explain how to do this for building both with CMake and make.
|
||||||
|
|
||||||
| :ref:`C++11 standard compliance test <cxx11>` when building all of LAMMPS
|
* :ref:`C++11 standard compliance <cxx11>` when building all of LAMMPS
|
||||||
| :ref:`FFT library <fft>` for use with the :doc:`kspace_style pppm <kspace_style>` command
|
* :ref:`FFT library <fft>` for use with the :doc:`kspace_style pppm <kspace_style>` command
|
||||||
| :ref:`Size of LAMMPS data types <size>`
|
* :ref:`Size of LAMMPS data types <size>`
|
||||||
| :ref:`Read or write compressed files <gzip>`
|
* :ref:`Read or write compressed files <gzip>`
|
||||||
| :ref:`Output of JPG and PNG files <graphics>` via the :doc:`dump image <dump_image>` command
|
* :ref:`Output of JPG and PNG files <graphics>` via the :doc:`dump image <dump_image>` command
|
||||||
| :ref:`Output of movie files <graphics>` via the :doc:`dump_movie <dump_image>` command
|
* :ref:`Output of movie files <graphics>` via the :doc:`dump_movie <dump_image>` command
|
||||||
| :ref:`Memory allocation alignment <align>`
|
* :ref:`Memory allocation alignment <align>`
|
||||||
| :ref:`Workaround for long long integers <longlong>`
|
* :ref:`Workaround for long long integers <longlong>`
|
||||||
| :ref:`Error handling exceptions <exceptions>` when using LAMMPS as a library
|
* :ref:`Error handling exceptions <exceptions>` when using LAMMPS as a library
|
||||||
|
|
|
||||||
|
|
||||||
|
|
||||||
----------
|
----------
|
||||||
@ -21,45 +20,16 @@ explain how to do this for building both with CMake and make.
|
|||||||
|
|
||||||
.. _cxx11:
|
.. _cxx11:
|
||||||
|
|
||||||
C++11 standard compliance test
|
C++11 standard compliance
|
||||||
------------------------------------------
|
------------------------------------------
|
||||||
|
|
||||||
The LAMMPS developers plan to transition to make the C++11 standard the
|
A C++11 standard compatible compiler is a requirement for compiling LAMMPS.
|
||||||
minimum requirement for compiling LAMMPS. Currently this only applies to
|
LAMMPS version 3 March 2020 is the last version compatible with the previous
|
||||||
some packages like KOKKOS while the rest aims to be compatible with the C++98
|
C++98 standard for the core code and most packages. Most currently used
|
||||||
standard. Most currently used compilers are compatible with C++11; some need
|
C++ compilers are compatible with C++11, but some older ones may need extra
|
||||||
to set extra flags to switch. To determine the impact of requiring C++11,
|
flags to enable C++11 compliance. Example for GNU c++ 4.8.x:
|
||||||
we have added a simple compliance test to the source code, that will cause
|
|
||||||
the compilation to abort, if C++11 compliance is not available or enabled.
|
|
||||||
To bypass this check, you need to change a setting in the makefile or
|
|
||||||
when calling CMake.
|
|
||||||
|
|
||||||
**CMake variable**\ :
|
.. code-block:: make
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
|
||||||
|
|
||||||
-D DISABLE_CXX11_REQUIREMENT=yes
|
|
||||||
|
|
||||||
You can set additional C++ compiler flags (beyond those selected by CMake)
|
|
||||||
through the CMAKE\_CXX\_FLAGS variable. Example for CentOS 7:
|
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
|
||||||
|
|
||||||
-D CMAKE_CXX_FLAGS="-O3 -g -fopenmp -DNDEBUG -std=c++11"
|
|
||||||
|
|
||||||
**Makefile.machine setting**\ to bypass the C++11 test and compile in C++98 mode:
|
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
|
||||||
|
|
||||||
LMP_INC = -DLAMMPS_CXX98
|
|
||||||
|
|
||||||
**Makefile.machine setting**\ to enable the C++11 with older (but not too old) GNU c++ (e.g. on CentOS 7):
|
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
|
||||||
|
|
||||||
CCFLAGS = -g -O3 -std=c++11
|
CCFLAGS = -g -O3 -std=c++11
|
||||||
|
|
||||||
@ -80,7 +50,7 @@ LAMMPS can use them if they are available on your system.
|
|||||||
**CMake variables**\ :
|
**CMake variables**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D FFT=value # FFTW3 or MKL or KISS, default is FFTW3 if found, else KISS
|
-D FFT=value # FFTW3 or MKL or KISS, default is FFTW3 if found, else KISS
|
||||||
-D FFT_SINGLE=value # yes or no (default), no = double precision
|
-D FFT_SINGLE=value # yes or no (default), no = double precision
|
||||||
@ -100,7 +70,7 @@ used. If CMake cannot detect the FFT library, you can set these variables
|
|||||||
to assist:
|
to assist:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D FFTW3_INCLUDE_DIRS=path # path to FFTW3 include files
|
-D FFTW3_INCLUDE_DIRS=path # path to FFTW3 include files
|
||||||
-D FFTW3_LIBRARIES=path # path to FFTW3 libraries
|
-D FFTW3_LIBRARIES=path # path to FFTW3 libraries
|
||||||
@ -112,7 +82,7 @@ to assist:
|
|||||||
**Makefile.machine settings**\ :
|
**Makefile.machine settings**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: make
|
||||||
|
|
||||||
FFT_INC = -DFFT_FFTW3 # -DFFT_FFTW3, -DFFT_FFTW (same as -DFFT_FFTW3), -DFFT_MKL, or -DFFT_KISS
|
FFT_INC = -DFFT_FFTW3 # -DFFT_FFTW3, -DFFT_FFTW (same as -DFFT_FFTW3), -DFFT_MKL, or -DFFT_KISS
|
||||||
# default is KISS if not specified
|
# default is KISS if not specified
|
||||||
@ -124,7 +94,7 @@ to assist:
|
|||||||
# default is FFT\_PACK\_ARRAY if not specified
|
# default is FFT\_PACK\_ARRAY if not specified
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: make
|
||||||
|
|
||||||
FFT_INC = -I/usr/local/include
|
FFT_INC = -I/usr/local/include
|
||||||
FFT_PATH = -L/usr/local/lib
|
FFT_PATH = -L/usr/local/lib
|
||||||
@ -190,7 +160,7 @@ For FFTW3, do the following, which should produce the additional
|
|||||||
library libfftw3f.a or libfftw3f.so.
|
library libfftw3f.a or libfftw3f.so.
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
make clean
|
make clean
|
||||||
./configure --enable-single; make; make install
|
./configure --enable-single; make; make install
|
||||||
@ -218,14 +188,14 @@ adequate.
|
|||||||
**CMake variable**\ :
|
**CMake variable**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D LAMMPS_SIZES=value # smallbig (default) or bigbig or smallsmall
|
-D LAMMPS_SIZES=value # smallbig (default) or bigbig or smallsmall
|
||||||
|
|
||||||
**Makefile.machine setting**\ :
|
**Makefile.machine setting**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: make
|
||||||
|
|
||||||
LMP_INC = -DLAMMPS_SMALLBIG # or -DLAMMPS_BIGBIG or -DLAMMPS_SMALLSMALL
|
LMP_INC = -DLAMMPS_SMALLBIG # or -DLAMMPS_BIGBIG or -DLAMMPS_SMALLSMALL
|
||||||
|
|
||||||
@ -296,7 +266,7 @@ following settings:
|
|||||||
**CMake variables**\ :
|
**CMake variables**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D WITH_JPEG=value # yes or no
|
-D WITH_JPEG=value # yes or no
|
||||||
# default = yes if CMake finds JPEG files, else no
|
# default = yes if CMake finds JPEG files, else no
|
||||||
@ -310,7 +280,7 @@ the graphics header, library, executable files, you can set these
|
|||||||
variables:
|
variables:
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D JPEG_INCLUDE_DIR=path # path to jpeglib.h header file
|
-D JPEG_INCLUDE_DIR=path # path to jpeglib.h header file
|
||||||
-D JPEG_LIBRARIES=path # path to libjpeg.a (.so) file
|
-D JPEG_LIBRARIES=path # path to libjpeg.a (.so) file
|
||||||
@ -323,7 +293,7 @@ variables:
|
|||||||
**Makefile.machine settings**\ :
|
**Makefile.machine settings**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: make
|
||||||
|
|
||||||
LMP_INC = -DLAMMPS_JPEG
|
LMP_INC = -DLAMMPS_JPEG
|
||||||
LMP_INC = -DLAMMPS_PNG
|
LMP_INC = -DLAMMPS_PNG
|
||||||
@ -337,7 +307,7 @@ As with CMake, you do not need to set JPG\_INC or JPG\_PATH, if make can
|
|||||||
find the graphics header and library files. You must specify JPG\_LIB
|
find the graphics header and library files. You must specify JPG\_LIB
|
||||||
with a list of graphics libraries to include in the link. You must
|
with a list of graphics libraries to include in the link. You must
|
||||||
insure ffmpeg is in a directory where LAMMPS can find it at runtime,
|
insure ffmpeg is in a directory where LAMMPS can find it at runtime,
|
||||||
i.e. a dir in your PATH environment variable.
|
that is a directory in your PATH environment variable.
|
||||||
|
|
||||||
**CMake and make info**\ :
|
**CMake and make info**\ :
|
||||||
|
|
||||||
@ -347,7 +317,7 @@ supports the "popen" function in the standard runtime library.
|
|||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
On some clusters with high-speed networks, using the fork()
|
On some clusters with high-speed networks, using the fork()
|
||||||
library calls (required by popen()) can interfere with the fast
|
library call (required by popen()) can interfere with the fast
|
||||||
communication library and lead to simulations using ffmpeg to hang or
|
communication library and lead to simulations using ffmpeg to hang or
|
||||||
crash.
|
crash.
|
||||||
|
|
||||||
@ -367,7 +337,7 @@ gzip compression by several LAMMPS commands, including
|
|||||||
**CMake variables**\ :
|
**CMake variables**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D WITH_GZIP=value # yes or no
|
-D WITH_GZIP=value # yes or no
|
||||||
# default is yes if CMake can find gzip, else no
|
# default is yes if CMake can find gzip, else no
|
||||||
@ -376,7 +346,7 @@ gzip compression by several LAMMPS commands, including
|
|||||||
**Makefile.machine setting**\ :
|
**Makefile.machine setting**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: make
|
||||||
|
|
||||||
LMP_INC = -DLAMMPS_GZIP
|
LMP_INC = -DLAMMPS_GZIP
|
||||||
|
|
||||||
@ -389,7 +359,7 @@ found by LAMMPS during a run.
|
|||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
On some clusters with high-speed networks, using the fork()
|
On some clusters with high-speed networks, using the fork()
|
||||||
library calls (required by popen()) can interfere with the fast
|
library call (required by popen()) can interfere with the fast
|
||||||
communication library and lead to simulations using compressed output
|
communication library and lead to simulations using compressed output
|
||||||
or input to hang or crash. For selected operations, compressed file
|
or input to hang or crash. For selected operations, compressed file
|
||||||
I/O is also available using a compression library instead, which is
|
I/O is also available using a compression library instead, which is
|
||||||
@ -416,7 +386,7 @@ aligned on 64-byte boundaries.
|
|||||||
**CMake variable**\ :
|
**CMake variable**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D LAMMPS_MEMALIGN=value # 0, 8, 16, 32, 64 (default)
|
-D LAMMPS_MEMALIGN=value # 0, 8, 16, 32, 64 (default)
|
||||||
|
|
||||||
@ -428,7 +398,7 @@ and this setting ignored.
|
|||||||
**Makefile.machine setting**\ :
|
**Makefile.machine setting**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: make
|
||||||
|
|
||||||
LMP_INC = -DLAMMPS_MEMALIGN=value # 8, 16, 32, 64
|
LMP_INC = -DLAMMPS_MEMALIGN=value # 8, 16, 32, 64
|
||||||
|
|
||||||
@ -455,14 +425,14 @@ those systems:
|
|||||||
**CMake variable**\ :
|
**CMake variable**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D LAMMPS_LONGLONG_TO_LONG=value # yes or no (default)
|
-D LAMMPS_LONGLONG_TO_LONG=value # yes or no (default)
|
||||||
|
|
||||||
**Makefile.machine setting**\ :
|
**Makefile.machine setting**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: make
|
||||||
|
|
||||||
LMP_INC = -DLAMMPS_LONGLONG_TO_LONG
|
LMP_INC = -DLAMMPS_LONGLONG_TO_LONG
|
||||||
|
|
||||||
@ -476,20 +446,21 @@ Exception handling when using LAMMPS as a library
|
|||||||
------------------------------------------------------------------
|
------------------------------------------------------------------
|
||||||
|
|
||||||
This setting is useful when external codes drive LAMMPS as a library.
|
This setting is useful when external codes drive LAMMPS as a library.
|
||||||
With this option enabled LAMMPS errors do not kill the caller.
|
With this option enabled, LAMMPS errors do not kill the calling code.
|
||||||
Instead, the call stack is unwound and control returns to the caller,
|
Instead, the call stack is unwound and control returns to the caller,
|
||||||
e.g. to Python.
|
e.g. to Python. Of course the calling code has to be set up to
|
||||||
|
*catch* exceptions from within LAMMPS.
|
||||||
|
|
||||||
**CMake variable**\ :
|
**CMake variable**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: bash
|
||||||
|
|
||||||
-D LAMMPS_EXCEPTIONS=value # yes or no (default)
|
-D LAMMPS_EXCEPTIONS=value # yes or no (default)
|
||||||
|
|
||||||
**Makefile.machine setting**\ :
|
**Makefile.machine setting**\ :
|
||||||
|
|
||||||
|
|
||||||
.. parsed-literal::
|
.. code-block:: make
|
||||||
|
|
||||||
LMP_INC = -DLAMMPS_EXCEPTIONS
|
LMP_INC = -DLAMMPS_EXCEPTIONS
|
||||||
|
|||||||
@ -17,7 +17,7 @@ General commands
|
|||||||
An alphabetic list of all general LAMMPS commands.
|
An alphabetic list of all general LAMMPS commands.
|
||||||
|
|
||||||
.. table_from_list::
|
.. table_from_list::
|
||||||
:columns: 6
|
:columns: 5
|
||||||
|
|
||||||
* :doc:`angle_coeff <angle_coeff>`
|
* :doc:`angle_coeff <angle_coeff>`
|
||||||
* :doc:`angle_style <angle_style>`
|
* :doc:`angle_style <angle_style>`
|
||||||
|
|||||||
@ -7,126 +7,163 @@ alphabetically. Style options for entries like fix, compute, pair etc.
|
|||||||
have their own pages where they are listed alphabetically.
|
have their own pages where they are listed alphabetically.
|
||||||
|
|
||||||
Initialization:
|
Initialization:
|
||||||
|
------------------------------
|
||||||
|
|
||||||
* :doc:`newton <newton>`,
|
.. table_from_list::
|
||||||
* :doc:`package <package>`,
|
:columns: 5
|
||||||
* :doc:`processors <processors>`,
|
|
||||||
* :doc:`suffix <suffix>`,
|
* :doc:`newton <newton>`
|
||||||
* :doc:`units <units>`
|
* :doc:`package <package>`
|
||||||
|
* :doc:`processors <processors>`
|
||||||
|
* :doc:`suffix <suffix>`
|
||||||
|
* :doc:`units <units>`
|
||||||
|
|
||||||
Setup simulation box:
|
Setup simulation box:
|
||||||
|
------------------------------
|
||||||
|
|
||||||
* :doc:`boundary <boundary>`,
|
.. table_from_list::
|
||||||
* :doc:`box <box>`,
|
:columns: 4
|
||||||
* :doc:`change_box <change_box>`,
|
|
||||||
* :doc:`create_box <create_box>`,
|
* :doc:`boundary <boundary>`
|
||||||
* :doc:`dimension <dimension>`,
|
* :doc:`box <box>`
|
||||||
* :doc:`lattice <lattice>`,
|
* :doc:`change_box <change_box>`
|
||||||
* :doc:`region <region>`
|
* :doc:`create_box <create_box>`
|
||||||
|
* :doc:`dimension <dimension>`
|
||||||
|
* :doc:`lattice <lattice>`
|
||||||
|
* :doc:`region <region>`
|
||||||
|
|
||||||
Setup atoms:
|
Setup atoms:
|
||||||
|
------------------------------
|
||||||
|
|
||||||
* :doc:`atom_modify <atom_modify>`,
|
.. table_from_list::
|
||||||
* :doc:`atom_style <atom_style>`,
|
:columns: 4
|
||||||
* :doc:`balance <balance>`,
|
|
||||||
* :doc:`create_atoms <create_atoms>`,
|
* :doc:`atom_modify <atom_modify>`
|
||||||
* :doc:`create_bonds <create_bonds>`,
|
* :doc:`atom_style <atom_style>`
|
||||||
* :doc:`delete_atoms <delete_atoms>`,
|
* :doc:`balance <balance>`
|
||||||
* :doc:`delete_bonds <delete_bonds>`,
|
* :doc:`create_atoms <create_atoms>`
|
||||||
* :doc:`displace_atoms <displace_atoms>`,
|
* :doc:`create_bonds <create_bonds>`
|
||||||
* :doc:`group <group>`,
|
* :doc:`delete_atoms <delete_atoms>`
|
||||||
* :doc:`mass <mass>`,
|
* :doc:`delete_bonds <delete_bonds>`
|
||||||
* :doc:`molecule <molecule>`,
|
* :doc:`displace_atoms <displace_atoms>`
|
||||||
* :doc:`read_data <read_data>`,
|
* :doc:`group <group>`
|
||||||
* :doc:`read_dump <read_dump>`,
|
* :doc:`mass <mass>`
|
||||||
* :doc:`read_restart <read_restart>`,
|
* :doc:`molecule <molecule>`
|
||||||
* :doc:`replicate <replicate>`,
|
* :doc:`read_data <read_data>`
|
||||||
* :doc:`set <set>`,
|
* :doc:`read_dump <read_dump>`
|
||||||
* :doc:`velocity <velocity>`
|
* :doc:`read_restart <read_restart>`
|
||||||
|
* :doc:`replicate <replicate>`
|
||||||
|
* :doc:`set <set>`
|
||||||
|
* :doc:`velocity <velocity>`
|
||||||
|
|
||||||
Force fields:
|
Force fields:
|
||||||
|
------------------------------
|
||||||
|
|
||||||
* :doc:`angle_coeff <angle_coeff>`,
|
.. table_from_list::
|
||||||
* :doc:`angle_style <angle_style>`,
|
:columns: 4
|
||||||
* :doc:`bond_coeff <bond_coeff>`,
|
|
||||||
* :doc:`bond_style <bond_style>`,
|
* :doc:`angle_coeff <angle_coeff>`
|
||||||
* :doc:`bond_write <bond_write>`,
|
* :doc:`angle_style <angle_style>`
|
||||||
* :doc:`dielectric <dielectric>`,
|
* :doc:`bond_coeff <bond_coeff>`
|
||||||
* :doc:`dihedral_coeff <dihedral_coeff>`,
|
* :doc:`bond_style <bond_style>`
|
||||||
* :doc:`dihedral_style <dihedral_style>`,
|
* :doc:`bond_write <bond_write>`
|
||||||
* :doc:`improper_coeff <improper_coeff>`,
|
* :doc:`dielectric <dielectric>`
|
||||||
* :doc:`improper_style <improper_style>`,
|
* :doc:`dihedral_coeff <dihedral_coeff>`
|
||||||
* :doc:`kspace_modify <kspace_modify>`,
|
* :doc:`dihedral_style <dihedral_style>`
|
||||||
* :doc:`kspace_style <kspace_style>`,
|
* :doc:`improper_coeff <improper_coeff>`
|
||||||
* :doc:`pair_coeff <pair_coeff>`,
|
* :doc:`improper_style <improper_style>`
|
||||||
* :doc:`pair_modify <pair_modify>`,
|
* :doc:`kspace_modify <kspace_modify>`
|
||||||
* :doc:`pair_style <pair_style>`,
|
* :doc:`kspace_style <kspace_style>`
|
||||||
* :doc:`pair_write <pair_write>`,
|
* :doc:`pair_coeff <pair_coeff>`
|
||||||
* :doc:`special_bonds <special_bonds>`
|
* :doc:`pair_modify <pair_modify>`
|
||||||
|
* :doc:`pair_style <pair_style>`
|
||||||
|
* :doc:`pair_write <pair_write>`
|
||||||
|
* :doc:`special_bonds <special_bonds>`
|
||||||
|
|
||||||
Settings:
|
Settings:
|
||||||
|
------------------------------
|
||||||
|
|
||||||
* :doc:`comm_modify <comm_modify>`,
|
.. table_from_list::
|
||||||
* :doc:`comm_style <comm_style>`,
|
:columns: 4
|
||||||
* :doc:`info <info>`,
|
|
||||||
* :doc:`min_modify <min_modify>`,
|
* :doc:`comm_modify <comm_modify>`
|
||||||
* :doc:`min_style <min_style>`,
|
* :doc:`comm_style <comm_style>`
|
||||||
* :doc:`neigh_modify <neigh_modify>`,
|
* :doc:`info <info>`
|
||||||
* :doc:`neighbor <neighbor>`,
|
* :doc:`min_modify <min_modify>`
|
||||||
* :doc:`partition <partition>`,
|
* :doc:`min_style <min_style>`
|
||||||
* :doc:`reset_timestep <reset_timestep>`,
|
* :doc:`neigh_modify <neigh_modify>`
|
||||||
* :doc:`run_style <run_style>`,
|
* :doc:`neighbor <neighbor>`
|
||||||
* :doc:`timer <timer>`,
|
* :doc:`partition <partition>`
|
||||||
* :doc:`timestep <timestep>`
|
* :doc:`reset_timestep <reset_timestep>`
|
||||||
|
* :doc:`run_style <run_style>`
|
||||||
|
* :doc:`timer <timer>`
|
||||||
|
* :doc:`timestep <timestep>`
|
||||||
|
|
||||||
Operations within timestepping (fixes) and diagnostics (computes):
|
Operations within timestepping (fixes) and diagnostics (computes):
|
||||||
|
------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
* :doc:`compute <compute>`,
|
.. table_from_list::
|
||||||
* :doc:`compute_modify <compute_modify>`,
|
:columns: 4
|
||||||
* :doc:`fix <fix>`,
|
|
||||||
* :doc:`fix_modify <fix_modify>`,
|
* :doc:`compute <compute>`
|
||||||
* :doc:`uncompute <uncompute>`,
|
* :doc:`compute_modify <compute_modify>`
|
||||||
* :doc:`unfix <unfix>`
|
* :doc:`fix <fix>`
|
||||||
|
* :doc:`fix_modify <fix_modify>`
|
||||||
|
* :doc:`uncompute <uncompute>`
|
||||||
|
* :doc:`unfix <unfix>`
|
||||||
|
|
||||||
Output:
|
Output:
|
||||||
|
------------------------------
|
||||||
|
|
||||||
* :doc:`dump image <dump_image>`,
|
.. table_from_list::
|
||||||
* :doc:`dump movie <dump_image>`,
|
:columns: 4
|
||||||
* :doc:`dump <dump>`,
|
|
||||||
* :doc:`dump_modify <dump_modify>`,
|
* :doc:`dump image <dump_image>`
|
||||||
* :doc:`restart <restart>`,
|
* :doc:`dump movie <dump_image>`
|
||||||
* :doc:`thermo <thermo>`,
|
* :doc:`dump <dump>`
|
||||||
* :doc:`thermo_modify <thermo_modify>`,
|
* :doc:`dump_modify <dump_modify>`
|
||||||
* :doc:`thermo_style <thermo_style>`,
|
* :doc:`restart <restart>`
|
||||||
* :doc:`undump <undump>`,
|
* :doc:`thermo <thermo>`
|
||||||
* :doc:`write_coeff <write_coeff>`,
|
* :doc:`thermo_modify <thermo_modify>`
|
||||||
* :doc:`write_data <write_data>`,
|
* :doc:`thermo_style <thermo_style>`
|
||||||
* :doc:`write_dump <write_dump>`,
|
* :doc:`undump <undump>`
|
||||||
* :doc:`write_restart <write_restart>`
|
* :doc:`write_coeff <write_coeff>`
|
||||||
|
* :doc:`write_data <write_data>`
|
||||||
|
* :doc:`write_dump <write_dump>`
|
||||||
|
* :doc:`write_restart <write_restart>`
|
||||||
|
|
||||||
Actions:
|
Actions:
|
||||||
|
------------------------------
|
||||||
|
|
||||||
* :doc:`minimize <minimize>`,
|
.. table_from_list::
|
||||||
* :doc:`neb <neb>`,
|
:columns: 6
|
||||||
* :doc:`neb_spin <neb_spin>`,
|
|
||||||
* :doc:`prd <prd>`,
|
* :doc:`minimize <minimize>`
|
||||||
* :doc:`rerun <rerun>`,
|
* :doc:`neb <neb>`
|
||||||
* :doc:`run <run>`,
|
* :doc:`neb_spin <neb_spin>`
|
||||||
* :doc:`tad <tad>`,
|
* :doc:`prd <prd>`
|
||||||
* :doc:`temper <temper>`
|
* :doc:`rerun <rerun>`
|
||||||
|
* :doc:`run <run>`
|
||||||
|
* :doc:`tad <tad>`
|
||||||
|
* :doc:`temper <temper>`
|
||||||
|
|
||||||
Input script control:
|
Input script control:
|
||||||
|
------------------------------
|
||||||
|
|
||||||
* :doc:`clear <clear>`,
|
.. table_from_list::
|
||||||
* :doc:`echo <echo>`,
|
:columns: 7
|
||||||
* :doc:`if <if>`,
|
|
||||||
* :doc:`include <include>`,
|
* :doc:`clear <clear>`
|
||||||
* :doc:`jump <jump>`,
|
* :doc:`echo <echo>`
|
||||||
* :doc:`label <label>`,
|
* :doc:`if <if>`
|
||||||
* :doc:`log <log>`,
|
* :doc:`include <include>`
|
||||||
* :doc:`next <next>`,
|
* :doc:`info <info>`
|
||||||
* :doc:`print <print>`,
|
* :doc:`jump <jump>`
|
||||||
* :doc:`python <python>`,
|
* :doc:`label <label>`
|
||||||
* :doc:`quit <quit>`,
|
* :doc:`log <log>`
|
||||||
* :doc:`shell <shell>`,
|
* :doc:`next <next>`
|
||||||
* :doc:`variable <variable>`
|
* :doc:`print <print>`
|
||||||
|
* :doc:`python <python>`
|
||||||
|
* :doc:`quit <quit>`
|
||||||
|
* :doc:`shell <shell>`
|
||||||
|
* :doc:`variable <variable>`
|
||||||
|
|||||||
@ -20,7 +20,7 @@ additional letters in parenthesis: g = GPU, i = USER-INTEL, k =
|
|||||||
KOKKOS, o = USER-OMP, t = OPT.
|
KOKKOS, o = USER-OMP, t = OPT.
|
||||||
|
|
||||||
.. table_from_list::
|
.. table_from_list::
|
||||||
:columns: 6
|
:columns: 5
|
||||||
|
|
||||||
* :doc:`ackland/atom <compute_ackland_atom>`
|
* :doc:`ackland/atom <compute_ackland_atom>`
|
||||||
* :doc:`adf <compute_adf>`
|
* :doc:`adf <compute_adf>`
|
||||||
|
|||||||
@ -20,7 +20,7 @@ parenthesis: g = GPU, i = USER-INTEL, k = KOKKOS, o = USER-OMP, t =
|
|||||||
OPT.
|
OPT.
|
||||||
|
|
||||||
.. table_from_list::
|
.. table_from_list::
|
||||||
:columns: 6
|
:columns: 5
|
||||||
|
|
||||||
* :doc:`adapt <fix_adapt>`
|
* :doc:`adapt <fix_adapt>`
|
||||||
* :doc:`adapt/fep <fix_adapt_fep>`
|
* :doc:`adapt/fep <fix_adapt_fep>`
|
||||||
|
|||||||
@ -26,6 +26,10 @@ OPT.
|
|||||||
* :doc:`zero <pair_zero>`
|
* :doc:`zero <pair_zero>`
|
||||||
* :doc:`hybrid (k) <pair_hybrid>`
|
* :doc:`hybrid (k) <pair_hybrid>`
|
||||||
* :doc:`hybrid/overlay (k) <pair_hybrid>`
|
* :doc:`hybrid/overlay (k) <pair_hybrid>`
|
||||||
|
* :doc:`kim <pair_kim>`
|
||||||
|
* :doc:`list <pair_list>`
|
||||||
|
*
|
||||||
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
@ -108,14 +112,12 @@ OPT.
|
|||||||
* :doc:`hbond/dreiding/lj (o) <pair_hbond_dreiding>`
|
* :doc:`hbond/dreiding/lj (o) <pair_hbond_dreiding>`
|
||||||
* :doc:`hbond/dreiding/morse (o) <pair_hbond_dreiding>`
|
* :doc:`hbond/dreiding/morse (o) <pair_hbond_dreiding>`
|
||||||
* :doc:`ilp/graphene/hbn <pair_ilp_graphene_hbn>`
|
* :doc:`ilp/graphene/hbn <pair_ilp_graphene_hbn>`
|
||||||
* :doc:`kim <pair_kim>`
|
|
||||||
* :doc:`kolmogorov/crespi/full <pair_kolmogorov_crespi_full>`
|
* :doc:`kolmogorov/crespi/full <pair_kolmogorov_crespi_full>`
|
||||||
* :doc:`kolmogorov/crespi/z <pair_kolmogorov_crespi_z>`
|
* :doc:`kolmogorov/crespi/z <pair_kolmogorov_crespi_z>`
|
||||||
* :doc:`lcbop <pair_lcbop>`
|
* :doc:`lcbop <pair_lcbop>`
|
||||||
* :doc:`lebedeva/z <pair_lebedeva_z>`
|
* :doc:`lebedeva/z <pair_lebedeva_z>`
|
||||||
* :doc:`lennard/mdf <pair_mdf>`
|
* :doc:`lennard/mdf <pair_mdf>`
|
||||||
* :doc:`line/lj <pair_line_lj>`
|
* :doc:`line/lj <pair_line_lj>`
|
||||||
* :doc:`list <pair_list>`
|
|
||||||
* :doc:`lj/charmm/coul/charmm (iko) <pair_charmm>`
|
* :doc:`lj/charmm/coul/charmm (iko) <pair_charmm>`
|
||||||
* :doc:`lj/charmm/coul/charmm/implicit (ko) <pair_charmm>`
|
* :doc:`lj/charmm/coul/charmm/implicit (ko) <pair_charmm>`
|
||||||
* :doc:`lj/charmm/coul/long (gikot) <pair_charmm>`
|
* :doc:`lj/charmm/coul/long (gikot) <pair_charmm>`
|
||||||
|
|||||||
@ -9,115 +9,130 @@ file names or user-chosen ID strings.
|
|||||||
Here are 6 rules for how each line in the input script is parsed by
|
Here are 6 rules for how each line in the input script is parsed by
|
||||||
LAMMPS:
|
LAMMPS:
|
||||||
|
|
||||||
(1) If the last printable character on the line is a "&" character,
|
.. _one:
|
||||||
the command is assumed to continue on the next line. The next line is
|
|
||||||
concatenated to the previous line by removing the "&" character and
|
|
||||||
line break. This allows long commands to be continued across two or
|
|
||||||
more lines. See the discussion of triple quotes in (6) for how to
|
|
||||||
continue a command across multiple line without using "&" characters.
|
|
||||||
|
|
||||||
(2) All characters from the first "#" character onward are treated as
|
1. If the last printable character on the line is a "&" character, the
|
||||||
comment and discarded. See an exception in (6). Note that a
|
command is assumed to continue on the next line. The next line is
|
||||||
comment after a trailing "&" character will prevent the command from
|
concatenated to the previous line by removing the "&" character and
|
||||||
continuing on the next line. Also note that for multi-line commands a
|
line break. This allows long commands to be continued across two or
|
||||||
single leading "#" will comment out the entire command.
|
more lines. See the discussion of triple quotes in :ref:`6 <six>`
|
||||||
|
for how to continue a command across multiple line without using "&"
|
||||||
|
characters.
|
||||||
|
|
||||||
.. code-block:: LAMMPS
|
.. _two:
|
||||||
|
|
||||||
|
2. All characters from the first "#" character onward are treated as
|
||||||
|
comment and discarded. The exception to this rule is described in
|
||||||
|
:ref:`6 <six>`. Note that a comment after a trailing "&" character
|
||||||
|
will prevent the command from continuing on the next line. Also note
|
||||||
|
that for multi-line commands a single leading "#" will comment out
|
||||||
|
the entire command.
|
||||||
|
|
||||||
|
.. code-block:: LAMMPS
|
||||||
|
|
||||||
# this is a comment
|
# this is a comment
|
||||||
|
timestep 1.0 # this is also a comment
|
||||||
|
|
||||||
(3) The line is searched repeatedly for $ characters, which indicate
|
.. _three:
|
||||||
variables that are replaced with a text string. See an exception in
|
|
||||||
(6).
|
|
||||||
|
|
||||||
If the $ is followed by curly brackets, then the variable name is the
|
3. The line is searched repeatedly for $ characters, which indicate
|
||||||
text inside the curly brackets. If no curly brackets follow the $,
|
variables that are replaced with a text string. The exception to
|
||||||
then the variable name is the single character immediately following
|
this rule is described in :ref:`6 <six>`.
|
||||||
the $. Thus ${myTemp} and $x refer to variable names "myTemp" and
|
|
||||||
"x".
|
|
||||||
|
|
||||||
How the variable is converted to a text string depends on what style
|
If the $ is followed by text in curly brackets '{}', then the
|
||||||
of variable it is; see the :doc:`variable <variable>` doc page for details.
|
variable name is the text inside the curly brackets. If no curly
|
||||||
It can be a variable that stores multiple text strings, and return one
|
brackets follow the $, then the variable name is the single character
|
||||||
of them. The returned text string can be multiple "words" (space
|
immediately following the $. Thus ${myTemp} and $x refer to variables
|
||||||
separated) which will then be interpreted as multiple arguments in the
|
named "myTemp" and "x", while "$xx" will be interpreted as a variable
|
||||||
input command. The variable can also store a numeric formula which
|
named "x" followed by an "x" character.
|
||||||
will be evaluated and its numeric result returned as a string.
|
|
||||||
|
|
||||||
As a special case, if the $ is followed by parenthesis, then the text
|
How the variable is converted to a text string depends on what style
|
||||||
inside the parenthesis is treated as an "immediate" variable and
|
of variable it is; see the :doc:`variable <variable>` doc page for
|
||||||
evaluated as an :doc:`equal-style variable <variable>`. This is a way
|
details. It can be a variable that stores multiple text strings, and
|
||||||
to use numeric formulas in an input script without having to assign
|
return one of them. The returned text string can be multiple "words"
|
||||||
them to variable names. For example, these 3 input script lines:
|
(space separated) which will then be interpreted as multiple
|
||||||
|
arguments in the input command. The variable can also store a
|
||||||
|
numeric formula which will be evaluated and its numeric result
|
||||||
|
returned as a string.
|
||||||
|
|
||||||
|
As a special case, if the $ is followed by parenthesis "()", then the
|
||||||
|
text inside the parenthesis is treated as an "immediate" variable and
|
||||||
|
evaluated as an :doc:`equal-style variable <variable>`. This is a
|
||||||
|
way to use numeric formulas in an input script without having to
|
||||||
|
assign them to variable names. For example, these 3 input script
|
||||||
|
lines:
|
||||||
|
|
||||||
.. code-block:: LAMMPS
|
.. code-block:: LAMMPS
|
||||||
|
|
||||||
variable X equal (xlo+xhi)/2+sqrt(v_area)
|
variable X equal (xlo+xhi)/2+sqrt(v_area)
|
||||||
region 1 block $X 2 INF INF EDGE EDGE
|
region 1 block $X 2 INF INF EDGE EDGE
|
||||||
variable X delete
|
variable X delete
|
||||||
|
|
||||||
can be replaced by
|
can be replaced by:
|
||||||
|
|
||||||
|
.. code-block:: LAMMPS
|
||||||
.. code-block:: LAMMPS
|
|
||||||
|
|
||||||
region 1 block $((xlo+xhi)/2+sqrt(v_area)) 2 INF INF EDGE EDGE
|
region 1 block $((xlo+xhi)/2+sqrt(v_area)) 2 INF INF EDGE EDGE
|
||||||
|
|
||||||
so that you do not have to define (or discard) a temporary variable X.
|
so that you do not have to define (or discard) a temporary variable,
|
||||||
|
"X" in this case.
|
||||||
|
|
||||||
Additionally, the "immediate" variable expression may be followed by a
|
Additionally, the "immediate" variable expression may be followed by
|
||||||
colon, followed by a C-style format string, e.g. ":%f" or ":%.10g".
|
a colon, followed by a C-style format string, e.g. ":%f" or ":%.10g".
|
||||||
The format string must be appropriate for a double-precision
|
The format string must be appropriate for a double-precision
|
||||||
floating-point value. The format string is used to output the result
|
floating-point value. The format string is used to output the result
|
||||||
of the variable expression evaluation. If a format string is not
|
of the variable expression evaluation. If a format string is not
|
||||||
specified a high-precision "%.20g" is used as the default.
|
specified a high-precision "%.20g" is used as the default.
|
||||||
|
|
||||||
This can be useful for formatting print output to a desired precision:
|
This can be useful for formatting print output to a desired precision:
|
||||||
|
|
||||||
|
|
||||||
.. code-block:: LAMMPS
|
.. code-block:: LAMMPS
|
||||||
|
|
||||||
print "Final energy per atom: $(pe/atoms:%10.3f) eV/atom"
|
print "Final energy per atom: $(pe/atoms:%10.3f) eV/atom"
|
||||||
|
|
||||||
Note that neither the curly-bracket or immediate form of variables can
|
Note that neither the curly-bracket or immediate form of variables
|
||||||
contain nested $ characters for other variables to substitute for.
|
can contain nested $ characters for other variables to substitute
|
||||||
Thus you cannot do this:
|
for. Thus you may **NOT** do this:
|
||||||
|
|
||||||
|
.. code-block:: LAMMPS
|
||||||
.. code-block:: LAMMPS
|
|
||||||
|
|
||||||
variable a equal 2
|
variable a equal 2
|
||||||
variable b2 equal 4
|
variable b2 equal 4
|
||||||
print "B2 = ${b$a}"
|
print "B2 = ${b$a}"
|
||||||
|
|
||||||
Nor can you specify this $($x-1.0) for an immediate variable, but
|
Nor can you specify an expression like "$($x-1.0)" for an immediate
|
||||||
you could use $(v\_x-1.0), since the latter is valid syntax for an
|
variable, but you could use $(v\_x-1.0), since the latter is valid
|
||||||
:doc:`equal-style variable <variable>`.
|
syntax for an :doc:`equal-style variable <variable>`.
|
||||||
|
|
||||||
See the :doc:`variable <variable>` command for more details of how
|
See the :doc:`variable <variable>` command for more details of how
|
||||||
strings are assigned to variables and evaluated, and how they can be
|
strings are assigned to variables and evaluated, and how they can
|
||||||
used in input script commands.
|
be used in input script commands.
|
||||||
|
|
||||||
(4) The line is broken into "words" separated by white-space (tabs,
|
.. _four:
|
||||||
spaces). Note that words can thus contain letters, digits,
|
|
||||||
underscores, or punctuation characters.
|
|
||||||
|
|
||||||
(5) The first word is the command name. All successive words in the
|
4. The line is broken into "words" separated by white-space (tabs,
|
||||||
line are arguments.
|
spaces). Note that words can thus contain letters, digits,
|
||||||
|
underscores, or punctuation characters.
|
||||||
|
|
||||||
(6) If you want text with spaces to be treated as a single argument,
|
.. _five:
|
||||||
it can be enclosed in either single or double or triple quotes. A
|
|
||||||
long single argument enclosed in single or double quotes can span
|
|
||||||
multiple lines if the "&" character is used, as described above. When
|
|
||||||
the lines are concatenated together (and the "&" characters and line
|
|
||||||
breaks removed), the text will become a single line. If you want
|
|
||||||
multiple lines of an argument to retain their line breaks, the text
|
|
||||||
can be enclosed in triple quotes, in which case "&" characters are not
|
|
||||||
needed. For example:
|
|
||||||
|
|
||||||
|
5. The first word is the command name. All successive words in the line
|
||||||
|
are arguments.
|
||||||
|
|
||||||
.. code-block:: LAMMPS
|
.. _six:
|
||||||
|
|
||||||
|
6. If you want text with spaces to be treated as a single argument, it
|
||||||
|
can be enclosed in either single or double or triple quotes. A long
|
||||||
|
single argument enclosed in single or double quotes can span multiple
|
||||||
|
lines if the "&" character is used, as described above. When the
|
||||||
|
lines are concatenated together (and the "&" characters and line
|
||||||
|
breaks removed), the text will become a single line. If you want
|
||||||
|
multiple lines of an argument to retain their line breaks, the text
|
||||||
|
can be enclosed in triple quotes, in which case "&" characters are
|
||||||
|
not needed. For example:
|
||||||
|
|
||||||
|
.. code-block:: LAMMPS
|
||||||
|
|
||||||
print "Volume = $v"
|
print "Volume = $v"
|
||||||
print 'Volume = $v'
|
print 'Volume = $v'
|
||||||
@ -129,14 +144,16 @@ needed. For example:
|
|||||||
System temperature = $t
|
System temperature = $t
|
||||||
"""
|
"""
|
||||||
|
|
||||||
In each case, the single, double, or triple quotes are removed when
|
In each case, the single, double, or triple quotes are removed when
|
||||||
the single argument they enclose is stored internally.
|
the single argument they enclose is stored internally.
|
||||||
|
|
||||||
See the :doc:`dump modify format <dump_modify>`, :doc:`print <print>`,
|
See the :doc:`dump modify format <dump_modify>`, :doc:`print
|
||||||
:doc:`if <if>`, and :doc:`python <python>` commands for examples.
|
<print>`, :doc:`if <if>`, and :doc:`python <python>` commands for
|
||||||
|
examples.
|
||||||
|
|
||||||
A "#" or "$" character that is between quotes will not be treated as a
|
A "#" or "$" character that is between quotes will not be treated as
|
||||||
comment indicator in (2) or substituted for as a variable in (3).
|
a comment indicator in :ref:`2 <two>` or substituted for as a
|
||||||
|
variable in :ref:`3 <three>`.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
|
|||||||
@ -8,17 +8,20 @@ page.
|
|||||||
|
|
||||||
A LAMMPS input script typically has 4 parts:
|
A LAMMPS input script typically has 4 parts:
|
||||||
|
|
||||||
1. Initialization
|
1. :ref:`Initialization <init>`
|
||||||
2. Atom definition
|
2. :ref:`System definition <system>`
|
||||||
3. Settings
|
3. :ref:`Simulation settings <settings>`
|
||||||
4. Run a simulation
|
4. :ref:`Run a simulation <run>`
|
||||||
|
|
||||||
The last 2 parts can be repeated as many times as desired. I.e. run a
|
The last 2 parts can be repeated as many times as desired. I.e. run a
|
||||||
simulation, change some settings, run some more, etc. Each of the 4
|
simulation, change some settings, run some more, etc. Each of the 4
|
||||||
parts is now described in more detail. Remember that almost all
|
parts is now described in more detail. Remember that almost all
|
||||||
commands need only be used if a non-default value is desired.
|
commands need only be used if a non-default value is desired.
|
||||||
|
|
||||||
(1) Initialization
|
.. _init:
|
||||||
|
|
||||||
|
Initialization
|
||||||
|
------------------------------
|
||||||
|
|
||||||
Set parameters that need to be defined before atoms are created or
|
Set parameters that need to be defined before atoms are created or
|
||||||
read-in from a file.
|
read-in from a file.
|
||||||
@ -34,23 +37,33 @@ commands tell LAMMPS what kinds of force fields are being used:
|
|||||||
:doc:`angle_style <angle_style>`, :doc:`dihedral_style <dihedral_style>`,
|
:doc:`angle_style <angle_style>`, :doc:`dihedral_style <dihedral_style>`,
|
||||||
:doc:`improper_style <improper_style>`.
|
:doc:`improper_style <improper_style>`.
|
||||||
|
|
||||||
(2) Atom definition
|
.. _system:
|
||||||
|
|
||||||
There are 3 ways to define atoms in LAMMPS. Read them in from a data
|
System definition
|
||||||
or restart file via the :doc:`read_data <read_data>` or
|
------------------------------
|
||||||
:doc:`read_restart <read_restart>` commands. These files can contain
|
|
||||||
molecular topology information. Or create atoms on a lattice (with no
|
|
||||||
molecular topology), using these commands: :doc:`lattice <lattice>`,
|
|
||||||
:doc:`region <region>`, :doc:`create_box <create_box>`,
|
|
||||||
:doc:`create_atoms <create_atoms>`. The entire set of atoms can be
|
|
||||||
duplicated to make a larger simulation using the
|
|
||||||
:doc:`replicate <replicate>` command.
|
|
||||||
|
|
||||||
(3) Settings
|
There are 3 ways to define the simulation cell and reserve space for
|
||||||
|
force field info and fill it with atoms in LAMMPS. Read them in from
|
||||||
|
(1) a data file or (2) a restart file via the :doc:`read_data
|
||||||
|
<read_data>` or :doc:`read_restart <read_restart>` commands,
|
||||||
|
respectively. These files can also contain molecular topology
|
||||||
|
information. Or (3) create a simulation cell and fill it with atoms on
|
||||||
|
a lattice (with no molecular topology), using these commands:
|
||||||
|
:doc:`lattice <lattice>`, :doc:`region <region>`, :doc:`create_box
|
||||||
|
<create_box>`, :doc:`create_atoms <create_atoms>` or
|
||||||
|
:doc:`read_dump <read_dump>`.
|
||||||
|
|
||||||
|
The entire set of atoms can be duplicated to make a larger simulation
|
||||||
|
using the :doc:`replicate <replicate>` command.
|
||||||
|
|
||||||
|
.. _settings:
|
||||||
|
|
||||||
|
Simulation settings
|
||||||
|
------------------------------
|
||||||
|
|
||||||
Once atoms and molecular topology are defined, a variety of settings
|
Once atoms and molecular topology are defined, a variety of settings
|
||||||
can be specified: force field coefficients, simulation parameters,
|
can be specified: force field coefficients, simulation parameters,
|
||||||
output options, etc.
|
output options, and more.
|
||||||
|
|
||||||
Force field coefficients are set by these commands (they can also be
|
Force field coefficients are set by these commands (they can also be
|
||||||
set in the read-in files): :doc:`pair_coeff <pair_coeff>`,
|
set in the read-in files): :doc:`pair_coeff <pair_coeff>`,
|
||||||
@ -77,7 +90,10 @@ commands.
|
|||||||
Output options are set by the :doc:`thermo <thermo>`, :doc:`dump <dump>`,
|
Output options are set by the :doc:`thermo <thermo>`, :doc:`dump <dump>`,
|
||||||
and :doc:`restart <restart>` commands.
|
and :doc:`restart <restart>` commands.
|
||||||
|
|
||||||
(4) Run a simulation
|
.. _run:
|
||||||
|
|
||||||
|
Run a simulation
|
||||||
|
------------------------------
|
||||||
|
|
||||||
A molecular dynamics simulation is run using the :doc:`run <run>`
|
A molecular dynamics simulation is run using the :doc:`run <run>`
|
||||||
command. Energy minimization (molecular statics) is performed using
|
command. Energy minimization (molecular statics) is performed using
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 28 KiB |
@ -1,15 +0,0 @@
|
|||||||
\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}
|
|
||||||
|
Before Width: | Height: | Size: 5.0 KiB |
@ -1,9 +0,0 @@
|
|||||||
\documentstyle[12pt]{article}
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
|
|
||||||
$$
|
|
||||||
E_{Pauli(ECP_s)}=p_1\exp\left(-\frac{p_2r^2}{p_3+s^2} \right)
|
|
||||||
$$
|
|
||||||
|
|
||||||
\end{document}
|
|
||||||
|
Before Width: | Height: | Size: 9.5 KiB |
@ -1,8 +0,0 @@
|
|||||||
\documentstyle[12pt]{article}
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
|
|
||||||
$$
|
|
||||||
E_{Pauli(ECP_p)}=p_1\left( \frac{2}{p_2/s+s/p_2} \right)\left( r-p_3s\right)^2\exp \left[ -\frac{p_4\left( r-p_3s \right)^2}{p_5+s^2} \right]
|
|
||||||
$$
|
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 3.3 KiB |
@ -1,9 +0,0 @@
|
|||||||
\documentclass[12pt]{article}
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
|
|
||||||
$$
|
|
||||||
E_{KE} = \frac{\hbar^2 }{{m_{e} }}\sum\limits_i {\frac{3}{{2s_i^2 }}}
|
|
||||||
$$
|
|
||||||
|
|
||||||
\end{document}
|
|
||||||
|
Before Width: | Height: | Size: 4.1 KiB |
@ -1,9 +0,0 @@
|
|||||||
\documentclass[12pt]{article}
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
|
|
||||||
$$
|
|
||||||
E_{NN} = \frac{1}{{4\pi \varepsilon _0 }}\sum\limits_{i < j} {\frac{{Z_i Z_j }}{{R_{ij} }}}
|
|
||||||
$$
|
|
||||||
|
|
||||||
\end{document}
|
|
||||||
|
Before Width: | Height: | Size: 6.3 KiB |
@ -1,9 +0,0 @@
|
|||||||
\documentclass[12pt]{article}
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
|
|
||||||
$$
|
|
||||||
E_{Ne} = - \frac{1}{{4\pi \varepsilon _0 }}\sum\limits_{i,j} {\frac{{Z_i }}{{R_{ij} }}Erf\left( {\frac{{\sqrt 2 R_{ij} }}{{s_j }}} \right)}
|
|
||||||
$$
|
|
||||||
|
|
||||||
\end{document}
|
|
||||||
|
Before Width: | Height: | Size: 5.5 KiB |
@ -1,9 +0,0 @@
|
|||||||
\documentclass[12pt]{article}
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
|
|
||||||
$$
|
|
||||||
E_{Pauli} = \sum\limits_{\sigma _i = \sigma _j } {E\left( { \uparrow \uparrow } \right)_{ij}} + \sum\limits_{\sigma _i \ne \sigma _j } {E\left( { \uparrow \downarrow } \right)_{ij}}
|
|
||||||
$$
|
|
||||||
|
|
||||||
\end{document}
|
|
||||||
|
Before Width: | Height: | Size: 6.7 KiB |
@ -1,9 +0,0 @@
|
|||||||
\documentclass[12pt]{article}
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
|
|
||||||
$$
|
|
||||||
E_{ee} = \frac{1}{{4\pi \varepsilon _0 }}\sum\limits_{i < j} {\frac{1}{{r_{ij} }}Erf\left( {\frac{{\sqrt 2 r_{ij} }}{{\sqrt {s_i^2 + s_j^2 } }}} \right)}
|
|
||||||
$$
|
|
||||||
|
|
||||||
\end{document}
|
|
||||||
|
Before Width: | Height: | Size: 9.3 KiB |
@ -1,9 +0,0 @@
|
|||||||
\documentclass[12pt]{article}
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
|
|
||||||
$$
|
|
||||||
U\left(R,r,s\right) = E_{NN} \left( R \right) + E_{Ne} \left( {R,r,s} \right) + E_{ee} \left( {r,s} \right) + E_{KE} \left( {r,s} \right) + E_{PR} \left( { \uparrow \downarrow ,S} \right)
|
|
||||||
$$
|
|
||||||
|
|
||||||
\end{document}
|
|
||||||
|
Before Width: | Height: | Size: 8.9 KiB |
@ -1,14 +0,0 @@
|
|||||||
\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} = \frac{1}{\left(1+\lambda^2 \right)} \left( \left(
|
|
||||||
\vec{\omega}_{i} +\vec{\eta} \right) \times \vec{s}_{i} + \lambda\, \vec{s}_{i}
|
|
||||||
\times\left( \vec{\omega}_{i} \times\vec{s}_{i} \right) \right), \nonumber
|
|
||||||
\end{equation}
|
|
||||||
\end{varwidth}
|
|
||||||
\end{document}
|
|
||||||
|
Before Width: | Height: | Size: 2.6 KiB |
@ -1,11 +0,0 @@
|
|||||||
\documentclass[12pt]{article}
|
|
||||||
|
|
||||||
\usepackage{amsmath}
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
|
|
||||||
$$
|
|
||||||
F = \left( 1-\lambda \right) F_{\text{solid}} + \lambda F_{\text{harm}}
|
|
||||||
$$
|
|
||||||
|
|
||||||
\end{document}
|
|
||||||
|
Before Width: | Height: | Size: 1.1 KiB |
@ -1,9 +0,0 @@
|
|||||||
\documentclass[12pt]{article}
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
|
|
||||||
$$
|
|
||||||
\lambda(\tau) = \tau
|
|
||||||
$$
|
|
||||||
|
|
||||||
\end{document}
|
|
||||||
|
Before Width: | Height: | Size: 5.5 KiB |
@ -1,9 +0,0 @@
|
|||||||
\documentclass[12pt]{article}
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
|
|
||||||
$$
|
|
||||||
\lambda(\tau) = \tau^5 \left( 70 \tau^4 - 315 \tau^3 + 540 \tau^2 - 420 \tau + 126 \right)
|
|
||||||
$$
|
|
||||||
|
|
||||||
\end{document}
|
|
||||||
|
Before Width: | Height: | Size: 3.6 KiB |
@ -1,9 +0,0 @@
|
|||||||
\documentstyle[12pt]{article}
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
|
|
||||||
$$
|
|
||||||
F^{H} = -R_{FU}(U-U^{\infty}) + R_{FE}E^{\infty}
|
|
||||||
$$
|
|
||||||
|
|
||||||
\end{document}
|
|
||||||
|
Before Width: | Height: | Size: 4.1 KiB |
@ -1,9 +0,0 @@
|
|||||||
\documentstyle[12pt]{article}
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
|
|
||||||
$$
|
|
||||||
-R_{FU}(U-U^{\infty}) = -R_{FE}E^{\infty} - F^{rest}
|
|
||||||
$$
|
|
||||||
|
|
||||||
\end{document}
|
|
||||||
|
Before Width: | Height: | Size: 15 KiB |
@ -1,11 +0,0 @@
|
|||||||
\documentclass[12pt]{article}
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
|
|
||||||
\begin{eqnarray*}
|
|
||||||
\mathbf{J} & = & \frac{1}{V} \left[ \sum_i e_i \mathbf{v}_i - \sum_{i} \mathbf{S}_{i} \mathbf{v}_i \right] \\
|
|
||||||
& = & \frac{1}{V} \left[ \sum_i e_i \mathbf{v}_i + \sum_{i<j} \left( \mathbf{f}_{ij} \cdot \mathbf{v}_j \right) \mathbf{x}_{ij} \right] \\
|
|
||||||
& = & \frac{1}{V} \left[ \sum_i e_i \mathbf{v}_i + \frac{1}{2} \sum_{i<j} \left( \mathbf{f}_{ij} \cdot \left(\mathbf{v}_i + \mathbf{v}_j \right) \right) \mathbf{x}_{ij} \right]
|
|
||||||
\end{eqnarray*}
|
|
||||||
|
|
||||||
\end{document}
|
|
||||||
|
Before Width: | Height: | Size: 8.6 KiB |
@ -1,11 +0,0 @@
|
|||||||
\documentclass[12pt]{article}
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
|
|
||||||
$$
|
|
||||||
\kappa = \frac{V}{k_B T^2} \int_0^\infty \langle J_x(0) J_x(t) \rangle \, dt
|
|
||||||
= \frac{V}{3 k_B T^2} \int_0^\infty \langle \mathbf{J}(0) \cdot \mathbf{J}(t) \rangle \, dt
|
|
||||||
$$
|
|
||||||
|
|
||||||
\end{document}
|
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 13 KiB |
@ -1,9 +0,0 @@
|
|||||||
\documentclass[12pt]{article}
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
|
|
||||||
$$
|
|
||||||
E = \frac{1}{2} \sum_{i=1}^{N} \sum_{j=i_1}^{i_N} \phi_{ij} \left( r_{ij} \right) - \sum_{i=1}^{N} \sum_{j=i_1}^{i_N} \beta_{\sigma,ij} \left( r_{ij} \right) \cdot \Theta_{\sigma,ij} - \sum_{i=1}^{N} \sum_{j=i_1}^{i_N} \beta_{\pi,ij} \left( r_{ij} \right) \cdot \Theta_{\pi,ij} + U_{prom}
|
|
||||||
$$
|
|
||||||
|
|
||||||
\end{document}
|
|
||||||
|
Before Width: | Height: | Size: 5.0 KiB |
@ -1,10 +0,0 @@
|
|||||||
\documentstyle[12pt]{article}
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
|
|
||||||
$$
|
|
||||||
E = A \exp \left(\frac{\sigma - r}{\rho} \right) -
|
|
||||||
\frac{C}{r^6} + \frac{D}{r^8} \qquad r < r_c
|
|
||||||
$$
|
|
||||||
|
|
||||||
\end{document}
|
|
||||||
|
Before Width: | Height: | Size: 2.8 KiB |
@ -1,9 +0,0 @@
|
|||||||
\documentclass[12pt]{article}
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
|
|
||||||
$$
|
|
||||||
E = A e^{-r / \rho} - \frac{C}{r^6} \qquad r < r_c
|
|
||||||
$$
|
|
||||||
|
|
||||||
\end{document}
|
|
||||||
|
Before Width: | Height: | Size: 6.9 KiB |
@ -1,10 +0,0 @@
|
|||||||
\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 \\
|
|
||||||
\end{eqnarray*}
|
|
||||||
|
|
||||||
\end{document}
|
|
||||||
|
Before Width: | Height: | Size: 24 KiB |
@ -1,22 +0,0 @@
|
|||||||
\documentclass[12pt]{article}
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
|
|
||||||
\begin{eqnarray*}
|
|
||||||
E & = & LJ(r) \qquad \qquad \qquad r < r_{\rm in} \\
|
|
||||||
& = & S(r) * LJ(r) \qquad \qquad r_{\rm in} < r < r_{\rm out} \\
|
|
||||||
& = & 0 \qquad \qquad \qquad \qquad r > r_{\rm out} \\
|
|
||||||
E & = & C(r) \qquad \qquad \qquad r < r_{\rm in} \\
|
|
||||||
& = & S(r) * C(r) \qquad \qquad r_{\rm in} < r < r_{\rm out} \\
|
|
||||||
& = & 0 \qquad \qquad \qquad \qquad r > r_{\rm out} \\
|
|
||||||
LJ(r) & = & 4 \epsilon \left[ \left(\frac{\sigma}{r}\right)^{12} -
|
|
||||||
\left(\frac{\sigma}{r}\right)^6 \right] \\
|
|
||||||
C(r) & = & \frac{C q_i q_j}{ \epsilon r} \\
|
|
||||||
S(r) & = & \frac{ \left[r_{\rm out}^2 - r^2\right]^2
|
|
||||||
\left[r_{\rm out}^2 + 2r^2 - 3{r_{\rm in}^2}\right]}
|
|
||||||
{ \left[r_{\rm out}^2 - {r_{\rm in}}^2\right]^3 }
|
|
||||||
\end{eqnarray*}
|
|
||||||
|
|
||||||
\end{document}
|
|
||||||
|
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 5.0 KiB |
@ -1,11 +0,0 @@
|
|||||||
\documentstyle[12pt]{article}
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
|
|
||||||
$$
|
|
||||||
E = \epsilon \left[ 2 \left(\frac{\sigma}{r}\right)^9 -
|
|
||||||
3 \left(\frac{\sigma}{r}\right)^6 \right]
|
|
||||||
\qquad r < r_c
|
|
||||||
$$
|
|
||||||
|
|
||||||
\end{document}
|
|
||||||
|
Before Width: | Height: | Size: 12 KiB |
@ -1,16 +0,0 @@
|
|||||||
\documentclass[12pt]{article}
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
|
|
||||||
\begin{eqnarray*}
|
|
||||||
E = & \frac{27}{4} \epsilon \left[ \left(\frac{\sigma}{r}\right)^{9} -
|
|
||||||
\left(\frac{\sigma}{r}\right)^6 \right] &
|
|
||||||
\qquad r < r_c \\
|
|
||||||
E = & \frac{3\sqrt{3}}{2} \epsilon \left[ \left(\frac{\sigma}{r}\right)^{12} -
|
|
||||||
\left(\frac{\sigma}{r}\right)^4 \right] &
|
|
||||||
\qquad r < r_c \\
|
|
||||||
E = & 4 \epsilon \left[ \left(\frac{\sigma}{r}\right)^{12} -
|
|
||||||
\left(\frac{\sigma}{r}\right)^6 \right] &
|
|
||||||
\qquad r < r_c
|
|
||||||
\end{eqnarray*}
|
|
||||||
\end{document}
|
|
||||||
|
Before Width: | Height: | Size: 42 KiB |
@ -1,31 +0,0 @@
|
|||||||
\documentstyle[12pt]{article}
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
|
|
||||||
\begin{eqnarray}
|
|
||||||
U_A &=& - \frac{A_{cc}}{6} \left[
|
|
||||||
\frac{2 a_1 a_2}{r^2-\left(a_1+a_2\right)^2}
|
|
||||||
+ \frac{2 a_1 a_2}{r^2 - \left(a_1 - a_2\right)^2}
|
|
||||||
+ \mathrm{ln}
|
|
||||||
\left(
|
|
||||||
\frac{r^2-\left(a_1+a_2\right)^2}{r^2-\left(a_1-a_2\right)^2}
|
|
||||||
\right)
|
|
||||||
\right] \nonumber \\
|
|
||||||
\nonumber \\
|
|
||||||
U_R &=& \frac{A_{cc}}{37800} \frac{\sigma^6}{r}
|
|
||||||
\left[ \frac{}{} \right. \nonumber \\
|
|
||||||
&&\qquad \frac{r^2-7r\left(a_1+a_2\right)+6\left(a_1^2+7a_1a_2+a_2^2\right)}
|
|
||||||
{\left(r-a_1-a_2\right)^7} \nonumber \\
|
|
||||||
&&\qquad +\frac{r^2+7r\left(a_1+a_2\right)+6\left(a_1^2+7a_1a_2+a_2^2\right)}
|
|
||||||
{\left(r+a_1+a_2\right)^7} \nonumber \\
|
|
||||||
&&\qquad -\frac{r^2+7r\left(a_1-a_2\right)+6\left(a_1^2-7a_1a_2+a_2^2\right)}
|
|
||||||
{\left(r+a_1-a_2\right)^7} \nonumber \\
|
|
||||||
&&\qquad \left. -\frac{r^2-7r\left(a_1-a_2\right)+6\left(a_1^2-7a_1a_2+a_2^2\right)}
|
|
||||||
{\left(r-a_1+a_2\right)^7}
|
|
||||||
\right] \nonumber \\
|
|
||||||
\nonumber \\
|
|
||||||
U &=& U_A + U_R, \qquad r < r_c \nonumber
|
|
||||||
\end{eqnarray}
|
|
||||||
|
|
||||||
\end{document}
|
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 11 KiB |
@ -1,12 +0,0 @@
|
|||||||
\documentstyle[12pt]{article}
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
|
|
||||||
\begin{eqnarray}
|
|
||||||
U &=& \frac{2 ~ a^3 ~ \sigma^3 ~ A_{cs}}{9 \left( a^2 - r^2 \right)^3}
|
|
||||||
\left[ 1 - \frac{\left(5 ~ a^6+45~a^4~r^2+63~a^2~r^4+15~r^6\right) \sigma^6}
|
|
||||||
{15 \left(a-r\right)^6 \left( a+r \right)^6} \right], ~~ r < r_c \nonumber
|
|
||||||
\end{eqnarray}
|
|
||||||
|
|
||||||
\end{document}
|
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 5.4 KiB |
@ -1,12 +0,0 @@
|
|||||||
\documentstyle[12pt]{article}
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
|
|
||||||
\begin{eqnarray}
|
|
||||||
U &=& \frac{A_{ss}}{36} \left[ \left( \frac{\sigma}{r}
|
|
||||||
\right)^{12} - \left( \frac{ \sigma}{r} \right)^6 \right], ~~
|
|
||||||
r < r_c \nonumber
|
|
||||||
\end{eqnarray}
|
|
||||||
|
|
||||||
\end{document}
|
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 18 KiB |
@ -1,7 +0,0 @@
|
|||||||
\documentclass[12pt]{article}
|
|
||||||
\begin{document} \large
|
|
||||||
\begin{eqnarray*}
|
|
||||||
E_T & = & \sum_i [ E_i^{self} (q_i) + \sum_{j>i} [E_{ij}^{short} (r_{ij}, q_i, q_j) + E_{ij}^{Coul} (r_{ij}, q_i, q_j)] + \\
|
|
||||||
&& E^{polar} (q_i, r_{ij}) + E^{vdW} (r_{ij}) + E^{barr} (q_i) + E^{corr} (r_{ij}, \theta_{jik})] \\
|
|
||||||
\end{eqnarray*}
|
|
||||||
\end{document}
|
|
||||||
|
Before Width: | Height: | Size: 39 KiB |
@ -1,23 +0,0 @@
|
|||||||
\documentclass[10pt]{article}
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
|
|
||||||
\begin{table}[h]
|
|
||||||
\begin{tabular}{|c|c|c|c|c|c|c|c|c|}
|
|
||||||
\hline
|
|
||||||
& $O$ & $Cu$ & $N$ & $C$ & $H$ & $Ti$ & $Zn$ & $Zr$ \\ \hline
|
|
||||||
$O$ & F & F & F & F & F & F & F & F\\ \hline
|
|
||||||
$Cu$ & F & F & P & F & F & P & F & P \\ \hline
|
|
||||||
$N$ & F & P & F & M & F & P & P & P \\ \hline
|
|
||||||
$C$ & F & F & M & F & F & M & M & M \\ \hline
|
|
||||||
$H$ & F & F & F & F & F & M & M & F \\ \hline
|
|
||||||
$Ti$ & F & P & P & M & M & F & P & P \\ \hline
|
|
||||||
$Zn$ & F & F & P & M & M & P & F & P \\ \hline
|
|
||||||
$Zr$ & F & P & P & M & F & P & P & F \\ \hline
|
|
||||||
\multicolumn{9}{l}{F: Fully optimized} \\
|
|
||||||
\multicolumn{9}{l}{M: Only optimized for dimer molecule} \\
|
|
||||||
\multicolumn{9}{l}{P: in Progress but have it from mixing rule} \\
|
|
||||||
\end{tabular}
|
|
||||||
\end{table}
|
|
||||||
|
|
||||||
\end{document}
|
|
||||||
|
Before Width: | Height: | Size: 8.7 KiB |
@ -1,16 +0,0 @@
|
|||||||
\documentclass[12pt]{article}
|
|
||||||
|
|
||||||
\usepackage{amsmath}
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
|
|
||||||
\begin{align*}
|
|
||||||
E =
|
|
||||||
\begin{cases}
|
|
||||||
-\epsilon& \quad r < \sigma \\
|
|
||||||
-\epsilon\cos\left(\frac{\pi\left(r - \sigma\right)}{2\left(r_c - \sigma\right)}\right)&\quad \sigma \leq r < r_c \\
|
|
||||||
0& \quad r \geq r_c
|
|
||||||
\end{cases}
|
|
||||||
\end{align*}
|
|
||||||
|
|
||||||
\end{document}
|
|
||||||
|
Before Width: | Height: | Size: 6.6 KiB |
@ -1,11 +0,0 @@
|
|||||||
\documentstyle[12pt]{article}
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
|
|
||||||
$$
|
|
||||||
E = \epsilon \left[ \left(\frac{\sigma}{r}\right)^{12} -
|
|
||||||
2\left(\frac{\sigma}{r}\right)^6 + 1\right]
|
|
||||||
, \quad r < \sigma
|
|
||||||
$$
|
|
||||||
|
|
||||||
\end{document}
|
|
||||||
|
Before Width: | Height: | Size: 10 KiB |
@ -1,9 +0,0 @@
|
|||||||
\documentclass[12pt]{article}
|
|
||||||
\pagestyle{empty}
|
|
||||||
\begin{document}
|
|
||||||
|
|
||||||
\begin{eqnarray*}
|
|
||||||
E & = & \frac{Cq_iq_j}{\epsilon r} \left( \frac{\epsilon}{\epsilon_D(r)}-1\right) \qquad r < r_c \\
|
|
||||||
\epsilon_D(r) & = & \frac{5.2+\epsilon}{2} + \frac{\epsilon-5.2}{2}\tanh\left(\frac{r-r_{me}}{\sigma_e}\right)
|
|
||||||
\end{eqnarray*}
|
|
||||||
\end{document}
|
|
||||||
|
Before Width: | Height: | Size: 12 KiB |
@ -1,10 +0,0 @@
|
|||||||
\documentclass[12pt]{article}
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
$$
|
|
||||||
E =
|
|
||||||
q_iq_j \left[ \frac{\mbox{erfc} (\alpha r)}{r} - \frac{\mbox{erfc} (\alpha r_c)}{r_c} +
|
|
||||||
\left( \frac{\mbox{erfc} (\alpha r_c)}{r_c^2} + \frac{2\alpha}{\sqrt{\pi}}\frac{\exp (-\alpha^2 r^2_c)}{r_c} \right)(r-r_c) \right] \qquad r < r_c
|
|
||||||
$$
|
|
||||||
|
|
||||||
\end{document}
|
|
||||||
|
Before Width: | Height: | Size: 7.1 KiB |
@ -1,15 +0,0 @@
|
|||||||
\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:
|
|
||||||
|
Before Width: | Height: | Size: 186 KiB |
@ -1,33 +0,0 @@
|
|||||||
\documentclass[aps,pr,onecolumn,superscriptaddress,noshowpacs,a4paper,15pt]{revtex4}
|
|
||||||
\pdfoutput=1
|
|
||||||
\bibliographystyle{apsrev4}
|
|
||||||
\usepackage{color}
|
|
||||||
\usepackage{dcolumn} %Align table columns on decimal point
|
|
||||||
\usepackage{amssymb}
|
|
||||||
\usepackage{amsmath}
|
|
||||||
\usepackage{amsthm}
|
|
||||||
\usepackage{graphicx}
|
|
||||||
\usepackage[pdftex]{hyperref}
|
|
||||||
\hypersetup{colorlinks=true,citecolor=blue,linkcolor=red,urlcolor=blue}
|
|
||||||
\usepackage[all]{hypcap}
|
|
||||||
\newcommand{\red}{\color{red}}
|
|
||||||
\newcommand{\blue}{\color{blue}}
|
|
||||||
\definecolor{green}{rgb}{0,0.5,0}
|
|
||||||
\newcommand{\green}{\color{green}}
|
|
||||||
\newcommand{\white}{\color{white}}
|
|
||||||
%\newcommand{\cite}[1]{\hspace{-1 ex} % \nocite{#1}\citenum{#1}}
|
|
||||||
\thickmuskip=0.5\thickmuskip %shorter spaces in math
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
\begingroup
|
|
||||||
\Large
|
|
||||||
\begin{eqnarray*}
|
|
||||||
E & = & \frac{1}{2} \sum_i \sum_{j \neq i} V_{ij} \\[15pt]
|
|
||||||
V_{ij} & = & {\rm Tap}(r_{ij})\frac{\kappa q_i q_j}{\sqrt[3]{r_{ij}^3+(1/\lambda_{ij})^3}}\\[15pt]
|
|
||||||
{\rm Tap}(r_{ij}) & = & 20\left ( \frac{r_{ij}}{R_{cut}} \right )^7 -
|
|
||||||
70\left ( \frac{r_{ij}}{R_{cut}} \right )^6 +
|
|
||||||
84\left ( \frac{r_{ij}}{R_{cut}} \right )^5 -
|
|
||||||
35\left ( \frac{r_{ij}}{R_{cut}} \right )^4 + 1
|
|
||||||
\end{eqnarray*}
|
|
||||||
\endgroup
|
|
||||||
\end{document}
|
|
||||||
|
Before Width: | Height: | Size: 8.6 KiB |
@ -1,11 +0,0 @@
|
|||||||
\documentclass[12pt]{article}
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
$$
|
|
||||||
E_i = \frac{1}{2} \sum_{j \neq i}
|
|
||||||
\frac{q_i q_j {\rm erfc}(\alpha r_{ij})}{r_{ij}} +
|
|
||||||
\frac{1}{2} \sum_{j \neq i}
|
|
||||||
\frac{q_i q_j {\rm erf}(\alpha r_{ij})}{r_{ij}} \qquad r < r_c
|
|
||||||
$$
|
|
||||||
|
|
||||||
\end{document}
|
|
||||||
|
Before Width: | Height: | Size: 4.5 KiB |
@ -1,9 +0,0 @@
|
|||||||
\documentclass[12pt]{article}
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
\thispagestyle{empty}
|
|
||||||
\begin{eqnarray*}
|
|
||||||
E &=& \frac{q_i q_j \mathrm{erf}\left( r/\sqrt{\gamma_1^2+\gamma_2^2} \right) }{\epsilon r_{ij}}
|
|
||||||
\end{eqnarray*}
|
|
||||||
|
|
||||||
\end{document}
|
|
||||||