diff --git a/doc/src/Build_basics.rst b/doc/src/Build_basics.rst index 832b6c3f02..c80acfa59d 100644 --- a/doc/src/Build_basics.rst +++ b/doc/src/Build_basics.rst @@ -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,17 +41,17 @@ 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 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): -.. 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 diff --git a/doc/src/Build_cmake.rst b/doc/src/Build_cmake.rst index ce103d978a..8314afaa0e 100644 --- a/doc/src/Build_cmake.rst +++ b/doc/src/Build_cmake.rst @@ -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 diff --git a/doc/src/Build_development.rst b/doc/src/Build_development.rst index ef06a27035..f8eee73197 100644 --- a/doc/src/Build_development.rst +++ b/doc/src/Build_development.rst @@ -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 diff --git a/doc/src/Build_extras.rst b/doc/src/Build_extras.rst index e1d3b52165..9b3f3adb56 100644 --- a/doc/src/Build_extras.rst +++ b/doc/src/Build_extras.rst @@ -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 @@ -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 ` 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 diff --git a/doc/src/Build_make.rst b/doc/src/Build_make.rst index c7db5dbb52..f88bd8b1b2 100644 --- a/doc/src/Build_make.rst +++ b/doc/src/Build_make.rst @@ -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 diff --git a/doc/src/Build_package.rst b/doc/src/Build_package.rst index 7f2fe7f8ef..15872aa7ec 100644 --- a/doc/src/Build_package.rst +++ b/doc/src/Build_package.rst @@ -45,14 +45,14 @@ versus make. **CMake variables**\ : -.. parsed-literal:: +.. code-block:: bash -D PKG_NAME=value # yes or no (default) Examples: -.. parsed-literal:: +.. code-block:: bash -D PKG_MANYBODY=yes -D PKG_USER-INTEL=yes @@ -74,7 +74,7 @@ once with CMake. **Traditional make**\ : -.. parsed-literal:: +.. code-block:: bash cd lammps/src make ps # check which packages are currently installed @@ -85,7 +85,7 @@ once with CMake. Examples: -.. parsed-literal:: +.. code-block:: bash make no-rigid make yes-user-intel @@ -172,7 +172,7 @@ one of them as a starting point and customize it to your needs. **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 diff --git a/doc/src/Build_settings.rst b/doc/src/Build_settings.rst index 273a598b1a..6eb204027a 100644 --- a/doc/src/Build_settings.rst +++ b/doc/src/Build_settings.rst @@ -4,16 +4,15 @@ 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 ` when building all of LAMMPS -| :ref:`FFT library ` for use with the :doc:`kspace_style pppm ` command -| :ref:`Size of LAMMPS data types ` -| :ref:`Read or write compressed files ` -| :ref:`Output of JPG and PNG files ` via the :doc:`dump image ` command -| :ref:`Output of movie files ` via the :doc:`dump_movie ` command -| :ref:`Memory allocation alignment ` -| :ref:`Workaround for long long integers ` -| :ref:`Error handling exceptions ` when using LAMMPS as a library -| +* :ref:`C++11 standard compliance ` when building all of LAMMPS +* :ref:`FFT library ` for use with the :doc:`kspace_style pppm ` command +* :ref:`Size of LAMMPS data types ` +* :ref:`Read or write compressed files ` +* :ref:`Output of JPG and PNG files ` via the :doc:`dump image ` command +* :ref:`Output of movie files ` via the :doc:`dump_movie ` command +* :ref:`Memory allocation alignment ` +* :ref:`Workaround for long long integers ` +* :ref:`Error handling exceptions ` when using LAMMPS as a library ---------- @@ -21,45 +20,16 @@ explain how to do this for building both with CMake and make. .. _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. +to set extra flags to enable C++11 compliance. Example for GNU c++: -**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 @@ -80,7 +50,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 @@ -100,7 +70,7 @@ 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 @@ -112,7 +82,7 @@ to assist: **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 @@ -124,7 +94,7 @@ to assist: # 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 @@ -190,7 +160,7 @@ For FFTW3, do the following, which should produce the additional library libfftw3f.a or libfftw3f.so. -.. parsed-literal:: +.. code-block:: bash make clean ./configure --enable-single; make; make install @@ -218,14 +188,14 @@ 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 @@ -296,7 +266,7 @@ 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 @@ -310,7 +280,7 @@ 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 @@ -323,7 +293,7 @@ variables: **Makefile.machine settings**\ : -.. parsed-literal:: +.. code-block:: make LMP_INC = -DLAMMPS_JPEG LMP_INC = -DLAMMPS_PNG @@ -367,7 +337,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 @@ -376,7 +346,7 @@ gzip compression by several LAMMPS commands, including **Makefile.machine setting**\ : -.. parsed-literal:: +.. code-block:: make LMP_INC = -DLAMMPS_GZIP @@ -416,7 +386,7 @@ aligned on 64-byte boundaries. **CMake variable**\ : -.. parsed-literal:: +.. code-block:: bash -D LAMMPS_MEMALIGN=value # 0, 8, 16, 32, 64 (default) @@ -428,7 +398,7 @@ and this setting ignored. **Makefile.machine setting**\ : -.. parsed-literal:: +.. code-block:: make LMP_INC = -DLAMMPS_MEMALIGN=value # 8, 16, 32, 64 @@ -455,14 +425,14 @@ 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 @@ -483,13 +453,13 @@ e.g. to Python. **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