doc: more build section updates

This commit is contained in:
Richard Berger
2024-08-14 14:15:48 -06:00
parent e1a0cc29be
commit 26f9a84c4f
7 changed files with 451 additions and 240 deletions

View File

@ -38,8 +38,8 @@ standard. A more detailed discussion of that is below.
.. code-block:: bash .. code-block:: bash
-D BUILD_MPI=value # yes or no, default is yes if CMake finds MPI -D BUILD_MPI=value # yes or no, default is yes if CMake finds MPI
-D BUILD_OMP=value # yes or no, default is yes if a compatible compiler -D BUILD_OMP=value # yes or no, default is yes if a compatible
# is detected # compiler is detected
-D LAMMPS_MACHINE=name # name = mpi, serial, mybox, titan, laptop, etc -D LAMMPS_MACHINE=name # name = mpi, serial, mybox, titan, laptop, etc
# no default value # no default value
@ -268,7 +268,7 @@ LAMMPS.
When the cmake command completes, it prints a summary to the When the cmake command completes, it prints a summary to the
screen which compilers it is using and what flags and settings screen which compilers it is using and what flags and settings
will be used for the compilation. Note that if the top-level will be used for the compilation. Note that if the top-level
compiler is mpicxx, it is simply a wrapper on a real compiler. compiler is ``mpicxx``, it is simply a wrapper on a real compiler.
The underlying compiler info is what CMake will try to The underlying compiler info is what CMake will try to
determine and report. You should check to confirm you are determine and report. You should check to confirm you are
using the compiler and optimization flags you want. using the compiler and optimization flags you want.
@ -325,10 +325,10 @@ LAMMPS.
there may be specific compiler or linker flags that are either there may be specific compiler or linker flags that are either
required or recommended to enable required features and to required or recommended to enable required features and to
achieve optimal performance. You need to include these in the achieve optimal performance. You need to include these in the
CCFLAGS and LINKFLAGS settings above. For details, see the ``CCFLAGS`` and ``LINKFLAGS`` settings above. For details, see the
documentation for the individual packages listed on the documentation for the individual packages listed on the
:doc:`Speed_packages` page. Or examine these files in the :doc:`Speed_packages` page. Or examine these files in the
src/MAKE/OPTIONS directory. They correspond to each of the 5 ``src/MAKE/OPTIONS`` directory. They correspond to each of the 5
accelerator packages and their hardware variants: accelerator packages and their hardware variants:
.. code-block:: bash .. code-block:: bash
@ -498,8 +498,9 @@ using CMake or Make.
.. code-block:: bash .. code-block:: bash
-D BUILD_TOOLS=value # yes or no (default). Build binary2txt, chain.x, -D BUILD_TOOLS=value # yes or no (default). Build binary2txt,
# micelle2d.x, msi2lmp, phana, stl_bin2txt # chain.x, micelle2d.x, msi2lmp, phana,
# stl_bin2txt
-D BUILD_LAMMPS_GUI=value # yes or no (default). Build LAMMPS-GUI -D BUILD_LAMMPS_GUI=value # yes or no (default). Build LAMMPS-GUI
The generated binaries will also become part of the LAMMPS installation The generated binaries will also become part of the LAMMPS installation

View File

@ -144,7 +144,7 @@ once, as the settings from the preset files are stored in the
by adding one or more ``-D`` flags to the CMake command line. by adding one or more ``-D`` flags to the CMake command line.
Generating files for alternate build tools (e.g. Ninja) and project files Generating files for alternate build tools (e.g. Ninja) and project files
for IDEs like Eclipse, CodeBlocks, or Kate can be selected using the *-G* for IDEs like Eclipse, CodeBlocks, or Kate can be selected using the ``-G``
command line flag. A list of available generator settings for your command line flag. A list of available generator settings for your
specific CMake version is given when running ``cmake --help``. specific CMake version is given when running ``cmake --help``.

View File

@ -14,7 +14,7 @@ in addition to
cmake -D PKG_NAME=yes cmake -D PKG_NAME=yes
- .. code-block:: console - .. code-block:: bash
make yes-name make yes-name
@ -73,7 +73,7 @@ COMPRESS package
To build with this package you must have the `zlib compression library To build with this package you must have the `zlib compression library
<https://zlib.net>`_ available on your system to build dump styles with <https://zlib.net>`_ available on your system to build dump styles with
a '/gz' suffix. There are also styles using the a ``/gz`` suffix. There are also styles using the
`Zstandard <https://facebook.github.io/zstd/>`_ library which have a `Zstandard <https://facebook.github.io/zstd/>`_ library which have a
'/zstd' suffix. The zstd library version must be at least 1.4. Older '/zstd' suffix. The zstd library version must be at least 1.4. Older
versions use an incompatible API and thus LAMMPS will fail to compile. versions use an incompatible API and thus LAMMPS will fail to compile.
@ -95,7 +95,7 @@ versions use an incompatible API and thus LAMMPS will fail to compile.
<https://www.freedesktop.org/wiki/Software/pkg-config/>`_ tool to <https://www.freedesktop.org/wiki/Software/pkg-config/>`_ tool to
identify the necessary flags to compile with this library, so the identify the necessary flags to compile with this library, so the
corresponding ``libzstandard.pc`` file must be in a folder where corresponding ``libzstandard.pc`` file must be in a folder where
pkg-config can find it, which may require adding it to the ``pkg-config`` can find it, which may require adding it to the
``PKG_CONFIG_PATH`` environment variable. ``PKG_CONFIG_PATH`` environment variable.
.. tab:: Traditional make .. tab:: Traditional make
@ -127,46 +127,53 @@ CMake build
# value = double or mixed (default) or single # value = double or mixed (default) or single
-D GPU_ARCH=value # primary GPU hardware choice for GPU_API=cuda -D GPU_ARCH=value # primary GPU hardware choice for GPU_API=cuda
# value = sm_XX (see below, default is sm_50) # value = sm_XX (see below, default is sm_50)
-D GPU_DEBUG=value # enable debug code in the GPU package library, mostly useful for developers -D GPU_DEBUG=value # enable debug code in the GPU package library,
# mostly useful for developers
# value = yes or no (default) # value = yes or no (default)
-D HIP_PATH=value # value = path to HIP installation. Must be set if GPU_API=HIP -D HIP_PATH=value # value = path to HIP installation. Must be set if
# GPU_API=HIP
-D HIP_ARCH=value # primary GPU hardware choice for GPU_API=hip -D HIP_ARCH=value # primary GPU hardware choice for GPU_API=hip
# value depends on selected HIP_PLATFORM # value depends on selected HIP_PLATFORM
# default is 'gfx906' for HIP_PLATFORM=amd and 'sm_50' for HIP_PLATFORM=nvcc # default is 'gfx906' for HIP_PLATFORM=amd and 'sm_50' for
# HIP_PLATFORM=nvcc
-D HIP_USE_DEVICE_SORT=value # enables GPU sorting -D HIP_USE_DEVICE_SORT=value # enables GPU sorting
# value = yes (default) or no # value = yes (default) or no
-D CUDPP_OPT=value # use GPU binning on with CUDA (should be off for modern GPUs) -D CUDPP_OPT=value # use GPU binning with CUDA (should be off for modern GPUs)
# enables CUDA Performance Primitives, must be "no" for CUDA_MPS_SUPPORT=yes # enables CUDA Performance Primitives, must be "no" for
# CUDA_MPS_SUPPORT=yes
# value = yes or no (default) # value = yes or no (default)
-D CUDA_MPS_SUPPORT=value # enables some tweaks required to run with active nvidia-cuda-mps daemon -D CUDA_MPS_SUPPORT=value # enables some tweaks required to run with active
# nvidia-cuda-mps daemon
# value = yes or no (default) # value = yes or no (default)
-D CUDA_BUILD_MULTIARCH=value # enables building CUDA kernels for all supported GPU architectures -D CUDA_BUILD_MULTIARCH=value # enables building CUDA kernels for all supported GPU
# architectures
# value = yes (default) or no # value = yes (default) or no
-D USE_STATIC_OPENCL_LOADER=value # downloads/includes OpenCL ICD loader library, no local OpenCL headers/libs needed -D USE_STATIC_OPENCL_LOADER=value # downloads/includes OpenCL ICD loader library,
# no local OpenCL headers/libs needed
# value = yes (default) or no # value = yes (default) or no
:code:`GPU_ARCH` settings for different GPU hardware is as follows: ``GPU_ARCH`` settings for different GPU hardware is as follows:
* sm_30 for Kepler (supported since CUDA 5 and until CUDA 10.x) * ``sm_30`` for Kepler (supported since CUDA 5 and until CUDA 10.x)
* sm_35 or sm_37 for Kepler (supported since CUDA 5 and until CUDA 11.x) * ``sm_35`` or ``sm_37`` for Kepler (supported since CUDA 5 and until CUDA 11.x)
* sm_50 or sm_52 for Maxwell (supported since CUDA 6) * ``sm_50`` or ``sm_52`` for Maxwell (supported since CUDA 6)
* sm_60 or sm_61 for Pascal (supported since CUDA 8) * ``sm_60`` or ``sm_61`` for Pascal (supported since CUDA 8)
* sm_70 for Volta (supported since CUDA 9) * ``sm_70`` for Volta (supported since CUDA 9)
* sm_75 for Turing (supported since CUDA 10) * ``sm_75`` for Turing (supported since CUDA 10)
* sm_80 or sm_86 for Ampere (supported since CUDA 11, sm_86 since CUDA 11.1) * ``sm_80`` or sm_86 for Ampere (supported since CUDA 11, sm_86 since CUDA 11.1)
* sm_89 for Lovelace (supported since CUDA 11.8) * ``sm_89`` for Lovelace (supported since CUDA 11.8)
* sm_90 for Hopper (supported since CUDA 12.0) * ``sm_90`` for Hopper (supported since CUDA 12.0)
A more detailed list can be found, for example, A more detailed list can be found, for example,
at `Wikipedia's CUDA article <https://en.wikipedia.org/wiki/CUDA#GPUs_supported>`_ at `Wikipedia's CUDA article <https://en.wikipedia.org/wiki/CUDA#GPUs_supported>`_
CMake can detect which version of the CUDA toolkit is used and thus will CMake can detect which version of the CUDA toolkit is used and thus will
try to include support for **all** major GPU architectures supported by try to include support for **all** major GPU architectures supported by
this toolkit. Thus the GPU_ARCH setting is merely an optimization, to this toolkit. Thus the ``GPU_ARCH`` setting is merely an optimization, to
have code for the preferred GPU architecture directly included rather have code for the preferred GPU architecture directly included rather
than having to wait for the JIT compiler of the CUDA driver to translate than having to wait for the JIT compiler of the CUDA driver to translate
it. This behavior can be turned off (e.g. to speed up compilation) by it. This behavior can be turned off (e.g. to speed up compilation) by
setting :code:`CUDA_ENABLE_MULTIARCH` to :code:`no`. setting ``CUDA_ENABLE_MULTIARCH`` to ``no``.
When compiling for CUDA or HIP with CUDA, version 8.0 or later of the When compiling for CUDA or HIP with CUDA, version 8.0 or later of the
CUDA toolkit is required and a GPU architecture of Kepler or later, CUDA toolkit is required and a GPU architecture of Kepler or later,
@ -185,21 +192,21 @@ build, and link with a static OpenCL ICD loader library and standard
OpenCL headers. This way no local OpenCL development headers or library OpenCL headers. This way no local OpenCL development headers or library
needs to be present and only OpenCL compatible drivers need to be needs to be present and only OpenCL compatible drivers need to be
installed to use OpenCL. If this is not desired, you can set installed to use OpenCL. If this is not desired, you can set
:code:`USE_STATIC_OPENCL_LOADER` to :code:`no`. ``USE_STATIC_OPENCL_LOADER`` to ``no``.
The GPU library has some multi-thread support using OpenMP. If LAMMPS The GPU library has some multi-thread support using OpenMP. If LAMMPS
is built with ``-D BUILD_OMP=on`` this will also be enabled. is built with ``-D BUILD_OMP=on`` this will also be enabled.
If you are compiling with HIP, note that before running CMake you will If you are compiling with HIP, note that before running CMake you will
have to set appropriate environment variables. Some variables such as have to set appropriate environment variables. Some variables such as
:code:`HCC_AMDGPU_TARGET` (for ROCm <= 4.0) or :code:`CUDA_PATH` are ``HCC_AMDGPU_TARGET`` (for ROCm <= 4.0) or ``CUDA_PATH`` are
necessary for :code:`hipcc` and the linker to work correctly. necessary for ``hipcc`` and the linker to work correctly.
.. versionadded:: 3Aug2022 .. versionadded:: 3Aug2022
Using the CHIP-SPV implementation of HIP is supported. It allows one to Using the CHIP-SPV implementation of HIP is supported. It allows one to
run HIP code on Intel GPUs via the OpenCL or Level Zero backends. To use run HIP code on Intel GPUs via the OpenCL or Level Zero backends. To use
CHIP-SPV, you must set :code:`-DHIP_USE_DEVICE_SORT=OFF` in your CMake CHIP-SPV, you must set ``-DHIP_USE_DEVICE_SORT=OFF`` in your CMake
command line as CHIP-SPV does not yet support hipCUB. As of Summer 2022, command line as CHIP-SPV does not yet support hipCUB. As of Summer 2022,
the use of HIP for Intel GPUs is experimental. You should only use this the use of HIP for Intel GPUs is experimental. You should only use this
option in preparations to run on Aurora system at Argonne. option in preparations to run on Aurora system at Argonne.
@ -263,22 +270,22 @@ script with the specified args:
make lib-gpu args="-m mpi -a sm_60 -p mixed -b" # build GPU library with mixed precision and P100 using other settings in Makefile.mpi make lib-gpu args="-m mpi -a sm_60 -p mixed -b" # build GPU library with mixed precision and P100 using other settings in Makefile.mpi
Note that this procedure starts with a Makefile.machine in lib/gpu, as Note that this procedure starts with a Makefile.machine in lib/gpu, as
specified by the "-m" switch. For your convenience, machine makefiles specified by the ``-m`` switch. For your convenience, machine makefiles
for "mpi" and "serial" are provided, which have the same settings as for "mpi" and "serial" are provided, which have the same settings as
the corresponding machine makefiles in the main LAMMPS source the corresponding machine makefiles in the main LAMMPS source
folder. In addition you can alter 4 important settings in the folder. In addition you can alter 4 important settings in the
Makefile.machine you start from via the corresponding -c, -a, -p, -e Makefile.machine you start from via the corresponding ``-c``, ``-a``, ``-p``, ``-e``
switches (as in the examples above), and also save a copy of the new switches (as in the examples above), and also save a copy of the new
Makefile if desired: Makefile if desired:
* ``CUDA_HOME`` = where NVIDIA CUDA software is installed on your system * ``CUDA_HOME`` = where NVIDIA CUDA software is installed on your system
* ``CUDA_ARCH`` = sm_XX, what GPU hardware you have, same as CMake GPU_ARCH above * ``CUDA_ARCH`` = ``sm_XX``, what GPU hardware you have, same as CMake ``GPU_ARCH`` above
* ``CUDA_PRECISION`` = precision (double, mixed, single) * ``CUDA_PRECISION`` = precision (double, mixed, single)
* ``EXTRAMAKE`` = which Makefile.lammps.\* file to copy to Makefile.lammps * ``EXTRAMAKE`` = which ``Makefile.lammps.*`` file to copy to Makefile.lammps
The file Makefile.cuda is set up to include support for multiple The file ``Makefile.cuda`` is set up to include support for multiple
GPU architectures as supported by the CUDA toolkit in use. This is done GPU architectures as supported by the CUDA toolkit in use. This is done
through using the "--gencode " flag, which can be used multiple times and through using the ``--gencode`` flag, which can be used multiple times and
thus support all GPU architectures supported by your CUDA compiler. thus support all GPU architectures supported by your CUDA compiler.
To enable GPU binning via CUDA performance primitives set the Makefile variable To enable GPU binning via CUDA performance primitives set the Makefile variable
@ -349,12 +356,16 @@ minutes to hours) to build. Of course you only need to do that once.)
.. code-block:: bash .. code-block:: bash
-D DOWNLOAD_KIM=value # download OpenKIM API v2 for build, value = no (default) or yes -D DOWNLOAD_KIM=value # download OpenKIM API v2 for build
-D LMP_DEBUG_CURL=value # set libcurl verbose mode on/off, value = off (default) or on # value = no (default) or yes
-D LMP_NO_SSL_CHECK=value # tell libcurl to not verify the peer, value = no (default) or yes -D LMP_DEBUG_CURL=value # set libcurl verbose mode on/off
-D KIM_EXTRA_UNITTESTS=value # enables extra unit tests, value = no (default) or yes # value = off (default) or on
-D LMP_NO_SSL_CHECK=value # tell libcurl to not verify the peer
# value = no (default) or yes
-D KIM_EXTRA_UNITTESTS=value # enables extra unit tests
# value = no (default) or yes
If ``DOWNLOAD_KIM`` is set to *yes* (or *on*), the KIM API library If ``DOWNLOAD_KIM`` is set to ``yes`` (or ``on``), the KIM API library
will be downloaded and built inside the CMake build directory. If will be downloaded and built inside the CMake build directory. If
the KIM library is already installed on your system (in a location the KIM library is already installed on your system (in a location
where CMake cannot find it), you may need to set the where CMake cannot find it), you may need to set the
@ -362,7 +373,7 @@ minutes to hours) to build. Of course you only need to do that once.)
found, or run the command ``source kim-api-activate``. found, or run the command ``source kim-api-activate``.
Extra unit tests can only be available if they are explicitly requested Extra unit tests can only be available if they are explicitly requested
(``KIM_EXTRA_UNITTESTS`` is set to *yes* (or *on*)) and the prerequisites (``KIM_EXTRA_UNITTESTS`` is set to ``yes`` (or ``on``)) and the prerequisites
are met. See :ref:`KIM Extra unit tests <kim_extra_unittests>` for are met. See :ref:`KIM Extra unit tests <kim_extra_unittests>` for
more details on this. more details on this.
@ -376,15 +387,28 @@ minutes to hours) to build. Of course you only need to do that once.)
.. code-block:: bash .. code-block:: bash
make lib-kim # print help message # print help message
make lib-kim args="-b " # (re-)install KIM API lib with only example models make lib-kim
make lib-kim args="-b -a Glue_Ercolessi_Adams_Al__MO_324507536345_001" # ditto plus one model
make lib-kim args="-b -a everything" # install KIM API lib with all models
make lib-kim args="-n -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # add one model or model driver
make lib-kim args="-p /usr/local" # use an existing KIM API installation at the provided location
make lib-kim args="-p /usr/local -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # ditto but add one model or driver
When using the "-b " option, the KIM library is built using its native # (re-)install KIM API lib with only example models
make lib-kim args="-b "
# ditto plus one model
make lib-kim args="-b -a Glue_Ercolessi_Adams_Al__MO_324507536345_001"
# install KIM API lib with all models
make lib-kim args="-b -a everything"
# add one model or model driver
make lib-kim args="-n -a EAM_Dynamo_Ackland_W__MO_141627196590_002"
# use an existing KIM API installation at the provided location
make lib-kim args="-p <prefix>"
# ditto but add one model or driver
make lib-kim args="-p <prefix> -a EAM_Dynamo_Ackland_W__MO_141627196590_002"
When using the ``-b `` option, the KIM library is built using its native
cmake build system. The ``lib/kim/Install.py`` script supports a cmake build system. The ``lib/kim/Install.py`` script supports a
``CMAKE`` environment variable if the cmake executable is named other ``CMAKE`` environment variable if the cmake executable is named other
than ``cmake`` on your system. Additional environment variables may be than ``cmake`` on your system. Additional environment variables may be
@ -394,7 +418,9 @@ minutes to hours) to build. Of course you only need to do that once.)
.. code-block:: bash .. code-block:: bash
CMAKE=cmake3 CXX=g++-11 CC=gcc-11 FC=gfortran-11 make lib-kim args="-b " # (re-)install KIM API lib using cmake3 and gnu v11 compilers with only example models # (re-)install KIM API lib using cmake3 and gnu v11 compilers
# with only example models
CMAKE=cmake3 CXX=g++-11 CC=gcc-11 FC=gfortran-11 make lib-kim args="-b "
Settings for debugging OpenKIM web queries discussed below need to Settings for debugging OpenKIM web queries discussed below need to
be applied by adding them to the ``LMP_INC`` variable through be applied by adding them to the ``LMP_INC`` variable through
@ -434,7 +460,7 @@ KIM Extra unit tests (CMake only)
During development, testing, or debugging, if During development, testing, or debugging, if
:doc:`unit testing <Build_development>` is enabled in LAMMPS, one can also :doc:`unit testing <Build_development>` is enabled in LAMMPS, one can also
enable extra tests on :doc:`KIM commands <kim_commands>` by setting the enable extra tests on :doc:`KIM commands <kim_commands>` by setting the
``KIM_EXTRA_UNITTESTS`` to *yes* (or *on*). ``KIM_EXTRA_UNITTESTS`` to ``yes`` (or ``on``).
Enabling the extra unit tests have some requirements, Enabling the extra unit tests have some requirements,
@ -449,10 +475,10 @@ Enabling the extra unit tests have some requirements,
*conda-forge* channel as ``conda install kim-property`` if LAMMPS is built in *conda-forge* channel as ``conda install kim-property`` if LAMMPS is built in
Conda. More detailed information is available at: Conda. More detailed information is available at:
`kim-property installation <https://github.com/openkim/kim-property#installing-kim-property>`_. `kim-property installation <https://github.com/openkim/kim-property#installing-kim-property>`_.
* It is also necessary to install * It is also necessary to install the following KIM models:
``EAM_Dynamo_MendelevAckland_2007v3_Zr__MO_004835508849_000``, - ``EAM_Dynamo_MendelevAckland_2007v3_Zr__MO_004835508849_000``
``EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005``, and - ``EAM_Dynamo_ErcolessiAdams_1994_Al__MO_123629422045_005``
``LennardJones612_UniversalShifted__MO_959249795837_003`` KIM models. - ``LennardJones612_UniversalShifted__MO_959249795837_003``
See `Obtaining KIM Models <https://openkim.org/doc/usage/obtaining-models>`_ See `Obtaining KIM Models <https://openkim.org/doc/usage/obtaining-models>`_
to learn how to install a pre-built binary of the OpenKIM Repository of to learn how to install a pre-built binary of the OpenKIM Repository of
Models or see Models or see
@ -729,7 +755,8 @@ This list was last updated for version 4.3.0 of the Kokkos library.
mkdir build-kokkos-cuda mkdir build-kokkos-cuda
cd build-kokkos-cuda cd build-kokkos-cuda
cmake -C ../cmake/presets/basic.cmake -C ../cmake/presets/kokkos-cuda.cmake ../cmake cmake -C ../cmake/presets/basic.cmake \
-C ../cmake/presets/kokkos-cuda.cmake ../cmake
cmake --build . cmake --build .
.. tab:: Basic traditional make settings: .. tab:: Basic traditional make settings:
@ -757,9 +784,10 @@ This list was last updated for version 4.3.0 of the Kokkos library.
.. code-block:: make .. code-block:: make
KOKKOS_DEVICES = Cuda KOKKOS_DEVICES = Cuda
KOKKOS_ARCH = HOSTARCH,GPUARCH # HOSTARCH = HOST from list above that is hosting the GPU KOKKOS_ARCH = HOSTARCH,GPUARCH # HOSTARCH = HOST from list above that is
KOKKOS_CUDA_OPTIONS = "enable_lambda" # hosting the GPU
# GPUARCH = GPU from list above # GPUARCH = GPU from list above
KOKKOS_CUDA_OPTIONS = "enable_lambda"
FFT_INC = -DFFT_CUFFT # enable use of cuFFT (optional) FFT_INC = -DFFT_CUFFT # enable use of cuFFT (optional)
FFT_LIB = -lcufft # link to cuFFT library FFT_LIB = -lcufft # link to cuFFT library
@ -787,7 +815,8 @@ This list was last updated for version 4.3.0 of the Kokkos library.
.. code-block:: make .. code-block:: make
KOKKOS_DEVICES = HIP KOKKOS_DEVICES = HIP
KOKKOS_ARCH = HOSTARCH,GPUARCH # HOSTARCH = HOST from list above that is hosting the GPU KOKKOS_ARCH = HOSTARCH,GPUARCH # HOSTARCH = HOST from list above that is
# hosting the GPU
# GPUARCH = GPU from list above # GPUARCH = GPU from list above
FFT_INC = -DFFT_HIPFFT # enable use of hipFFT (optional) FFT_INC = -DFFT_HIPFFT # enable use of hipFFT (optional)
FFT_LIB = -lhipfft # link to hipFFT library FFT_LIB = -lhipfft # link to hipFFT library
@ -874,11 +903,16 @@ included in the LAMMPS source distribution in the ``lib/lepton`` folder.
.. code-block:: bash .. code-block:: bash
make lib-lepton # print help message # print help message
make lib-lepton args="-m serial" # build with GNU g++ compiler (settings as with "make serial") make lib-lepton
make lib-lepton args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
The "machine" argument of the "-m" flag is used to find a # build with GNU g++ compiler (settings as with "make serial")
make lib-lepton args="-m serial"
# build with default MPI compiler (settings as with "make mpi")
make lib-lepton args="-m mpi"
The "machine" argument of the ``-m`` flag is used to find a
Makefile.machine to use as build recipe. Makefile.machine to use as build recipe.
The build should produce a ``build`` folder and the library ``lib/lepton/liblmplepton.a`` The build should produce a ``build`` folder and the library ``lib/lepton/liblmplepton.a``
@ -900,7 +934,8 @@ Eigen3 is a template library, so you do not need to build it.
.. code-block:: bash .. code-block:: bash
-D DOWNLOAD_EIGEN3 # download Eigen3, value = no (default) or yes -D DOWNLOAD_EIGEN3 # download Eigen3, value = no (default) or yes
-D EIGEN3_INCLUDE_DIR=path # path to Eigen library (only needed if a custom location) -D EIGEN3_INCLUDE_DIR=path # path to Eigen library (only needed if a
# custom location)
If ``DOWNLOAD_EIGEN3`` is set, the Eigen3 library will be If ``DOWNLOAD_EIGEN3`` is set, the Eigen3 library will be
downloaded and inside the CMake build directory. If the Eigen3 downloaded and inside the CMake build directory. If the Eigen3
@ -918,9 +953,14 @@ Eigen3 is a template library, so you do not need to build it.
.. code-block:: bash .. code-block:: bash
make lib-machdyn # print help message # print help message
make lib-machdyn args="-b" # download to lib/machdyn/eigen3 make lib-machdyn
make lib-machdyn args="-p /usr/include/eigen3" # use existing Eigen installation in /usr/include/eigen3
# download to lib/machdyn/eigen3
make lib-machdyn args="-b"
# use existing Eigen installation in /usr/include/eigen3
make lib-machdyn args="-p /usr/include/eigen3"
Note that a symbolic (soft) link named ``includelink`` is created Note that a symbolic (soft) link named ``includelink`` is created
in ``lib/machdyn`` to point to the Eigen dir. When LAMMPS builds it in ``lib/machdyn`` to point to the Eigen dir. When LAMMPS builds it
@ -994,7 +1034,7 @@ OPT package
The compiler flag ``-restrict`` must be used to build LAMMPS with The compiler flag ``-restrict`` must be used to build LAMMPS with
the OPT package when using Intel compilers. It should be added to the OPT package when using Intel compilers. It should be added to
the :code:`CCFLAGS` line of your ``Makefile.machine``. See the ``CCFLAGS`` line of your ``Makefile.machine``. See
``src/MAKE/OPTIONS/Makefile.opt`` for an example. ``src/MAKE/OPTIONS/Makefile.opt`` for an example.
---------- ----------
@ -1021,10 +1061,17 @@ POEMS package
.. code-block:: bash .. code-block:: bash
make lib-poems # print help message # print help message
make lib-poems args="-m serial" # build with GNU g++ compiler (settings as with "make serial") make lib-poems
make lib-poems args="-m mpi" # build with default MPI C++ compiler (settings as with "make mpi")
make lib-poems args="-m icc" # build with Intel icc compiler # build with GNU g++ compiler (settings as with "make serial")
make lib-poems args="-m serial"
# build with default MPI C++ compiler (settings as with "make mpi")
make lib-poems args="-m mpi"
# build with Intel icc compiler
make lib-poems args="-m icc"
The build should produce two files: ``lib/poems/libpoems.a`` and The build should produce two files: ``lib/poems/libpoems.a`` and
``lib/poems/Makefile.lammps``. The latter is copied from an ``lib/poems/Makefile.lammps``. The latter is copied from an
@ -1088,9 +1135,12 @@ binary package provided by your operating system.
.. code-block:: bash .. code-block:: bash
-D DOWNLOAD_VORO=value # download Voro++ for build, value = no (default) or yes -D DOWNLOAD_VORO=value # download Voro++ for build
-D VORO_LIBRARY=path # Voro++ library file (only needed if at custom location) # value = no (default) or yes
-D VORO_INCLUDE_DIR=path # Voro++ include directory (only needed if at custom location) -D VORO_LIBRARY=path # Voro++ library file
# (only needed if at custom location)
-D VORO_INCLUDE_DIR=path # Voro++ include directory
# (only needed if at custom location)
If ``DOWNLOAD_VORO`` is set, the Voro++ library will be downloaded If ``DOWNLOAD_VORO`` is set, the Voro++ library will be downloaded
and built inside the CMake build directory. If the Voro++ library and built inside the CMake build directory. If the Voro++ library
@ -1110,12 +1160,19 @@ binary package provided by your operating system.
.. code-block:: bash .. code-block:: bash
make lib-voronoi # print help message # print help message
make lib-voronoi args="-b" # download and build the default version in lib/voronoi/voro++-<version> make lib-voronoi
make lib-voronoi args="-p $HOME/voro++" # use existing Voro++ installation in $HOME/voro++
make lib-voronoi args="-b -v voro++0.4.6" # download and build the 0.4.6 version in lib/voronoi/voro++-0.4.6
Note that 2 symbolic (soft) links, ``includelink`` and # download and build the default version in lib/voronoi/voro++-<version>
make lib-voronoi args="-b"
# use existing Voro++ installation in $HOME/voro++
make lib-voronoi args="-p $HOME/voro++"
# download and build the 0.4.6 version in lib/voronoi/voro++-0.4.6
make lib-voronoi args="-b -v voro++0.4.6"
Note that two symbolic (soft) links, ``includelink`` and
``liblink``, are created in lib/voronoi to point to the Voro++ ``liblink``, are created in lib/voronoi to point to the Voro++
source dir. When LAMMPS builds in ``src`` it will use these source dir. When LAMMPS builds in ``src`` it will use these
links. You should not need to edit the links. You should not need to edit the
@ -1189,10 +1246,17 @@ The ATC package requires the MANYBODY package also be installed.
.. code-block:: bash .. code-block:: bash
make lib-atc # print help message # print help message
make lib-atc args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial") make lib-atc
make lib-atc args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
make lib-atc args="-m icc" # build with Intel icc compiler # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
make lib-atc args="-m serial"
# build with default MPI compiler (settings as with "make mpi")
make lib-atc args="-m mpi"
# build with Intel icc compiler
make lib-atc args="-m icc"
The build should produce two files: ``lib/atc/libatc.a`` and The build should produce two files: ``lib/atc/libatc.a`` and
``lib/atc/Makefile.lammps``. The latter is copied from an ``lib/atc/Makefile.lammps``. The latter is copied from an
@ -1211,10 +1275,17 @@ The ATC package requires the MANYBODY package also be installed.
.. code-block:: bash .. code-block:: bash
make lib-linalg # print help message # print help message
make lib-linalg args="-m serial" # build with GNU C++ compiler (settings as with "make serial") make lib-linalg
make lib-linalg args="-m mpi" # build with default MPI C++ compiler (settings as with "make mpi")
make lib-linalg args="-m g++" # build with GNU Fortran compiler # build with GNU C++ compiler (settings as with "make serial")
make lib-linalg args="-m serial"
# build with default MPI C++ compiler (settings as with "make mpi")
make lib-linalg args="-m mpi"
# build with GNU Fortran compiler
make lib-linalg args="-m g++"
---------- ----------
@ -1240,10 +1311,17 @@ AWPMD package
.. code-block:: bash .. code-block:: bash
make lib-awpmd # print help message # print help message
make lib-awpmd args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial") make lib-awpmd
make lib-awpmd args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
make lib-awpmd args="-m icc" # build with Intel icc compiler # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
make lib-awpmd args="-m serial"
# build with default MPI compiler (settings as with "make mpi")
make lib-awpmd args="-m mpi"
# build with Intel icc compiler
make lib-awpmd args="-m icc"
The build should produce two files: ``lib/awpmd/libawpmd.a`` and The build should produce two files: ``lib/awpmd/libawpmd.a`` and
``lib/awpmd/Makefile.lammps``. The latter is copied from an ``lib/awpmd/Makefile.lammps``. The latter is copied from an
@ -1262,10 +1340,17 @@ AWPMD package
.. code-block:: bash .. code-block:: bash
make lib-linalg # print help message # print help message
make lib-linalg args="-m serial" # build with GNU C++ compiler (settings as with "make serial") make lib-linalg
make lib-linalg args="-m mpi" # build with default MPI C++ compiler (settings as with "make mpi")
make lib-linalg args="-m g++" # build with GNU C++ compiler # build with GNU C++ compiler (settings as with "make serial")
make lib-linalg args="-m serial"
# build with default MPI C++ compiler (settings as with "make mpi")
make lib-linalg args="-m mpi"
# build with GNU C++ compiler
make lib-linalg args="-m g++"
---------- ----------
@ -1298,10 +1383,17 @@ module included in the LAMMPS source distribution.
.. code-block:: bash .. code-block:: bash
make lib-colvars # print help message # print help message
make lib-colvars args="-m serial" # build with GNU g++ compiler (settings as with "make serial") make lib-colvars
make lib-colvars args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
make lib-colvars args="-m g++-debug" # build with GNU g++ compiler and colvars debugging enabled # build with GNU g++ compiler (settings as with "make serial")
make lib-colvars args="-m serial"
# build with default MPI compiler (settings as with "make mpi")
make lib-colvars args="-m mpi"
# build with GNU g++ compiler and colvars debugging enabled
make lib-colvars args="-m g++-debug"
The "machine" argument of the "-m" flag is used to find a The "machine" argument of the "-m" flag is used to find a
``Makefile.machine`` file to use as build recipe. If such recipe does ``Makefile.machine`` file to use as build recipe. If such recipe does
@ -1320,8 +1412,11 @@ module included in the LAMMPS source distribution.
.. code-block:: bash .. code-block:: bash
COLVARS_DEBUG=yes make lib-colvars args="-m machine" # Build with debug code (much slower) # Build with debug code (much slower)
COLVARS_LEPTON=no make lib-colvars args="-m machine" # Build without Lepton (included otherwise) COLVARS_DEBUG=yes make lib-colvars args="-m machine"
# Build without Lepton (included otherwise)
COLVARS_LEPTON=no make lib-colvars args="-m machine"
The build should produce two files: the library The build should produce two files: the library
``lib/colvars/libcolvars.a`` and the specification file ``lib/colvars/libcolvars.a`` and the specification file
@ -1368,9 +1463,14 @@ This package depends on the KSPACE package.
.. code-block:: bash .. code-block:: bash
make lib-electrode # print help message # print help message
make lib-electrode args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial") make lib-electrode
make lib-electrode args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
# build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
make lib-electrode args="-m serial"
# build with default MPI compiler (settings as with "make mpi")
make lib-electrode args="-m mpi"
Note that the ``Makefile.lammps`` file has settings for the BLAS Note that the ``Makefile.lammps`` file has settings for the BLAS
@ -1381,10 +1481,17 @@ This package depends on the KSPACE package.
.. code-block:: bash .. code-block:: bash
make lib-linalg # print help message # print help message
make lib-linalg args="-m serial" # build with GNU C++ compiler (settings as with "make serial") make lib-linalg
make lib-linalg args="-m mpi" # build with default MPI C++ compiler (settings as with "make mpi")
make lib-linalg args="-m g++" # build with GNU C++ compiler # build with GNU C++ compiler (settings as with "make serial")
make lib-linalg args="-m serial"
# build with default MPI C++ compiler (settings as with "make mpi")
make lib-linalg args="-m mpi"
# build with GNU C++ compiler
make lib-linalg args="-m g++"
The package itself is activated with ``make yes-KSPACE`` and The package itself is activated with ``make yes-KSPACE`` and
``make yes-ELECTRODE`` ``make yes-ELECTRODE``
@ -1424,8 +1531,11 @@ at: `https://github.com/ICAMS/lammps-user-pace/ <https://github.com/ICAMS/lammps
.. code-block:: bash .. code-block:: bash
make lib-pace # print help message # print help message
make lib-pace args="-b" # download and build the default version in lib/pace make lib-pace
# download and build the default version in lib/pace
make lib-pace args="-b"
You should not need to edit the ``lib/pace/Makefile.lammps`` file. You should not need to edit the ``lib/pace/Makefile.lammps`` file.
@ -1452,10 +1562,17 @@ ML-POD package
.. code-block:: bash .. code-block:: bash
make lib-mlpod # print help message # print help message
make lib-mlpod args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial") make lib-mlpod
make lib-mlpod args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
make lib-mlpod args="-m mpi -e linalg" # same as above but use the bundled linalg lib # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
make lib-mlpod args="-m serial"
# build with default MPI compiler (settings as with "make mpi")
make lib-mlpod args="-m mpi"
# same as above but use the bundled linalg lib
make lib-mlpod args="-m mpi -e linalg"
Note that the ``Makefile.lammps`` file has settings to use the BLAS Note that the ``Makefile.lammps`` file has settings to use the BLAS
and LAPACK linear algebra libraries. These can either exist on and LAPACK linear algebra libraries. These can either exist on
@ -1465,10 +1582,17 @@ ML-POD package
.. code-block:: bash .. code-block:: bash
make lib-linalg # print help message # print help message
make lib-linalg args="-m serial" # build with GNU C++ compiler (settings as with "make serial") make lib-linalg
make lib-linalg args="-m mpi" # build with default MPI C++ compiler (settings as with "make mpi")
make lib-linalg args="-m g++" # build with GNU C++ compiler # build with GNU C++ compiler (settings as with "make serial")
make lib-linalg args="-m serial"
# build with default MPI C++ compiler (settings as with "make mpi")
make lib-linalg args="-m mpi"
# build with GNU C++ compiler
make lib-linalg args="-m g++"
The package itself is activated with ``make yes-ML-POD``. The package itself is activated with ``make yes-ML-POD``.
@ -1491,9 +1615,12 @@ within CMake will download the non-commercial use version.
.. code-block:: bash .. code-block:: bash
-D DOWNLOAD_QUIP=value # download QUIP library for build, value = no (default) or yes -D DOWNLOAD_QUIP=value # download QUIP library for build
-D QUIP_LIBRARY=path # path to libquip.a (only needed if a custom location) # value = no (default) or yes
-D USE_INTERNAL_LINALG=value # Use the internal linear algebra library instead of LAPACK -D QUIP_LIBRARY=path # path to libquip.a
# (only needed if a custom location)
-D USE_INTERNAL_LINALG=value # Use the internal linear algebra library
# instead of LAPACK
# value = no (default) or yes # value = no (default) or yes
CMake will try to download and build the QUIP library from GitHub, CMake will try to download and build the QUIP library from GitHub,
@ -1578,17 +1705,20 @@ LAMMPS build.
.. code-block:: bash .. code-block:: bash
-D DOWNLOAD_PLUMED=value # download PLUMED for build, value = no (default) or yes -D DOWNLOAD_PLUMED=value # download PLUMED for build
-D PLUMED_MODE=value # Linkage mode for PLUMED, value = static (default), shared, or runtime # value = no (default) or yes
-D PLUMED_MODE=value # Linkage mode for PLUMED
# value = static (default), shared,
# or runtime
If DOWNLOAD_PLUMED is set to "yes", the PLUMED library will be If ``DOWNLOAD_PLUMED`` is set to ``yes``, the PLUMED library will be
downloaded (the version of PLUMED that will be downloaded is downloaded (the version of PLUMED that will be downloaded is
hard-coded to a vetted version of PLUMED, usually a recent stable hard-coded to a vetted version of PLUMED, usually a recent stable
release version) and built inside the CMake build directory. If release version) and built inside the CMake build directory. If
``DOWNLOAD_PLUMED`` is set to "no" (the default), CMake will try ``DOWNLOAD_PLUMED`` is set to "no" (the default), CMake will try
to detect and link to an installed version of PLUMED. For this to to detect and link to an installed version of PLUMED. For this to
work, the PLUMED library has to be installed into a location where work, the PLUMED library has to be installed into a location where
the ``pkg-config`` tool can find it or the PKG_CONFIG_PATH the ``pkg-config`` tool can find it or the ``PKG_CONFIG_PATH``
environment variable has to be set up accordingly. PLUMED should environment variable has to be set up accordingly. PLUMED should
be installed in such a location if you compile it using the be installed in such a location if you compile it using the
default make; make install commands. default make; make install commands.
@ -1617,14 +1747,21 @@ LAMMPS build.
.. code-block:: bash .. code-block:: bash
make lib-plumed # print help message # print help message
make lib-plumed args="-b" # download and build PLUMED in lib/plumed/plumed2 make lib-plumed
make lib-plumed args="-p $HOME/.local" # use existing PLUMED installation in $HOME/.local
make lib-plumed args="-p /usr/local -m shared" # use existing PLUMED installation in
# /usr/local and use shared linkage mode
Note that 2 symbolic (soft) links, ``includelink`` and ``liblink`` # download and build PLUMED in lib/plumed/plumed2
are created in lib/plumed that point to the location of the PLUMED make lib-plumed args="-b"
# use existing PLUMED installation in $HOME/.local
make lib-plumed args="-p $HOME/.local"
# use existing PLUMED installation in /usr/local and
# use shared linkage mode
make lib-plumed args="-p /usr/local -m shared"
Note that two symbolic (soft) links, ``includelink`` and ``liblink``
are created in ``lib/plumed`` that point to the location of the PLUMED
build to use. A new file ``lib/plumed/Makefile.lammps`` is also build to use. A new file ``lib/plumed/Makefile.lammps`` is also
created with settings suitable for LAMMPS to compile and link created with settings suitable for LAMMPS to compile and link
PLUMED using the desired linkage mode. After this step is PLUMED using the desired linkage mode. After this step is
@ -1639,17 +1776,17 @@ LAMMPS build.
Once this compilation completes you should be able to run LAMMPS Once this compilation completes you should be able to run LAMMPS
in the usual way. For shared linkage mode, libplumed.so must be in the usual way. For shared linkage mode, libplumed.so must be
found by the LAMMPS executable, which on many operating systems found by the LAMMPS executable, which on many operating systems
means, you have to set the LD_LIBRARY_PATH environment variable means, you have to set the ``LD_LIBRARY_PATH`` environment variable
accordingly. accordingly.
Support for the different linkage modes in LAMMPS varies for Support for the different linkage modes in LAMMPS varies for
different operating systems, using the static linkage is expected different operating systems, using the static linkage is expected
to be the most portable, and thus set to be the default. to be the most portable, and thus set to be the default.
If you want to change the linkage mode, you have to re-run "make If you want to change the linkage mode, you have to re-run ``make
lib-plumed" with the desired settings **and** do a re-install if lib-plumed`` with the desired settings **and** do a re-install if
the PLUMED package with "make yes-plumed" to update the the PLUMED package with ``make yes-plumed`` to update the
required makefile settings with the changes in the lib/plumed required makefile settings with the changes in the ``lib/plumed``
folder. folder.
---------- ----------
@ -1723,8 +1860,10 @@ details please see ``lib/hdnnp/README`` and the `n2p2 build documentation
.. code-block:: bash .. code-block:: bash
-D DOWNLOAD_N2P2=value # download n2p2 for build, value = no (default) or yes -D DOWNLOAD_N2P2=value # download n2p2 for build
-D N2P2_DIR=path # n2p2 base directory (only needed if a custom location) # value = no (default) or yes
-D N2P2_DIR=path # n2p2 base directory
# (only needed if a custom location)
If ``DOWNLOAD_N2P2`` is set, the *n2p2* library will be downloaded and If ``DOWNLOAD_N2P2`` is set, the *n2p2* library will be downloaded and
built inside the CMake build directory. If the *n2p2* library is already built inside the CMake build directory. If the *n2p2* library is already
@ -1741,12 +1880,19 @@ details please see ``lib/hdnnp/README`` and the `n2p2 build documentation
.. code-block:: bash .. code-block:: bash
make lib-hdnnp # print help message # print help message
make lib-hdnnp args="-b" # download and build in lib/hdnnp/n2p2-... make lib-hdnnp
make lib-hdnnp args="-b -v 2.1.4" # download and build specific version
make lib-hdnnp args="-p /usr/local/n2p2" # use the existing n2p2 installation in /usr/local/n2p2
Note that 3 symbolic (soft) links, ``includelink``, ``liblink`` and # download and build in lib/hdnnp/n2p2-...
make lib-hdnnp args="-b"
# download and build specific version
make lib-hdnnp args="-b -v 2.1.4"
# use the existing n2p2 installation in /usr/local/n2p2
make lib-hdnnp args="-p /usr/local/n2p2"
Note that three symbolic (soft) links, ``includelink``, ``liblink`` and
``Makefile.lammps``, will be created in ``lib/hdnnp`` to point to ``Makefile.lammps``, will be created in ``lib/hdnnp`` to point to
``n2p2/include``, ``n2p2/lib`` and ``n2p2/lib/Makefile.lammps-extra``, ``n2p2/include``, ``n2p2/lib`` and ``n2p2/lib/Makefile.lammps-extra``,
respectively. When LAMMPS is built in ``src`` it will use these links. respectively. When LAMMPS is built in ``src`` it will use these links.
@ -1834,7 +1980,8 @@ MDI package
.. code-block:: bash .. code-block:: bash
-D DOWNLOAD_MDI=value # download MDI Library for build, value = no (default) or yes -D DOWNLOAD_MDI=value # download MDI Library for build
# value = no (default) or yes
.. tab:: Traditional make .. tab:: Traditional make
@ -1863,7 +2010,8 @@ MOLFILE package
.. code-block:: bash .. code-block:: bash
-D MOLFILE_INCLUDE_DIR=path # (optional) path where VMD molfile plugin headers are installed -D MOLFILE_INCLUDE_DIR=path # (optional) path where VMD molfile
# plugin headers are installed
-D PKG_MOLFILE=yes -D PKG_MOLFILE=yes
Using ``-D PKG_MOLFILE=yes`` enables the package, and setting Using ``-D PKG_MOLFILE=yes`` enables the package, and setting
@ -2022,10 +2170,17 @@ verified to work in February 2020 with Quantum Espresso versions 6.3 to
.. code-block:: bash .. code-block:: bash
make lib-qmmm # print help message # print help message
make lib-qmmm args="-m serial" # build with GNU Fortran compiler (settings as in "make serial") make lib-qmmm
make lib-qmmm args="-m mpi" # build with default MPI compiler (settings as in "make mpi")
make lib-qmmm args="-m gfortran" # build with GNU Fortran compiler # build with GNU Fortran compiler (settings as in "make serial")
make lib-qmmm args="-m serial"
# build with default MPI compiler (settings as in "make mpi")
make lib-qmmm args="-m mpi"
# build with GNU Fortran compiler
make lib-qmmm args="-m gfortran"
The build should produce two files: ``lib/qmmm/libqmmm.a`` and The build should produce two files: ``lib/qmmm/libqmmm.a`` and
``lib/qmmm/Makefile.lammps``. The latter is copied from an ``lib/qmmm/Makefile.lammps``. The latter is copied from an
@ -2038,10 +2193,10 @@ verified to work in February 2020 with Quantum Espresso versions 6.3 to
You can then install QMMM package and build LAMMPS in the usual You can then install QMMM package and build LAMMPS in the usual
manner. After completing the LAMMPS build and compiling Quantum manner. After completing the LAMMPS build and compiling Quantum
ESPRESSO with external library support (via "make couple"), go ESPRESSO with external library support (via ``make couple``), go
back to the ``lib/qmmm`` folder and follow the instructions in the back to the ``lib/qmmm`` folder and follow the instructions in the
README file to build the combined LAMMPS/QE QM/MM executable README file to build the combined LAMMPS/QE QM/MM executable
(pwqmmm.x) in the lib/qmmm folder. (``pwqmmm.x``) in the ``lib/qmmm`` folder.
---------- ----------
@ -2111,11 +2266,16 @@ To build with this package, you must download and build the
.. code-block:: bash .. code-block:: bash
make lib-scafacos # print help message # print help message
make lib-scafacos args="-b" # download and build in lib/scafacos/scafacos-<version> make lib-scafacos
make lib-scafacos args="-p $HOME/scafacos # use existing ScaFaCoS installation in $HOME/scafacos
Note that 2 symbolic (soft) links, ``includelink`` and ``liblink``, are # download and build in lib/scafacos/scafacos-<version>
make lib-scafacos args="-b"
# use existing ScaFaCoS installation in $HOME/scafacos
make lib-scafacos args="-p $HOME/scafacos
Note that two symbolic (soft) links, ``includelink`` and ``liblink``, are
created in ``lib/scafacos`` to point to the ScaFaCoS src dir. When LAMMPS created in ``lib/scafacos`` to point to the ScaFaCoS src dir. When LAMMPS
builds in src it will use these links. You should not need to edit builds in src it will use these links. You should not need to edit
the ``lib/scafacos/Makefile.lammps`` file. the ``lib/scafacos/Makefile.lammps`` file.

View File

@ -37,7 +37,7 @@ executable code from the library is copied into the calling executable.
.. tab:: CMake build .. tab:: CMake build
This assumes that LAMMPS has been configured without setting a This assumes that LAMMPS has been configured without setting a
``LAMMPS_MACHINE`` name, installed with "make install", and the ``LAMMPS_MACHINE`` name, installed with ``make install``, and the
``PKG_CONFIG_PATH`` environment variable has been updated to ``PKG_CONFIG_PATH`` environment variable has been updated to
include the ``liblammps.pc`` file installed into the configured include the ``liblammps.pc`` file installed into the configured
destination folder. The commands to compile and link a coupled destination folder. The commands to compile and link a coupled
@ -59,10 +59,10 @@ executable code from the library is copied into the calling executable.
mpicc -c -O -I${HOME}/lammps/src caller.c mpicc -c -O -I${HOME}/lammps/src caller.c
mpicxx -o caller caller.o -L${HOME}/lammps/src -llammps_mpi mpicxx -o caller caller.o -L${HOME}/lammps/src -llammps_mpi
The *-I* argument is the path to the location of the ``library.h`` The ``-I`` argument is the path to the location of the ``library.h``
header file containing the interface to the LAMMPS C-style library header file containing the interface to the LAMMPS C-style library
interface. The *-L* argument is the path to where the interface. The ``-L`` argument is the path to where the
``liblammps_mpi.a`` file is located. The *-llammps_mpi* argument ``liblammps_mpi.a`` file is located. The ``-llammps_mpi`` argument
is shorthand for telling the compiler to link the file is shorthand for telling the compiler to link the file
``liblammps_mpi.a``. If LAMMPS has been built as a shared ``liblammps_mpi.a``. If LAMMPS has been built as a shared
library, then the linker will use ``liblammps_mpi.so`` instead. library, then the linker will use ``liblammps_mpi.so`` instead.
@ -142,7 +142,7 @@ When linking to LAMMPS built as a shared library, the situation becomes
much simpler, as all dependent libraries and objects are either included much simpler, as all dependent libraries and objects are either included
in the shared library or registered as a dependent library in the shared in the shared library or registered as a dependent library in the shared
library file. Thus, those libraries need not be specified when linking library file. Thus, those libraries need not be specified when linking
the calling executable. Only the *-I* flags are needed. So the example the calling executable. Only the ``-I`` flags are needed. So the example
case from above of the serial version static LAMMPS library with the case from above of the serial version static LAMMPS library with the
POEMS package installed becomes: POEMS package installed becomes:

View File

@ -25,7 +25,7 @@ additional tools to be available and functioning.
require adding flags like ``-std=c++11`` to enable the C++11 mode. require adding flags like ``-std=c++11`` to enable the C++11 mode.
* A Bourne shell compatible "Unix" shell program (frequently this is ``bash``) * A Bourne shell compatible "Unix" shell program (frequently this is ``bash``)
* A few shell utilities: ``ls``, ``mv``, ``ln``, ``rm``, ``grep``, ``sed``, ``tr``, ``cat``, ``touch``, ``diff``, ``dirname`` * A few shell utilities: ``ls``, ``mv``, ``ln``, ``rm``, ``grep``, ``sed``, ``tr``, ``cat``, ``touch``, ``diff``, ``dirname``
* Python (optional, required for ``make lib-<pkg>`` in the src * Python (optional, required for ``make lib-<pkg>`` in the ``src``
folder). Python scripts are currently tested with python 2.7 and folder). Python scripts are currently tested with python 2.7 and
3.6 to 3.11. The procedure for :doc:`building the documentation 3.6 to 3.11. The procedure for :doc:`building the documentation
<Build_manual>` *requires* Python 3.5 or later. <Build_manual>` *requires* Python 3.5 or later.

View File

@ -172,18 +172,41 @@ make a copy of one of them and modify it to suit your needs.
.. code-block:: bash .. code-block:: bash
cmake -C ../cmake/presets/basic.cmake [OPTIONS] ../cmake # enable just a few core packages # enable just a few core packages
cmake -C ../cmake/presets/most.cmake [OPTIONS] ../cmake # enable most packages cmake -C ../cmake/presets/basic.cmake [OPTIONS] ../cmake
cmake -C ../cmake/presets/download.cmake [OPTIONS] ../cmake # enable packages which download sources or potential files
cmake -C ../cmake/presets/nolib.cmake [OPTIONS] ../cmake # disable packages that do require extra libraries or tools # enable most packages
cmake -C ../cmake/presets/clang.cmake [OPTIONS] ../cmake # change settings to use the Clang compilers by default cmake -C ../cmake/presets/most.cmake [OPTIONS] ../cmake
cmake -C ../cmake/presets/gcc.cmake [OPTIONS] ../cmake # change settings to use the GNU compilers by default
cmake -C ../cmake/presets/intel.cmake [OPTIONS] ../cmake # change settings to use the Intel compilers by default # enable packages which download sources or potential files
cmake -C ../cmake/presets/pgi.cmake [OPTIONS] ../cmake # change settings to use the PGI compilers by default cmake -C ../cmake/presets/download.cmake [OPTIONS] ../cmake
cmake -C ../cmake/presets/all_on.cmake [OPTIONS] ../cmake # enable all packages
cmake -C ../cmake/presets/all_off.cmake [OPTIONS] ../cmake # disable all packages # disable packages that do require extra libraries or tools
mingw64-cmake -C ../cmake/presets/mingw-cross.cmake [OPTIONS] ../cmake # compile with MinGW cross-compilers cmake -C ../cmake/presets/nolib.cmake [OPTIONS] ../cmake
cmake -C ../cmake/presets/macos-multiarch.cmake [OPTIONS] ../cmake # compile serial multi-arch binaries on macOS
# change settings to use the Clang compilers by default
cmake -C ../cmake/presets/clang.cmake [OPTIONS] ../cmake
# change settings to use the GNU compilers by default
cmake -C ../cmake/presets/gcc.cmake [OPTIONS] ../cmake
# change settings to use the Intel compilers by default
cmake -C ../cmake/presets/intel.cmake [OPTIONS] ../cmake
# change settings to use the PGI compilers by default
cmake -C ../cmake/presets/pgi.cmake [OPTIONS] ../cmake
# enable all packages
cmake -C ../cmake/presets/all_on.cmake [OPTIONS] ../cmake
# disable all packages
cmake -C ../cmake/presets/all_off.cmake [OPTIONS] ../cmake
# compile with MinGW cross-compilers
mingw64-cmake -C ../cmake/presets/mingw-cross.cmake [OPTIONS] ../cmake
# compile serial multi-arch binaries on macOS
cmake -C ../cmake/presets/macos-multiarch.cmake [OPTIONS] ../cmake
Presets that have names starting with "windows" are specifically for Presets that have names starting with "windows" are specifically for
compiling LAMMPS :doc:`natively on Windows <Build_windows>` and compiling LAMMPS :doc:`natively on Windows <Build_windows>` and
@ -209,7 +232,8 @@ Example
# GPU package and configure it for using CUDA. You can run. # GPU package and configure it for using CUDA. You can run.
mkdir build mkdir build
cd build cd build
cmake -C ../cmake/presets/most.cmake -C ../cmake/presets/nolib.cmake -D PKG_GPU=on -D GPU_API=cuda ../cmake cmake -C ../cmake/presets/most.cmake -C ../cmake/presets/nolib.cmake \
-D PKG_GPU=on -D GPU_API=cuda ../cmake
# to add another package, say BODY to the previous configuration you can run: # to add another package, say BODY to the previous configuration you can run:
cmake -D PKG_BODY=on . cmake -D PKG_BODY=on .

View File

@ -1,3 +1,7 @@
.. raw:: latex
\clearpage
Optional build settings Optional build settings
======================= =======================
@ -54,7 +58,7 @@ LAMMPS can use them if they are available on your system.
Alternatively, LAMMPS can use the `heFFTe Alternatively, LAMMPS can use the `heFFTe
<https://icl-utk-edu.github.io/heffte/>`_ library for the MPI <https://icl-utk-edu.github.io/heffte/>`_ library for the MPI
communication algorithms, which comes with many optimizations for communication algorithms, which comes with many optimizations for
special cases, e.g. leveraging available 2D and 3D FFTs in the back end special cases, e.g. leveraging available 2D and 3D FFTs in the backend
libraries and better pipelining for packing and communication. libraries and better pipelining for packing and communication.
.. tabs:: .. tabs::
@ -74,11 +78,11 @@ libraries and better pipelining for packing and communication.
.. note:: .. note::
When the Kokkos variant of a package is compiled and selected at run time, When the Kokkos variant of a package is compiled and selected at run time,
the FFT library selected by the FFT_KOKKOS variable applies. Otherwise, the FFT library selected by the ``FFT_KOKKOS`` variable applies. Otherwise,
the FFT library selected by the FFT variable applies. the FFT library selected by the FFT variable applies.
The same FFT settings apply to both. FFT_KOKKOS must be compatible with the The same FFT settings apply to both. ``FFT_KOKKOS`` must be compatible with the
Kokkos back end - for example, when using the CUDA back end of Kokkos, Kokkos backend - for example, when using the CUDA backend of Kokkos,
you must use either CUFFT or KISS. you must use either ``CUFFT`` or ``KISS``.
Usually these settings are all that is needed. If FFTW3 is Usually these settings are all that is needed. If FFTW3 is
selected, then CMake will try to detect, if threaded FFTW selected, then CMake will try to detect, if threaded FFTW
@ -102,7 +106,7 @@ libraries and better pipelining for packing and communication.
.. note:: .. note::
heFFTe comes with a builtin (= stock) back end for FFTs, i.e. a heFFTe comes with a builtin (= stock) backend for FFTs, i.e. a
default internal FFT implementation; however, this stock back default internal FFT implementation; however, this stock back
end is intended for testing purposes only and is not optimized end is intended for testing purposes only and is not optimized
for production runs. for production runs.
@ -116,11 +120,10 @@ libraries and better pipelining for packing and communication.
.. code-block:: make .. code-block:: make
FFT_INC = -DFFT_FFTW3 # -DFFT_FFTW3, -DFFT_FFTW (same as -DFFT_FFTW3), FFT_INC = -DFFT_<NAME> # where <NAME> is KISS (default), FFTW3,
# -DFFT_MKL, or -DFFT_KISS # FFTW (same as FFTW3), or MKL
# default is KISS if not specified FFT_INC = -DFFT_KOKKOS_<NAME> # where <NAME> is KISS (default), FFTW3,
FFT_INC = -DFFT_KOKKOS_CUFFT # -DFFT_KOKKOS_{FFTW,FFTW3,MKL,CUFFT,HIPFFT,KISS} # FFTW (same as FFTW3), MKL, CUFFT, or HIPFFT
# default is KISS if not specified
FFT_INC = -DFFT_SINGLE # do not specify for double precision FFT_INC = -DFFT_SINGLE # do not specify for double precision
FFT_INC = -DFFT_FFTW_THREADS # enable using threaded FFTW3 libraries 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_MKL_THREADS # enable using threaded FFTs with MKL libraries
@ -131,17 +134,36 @@ libraries and better pipelining for packing and communication.
FFT_INC = -I/usr/local/include FFT_INC = -I/usr/local/include
FFT_PATH = -L/usr/local/lib FFT_PATH = -L/usr/local/lib
FFT_LIB = -lhipfft # hipFFT either precision
FFT_LIB = -lcufft # cuFFT either precision # hipFFT either precision
FFT_LIB = -lfftw3 # FFTW3 double precision FFT_LIB = -lhipfft
FFT_LIB = -lfftw3 -lfftw3_omp # FFTW3 double precision with threads
# (needs -DFFT_FFTW_THREADS) # cuFFT either precision
FFT_LIB = -lfftw3 -lfftw3f # FFTW3 single precision FFT_LIB = -lcufft
FFT_LIB = -lmkl_intel_lp64 -lmkl_sequential -lmkl_core # serial MKL with Intel compiler,
FFT_LIB = -lmkl_gf_lp64 -lmkl_sequential -lmkl_core # serial MKL with GNU compiler, # FFTW3 double precision
FFT_LIB = -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core # threaded MKL with Intel compiler FFT_LIB = -lfftw3
FFT_LIB = -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core # threaded MKL with GNU compiler
FFT_LIB = -lmkl_rt # MKL with automatic runtime selection of interface libs # FFTW3 double precision with threads (needs -DFFT_FFTW_THREADS)
FFT_LIB = -lfftw3 -lfftw3_omp
# FFTW3 single precision
FFT_LIB = -lfftw3 -lfftw3f
# serial MKL with Intel compiler
FFT_LIB = -lmkl_intel_lp64 -lmkl_sequential -lmkl_core
# serial MKL with GNU compiler
FFT_LIB = -lmkl_gf_lp64 -lmkl_sequential -lmkl_core
# threaded MKL with Intel compiler
FFT_LIB = -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core
# threaded MKL with GNU compiler
FFT_LIB = -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core
# MKL with automatic runtime selection of interface libs
FFT_LIB = -lmkl_rt
As with CMake, you do not need to set paths in ``FFT_INC`` or 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 ``FFT_PATH``, if the compiler can find the FFT header and library
@ -198,7 +220,7 @@ above).
The cuFFT and hipFFT FFT libraries are packaged with NVIDIA's CUDA and The cuFFT and hipFFT FFT libraries are packaged with NVIDIA's CUDA and
AMD's HIP installations, respectively. These FFT libraries require the AMD's HIP installations, respectively. These FFT libraries require the
Kokkos acceleration package to be enabled and the Kokkos back end to be Kokkos acceleration package to be enabled and the Kokkos backend to be
GPU-resident (i.e., HIP or CUDA). GPU-resident (i.e., HIP or CUDA).
Performing 3d FFTs in parallel can be time-consuming due to data access Performing 3d FFTs in parallel can be time-consuming due to data access
@ -233,7 +255,7 @@ ARRAY mode.
When using ``-DFFT_HEFFTE`` CMake will first look for an existing When using ``-DFFT_HEFFTE`` CMake will first look for an existing
install with hints provided by ``-DHeffte_ROOT``, as recommended by the install with hints provided by ``-DHeffte_ROOT``, as recommended by the
CMake standard and note that the name is case sensitive. If CMake cannot CMake standard and note that the name is case sensitive. If CMake cannot
find a heFFTe installation with the correct back end (e.g., FFTW or find a heFFTe installation with the correct backend (e.g., FFTW or
MKL), it will attempt to download and build the library automatically. MKL), it will attempt to download and build the library automatically.
In this case, LAMMPS CMake will also accept all heFFTe specific In this case, LAMMPS CMake will also accept all heFFTe specific
variables listed in the `heFFTe documentation variables listed in the `heFFTe documentation
@ -242,6 +264,10 @@ and those variables will be passed into the heFFTe build.
---------- ----------
.. raw:: latex
\clearpage
.. _size: .. _size:
Size of LAMMPS integer types and size limits Size of LAMMPS integer types and size limits
@ -512,11 +538,11 @@ LAMMPS is compiled accordingly which needs the following settings:
Memory allocation alignment 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 of memory. Vector ``malloc()`` when LAMMPS allocates large chunks of memory. Vector
instructions on CPUs may become more efficient, if dynamically allocated instructions on CPUs may become more efficient, if dynamically allocated
memory is aligned on larger-than-default byte boundaries. On most memory is aligned on larger-than-default byte boundaries. On most
current operating systems, the "malloc()" implementation returns current operating systems, the ``malloc()`` implementation returns
pointers that are aligned to 16-byte boundaries. Using SSE vector pointers that are aligned to 16-byte boundaries. Using SSE vector
instructions efficiently, however, requires memory blocks being aligned instructions efficiently, however, requires memory blocks being aligned
on 64-byte boundaries. on 64-byte boundaries.
@ -530,9 +556,9 @@ on 64-byte boundaries.
-D LAMMPS_MEMALIGN=value # 0, 8, 16, 32, 64 (default) -D LAMMPS_MEMALIGN=value # 0, 8, 16, 32, 64 (default)
Use a ``LAMMPS_MEMALIGN`` value of 0 to disable using Use a ``LAMMPS_MEMALIGN`` value of 0 to disable using
"posix_memalign()" and revert to using the "malloc()" C-library ``posix_memalign()`` and revert to using the ``malloc()`` C-library
function instead. When compiling LAMMPS for Windows systems, function instead. When compiling LAMMPS for Windows systems,
"malloc()" will always be used and this setting is ignored. ``malloc()`` will always be used and this setting is ignored.
.. tab:: Traditional make .. tab:: Traditional make
@ -541,7 +567,7 @@ on 64-byte boundaries.
LMP_INC = -DLAMMPS_MEMALIGN=value # 8, 16, 32, 64 LMP_INC = -DLAMMPS_MEMALIGN=value # 8, 16, 32, 64
Do not set ``-DLAMMPS_MEMALIGN``, if you want to have memory Do not set ``-DLAMMPS_MEMALIGN``, if you want to have memory
allocated with the "malloc()" function call allocated with the ``malloc()`` function call
instead. ``-DLAMMPS_MEMALIGN`` **cannot** be used on Windows, as instead. ``-DLAMMPS_MEMALIGN`` **cannot** be used on Windows, as
Windows different function calls with different semantics for Windows different function calls with different semantics for
allocating aligned memory, that are not compatible with how LAMMPS allocating aligned memory, that are not compatible with how LAMMPS