Merge branch 'master' into gpu_hip
|
@ -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-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.
|
||||
* 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
|
||||
* 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.
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ vgcore.*
|
|||
.vagrant
|
||||
\#*#
|
||||
.#*
|
||||
.vscode
|
||||
|
||||
.DS_Store
|
||||
.DS_Store?
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
diff --git a/lib/kokkos/containers/src/Kokkos_ScatterView.hpp b/lib/kokkos/containers/src/Kokkos_ScatterView.hpp
|
||||
index a8c05e3..1d83aed 100644
|
||||
--- a/lib/kokkos/containers/src/Kokkos_ScatterView.hpp
|
||||
+++ b/lib/kokkos/containers/src/Kokkos_ScatterView.hpp
|
||||
@@ -681,7 +681,7 @@ class ScatterView<DataType
|
||||
,contribution>
|
||||
{
|
||||
public:
|
||||
- typedef Kokkos::View<DataType, Layout, ExecSpace> original_view_type;
|
||||
+ typedef Kokkos::View<DataType, Layout, Kokkos::Device<ExecSpace, Kokkos::Cuda::memory_space> > original_view_type;
|
||||
typedef typename original_view_type::value_type original_value_type;
|
||||
typedef typename original_view_type::reference_type original_reference_type;
|
||||
friend class ScatterAccess<DataType, Op, ExecSpace, Layout, ScatterNonDuplicated, contribution, ScatterNonAtomic>;
|
|
@ -2,7 +2,7 @@
|
|||
# CMake build system
|
||||
# This file is part of LAMMPS
|
||||
# Created by Christoph Junghans and Richard Berger
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
|
||||
project(lammps CXX)
|
||||
set(SOVERSION 0)
|
||||
|
@ -36,7 +36,6 @@ get_lammps_version(${LAMMPS_SOURCE_DIR}/version.h LAMMPS_VERSION)
|
|||
include(PreventInSourceBuilds)
|
||||
|
||||
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)
|
||||
endif(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS)
|
||||
string(TOUPPER "${CMAKE_BUILD_TYPE}" BTYPE)
|
||||
|
@ -52,39 +51,35 @@ check_for_autogen_files(${LAMMPS_SOURCE_DIR})
|
|||
include(CheckCCompilerFlag)
|
||||
include(CheckIncludeFileCXX)
|
||||
|
||||
# set required compiler flags and compiler/CPU arch specific optimizations
|
||||
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")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.3 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.4)
|
||||
set(CMAKE_TUNE_DEFAULT "-xCOMMON-AVX512")
|
||||
else()
|
||||
set(CMAKE_TUNE_DEFAULT "-xHost")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(DISABLE_CXX11_REQUIREMENT "Disable check that requires C++11 for compiling LAMMPS" OFF)
|
||||
if(DISABLE_CXX11_REQUIREMENT)
|
||||
add_definitions(-DLAMMPS_CXX98)
|
||||
# else()
|
||||
# set(CMAKE_CXX_STANDARD 11)
|
||||
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
||||
set(CMAKE_TUNE_DEFAULT "-ffast-math -march=native")
|
||||
endif()
|
||||
|
||||
# GNU compiler features
|
||||
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
|
||||
set(CMAKE_TUNE_DEFAULT "-ffast-math -march=native")
|
||||
endif()
|
||||
|
||||
# we require C++11
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# GNU compiler specific features for testing
|
||||
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
||||
option(ENABLE_COVERAGE "Enable code coverage" OFF)
|
||||
option(ENABLE_COVERAGE "Enable collecting code coverage data" OFF)
|
||||
mark_as_advanced(ENABLE_COVERAGE)
|
||||
if(ENABLE_COVERAGE)
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
|
||||
endif()
|
||||
option(ENABLE_SANITIZE_ADDRESS "Enable address sanitizer" OFF)
|
||||
mark_as_advanced(ENABLE_SANITIZE_ADDRESS)
|
||||
if(ENABLE_SANITIZE_ADDRESS)
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
|
||||
endif()
|
||||
option(ENABLE_SANITIZE_UNDEFINED "Enable undefined behavior sanitizer" OFF)
|
||||
mark_as_advanced(ENABLE_SANITIZE_UNDEFINED)
|
||||
if(ENABLE_SANITIZE_UNDEFINED)
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined")
|
||||
endif()
|
||||
option(ENABLE_SANITIZE_THREAD "Enable thread sanitizer" OFF)
|
||||
mark_as_advanced(ENABLE_SANITIZE_THREAD)
|
||||
if(ENABLE_SANITIZE_THREAD)
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
########################################################################
|
||||
|
@ -129,12 +124,12 @@ set(LAMMPS_API_DEFINES)
|
|||
set(DEFAULT_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE
|
||||
GRANULAR KSPACE LATTE MANYBODY MC MESSAGE MISC MOLECULE PERI POEMS QEQ
|
||||
REPLICA RIGID SHOCK SPIN SNAP SRD KIM PYTHON MSCG MPIIO VORONOI
|
||||
USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-MESO USER-CGSDK USER-COLVARS
|
||||
USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-MESODPD USER-CGSDK USER-COLVARS
|
||||
USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD USER-LB
|
||||
USER-MANIFOLD USER-MEAMC USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE
|
||||
USER-NETCDF USER-PHONON USER-PLUMED USER-PTM USER-QTB USER-REAXC
|
||||
USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY USER-UEF
|
||||
USER-VTK USER-QUIP USER-QMMM USER-YAFF USER-ADIOS)
|
||||
USER-NETCDF USER-PHONON USER-PLUMED USER-PTM USER-QTB USER-REACTION
|
||||
USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY
|
||||
USER-UEF USER-VTK USER-QUIP USER-QMMM USER-YAFF USER-ADIOS)
|
||||
set(ACCEL_PACKAGES USER-OMP KOKKOS OPT USER-INTEL GPU)
|
||||
foreach(PKG ${DEFAULT_PACKAGES} ${ACCEL_PACKAGES})
|
||||
option(PKG_${PKG} "Build ${PKG} Package" OFF)
|
||||
|
@ -172,17 +167,25 @@ if(PKG_USER-ADIOS)
|
|||
list(APPEND LAMMPS_LINK_LIBS adios2::adios2)
|
||||
endif()
|
||||
|
||||
# do MPI detection after language activation, if MPI for these language is required
|
||||
# do MPI detection after language activation,
|
||||
# in case MPI for these languages is required
|
||||
set(MPI_CXX_SKIP_MPICXX TRUE)
|
||||
find_package(MPI QUIET)
|
||||
option(BUILD_MPI "Build MPI version" ${MPI_FOUND})
|
||||
|
||||
if(BUILD_MPI)
|
||||
find_package(MPI REQUIRED)
|
||||
include_directories(${MPI_CXX_INCLUDE_PATH})
|
||||
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)
|
||||
if(LAMMPS_LONGLONG_TO_LONG)
|
||||
add_definitions(-DLAMMPS_LONGLONG_TO_LONG)
|
||||
# We use a non-standard procedure to compile with MPI on windows
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL Windows)
|
||||
include(MPI4WIN)
|
||||
else()
|
||||
find_package(MPI REQUIRED)
|
||||
include_directories(${MPI_CXX_INCLUDE_PATH})
|
||||
add_definitions(-DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1)
|
||||
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)
|
||||
if(LAMMPS_LONGLONG_TO_LONG)
|
||||
add_definitions(-DLAMMPS_LONGLONG_TO_LONG)
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
enable_language(C)
|
||||
|
@ -224,7 +227,15 @@ pkg_depends(USER-LB MPI)
|
|||
pkg_depends(USER-PHONON KSPACE)
|
||||
pkg_depends(USER-SCAFACOS MPI)
|
||||
|
||||
# detect if we may enable OpenMP support by default
|
||||
set(BUILD_OMP_DEFAULT OFF)
|
||||
find_package(OpenMP QUIET)
|
||||
if(OpenMP_FOUND)
|
||||
check_include_file_cxx(omp.h HAVE_OMP_H_INCLUDE)
|
||||
if(HAVE_OMP_H_INCLUDE)
|
||||
set(BUILD_OMP_DEFAULT ON)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# TODO: this is a temporary workaround until a better solution is found. AK 2019-05-30
|
||||
# GNU GCC 9.x uses settings incompatible with our use of 'default(none)' in OpenMP pragmas
|
||||
|
@ -234,14 +245,14 @@ find_package(OpenMP QUIET)
|
|||
if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.99.9))
|
||||
option(BUILD_OMP "Build with OpenMP support" OFF)
|
||||
else()
|
||||
option(BUILD_OMP "Build with OpenMP support" ${OpenMP_FOUND})
|
||||
option(BUILD_OMP "Build with OpenMP support" ${BUILD_OMP_DEFAULT})
|
||||
endif()
|
||||
|
||||
if(BUILD_OMP)
|
||||
find_package(OpenMP REQUIRED)
|
||||
check_include_file_cxx(omp.h HAVE_OMP_H_INCLUDE)
|
||||
if(NOT HAVE_OMP_H_INCLUDE)
|
||||
message(FATAL_ERROR "Cannot find required 'omp.h' header file")
|
||||
message(FATAL_ERROR "Cannot find the 'omp.h' header file required for full OpenMP support")
|
||||
endif()
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
|
||||
|
@ -252,14 +263,15 @@ if(PKG_MSCG OR PKG_USER-ATC OR PKG_USER-AWPMD OR PKG_USER-QUIP OR PKG_LATTE)
|
|||
find_package(LAPACK)
|
||||
find_package(BLAS)
|
||||
if(NOT LAPACK_FOUND OR NOT BLAS_FOUND)
|
||||
if(CMAKE_GENERATOR STREQUAL "Ninja")
|
||||
status(FATAL_ERROR "Cannot build internal linear algebra library with Ninja build tool due to lack for Fortran support")
|
||||
include(CheckGeneratorSupport)
|
||||
if(NOT CMAKE_GENERATOR_SUPPORT_FORTRAN)
|
||||
status(FATAL_ERROR "Cannot build internal linear algebra library as CMake build tool lacks Fortran support")
|
||||
endif()
|
||||
enable_language(Fortran)
|
||||
file(GLOB LAPACK_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/linalg/[^.]*.[fF])
|
||||
add_library(linalg STATIC ${LAPACK_SOURCES})
|
||||
set(BLAS_LIBRARIES linalg)
|
||||
set(LAPACK_LIBRARIES linalg)
|
||||
set(BLAS_LIBRARIES "$<TARGET_FILE:linalg>")
|
||||
set(LAPACK_LIBRARIES "$<TARGET_FILE:linalg>")
|
||||
else()
|
||||
list(APPEND LAPACK_LIBRARIES ${BLAS_LIBRARIES})
|
||||
endif()
|
||||
|
@ -338,11 +350,11 @@ include(Packages/MESSAGE)
|
|||
include(Packages/MSCG)
|
||||
include(Packages/COMPRESS)
|
||||
|
||||
# the windows version of LAMMPS requires a couple extra libraries
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
list(APPEND LAMMPS_LINK_LIBS -lwsock32 -lpsapi)
|
||||
set(CMAKE_TUNE_FLAGS "${CMAKE_TUNE_DEFAULT}" CACHE STRING "Compiler specific optimization or instrumentation")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_TUNE_FLAGS}")
|
||||
if(CMAKE_Fortran_COMPILER)
|
||||
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${CMAKE_TUNE_FLAGS}")
|
||||
endif()
|
||||
|
||||
########################################################################
|
||||
# Basic system tests (standard libraries, headers, functions, types) #
|
||||
########################################################################
|
||||
|
@ -356,9 +368,6 @@ endforeach(HEADER)
|
|||
set(MATH_LIBRARIES "m" CACHE STRING "math library")
|
||||
mark_as_advanced( MATH_LIBRARIES )
|
||||
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
|
||||
#foreach(FUNC sin cos)
|
||||
# check_library_exists(${MATH_LIBRARIES} ${FUNC} "" FOUND_${FUNC}_${MATH_LIBRARIES})
|
||||
|
@ -420,7 +429,7 @@ endforeach()
|
|||
##############################################
|
||||
# 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})
|
||||
string(REGEX REPLACE "^USER-" "" PKG_LIB "${SIMPLE_LIB}")
|
||||
string(TOLOWER "${PKG_LIB}" PKG_LIB)
|
||||
|
@ -429,6 +438,9 @@ foreach(SIMPLE_LIB POEMS USER-ATC USER-AWPMD USER-H5MD USER-QMMM)
|
|||
${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.c
|
||||
${LAMMPS_LIB_SOURCE_DIR}/${PKG_LIB}/[^.]*.cpp)
|
||||
add_library(${PKG_LIB} STATIC ${${PKG_LIB}_SOURCES})
|
||||
if(LAMMPS_USE_MPI4WIN)
|
||||
add_dependencies(${PKG_LIB} mpi4win_build)
|
||||
endif()
|
||||
list(APPEND LAMMPS_LINK_LIBS ${PKG_LIB})
|
||||
if(PKG_LIB STREQUAL awpmd)
|
||||
target_include_directories(awpmd PUBLIC ${LAMMPS_LIB_SOURCE_DIR}/awpmd/systems/interact ${LAMMPS_LIB_SOURCE_DIR}/awpmd/ivutils/include)
|
||||
|
@ -466,6 +478,18 @@ include(Packages/OPT)
|
|||
include(Packages/USER-INTEL)
|
||||
include(Packages/GPU)
|
||||
|
||||
######################################################################
|
||||
# the windows version of LAMMPS requires a couple extra libraries
|
||||
# and the MPI library - if use - has to be linked right before those
|
||||
# and after everything else that is compiled locally
|
||||
######################################################################
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
if(LAMMPS_USE_MPI4WIN)
|
||||
list(APPEND LAMMPS_LINK_LIBS ${MPI4WIN_LIBRARIES})
|
||||
endif()
|
||||
list(APPEND LAMMPS_LINK_LIBS -lwsock32 -lpsapi)
|
||||
endif()
|
||||
|
||||
######################################################
|
||||
# Generate style headers based on global list of
|
||||
# styles registered during package selection
|
||||
|
@ -587,14 +611,14 @@ if(BUILD_TOOLS)
|
|||
add_executable(binary2txt ${LAMMPS_TOOLS_DIR}/binary2txt.cpp)
|
||||
install(TARGETS binary2txt DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
|
||||
# ninja-build currently does not support fortran. thus we skip building this tool
|
||||
if(CMAKE_GENERATOR STREQUAL "Ninja")
|
||||
message(STATUS "Skipping building 'chain.x' with Ninja build tool due to lack of Fortran support")
|
||||
else()
|
||||
include(CheckGeneratorSupport)
|
||||
if(CMAKE_GENERATOR_SUPPORT_FORTRAN)
|
||||
enable_language(Fortran)
|
||||
add_executable(chain.x ${LAMMPS_TOOLS_DIR}/chain.f)
|
||||
target_link_libraries(chain.x ${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES})
|
||||
install(TARGETS chain.x DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
else()
|
||||
message(WARNING "CMake build doesn't support fortran, skipping building 'chain.x'")
|
||||
endif()
|
||||
|
||||
enable_language(C)
|
||||
|
@ -682,10 +706,11 @@ endforeach()
|
|||
|
||||
get_directory_property(CPPFLAGS DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS)
|
||||
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 >>>
|
||||
Build type ${CMAKE_BUILD_TYPE}
|
||||
Install path ${CMAKE_INSTALL_PREFIX}
|
||||
Generator ${CMAKE_GENERATOR} using ${CMAKE_MAKE_PROGRAM}
|
||||
Compilers and Flags:
|
||||
C++ Compiler ${CMAKE_CXX_COMPILER}
|
||||
Type ${CMAKE_CXX_COMPILER_ID}
|
||||
|
@ -702,7 +727,7 @@ if (${_index} GREATER -1)
|
|||
endif()
|
||||
list (FIND LANGUAGES "C" _index)
|
||||
if (${_index} GREATER -1)
|
||||
message(STATUS "C Compiler ${CMAKE_C_COMPILER}
|
||||
message(STATUS "C compiler ${CMAKE_C_COMPILER}
|
||||
Type ${CMAKE_C_COMPILER_ID}
|
||||
Version ${CMAKE_C_COMPILER_VERSION}
|
||||
C Flags ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${BTYPE}}")
|
||||
|
@ -712,22 +737,22 @@ if(CMAKE_EXE_LINKER_FLAGS)
|
|||
Executable ${CMAKE_EXE_LINKER_FLAGS}")
|
||||
endif()
|
||||
if(BUILD_SHARED_LIBS)
|
||||
message(STATUS "Shared libraries ${CMAKE_SHARED_LINKER_FLAGS}")
|
||||
message(STATUS "Shared library flags: ${CMAKE_SHARED_LINKER_FLAGS}")
|
||||
else()
|
||||
message(STATUS "Static libraries ${CMAKE_STATIC_LINKER_FLAGS}")
|
||||
message(STATUS "Static library flags: ${CMAKE_STATIC_LINKER_FLAGS}")
|
||||
endif()
|
||||
message(STATUS "Link libraries: ${LAMMPS_LINK_LIBS}")
|
||||
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 these libraries: ${MPI_CXX_LIBRARIES};${MPI_Fortran_LIBRARIES}")
|
||||
endif()
|
||||
if(PKG_GPU)
|
||||
message(STATUS "GPU Api: ${GPU_API}")
|
||||
message(STATUS "GPU API: ${GPU_API}")
|
||||
if(GPU_API STREQUAL "CUDA")
|
||||
message(STATUS "GPU Arch: ${GPU_ARCH}")
|
||||
message(STATUS "GPU architecture: ${GPU_ARCH}")
|
||||
elseif(GPU_API STREQUAL "OPENCL")
|
||||
message(STATUS "OCL Tune: ${OCL_TUNE}")
|
||||
message(STATUS "OpenCL parameter tuning: ${OCL_TUNE}")
|
||||
endif()
|
||||
message(STATUS "GPU Precision: ${GPU_PREC}")
|
||||
message(STATUS "GPU precision: ${GPU_PREC}")
|
||||
endif()
|
||||
if(PKG_KOKKOS)
|
||||
message(STATUS "Kokkos Arch: ${KOKKOS_ARCH}")
|
||||
|
@ -739,7 +764,7 @@ if(PKG_KSPACE)
|
|||
else()
|
||||
message(STATUS "Using double precision FFTs")
|
||||
endif()
|
||||
if(FFT_FFTW_THREADS)
|
||||
if(FFT_FFTW_THREADS OR FFT_MKL_THREADS)
|
||||
message(STATUS "Using threaded FFTs")
|
||||
else()
|
||||
message(STATUS "Using non-threaded FFTs")
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
# ninja-build<1.10 does not support fortran.
|
||||
if(CMAKE_GENERATOR STREQUAL "Ninja")
|
||||
set(CMAKE_GENERATOR_SUPPORT_FORTRAN FALSE)
|
||||
execute_process(COMMAND "${CMAKE_MAKE_PROGRAM}" --version
|
||||
OUTPUT_VARIABLE NINJA_VERSION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
RESULT_VARIABLE _Ninja_version_result
|
||||
)
|
||||
if(_Ninja_version_result)
|
||||
message(WARNING "Unable to determine ninja version: ${_Ninja_version_result}, assuming fortran isn't supported")
|
||||
elseif(NINJA_VERSION VERSION_LESS "1.10")
|
||||
message(WARNING "Ninja build tool too old, to compile Fortran code, please install ninja-1.10 or newer")
|
||||
else()
|
||||
set(CMAKE_GENERATOR_SUPPORT_FORTRAN TRUE)
|
||||
endif()
|
||||
else()
|
||||
set(CMAKE_GENERATOR_SUPPORT_FORTRAN TRUE)
|
||||
if(NOT CMAKE_GENERATOR STREQUAL "Unix Makefiles")
|
||||
message(WARNING "Assuming fortran is supported for ${CMAKE_GENERATOR}")
|
||||
endif()
|
||||
endif()
|
|
@ -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)
|
|
@ -0,0 +1,23 @@
|
|||
# Download and configure custom MPICH files for Windows
|
||||
message(STATUS "Downloading and configuring MPICH-1.4.1 for Windows")
|
||||
include(ExternalProject)
|
||||
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
||||
ExternalProject_Add(mpi4win_build
|
||||
URL https://download.lammps.org/thirdparty/mpich2-win64-devel.tar.gz
|
||||
URL_MD5 4939fdb59d13182fd5dd65211e469f14
|
||||
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
|
||||
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmpi.a)
|
||||
else()
|
||||
ExternalProject_Add(mpi4win_build
|
||||
URL https://download.lammps.org/thirdparty/mpich2-win32-devel.tar.gz
|
||||
URL_MD5 a61d153500dce44e21b755ee7257e031
|
||||
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
|
||||
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libmpi.a)
|
||||
endif()
|
||||
|
||||
ExternalProject_get_property(mpi4win_build SOURCE_DIR)
|
||||
add_definitions(-DMPICH_SKIP_MPICXX)
|
||||
include_directories("${SOURCE_DIR}/include")
|
||||
set(MPI4WIN_LIBRARIES "${SOURCE_DIR}/lib/libmpi.a")
|
||||
list(APPEND LAMMPS_DEPS mpi4win_build)
|
||||
set(LAMMPS_USE_MPI4WIN ON)
|
|
@ -1,7 +1,4 @@
|
|||
if(PKG_GPU)
|
||||
if (CMAKE_VERSION VERSION_LESS "3.1")
|
||||
message(FATAL_ERROR "For the GPU package you need at least cmake-3.1")
|
||||
endif()
|
||||
set(GPU_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/GPU)
|
||||
set(GPU_SOURCES ${GPU_SOURCES_DIR}/gpu_extra.h
|
||||
${GPU_SOURCES_DIR}/fix_gpu.h
|
||||
|
@ -111,6 +108,9 @@ if(PKG_GPU)
|
|||
endif()
|
||||
|
||||
list(APPEND LAMMPS_LINK_LIBS gpu)
|
||||
if(LAMMPS_USE_MPI4WIN)
|
||||
add_dependencies(gpu mpi4win_build)
|
||||
endif()
|
||||
|
||||
add_executable(nvc_get_devices ${LAMMPS_LIB_SOURCE_DIR}/gpu/geryon/ucl_get_devices.cpp)
|
||||
target_compile_definitions(nvc_get_devices PRIVATE -DUCL_CUDADR)
|
||||
|
@ -172,6 +172,9 @@ if(PKG_GPU)
|
|||
target_compile_definitions(gpu PRIVATE -DUSE_OPENCL)
|
||||
|
||||
list(APPEND LAMMPS_LINK_LIBS gpu)
|
||||
if(LAMMPS_USE_MPI4WIN)
|
||||
add_dependencies(gpu mpi4win_build)
|
||||
endif()
|
||||
|
||||
add_executable(ocl_get_devices ${LAMMPS_LIB_SOURCE_DIR}/gpu/geryon/ucl_get_devices.cpp)
|
||||
target_compile_definitions(ocl_get_devices PRIVATE -DUCL_OPENCL)
|
||||
|
|
|
@ -34,30 +34,30 @@ if(PKG_KIM)
|
|||
endif()
|
||||
option(DOWNLOAD_KIM "Download KIM-API from OpenKIM instead of using an already installed one" ${DOWNLOAD_KIM_DEFAULT})
|
||||
if(DOWNLOAD_KIM)
|
||||
if(CMAKE_GENERATOR STREQUAL "Ninja")
|
||||
message(FATAL_ERROR "Cannot build downloaded KIM-API library with Ninja build tool")
|
||||
endif()
|
||||
message(STATUS "KIM-API download requested - we will build our own")
|
||||
include(CheckLanguage)
|
||||
# Workaround for cross compilation with MinGW where ${CMAKE_INSTALL_LIBDIR}
|
||||
# is a full path, so we need to remove the prefix
|
||||
string(REPLACE ${CMAKE_INSTALL_PREFIX} "" _KIM_LIBDIR ${CMAKE_INSTALL_LIBDIR})
|
||||
include(ExternalProject)
|
||||
enable_language(C)
|
||||
check_language(Fortran)
|
||||
if(NOT CMAKE_Fortran_COMPILER)
|
||||
message(FATAL_ERROR "Compiling the KIM-API library requires a Fortran compiler")
|
||||
endif()
|
||||
enable_language(Fortran)
|
||||
ExternalProject_Add(kim_build
|
||||
URL https://s3.openkim.org/kim-api/kim-api-2.1.3.txz
|
||||
URL_MD5 6ee829a1bbba5f8b9874c88c4c4ebff8
|
||||
BINARY_DIR build
|
||||
CMAKE_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
CMAKE_ARGS ${CMAKE_REQUEST_PIC}
|
||||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
|
||||
-DCMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER}
|
||||
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
|
||||
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
|
||||
BUILD_BYPRODUCTS <INSTALL_DIR>/${_KIM_LIBDIR}/libkim-api${CMAKE_SHARED_LIBRARY_SUFFIX}
|
||||
)
|
||||
ExternalProject_get_property(kim_build INSTALL_DIR)
|
||||
set(KIM-API_INCLUDE_DIRS ${INSTALL_DIR}/include/kim-api)
|
||||
set(KIM-API_LDFLAGS ${INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libkim-api${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
set(KIM-API_LDFLAGS ${INSTALL_DIR}/${_KIM_LIBDIR}/libkim-api${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
list(APPEND LAMMPS_DEPS kim_build)
|
||||
else()
|
||||
find_package(KIM-API ${KIM-API_MIN_VERSION} REQUIRED)
|
||||
|
|
|
@ -1,22 +1,38 @@
|
|||
if(PKG_KOKKOS)
|
||||
# TODO: this option needs to be documented when this works with a
|
||||
# regular release version of KOKKOS, and a version compatibility check
|
||||
# of external KOKKOS lib versus what the KOKKOS package needs is required.
|
||||
option(EXTERNAL_KOKKOS "Build against external kokkos library")
|
||||
if(EXTERNAL_KOKKOS)
|
||||
find_package(Kokkos REQUIRED)
|
||||
list(APPEND LAMMPS_LINK_LIBS Kokkos::kokkos)
|
||||
find_package(Kokkos 3 QUIET)
|
||||
if(Kokkos_FOUND)
|
||||
set(DOWNLOAD_KOKKOS_DEFAULT OFF)
|
||||
else()
|
||||
set(LAMMPS_LIB_KOKKOS_SRC_DIR ${LAMMPS_LIB_SOURCE_DIR}/kokkos)
|
||||
set(LAMMPS_LIB_KOKKOS_BIN_DIR ${LAMMPS_LIB_BINARY_DIR}/kokkos)
|
||||
add_subdirectory(${LAMMPS_LIB_KOKKOS_SRC_DIR} ${LAMMPS_LIB_KOKKOS_BIN_DIR})
|
||||
|
||||
set(Kokkos_INCLUDE_DIRS ${LAMMPS_LIB_KOKKOS_SRC_DIR}/core/src
|
||||
${LAMMPS_LIB_KOKKOS_SRC_DIR}/containers/src
|
||||
${LAMMPS_LIB_KOKKOS_SRC_DIR}/algorithms/src
|
||||
${LAMMPS_LIB_KOKKOS_BIN_DIR})
|
||||
include_directories(${Kokkos_INCLUDE_DIRS})
|
||||
list(APPEND LAMMPS_LINK_LIBS kokkos)
|
||||
set(DOWNLOAD_KOKKOS_DEFAULT ON)
|
||||
endif()
|
||||
option(DOWNLOAD_KOKKOS "Download the KOKKOS library instead of using an already installed one" ${DOWNLOAD_KOKKOS_DEFAULT})
|
||||
if(DOWNLOAD_KOKKOS)
|
||||
message(STATUS "KOKKOS download requested - we will build our own")
|
||||
# Workaround for cross compilation with MinGW where ${CMAKE_INSTALL_LIBDIR}
|
||||
# is a full path, so we need to remove the prefix
|
||||
string(REPLACE ${CMAKE_INSTALL_PREFIX} "" _KOKKOS_LIBDIR ${CMAKE_INSTALL_LIBDIR})
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(kokkos_build
|
||||
URL https://github.com/kokkos/kokkos/archive/3.0.00.tar.gz
|
||||
URL_MD5 281c7093aa3a603276e93abdf4be23b9
|
||||
PATCH_COMMAND patch -p3 < ${CMAKE_CURRENT_SOURCE_DIR}/2826.patch
|
||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> ${CMAKE_REQUEST_PIC}
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
|
||||
BUILD_BYPRODUCTS <INSTALL_DIR>/${_KOKKOS_LIBDIR}/libkokkoscore.a
|
||||
)
|
||||
list(APPEND LAMMPS_DEPS kokkos_build)
|
||||
ExternalProject_get_property(kokkos_build INSTALL_DIR)
|
||||
set(KOKKOS_LIBRARIES ${INSTALL_DIR}/${_KOKKOS_LIBDIR}/libkokkoscore.a)
|
||||
set(KOKKOS_INCLUDE_DIRS ${INSTALL_DIR}/include)
|
||||
include_directories(${KOKKOS_INCLUDE_DIRS})
|
||||
list(APPEND LAMMPS_LINK_LIBS ${KOKKOS_LIBRARIES})
|
||||
else()
|
||||
find_package(Kokkos 3)
|
||||
if(NOT Kokkos_FOUND)
|
||||
message(FATAL_ERROR "KOKKOS library not found, help CMake to find it by setting KOKKOS_LIBRARY, or set DOWNLOAD_KOKKOS=ON to download it")
|
||||
endif()
|
||||
list(APPEND LAMMPS_LINK_LIBS Kokkos::kokkos)
|
||||
endif()
|
||||
add_definitions(-DLMP_KOKKOS)
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ if(PKG_KSPACE)
|
|||
include_directories(${${FFTW}_INCLUDE_DIRS})
|
||||
list(APPEND LAMMPS_LINK_LIBS ${${FFTW}_LIBRARIES})
|
||||
if(FFTW3_OMP_LIBRARY OR FFTW3F_OMP_LIBRARY)
|
||||
option(FFT_FFTW_THREADS "Use threaded FFT library" ON)
|
||||
option(FFT_FFTW_THREADS "Use threaded FFTW library" ON)
|
||||
else()
|
||||
option(FFT_FFTW_THREADS "Use threaded FFT library" OFF)
|
||||
endif()
|
||||
|
@ -38,6 +38,10 @@ if(PKG_KSPACE)
|
|||
elseif(FFT STREQUAL "MKL")
|
||||
find_package(MKL REQUIRED)
|
||||
add_definitions(-DFFT_MKL)
|
||||
option(FFT_MKL_THREADS "Use threaded MKL FFT" ON)
|
||||
if(FFT_MKL_THREADS)
|
||||
add_definitions(-DFFT_MKL_THREADS)
|
||||
endif()
|
||||
include_directories(${MKL_INCLUDE_DIRS})
|
||||
list(APPEND LAMMPS_LINK_LIBS ${MKL_LIBRARIES})
|
||||
else()
|
||||
|
|
|
@ -8,13 +8,10 @@ if(PKG_LATTE)
|
|||
endif()
|
||||
option(DOWNLOAD_LATTE "Download the LATTE library instead of using an already installed one" ${DOWNLOAD_LATTE_DEFAULT})
|
||||
if(DOWNLOAD_LATTE)
|
||||
if (CMAKE_VERSION VERSION_LESS "3.7") # due to SOURCE_SUBDIR
|
||||
message(FATAL_ERROR "For downlading LATTE you need at least cmake-3.7")
|
||||
endif()
|
||||
if(CMAKE_GENERATOR STREQUAL "Ninja")
|
||||
message(FATAL_ERROR "Cannot build downloaded LATTE library with Ninja build tool")
|
||||
endif()
|
||||
message(STATUS "LATTE download requested - we will build our own")
|
||||
# Workaround for cross compilation with MinGW where ${CMAKE_INSTALL_LIBDIR}
|
||||
# is a full path, so we need to remove the prefix
|
||||
string(REPLACE ${CMAKE_INSTALL_PREFIX} "" _LATTE_LIBDIR ${CMAKE_INSTALL_LIBDIR})
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(latte_build
|
||||
URL https://github.com/lanl/LATTE/archive/v1.2.1.tar.gz
|
||||
|
@ -24,15 +21,20 @@ if(PKG_LATTE)
|
|||
-DBLAS_LIBRARIES=${BLAS_LIBRARIES} -DLAPACK_LIBRARIES=${LAPACK_LIBRARIES}
|
||||
-DCMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER} -DCMAKE_Fortran_FLAGS=${CMAKE_Fortran_FLAGS}
|
||||
-DCMAKE_Fortran_FLAGS_${BTYPE}=${CMAKE_Fortran_FLAGS_${BTYPE}} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
|
||||
BUILD_BYPRODUCTS <INSTALL_DIR>/${_LATTE_LIBDIR}/liblatte.a
|
||||
)
|
||||
ExternalProject_get_property(latte_build INSTALL_DIR)
|
||||
set(LATTE_LIBRARIES ${INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/liblatte.a)
|
||||
list(APPEND LAMMPS_DEPS latte_build)
|
||||
ExternalProject_get_property(latte_build INSTALL_DIR)
|
||||
set(LATTE_LIBRARIES ${INSTALL_DIR}/${_LATTE_LIBDIR}/liblatte.a)
|
||||
else()
|
||||
find_package(LATTE)
|
||||
if(NOT LATTE_FOUND)
|
||||
message(FATAL_ERROR "LATTE library not found, help CMake to find it by setting LATTE_LIBRARY, or set DOWNLOAD_LATTE=ON to download it")
|
||||
endif()
|
||||
endif()
|
||||
if(NOT LAPACK_FOUND)
|
||||
add_dependencies(latte_build linalg)
|
||||
endif()
|
||||
list(APPEND LAMMPS_LINK_LIBS ${LATTE_LIBRARIES} ${LAPACK_LIBRARIES})
|
||||
endif()
|
||||
|
|
|
@ -8,12 +8,6 @@ if(PKG_MSCG)
|
|||
endif()
|
||||
option(DOWNLOAD_MSCG "Download MSCG library instead of using an already installed one)" ${DOWNLOAD_MSCG_DEFAULT})
|
||||
if(DOWNLOAD_MSCG)
|
||||
if (CMAKE_VERSION VERSION_LESS "3.7") # due to SOURCE_SUBDIR
|
||||
message(FATAL_ERROR "For downlading MSCG you need at least cmake-3.7")
|
||||
endif()
|
||||
if(CMAKE_GENERATOR STREQUAL "Ninja")
|
||||
message(FATAL_ERROR "Cannot build downloaded MSCG library with Ninja build tool")
|
||||
endif()
|
||||
include(ExternalProject)
|
||||
if(NOT LAPACK_FOUND)
|
||||
set(EXTRA_MSCG_OPTS "-DLAPACK_LIBRARIES=${CMAKE_CURRENT_BINARY_DIR}/liblinalg.a")
|
||||
|
@ -22,8 +16,17 @@ if(PKG_MSCG)
|
|||
URL https://github.com/uchicago-voth/MSCG-release/archive/1.7.3.1.tar.gz
|
||||
URL_MD5 8c45e269ee13f60b303edd7823866a91
|
||||
SOURCE_SUBDIR src/CMake
|
||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> ${CMAKE_REQUEST_PIC} ${EXTRA_MSCG_OPTS}
|
||||
BUILD_COMMAND make mscg INSTALL_COMMAND ""
|
||||
CMAKE_ARGS ${CMAKE_REQUEST_PIC} ${EXTRA_MSCG_OPTS}
|
||||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
|
||||
-DCMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER}
|
||||
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
|
||||
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
|
||||
BUILD_COMMAND ${CMAKE_COMMAND} --build . --target mscg
|
||||
INSTALL_COMMAND ""
|
||||
BUILD_BYPRODUCTS <BINARY_DIR>/libmscg.a
|
||||
)
|
||||
ExternalProject_get_property(mscg_build BINARY_DIR)
|
||||
set(MSCG_LIBRARIES ${BINARY_DIR}/libmscg.a)
|
||||
|
|
|
@ -5,22 +5,7 @@ if(PKG_USER-COLVARS)
|
|||
file(GLOB COLVARS_SOURCES ${COLVARS_SOURCE_DIR}/[^.]*.cpp)
|
||||
|
||||
# Build Lepton by default
|
||||
set(COLVARS_LEPTON_DEFAULT ON)
|
||||
# but not if C++11 is disabled per user request
|
||||
if(DEFINED DISABLE_CXX11_REQUIREMENT)
|
||||
if(DISABLE_CXX11_REQUIREMENT)
|
||||
set(COLVARS_LEPTON_DEFAULT OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(COLVARS_LEPTON "Build and link the Lepton library" ${COLVARS_LEPTON_DEFAULT})
|
||||
|
||||
# Verify that the user's choice is consistent
|
||||
if(DEFINED DISABLE_CXX11_REQUIREMENT)
|
||||
if((DISABLE_CXX11_REQUIREMENT) AND (COLVARS_LEPTON))
|
||||
message(FATAL_ERROR "Building the Lepton library requires C++11 or later.")
|
||||
endif()
|
||||
endif()
|
||||
option(COLVARS_LEPTON "Build and link the Lepton library" ON)
|
||||
|
||||
if(COLVARS_LEPTON)
|
||||
set(LEPTON_DIR ${LAMMPS_LIB_SOURCE_DIR}/colvars/lepton)
|
||||
|
|
|
@ -31,7 +31,7 @@ if(PKG_USER-INTEL)
|
|||
endif()
|
||||
endif()
|
||||
if(INTEL_LRT_MODE STREQUAL "C++11")
|
||||
add_definitions(-DLMP_INTEL_USERLRT -DLMP_INTEL_LRT11)
|
||||
add_definitions(-DLMP_INTEL_USELRT -DLMP_INTEL_LRT11)
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
|
@ -74,11 +74,6 @@ if(PKG_USER-INTEL)
|
|||
add_definitions(-DLMP_INTEL_OFFLOAD)
|
||||
else()
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.3 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.4)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -xCOMMON-AVX512")
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -xHost")
|
||||
endif()
|
||||
include(CheckCXXCompilerFlag)
|
||||
foreach(_FLAG -O2 -fp-model fast=2 -no-prec-div -qoverride-limits -qopt-zmm-usage=high -qno-offload -fno-alias -ansi-alias -restrict)
|
||||
check_cxx_compiler_flag("${__FLAG}" COMPILER_SUPPORTS${_FLAG})
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
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")
|
||||
add_library(molfile INTERFACE)
|
||||
target_include_directories(molfile INTERFACE ${MOLFILE_INCLUDE_DIRS})
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
if(PKG_USER-NETCDF)
|
||||
# USER-NETCDF can use NetCDF, Parallel NetCDF (PNetCDF), or both. At least one necessary.
|
||||
# NetCDF library enables dump sytle "netcdf", while PNetCDF enables dump style "netcdf/mpiio"
|
||||
# NetCDF library enables dump style "netcdf", while PNetCDF enables dump style "netcdf/mpiio"
|
||||
find_package(NetCDF)
|
||||
if(NETCDF_FOUND)
|
||||
find_package(PNetCDF)
|
||||
|
|
|
@ -29,9 +29,6 @@ if(PKG_USER-PLUMED)
|
|||
|
||||
option(DOWNLOAD_PLUMED "Download Plumed package instead of using an already installed one" ${DOWNLOAD_PLUMED_DEFAULT})
|
||||
if(DOWNLOAD_PLUMED)
|
||||
if(CMAKE_GENERATOR STREQUAL "Ninja")
|
||||
message(FATAL_ERROR "Cannot build downloaded Plumed library with Ninja build tool")
|
||||
endif()
|
||||
if(BUILD_MPI)
|
||||
set(PLUMED_CONFIG_MPI "--enable-mpi")
|
||||
set(PLUMED_CONFIG_CC ${CMAKE_MPI_C_COMPILER})
|
||||
|
@ -47,10 +44,17 @@ if(PKG_USER-PLUMED)
|
|||
set(PLUMED_CONFIG_OMP "--disable-openmp")
|
||||
endif()
|
||||
message(STATUS "PLUMED download requested - we will build our own")
|
||||
if(PLUMED_MODE STREQUAL "STATIC")
|
||||
set(PLUMED_BUILD_BYPRODUCTS "<INSTALL_DIR>/lib/libplumed.a")
|
||||
elseif(PLUMED_MODE STREQUAL "SHARED")
|
||||
set(PLUMED_BUILD_BYPRODUCTS "<INSTALL_DIR>/lib/libplumed${CMAKE_SHARED_LIBRARY_SUFFIX};<INSTALL_DIR>/lib/libplumedKernel${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
elseif(PLUMED_MODE STREQUAL "RUNTIME")
|
||||
set(PLUMED_BUILD_BYPRODUCTS "<INSTALL_DIR>/lib/libplumedWrapper.a")
|
||||
endif()
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(plumed_build
|
||||
URL https://github.com/plumed/plumed2/releases/download/v2.5.3/plumed-src-2.5.3.tgz
|
||||
URL_MD5 de30d6e7c2dcc0973298e24a6da24286
|
||||
URL https://github.com/plumed/plumed2/releases/download/v2.6.0/plumed-src-2.6.0.tgz
|
||||
URL_MD5 204d2edae58d9b10ba3ad460cad64191
|
||||
BUILD_IN_SOURCE 1
|
||||
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR>
|
||||
${CONFIGURE_REQUEST_PIC}
|
||||
|
@ -59,6 +63,7 @@ if(PKG_USER-PLUMED)
|
|||
${PLUMED_CONFIG_OMP}
|
||||
CXX=${PLUMED_CONFIG_CXX}
|
||||
CC=${PLUMED_CONFIG_CC}
|
||||
BUILD_BYPRODUCTS ${PLUMED_BUILD_BYPRODUCTS}
|
||||
)
|
||||
ExternalProject_get_property(plumed_build INSTALL_DIR)
|
||||
set(PLUMED_INSTALL_DIR ${INSTALL_DIR})
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
if(PKG_USER-QMMM)
|
||||
enable_language(Fortran)
|
||||
enable_language(C)
|
||||
|
||||
message(WARNING "Building QMMM with CMake is still experimental")
|
||||
find_package(QE REQUIRED)
|
||||
include_directories(${QE_INCLUDE_DIRS})
|
||||
list(APPEND LAMMPS_LINK_LIBS ${QE_LIBRARIES})
|
||||
if(NOT BUILD_LIB)
|
||||
message(FATAL_ERROR "Building a QM/MM executable with USER-QMMM requires BUILD_LIB=yes")
|
||||
endif()
|
||||
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()
|
||||
|
|
|
@ -4,6 +4,7 @@ if(PKG_USER-SCAFACOS)
|
|||
|
||||
find_package(GSL REQUIRED)
|
||||
find_package(PkgConfig QUIET)
|
||||
find_package(MPI REQUIRED)
|
||||
set(DOWNLOAD_SCAFACOS_DEFAULT ON)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(SCAFACOS QUIET scafacos)
|
||||
|
@ -13,9 +14,6 @@ if(PKG_USER-SCAFACOS)
|
|||
endif()
|
||||
option(DOWNLOAD_SCAFACOS "Download ScaFaCoS library instead of using an already installed one" ${DOWNLOAD_SCAFACOS_DEFAULT})
|
||||
if(DOWNLOAD_SCAFACOS)
|
||||
if(CMAKE_GENERATOR STREQUAL "Ninja")
|
||||
message(FATAL_ERROR "Cannot build downloaded ScaFaCoS library with Ninja build tool")
|
||||
endif()
|
||||
message(STATUS "ScaFaCoS download requested - we will build our own")
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(scafacos_build
|
||||
|
@ -29,6 +27,22 @@ if(PKG_USER-SCAFACOS)
|
|||
CXX=${CMAKE_MPI_CXX_COMPILER}
|
||||
CC=${CMAKE_MPI_C_COMPILER}
|
||||
F77=
|
||||
BUILD_BYPRODUCTS
|
||||
<INSTALL_DIR>/lib/libfcs.a
|
||||
<INSTALL_DIR>/lib/libfcs_direct.a
|
||||
<INSTALL_DIR>/lib/libfcs_ewald.a
|
||||
<INSTALL_DIR>/lib/libfcs_fmm.a
|
||||
<INSTALL_DIR>/lib/libfcs_p2nfft.a
|
||||
<INSTALL_DIR>/lib/libfcs_p3m.a
|
||||
<INSTALL_DIR>/lib/libfcs_near.a
|
||||
<INSTALL_DIR>/lib/libfcs_gridsort.a
|
||||
<INSTALL_DIR>/lib/libfcs_resort.a
|
||||
<INSTALL_DIR>/lib/libfcs_redist.a
|
||||
<INSTALL_DIR>/lib/libfcs_common.a
|
||||
<INSTALL_DIR>/lib/libfcs_pnfft.a
|
||||
<INSTALL_DIR>/lib/libfcs_pfft.a
|
||||
<INSTALL_DIR>/lib/libfcs_fftw3_mpi.a
|
||||
<INSTALL_DIR>/lib/libfcs_fftw3.a
|
||||
)
|
||||
ExternalProject_get_property(scafacos_build INSTALL_DIR)
|
||||
set(SCAFACOS_BUILD_DIR ${INSTALL_DIR})
|
||||
|
|
|
@ -7,9 +7,6 @@ if(PKG_VORONOI)
|
|||
endif()
|
||||
option(DOWNLOAD_VORO "Download and compile the Voro++ library instead of using an already installed one" ${DOWNLOAD_VORO_DEFAULT})
|
||||
if(DOWNLOAD_VORO)
|
||||
if(CMAKE_GENERATOR STREQUAL "Ninja")
|
||||
message(FATAL_ERROR "Cannot build downloaded Voro++ library with Ninja build tool")
|
||||
endif()
|
||||
message(STATUS "Voro++ download requested - we will build our own")
|
||||
include(ExternalProject)
|
||||
|
||||
|
@ -29,6 +26,7 @@ if(PKG_VORONOI)
|
|||
URL https://download.lammps.org/thirdparty/voro++-0.4.6.tar.gz
|
||||
URL_MD5 2338b824c3b7b25590e18e8df5d68af9
|
||||
CONFIGURE_COMMAND "" BUILD_COMMAND make ${VORO_BUILD_OPTIONS} BUILD_IN_SOURCE 1 INSTALL_COMMAND ""
|
||||
BUILD_BYPRODUCTS <SOURCE_DIR>/src/libvoro++.a
|
||||
)
|
||||
ExternalProject_get_property(voro_build SOURCE_DIR)
|
||||
set(VORO_LIBRARIES ${SOURCE_DIR}/src/libvoro++.a)
|
||||
|
|
|
@ -217,7 +217,7 @@ cmake -C ../cmake/presets/all_on.cmake -C ../cmake/presets/nolib.cmake -D PKG_GP
|
|||
</tr>
|
||||
<tr>
|
||||
<td><code>CMAKE_VERBOSE_MAKEFILE</code></td>
|
||||
<td>Enable verbose output from Makefile builds (useful for debugging), the same can be achived by adding `VERBOSE=1` to the `make` call.</td>
|
||||
<td>Enable verbose output from Makefile builds (useful for debugging), the same can be achieved by adding `VERBOSE=1` to the `make` call.</td>
|
||||
<td>
|
||||
<dl>
|
||||
<dt><code>off</code> (default)</dt>
|
||||
|
@ -576,7 +576,7 @@ cmake -C ../cmake/presets/all_on.cmake -C ../cmake/presets/nolib.cmake -D PKG_GP
|
|||
Several fixes and a pair style that have Monte Carlo (MC) or MC-like
|
||||
attributes. These include fixes for creating, breaking, and swapping bonds,
|
||||
for performing atomic swaps, and performing grand-canonical MC (GCMC) in
|
||||
conjuction with dynamics.
|
||||
conjunction with dynamics.
|
||||
</td>
|
||||
<td>
|
||||
<dl>
|
||||
|
@ -1383,8 +1383,8 @@ cmake -C ../cmake/presets/all_on.cmake -C ../cmake/presets/nolib.cmake -D PKG_GP
|
|||
Some potentials that are also implemented in the Yet Another Force Field (YAFF) code.
|
||||
The expressions and their use are discussed in the following papers:
|
||||
<ul>
|
||||
<li><a href="http://dx.doi.org/10.1002/jcc.23877" target="_blank">Vanduyfhuys et al., J. Comput. Chem., 36 (13), 1015-1027 (2015)</a></li>
|
||||
<li><a href="http://dx.doi.org/10.1002/jcc.25173" target="_blank">Vanduyfhuys et al., J. Comput. Chem., 39 (16), 999-1011 (2018)</a></li>
|
||||
<li><a href="https://doi.org/10.1002/jcc.23877" target="_blank">Vanduyfhuys et al., J. Comput. Chem., 36 (13), 1015-1027 (2015)</a></li>
|
||||
<li><a href="https://doi.org/10.1002/jcc.25173" target="_blank">Vanduyfhuys et al., J. Comput. Chem., 39 (16), 999-1011 (2018)</a></li>
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
|
|
|
@ -7,11 +7,11 @@ set(ALL_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU
|
|||
SRD VORONOI
|
||||
USER-ADIOS USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK
|
||||
USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP
|
||||
USER-H5MD USER-INTEL USER-LB USER-MANIFOLD USER-MEAMC USER-MESO
|
||||
USER-H5MD USER-INTEL USER-LB USER-MANIFOLD USER-MEAMC USER-MESODPD
|
||||
USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF USER-OMP
|
||||
USER-PHONON USER-PLUMED USER-PTM USER-QMMM USER-QTB USER-QUIP
|
||||
USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ USER-SPH
|
||||
USER-TALLY USER-UEF USER-VTK USER-YAFF)
|
||||
USER-REACTION USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ
|
||||
USER-SPH USER-TALLY USER-UEF USER-VTK USER-YAFF)
|
||||
|
||||
foreach(PKG ${ALL_PACKAGES})
|
||||
set(PKG_${PKG} OFF CACHE BOOL "" FORCE)
|
||||
|
|
|
@ -9,11 +9,11 @@ set(ALL_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU
|
|||
SRD VORONOI
|
||||
USER-ADIOS USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK
|
||||
USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP
|
||||
USER-H5MD USER-INTEL USER-LB USER-MANIFOLD USER-MEAMC USER-MESO
|
||||
USER-H5MD USER-INTEL USER-LB USER-MANIFOLD USER-MEAMC USER-MESODPD
|
||||
USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF USER-OMP
|
||||
USER-PHONON USER-PLUMED USER-PTM USER-QMMM USER-QTB USER-QUIP
|
||||
USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ USER-SPH
|
||||
USER-TALLY USER-UEF USER-VTK USER-YAFF)
|
||||
USER-REACTION USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ
|
||||
USER-SPH USER-TALLY USER-UEF USER-VTK USER-YAFF)
|
||||
|
||||
foreach(PKG ${ALL_PACKAGES})
|
||||
set(PKG_${PKG} ON CACHE BOOL "" FORCE)
|
||||
|
|
|
@ -13,5 +13,5 @@ set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
|||
set(OpenMP_CXX "clang++" CACHE STRING "" FORCE)
|
||||
set(OpenMP_CXX_FLAGS "-fopenmp" CACHE STRING "" FORCE)
|
||||
set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
||||
set(OpenMP_omp_LIBRARY "/usr/lib64/libomp.so" CACHE PATH "" FORCE)
|
||||
set(OpenMP_omp_LIBRARY "libomp.so" CACHE PATH "" FORCE)
|
||||
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
# preset that will enable clang/clang++ with support for MPI and OpenMP (on Linux boxes)
|
||||
|
||||
set(CMAKE_CXX_COMPILER "icpc" CACHE STRING "" FORCE)
|
||||
set(CMAKE_C_COMPILER "icc" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_FLAGS "-O3 -DNDEBG" CACHE STRING "" FORCE)
|
||||
set(MPI_CXX "icpc" CACHE STRING "" FORCE)
|
||||
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
|
||||
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||
|
||||
set(OpenMP_C "icc" CACHE STRING "" FORCE)
|
||||
set(OpenMP_C_FLAGS "-qopenmp" CACHE STRING "" FORCE)
|
||||
set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
||||
set(OpenMP_CXX "icpc" CACHE STRING "" FORCE)
|
||||
set(OpenMP_CXX_FLAGS "-qopenmp" CACHE STRING "" FORCE)
|
||||
set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
||||
set(OpenMP_omp_LIBRARY "libiomp5.so" CACHE PATH "" FORCE)
|
||||
|
|
@ -1,17 +1,28 @@
|
|||
set(WIN_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU
|
||||
GRANULAR KSPACE MANYBODY MC MISC MOLECULE OPT PERI POEMS QEQ
|
||||
REPLICA RIGID SHOCK SNAP SPIN SRD VORONOI USER-ATC USER-AWPMD
|
||||
USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS USER-DIFFRACTION
|
||||
USER-DPD USER-DRUDE USER-EFF USER-FEP USER-INTEL USER-MANIFOLD
|
||||
USER-MEAMC USER-MESO USER-MISC USER-MGPT USER-MOFFF USER-MOLFILE
|
||||
USER-OMP USER-PHONON USER-PTM USER-QTB USER-REAXC USER-SDPD
|
||||
USER-SMD USER-SMTBQ USER-SPH USER-TALLY USER-UEF USER-YAFF)
|
||||
GRANULAR KSPACE LATTE MANYBODY MC MISC MOLECULE OPT PERI
|
||||
POEMS QEQ REPLICA RIGID SHOCK SNAP SPIN SRD VORONOI
|
||||
USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK
|
||||
USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF
|
||||
USER-FEP USER-INTEL USER-MANIFOLD USER-MEAMC USER-MESODPD
|
||||
USER-MISC USER-MGPT USER-MOFFF USER-MOLFILE USER-OMP
|
||||
USER-PHONON USER-PTM USER-QTB USER-REACTION USER-REAXC
|
||||
USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY USER-UEF
|
||||
USER-YAFF)
|
||||
|
||||
foreach(PKG ${WIN_PACKAGES})
|
||||
set(PKG_${PKG} ON CACHE BOOL "" FORCE)
|
||||
endforeach()
|
||||
|
||||
# these two packages require a full MPI implementation
|
||||
if(BUILD_MPI)
|
||||
set(PKG_MPIIO ON CACHE BOOL "" FORCE)
|
||||
set(PKG_USER-LB ON CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
|
||||
set(DOWNLOAD_VORO ON CACHE BOOL "" FORCE)
|
||||
set(DOWNLOAD_EIGEN3 ON CACHE BOOL "" FORCE)
|
||||
set(LAMMPS_MEMALIGN "0" CACHE STRING "" FORCE)
|
||||
set(CMAKE_TUNE_FLAGS "-Wno-missing-include-dirs" CACHE STRING "" FORCE)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "--enable-stdcall-fixup" CACHE STRING "" FORCE)
|
||||
set(BUILD_TOOLS ON CACHE BOOL "" FORCE)
|
||||
set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/lammps-installer")
|
||||
|
|
|
@ -2,14 +2,16 @@
|
|||
# external libraries. Compared to all_on.cmake some more unusual packages
|
||||
# are removed. The resulting binary should be able to run most inputs.
|
||||
|
||||
set(ALL_PACKAGES ASPHERE CLASS2 COLLOID CORESHELL DIPOLE
|
||||
GRANULAR KSPACE MANYBODY MC MISC MOLECULE OPT PERI
|
||||
PYTHON QEQ REPLICA RIGID SHOCK SNAP SRD VORONOI
|
||||
USER-CGDNA USER-CGSDK USER-COLVARS USER-DIFFRACTION USER-DPD
|
||||
USER-DRUDE USER-FEP USER-MEAMC USER-MESO
|
||||
USER-MISC USER-MOFFF USER-OMP USER-PHONON USER-REAXC
|
||||
USER-SPH USER-SMD USER-UEF USER-YAFF)
|
||||
set(ALL_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL
|
||||
DIPOLE GRANULAR KSPACE MANYBODY MC MISC MOLECULE OPT PERI
|
||||
POEMS PYTHON QEQ REPLICA RIGID SHOCK SNAP SPIN SRD VORONOI
|
||||
USER-CGDNA USER-CGSDK USER-COLVARS USER-DIFFRACTION
|
||||
USER-DPD USER-DRUDE USER-FEP USER-MEAMC USER-MESODPD
|
||||
USER-MISC USER-MOFFF USER-OMP USER-PHONON USER-REACTION
|
||||
USER-REAXC USER-SPH USER-SMD USER-UEF USER-YAFF)
|
||||
|
||||
foreach(PKG ${ALL_PACKAGES})
|
||||
set(PKG_${PKG} ON CACHE BOOL "" FORCE)
|
||||
endforeach()
|
||||
|
||||
set(BUILD_TOOLS ON CACHE BOOL "" FORCE)
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
/old
|
||||
/html
|
||||
/html-offline
|
||||
/latex
|
||||
/mathjax
|
||||
/spelling
|
||||
/LAMMPS.epub
|
||||
/LAMMPS.mobi
|
||||
|
|
61
doc/Makefile
|
@ -4,6 +4,7 @@ SHELL = /bin/bash
|
|||
BUILDDIR = ${CURDIR}
|
||||
RSTDIR = $(BUILDDIR)/src
|
||||
VENV = $(BUILDDIR)/docenv
|
||||
MATHJAX = $(BUILDDIR)/mathjax
|
||||
TXT2RST = $(VENV)/bin/txt2rst
|
||||
ANCHORCHECK = $(VENV)/bin/rst_anchor_check
|
||||
|
||||
|
@ -28,62 +29,61 @@ endif
|
|||
|
||||
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
|
||||
|
||||
# ------------------------------------------
|
||||
|
||||
help:
|
||||
@echo "Please use \`make <target>' where <target> is one of"
|
||||
@echo " html create HTML doc pages in html dir"
|
||||
@echo " pdf create Developer.pdf and Manual.pdf in this dir"
|
||||
@echo " fetch fetch HTML and PDF files from LAMMPS web site"
|
||||
@echo " epub create ePUB format manual for e-book readers"
|
||||
@echo " mobi convert ePUB to MOBI format manual for e-book readers (e.g. Kindle)"
|
||||
@echo " html create HTML doc pages in html dir"
|
||||
@echo " pdf create Developer.pdf and Manual.pdf in this dir"
|
||||
@echo " fetch fetch HTML and PDF files from LAMMPS web site"
|
||||
@echo " epub create ePUB format manual for e-book readers"
|
||||
@echo " mobi convert ePUB to MOBI format manual for e-book readers (e.g. Kindle)"
|
||||
@echo " (requires ebook-convert tool from calibre)"
|
||||
@echo " clean remove all intermediate RST files"
|
||||
@echo " clean-all reset the entire build environment"
|
||||
@echo " clean remove all intermediate RST files"
|
||||
@echo " clean-all reset the entire build environment"
|
||||
@echo " anchor_check scan for duplicate anchor labels"
|
||||
@echo " style_check check for complete and consistent style lists"
|
||||
@echo " spelling spell-check the manual"
|
||||
@echo " package_check check for complete and consistent package lists"
|
||||
@echo " spelling spell-check the manual"
|
||||
|
||||
# ------------------------------------------
|
||||
|
||||
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 spelling
|
||||
|
||||
clean-spelling:
|
||||
rm -rf spelling
|
||||
|
||||
rst: clean $(ANCHORCHECK)
|
||||
|
||||
html: $(ANCHORCHECK)
|
||||
html: $(ANCHORCHECK) $(MATHJAX)
|
||||
@(\
|
||||
. $(VENV)/bin/activate ;\
|
||||
sphinx-build $(SPHINXEXTRA) -b html -c utils/sphinx-config -d $(BUILDDIR)/doctrees $(RSTDIR) html ;\
|
||||
echo "############################################" ;\
|
||||
rst_anchor_check src/*.rst ;\
|
||||
python utils/check-packages.py -s ../src -d src ;\
|
||||
env LC_ALL=C grep -n '[^ -~]' $(RSTDIR)/*.rst ;\
|
||||
python utils/check-styles.py -s ../src -d src ;\
|
||||
echo "############################################" ;\
|
||||
deactivate ;\
|
||||
)
|
||||
-rm html/searchindex.js
|
||||
@rm -rf html/_sources
|
||||
@rm -rf html/PDF
|
||||
@rm -rf html/USER
|
||||
@rm -rf html/JPG
|
||||
@cp -r src/PDF html/PDF
|
||||
@cp -r src/USER html/USER
|
||||
@mkdir -p html/JPG
|
||||
@cp `grep -A2 '\.\. .*image::' src/*.rst | grep ':target:' | sed -e 's,.*:target: JPG/,src/JPG/,' | sort | uniq` html/JPG/
|
||||
@rm -rf html/PDF/.[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."
|
||||
|
||||
spelling: utils/sphinx-config/false_positives.txt
|
||||
spelling: $(VENV) utils/sphinx-config/false_positives.txt
|
||||
@(\
|
||||
. $(VENV)/bin/activate ;\
|
||||
pip install sphinxcontrib-spelling ;\
|
||||
|
@ -93,7 +93,7 @@ spelling: utils/sphinx-config/false_positives.txt
|
|||
)
|
||||
@echo "Spell check finished."
|
||||
|
||||
epub:
|
||||
epub: $(VENV)
|
||||
@mkdir -p epub/JPG
|
||||
@rm -f LAMMPS.epub
|
||||
@cp src/JPG/lammps-logo.png epub/
|
||||
|
@ -125,6 +125,7 @@ pdf: $(ANCHORCHECK)
|
|||
sphinx-build $(SPHINXEXTRA) -b latex -c utils/sphinx-config -d $(BUILDDIR)/doctrees $(RSTDIR) latex ;\
|
||||
echo "############################################" ;\
|
||||
rst_anchor_check src/*.rst ;\
|
||||
python utils/check-packages.py -s ../src -d src ;\
|
||||
env LC_ALL=C grep -n '[^ -~]' $(RSTDIR)/*.rst ;\
|
||||
python utils/check-styles.py -s ../src -d src ;\
|
||||
echo "############################################" ;\
|
||||
|
@ -146,11 +147,7 @@ pdf: $(ANCHORCHECK)
|
|||
@rm -rf latex/PDF
|
||||
@rm -rf latex/USER
|
||||
@cp -r src/PDF latex/PDF
|
||||
@cp -r src/USER latex/USER
|
||||
@rm -rf latex/PDF/.[sg]*
|
||||
@rm -rf latex/USER/.[sg]*
|
||||
@rm -rf latex/USER/*/.[sg]*
|
||||
@rm -rf latex/USER/*/*.[sg]*
|
||||
@echo "Build finished. Manual.pdf and Developer.pdf are in this directory."
|
||||
|
||||
fetch:
|
||||
|
@ -168,13 +165,20 @@ anchor_check : $(ANCHORCHECK)
|
|||
deactivate ;\
|
||||
)
|
||||
|
||||
style_check :
|
||||
style_check : $(VENV)
|
||||
@(\
|
||||
. $(VENV)/bin/activate ;\
|
||||
python utils/check-styles.py -s ../src -d src ;\
|
||||
deactivate ;\
|
||||
)
|
||||
|
||||
package_check : $(VENV)
|
||||
@(\
|
||||
. $(VENV)/bin/activate ;\
|
||||
python utils/check-packages.py -s ../src -d src ;\
|
||||
deactivate ;\
|
||||
)
|
||||
|
||||
# ------------------------------------------
|
||||
|
||||
$(VENV):
|
||||
|
@ -187,6 +191,9 @@ $(VENV):
|
|||
deactivate;\
|
||||
)
|
||||
|
||||
$(MATHJAX):
|
||||
@git clone --depth 1 https://github.com/mathjax/MathJax.git mathjax
|
||||
|
||||
$(TXT2RST) $(ANCHORCHECK): $(VENV)
|
||||
@( \
|
||||
. $(VENV)/bin/activate; \
|
||||
|
|
11
doc/lammps.1
|
@ -1,4 +1,4 @@
|
|||
.TH LAMMPS "24 January 2020" "2020-01-24"
|
||||
.TH LAMMPS "19 March 2020" "2020-03-19"
|
||||
.SH NAME
|
||||
.B LAMMPS
|
||||
\- Molecular Dynamics Simulator.
|
||||
|
@ -11,13 +11,18 @@ or
|
|||
|
||||
mpirun \-np 2
|
||||
.B lmp
|
||||
<input file> [OPTIONS] ...
|
||||
\-in <input file> [OPTIONS] ...
|
||||
|
||||
or
|
||||
|
||||
.B lmp
|
||||
\-r2data file.restart file.data
|
||||
|
||||
or
|
||||
|
||||
.B lmp
|
||||
\-h
|
||||
|
||||
.SH DESCRIPTION
|
||||
.B LAMMPS
|
||||
is a classical molecular dynamics code, and an acronym for \fBL\fRarge-scale
|
||||
|
@ -249,7 +254,7 @@ the chapter on errors in the
|
|||
manual gives some additional information about error messages, if possible.
|
||||
|
||||
.SH COPYRIGHT
|
||||
© 2003--2019 Sandia Corporation
|
||||
© 2003--2020 Sandia Corporation
|
||||
|
||||
This package is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License version 2 as
|
||||
|
|
|
@ -31,7 +31,7 @@ of benzene, you have to provide the files 'benzene.car' and 'benzene.mdf'
|
|||
in the current working directory.
|
||||
.B msi2lmp
|
||||
will then read and process those files according to its remaining settings.
|
||||
All other settins are optional and have defaults as listed.
|
||||
All other settings are optional and have defaults as listed.
|
||||
.TP
|
||||
\fB\-c <I,1,II,2,O,0>\fR, \fB\-class <I,1,II,2,O,0>\fR
|
||||
The \-c or \-class option selects the force field class, i.e which pair
|
||||
|
|
|
@ -10,7 +10,7 @@ LAMMPS</H2>
|
|||
LAMMPS = Large-scale Atomic/Molecular Massively Parallel Simulator</P>
|
||||
<P>
|
||||
This is the documentation for the LAMMPS 2001 version, written in F90,
|
||||
which has been superceded by more current versions. See the <A
|
||||
which has been superseded by more current versions. See the <A
|
||||
HREF="http://www.cs.sandia.gov/~sjplimp/lammps.html">LAMMPS WWW
|
||||
Site</A> for more information.
|
||||
<P>
|
||||
|
|
|
@ -47,7 +47,7 @@ directories: </P>
|
|||
<P>
|
||||
The src directory contains the F90 and C source files for LAMMPS as
|
||||
well as several sample Makefiles for different machines. To make LAMMPS
|
||||
for a specfic machine, you simply type</P>
|
||||
for a specific machine, you simply type</P>
|
||||
<P>
|
||||
make machine</P>
|
||||
<P>
|
||||
|
|
|
@ -1079,7 +1079,7 @@ for style aveforce, average force on the group of fixed atoms is computed,
|
|||
to new total value -> has effect of applying same force to entire group
|
||||
of atoms
|
||||
thermostatting constraints (rescale, hoover/drag, langevin) cannot be used in
|
||||
conjuction with global "temp control", since they conflict and will
|
||||
conjunction with global "temp control", since they conflict and will
|
||||
cause atom velocities to be reset twice
|
||||
thermostatting constraints (rescale, hoover/drag, langevin) cannot be used
|
||||
when performing a minimization
|
||||
|
@ -1089,7 +1089,7 @@ meaning of rescale and Langevin thermostatting coefficients is same as in
|
|||
"temp control" command
|
||||
for rescale style, it can be used as a coarse temperature rescaler,
|
||||
for example "rescale 200.0 300.0 100 10.0 1.0" will ramp the temperature
|
||||
up during the simulation, resetting it to the target temperatue as needed
|
||||
up during the simulation, resetting it to the target temperature as needed
|
||||
for rescale style, it can be used to create an instantaneous
|
||||
drag force that slowly rescales the temperature without oscillation,
|
||||
for example "rescale 300.0 300.0 1 0.0 0.0001" will force (or keep)
|
||||
|
@ -1952,7 +1952,7 @@ for rescale style, the amount of rescaling is contfolled by the fractional
|
|||
to halfway between the current and target temperature
|
||||
for rescale style, it can be used as a coarse temperature rescaler,
|
||||
for example "rescale 200.0 300.0 100 10.0 1.0" will ramp the temperature
|
||||
up during the simulation, resetting it to the target temperatue as needed
|
||||
up during the simulation, resetting it to the target temperature as needed
|
||||
for rescale style, it can be used to create an instantaneous
|
||||
drag force that slowly rescales the temperature without oscillation,
|
||||
for example "rescale 300.0 300.0 1 0.0 0.0001" will force (or keep)
|
||||
|
|
|
@ -10,7 +10,7 @@ LAMMPS</H2>
|
|||
LAMMPS = Large-scale Atomic/Molecular Massively Parallel Simulator</P>
|
||||
<P>
|
||||
This is the documentation for the LAMMPS 99 version, written in F77,
|
||||
which has been superceded by more current versions. See the <A
|
||||
which has been superseded by more current versions. See the <A
|
||||
HREF="http://www.cs.sandia.gov/~sjplimp/lammps.html">LAMMPS WWW
|
||||
Site</A> for more information.
|
||||
<P>
|
||||
|
|
|
@ -45,7 +45,7 @@ directories: </P>
|
|||
<P>
|
||||
The src directory contains the F77 and C source files for LAMMPS as
|
||||
well as several sample Makefiles for different machines. To make LAMMPS
|
||||
for a specfic machine, you simply type</P>
|
||||
for a specific machine, you simply type</P>
|
||||
<P>
|
||||
make machine</P>
|
||||
<P>
|
||||
|
|
|
@ -430,7 +430,7 @@ accuracy criterion effectively determines how many k-space vectors are used
|
|||
for PPPM, accuracy criterion determines mesh spacing (see "particle mesh"
|
||||
command)
|
||||
for PPPM, must be running on power-of-2 number of processors for FFTs
|
||||
must use periodic boundary conditions in conjuction with Ewald and PPPM
|
||||
must use periodic boundary conditions in conjunction with Ewald and PPPM
|
||||
cannot use any styles other than none with nonbond style = lj/shift or
|
||||
nonbond style = soft
|
||||
Coulomb style = smooth should be used with nonbond style = lj/switch,
|
||||
|
@ -772,7 +772,7 @@ for style aveforce, average force on the group of fixed atoms is computed,
|
|||
to new total value -> has effect of applying same force to entire group
|
||||
of atoms
|
||||
thermostatting constraints (rescale, langevin, nose/hoover) cannot be used in
|
||||
conjuction with global "temp control", since they conflict and will
|
||||
conjunction with global "temp control", since they conflict and will
|
||||
cause atom velocities to be reset twice
|
||||
if multiple Langevin constraints are specified the Marsaglia RNG will
|
||||
only use the last RNG seed specified for initialization
|
||||
|
|
|
@ -8,7 +8,6 @@ for use with GNU make or gmake, or a build environment generated by CMake
|
|||
alternative you can download a package with pre-built executables
|
||||
as described on the :doc:`Install <Install>` doc page.
|
||||
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
|
@ -21,8 +20,3 @@ as described on the :doc:`Install <Install>` doc page.
|
|||
Build_extras
|
||||
Build_windows
|
||||
Build_development
|
||||
|
||||
|
||||
.. _lws: http://lammps.sandia.gov
|
||||
.. _ld: Manual.html
|
||||
.. _lc: Commands_all.html
|
||||
|
|
|
@ -10,155 +10,186 @@ CMake and make:
|
|||
* :ref:`Build the LAMMPS documentation <doc>`
|
||||
* :ref:`Install LAMMPS after a build <install>`
|
||||
|
||||
|
||||
----------
|
||||
|
||||
|
||||
.. _serial:
|
||||
|
||||
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>`_
|
||||
library. Or it can built to run on a single processor (serial)
|
||||
without MPI. It can also be built with support for OpenMP threading
|
||||
(see more discussion below).
|
||||
LAMMPS is written to use the ubiquitous `MPI (Message Passing Interface)
|
||||
<https://en.wikipedia.org/wiki/Message_Passing_Interface>`_ library API
|
||||
for distributed memory parallel computation. You need to have such a
|
||||
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_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
|
||||
# no default value
|
||||
|
||||
The executable created by CMake (after running make) is lmp\_name. If
|
||||
the LAMMPS\_MACHINE variable is not specified, the executable is just
|
||||
lmp. Using BUILD\_MPI=no will produce a serial executable.
|
||||
The executable created by CMake (after running make) is named ``lmp`` unless
|
||||
the LAMMPS_MACHINE option is set. When setting ``LAMMPS_MACHINE=name``
|
||||
the executable will be called ``lmp_name``. Using ``BUILD_MPI=no`` will
|
||||
enforce building a serial executable using the MPI STUBS library.
|
||||
|
||||
**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 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.
|
||||
|
||||
For the serial build the following make variables are set (see src/MAKE/Makefile.serial):
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: make
|
||||
|
||||
CC = g++
|
||||
LINK = g++
|
||||
MPI_INC = -I../STUBS
|
||||
MPI_PATH = -L../STUBS
|
||||
MPI_LIB = -lmpi_stubs
|
||||
|
||||
For a parallel build, if MPI is installed on your system in the usual
|
||||
place (e.g. under /usr/local), you do not need to specify the 3
|
||||
variables MPI\_INC, MPI\_PATH, MPI\_LIB. The MPI wrapper on the compiler
|
||||
(e.g. mpicxx, mpiCC) knows where to find the needed include and
|
||||
library files. Failing this, these 3 variables can be used to specify
|
||||
where the mpi.h file (MPI\_INC), and the MPI library files (MPI\_PATH)
|
||||
are found, and the name of the library files (MPI\_LIB).
|
||||
You also need to build the STUBS library for your platform before making
|
||||
LAMMPS itself. A ``make serial`` build does this for you automatically,
|
||||
otherwise, type ``make mpi-stubs`` from the src directory, or ``make`` from
|
||||
the src/STUBS dir. If the build fails, you will need to edit the
|
||||
STUBS/Makefile for your platform. The stubs library does not provide
|
||||
MPI/IO functions required by some LAMMPS packages, e.g. MPIIO or USER-LB,
|
||||
and thus is not compatible with those packages.
|
||||
|
||||
For a serial build, you need to specify the 3 variables, as shown
|
||||
above.
|
||||
.. note::
|
||||
|
||||
For a serial LAMMPS build, use the dummy MPI library provided in
|
||||
src/STUBS. You also need to build the STUBS library for your platform
|
||||
before making LAMMPS itself. A "make serial" build does this for.
|
||||
Otherwise, type "make mpi-stubs" from the src directory, or "make"
|
||||
from the src/STUBS dir. If the build fails, you will need to edit the
|
||||
STUBS/Makefile for your platform.
|
||||
The file ``src/STUBS/mpi.c`` provides a CPU timer function called
|
||||
MPI_Wtime() that calls gettimeofday() . If your operating system
|
||||
does not support gettimeofday() , you will 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.
|
||||
|
||||
The file STUBS/mpi.c provides a CPU timer function called MPI\_Wtime()
|
||||
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.
|
||||
**MPI and OpenMP support info**\ :
|
||||
|
||||
**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
|
||||
National Laboratory or OpenMPI. MPICH can be downloaded from the
|
||||
`Argonne MPI site <http://www.mcs.anl.gov/research/projects/mpich2/>`_.
|
||||
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
|
||||
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 includes OpenMP threading (it is
|
||||
compatible with USER-OMP) and adds vectorization support when compiled
|
||||
with the Intel compilers on top of that. Also, the KOKKOS package can
|
||||
be compiled for using OpenMP threading.
|
||||
with compatible compilers, in particular the Intel compilers on top of
|
||||
OpenMP. Also, the KOKKOS package can be compiled to include OpenMP
|
||||
threading.
|
||||
|
||||
However, there are a few commands in LAMMPS that have native OpenMP
|
||||
support. These are commands in the MPIIO, SNAP, USER-DIFFRACTION, and
|
||||
USER-DPD packages. In addition some packages support OpenMP threading
|
||||
indirectly through the libraries they interface to: e.g. LATTE and
|
||||
USER-COLVARS. See the :doc:`Packages details <Packages_details>` doc
|
||||
page for more info on these packages and the doc pages for their
|
||||
respective commands for OpenMP threading info.
|
||||
In addition, there are a few commands in LAMMPS that have native OpenMP
|
||||
support included as well. These are commands in the MPIIO, SNAP,
|
||||
USER-DIFFRACTION, and USER-DPD packages. In addition some packages
|
||||
support OpenMP threading indirectly through the libraries they interface
|
||||
to: e.g. LATTE and USER-COLVARS. See the :doc:`Packages details
|
||||
<Packages_details>` doc page for more info on these packages and the doc
|
||||
pages for their respective commands for OpenMP threading info.
|
||||
|
||||
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
|
||||
support at run time, by setting the OMP\_NUM\_THREADS environment
|
||||
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
|
||||
support at run time, by setting the ``OMP_NUM_THREADS`` environment
|
||||
variable before you launch LAMMPS.
|
||||
|
||||
For building via conventional make, the CCFLAGS and LINKFLAGS
|
||||
For building via conventional make, the ``CCFLAGS`` and ``LINKFLAGS``
|
||||
variables in Makefile.machine need to include the compiler flag that
|
||||
enables OpenMP. For GNU compilers it is -fopenmp. For (recent) Intel
|
||||
compilers it is -qopenmp. If you are using a different compiler,
|
||||
enables OpenMP. For GNU compilers it is ``-fopenmp``\ . For (recent) Intel
|
||||
compilers it is ``-qopenmp``\ . If you are using a different compiler,
|
||||
please refer to its documentation.
|
||||
|
||||
.. _default-none-issues:
|
||||
|
||||
**OpenMP Compiler compatibility info**\ :
|
||||
**OpenMP Compiler compatibility info**\ :
|
||||
|
||||
Some compilers do not fully support the 'default(none)' directive
|
||||
Some compilers do not fully support the ``default(none)`` directive
|
||||
and others (e.g. GCC version 9 and beyond) may implement OpenMP 4.0
|
||||
semantics, which are incompatible with the OpenMP 3.1 directives used
|
||||
semantics, which are incompatible with the OpenMP 3.1 semantics used
|
||||
in LAMMPS (for maximal compatibility with compiler versions in use).
|
||||
In those case, all 'default(none)' directives (which aid in detecting
|
||||
incorrect and unwanted sharing) can be replaced with 'default(shared)'
|
||||
while dropping all 'shared()' directives. The script
|
||||
'src/USER-OMP/hack\_openmp\_for\_pgi\_gcc9.sh' can be used to automate
|
||||
In those case, all ``default(none)`` directives (which aid in detecting
|
||||
incorrect and unwanted sharing) can be replaced with ``default(shared)``
|
||||
while dropping all ``shared()`` directives. The script
|
||||
'src/USER-OMP/hack_openmp_for_pgi_gcc9.sh' can be used to automate
|
||||
this conversion.
|
||||
|
||||
|
||||
----------
|
||||
|
||||
|
||||
.. _compile:
|
||||
|
||||
Choice of compiler and compile/link options
|
||||
---------------------------------------------------------
|
||||
|
||||
The choice of compiler and compiler flags can be important for
|
||||
performance. Vendor compilers can produce faster code than
|
||||
open-source compilers like GNU. On boxes with Intel CPUs, we suggest
|
||||
trying the `Intel C++ compiler <intel_>`_.
|
||||
performance. Vendor provided compilers for a specific hardware can
|
||||
produce faster code than open-source compilers like the GNU compilers.
|
||||
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
|
||||
|
||||
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
|
||||
compile/link environments, you can often access different compilers by
|
||||
simply loading the appropriate module before building LAMMPS.
|
||||
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.
|
||||
|
||||
**CMake variables**\ :
|
||||
You can tell CMake to look for a specific compiler with these variable
|
||||
settings. Likewise you can specify the corresponding ``CMAKE_*_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:
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
-D CMAKE_CXX_COMPILER=name # name of C++ compiler
|
||||
-D CMAKE_C_COMPILER=name # name of C compiler
|
||||
|
@ -168,42 +199,49 @@ simply loading the appropriate module before building LAMMPS.
|
|||
-D CMAKE_C_FLAGS=string # flags to use with C 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.
|
||||
A few example command lines are:
|
||||
|
||||
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::
|
||||
|
||||
Building with GNU Compilers:
|
||||
# Building with GNU Compilers:
|
||||
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
|
||||
Building with LLVM/Clang Compilers:
|
||||
# Building with LLVM/Clang Compilers:
|
||||
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`.
|
||||
|
||||
In addition you can set ``CMAKE_TUNE_FLAGS`` to specifically add compiler
|
||||
flags to tune for optimal performance on given hosts. By default these are
|
||||
initialized to some compiler specific flags, where known, to optimize the
|
||||
LAMMPS executable with optimizations and instructions available on the host
|
||||
where LAMMPS is compiled. For example, for Intel compilers this would be
|
||||
``-xHost`` and for GNU compilers this would be ``-march=native``. To turn
|
||||
these flags off, set ``-D CMAKE_TUNE_FLAGS=``.
|
||||
|
||||
.. note::
|
||||
|
||||
When the cmake command completes, it prints info to the screen
|
||||
as to which compilers it is using, and what flags will be used in the
|
||||
compilation. Note that if the top-level compiler is mpicxx, it is
|
||||
simply a wrapper on a real compiler. The underlying compiler info is
|
||||
what will be listed in the CMake output. You should check to insure
|
||||
you are using the compiler and optimization flags are the ones you
|
||||
want.
|
||||
When the cmake command completes, it prints a summary to the screen
|
||||
which compilers it is using and what flags and settings will be used
|
||||
for the compilation. Note that if the top-level compiler is mpicxx,
|
||||
it is simply a wrapper on a real compiler. The underlying compiler
|
||||
info is what CMake will try to determine and report. You should check
|
||||
to confirm you are using the compiler and optimization flags you 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):
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
CC = mpicxx
|
||||
CCFLAGS = -g -O3
|
||||
|
@ -212,33 +250,26 @@ Parallel build (see src/MAKE/Makefile.mpi):
|
|||
|
||||
Serial build (see src/MAKE/Makefile.serial):
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: make
|
||||
|
||||
CC = g++
|
||||
CCFLAGS = -g -O3
|
||||
LINK = g++
|
||||
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::
|
||||
|
||||
If you build LAMMPS with any :doc:`accelerator packages <Speed_packages>` included, they have specific
|
||||
optimization flags that are either required or recommended for optimal
|
||||
performance. You need to include these in the CCFLAGS and LINKFLAGS
|
||||
settings above. For details, see the individual package doc pages
|
||||
listed on the :doc:`Speed packages <Speed_packages>` doc page. Or
|
||||
examine these files in the src/MAKE/OPTIONS directory. They
|
||||
correspond to each of the 5 accelerator packages and their hardware
|
||||
variants:
|
||||
If you build LAMMPS with any :doc:`accelerator packages <Speed_packages>`
|
||||
included, there may be specific optimization flags that are either
|
||||
required or recommended to enable required features and to achieve
|
||||
optimal performance. You need to include these in the CCFLAGS and
|
||||
LINKFLAGS settings above. For details, see the individual package
|
||||
doc pages listed on the :doc:`Speed packages <Speed_packages>` doc
|
||||
page. Or examine these files in the src/MAKE/OPTIONS directory.
|
||||
They correspond to each of the 5 accelerator packages and their
|
||||
hardware variants:
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
Makefile.opt # OPT package
|
||||
Makefile.omp # USER-OMP package
|
||||
|
@ -249,10 +280,8 @@ a variety of settings appropriate for your MPI installation.
|
|||
Makefile.kokkos_omp # KOKKOS package for CPUs (OpenMP)
|
||||
Makefile.kokkos_phi # KOKKOS package for KNLs (OpenMP)
|
||||
|
||||
|
||||
----------
|
||||
|
||||
|
||||
.. _exe:
|
||||
|
||||
Build LAMMPS as an executable or a library
|
||||
|
@ -265,10 +294,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
|
||||
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_LIB=value # yes or no (default)
|
||||
|
@ -276,25 +308,32 @@ running LAMMPS from Python via its library interface.
|
|||
-D LAMMPS_LIB_SUFFIX=name # name = mpi, serial, mybox, titan, laptop, etc
|
||||
# no default value
|
||||
|
||||
Setting BUILD\_EXE=no will not produce an executable. Setting
|
||||
BUILD\_LIB=yes will produce a static library named liblammps.a.
|
||||
Setting both BUILD\_LIB=yes and BUILD\_SHARED\_LIBS=yes will produce a
|
||||
shared library named liblammps.so. If LAMMPS\_LIB\_SUFFIX is set the generated
|
||||
libraries will be named liblammps\_name.a or liblammps\_name.so instead.
|
||||
Setting ``BUILD_EXE=no`` will not produce an executable. Setting
|
||||
``BUILD_LIB=yes`` will produce a static library named ``liblammps.a``\ .
|
||||
Setting both ``BUILD_LIB=yes`` and ``BUILD_SHARED_LIBS=yes`` will produce a
|
||||
shared library named ``liblammps.so`` instead. If ``LAMMPS_LIB_SUFFIX=name``
|
||||
is set in addition, the name of the generated libraries will be changed to
|
||||
either ``liblammps_name.a`` or ``liblammps_name.so``\ , respectively.
|
||||
|
||||
**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 mode=exe machine # same as "make machine"
|
||||
make mode=lib machine # build LAMMPS static lib liblammps_machine.a
|
||||
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
|
||||
liblammps.a and liblammps.so, which point to the liblammps\_machine
|
||||
files.
|
||||
The two "exe" builds will generate and executable ``lmp_machine``\ ,
|
||||
while the two library builds will create a file ``liblammps_machine.a``
|
||||
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**\ :
|
||||
|
||||
|
@ -302,76 +341,100 @@ 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
|
||||
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
|
||||
the lib/packages directory, since they are always built as shared
|
||||
libraries using the -fPIC switch. However, if a library like MPI or
|
||||
FFTW does not exist as a shared library, the shared library build will
|
||||
generate an error. This means you will need to install a shared
|
||||
library version of the auxiliary library. The build instructions for
|
||||
the library should tell you how to do this.
|
||||
the lib/packages directory, since they are always built in a shared
|
||||
library compatible way using the ``-fPIC`` switch. However, if a library
|
||||
like MPI or FFTW does not exist as a shared library, the shared library
|
||||
build may generate an error. This means you will need to install a
|
||||
shared library version of the auxiliary library. The build instructions
|
||||
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:
|
||||
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: http://www-unix.mcs.anl.gov/mpi
|
||||
.. _mpich: https://www.mpich.org
|
||||
|
||||
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
./configure --enable-shared
|
||||
make
|
||||
make install
|
||||
|
||||
You may need to use "sudo make install" in place of the last line if
|
||||
you do not have write privileges for /usr/local/lib. The end result
|
||||
should be the file /usr/local/lib/libmpich.so.
|
||||
You may need to use ``sudo make install`` in place of the last line if you
|
||||
do not have write privileges for ``/usr/local/lib``. The end result should
|
||||
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.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
.. _doc:
|
||||
|
||||
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
|
||||
|
||||
.. parsed-literal::
|
||||
**Documentation make option**\ :
|
||||
|
||||
-D BUILD_DOC=value # yes or no (default)
|
||||
The following make commands can be issued in the doc folder of the
|
||||
LAMMPS source distribution.
|
||||
|
||||
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.
|
||||
.. code-block:: bash
|
||||
|
||||
**Traditional make**\ :
|
||||
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::
|
||||
|
||||
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.
|
||||
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
|
||||
your system.
|
||||
|
||||
.. note::
|
||||
|
||||
You can also download a tarball of the documentation for the
|
||||
current LAMMPS version (HTML and PDF files), from the website
|
||||
`download page <http://lammps.sandia.gov/download.html>`_.
|
||||
`download page <https://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)
|
||||
|
||||
----------
|
||||
|
||||
|
||||
.. _tools:
|
||||
|
||||
Build LAMMPS tools
|
||||
|
@ -380,19 +443,18 @@ Build LAMMPS tools
|
|||
Some tools described in :doc:`Auxiliary tools <Tools>` can be built directly
|
||||
using CMake or Make.
|
||||
|
||||
**CMake variable**\ :
|
||||
**CMake build3**\ :
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
-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**\ :
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
cd lammps/tools
|
||||
make all # build all binaries of tools
|
||||
|
@ -401,10 +463,8 @@ The generated binaries will also become part of the LAMMPS installation (see bel
|
|||
make micelle2d # build only micelle2d tool
|
||||
make thermo_extract # build only thermo_extract tool
|
||||
|
||||
|
||||
----------
|
||||
|
||||
|
||||
.. _install:
|
||||
|
||||
Install LAMMPS after a build
|
||||
|
@ -416,10 +476,9 @@ 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
|
||||
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
|
||||
make # perform make after CMake command
|
||||
|
@ -427,11 +486,6 @@ you want to copy files to is protected.
|
|||
|
||||
**Traditional make**\ :
|
||||
|
||||
There is no "install" option in the src/Makefile for LAMMPS. If you
|
||||
wish to do this you will need to first build LAMMPS, then manually
|
||||
There is no "install" option in the ``src/Makefile`` for LAMMPS. If
|
||||
you wish to do this you will need to first build LAMMPS, then manually
|
||||
copy the desired LAMMPS files to the appropriate system directories.
|
||||
|
||||
|
||||
.. _lws: http://lammps.sandia.gov
|
||||
.. _ld: Manual.html
|
||||
.. _lc: Commands_all.html
|
||||
|
|
|
@ -9,68 +9,67 @@ Richard Berger (Temple U) has also written a `more comprehensive guide <https://
|
|||
for how to use CMake to build LAMMPS. If you are new to CMake it is a
|
||||
good place to start.
|
||||
|
||||
|
||||
----------
|
||||
|
||||
|
||||
Building LAMMPS with CMake is a two-step process. First you use CMake
|
||||
to create a build environment in a new directory. On Linux systems,
|
||||
this will be based on makefiles for use with make. Then you use the
|
||||
make command to build LAMMPS, which uses the created
|
||||
this will be by default based on Unix-style makefiles for use with make.
|
||||
Then you use the *make* command to build LAMMPS, which uses the created
|
||||
Makefile(s). Example:
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
cd lammps # change to the LAMMPS distribution directory
|
||||
mkdir build; cd build # create a new directory (folder) for build
|
||||
cmake [options ...] ../cmake # configuration with (command-line) cmake
|
||||
make # compilation
|
||||
cmake --build . # compilation (or type "make")
|
||||
|
||||
The cmake command will detect available features, enable selected
|
||||
The ``cmake`` command will detect available features, enable selected
|
||||
packages and options, and will generate the build environment. By default
|
||||
this build environment will be created for "Unix Makefiles" on most
|
||||
platforms and particularly on Linux. However, alternate build tools
|
||||
(e.g. Ninja) and support files for Integrated Development Environments
|
||||
(IDE) like Eclipse, CodeBlocks, or Kate can be generated, too. This is
|
||||
selected via the "-G" command line flag. For the rest of the documentation
|
||||
we will assume that the build environment is generated for makefiles
|
||||
and thus the make command will be used to compile and link LAMMPS as
|
||||
indicated above, producing (by default) an executable called "lmp" and
|
||||
a library called "liblammps.a" in the "build" folder. When generating
|
||||
a build environment for the "Ninja" build tool, the build command would
|
||||
be "ninja" instead of "make".
|
||||
(e.g. Ninja) and project files for Integrated Development Environments
|
||||
(IDEs) like Eclipse, CodeBlocks, or Kate can be generated, too. This is
|
||||
selected via the ``-G`` command line flag. Further details about features
|
||||
and settings for CMake are in the `CMake online documentation <cmake_doc_>`_
|
||||
|
||||
If your machine has multiple CPU cores (most do these days), using a
|
||||
command like "make -jN" (with N being the number of available local
|
||||
CPU cores) can be much faster. If you plan to do development on
|
||||
LAMMPS or need to re-compile LAMMPS repeatedly, installation of the
|
||||
ccache (= Compiler Cache) software may speed up repeated compilation
|
||||
even more.
|
||||
.. _cmake_doc: https://cmake.org/documentation/
|
||||
|
||||
For the rest of the documentation
|
||||
we will assume that the build environment is generated for "Unix Makefiles"
|
||||
and thus the ``make`` command will be used to compile and link LAMMPS as
|
||||
indicated above, producing (by default) an executable called ``lmp`` and
|
||||
a library called ``liblammps.a`` in the ``build`` folder.
|
||||
|
||||
If your machine has multiple CPU cores (most do these days), you can
|
||||
compile sources in parallel with a command like ``make -j N`` (with N
|
||||
being the maximum number of concurrently executed tasks). Also
|
||||
installation of the ``ccache`` (= Compiler Cache) software may speed
|
||||
up repeated compilation, e.g. during code development, significantly.
|
||||
|
||||
After compilation, you may optionally install the LAMMPS executable into
|
||||
your system with:
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
make install # optional, copy LAMMPS executable & library elsewhere
|
||||
|
||||
This will install the lammps executable and library (if requested), some
|
||||
tools (if configured) and additional files like library API headers,
|
||||
manpages, potential and force field files. The location of the installation
|
||||
tree is set by the CMake variable "CMAKE\_INSTALL\_PREFIX" which defaults
|
||||
tree is set by the CMake variable "CMAKE_INSTALL_PREFIX" which defaults
|
||||
to ${HOME}/.local
|
||||
|
||||
|
||||
----------
|
||||
|
||||
.. _cmake_build:
|
||||
|
||||
There are 3 variants of CMake: a command-line version (cmake), a text mode
|
||||
UI version (ccmake), and a graphical GUI version (cmake-GUI). You can use
|
||||
any of them interchangeably to configure and create the LAMMPS build
|
||||
environment. On Linux all the versions produce a Makefile as their
|
||||
output. See more details on each below.
|
||||
There are 3 variants of the CMake command itself: a command-line version
|
||||
(``cmake`` or ``cmake3``), a text mode UI version (``ccmake`` or ``ccmake3``),
|
||||
and a graphical GUI version (``cmake-gui``). You can use any of them
|
||||
interchangeably to configure and create the LAMMPS build environment.
|
||||
On Linux all the versions produce a Makefile as their output by default.
|
||||
See more details on each below.
|
||||
|
||||
You can specify a variety of options with any of the 3 versions, which
|
||||
affect how the build is performed and what is included in the LAMMPS
|
||||
|
@ -80,7 +79,7 @@ the :doc:`Build <Build>` doc page.
|
|||
You must perform the CMake build system generation and compilation in
|
||||
a new directory you create. It can be anywhere on your local machine.
|
||||
In these Build pages we assume that you are building in a directory
|
||||
called "lammps/build". You can perform separate builds independently
|
||||
called ``lammps/build``. You can perform separate builds independently
|
||||
with different options, so long as you perform each of them in a
|
||||
separate directory you create. All the auxiliary files created by one
|
||||
build process (executable, object files, log files, etc) are stored in
|
||||
|
@ -88,17 +87,16 @@ this directory or sub-directories within it that CMake creates.
|
|||
|
||||
.. note::
|
||||
|
||||
To perform a CMake build, no packages can be installed or a
|
||||
build been previously attempted in the LAMMPS src directory by using
|
||||
"make" commands to :doc:`perform a conventional LAMMPS build <Build_make>`. CMake detects if this is the case and
|
||||
generates an error, telling you to type "make no-all purge" in the src
|
||||
directory to un-install all packages. The purge removes all the \*.h
|
||||
files auto-generated by make.
|
||||
To perform a CMake build, no packages can be installed or a build
|
||||
been previously attempted in the LAMMPS src directory by using ``make``
|
||||
commands to :doc:`perform a conventional LAMMPS build <Build_make>`.
|
||||
CMake detects if this is the case and generates an error, telling you
|
||||
to type ``make no-all purge`` in the src directory to un-install all
|
||||
packages. The purge removes all the \*.h files auto-generated by
|
||||
make.
|
||||
|
||||
You must have CMake version 2.8 or later on your system to build
|
||||
LAMMPS. A handful of LAMMPS packages (KOKKOS, LATTE, MSCG) require a
|
||||
later version. CMake will print a message telling you if a later
|
||||
version is required. Installation instructions for CMake are below.
|
||||
You must have CMake version 3.10 or later on your system to build
|
||||
LAMMPS. Installation instructions for CMake are below.
|
||||
|
||||
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
|
||||
|
@ -108,30 +106,28 @@ ccmake or cmake-gui) again from the same build directory and alter
|
|||
various options; see details below. Or you can remove the entire build
|
||||
folder, recreate the directory and start over.
|
||||
|
||||
|
||||
----------
|
||||
|
||||
|
||||
**Command-line version of CMake**\ :
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
cmake [options ...] /path/to/lammps/cmake # build from any dir
|
||||
cmake [options ...] ../cmake # build from lammps/build
|
||||
cmake [options ...] /path/to/lammps/cmake # build from any dir
|
||||
cmake [options ...] ../cmake # build from lammps/build
|
||||
cmake3 [options ...] ../cmake # build from lammps/build
|
||||
|
||||
The cmake command takes one required argument, which is the LAMMPS
|
||||
cmake directory which contains the CMakeLists.txt file.
|
||||
|
||||
The argument can be preceeded or followed by various CMake
|
||||
The argument can be prefixed or followed by various CMake
|
||||
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_BUILD_TYPE=type # type = RelWithDebInfo (default), Release, MinSizeRel, or Debug
|
||||
-G output # style of output CMake generates
|
||||
-G output # style of output CMake generates (e.g. "Unix Makefiles" or "Ninja")
|
||||
-D CMAKE_MAKE_PROGRAM=builder # name of the builder executable (e.g. when using "gmake" instead of "make")
|
||||
-DVARIABLE=value # setting for a LAMMPS feature to enable
|
||||
-D VARIABLE=value # ditto, but cannot come after CMakeLists.txt dir
|
||||
-C path/to/preset/file # load some CMake settings before configuring
|
||||
|
@ -139,13 +135,13 @@ command-line options. Several useful ones are:
|
|||
All the LAMMPS-specific -D variables that a LAMMPS build supports are
|
||||
described on the pages linked to from the :doc:`Build <Build>` doc page.
|
||||
All of these variable names are upper-case and their values are
|
||||
lower-case, e.g. -D LAMMPS\_SIZES=smallbig. For boolean values, any of
|
||||
lower-case, e.g. -D LAMMPS_SIZES=smallbig. For boolean values, any of
|
||||
these forms can be used: yes/no, on/off, 1/0.
|
||||
|
||||
On Unix/Linux machines, CMake generates a Makefile by default to
|
||||
perform the LAMMPS build. Alternate forms of build info can be
|
||||
generated via the -G switch, e.g. Visual Studio on a Windows machine,
|
||||
Xcode on MacOS, or KDevelop on Linux. Type "cmake --help" to see the
|
||||
Xcode on MacOS, or KDevelop on Linux. Type ``cmake --help`` to see the
|
||||
"Generator" styles of output your system supports.
|
||||
|
||||
.. note::
|
||||
|
@ -170,14 +166,11 @@ In these cases it is usually better to first remove all the
|
|||
files/directories in the build directory, or start with a fresh build
|
||||
directory.
|
||||
|
||||
|
||||
----------
|
||||
|
||||
|
||||
**Curses version (terminal-style menu) of CMake**\ :
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
ccmake ../cmake
|
||||
|
||||
|
@ -188,14 +181,11 @@ required to edit some of the entries of CMake configuration variables
|
|||
in between. Please see the `ccmake manual <https://cmake.org/cmake/help/latest/manual/ccmake.1.html>`_ for
|
||||
more information.
|
||||
|
||||
|
||||
----------
|
||||
|
||||
|
||||
**GUI version of CMake**\ :
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
cmake-gui ../cmake
|
||||
|
||||
|
@ -207,16 +197,13 @@ edit some of the entries of CMake configuration variables in between.
|
|||
Please see the `cmake-gui manual <https://cmake.org/cmake/help/latest/manual/cmake-gui.1.html>`_
|
||||
for more information.
|
||||
|
||||
|
||||
----------
|
||||
|
||||
|
||||
**Installing CMake**
|
||||
|
||||
Check if your machine already has CMake installed:
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
which cmake # do you have it?
|
||||
which cmake3 # version 3 may have this name
|
||||
|
@ -225,11 +212,10 @@ Check if your machine already has CMake installed:
|
|||
On clusters or supercomputers which use environment modules to manage
|
||||
software packages, do this:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
module list # is a cmake module already loaded?
|
||||
module avail # is a cmake module available?
|
||||
module list # is a module for cmake already loaded?
|
||||
module avail # is a module for cmake available?
|
||||
module load cmake3 # load cmake module with appropriate name
|
||||
|
||||
Most Linux distributions offer pre-compiled cmake packages through
|
||||
|
@ -238,8 +224,3 @@ enough version, you can download the latest version at
|
|||
`https://cmake.org/download/ <https://cmake.org/download/>`_.
|
||||
Instructions on how to install it on various platforms can be found
|
||||
`on this page <https://cmake.org/install/>`_.
|
||||
|
||||
|
||||
.. _lws: http://lammps.sandia.gov
|
||||
.. _ld: Manual.html
|
||||
.. _lc: Commands_all.html
|
||||
|
|
|
@ -2,12 +2,10 @@ Development build options (CMake only)
|
|||
======================================
|
||||
|
||||
The CMake build of LAMMPS has a few extra options which are useful during
|
||||
development, testing or debugging.
|
||||
|
||||
development, testing or debugging.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
.. _compilation:
|
||||
|
||||
Verify compilation flags
|
||||
|
@ -17,47 +15,47 @@ Sometimes it is necessary to verify the complete sequence of compilation flags
|
|||
generated by the CMake build. To enable a more verbose output during
|
||||
compilation you can use the following option.
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
-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:
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
make VERBOSE=1
|
||||
|
||||
|
||||
----------
|
||||
|
||||
|
||||
.. _sanitizer:
|
||||
|
||||
Address, Undefined Behavior, and Thread Sanitizer Support
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
Compilers such as GCC and Clang support generating binaries which use different
|
||||
sanitizers to detect problems in code during run-time. They can detect `memory leaks <https://clang.llvm.org/docs/AddressSanitizer.html>`_,
|
||||
code that runs into `undefined behavior <https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html>`_ of the
|
||||
language and `data races <https://clang.llvm.org/docs/ThreadSanitizer.html>`_ in threaded code.
|
||||
Compilers such as GCC and Clang support generating instrumented binaries
|
||||
which use different sanitizer libraries to detect problems in code
|
||||
during run-time. They can detect issues like:
|
||||
|
||||
The following settings allow you enable these features if your compiler supports
|
||||
it. Please note that they come with a performance hit. However, they are
|
||||
usually faster than using tools like Valgrind.
|
||||
- `memory leaks <https://clang.llvm.org/docs/AddressSanitizer.html>`_
|
||||
- `undefined behavior <https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html>`_
|
||||
- `data races <https://clang.llvm.org/docs/ThreadSanitizer.html>`_
|
||||
|
||||
Please note that this kind of instrumentation usually comes with a small
|
||||
performance hit (much less than using tools like `Valgrind <valgrind_>`_).
|
||||
The to enable these features additional compiler flags need to be added
|
||||
to the compilation and linking stages. This is most easily done through
|
||||
setting the ``CMAKE_TUNE_FLAGS`` variable during configuration. Examples:
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
-D ENABLE_SANITIZE_ADDRESS=value # enable Address Sanitizer, value = no (default) or yes
|
||||
-D ENABLE_SANITIZE_UNDEFINED=value # enable Undefined Behaviour Sanitizer, value = no (default) or yes
|
||||
-D ENABLE_SANITIZE_THREAD=value # enable Thread Sanitizer, value = no (default) or yes
|
||||
-D CMAKE_TUNE_FLAGS=-fsanitize=address # enable address sanitizer / memory leak checker
|
||||
-D CMAKE_TUNE_FLAGS=-fsanitize=undefined # enable undefined behavior sanitizer
|
||||
-D CMAKE_TUNE_FLAGS=-fsanitize=thread # enable thread sanitizer
|
||||
|
||||
.. _valgrind: https://valgrind.org
|
||||
|
||||
----------
|
||||
|
||||
|
||||
.. _testing:
|
||||
|
||||
Code Coverage and Testing
|
||||
|
@ -71,8 +69,7 @@ developers can run the tests directly on their workstation.
|
|||
|
||||
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 LAMMPS_TESTING_SOURCE_DIR=path # path to lammps-testing repository (option if in custom location)
|
||||
|
@ -80,8 +77,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:
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
make test
|
||||
|
||||
|
@ -92,15 +88,13 @@ faster.
|
|||
You can also collect code coverage metrics while running the tests by enabling
|
||||
coverage support during building.
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
-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:
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
make test # run tests first!
|
||||
make gen_coverage_html # generate coverage report in HTML format
|
||||
|
@ -108,13 +102,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:
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
pip install git+https://github.com/gcovr/gcovr.git
|
||||
|
||||
|
||||
|
||||
.. _lws: http://lammps.sandia.gov
|
||||
.. _ld: Manual.html
|
||||
.. _lc: Commands_all.html
|
||||
|
|
|
@ -3,89 +3,248 @@ Link LAMMPS as a library to another code
|
|||
|
||||
LAMMPS can be used as a library by another application, including
|
||||
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
|
||||
interface and how to extend it for your needs.
|
||||
C-style API for using LAMMPS as a library. See the :doc:`Howto
|
||||
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
|
||||
LAMMPS as either a shared or static library. This results in one of
|
||||
these 2 files:
|
||||
|
||||
liblammps.so # shared library
|
||||
liblammps.a # static library
|
||||
.. code-block:: bash
|
||||
|
||||
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**\ :
|
||||
|
||||
The calling application can link to LAMMPS as a static library with a
|
||||
link command like this:
|
||||
The calling application can link to LAMMPS as a static library with
|
||||
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
|
||||
-llammps argument is shorthand for the file liblammps.a.
|
||||
This assumes that LAMMPS has been configured with "-D BUILD_LIB=yes"
|
||||
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**\ :
|
||||
|
||||
If you wish to link to liblammps.so, the operating system finds shared
|
||||
libraries to load at run-time using the environment variable
|
||||
LD\_LIBRARY\_PATH. To enable this you can do one of two things:
|
||||
When linking to LAMMPS built as a shared library, the situation
|
||||
becomes much simpler, as all dependent libraries and objects are
|
||||
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,
|
||||
such as /usr/local/lib. I.e. a directory already listed in your
|
||||
LD\_LIBRARY\_PATH variable. You can type
|
||||
*CMake build*\ :
|
||||
|
||||
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
|
||||
|
||||
to see what directories are in that list.
|
||||
|
||||
(2) Add the LAMMPS src directory (or the directory you perform CMake
|
||||
build in) to your LD\_LIBRARY\_PATH, so that the current version of the
|
||||
shared library is always available to programs that use it.
|
||||
Or you can add the LAMMPS src directory (or the directory you performed
|
||||
a CMake style build in) to your LD_LIBRARY_PATH, so that the current
|
||||
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
|
||||
~/.cshrc file:
|
||||
For the Bourne or Korn shells (/bin/sh, /bin/ksh, /bin/bash etc.), you
|
||||
would add something like this to your ~/.profile file:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
.. parsed-literal::
|
||||
LD_LIBRARY_PATH ${LD_LIBRARY_PATH-/usr/lib64}:${HOME}/lammps/src
|
||||
export LD_LIBRARY_PATH
|
||||
|
||||
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/sjplimp/lammps/src
|
||||
For the csh or tcsh shells, you would equivalently add something like this
|
||||
to your ~/.cshrc file:
|
||||
|
||||
.. code-block:: csh
|
||||
|
||||
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)
|
||||
|
||||
----------
|
||||
|
||||
|
||||
**Calling the LAMMPS library**\ :
|
||||
|
||||
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
|
||||
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
|
||||
To be compatible with C, Fortran, Python programs, the library has a simple
|
||||
C-style interface, provided in src/library.cpp and src/library.h.
|
||||
|
||||
See the :doc:`Python library <Python_library>` doc page for a
|
||||
description of the Python interface to LAMMPS, which wraps the C-style
|
||||
interface.
|
||||
interface from a shared library through the `ctypes python module <ctypes_>`_.
|
||||
|
||||
See the sample codes in examples/COUPLE/simple for examples of C++ and
|
||||
C and Fortran codes that invoke LAMMPS through its library interface.
|
||||
Other examples in the COUPLE directory use coupling ideas discussed on
|
||||
the :doc:`Howto couple <Howto_couple>` doc page.
|
||||
|
||||
|
||||
.. _lws: http://lammps.sandia.gov
|
||||
.. _ld: Manual.html
|
||||
.. _lc: Commands_all.html
|
||||
.. _ctypes: https://docs.python.org/3/library/ctypes.html
|
||||
|
|
|
@ -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
|
||||
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
|
||||
must install them first, as discussed on the :doc:`Build package <Build_package>` doc page. If the packages require
|
||||
provided or external libraries, you must build those libraries before
|
||||
building LAMMPS. Building :doc:`LAMMPS with CMake <Build_cmake>` can
|
||||
automate all of this for many types of machines, especially
|
||||
workstations, desktops and laptops, so we suggest you try it first.
|
||||
must enable them first, as discussed on the :doc:`Build package
|
||||
<Build_package>` doc page. If a packages requires (provided or
|
||||
external) libraries, you must configure and build those libraries
|
||||
**before** building LAMMPS itself and especially **before** enabling
|
||||
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
|
||||
executable lmp\_serial or lmp\_mpi in lammps/src:
|
||||
The commands below perform a default LAMMPS build, producing the LAMMPS
|
||||
executable lmp_serial and lmp_mpi in lammps/src:
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
cd lammps/src
|
||||
make serial # build a serial LAMMPS executable
|
||||
|
@ -42,21 +57,23 @@ re-compiled.
|
|||
|
||||
.. note::
|
||||
|
||||
When you build LAMMPS for the first time, a long list of \*.d
|
||||
files will be printed out rapidly. This is not an error; it is the
|
||||
Makefile doing its normal creation of dependencies.
|
||||
|
||||
Before the actual compilation starts, LAMMPS will perform several
|
||||
steps to collect information from the configuration and setup that
|
||||
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
|
||||
in the LAMMPS distribution. Typing "make machine" uses
|
||||
*Makefile.machine*\ . Thus the "make serial" or "make mpi" lines above
|
||||
use Makefile.serial and Makefile.mpi, respectively. Other makefiles
|
||||
are in these directories:
|
||||
|
||||
The lammps/src/MAKE tree contains all the Makefile.machine files
|
||||
included in the LAMMPS distribution. Typing "make machine" uses
|
||||
Makefile.machine. Thus the "make serial" or "make mpi" lines above
|
||||
use Makefile.serial and Makefile.mpi. Others are in these dirs:
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
OPTIONS # Makefiles which enable specific options
|
||||
MACHINES # Makefiles for specific machines
|
||||
|
@ -64,7 +81,7 @@ use Makefile.serial and Makefile.mpi. Others are in these dirs:
|
|||
|
||||
Typing "make" lists all the available Makefile.machine files. A file
|
||||
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
|
||||
to a customized file you put in src/MAKE/MINE.
|
||||
|
||||
|
@ -75,8 +92,7 @@ customized machine Makefile are contributed by users. Since both
|
|||
compilers, OS configurations, and LAMMPS itself keep changing, their
|
||||
settings may become outdated:
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
make mac # build serial LAMMPS on a Mac
|
||||
make mac_mpi # build parallel LAMMPS on a Mac
|
||||
|
@ -87,8 +103,3 @@ settings may become outdated:
|
|||
make kokkos_omp # build with the KOKKOS package for OpenMP
|
||||
make kokkos_cuda_mpi # build with the KOKKOS package for GPUs
|
||||
make kokkos_phi # build with the KOKKOS package for KNLs
|
||||
|
||||
|
||||
.. _lws: http://lammps.sandia.gov
|
||||
.. _ld: Manual.html
|
||||
.. _lc: Commands_all.html
|
||||
|
|
|
@ -14,10 +14,13 @@ package. In general there is no need to include a package if you
|
|||
never plan to use its features.
|
||||
|
||||
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,
|
||||
and your build did not include that package. Running LAMMPS with the
|
||||
:doc:`-h command-line switch <Run_options>` will print all the included
|
||||
packages and commands for that executable.
|
||||
"unknown", it is often because the command is contained in a package,
|
||||
and your build did not include that package. If the command or style
|
||||
*is* available in a package included in the LAMMPS distribution,
|
||||
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
|
||||
include it, you can then build LAMMPS exactly the same as you would
|
||||
|
@ -42,17 +45,15 @@ packages:
|
|||
The mechanism for including packages is simple but different for CMake
|
||||
versus make.
|
||||
|
||||
**CMake variables**\ :
|
||||
**CMake build**\ :
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: csh
|
||||
|
||||
-D PKG_NAME=value # yes or no (default)
|
||||
|
||||
Examples:
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: csh
|
||||
|
||||
-D PKG_MANYBODY=yes
|
||||
-D PKG_USER-INTEL=yes
|
||||
|
@ -73,8 +74,7 @@ once with CMake.
|
|||
|
||||
**Traditional make**\ :
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
cd lammps/src
|
||||
make ps # check which packages are currently installed
|
||||
|
@ -84,8 +84,7 @@ once with CMake.
|
|||
|
||||
Examples:
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
make no-rigid
|
||||
make yes-user-intel
|
||||
|
@ -119,7 +118,7 @@ are already included. Likewise, if a package is excluded, other files
|
|||
dependent on that package are also excluded.
|
||||
|
||||
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.
|
||||
|
||||
.. note::
|
||||
|
@ -129,16 +128,15 @@ src directory.
|
|||
That is no longer the case, so that CMake will build as-is without the
|
||||
need to un-install those packages.
|
||||
|
||||
|
||||
----------
|
||||
|
||||
|
||||
**CMake shortcuts for installing many packages**\ :
|
||||
|
||||
Instead of specifying all the CMake options via the command-line,
|
||||
CMake allows initializing the variable cache using script files. These
|
||||
are regular CMake files which can manipulate and set variables, and
|
||||
can also contain control flow constructs.
|
||||
CMake allows initializing its settings cache using script files.
|
||||
These are regular CMake files which can manipulate and set CMake
|
||||
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
|
||||
"presets", similar to the options that exist for the Make based
|
||||
|
@ -146,33 +144,27 @@ system. Using these files you can enable/disable portions of the
|
|||
available packages in LAMMPS. If you need a custom preset you can take
|
||||
one of them as a starting point and customize it to your needs.
|
||||
|
||||
+-------------------------------------------------------------+-----------------------------------------------------------+
|
||||
| cmake -C ../cmake/presets/all\_on.cmake [OPTIONS] ../cmake | enable all packages |
|
||||
+-------------------------------------------------------------+-----------------------------------------------------------+
|
||||
| cmake -C ../cmake/presets/all\_off.cmake [OPTIONS] ../cmake | disable all packages |
|
||||
+-------------------------------------------------------------+-----------------------------------------------------------+
|
||||
| cmake -C ../cmake/presets/minimal.cmake [OPTIONS] ../cmake | enable just a few core packages |
|
||||
+-------------------------------------------------------------+-----------------------------------------------------------+
|
||||
| cmake -C ../cmake/presets/most.cmake [OPTIONS] ../cmake | enable most common packages |
|
||||
+-------------------------------------------------------------+-----------------------------------------------------------+
|
||||
| cmake -C ../cmake/presets/nolib.cmake [OPTIONS] ../cmake | disable packages that do require extra libraries or tools |
|
||||
+-------------------------------------------------------------+-----------------------------------------------------------+
|
||||
| cmake -C ../cmake/presets/clang.cmake [OPTIONS] ../cmake | change settings to use the Clang compilers by default |
|
||||
+-------------------------------------------------------------+-----------------------------------------------------------+
|
||||
| cmake -C ../cmake/presets/mingw.cmake [OPTIONS] ../cmake | enable all packages compatible with MinGW compilers |
|
||||
+-------------------------------------------------------------+-----------------------------------------------------------+
|
||||
.. code-block:: bash
|
||||
|
||||
cmake -C ../cmake/presets/minimal.cmake [OPTIONS] ../cmake # enable just a few core packages
|
||||
cmake -C ../cmake/presets/most.cmake [OPTIONS] ../cmake # enable most packages
|
||||
cmake -C ../cmake/presets/nolib.cmake [OPTIONS] ../cmake # disable packages that do require extra libraries or tools
|
||||
cmake -C ../cmake/presets/clang.cmake [OPTIONS] ../cmake # change settings to use the Clang compilers by default
|
||||
cmake -C ../cmake/presets/intel.cmake [OPTIONS] ../cmake # change settings to use the Intel compilers by default
|
||||
cmake -C ../cmake/presets/all_on.cmake [OPTIONS] ../cmake # enable all packages
|
||||
cmake -C ../cmake/presets/all_off.cmake [OPTIONS] ../cmake # disable all packages
|
||||
mingw64-cmake -C ../cmake/presets/mingw-cross.cmake [OPTIONS] ../cmake # compile with MinGW cross compilers
|
||||
|
||||
.. 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
|
||||
in a single cmake run, or change settings incrementally by running
|
||||
cmake with new flags.
|
||||
|
||||
**Example:**
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
# build LAMMPS with most commonly used packages, but then remove
|
||||
# those requiring additional library or tools, but still enable
|
||||
|
@ -188,49 +180,40 @@ one of them as a starting point and customize it to your needs.
|
|||
# but leaving all other settings untouched. You can run:
|
||||
cmake -C ../cmake/presets/no_all.cmake .
|
||||
|
||||
|
||||
----------
|
||||
|
||||
|
||||
**Make shortcuts for installing many packages**\ :
|
||||
|
||||
The following commands are useful for managing package source files
|
||||
and their installation when building LAMMPS via traditional make.
|
||||
Just type "make" in lammps/src to see a one-line summary.
|
||||
Just type ``make`` in lammps/src to see a one-line summary.
|
||||
|
||||
These commands install/un-install sets of packages:
|
||||
|
||||
+-----------------------------------+-----------------------------------------------------+
|
||||
| make yes-all | install all packages |
|
||||
+-----------------------------------+-----------------------------------------------------+
|
||||
| make no-all | un-install all packages |
|
||||
+-----------------------------------+-----------------------------------------------------+
|
||||
| make yes-standard or make yes-std | install standard packages |
|
||||
+-----------------------------------+-----------------------------------------------------+
|
||||
| make no-standard or make no-std | un-install standard packages |
|
||||
+-----------------------------------+-----------------------------------------------------+
|
||||
| make yes-user | install user packages |
|
||||
+-----------------------------------+-----------------------------------------------------+
|
||||
| make no-user | un-install user packages |
|
||||
+-----------------------------------+-----------------------------------------------------+
|
||||
| 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 |
|
||||
+-----------------------------------+-----------------------------------------------------+
|
||||
.. code-block:: bash
|
||||
|
||||
which install/un-install various sets of packages. Typing "make
|
||||
package" will list all the these commands.
|
||||
make yes-all # install all packages
|
||||
make no-all # uninstall all 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-user # uninstall user packages
|
||||
make yes-lib # install packages that require extra libraries
|
||||
make no-lib # uninstall packages that require extra libraries
|
||||
make yes-ext # install packages that require external libraries
|
||||
make no-ext # uninstall packages that require external libraries
|
||||
|
||||
which install/un-install various sets of packages. Typing ``make
|
||||
package`` will list all the these commands.
|
||||
|
||||
.. note::
|
||||
|
||||
Installing or un-installing a package works by simply copying
|
||||
files back and forth between the main src directory and
|
||||
sub-directories with the package name (e.g. src/KSPACE, src/USER-ATC),
|
||||
so that the files are included or excluded when LAMMPS is built.
|
||||
Installing or un-installing a package for the make based build process
|
||||
works by simply copying files back and forth between the main source
|
||||
directory src and the sub-directories with the package name (e.g.
|
||||
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
|
||||
src directory and in package sub-directories. You do not normally
|
||||
|
@ -238,28 +221,23 @@ need to use these commands unless you are editing LAMMPS files or are
|
|||
:doc:`installing a patch <Install_patch>` downloaded from the LAMMPS web
|
||||
site.
|
||||
|
||||
Type "make package-status" or "make ps" to show which packages are
|
||||
Type ``make package-status`` or ``make ps`` to show which packages are
|
||||
currently installed. For those that are installed, it will list any
|
||||
files that are different in the src directory and package
|
||||
sub-directory.
|
||||
|
||||
Type "make package-installed" or "make pi" to show which packages are
|
||||
Type ``make package-installed`` or ``make pi`` to show which packages are
|
||||
currently installed, without listing the status of packages that are
|
||||
not installed.
|
||||
|
||||
Type "make package-update" or "make pu" to overwrite src files with
|
||||
Type ``make package-update`` or ``make pu`` to overwrite src files with
|
||||
files from the package sub-directories if the package is installed.
|
||||
It should be used after a :doc:`patch has been applied <Install_patch>`,
|
||||
since patches only update the files in the package sub-directory, but
|
||||
not the src files.
|
||||
|
||||
Type "make package-overwrite" to overwrite files in the package
|
||||
Type ``make package-overwrite`` to overwrite files in the package
|
||||
sub-directories with src files.
|
||||
|
||||
Type "make package-diff" to list all differences between pairs of
|
||||
files in both the src dir and a package dir.
|
||||
|
||||
|
||||
.. _lws: http://lammps.sandia.gov
|
||||
.. _ld: Manual.html
|
||||
.. _lc: Commands_all.html
|
||||
Type ``make package-diff`` to list all differences between pairs of
|
||||
files in both the source directory and the package directory.
|
||||
|
|
|
@ -4,68 +4,35 @@ Optional build settings
|
|||
LAMMPS can be built with several optional settings. Each sub-section
|
||||
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:`FFT library <fft>` for use with the :doc:`kspace_style pppm <kspace_style>` command
|
||||
| :ref:`Size of LAMMPS data types <size>`
|
||||
| :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 movie files <graphics>` via the :doc:`dump_movie <dump_image>` command
|
||||
| :ref:`Memory allocation alignment <align>`
|
||||
| :ref:`Workaround for long long integers <longlong>`
|
||||
| :ref:`Error handling exceptions <exceptions>` when using LAMMPS as a library
|
||||
|
|
||||
|
||||
* :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:`Size of LAMMPS data types <size>`
|
||||
* :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 movie files <graphics>` via the :doc:`dump_movie <dump_image>` command
|
||||
* :ref:`Memory allocation alignment <align>`
|
||||
* :ref:`Workaround for long long integers <longlong>`
|
||||
* :ref:`Error handling exceptions <exceptions>` when using LAMMPS as a library
|
||||
|
||||
----------
|
||||
|
||||
|
||||
.. _cxx11:
|
||||
|
||||
C++11 standard compliance test
|
||||
C++11 standard compliance
|
||||
------------------------------------------
|
||||
|
||||
The LAMMPS developers plan to transition to make the C++11 standard the
|
||||
minimum requirement for compiling LAMMPS. Currently this only applies to
|
||||
some packages like KOKKOS while the rest aims to be compatible with the C++98
|
||||
standard. Most currently used compilers are compatible with C++11; some need
|
||||
to set extra flags to switch. To determine the impact of requiring C++11,
|
||||
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.
|
||||
A C++11 standard compatible compiler is a requirement for compiling LAMMPS.
|
||||
LAMMPS version 3 March 2020 is the last version compatible with the previous
|
||||
C++98 standard for the core code and most packages. Most currently used
|
||||
C++ compilers are compatible with C++11, but some older ones may need extra
|
||||
flags to enable C++11 compliance. Example for GNU c++ 4.8.x:
|
||||
|
||||
**CMake variable**\ :
|
||||
|
||||
|
||||
.. 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::
|
||||
.. code-block:: make
|
||||
|
||||
CCFLAGS = -g -O3 -std=c++11
|
||||
|
||||
----------
|
||||
|
||||
|
||||
.. _fft:
|
||||
|
||||
FFT library
|
||||
|
@ -79,8 +46,7 @@ LAMMPS can use them if they are available on your system.
|
|||
|
||||
**CMake variables**\ :
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
-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
|
||||
|
@ -99,42 +65,44 @@ OpenMP threads are enabled and a packages like KOKKOS or USER-OMP is
|
|||
used. If CMake cannot detect the FFT library, you can set these variables
|
||||
to assist:
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
-D FFTW3_INCLUDE_DIRS=path # path to FFTW3 include files
|
||||
-D FFTW3_LIBRARIES=path # path to FFTW3 libraries
|
||||
-D FFT_FFTW_THREADS=on # enable using threaded FFTW3 libraries
|
||||
-D MKL_INCLUDE_DIRS=path # ditto for Intel MKL library
|
||||
-D FFT_MKL_THREADS=on # enable using threaded FFTs with MKL libraries
|
||||
-D MKL_LIBRARIES=path
|
||||
|
||||
**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
|
||||
# default is KISS if not specified
|
||||
FFT_INC = -DFFT_SINGLE # do not specify for double precision
|
||||
FFT_INC = -DFFT_FFTW_THREADS # enable using threaded FFTW3 libraries
|
||||
FFT_INC = -DFFT_MKL_THREADS # enable using threaded FFTs with MKL libraries
|
||||
FFT_INC = -DFFT_PACK_ARRAY # or -DFFT_PACK_POINTER or -DFFT_PACK_MEMCPY
|
||||
|
||||
# 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_PATH = -L/usr/local/lib
|
||||
FFT_LIB = -lfftw3 # FFTW3 double precision
|
||||
FFT_LIB = -lfftw3 -lfftw3_omp # FFTW3 double precision with threads (needs -DFFT_FFTW_THREADS)
|
||||
FFT_LIB = -lfftw3 -lfftw3f # FFTW3 single precision
|
||||
FFT_LIB = -lmkl_intel_lp64 -lmkl_sequential -lmkl_core # MKL with Intel compiler
|
||||
FFT_LIB = -lmkl_gf_lp64 -lmkl_sequential -lmkl_core # MKL with GNU compier
|
||||
FFT_LIB = -lmkl_intel_lp64 -lmkl_sequential -lmkl_core # MKL with Intel compiler, serial interface
|
||||
FFT_LIB = -lmkl_gf_lp64 -lmkl_sequential -lmkl_core # MKL with GNU compiler, serial interface
|
||||
FFT_LIB = -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core # MKL with Intel compiler, threaded interface
|
||||
FFT_LIB = -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core # MKL with GNU compiler, threaded interface
|
||||
FFT_LIB = -lmkl_rt # MKL with automatic runtime selection of interface libs
|
||||
|
||||
As with CMake, you do not need to set paths in FFT\_INC or FFT\_PATH, if
|
||||
make can find the FFT header and library files. You must specify
|
||||
FFT\_LIB with the appropriate FFT libraries to include in the link.
|
||||
As with CMake, you do not need to set paths in ``FFT_INC`` or ``FFT_PATH``, if
|
||||
the compiler can find the FFT header and library files in its default search path.
|
||||
You must specify ``FFT_LIB`` with the appropriate FFT libraries to include in the link.
|
||||
|
||||
**CMake and make info**\ :
|
||||
|
||||
|
@ -158,14 +126,15 @@ platform and can be faster than the KISS FFT library. You can
|
|||
download it from `www.fftw.org <http://www.fftw.org>`_. LAMMPS requires
|
||||
version 3.X; the legacy version 2.1.X is no longer supported.
|
||||
|
||||
Building FFTW for your box should be as simple as ./configure; make;
|
||||
make install. The install command typically requires root privileges
|
||||
Building FFTW for your box should be as simple as ``./configure; make;
|
||||
make install``\ . The install command typically requires root privileges
|
||||
(e.g. invoke it via sudo), unless you specify a local directory with
|
||||
the "--prefix" option of configure. Type "./configure --help" to see
|
||||
the "--prefix" option of configure. Type ``./configure --help`` to see
|
||||
various options.
|
||||
|
||||
The Intel MKL math library is part of the Intel compiler suite. It
|
||||
can be used with the Intel or GNU compiler (see FFT\_LIB setting above).
|
||||
can be used with the Intel or GNU compiler (see the ``FFT_LIB`` setting
|
||||
above).
|
||||
|
||||
Performing 3d FFTs in parallel can be time consuming due to data
|
||||
access and required communication. This cost can be reduced by
|
||||
|
@ -174,33 +143,30 @@ precision means the real and imaginary parts of a complex datum are
|
|||
4-byte floats. Double precision means they are 8-byte doubles. Note
|
||||
that Fourier transform and related PPPM operations are somewhat less
|
||||
sensitive to floating point truncation errors and thus the resulting
|
||||
error is less than the difference in precision. Using the -DFFT\_SINGLE
|
||||
error is less than the difference in precision. Using the ``-DFFT_SINGLE``
|
||||
setting trades off a little accuracy for reduced memory use and
|
||||
parallel communication costs for transposing 3d FFT data.
|
||||
|
||||
When using -DFFT\_SINGLE with FFTW3 you may need to build the FFTW
|
||||
When using ``-DFFT_SINGLE`` with FFTW3 you may need to build the FFTW
|
||||
library a second time with support for single-precision.
|
||||
|
||||
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
|
||||
./configure --enable-single; make; make install
|
||||
|
||||
Performing 3d FFTs requires communication to transpose the 3d FFT
|
||||
grid. The data packing/unpacking for this can be done in one of 3
|
||||
modes (ARRAY, POINTER, MEMCPY) as set by the FFT\_PACK syntax above.
|
||||
modes (ARRAY, POINTER, MEMCPY) as set by the FFT_PACK syntax above.
|
||||
Depending on the machine, the size of the FFT grid, the number of
|
||||
processors used, one option may be slightly faster. The default is
|
||||
ARRAY mode.
|
||||
|
||||
|
||||
----------
|
||||
|
||||
|
||||
.. _size:
|
||||
|
||||
Size of LAMMPS data types
|
||||
|
@ -212,19 +178,18 @@ adequate.
|
|||
|
||||
**CMake variable**\ :
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
-D LAMMPS_SIZES=value # smallbig (default) or bigbig or smallsmall
|
||||
|
||||
**Makefile.machine setting**\ :
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: make
|
||||
|
||||
LMP_INC = -DLAMMPS_SMALLBIG # or -DLAMMPS_BIGBIG or -DLAMMPS_SMALLSMALL
|
||||
|
||||
# default is LAMMPS\_SMALLBIG if not specified
|
||||
The default setting is ``-DLAMMPS_SMALLBIG`` if nothing is specified
|
||||
|
||||
**CMake and make info**\ :
|
||||
|
||||
The default "smallbig" setting allows for simulations with:
|
||||
|
@ -272,12 +237,10 @@ than crashing randomly or corrupting data.
|
|||
Also note that the GPU package requires its lib/gpu library to be
|
||||
compiled with the same size setting, or the link will fail. A CMake
|
||||
build does this automatically. When building with make, the setting
|
||||
in whichever lib/gpu/Makefile is used must be the same as above.
|
||||
|
||||
in whichever ``lib/gpu/Makefile`` is used must be the same as above.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
.. _graphics:
|
||||
|
||||
Output of JPG, PNG, and movie files
|
||||
|
@ -290,22 +253,20 @@ following settings:
|
|||
|
||||
**CMake variables**\ :
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
-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
|
||||
-D WITH_PNG=value # yes or no
|
||||
# default = yes if CMake finds PNG and ZLIB files, else no
|
||||
# default = yes if CMake finds PNG and ZLIB files, else no
|
||||
-D WITH_FFMPEG=value # yes or no
|
||||
# default = yes if CMake can find ffmpeg, else no
|
||||
# default = yes if CMake can find ffmpeg, else no
|
||||
|
||||
Usually these settings are all that is needed. If CMake cannot find
|
||||
the graphics header, library, executable files, you can set these
|
||||
variables:
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
-D JPEG_INCLUDE_DIR=path # path to jpeglib.h header file
|
||||
-D JPEG_LIBRARIES=path # path to libjpeg.a (.so) file
|
||||
|
@ -317,8 +278,7 @@ variables:
|
|||
|
||||
**Makefile.machine settings**\ :
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: make
|
||||
|
||||
LMP_INC = -DLAMMPS_JPEG
|
||||
LMP_INC = -DLAMMPS_PNG
|
||||
|
@ -328,28 +288,27 @@ variables:
|
|||
JPG_PATH = -L/usr/lib # paths to libjpeg.a, libpng.a, libz.a (.so) files if make cannot find them
|
||||
JPG_LIB = -ljpeg -lpng -lz # library names
|
||||
|
||||
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
|
||||
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``
|
||||
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,
|
||||
i.e. a dir in your PATH environment variable.
|
||||
that is a directory in your PATH environment variable.
|
||||
|
||||
**CMake and make info**\ :
|
||||
|
||||
Using ffmpeg to output movie files requires that your machine
|
||||
Using ``ffmpeg`` to output movie files requires that your machine
|
||||
supports the "popen" function in the standard runtime library.
|
||||
|
||||
.. note::
|
||||
|
||||
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
|
||||
crash.
|
||||
|
||||
|
||||
----------
|
||||
|
||||
|
||||
.. _gzip:
|
||||
|
||||
Read or write compressed files
|
||||
|
@ -361,8 +320,7 @@ gzip compression by several LAMMPS commands, including
|
|||
|
||||
**CMake variables**\ :
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
-D WITH_GZIP=value # yes or no
|
||||
# default is yes if CMake can find gzip, else no
|
||||
|
@ -370,8 +328,7 @@ gzip compression by several LAMMPS commands, including
|
|||
|
||||
**Makefile.machine setting**\ :
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: make
|
||||
|
||||
LMP_INC = -DLAMMPS_GZIP
|
||||
|
||||
|
@ -384,22 +341,20 @@ found by LAMMPS during a run.
|
|||
.. note::
|
||||
|
||||
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
|
||||
or input to hang or crash. For selected operations, compressed file
|
||||
I/O is also available using a compression library instead, which is
|
||||
what the :ref:`COMPRESS package <PKG-COMPRESS>` enables.
|
||||
|
||||
|
||||
----------
|
||||
|
||||
|
||||
.. _align:
|
||||
|
||||
Memory allocation alignment
|
||||
---------------------------------------
|
||||
|
||||
This setting enables the use of the posix\_memalign() call instead of
|
||||
This setting enables the use of the posix_memalign() call instead of
|
||||
malloc() when LAMMPS allocates large chunks or memory. This can make
|
||||
vector instructions on CPUs more efficient, if dynamically allocated
|
||||
memory is aligned on larger-than-default byte boundaries.
|
||||
|
@ -410,33 +365,29 @@ aligned on 64-byte boundaries.
|
|||
|
||||
**CMake variable**\ :
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
-D LAMMPS_MEMALIGN=value # 0, 8, 16, 32, 64 (default)
|
||||
|
||||
Use a LAMMPS\_MEMALIGN value of 0 to disable using posix\_memalign()
|
||||
Use a ``LAMMPS_MEMALIGN`` value of 0 to disable using posix_memalign()
|
||||
and revert to using the malloc() C-library function instead. When
|
||||
compiling LAMMPS for Windows systems, malloc() will always be used
|
||||
and this setting ignored.
|
||||
|
||||
**Makefile.machine setting**\ :
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: make
|
||||
|
||||
LMP_INC = -DLAMMPS_MEMALIGN=value # 8, 16, 32, 64
|
||||
|
||||
Do not set -DLAMMPS\_MEMALIGN, if you want to have memory allocated
|
||||
with the malloc() function call instead. -DLAMMPS\_MEMALIGN **cannot**
|
||||
Do not set ``-DLAMMPS_MEMALIGN``, if you want to have memory allocated
|
||||
with the malloc() function call instead. ``-DLAMMPS_MEMALIGN`` **cannot**
|
||||
be used on Windows, as it does use different function calls for
|
||||
allocating aligned memory, that are not compatible with how LAMMPS
|
||||
manages its dynamical memory.
|
||||
|
||||
|
||||
----------
|
||||
|
||||
|
||||
.. _longlong:
|
||||
|
||||
Workaround for long long integers
|
||||
|
@ -449,47 +400,37 @@ those systems:
|
|||
|
||||
**CMake variable**\ :
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
-D LAMMPS_LONGLONG_TO_LONG=value # yes or no (default)
|
||||
|
||||
**Makefile.machine setting**\ :
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: make
|
||||
|
||||
LMP_INC = -DLAMMPS_LONGLONG_TO_LONG
|
||||
|
||||
|
||||
----------
|
||||
|
||||
|
||||
.. _exceptions:
|
||||
|
||||
Exception handling when using 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,
|
||||
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**\ :
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: bash
|
||||
|
||||
-D LAMMPS_EXCEPTIONS=value # yes or no (default)
|
||||
|
||||
**Makefile.machine setting**\ :
|
||||
|
||||
|
||||
.. parsed-literal::
|
||||
.. code-block:: make
|
||||
|
||||
LMP_INC = -DLAMMPS_EXCEPTIONS
|
||||
|
||||
|
||||
.. _lws: http://lammps.sandia.gov
|
||||
.. _ld: Manual.html
|
||||
.. _lc: Commands_all.html
|
||||
|
|
|
@ -6,10 +6,8 @@ Notes for building LAMMPS on Windows
|
|||
* :ref:`Using GNU GCC ported to Windows <gnu>`
|
||||
* :ref:`Using a cross-compiler <cross>`
|
||||
|
||||
|
||||
----------
|
||||
|
||||
|
||||
.. _generic:
|
||||
|
||||
General remarks
|
||||
|
@ -17,9 +15,9 @@ General remarks
|
|||
|
||||
LAMMPS is developed and tested primarily on Linux machines. The vast
|
||||
majority of HPC clusters and supercomputers today runs on Linux as well.
|
||||
Thus portability to other platforms is desired, but not always achieved.
|
||||
While portability to other platforms is desired, it is not always achieved.
|
||||
The LAMMPS developers strongly rely on LAMMPS users giving feedback and
|
||||
providing assistance in resolving portability issues. This particularly
|
||||
providing assistance in resolving portability issues. This is particularly
|
||||
true for compiling LAMMPS on Windows, since this platform has significant
|
||||
differences with some low-level functionality.
|
||||
|
||||
|
@ -31,18 +29,20 @@ Running Linux on Windows
|
|||
So before trying to build LAMMPS on Windows, please consider if using
|
||||
the pre-compiled Windows binary packages are sufficient for your needs
|
||||
(as an aside, those packages themselves are build on a Linux machine
|
||||
using cross-compilers). If it is necessary for your to compile LAMMPS
|
||||
using cross-compilers). If it is necessary for you to compile LAMMPS
|
||||
on a Windows machine (e.g. because it is your main desktop), please also
|
||||
consider using a virtual machine software and run a Linux virtual machine,
|
||||
or - if have a recently updated Windows 10 installation - consider using
|
||||
the Windows subsystem for Linux, which allows to run a bash shell from
|
||||
Ubuntu and from there on, you can pretty much use that shell like you
|
||||
are running on an Ubuntu Linux machine (e.g. installing software via
|
||||
apt-get). For more details on that, please see :doc:`this tutorial <Howto_bash>`
|
||||
consider using a virtual machine software and compile and run LAMMPS in
|
||||
a Linux virtual machine, or - if you have a recently updated Windows 10
|
||||
installation - consider using the Windows subsystem for Linux. This
|
||||
optional Windows feature allows you to run the bash shell from Ubuntu
|
||||
from within Windows and from there on, you can pretty much use that
|
||||
shell like you are running on an Ubuntu Linux machine (e.g. installing
|
||||
software via apt-get and more). For more details on that, please
|
||||
see :doc:`this tutorial <Howto_bash>`
|
||||
|
||||
.. _gnu:
|
||||
|
||||
Using GNU GCC ported to Windows
|
||||
Using a GNU GCC ported to Windows
|
||||
-----------------------------------------
|
||||
|
||||
One option for compiling LAMMPS on Windows natively, that has been known
|
||||
|
@ -55,8 +55,8 @@ and the corresponding new code. A machine makefile for using cygwin for
|
|||
the old build system is provided. Using CMake for this mode of compilation
|
||||
is untested and not likely to work.
|
||||
|
||||
When compiling for Windows do **not** set the -DLAMMPS\_MEMALIGN define
|
||||
in the LMP\_INC makefile variable and add -lwsock32 -lpsapi to the linker
|
||||
When compiling for Windows do **not** set the -DLAMMPS_MEMALIGN define
|
||||
in the LMP_INC makefile variable and add -lwsock32 -lpsapi to the linker
|
||||
flags in LIB makefile variable. Try adding -static-libgcc or -static or
|
||||
both to the linker flags when your resulting LAMMPS Windows executable
|
||||
complains about missing .dll files. The CMake configuration should set
|
||||
|
@ -83,13 +83,19 @@ traditional build system, but CMake has also been successfully tested
|
|||
using the mingw32-cmake and mingw64-cmake wrappers that are bundled
|
||||
with the cross-compiler environment on Fedora machines. A CMake preset
|
||||
selecting all packages compatible with this cross-compilation build
|
||||
is provided. You likely need to disable the GPU package unless you
|
||||
download and install the contents of the pre-compiled `OpenCL ICD loader library <https://download.lammps.org/thirdparty/opencl-win-devel.tar.gz>`_
|
||||
into your MinGW64 cross-compiler environment. The cross-compilation
|
||||
currently will only produce non-MPI serial binaries.
|
||||
is provided. The GPU package can only be compiled with OpenCL support
|
||||
and you need to download and install the pre-compiled
|
||||
`OpenCL ICD loader library <https://download.lammps.org/thirdparty/opencl-win-devel.tar.gz>`_
|
||||
into your MinGW64 cross-compiler environment. With CMake this will be
|
||||
done transparently. To compile with MPI support, a pre-compiled
|
||||
library and the corresponding header files are required. There is
|
||||
`one package for 32-bit Windows <https://download.lammps.org/thirdparty/mpich2-win32-devel.tar.gz>`_
|
||||
and `a second package for 64-bit Windows <https://download.lammps.org/thirdparty/mpich2-win64-devel.tar.gz>`_.
|
||||
When building with CMake, the matching package will be downloaded
|
||||
automatically, but MPI support has to be explicitly enabled with ``-DBUILD_MPI=on``.
|
||||
|
||||
Please keep in mind, though, that this only applies to compiling LAMMPS.
|
||||
Whether the resulting binaries do work correctly is no tested by the
|
||||
Please keep in mind, though, that this only applies to **compiling** LAMMPS.
|
||||
Whether the resulting binaries do work correctly is not tested by the
|
||||
LAMMPS developers. We instead rely on the feedback of the users
|
||||
of these pre-compiled LAMMPS packages for Windows. We will try to resolve
|
||||
issues to the best of our abilities if we become aware of them. However
|
||||
|
@ -104,8 +110,3 @@ Support for the Visual C++ compilers is currently not available. The
|
|||
CMake build system is capable of creating suitable a Visual Studio
|
||||
style build environment, but the LAMMPS code itself is not fully ported
|
||||
to support Visual C++. Volunteers to take on this task are welcome.
|
||||
|
||||
|
||||
.. _lws: http://lammps.sandia.gov
|
||||
.. _ld: Manual.html
|
||||
.. _lc: Commands_all.html
|
||||
|
|
|
@ -4,7 +4,6 @@ Commands
|
|||
These pages describe how a LAMMPS input script is formatted and the
|
||||
commands in it are used to define a LAMMPS simulation.
|
||||
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ General commands
|
|||
An alphabetic list of all general LAMMPS commands.
|
||||
|
||||
.. table_from_list::
|
||||
:columns: 6
|
||||
:columns: 5
|
||||
|
||||
* :doc:`angle_coeff <angle_coeff>`
|
||||
* :doc:`angle_style <angle_style>`
|
||||
|
@ -70,6 +70,7 @@ An alphabetic list of all general LAMMPS commands.
|
|||
* :doc:`kim_init <kim_commands>`
|
||||
* :doc:`kim_interactions <kim_commands>`
|
||||
* :doc:`kim_param <kim_commands>`
|
||||
* :doc:`kim_property <kim_commands>`
|
||||
* :doc:`kim_query <kim_commands>`
|
||||
* :doc:`kspace_modify <kspace_modify>`
|
||||
* :doc:`kspace_style <kspace_style>`
|
||||
|
@ -136,4 +137,3 @@ An alphabetic list of all general LAMMPS commands.
|
|||
* :doc:`write_data <write_data>`
|
||||
* :doc:`write_dump <write_dump>`
|
||||
* :doc:`write_restart <write_restart>`
|
||||
|
||||
|
|
|
@ -99,7 +99,6 @@ have accelerated versions. This is indicated by additional letters in
|
|||
parenthesis: g = GPU, i = USER-INTEL, k = KOKKOS, o = USER-OMP, t =
|
||||
OPT.
|
||||
|
||||
|
||||
.. table_from_list::
|
||||
:columns: 4
|
||||
|
||||
|
|
|
@ -7,126 +7,163 @@ alphabetically. Style options for entries like fix, compute, pair etc.
|
|||
have their own pages where they are listed alphabetically.
|
||||
|
||||
Initialization:
|
||||
------------------------------
|
||||
|
||||
* :doc:`newton <newton>`,
|
||||
* :doc:`package <package>`,
|
||||
* :doc:`processors <processors>`,
|
||||
* :doc:`suffix <suffix>`,
|
||||
* :doc:`units <units>`
|
||||
.. table_from_list::
|
||||
:columns: 5
|
||||
|
||||
* :doc:`newton <newton>`
|
||||
* :doc:`package <package>`
|
||||
* :doc:`processors <processors>`
|
||||
* :doc:`suffix <suffix>`
|
||||
* :doc:`units <units>`
|
||||
|
||||
Setup simulation box:
|
||||
------------------------------
|
||||
|
||||
* :doc:`boundary <boundary>`,
|
||||
* :doc:`box <box>`,
|
||||
* :doc:`change_box <change_box>`,
|
||||
* :doc:`create_box <create_box>`,
|
||||
* :doc:`dimension <dimension>`,
|
||||
* :doc:`lattice <lattice>`,
|
||||
* :doc:`region <region>`
|
||||
.. table_from_list::
|
||||
:columns: 4
|
||||
|
||||
* :doc:`boundary <boundary>`
|
||||
* :doc:`box <box>`
|
||||
* :doc:`change_box <change_box>`
|
||||
* :doc:`create_box <create_box>`
|
||||
* :doc:`dimension <dimension>`
|
||||
* :doc:`lattice <lattice>`
|
||||
* :doc:`region <region>`
|
||||
|
||||
Setup atoms:
|
||||
------------------------------
|
||||
|
||||
* :doc:`atom_modify <atom_modify>`,
|
||||
* :doc:`atom_style <atom_style>`,
|
||||
* :doc:`balance <balance>`,
|
||||
* :doc:`create_atoms <create_atoms>`,
|
||||
* :doc:`create_bonds <create_bonds>`,
|
||||
* :doc:`delete_atoms <delete_atoms>`,
|
||||
* :doc:`delete_bonds <delete_bonds>`,
|
||||
* :doc:`displace_atoms <displace_atoms>`,
|
||||
* :doc:`group <group>`,
|
||||
* :doc:`mass <mass>`,
|
||||
* :doc:`molecule <molecule>`,
|
||||
* :doc:`read_data <read_data>`,
|
||||
* :doc:`read_dump <read_dump>`,
|
||||
* :doc:`read_restart <read_restart>`,
|
||||
* :doc:`replicate <replicate>`,
|
||||
* :doc:`set <set>`,
|
||||
* :doc:`velocity <velocity>`
|
||||
.. table_from_list::
|
||||
:columns: 4
|
||||
|
||||
* :doc:`atom_modify <atom_modify>`
|
||||
* :doc:`atom_style <atom_style>`
|
||||
* :doc:`balance <balance>`
|
||||
* :doc:`create_atoms <create_atoms>`
|
||||
* :doc:`create_bonds <create_bonds>`
|
||||
* :doc:`delete_atoms <delete_atoms>`
|
||||
* :doc:`delete_bonds <delete_bonds>`
|
||||
* :doc:`displace_atoms <displace_atoms>`
|
||||
* :doc:`group <group>`
|
||||
* :doc:`mass <mass>`
|
||||
* :doc:`molecule <molecule>`
|
||||
* :doc:`read_data <read_data>`
|
||||
* :doc:`read_dump <read_dump>`
|
||||
* :doc:`read_restart <read_restart>`
|
||||
* :doc:`replicate <replicate>`
|
||||
* :doc:`set <set>`
|
||||
* :doc:`velocity <velocity>`
|
||||
|
||||
Force fields:
|
||||
------------------------------
|
||||
|
||||
* :doc:`angle_coeff <angle_coeff>`,
|
||||
* :doc:`angle_style <angle_style>`,
|
||||
* :doc:`bond_coeff <bond_coeff>`,
|
||||
* :doc:`bond_style <bond_style>`,
|
||||
* :doc:`bond_write <bond_write>`,
|
||||
* :doc:`dielectric <dielectric>`,
|
||||
* :doc:`dihedral_coeff <dihedral_coeff>`,
|
||||
* :doc:`dihedral_style <dihedral_style>`,
|
||||
* :doc:`improper_coeff <improper_coeff>`,
|
||||
* :doc:`improper_style <improper_style>`,
|
||||
* :doc:`kspace_modify <kspace_modify>`,
|
||||
* :doc:`kspace_style <kspace_style>`,
|
||||
* :doc:`pair_coeff <pair_coeff>`,
|
||||
* :doc:`pair_modify <pair_modify>`,
|
||||
* :doc:`pair_style <pair_style>`,
|
||||
* :doc:`pair_write <pair_write>`,
|
||||
* :doc:`special_bonds <special_bonds>`
|
||||
.. table_from_list::
|
||||
:columns: 4
|
||||
|
||||
* :doc:`angle_coeff <angle_coeff>`
|
||||
* :doc:`angle_style <angle_style>`
|
||||
* :doc:`bond_coeff <bond_coeff>`
|
||||
* :doc:`bond_style <bond_style>`
|
||||
* :doc:`bond_write <bond_write>`
|
||||
* :doc:`dielectric <dielectric>`
|
||||
* :doc:`dihedral_coeff <dihedral_coeff>`
|
||||
* :doc:`dihedral_style <dihedral_style>`
|
||||
* :doc:`improper_coeff <improper_coeff>`
|
||||
* :doc:`improper_style <improper_style>`
|
||||
* :doc:`kspace_modify <kspace_modify>`
|
||||
* :doc:`kspace_style <kspace_style>`
|
||||
* :doc:`pair_coeff <pair_coeff>`
|
||||
* :doc:`pair_modify <pair_modify>`
|
||||
* :doc:`pair_style <pair_style>`
|
||||
* :doc:`pair_write <pair_write>`
|
||||
* :doc:`special_bonds <special_bonds>`
|
||||
|
||||
Settings:
|
||||
------------------------------
|
||||
|
||||
* :doc:`comm_modify <comm_modify>`,
|
||||
* :doc:`comm_style <comm_style>`,
|
||||
* :doc:`info <info>`,
|
||||
* :doc:`min_modify <min_modify>`,
|
||||
* :doc:`min_style <min_style>`,
|
||||
* :doc:`neigh_modify <neigh_modify>`,
|
||||
* :doc:`neighbor <neighbor>`,
|
||||
* :doc:`partition <partition>`,
|
||||
* :doc:`reset_timestep <reset_timestep>`,
|
||||
* :doc:`run_style <run_style>`,
|
||||
* :doc:`timer <timer>`,
|
||||
* :doc:`timestep <timestep>`
|
||||
.. table_from_list::
|
||||
:columns: 4
|
||||
|
||||
* :doc:`comm_modify <comm_modify>`
|
||||
* :doc:`comm_style <comm_style>`
|
||||
* :doc:`info <info>`
|
||||
* :doc:`min_modify <min_modify>`
|
||||
* :doc:`min_style <min_style>`
|
||||
* :doc:`neigh_modify <neigh_modify>`
|
||||
* :doc:`neighbor <neighbor>`
|
||||
* :doc:`partition <partition>`
|
||||
* :doc:`reset_timestep <reset_timestep>`
|
||||
* :doc:`run_style <run_style>`
|
||||
* :doc:`timer <timer>`
|
||||
* :doc:`timestep <timestep>`
|
||||
|
||||
Operations within timestepping (fixes) and diagnostics (computes):
|
||||
------------------------------------------------------------------------------------------
|
||||
|
||||
* :doc:`compute <compute>`,
|
||||
* :doc:`compute_modify <compute_modify>`,
|
||||
* :doc:`fix <fix>`,
|
||||
* :doc:`fix_modify <fix_modify>`,
|
||||
* :doc:`uncompute <uncompute>`,
|
||||
* :doc:`unfix <unfix>`
|
||||
.. table_from_list::
|
||||
:columns: 4
|
||||
|
||||
* :doc:`compute <compute>`
|
||||
* :doc:`compute_modify <compute_modify>`
|
||||
* :doc:`fix <fix>`
|
||||
* :doc:`fix_modify <fix_modify>`
|
||||
* :doc:`uncompute <uncompute>`
|
||||
* :doc:`unfix <unfix>`
|
||||
|
||||
Output:
|
||||
------------------------------
|
||||
|
||||
* :doc:`dump image <dump_image>`,
|
||||
* :doc:`dump movie <dump_image>`,
|
||||
* :doc:`dump <dump>`,
|
||||
* :doc:`dump_modify <dump_modify>`,
|
||||
* :doc:`restart <restart>`,
|
||||
* :doc:`thermo <thermo>`,
|
||||
* :doc:`thermo_modify <thermo_modify>`,
|
||||
* :doc:`thermo_style <thermo_style>`,
|
||||
* :doc:`undump <undump>`,
|
||||
* :doc:`write_coeff <write_coeff>`,
|
||||
* :doc:`write_data <write_data>`,
|
||||
* :doc:`write_dump <write_dump>`,
|
||||
* :doc:`write_restart <write_restart>`
|
||||
.. table_from_list::
|
||||
:columns: 4
|
||||
|
||||
* :doc:`dump image <dump_image>`
|
||||
* :doc:`dump movie <dump_image>`
|
||||
* :doc:`dump <dump>`
|
||||
* :doc:`dump_modify <dump_modify>`
|
||||
* :doc:`restart <restart>`
|
||||
* :doc:`thermo <thermo>`
|
||||
* :doc:`thermo_modify <thermo_modify>`
|
||||
* :doc:`thermo_style <thermo_style>`
|
||||
* :doc:`undump <undump>`
|
||||
* :doc:`write_coeff <write_coeff>`
|
||||
* :doc:`write_data <write_data>`
|
||||
* :doc:`write_dump <write_dump>`
|
||||
* :doc:`write_restart <write_restart>`
|
||||
|
||||
Actions:
|
||||
------------------------------
|
||||
|
||||
* :doc:`minimize <minimize>`,
|
||||
* :doc:`neb <neb>`,
|
||||
* :doc:`neb_spin <neb_spin>`,
|
||||
* :doc:`prd <prd>`,
|
||||
* :doc:`rerun <rerun>`,
|
||||
* :doc:`run <run>`,
|
||||
* :doc:`tad <tad>`,
|
||||
* :doc:`temper <temper>`
|
||||
.. table_from_list::
|
||||
:columns: 6
|
||||
|
||||
* :doc:`minimize <minimize>`
|
||||
* :doc:`neb <neb>`
|
||||
* :doc:`neb_spin <neb_spin>`
|
||||
* :doc:`prd <prd>`
|
||||
* :doc:`rerun <rerun>`
|
||||
* :doc:`run <run>`
|
||||
* :doc:`tad <tad>`
|
||||
* :doc:`temper <temper>`
|
||||
|
||||
Input script control:
|
||||
------------------------------
|
||||
|
||||
* :doc:`clear <clear>`,
|
||||
* :doc:`echo <echo>`,
|
||||
* :doc:`if <if>`,
|
||||
* :doc:`include <include>`,
|
||||
* :doc:`jump <jump>`,
|
||||
* :doc:`label <label>`,
|
||||
* :doc:`log <log>`,
|
||||
* :doc:`next <next>`,
|
||||
* :doc:`print <print>`,
|
||||
* :doc:`python <python>`,
|
||||
* :doc:`quit <quit>`,
|
||||
* :doc:`shell <shell>`,
|
||||
* :doc:`variable <variable>`
|
||||
.. table_from_list::
|
||||
:columns: 7
|
||||
|
||||
* :doc:`clear <clear>`
|
||||
* :doc:`echo <echo>`
|
||||
* :doc:`if <if>`
|
||||
* :doc:`include <include>`
|
||||
* :doc:`info <info>`
|
||||
* :doc:`jump <jump>`
|
||||
* :doc:`label <label>`
|
||||
* :doc:`log <log>`
|
||||
* :doc:`next <next>`
|
||||
* :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.
|
||||
|
||||
.. table_from_list::
|
||||
:columns: 6
|
||||
:columns: 5
|
||||
|
||||
* :doc:`ackland/atom <compute_ackland_atom>`
|
||||
* :doc:`adf <compute_adf>`
|
||||
|
@ -163,4 +163,3 @@ KOKKOS, o = USER-OMP, t = OPT.
|
|||
* :doc:`vcm/chunk <compute_vcm_chunk>`
|
||||
* :doc:`voronoi/atom <compute_voronoi_atom>`
|
||||
* :doc:`xrd <compute_xrd>`
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ parenthesis: g = GPU, i = USER-INTEL, k = KOKKOS, o = USER-OMP, t =
|
|||
OPT.
|
||||
|
||||
.. table_from_list::
|
||||
:columns: 6
|
||||
:columns: 5
|
||||
|
||||
* :doc:`adapt <fix_adapt>`
|
||||
* :doc:`adapt/fep <fix_adapt_fep>`
|
||||
|
@ -119,6 +119,7 @@ OPT.
|
|||
* :doc:`npt/eff <fix_nh_eff>`
|
||||
* :doc:`npt/sphere (o) <fix_npt_sphere>`
|
||||
* :doc:`npt/uef <fix_nh_uef>`
|
||||
* :doc:`numdiff <fix_numdiff>`
|
||||
* :doc:`nve (iko) <fix_nve>`
|
||||
* :doc:`nve/asphere (i) <fix_nve_asphere>`
|
||||
* :doc:`nve/asphere/noforce <fix_nve_asphere_noforce>`
|
||||
|
|
|
@ -16,7 +16,6 @@ simulation with all the settings. Rather, the input script is read
|
|||
one line at a time and each command takes effect when it is read.
|
||||
Thus this sequence of commands:
|
||||
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
timestep 0.5
|
||||
|
@ -25,7 +24,6 @@ Thus this sequence of commands:
|
|||
|
||||
does something different than this sequence:
|
||||
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
run 100
|
||||
|
@ -48,7 +46,7 @@ is to have the desired effect. For example, the
|
|||
:doc:`read_data <read_data>` command initializes the system by setting
|
||||
up the simulation box and assigning atoms to processors. If default
|
||||
values are not desired, the :doc:`processors <processors>` and
|
||||
:doc:`boundary <boundary>` commands need to be used before read\_data to
|
||||
:doc:`boundary <boundary>` commands need to be used before read_data to
|
||||
tell LAMMPS how to map processors to the simulation box.
|
||||
|
||||
Many input script errors are detected by LAMMPS and an ERROR or
|
||||
|
|
|
@ -26,6 +26,10 @@ OPT.
|
|||
* :doc:`zero <pair_zero>`
|
||||
* :doc:`hybrid (k) <pair_hybrid>`
|
||||
* :doc:`hybrid/overlay (k) <pair_hybrid>`
|
||||
* :doc:`kim <pair_kim>`
|
||||
* :doc:`list <pair_list>`
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
|
@ -73,6 +77,8 @@ OPT.
|
|||
* :doc:`coul/long/cs (g) <pair_cs>`
|
||||
* :doc:`coul/long/soft (o) <pair_fep_soft>`
|
||||
* :doc:`coul/msm (o) <pair_coul>`
|
||||
* :doc:`coul/slater/cut <pair_coul_slater>`
|
||||
* :doc:`coul/slater/long <pair_coul_slater>`
|
||||
* :doc:`coul/shield <pair_coul_shield>`
|
||||
* :doc:`coul/streitz <pair_coul>`
|
||||
* :doc:`coul/wolf (ko) <pair_coul>`
|
||||
|
@ -91,7 +97,7 @@ OPT.
|
|||
* :doc:`eam/fs (gikot) <pair_eam>`
|
||||
* :doc:`edip (o) <pair_edip>`
|
||||
* :doc:`edip/multi <pair_edip>`
|
||||
* :doc:`edpd <pair_meso>`
|
||||
* :doc:`edpd <pair_mesodpd>`
|
||||
* :doc:`eff/cut <pair_eff>`
|
||||
* :doc:`eim (o) <pair_eim>`
|
||||
* :doc:`exp6/rx (k) <pair_exp6_rx>`
|
||||
|
@ -108,14 +114,12 @@ OPT.
|
|||
* :doc:`hbond/dreiding/lj (o) <pair_hbond_dreiding>`
|
||||
* :doc:`hbond/dreiding/morse (o) <pair_hbond_dreiding>`
|
||||
* :doc:`ilp/graphene/hbn <pair_ilp_graphene_hbn>`
|
||||
* :doc:`kim <pair_kim>`
|
||||
* :doc:`kolmogorov/crespi/full <pair_kolmogorov_crespi_full>`
|
||||
* :doc:`kolmogorov/crespi/z <pair_kolmogorov_crespi_z>`
|
||||
* :doc:`lcbop <pair_lcbop>`
|
||||
* :doc:`lebedeva/z <pair_lebedeva_z>`
|
||||
* :doc:`lennard/mdf <pair_mdf>`
|
||||
* :doc:`line/lj <pair_line_lj>`
|
||||
* :doc:`list <pair_list>`
|
||||
* :doc:`lj/charmm/coul/charmm (iko) <pair_charmm>`
|
||||
* :doc:`lj/charmm/coul/charmm/implicit (ko) <pair_charmm>`
|
||||
* :doc:`lj/charmm/coul/long (gikot) <pair_charmm>`
|
||||
|
@ -169,8 +173,8 @@ OPT.
|
|||
* :doc:`lubricate/poly (o) <pair_lubricate>`
|
||||
* :doc:`lubricateU <pair_lubricateU>`
|
||||
* :doc:`lubricateU/poly <pair_lubricateU>`
|
||||
* :doc:`mdpd <pair_meso>`
|
||||
* :doc:`mdpd/rhosum <pair_meso>`
|
||||
* :doc:`mdpd <pair_mesodpd>`
|
||||
* :doc:`mdpd/rhosum <pair_mesodpd>`
|
||||
* :doc:`meam/c <pair_meamc>`
|
||||
* :doc:`meam/spline (o) <pair_meam_spline>`
|
||||
* :doc:`meam/sw/spline <pair_meam_sw_spline>`
|
||||
|
@ -240,7 +244,7 @@ OPT.
|
|||
* :doc:`sw (giko) <pair_sw>`
|
||||
* :doc:`table (gko) <pair_table>`
|
||||
* :doc:`table/rx (k) <pair_table_rx>`
|
||||
* :doc:`tdpd <pair_meso>`
|
||||
* :doc:`tdpd <pair_mesodpd>`
|
||||
* :doc:`tersoff (giko) <pair_tersoff>`
|
||||
* :doc:`tersoff/mod (gko) <pair_tersoff_mod>`
|
||||
* :doc:`tersoff/mod/c (o) <pair_tersoff_mod>`
|
||||
|
|
|
@ -9,134 +9,150 @@ file names or user-chosen ID strings.
|
|||
Here are 6 rules for how each line in the input script is parsed by
|
||||
LAMMPS:
|
||||
|
||||
(1) If the last printable character on the line is a "&" character,
|
||||
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.
|
||||
.. _one:
|
||||
|
||||
(2) All characters from the first "#" character onward are treated as
|
||||
comment and discarded. See an exception in (6). 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.
|
||||
1. If the last printable character on the line is a "&" character, 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 :ref:`6 <six>`
|
||||
for how to continue a command across multiple line without using "&"
|
||||
characters.
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
.. _two:
|
||||
|
||||
# this is a comment
|
||||
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.
|
||||
|
||||
(3) The line is searched repeatedly for $ characters, which indicate
|
||||
variables that are replaced with a text string. See an exception in
|
||||
(6).
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
If the $ is followed by curly brackets, then the variable name is the
|
||||
text inside the curly brackets. If no curly brackets follow the $,
|
||||
then the variable name is the single character immediately following
|
||||
the $. Thus ${myTemp} and $x refer to variable names "myTemp" and
|
||||
"x".
|
||||
# this is a comment
|
||||
timestep 1.0 # this is also a comment
|
||||
|
||||
How the variable is converted to a text string depends on what style
|
||||
of variable it is; see the :doc:`variable <variable>` doc page for details.
|
||||
It can be a variable that stores multiple text strings, and return one
|
||||
of them. The returned text string can be multiple "words" (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.
|
||||
.. _three:
|
||||
|
||||
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:
|
||||
3. The line is searched repeatedly for $ characters, which indicate
|
||||
variables that are replaced with a text string. The exception to
|
||||
this rule is described in :ref:`6 <six>`.
|
||||
|
||||
If the $ is followed by text in curly brackets '{}', then the
|
||||
variable name is the text inside the curly brackets. If no curly
|
||||
brackets follow the $, then the variable name is the single character
|
||||
immediately following the $. Thus ${myTemp} and $x refer to variables
|
||||
named "myTemp" and "x", while "$xx" will be interpreted as a variable
|
||||
named "x" followed by an "x" character.
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
How the variable is converted to a text string depends on what style
|
||||
of variable it is; see the :doc:`variable <variable>` doc page for
|
||||
details. It can be a variable that stores multiple text strings, and
|
||||
return one of them. The returned text string can be multiple "words"
|
||||
(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.
|
||||
|
||||
variable X equal (xlo+xhi)/2+sqrt(v_area)
|
||||
region 1 block $X 2 INF INF EDGE EDGE
|
||||
variable X delete
|
||||
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:
|
||||
|
||||
can be replaced by
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
variable X equal (xlo+xhi)/2+sqrt(v_area)
|
||||
region 1 block $X 2 INF INF EDGE EDGE
|
||||
variable X delete
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
can be replaced by:
|
||||
|
||||
region 1 block $((xlo+xhi)/2+sqrt(v_area)) 2 INF INF EDGE EDGE
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
so that you do not have to define (or discard) a temporary variable X.
|
||||
region 1 block $((xlo+xhi)/2+sqrt(v_area)) 2 INF INF EDGE EDGE
|
||||
|
||||
Additionally, the "immediate" variable expression may be followed by a
|
||||
colon, followed by a C-style format string, e.g. ":%f" or ":%.10g".
|
||||
The format string must be appropriate for a double-precision
|
||||
floating-point value. The format string is used to output the result
|
||||
of the variable expression evaluation. If a format string is not
|
||||
specified a high-precision "%.20g" is used as the default.
|
||||
so that you do not have to define (or discard) a temporary variable,
|
||||
"X" in this case.
|
||||
|
||||
This can be useful for formatting print output to a desired precision:
|
||||
Additionally, the "immediate" variable expression may be followed by
|
||||
a colon, followed by a C-style format string, e.g. ":%f" or ":%.10g".
|
||||
The format string must be appropriate for a double-precision
|
||||
floating-point value. The format string is used to output the result
|
||||
of the variable expression evaluation. If a format string is not
|
||||
specified a high-precision "%.20g" is used as the default.
|
||||
|
||||
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
|
||||
contain nested $ characters for other variables to substitute for.
|
||||
Thus you cannot do this:
|
||||
Note that neither the curly-bracket or immediate form of variables
|
||||
can contain nested $ characters for other variables to substitute
|
||||
for. Thus you may **NOT** do this:
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
variable a equal 2
|
||||
variable b2 equal 4
|
||||
print "B2 = ${b$a}"
|
||||
|
||||
variable a equal 2
|
||||
variable b2 equal 4
|
||||
print "B2 = ${b$a}"
|
||||
Nor can you specify an expression like "$($x-1.0)" for an immediate
|
||||
variable, but you could use $(v_x-1.0), since the latter is valid
|
||||
syntax for an :doc:`equal-style variable <variable>`.
|
||||
|
||||
Nor can you specify this $($x-1.0) for an immediate variable, but
|
||||
you could use $(v\_x-1.0), since the latter is valid syntax for an
|
||||
:doc:`equal-style variable <variable>`.
|
||||
See the :doc:`variable <variable>` command for more details of how
|
||||
strings are assigned to variables and evaluated, and how they can
|
||||
be used in input script commands.
|
||||
|
||||
See the :doc:`variable <variable>` command for more details of how
|
||||
strings are assigned to variables and evaluated, and how they can be
|
||||
used in input script commands.
|
||||
.. _four:
|
||||
|
||||
(4) The line is broken into "words" separated by white-space (tabs,
|
||||
spaces). Note that words can thus contain letters, digits,
|
||||
underscores, or punctuation characters.
|
||||
4. The line is broken into "words" separated by white-space (tabs,
|
||||
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
|
||||
line are arguments.
|
||||
.. _five:
|
||||
|
||||
(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:
|
||||
5. The first word is the command name. All successive words in the line
|
||||
are arguments.
|
||||
|
||||
.. _six:
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
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:
|
||||
|
||||
print "Volume = $v"
|
||||
print 'Volume = $v'
|
||||
if "${steps} > 1000" then quit
|
||||
variable a string "red green blue &
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
print "Volume = $v"
|
||||
print 'Volume = $v'
|
||||
if "${steps} > 1000" then quit
|
||||
variable a string "red green blue &
|
||||
purple orange cyan"
|
||||
print """
|
||||
System volume = $v
|
||||
System temperature = $t
|
||||
"""
|
||||
print """
|
||||
System volume = $v
|
||||
System temperature = $t
|
||||
"""
|
||||
|
||||
In each case, the single, double, or triple quotes are removed when
|
||||
the single argument they enclose is stored internally.
|
||||
In each case, the single, double, or triple quotes are removed when
|
||||
the single argument they enclose is stored internally.
|
||||
|
||||
See the :doc:`dump modify format <dump_modify>`, :doc:`print <print>`,
|
||||
:doc:`if <if>`, and :doc:`python <python>` commands for examples.
|
||||
See the :doc:`dump modify format <dump_modify>`, :doc:`print
|
||||
<print>`, :doc:`if <if>`, and :doc:`python <python>` commands for
|
||||
examples.
|
||||
|
||||
A "#" or "$" character that is between quotes will not be treated as a
|
||||
comment indicator in (2) or substituted for as a variable in (3).
|
||||
A "#" or "$" character that is between quotes will not be treated as
|
||||
a comment indicator in :ref:`2 <two>` or substituted for as a
|
||||
variable in :ref:`3 <three>`.
|
||||
|
||||
.. note::
|
||||
|
||||
|
|
|
@ -60,8 +60,3 @@ LAMMPS executable directly instead of having a separate tool. A
|
|||
combination of the commands :doc:`read_restart <read_restart>` and
|
||||
:doc:`write_data <write_data>` can be used to the same effect. For added
|
||||
convenience this conversion can also be triggered by :doc:`command line flags <Run_options>`
|
||||
|
||||
|
||||
.. _lws: http://lammps.sandia.gov
|
||||
.. _ld: Manual.html
|
||||
.. _lc: Commands_all.html
|
||||
|
|
|
@ -8,17 +8,20 @@ page.
|
|||
|
||||
A LAMMPS input script typically has 4 parts:
|
||||
|
||||
1. Initialization
|
||||
2. Atom definition
|
||||
3. Settings
|
||||
4. Run a simulation
|
||||
1. :ref:`Initialization <init>`
|
||||
2. :ref:`System definition <system>`
|
||||
3. :ref:`Simulation settings <settings>`
|
||||
4. :ref:`Run a simulation <run>`
|
||||
|
||||
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
|
||||
parts is now described in more detail. Remember that almost all
|
||||
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
|
||||
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:`improper_style <improper_style>`.
|
||||
|
||||
(2) Atom definition
|
||||
.. _system:
|
||||
|
||||
There are 3 ways to define atoms in LAMMPS. Read them in from a data
|
||||
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.
|
||||
System definition
|
||||
------------------------------
|
||||
|
||||
(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
|
||||
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
|
||||
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>`,
|
||||
and :doc:`restart <restart>` commands.
|
||||
|
||||
(4) Run a simulation
|
||||
.. _run:
|
||||
|
||||
Run a simulation
|
||||
------------------------------
|
||||
|
||||
A molecular dynamics simulation is run using the :doc:`run <run>`
|
||||
command. Energy minimization (molecular statics) is performed using
|
||||
|
|
Before Width: | Height: | Size: 14 KiB |
|
@ -1,15 +0,0 @@
|
|||
\documentclass[12pt]{article}
|
||||
|
||||
\pagestyle{empty}
|
||||
\begin{document}
|
||||
|
||||
$$
|
||||
E_{a} = K_2\left(\theta - \theta_0\right)^2 + K_3\left(\theta - \theta_0\right)^3 + K_4\left(\theta - \theta_0\right)^4 + K_5\left(\theta - \theta_0\right)^5 + K_6\left(\theta - \theta_0\right)^6
|
||||
$$
|
||||
|
||||
\end{document}
|
||||
|
||||
%%% Local Variables:
|
||||
%%% mode: latex
|
||||
%%% TeX-master: t
|
||||
%%% End:
|
Before Width: | Height: | Size: 11 KiB |
|
@ -1,14 +0,0 @@
|
|||
\documentclass[12pt]{article}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{eqnarray*}
|
||||
a &=& {\rm lx} \\
|
||||
b^2 &=& {\rm ly}^2 + {\rm xy}^2 \\
|
||||
c^2 &=& {\rm lz}^2 + {\rm xz}^2 + {\rm yz}^2 \\
|
||||
\cos{\alpha} &=& \frac{{\rm xy}*{\rm xz} + {\rm ly}*{\rm yz}}{b*c} \\
|
||||
\cos{\beta} &=& \frac{\rm xz}{c} \\
|
||||
\cos{\gamma} &=& \frac{\rm xy}{b} \\
|
||||
\end{eqnarray*}
|
||||
|
||||
\end{document}
|
Before Width: | Height: | Size: 10 KiB |
|
@ -1,14 +0,0 @@
|
|||
\documentclass[12pt]{article}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{eqnarray*}
|
||||
{\rm lx} &=& a \\
|
||||
{\rm xy} &=& b \cos{\gamma} \\
|
||||
{\rm xz} &=& c \cos{\beta}\\
|
||||
{\rm ly}^2 &=& b^2 - {\rm xy}^2 \\
|
||||
{\rm yz} &=& \frac{b*c \cos{\alpha} - {\rm xy}*{\rm xz}}{\rm ly} \\
|
||||
{\rm lz}^2 &=& c^2 - {\rm xz}^2 - {\rm yz}^2 \\
|
||||
\end{eqnarray*}
|
||||
|
||||
\end{document}
|
Before Width: | Height: | Size: 4.0 KiB |
|
@ -1,9 +0,0 @@
|
|||
\documentclass[12pt]{article}
|
||||
|
||||
\begin{document}
|
||||
|
||||
$$
|
||||
CS = \sum_{i = 1}^{N/2} | \vec{R}_i + \vec{R}_{i+N/2} |^2
|
||||
$$
|
||||
|
||||
\end{document}
|
Before Width: | Height: | Size: 13 KiB |
|
@ -1,14 +0,0 @@
|
|||
\documentclass[12pt,article]{article}
|
||||
|
||||
\usepackage{indentfirst}
|
||||
\usepackage{amsmath}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{eqnarray*}
|
||||
r_{c}^{fcc} & = & \frac{1}{2} \left(\frac{\sqrt{2}}{2} + 1\right) \mathrm{a} \simeq 0.8536 \:\mathrm{a} \\
|
||||
r_{c}^{bcc} & = & \frac{1}{2}(\sqrt{2} + 1) \mathrm{a} \simeq 1.207 \:\mathrm{a} \\
|
||||
r_{c}^{hcp} & = & \frac{1}{2}\left(1+\sqrt{\frac{4+2x^{2}}{3}}\right) \mathrm{a}
|
||||
\end{eqnarray*}
|
||||
|
||||
\end{document}
|
Before Width: | Height: | Size: 2.5 KiB |
|
@ -1,12 +0,0 @@
|
|||
\documentclass[12pt,article]{article}
|
||||
|
||||
\usepackage{indentfirst}
|
||||
\usepackage{amsmath}
|
||||
|
||||
\begin{document}
|
||||
|
||||
$$
|
||||
Rc + Rs > 2*{\rm cutoff}
|
||||
$$
|
||||
|
||||
\end{document}
|
Before Width: | Height: | Size: 13 KiB |
|
@ -1,14 +0,0 @@
|
|||
\documentclass[12pt,article]{article}
|
||||
|
||||
\usepackage{indentfirst}
|
||||
\usepackage{amsmath}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{eqnarray*}
|
||||
r_{c}^{fcc} & = & \frac{1}{2} \left(\frac{\sqrt{2}}{2} + 1\right) \mathrm{a} \simeq 0.8536 \:\mathrm{a} \\
|
||||
r_{c}^{bcc} & = & \frac{1}{2}(\sqrt{2} + 1) \mathrm{a} \simeq 1.207 \:\mathrm{a} \\
|
||||
r_{c}^{hcp} & = & \frac{1}{2}\left(1+\sqrt{\frac{4+2x^{2}}{3}}\right) \mathrm{a}
|
||||
\end{eqnarray*}
|
||||
|
||||
\end{document}
|
Before Width: | Height: | Size: 2.5 KiB |
|
@ -1,12 +0,0 @@
|
|||
\documentclass[12pt,article]{article}
|
||||
|
||||
\usepackage{indentfirst}
|
||||
\usepackage{amsmath}
|
||||
|
||||
\begin{document}
|
||||
|
||||
$$
|
||||
Rc + Rs > 2*{\rm cutoff}
|
||||
$$
|
||||
|
||||
\end{document}
|
Before Width: | Height: | Size: 23 KiB |
|
@ -1,9 +0,0 @@
|
|||
\documentclass[12pt]{article}
|
||||
|
||||
\begin{document}
|
||||
|
||||
$$
|
||||
Q_{i} = \frac{1}{n_i}\sum_{j = 1}^{n_i} | \sum_{k = 1}^{n_{ij}} \vec{R}_{ik} + \vec{R}_{jk} |^2
|
||||
$$
|
||||
|
||||
\end{document}
|
Before Width: | Height: | Size: 21 KiB |
|
@ -1,13 +0,0 @@
|
|||
\documentstyle[12pt]{article}
|
||||
\pagestyle{empty}
|
||||
\begin{document}
|
||||
|
||||
\begin{eqnarray*}
|
||||
U^{cond} = \displaystyle\sum_{i=1}^{N} u_{i}^{cond} \\
|
||||
U^{mech} = \displaystyle\sum_{i=1}^{N} u_{i}^{mech} \\
|
||||
U^{chem} = \displaystyle\sum_{i=1}^{N} u_{i}^{chem} \\
|
||||
U = \displaystyle\sum_{i=1}^{N} (u_{i}^{cond} + u_{i}^{mech} + u_{i}^{chem}) \\
|
||||
\theta_{avg} = (\frac{1}{N}\displaystyle\sum_{i=1}^{N} \frac{1}{\theta_{i}})^{-1} \\
|
||||
\end{eqnarray*}
|
||||
|
||||
\end{document}
|
Before Width: | Height: | Size: 18 KiB |
|
@ -1,7 +0,0 @@
|
|||
\documentstyle[12pt]{article}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\[ \left< \frac{1}{1 + \exp\left[\left(U_1 - U_0 - \Delta_0^1A \right) /kT \right]} \right>_0 = \left< \frac{1}{1 + \exp\left[\left(U_0 - U_1 + \Delta_0^1A \right) /kT \right]} \right>_1 \]
|
||||
|
||||
\end{document}
|
Before Width: | Height: | Size: 15 KiB |
|
@ -1,10 +0,0 @@
|
|||
\documentstyle[12pt]{article}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\[ \Delta_0^1 A = \int_{\lambda=0}^{\lambda=1} \left( \frac{\partial
|
||||
A(\lambda)}{\partial\lambda} \right)_\lambda \mathrm{d}\lambda
|
||||
\approx \sum_{i=0}^{n-1} w_i \frac{A(\lambda_{i} + \delta) -
|
||||
A(\lambda_i)}{\delta} \]
|
||||
|
||||
\end{document}
|
Before Width: | Height: | Size: 18 KiB |
|
@ -1,9 +0,0 @@
|
|||
\documentstyle[12pt]{article}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\[ \Delta_0^1 A = \sum_{i=0}^{n-1} \Delta_{\lambda_i}^{\lambda_{i+1}} A =
|
||||
- kT \sum_{i=0}^{n-1} \ln \left< \exp \left( - \frac{U(\lambda_{i+1}) -
|
||||
U(\lambda_i)}{kT} \right) \right>_{\lambda_i} \]
|
||||
|
||||
\end{document}
|
Before Width: | Height: | Size: 10 KiB |
|
@ -1,10 +0,0 @@
|
|||
\documentstyle[12pt]{article}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{eqnarray*}
|
||||
\lambda = 0 \quad\Rightarrow\quad U = U_{\mathrm{bg}} + U_0 \\
|
||||
\lambda = 1 \quad\Rightarrow\quad U = U_{\mathrm{bg}} + U_1
|
||||
\end{eqnarray*}
|
||||
|
||||
\end{document}
|
Before Width: | Height: | Size: 18 KiB |
|
@ -1,10 +0,0 @@
|
|||
\documentstyle[12pt]{article}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\[ \Delta_0^1 A = \int_{\lambda=0}^{\lambda=1} \left< \frac{\partial
|
||||
U(\lambda)}{\partial\lambda} \right>_\lambda \mathrm{d}\lambda
|
||||
\approx \sum_{i=0}^{n-1} w_i \left< \frac{U(\lambda_{i} + \delta) -
|
||||
U(\lambda_i)}{\delta} \right>_{\lambda_i} \]
|
||||
|
||||
\end{document}
|
Before Width: | Height: | Size: 9.1 KiB |
|
@ -1,7 +0,0 @@
|
|||
\documentstyle[12pt]{article}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\[ U(\lambda) = U_{\mathrm{bg}} + U_1(\lambda) + U_0(\lambda) \]
|
||||
|
||||
\end{document}
|
Before Width: | Height: | Size: 15 KiB |
|
@ -1,9 +0,0 @@
|
|||
\documentstyle[12pt]{article}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\[ \Delta_0^1 A = - kT \sum_{i=0}^{n-1} \ln \frac{\left< V \exp \left( -
|
||||
\frac{U(\lambda_{i+1}) - U(\lambda_i)}{kT} \right)
|
||||
\right>_{\lambda_i}}{\left< V \right>_{\lambda_i}} \]
|
||||
|
||||
\end{document}
|
Before Width: | Height: | Size: 3.6 KiB |
|
@ -1,9 +0,0 @@
|
|||
\documentstyle[12pt]{article}
|
||||
|
||||
\begin{document}
|
||||
|
||||
$$
|
||||
{R_g}^2 = \frac{1}{M} \sum_i m_i (r_i - r_{cm})^2
|
||||
$$
|
||||
|
||||
\end{document}
|
Before Width: | Height: | Size: 7.1 KiB |
|
@ -1,9 +0,0 @@
|
|||
\documentstyle[12pt]{article}
|
||||
|
||||
\begin{document}
|
||||
|
||||
$$
|
||||
NGP(t) = 3<(r(t)-r(0))^4>/(5<(r(t)-r(0))^2>^2) - 1
|
||||
$$
|
||||
|
||||
\end{document}
|
Before Width: | Height: | Size: 1.4 KiB |
|
@ -1,10 +0,0 @@
|
|||
\documentstyle[12pt]{article}
|
||||
|
||||
\begin{document}
|
||||
|
||||
$$
|
||||
I=\frac{F^{*}F}{N}
|
||||
$$
|
||||
|
||||
\end{document}
|
||||
|
Before Width: | Height: | Size: 4.8 KiB |