GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||
GeezerVison is showing docs.lammps.org — 3.7. Include packages in build — LAMMPS documentation 3.7. Include packages in buildIn LAMMPS, a package is a group of files that enable a specific set of features. For example, force fields for molecular systems or rigid-body constraints are in packages. In the src directory, each package is a subdirectory with the package name in capital letters. An overview of packages is given on the Packages doc page. Brief overviews of each package are on the Packages details page. When building LAMMPS, you can choose to include or exclude each package. Generally, there is no need to include a package if you never plan to use its features. If you get a run-time error that a LAMMPS command or style is “unknown”, it is often because the command is contained in a package, and your build did not include that package. If the command or style is available in a package included in the LAMMPS distribution, the error message will indicate which package would be needed. Running LAMMPS with the -h command-line switch will print all optional commands and packages that were enabled when building that executable. For the majority of packages, if you follow the single step below to include it, you can then build LAMMPS exactly the same as you would without any packages installed. A few packages may require additional steps, as explained on the Build extras page. These links take you to the extra instructions for those select packages: The mechanism for including packages is simple but different for the CMake build system in comparison to the traditional make build. -D PKG_NAME=value # on or off (default) Examples: -D PKG_MANYBODY=on -D PKG_INTEL=on All packages are included the same way. See the shortcut section below for how to install many packages at once with CMake. Note If you switch between building with CMake and make builds, no
packages in the src directory can be installed when you invoke
cd lammps/src make ps # check which packages are currently installed make yes-name # install a package with name make no-name # uninstall a package with name make mpi # build LAMMPS with whatever packages are now installed Examples: make no-rigid make yes-intel All packages are included the same way. See the shortcut section below for how to install many packages at once with make. Note You must always re-build LAMMPS (via make) after installing or uninstalling a package, for the action to take effect. The included dependency tracking will make certain only files that are required to be rebuilt are recompiled. Note You cannot install or uninstall packages and build LAMMPS in a
single make command with multiple targets, e.g. 3.7.1. Information for both build systemsAlmost all packages can be included or excluded in a LAMMPS build, independent of the other packages. However, some packages include files derived from files in other packages. LAMMPS checks for this and does the right thing. Individual files are only included if their dependencies are already included. Likewise, if a package is excluded, other files dependent on that package are also excluded. Note By default no packages are installed. Prior to August 2018,
however, if you downloaded a tarball, 3 packages (KSPACE, MANYBODY,
MOLECULE) were pre-installed via the traditional make procedure in
the 3.7.2. CMake presets for installing many packagesInstead of specifying all the CMake options via the command-line, CMake allows initializing its settings cache using script files. These are regular CMake files which can manipulate and set CMake variables (which represent selected options), and can also contain control flow constructs for more complex operations. LAMMPS includes several of these files to define configuration “presets”, similar to the options that exist for the Make based system. Using these files, you can enable/disable portions of the available packages in LAMMPS. If you need a custom preset, you can make a copy of one of them and modify it to suit your needs. # enable just a few core packages (MOLECULE, KSPACE, MANYBODY, RIGID, GRAPHICS) cmake -S cmake -B build -C cmake/presets/basic.cmake [OPTIONS] # enable most packages cmake -S cmake -B build -C cmake/presets/most.cmake [OPTIONS] # enable packages which download sources or potential files cmake -S cmake -B build -C cmake/presets/download.cmake [OPTIONS] # disable packages that do require extra libraries or tools cmake -S cmake -B build -C cmake/presets/nolib.cmake [OPTIONS] # change settings to use the Clang compilers by default cmake -S cmake -B build -C cmake/presets/clang.cmake [OPTIONS] # change settings to use the GNU compilers by default cmake -S cmake -B build -C cmake/presets/gcc.cmake [OPTIONS] # like gcc.cmake, clang.cmake, or oneapi.cmake, but with more aggressive # optimization (see the "Compiler optimization" page) cmake -S cmake -B build -C cmake/presets/gcc-opt.cmake [OPTIONS] cmake -S cmake -B build -C cmake/presets/clang-opt.cmake [OPTIONS] cmake -S cmake -B build -C cmake/presets/oneapi-opt.cmake [OPTIONS] # like gcc.cmake but with additional compiler warnings enabled # (useful during development) cmake -S cmake -B build -C cmake/presets/pedantic.cmake [OPTIONS] # change settings to use the Intel oneAPI compilers by default cmake -S cmake -B build -C cmake/presets/oneapi.cmake [OPTIONS] # change settings to use the PGI compilers by default cmake -S cmake -B build -C cmake/presets/pgi.cmake [OPTIONS] # change settings to use the NVIDIA HPC compilers by default cmake -S cmake -B build -C cmake/presets/nvhpc.cmake [OPTIONS] # enable all packages cmake -S cmake -B build -C cmake/presets/all_on.cmake [OPTIONS] # disable all packages cmake -S cmake -B build -C cmake/presets/all_off.cmake [OPTIONS] # enable all packages that contain styles with KOKKOS support cmake -S cmake -B build -C cmake/presets/kokkos-packages.cmake [OPTIONS] # enable all packages that contain styles with GPU package support cmake -S cmake -B build -C cmake/presets/gpu-packages.cmake [OPTIONS] # compile with MinGW cross-compilers mingw64-cmake -S cmake -B build -C cmake/presets/mingw-cross.cmake [OPTIONS] # compile serial multi-arch binaries on macOS cmake -S cmake -B build -C cmake/presets/macos-multiarch.cmake [OPTIONS] Presets that have names starting with “windows” are specifically for
compiling LAMMPS natively on Windows, presets
that have names starting with “kokkos” are specifically for selecting
configurations for compiling LAMMPS with KOKKOS, and
presets that have names starting with “gpu” are specifically for
compiling LAMMPS with the GPU package. The
Note Running cmake this way manipulates the CMake settings cache in the build folder. You can combine multiple presets and options in a single cmake run, or change settings incrementally by running cmake with new flags. If you use a preset for selecting a set of compilers, it will reset all settings from previous CMake runs. Example# build LAMMPS with most commonly used packages, but then remove # those requiring additional library or tools, but still enable # GPU package and configure it for using CUDA. You can run: cmake -S cmake -B build -C cmake/presets/most.cmake -C cmake/presets/nolib.cmake \ -D PKG_GPU=on -D GPU_API=cuda # to add another package, say BODY to the previous configuration you can run: cmake -S cmake -B build -D PKG_BODY=on # to reset the package selection from above to the default of no packages # but leaving all other settings untouched. You can run: cmake -S cmake -B build -C cmake/presets/all_off.cmake 3.7.3. Make shortcuts for installing many packagesThe following commands are useful for managing package source files
and their installation when building LAMMPS via traditional make.
Just type These commands install/uninstall sets of packages: make yes-all # install all packages make no-all # check for changes and uninstall all packages make no-installed # only check and uninstall installed packages make yes-basic # install a few commonly used packages' make no-basic # remove a few commonly used packages' make yes-most # install most packages w/o libs' make no-most # remove most packages w/o libs' which install/uninstall various sets of packages. Typing Note Installing or uninstalling a package for the make based build process works by simply copying files back and forth between the main source directory src and the subdirectories with the package name (e.g. src/KSPACE, src/MANYBODY), so that the files are included or excluded when LAMMPS is built. Only source files in the src folder will be compiled. The following make commands help manage files that exist in both the src directory and in package subdirectories. You do not normally need to use these commands unless you are editing LAMMPS files or are updating LAMMPS via git. Type Type Type Type Type | ||||||||||||||||||||||||||||||||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |