We use here the command-line, non-interactive CMake interface.
Cmake C/C version selection Example Wanted version for C and C can be specified globally using respectively variables CMAKECSTANDARD (accepted values are 98, 99 and 11) and CMAKECXXSTANDARD (accepted values are 98, 11 and 14). Update the VERSION argument value or use a. Suffix to tell CMake that the project does not need compatibility with older versions. Increasing it to 3.0 silences this warning. Does libminc actually still need 2.8.12 support?
Download and installCMake. Version 3.4.3 is the minimum required.
Open a shell. Your development tools must be reachable from this shellthrough the PATH environment variable.
Create a build directory. Building LLVM in the sourcedirectory is not supported. cd to this directory:
Execute this command in the shell replacing path/to/llvm/source/root withthe path to the root of your LLVM source tree:
CMake will detect your development environment, perform a series of tests, andgenerate the files required for building LLVM. CMake will use default valuesfor all build parameters. See the Options and variables section fora list of build parameters that you can modify.
This can fail if CMake can’t detect your toolset, or if it thinks that theenvironment is not sane enough. In this case, make sure that the toolset thatyou intend to use is the only one reachable from the shell, and that the shellitself is the correct one for your development environment. CMake will refuseto build MinGW makefiles if you have a POSIX shell reachable through the PATHenvironment variable, for instance. You can force CMake to use a given buildtool; for instructions, see the Usage section, below.
After CMake has finished running, proceed to use IDE project files, or startthe build from the build directory:
cmaketo invoke the underlying buildtool (
The underlying build tool can be invoked directly, of course, butthe
--buildoption is portable.
After LLVM has finished building, install it from the build directory:
installparameter in addition tothe
cmaketo build the
It is possible to set a different install prefix at installation timeby invoking the
cmake_install.cmakescript generated in thebuild directory:
In LAMMPS, a package is a group of files that enable a specific set offeatures. For example, force fields for molecular systems orrigid-body constraints are in packages. In the src directory, eachpackage is a sub-directory with the package name in capital letters.
An overview of packages is given on the Packages docpage. Brief overviews of each package are on the Packages details page.
When building LAMMPS, you can choose to include or exclude eachpackage. In general there is no need to include a package if younever 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 styleis 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 switchwill print all optional commands and packages that were enabledwhen building that executable.
For the majority of packages, if you follow the single step below toinclude it, you can then build LAMMPS exactly the same as you wouldwithout any packages installed. A few packages may require additionalsteps, as explained on the Build extras page.
These links take you to the extra instructions for those selectpackages:
The mechanism for including packages is simple but different for CMakeversus make.
All standard and user packages are included the same way. Notethat USER packages have a hyphen between USER and the rest of thepackage name, not an underscore.
See the shortcut section below for how to install many packages atonce with CMake.
Did Not Make Required Minimum Distribution
If you switch between building with CMake and make builds, nopackages in the src directory can be installed when you invoke
cmake. CMake will give an error if that is not the case,indicating how you can un-install all packages in the src dir.
All standard and user packages are included the same way.
See the shortcut section below for how to install many packages atonce with make.
You must always re-build LAMMPS (via make) after installing orun-installing a package, for the action to take effect. Theincluded dependency tracking will make certain only files thatare required to be rebuilt are recompiled.
You cannot install or un-install packages and build LAMMPS in asingle make command with multiple targets, e.g.
makeyes-colloidmpi. This is because the make procedure createsa list of source files that will be out-of-date for the buildif the package configuration changes within the same command.You can include or exclude multiple packages in a single makecommand, e.g.
3.6.1. Information for both build systems¶
Almost all packages can be included or excluded in a LAMMPS build,independent of the other packages. However, some packages include filesderived from files in other packages. LAMMPS checks for this and doesthe right thing. Individual files are only included if theirdependencies are already included. Likewise, if a package is excluded,other files dependent on that package are also excluded.
By default no package is 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
srcdirectory. That is no longer the case, so that CMake will buildas-is without needing to un-install those packages.
CMake presets for installing many packages¶
Instead 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 CMakevariables (which represent selected options), and can also containcontrol 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 basedsystem. Using these files you can enable/disable portions of theavailable packages in LAMMPS. If you need a custom preset you can takeone of them as a starting point and customize it to your needs.
Running cmake this way manipulates the CMake settings cache in yourcurrent build directory. You can combine multiple presets and optionsin a single cmake run, or change settings incrementally by runningcmake with new flags. If you use a present for selecting a set ofcompilers, it will reset all settings from previous CMake runs.
3.6.2. Make shortcuts for installing many packages¶
The following commands are useful for managing package source filesand their installation when building LAMMPS via traditional make.Just type
make in lammps/src to see a one-line summary.
These commands install/un-install sets of packages:
which install/un-install various sets of packages. Typing
makepackage will list all the these commands.
Installing or un-installing a package for the make based build processworks by simply copying files back and forth between the main sourcedirectory src and the sub-directories with the package name (e.g.src/KSPACE, src/USER-ATC), so that the files are included or excludedwhen LAMMPS is built. Only source files in the src folder will becompiled.
The following make commands help manage files that exist in both thesrc directory and in package sub-directories. You do not normallyneed to use these commands unless you are editing LAMMPS files or areinstalling a patch downloaded from the LAMMPS website.
makeps to show which packages arecurrently installed. For those that are installed, it will list anyfiles that are different in the src directory and packagesub-directory.
makepi to show which packages arecurrently installed, without listing the status of packages that arenot installed.
Cmake If Example
makepu to overwrite src files withfiles from the package sub-directories if the package is installed.It should be used after a patch has been applied,since patches only update the files in the package sub-directory, butnot the src files.
makepackage-overwrite to overwrite files in the packagesub-directories with src files.
How To Make Required Field In Excel
makepackage-diff to list all differences between pairs offiles in both the source directory and the package directory.