Unverified Commit 75a43398 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

replace more "parsed-literal" with "code-block" in build docs

parent a9dc6294
Loading
Loading
Loading
Loading
+26 −27
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ without MPI. It can also be built with support for OpenMP threading
**CMake variables**\ :


.. 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)
@@ -41,7 +41,7 @@ lmp. Using BUILD\_MPI=no will produce a serial executable.
**Traditional make**\ :


.. parsed-literal::
.. code-block:: bash

   cd lammps/src
   make mpi                # parallel build, produces lmp_mpi using Makefile.mpi
@@ -51,7 +51,7 @@ lmp. Using BUILD\_MPI=no will produce a serial executable.
Serial build (see src/MAKE/Makefile.serial):


.. parsed-literal::
.. code-block:: make

   MPI_INC =       -I../STUBS
   MPI_PATH =      -L../STUBS
@@ -158,7 +158,7 @@ simply loading the appropriate module before building LAMMPS.
**CMake variables**\ :


.. parsed-literal::
.. code-block:: bash

   -D CMAKE_CXX_COMPILER=name            # name of C++ compiler
   -D CMAKE_C_COMPILER=name              # name of C compiler
@@ -179,31 +179,30 @@ in C or Fortran are built with a compiler consistent with the one used
for all the C++ files:


.. parsed-literal::
.. code-block:: bash

   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

.. 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**\ :

Parallel build (see src/MAKE/Makefile.mpi):


.. parsed-literal::
.. code-block:: bash

   CC =            mpicxx
   CCFLAGS =       -g -O3
@@ -213,7 +212,7 @@ Parallel build (see src/MAKE/Makefile.mpi):
Serial build (see src/MAKE/Makefile.serial):


.. parsed-literal::
.. code-block:: make

   CC =            g++
   CCFLAGS =       -g -O3
@@ -238,7 +237,7 @@ a variety of settings appropriate for your MPI installation.
   variants:


.. parsed-literal::
.. code-block:: bash

   Makefile.opt                   # OPT package
   Makefile.omp                   # USER-OMP package
@@ -268,7 +267,7 @@ running LAMMPS from Python via its library interface.
**CMake variables**\ :


.. parsed-literal::
.. code-block:: bash

   -D BUILD_EXE=value           # yes (default) or no
   -D BUILD_LIB=value           # yes or no (default)
@@ -285,7 +284,7 @@ libraries will be named liblammps\_name.a or liblammps\_name.so instead.
**Traditional make**\ :


.. parsed-literal::
.. code-block:: bash

   cd lammps/src
   make machine               # build LAMMPS executable lmp_machine
@@ -318,7 +317,7 @@ Argonne National Lab, as a shared library in the default



.. parsed-literal::
.. code-block:: bash

   ./configure --enable-shared
   make
@@ -340,7 +339,7 @@ Build the LAMMPS documentation
**CMake variable**\ :


.. parsed-literal::
.. code-block:: bash

   -D BUILD_DOC=value       # yes or no (default)

@@ -352,7 +351,7 @@ the install.
**Traditional make**\ :


.. parsed-literal::
.. code-block:: bash

   cd lammps/doc
   make html       # html doc pages
@@ -383,7 +382,7 @@ using CMake or Make.
**CMake variable**\ :


.. parsed-literal::
.. code-block:: bash

   -D BUILD_TOOLS=value       # yes or no (default)

@@ -392,7 +391,7 @@ The generated binaries will also become part of the LAMMPS installation (see bel
**Traditional make**\ :


.. parsed-literal::
.. code-block:: bash

   cd lammps/tools
   make all              # build all binaries of tools
@@ -419,7 +418,7 @@ you want to copy files to is protected.
**CMake variable**\ :


.. parsed-literal::
.. code-block:: bash

   cmake -D CMAKE_INSTALL_PREFIX=path [options ...] ../cmake
   make                        # perform make after CMake command
+10 −10
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ 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
@@ -52,7 +52,7 @@ 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

@@ -115,7 +115,7 @@ folder, recreate the directory and start over.
**Command-line version of CMake**\ :


.. parsed-literal::
.. code-block:: bash

   cmake [options ...] /path/to/lammps/cmake  # build from any dir
   cmake [options ...] ../cmake               # build from lammps/build
@@ -127,7 +127,7 @@ The argument can be preceeded 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
@@ -177,7 +177,7 @@ directory.
**Curses version (terminal-style menu) of CMake**\ :


.. parsed-literal::
.. code-block:: bash

   ccmake ../cmake

@@ -195,7 +195,7 @@ more information.
**GUI version of CMake**\ :


.. parsed-literal::
.. code-block:: bash

   cmake-gui ../cmake

@@ -216,7 +216,7 @@ for more information.
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
@@ -226,10 +226,10 @@ On clusters or supercomputers which use environment modules to manage
software packages, do this:


.. parsed-literal::
.. code-block:: bash

   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
+8 −8
Original line number Diff line number Diff line
@@ -18,14 +18,14 @@ 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

@@ -48,7 +48,7 @@ it. Please note that they come with a performance hit. However, they are
usually faster than using tools like Valgrind.


.. parsed-literal::
.. code-block:: bash

   -D ENABLE_SANITIZE_ADDRESS=value    # enable Address Sanitizer, value = no (default) or yes
   -D ENABLE_SANITIZE_UNDEFINED=value  # enable Undefined Behaviour Sanitizer, value = no (default) or yes
@@ -72,7 +72,7 @@ developers can run the tests directly on their workstation.
   this is incomplete and only represents a small subset of tests that we run


.. 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)
@@ -81,7 +81,7 @@ developers can run the tests directly on their workstation.
If you enable testing in the CMake build it will create an additional target called "test". You can run them with:


.. parsed-literal::
.. code-block:: bash

   make test

@@ -93,14 +93,14 @@ 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
@@ -109,6 +109,6 @@ This will also add the following targets to generate coverage reports after runn
These reports require GCOVR to be installed. The easiest way to do this to install it via pip:


.. parsed-literal::
.. code-block:: bash

   pip install git+https://github.com/gcovr/gcovr.git
+45 −45
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ When building with some packages, additional steps may be required,
in addition to:


.. parsed-literal::
.. code-block:: bash

   -D PKG_NAME=yes    # CMake
   make yes-name      # make
@@ -49,7 +49,7 @@ available on your system.
If CMake cannot find the library, you can set these variables:


.. parsed-literal::
.. code-block:: bash

   -D ZLIB_INCLUDE_DIR=path    # path to zlib.h header file
   -D ZLIB_LIBRARIES=path      # path to libz.a (.so) file
@@ -75,7 +75,7 @@ which GPU hardware to build for.
**CMake build**\ :


.. parsed-literal::
.. code-block:: bash

   -D GPU_API=value          # value = opencl (default) or cuda
   -D GPU_PREC=value         # precision setting
@@ -125,7 +125,7 @@ using a command like these, which simply invoke the lib/gpu/Install.py
script with the specified args:


.. parsed-literal::
.. code-block:: bash

   make lib-gpu               # print help message
   make lib-gpu args="-b"     # build GPU library with default Makefile.linux
@@ -192,7 +192,7 @@ minutes to hours) to build. Of course you only need to do that once.)
**CMake build**\ :


.. parsed-literal::
.. code-block:: bash

   -D DOWNLOAD_KIM=value           # download OpenKIM API v2 for build, value = no (default) or yes
   -D LMP_DEBUG_CURL=value         # set libcurl verbose mode on/off, value = off (default) or on
@@ -229,7 +229,7 @@ step from the lammps/src dir, using a command like these, which simply
invoke the lib/kim/Install.py script with the specified args.


.. parsed-literal::
.. code-block:: bash

   make lib-kim              # print help message
   make lib-kim args="-b "   # (re-)install KIM API lib with only example models
@@ -287,7 +287,7 @@ case-sensitive values, e.g. BDW, not bdw.
For multicore CPUs using OpenMP, set these 2 variables.


.. parsed-literal::
.. code-block:: bash

   -D KOKKOS_ARCH=archCPU         # archCPU = CPU from list above
   -D KOKKOS_ENABLE_OPENMP=yes
@@ -295,7 +295,7 @@ For multicore CPUs using OpenMP, set these 2 variables.
For Intel KNLs using OpenMP, set these 2 variables:


.. parsed-literal::
.. code-block:: bash

   -D KOKKOS_ARCH=KNL
   -D KOKKOS_ENABLE_OPENMP=yes
@@ -303,7 +303,7 @@ For Intel KNLs using OpenMP, set these 2 variables:
For NVIDIA GPUs using CUDA, set these 4 variables:


.. parsed-literal::
.. code-block:: bash

   -D KOKKOS_ARCH="archCPU;archGPU"   # archCPU = CPU from list above that is hosting the GPU
                                      # archGPU = GPU from list above
@@ -316,7 +316,7 @@ Kokkos library: lib/kokkos/bin/nvcc\_wrapper. The setting should
include the full path name to the wrapper, e.g.


.. parsed-literal::
.. code-block:: bash

   -D CMAKE_CXX_COMPILER=/home/username/lammps/lib/kokkos/bin/nvcc_wrapper

@@ -329,7 +329,7 @@ src/MAKE/OPTIONS/Makefile.kokkos\* files for examples.
For multicore CPUs using OpenMP:


.. parsed-literal::
.. code-block:: make

   KOKKOS_DEVICES = OpenMP
   KOKKOS_ARCH = archCPU      # archCPU = CPU from list above
@@ -337,7 +337,7 @@ For multicore CPUs using OpenMP:
For Intel KNLs using OpenMP:


.. parsed-literal::
.. code-block:: make

   KOKKOS_DEVICES = OpenMP
   KOKKOS_ARCH = KNL
@@ -345,7 +345,7 @@ For Intel KNLs using OpenMP:
For NVIDIA GPUs using CUDA:


.. parsed-literal::
.. code-block:: make

   KOKKOS_DEVICES = Cuda
   KOKKOS_ARCH = archCPU,archGPU    # archCPU = CPU from list above that is hosting the GPU
@@ -360,7 +360,7 @@ compiling CUDA files and use a C++ compiler for non-Kokkos, non-CUDA
files.


.. parsed-literal::
.. code-block:: make

   KOKKOS_ABSOLUTE_PATH = $(shell cd $(KOKKOS_PATH); pwd)
   export OMPI_CXX = $(KOKKOS_ABSOLUTE_PATH)/config/nvcc_wrapper
@@ -381,7 +381,7 @@ library.
**CMake build**\ :


.. parsed-literal::
.. code-block:: bash

   -D DOWNLOAD_LATTE=value    # download LATTE for build, value = no (default) or yes
   -D LATTE_LIBRARY=path      # LATTE library file (only needed if a custom location)
@@ -401,7 +401,7 @@ simply invokes the lib/latte/Install.py script with the specified
args:


.. parsed-literal::
.. code-block:: bash

   make lib-latte                          # print help message
   make lib-latte args="-b"                # download and build in lib/latte/LATTE-master
@@ -431,7 +431,7 @@ be installed on your system.
**CMake build**\ :


.. parsed-literal::
.. code-block:: bash

   -D MESSAGE_ZMQ=value    # build with ZeroMQ support, value = no (default) or yes
   -D ZMQ_LIBRARY=path     # ZMQ library file (only needed if a custom location)
@@ -446,7 +446,7 @@ one step from the lammps/src dir, using a command like these, which
simply invoke the lib/message/Install.py script with the specified args:


.. parsed-literal::
.. code-block:: bash

   make lib-message               # print help message
   make lib-message args="-m -z"  # build with MPI and socket (ZMQ) support
@@ -475,7 +475,7 @@ lib/mscg/README and MSCG/Install files for more details.
**CMake build**\ :


.. parsed-literal::
.. code-block:: bash

   -D DOWNLOAD_MSCG=value    # download MSCG for build, value = no (default) or yes
   -D MSCG_LIBRARY=path      # MSCG library file (only needed if a custom location)
@@ -496,7 +496,7 @@ step from the lammps/src dir, using a command like these, which simply
invoke the lib/mscg/Install.py script with the specified args:


.. parsed-literal::
.. code-block:: bash

   make lib-mscg             # print help message
   make lib-mscg args="-b -m serial"   # download and build in lib/mscg/MSCG-release-master
@@ -552,7 +552,7 @@ dir, using a command like these, which simply invoke the
lib/poems/Install.py script with the specified args:


.. parsed-literal::
.. code-block:: bash

   make lib-poems                   # print help message
   make lib-poems args="-m serial"  # build with GNU g++ compiler (settings as with "make serial")
@@ -584,7 +584,7 @@ lib/python/README for more details.
**CMake build**\ :


.. parsed-literal::
.. code-block:: bash

   -D PYTHON_EXECUTABLE=path   # path to Python executable to use

@@ -620,7 +620,7 @@ To build with this package, you must download and build the `Voro++ library <vor
**CMake build**\ :


.. parsed-literal::
.. code-block:: bash

   -D DOWNLOAD_VORO=value    # download Voro++ for build, value = no (default) or yes
   -D VORO_LIBRARY=path      # Voro++ library file (only needed if at custom location)
@@ -642,7 +642,7 @@ simply invoke the lib/voronoi/Install.py script with the specified
args:


.. parsed-literal::
.. code-block:: bash

   make lib-voronoi                          # print help message
   make lib-voronoi args="-b"                # download and build the default version in lib/voronoi/voro++-<version>
@@ -673,7 +673,7 @@ installation and the instructions below are followed for the respective build sy
**CMake build**\ :


.. parsed-literal::
.. code-block:: bash

   -D ADIOS2_DIR=path        # path is where ADIOS 2.x is installed
   -D PKG_USER-ADIOS=yes
@@ -683,14 +683,14 @@ installation and the instructions below are followed for the respective build sy
Turn on the USER-ADIOS package before building LAMMPS. If the ADIOS 2.x software is installed in PATH, there is nothing else to do:


.. parsed-literal::
.. code-block:: bash

   make yes-user-adios

otherwise, set ADIOS2\_DIR environment variable when turning on the package:


.. parsed-literal::
.. code-block:: bash

   ADIOS2_DIR=path make yes-user-adios   # path is where ADIOS 2.x is installed

@@ -719,7 +719,7 @@ dir, using a command like these, which simply invoke the
lib/atc/Install.py script with the specified args:


.. parsed-literal::
.. code-block:: bash

   make lib-atc                      # print help message
   make lib-atc args="-m serial"     # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
@@ -741,7 +741,7 @@ lib/linalg. In the latter case you also need to build the library in
lib/linalg with a command like these:


.. parsed-literal::
.. code-block:: bash

   make lib-linalg                     # print help message
   make lib-linalg args="-m serial"    # build with GNU Fortran compiler (settings as with "make serial")
@@ -770,7 +770,7 @@ dir, using a command like these, which simply invoke the
lib/awpmd/Install.py script with the specified args:


.. parsed-literal::
.. code-block:: bash

   make lib-awpmd                   # print help message
   make lib-awpmd args="-m serial"  # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
@@ -792,7 +792,7 @@ provided in lib/linalg. In the latter case you also need to build the
library in lib/linalg with a command like these:


.. parsed-literal::
.. code-block:: bash

   make lib-linalg                     # print help message
   make lib-linalg args="-m serial"    # build with GNU Fortran compiler (settings as with "make serial")
@@ -844,7 +844,7 @@ command like these, which simply invoke the lib/colvars/Install.py script with
the specified args:


.. parsed-literal::
.. code-block:: bash

   make lib-colvars                      # print help message
   make lib-colvars args="-m serial"     # build with GNU g++ compiler (settings as with "make serial")
@@ -921,7 +921,7 @@ your environment. There are then two additional commands that control
the manner in which PLUMED is obtained and linked into LAMMPS.


.. parsed-literal::
.. code-block:: bash

   -D DOWNLOAD_PLUMED=value   # download PLUMED for build, value = no (default) or yes
   -D PLUMED_MODE=value       # Linkage mode for PLUMED, value = static (default), shared, or runtime
@@ -957,7 +957,7 @@ Download/compilation/configuration of the plumed library can be done
from the src folder through the following make args:


.. parsed-literal::
.. code-block:: bash

   make lib-plumed                         # print help message
   make lib-plumed args="-b"               # download and build PLUMED in lib/plumed/plumed2
@@ -973,7 +973,7 @@ mode. After this step is completed, you can install the USER-PLUMED
package and compile LAMMPS in the usual manner:


.. parsed-literal::
.. code-block:: bash

   make yes-user-plumed
   make machine
@@ -1024,7 +1024,7 @@ dir, using a command like these, which simply invoke the
lib/h5md/Install.py script with the specified args:


.. parsed-literal::
.. code-block:: bash

   make lib-h5md                     # print help message
   make lib-h5md args="-m h5cc"      # build with h5cc compiler
@@ -1055,7 +1055,7 @@ on the :doc:`Speed intel <Speed_intel>` doc page.
**CMake build**\ :


.. parsed-literal::
.. code-block:: bash

   -D INTEL_ARCH=value     # value = cpu (default) or knl
   -D INTEL_LRT_MODE=value # value = threads, none, or c++11
@@ -1082,7 +1082,7 @@ additional information.
For CPUs:


.. parsed-literal::
.. code-block:: make

   OPTFLAGS =      -xHost -O2 -fp-model fast=2 -no-prec-div -qoverride-limits -qopt-zmm-usage=high
   CCFLAGS =       -g -qopenmp -DLAMMPS_MEMALIGN=64 -no-offload -fno-alias -ansi-alias -restrict $(OPTFLAGS)
@@ -1092,7 +1092,7 @@ For CPUs:
For KNLs:


.. parsed-literal::
.. code-block:: make

   OPTFLAGS =      -xMIC-AVX512 -O2 -fp-model fast=2 -no-prec-div -qoverride-limits
   CCFLAGS =       -g -qopenmp -DLAMMPS_MEMALIGN=64 -no-offload -fno-alias -ansi-alias -restrict $(OPTFLAGS)
@@ -1111,7 +1111,7 @@ USER-MOLFILE package
**CMake build**\ :


.. parsed-literal::
.. code-block:: bash

   -D MOLFILE_INCLUDE_DIRS=path   # (optional) path where VMD molfile plugin headers are installed
   -D PKG_USER-MOLFILE=yes
@@ -1235,7 +1235,7 @@ lammps/src dir, using a command like these, which simply invoke the
lib/qmmm/Install.py script with the specified args:


.. parsed-literal::
.. code-block:: bash

   make lib-qmmm                      # print help message
   make lib-qmmm args="-m serial"     # build with GNU Fortran compiler (settings as in "make serial")
@@ -1274,7 +1274,7 @@ lib/quip/README file for details on how to do this.
**CMake build**\ :


.. parsed-literal::
.. code-block:: bash

   -D QUIP_LIBRARY=path     # path to libquip.a (only needed if a custom location)

@@ -1310,7 +1310,7 @@ To build with this package, you must download and build the `ScaFaCoS Coulomb so
**CMake build**\ :


.. parsed-literal::
.. code-block:: bash

   -D DOWNLOAD_SCAFACOS=value    # download ScaFaCoS for build, value = no (default) or yes
   -D SCAFACOS_LIBRARY=path      # ScaFaCos library file (only needed if at custom location)
@@ -1355,7 +1355,7 @@ Eigen3 is a template library, so you do not need to build it.
**CMake build**\ :


.. parsed-literal::
.. code-block:: bash

   -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)
@@ -1373,7 +1373,7 @@ the lammps/src dir, using a command like these, which simply invoke
the lib/smd/Install.py script with the specified args:


.. parsed-literal::
.. code-block:: bash

   make lib-smd                         # print help message
   make lib-smd args="-b"               # download to lib/smd/eigen3
+2 −2
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ These commands perform a default LAMMPS build, producing the LAMMPS
executable lmp\_serial or lmp\_mpi in lammps/src:


.. parsed-literal::
.. code-block:: bash

   cd lammps/src
   make serial     # build a serial LAMMPS executable
@@ -76,7 +76,7 @@ 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
Loading