Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This pull request contains a full CMake build system for n2p2. It can optionally download and build LAMMPS with the USER_NNP package if desired. (NB: LAMMPS build still uses the LAMMPS Makefile build system and not their CMake build system). This is designed to mirror the existing Makefile system as closely as possible.
The primary benefit of this CMake system is that it automatically finds and builds all dependencies, i.e., MPI, GSL & Eigen and adapts automatically to the preferred distributions of this library on each system. This is particularly useful, e.g., when building n2p2 on more complicated clusters such as NERSC Perlmutter where different MPI distributions etc. are used based on the desired optimization settings.
Quickstart Build Instructions
To build all n2p2 applications (no LAMMPS), simply run the following commands from the n2p2 home directory:
If downloading & building LAMMPS is desired, use the options
-DDOWNLOAD_LAMMPS=ON -DBUILD_LAMMPS=ON
and LAMMPS will build during the system. The download occurs in thecmake
stage while the build happens during themake
stage.Build Options
The build options are documented below. Nearly all of the build options are identically ported over from the Makefile build system. To set the binary flags use the syntax
-DOPTION_NAME=ON/OFF
. Defaults are indicated in [].If desired, these options can also be listed from command line by replacing the
cmake
command above (inside thebuild
directory) withcmake -LAH ../src
.Basic Build Settings
N2P2 Compile Options
Which interfaces to build in libnnpif
Eigen Optimization Options
LAMMPS Build Options