-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathInstallation.html
More file actions
390 lines (375 loc) · 26.5 KB
/
Installation.html
File metadata and controls
390 lines (375 loc) · 26.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>2. Installation — FitSNAP documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="3. Run FitSNAP" href="Run/index.html" />
<link rel="prev" title="1. Introduction" href="Introduction.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html">
<img src="_static/FitSNAP.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">User Guide</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="Introduction.html">1. Introduction</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">2. Installation</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#lammps-installation">2.1. LAMMPS Installation</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#mpi-for-lammps-and-fitsnap">2.1.1. MPI for LAMMPS and FitSNAP</a></li>
<li class="toctree-l3"><a class="reference internal" href="#python-dependencies">2.1.2. Python dependencies</a></li>
<li class="toctree-l3"><a class="reference internal" href="#lammps-for-fitsnap">2.1.3. LAMMPS for FitSNAP</a></li>
<li class="toctree-l3"><a class="reference internal" href="#lammps-pace-install">2.1.4. LAMMPS PACE install</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#fitsnap-installation">2.2. FitSNAP Installation</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#install-fitsnap-with-latest-lammps">2.2.1. Install FitSNAP with latest LAMMPS</a></li>
<li class="toctree-l3"><a class="reference internal" href="#minimal-conda-install">2.2.2. Minimal conda install</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="Run/index.html">3. Run FitSNAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="Linear.html">4. Linear Models</a></li>
<li class="toctree-l1"><a class="reference internal" href="Pytorch.html">5. PyTorch Models</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Programmer Guide</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="Contributing.html">1. Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="Executable.html">2. Executable</a></li>
<li class="toctree-l1"><a class="reference internal" href="Lib/index.html">3. Library</a></li>
<li class="toctree-l1"><a class="reference internal" href="Tests.html">4. Tests</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">FitSNAP</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home"></a> »</li>
<li><span class="section-number">2. </span>Installation</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/Installation.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="installation">
<h1><span class="section-number">2. </span>Installation<a class="headerlink" href="#installation" title="Permalink to this heading"></a></h1>
<p>This page documents how to properly install LAMMPS and FitSNAP. First we begin with how to install
LAMMPS specifically for FitSNAP.</p>
<ul class="simple">
<li><p>If you do not want to manually install LAMMPS, please see <a class="reference internal" href="#minimal-conda-install">Minimal conda install</a>, but note this
version of conda LAMMPS does not included recent features like neural networks or ACE descriptors.</p></li>
<li><p>If you want a quick summary of installation instructions, see <a class="reference external" href="Quick.html">Quick Installation</a>.</p></li>
</ul>
<section id="lammps-installation">
<span id="id1"></span><h2><span class="section-number">2.1. </span>LAMMPS Installation<a class="headerlink" href="#lammps-installation" title="Permalink to this heading"></a></h2>
<p>Since LAMMPS is the backbone of FitSNAP, we begin with instructions on how to install LAMMPS
specifically for using FitSNAP. The following few sections cover basics of installing LAMMPS with
Python library support.</p>
<ul class="simple">
<li><p>If you want to fit ACE potentials, see <a class="reference internal" href="#lammps-pace-install">LAMMPS PACE install</a></p></li>
</ul>
<section id="mpi-for-lammps-and-fitsnap">
<h3><span class="section-number">2.1.1. </span>MPI for LAMMPS and FitSNAP<a class="headerlink" href="#mpi-for-lammps-and-fitsnap" title="Permalink to this heading"></a></h3>
<p>Both LAMMPS and FitSNAP are parallelized for optimal performance.</p>
<p>We build MPI from source using OpenMPI version 4.1.4 (<a class="reference external" href="https://www.open-mpi.org/">https://www.open-mpi.org/</a>)
and the instructions at <a class="reference external" href="https://www.open-mpi.org/faq/?category=building#easy-build">https://www.open-mpi.org/faq/?category=building#easy-build</a>.</p>
<p>After building, add your openmpi executable path to your <code class="code docutils literal notranslate"><span class="pre">PATH</span></code> variable as well so that
LAMMPS can automatically find your MPI install, e.g.:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span># in e.g., ~/.bashrc
MPI_DIR=/usr/local/openmpi
export PATH=$MPI_DIR/bin:$PATH
</pre></div>
</div>
</section>
<section id="python-dependencies">
<h3><span class="section-number">2.1.2. </span>Python dependencies<a class="headerlink" href="#python-dependencies" title="Permalink to this heading"></a></h3>
<p>We recommend creating a virtual environment with <code class="code docutils literal notranslate"><span class="pre">python</span> <span class="pre">-m</span> <span class="pre">venv</span></code> or <code class="code docutils literal notranslate"><span class="pre">conda</span></code>. After
creating your virtual environment, <strong>make sure it is activated for all future steps</strong>, e.g.:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">conda</span> <span class="n">create</span> <span class="o">--</span><span class="n">name</span> <span class="n">fitsnap</span> <span class="n">python</span><span class="o">=</span><span class="mf">3.10</span>
<span class="n">conda</span> <span class="n">activate</span> <span class="n">fitsnap</span>
</pre></div>
</div>
<p>Now install the necessary pre-requisites to build Python-LAMMPS using pip or conda:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">python</span> <span class="o">-</span><span class="n">m</span> <span class="n">pip</span> <span class="n">install</span> <span class="n">numpy</span> <span class="n">scipy</span> <span class="n">scikit</span><span class="o">-</span><span class="n">learn</span> <span class="n">virtualenv</span> <span class="n">psutil</span> <span class="n">pandas</span> <span class="n">tabulate</span> <span class="n">mpi4py</span> <span class="n">Cython</span>
<span class="c1"># For nonlinear fitting:</span>
<span class="n">python</span> <span class="o">-</span><span class="n">m</span> <span class="n">pip</span> <span class="n">install</span> <span class="n">torch</span>
<span class="c1"># For fitting ACE:</span>
<span class="n">python</span> <span class="o">-</span><span class="n">m</span> <span class="n">pip</span> <span class="n">install</span> <span class="n">sympy</span> <span class="n">pyyaml</span>
<span class="c1"># For contributing to docs:</span>
<span class="n">python</span> <span class="o">-</span><span class="n">m</span> <span class="n">pip</span> <span class="n">install</span> <span class="n">sphinx</span> <span class="n">sphinx_rtd_theme</span> <span class="n">sphinxcontrib</span><span class="o">-</span><span class="n">napoleon</span>
</pre></div>
</div>
<p>To make sure MPI is working, make a Python script called <code class="code docutils literal notranslate"><span class="pre">test.py</span></code> with the following:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">mpi4py</span> <span class="kn">import</span> <span class="n">MPI</span>
<span class="n">comm</span> <span class="o">=</span> <span class="n">MPI</span><span class="o">.</span><span class="n">COMM_WORLD</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">"Proc </span><span class="si">%d</span><span class="s2"> out of </span><span class="si">%d</span><span class="s2"> procs"</span> <span class="o">%</span> <span class="p">(</span><span class="n">comm</span><span class="o">.</span><span class="n">Get_rank</span><span class="p">(),</span><span class="n">comm</span><span class="o">.</span><span class="n">Get_size</span><span class="p">()))</span>
</pre></div>
</div>
<p>And see the output of running <code class="code docutils literal notranslate"><span class="pre">test.py</span></code> in parallel:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span># NOTE: the line order is not deterministic
$ mpirun -np 4 python test.py
Proc 0 out of 4 procs
Proc 1 out of 4 procs
Proc 2 out of 4 procs
Proc 3 out of 4 procs
</pre></div>
</div>
</section>
<section id="lammps-for-fitsnap">
<h3><span class="section-number">2.1.3. </span>LAMMPS for FitSNAP<a class="headerlink" href="#lammps-for-fitsnap" title="Permalink to this heading"></a></h3>
<ul class="simple">
<li><p>If you want to fit ACE potentials, see <a class="reference internal" href="#lammps-pace-install">LAMMPS PACE install</a></p></li>
</ul>
<p>First clone the LAMMPS repo:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">git</span> <span class="n">clone</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">github</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">lammps</span><span class="o">/</span><span class="n">lammps</span>
</pre></div>
</div>
<p>This creates a <code class="code docutils literal notranslate"><span class="pre">lammps</span></code> directory, where we will build LAMMPS using <cite>cmake`</cite> and <cite>make</cite>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>cd /path/to/lammps
mkdir build-fitsnap
cd build-fitsnap
# Use cmake to build the Makefile
cmake ../cmake -DLAMMPS_EXCEPTIONS=yes \
-DBUILD_SHARED_LIBS=yes \
-DMLIAP_ENABLE_PYTHON=yes \
-DPKG_PYTHON=yes \
-DPKG_ML-SNAP=yes \
-DPKG_ML-IAP=yes \
-DPKG_ML-PACE=yes \
-DPKG_SPIN=yes \
-DPYTHON_EXECUTABLE:FILEPATH=`which python`
# Build a LAMMPS executable and shared library
make
# Install Python-LAMMPS interface
make install-python
</pre></div>
</div>
<p>Do not be alarmed by runtime library warnings after <cite>cmake</cite>, or <cite>-Weffc++</cite> and <cite>-Wunused-result</cite>
warnings during <cite>make</cite>.
This will create a LAMMPS executable <code class="code docutils literal notranslate"><span class="pre">lmp</span></code>, which should be used to run MD using FitSNAP fits.
This will also create a Python-LAMMPS interface located in your Python <code class="code docutils literal notranslate"><span class="pre">site-packages/lammps</span></code>
directory. Set the following environment variables so that your Python can find the LAMMPS library:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>LAMMPS_DIR=/path/to/lammps
# For MacOS, use DYLD_LIBRARY_PATH instead of LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$LAMMPS_DIR/build-fitsnap:$LD_LIBRARY_PATH
</pre></div>
</div>
<p>Also make sure your Python-LAMMPS interface is working by doing the following in your Python
interpreter:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">lammps</span>
<span class="n">lmp</span> <span class="o">=</span> <span class="n">lammps</span><span class="o">.</span><span class="n">lammps</span><span class="p">()</span>
</pre></div>
</div>
<p>which should produce no errors.</p>
<p>After completing this LAMMPS installation, please see <a class="reference internal" href="#install-fitsnap-with-latest-lammps">Install FitSNAP with latest LAMMPS</a> to use
FitSNAP.</p>
</section>
<section id="lammps-pace-install">
<span id="id2"></span><h3><span class="section-number">2.1.4. </span>LAMMPS PACE install<a class="headerlink" href="#lammps-pace-install" title="Permalink to this heading"></a></h3>
<p>Computes for ACE descriptors are currently in our modified LAMMPS repo (<a class="reference external" href="https://github.com/jmgoff/lammps_compute_PACE">https://github.com/jmgoff/lammps_compute_PACE</a>),
so the installation instructions are a little different if you want to use ACE.</p>
<ol class="arabic">
<li><p>Clone our modified LAMMPS repo and set up a typical LAMMPS build:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">git</span> <span class="n">clone</span> <span class="o">-</span><span class="n">b</span> <span class="n">compute</span><span class="o">-</span><span class="n">pace</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">github</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">jmgoff</span><span class="o">/</span><span class="n">lammps_compute_PACE</span>
<span class="n">cd</span> <span class="n">lammps_compute_PACE</span>
<span class="n">mkdir</span> <span class="n">build</span> <span class="o">&&</span> <span class="n">cd</span> <span class="n">build</span>
</pre></div>
</div>
</li>
<li><p>Set up a typical LAMMPS build the ML-PACE library enabled:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>cmake ../cmake -DLAMMPS_EXCEPTIONS=yes \
-DBUILD_SHARED_LIBS=yes \
-DMLIAP_ENABLE_PYTHON=yes \
-DPKG_PYTHON=yes \
-DPKG_ML-SNAP=yes \
-DPKG_ML-IAP=yes \
-DPKG_ML-PACE=yes \
-DPKG_SPIN=yes \
-DPYTHON_EXECUTABLE:FILEPATH=`which python`
</pre></div>
</div>
</li>
<li><p>Download the modified lammps-user-pace code that contains extra arrays for breaking out descriptor contributions:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">git</span> <span class="n">clone</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">github</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">jmgoff</span><span class="o">/</span><span class="n">lammps</span><span class="o">-</span><span class="n">user</span><span class="o">-</span><span class="n">pace</span><span class="o">-</span><span class="mi">1</span>
<span class="n">cp</span> <span class="n">lammps</span><span class="o">-</span><span class="n">user</span><span class="o">-</span><span class="n">pace</span><span class="o">-</span><span class="mi">1</span><span class="o">/</span><span class="n">ML</span><span class="o">-</span><span class="n">PACE</span><span class="o">/</span><span class="n">ace</span><span class="o">-</span><span class="n">evaluator</span><span class="o">/</span><span class="n">ace_evaluator</span><span class="o">.*</span> <span class="o">./</span><span class="n">lammps</span><span class="o">-</span><span class="n">user</span><span class="o">-</span><span class="n">pace</span><span class="o">-</span><span class="n">v</span><span class="mf">.2022.10.15</span><span class="o">/</span><span class="n">ML</span><span class="o">-</span><span class="n">PACE</span><span class="o">/</span><span class="n">ace</span><span class="o">-</span><span class="n">evaluator</span><span class="o">/</span>
<span class="n">make</span> <span class="o">-</span><span class="n">j</span>
<span class="n">make</span> <span class="n">install</span><span class="o">-</span><span class="n">python</span>
</pre></div>
</div>
</li>
<li><p>Now, set up paths:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span># Use DYLD_LIBRARY_PATH if using MacOS, on Linux use LD_LIBRARY_PATH:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/lammps_compute_PACE/build
</pre></div>
</div>
</li>
<li><p>Now we can get and use FitSNAP:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>cd /path/to/where/you/want/FitSNAP
git clone https://github.com/FitSNAP/FitSNAP
# Set python path so you can run FitSNAP as executable:
export PYTHONPATH=$PYTHONPATH:/path/to/where/you/want/FitSNAP
</pre></div>
</div>
</li>
</ol>
<p>Note for infrequent installation issues: For some versions of OMP, the
LAMMPS/PYTHON interface may produce errors when running, leading to a
LAMMPS exception that kills FitSNAP jobs. If your install completes
successfully and you have problems with the execution of examples in
the example folder, try recompiling lammps with these alternative
D flags.</p>
<ol class="arabic">
<li><p>Alternative D flags for python/omp errors:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>cmake ../cmake -D LAMMPS_EXCEPTIONS=on \
-D PKG_PYTHON=on \
-D BUILD_SHARED_LIBS=on \
-D CMAKE_BUILD_TYPE=Debug \
-D PKG_ML-IAP=on \
-D PKG_ML-PACE=on \
-D PKG_ML-SNAP=on \
-D BUILD_MPI=on \
-D BUILD_OMP=off \
-D CMAKE_INSTALL_PREFIX=<$HOME>/.local \
-D PKG_MOLECULE=on
</pre></div>
</div>
</li>
</ol>
<p>With key changes coming from turning off omp.</p>
<p>For a summary/review of all these steps, see see <a class="reference external" href="Quick.html">Quick Installation</a>.</p>
</section>
</section>
<section id="fitsnap-installation">
<h2><span class="section-number">2.2. </span>FitSNAP Installation<a class="headerlink" href="#fitsnap-installation" title="Permalink to this heading"></a></h2>
<p>There are two primary ways to get started with FitSNAP: (1) building LAMMPS manually, and (2) a
simple conda environment using the packaged LAMMPS that ships with conda. The former option allows
for more recent LAMMPS features.</p>
<section id="install-fitsnap-with-latest-lammps">
<span id="id3"></span><h3><span class="section-number">2.2.1. </span>Install FitSNAP with latest LAMMPS<a class="headerlink" href="#install-fitsnap-with-latest-lammps" title="Permalink to this heading"></a></h3>
<p>Both FitSNAP and LAMMPS have been optimized to work with MPI. For optimal performance of
both, we recommend building and configuring your favored flavor of MPI before continuing
(see <a class="reference internal" href="#lammps-installation">LAMMPS Installation</a> docs).</p>
<ol class="arabic">
<li><p>Set up environment and build LAMMPS (see <a class="reference internal" href="#lammps-installation">LAMMPS Installation</a> docs)</p></li>
<li><p>Clone the FitSNAP repository:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">git</span> <span class="n">clone</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">github</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">FitSNAP</span><span class="o">/</span><span class="n">FitSNAP</span>
</pre></div>
</div>
</li>
<li><p>Add the cloned repository path to your PYTHONPATH environment variable:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>FITSNAP_DIR=\path\to\FitSNAP
export PYTHONPATH=$FITSNAP_DIR:$PYTHONPATH
</pre></div>
</div>
</li>
<li><p>You should now be able to run the FitSNAP examples in <code class="code docutils literal notranslate"><span class="pre">FitSNAP/examples</span></code>.</p></li>
<li><p>For a summary/review of all these steps, see see <a class="reference external" href="Quick.html">Quick Installation</a>.</p></li>
</ol>
</section>
<section id="minimal-conda-install">
<span id="id4"></span><h3><span class="section-number">2.2.2. </span>Minimal conda install<a class="headerlink" href="#minimal-conda-install" title="Permalink to this heading"></a></h3>
<ul class="simple">
<li><p><strong>WARNING:</strong> Conda lammps installation does NOT include ACE descriptor set, SPIN package, or new
LAMMPS settings needed for fitting neural networks. If you want to use these newer settings,
please build LAMMPS from source as explained in the <a class="reference internal" href="#lammps-installation">LAMMPS Installation</a> docs.</p></li>
</ul>
<p>A minimal working environment can be set up using the Python distribution package Anaconda (<a class="reference external" href="https://www.anaconda.com">https://www.anaconda.com</a>).</p>
<p>After installing Anaconda:</p>
<ol class="arabic">
<li><p>Add conda-forge to your Conda install, if not already added:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">conda</span> <span class="n">config</span> <span class="o">--</span><span class="n">add</span> <span class="n">channels</span> <span class="n">conda</span><span class="o">-</span><span class="n">forge</span>
</pre></div>
</div>
</li>
<li><p>Create a new Conda environment:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">conda</span> <span class="n">create</span> <span class="o">-</span><span class="n">n</span> <span class="n">fitsnap</span> <span class="n">python</span><span class="o">=</span><span class="mf">3.10</span>
<span class="n">conda</span> <span class="n">activate</span> <span class="n">fitsnap</span>
</pre></div>
</div>
</li>
<li><p>Install dependencies:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">conda</span> <span class="n">install</span> <span class="n">lammps</span>
<span class="n">python</span> <span class="o">-</span><span class="n">m</span> <span class="n">pip</span> <span class="n">install</span> <span class="n">numpy</span> <span class="n">scipy</span> <span class="n">scikit</span><span class="o">-</span><span class="n">learn</span> <span class="n">virtualenv</span> <span class="n">psutil</span> <span class="n">pandas</span> <span class="n">tabulate</span> <span class="n">mpi4py</span> <span class="n">Cython</span>
</pre></div>
</div>
</li>
<li><p>Clone the FitSNAP repository:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">git</span> <span class="n">clone</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">github</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">FitSNAP</span><span class="o">/</span><span class="n">FitSNAP</span><span class="o">.</span><span class="n">git</span>
</pre></div>
</div>
</li>
<li><p>Add the cloned repository path to your PYTHONPATH environment variable, e.g. in <code class="code docutils literal notranslate"><span class="pre">~/.bashrc</span></code>
or <code class="code docutils literal notranslate"><span class="pre">~/.bash_profile</span></code>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>FITSNAP_DIR=\path\to\FitSNAP
export PYTHONPATH=$FITSNAP_DIR:$LAMMPS_DIR/python:$PYTHONPATH
</pre></div>
</div>
</li>
</ol>
<ul class="simple">
<li><p><strong>TIP:</strong> Periodically use the command <code class="code docutils literal notranslate"><span class="pre">git</span> <span class="pre">pull</span></code> in the cloned directory for updates</p></li>
</ul>
</section>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="Introduction.html" class="btn btn-neutral float-left" title="1. Introduction" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="Run/index.html" class="btn btn-neutral float-right" title="3. Run FitSNAP" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>© Copyright 2022, Sandia Corporation.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>