forked from lijiext/lammps
sync with Git
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@15518 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
a62bae7d33
commit
236241b100
|
@ -1,5 +1,5 @@
|
||||||
# Makefile for LAMMPS documentation
|
# Makefile for LAMMPS documentation
|
||||||
SHA1 = $(shell echo $USER-$PWD | sha1sum | cut -f1 -d" ")
|
SHA1 = $(shell echo $USER-$PWD | python utils/sha1sum.py)
|
||||||
BUILDDIR = /tmp/lammps-docs-$(SHA1)
|
BUILDDIR = /tmp/lammps-docs-$(SHA1)
|
||||||
RSTDIR = $(BUILDDIR)/rst
|
RSTDIR = $(BUILDDIR)/rst
|
||||||
VENV = $(BUILDDIR)/docenv
|
VENV = $(BUILDDIR)/docenv
|
||||||
|
|
|
@ -15,18 +15,28 @@ make clean-all # remove entire build folder and any cached data
|
||||||
## Installing prerequisites
|
## Installing prerequisites
|
||||||
|
|
||||||
To run the documention build toolchain Python 3 and virtualenv have to be
|
To run the documention build toolchain Python 3 and virtualenv have to be
|
||||||
installed. The following are instructions for common Linux distributions:
|
installed. Here are instructions for common setups:
|
||||||
|
|
||||||
### virtualenv
|
### Ubuntu
|
||||||
|
|
||||||
#### Ubuntu
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo apt-get install python-virtualenv
|
sudo apt-get install python-virtualenv
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Fedora
|
### Fedora
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo yum install python-virtualenv
|
sudo yum install python-virtualenv
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### MacOS X
|
||||||
|
|
||||||
|
## Python 3
|
||||||
|
|
||||||
|
Download the latest Python 3 MacOS X package from https://www.python.org and install it.
|
||||||
|
This will install both Python 3 and pip3.
|
||||||
|
|
||||||
|
## virtualenv
|
||||||
|
|
||||||
|
Once Python 3 is installed, open a Terminal and type `pip3 install virtualenv`. This will
|
||||||
|
install virtualenv from the Python Package Index.
|
||||||
|
|
|
@ -158,7 +158,7 @@ keyword = <em>every</em>
|
||||||
<p>Perform constant NVE integration to update position and velocity for
|
<p>Perform constant NVE integration to update position and velocity for
|
||||||
atoms constrained to a curved surface (manifold) in the group each timestep. The constraint
|
atoms constrained to a curved surface (manifold) in the group each timestep. The constraint
|
||||||
is handled by RATTLE <a class="reference internal" href="fix_shake.html#andersen"><span class="std std-ref">(Andersen)</span></a> written out for the special case of
|
is handled by RATTLE <a class="reference internal" href="fix_shake.html#andersen"><span class="std std-ref">(Andersen)</span></a> written out for the special case of
|
||||||
single-particle constraints as explained in <a class="reference internal" href="fix_nvt_manifold_rattle.html#paquay"><span class="std std-ref">(Paquay)</span></a>.
|
single-particle constraints as explained in <a class="reference internal" href="manifolds.html#paquay"><span class="std std-ref">(Paquay)</span></a>.
|
||||||
V is volume; E is energy. This way, the dynamics of particles constrained to
|
V is volume; E is energy. This way, the dynamics of particles constrained to
|
||||||
curved surfaces can be studied. If combined with <a class="reference internal" href="fix_langevin.html"><span class="doc">fix langevin</span></a>, this generates
|
curved surfaces can be studied. If combined with <a class="reference internal" href="fix_langevin.html"><span class="doc">fix langevin</span></a>, this generates
|
||||||
Brownian motion of particles constrained to a curved surface. For a list of currently supported
|
Brownian motion of particles constrained to a curved surface. For a list of currently supported
|
||||||
|
@ -191,6 +191,9 @@ This fix is not invoked during <a class="reference internal" href="minimize.html
|
||||||
<p>This fix is part of the USER-MANIFOLD package. It is only enabled if LAMMPS
|
<p>This fix is part of the USER-MANIFOLD package. It is only enabled if LAMMPS
|
||||||
was built with that package. See the <a class="reference internal" href="Section_start.html#start-3"><span class="std std-ref">Making LAMMPS</span></a>
|
was built with that package. See the <a class="reference internal" href="Section_start.html#start-3"><span class="std std-ref">Making LAMMPS</span></a>
|
||||||
section for more info.</p>
|
section for more info.</p>
|
||||||
|
<p>Only use this with <em>min_style hftn</em> or <em>min_style quickmin</em>. If not, the constraints
|
||||||
|
will not be satisfied very well at all. A warning is generated if the <em>min_style</em> is
|
||||||
|
incompatible but no error.</p>
|
||||||
</div>
|
</div>
|
||||||
<hr class="docutils" />
|
<hr class="docutils" />
|
||||||
<div class="section" id="related-commands">
|
<div class="section" id="related-commands">
|
||||||
|
@ -199,7 +202,7 @@ section for more info.</p>
|
||||||
<p><strong>Default:</strong> every = 0, tchain = 3</p>
|
<p><strong>Default:</strong> every = 0, tchain = 3</p>
|
||||||
<hr class="docutils" />
|
<hr class="docutils" />
|
||||||
<p id="andersen"><strong>(Andersen)</strong> Andersen, J. Comp. Phys. 52, 24, (1983).</p>
|
<p id="andersen"><strong>(Andersen)</strong> Andersen, J. Comp. Phys. 52, 24, (1983).</p>
|
||||||
<p id="paquay"><strong>(Paquay)</strong> Paquay and Kusters, Biophys. J., 110, 6, (2016).
|
<p id="paquay"><strong>(Paquay)</strong> Paquay and Kusters, Biophys. J., 110, ???, (2016), to be published,
|
||||||
preprint available at <a class="reference external" href="http://arxiv.org/abs/1411.3019/">arXiv:1411.3019</a>.</p>
|
preprint available at <a class="reference external" href="http://arxiv.org/abs/1411.3019/">arXiv:1411.3019</a>.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -157,7 +157,7 @@ keyword = <em>temp</em> or <em>tchain</em> or <em>every</em>
|
||||||
</div>
|
</div>
|
||||||
<div class="section" id="description">
|
<div class="section" id="description">
|
||||||
<h2>Description</h2>
|
<h2>Description</h2>
|
||||||
<p>This fix combines the RATTLE-based <a class="reference internal" href="fix_shake.html#andersen"><span class="std std-ref">(Andersen)</span></a> time integrator of <a class="reference internal" href="fix_nve_manifold_rattle.html"><span class="doc">fix nve/manifold/rattle</span></a> <a class="reference internal" href="#paquay"><span class="std std-ref">(Paquay)</span></a> with a Nose-Hoover-chain thermostat to sample the
|
<p>This fix combines the RATTLE-based <a class="reference internal" href="fix_shake.html#andersen"><span class="std std-ref">(Andersen)</span></a> time integrator of <a class="reference internal" href="fix_nve_manifold_rattle.html"><span class="doc">fix nve/manifold/rattle</span></a> <a class="reference internal" href="manifolds.html#paquay"><span class="std std-ref">(Paquay)</span></a> with a Nose-Hoover-chain thermostat to sample the
|
||||||
canonical ensemble of particles constrained to a curved surface (manifold). This sampling does suffer from discretization bias of O(dt).
|
canonical ensemble of particles constrained to a curved surface (manifold). This sampling does suffer from discretization bias of O(dt).
|
||||||
For a list of currently supported manifolds and their parameters, see <a class="reference internal" href="manifolds.html"><span class="doc">manifolds</span></a></p>
|
For a list of currently supported manifolds and their parameters, see <a class="reference internal" href="manifolds.html"><span class="doc">manifolds</span></a></p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -176,6 +176,9 @@ This fix is not invoked during <a class="reference internal" href="minimize.html
|
||||||
<p>This fix is part of the USER-MANIFOLD package. It is only enabled if LAMMPS
|
<p>This fix is part of the USER-MANIFOLD package. It is only enabled if LAMMPS
|
||||||
was built with that package. See the <a class="reference internal" href="Section_start.html#start-3"><span class="std std-ref">Making LAMMPS</span></a>
|
was built with that package. See the <a class="reference internal" href="Section_start.html#start-3"><span class="std std-ref">Making LAMMPS</span></a>
|
||||||
section for more info.</p>
|
section for more info.</p>
|
||||||
|
<p>Only use this with <em>min_style hftn</em> or <em>min_style quickmin</em>. If not, the constraints
|
||||||
|
will not be satisfied very well at all. A warning is generated if the <em>min_style</em> is
|
||||||
|
incompatible but no error.</p>
|
||||||
</div>
|
</div>
|
||||||
<hr class="docutils" />
|
<hr class="docutils" />
|
||||||
<div class="section" id="related-commands">
|
<div class="section" id="related-commands">
|
||||||
|
@ -184,7 +187,7 @@ section for more info.</p>
|
||||||
<strong>Default:</strong> every = 0</p>
|
<strong>Default:</strong> every = 0</p>
|
||||||
<hr class="docutils" />
|
<hr class="docutils" />
|
||||||
<p id="andersen"><strong>(Andersen)</strong> Andersen, J. Comp. Phys. 52, 24, (1983).</p>
|
<p id="andersen"><strong>(Andersen)</strong> Andersen, J. Comp. Phys. 52, 24, (1983).</p>
|
||||||
<p id="paquay"><strong>(Paquay)</strong> Paquay and Kusters, Biophys. J., 110, 6, (2016).
|
<p id="paquay"><strong>(Paquay)</strong> Paquay and Kusters, Biophys. J., 110, ???, (2016), to be published,
|
||||||
preprint available at <a class="reference external" href="http://arxiv.org/abs/1411.3019/">arXiv:1411.3019</a>.</p>
|
preprint available at <a class="reference external" href="http://arxiv.org/abs/1411.3019/">arXiv:1411.3019</a>.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -76,6 +76,10 @@ This fix is part of the USER-MANIFOLD package. It is only enabled if LAMMPS
|
||||||
was built with that package. See the "Making LAMMPS"_Section_start.html#start_3
|
was built with that package. See the "Making LAMMPS"_Section_start.html#start_3
|
||||||
section for more info.
|
section for more info.
|
||||||
|
|
||||||
|
Only use this with {min_style hftn} or {min_style quickmin}. If not, the constraints
|
||||||
|
will not be satisfied very well at all. A warning is generated if the {min_style} is
|
||||||
|
incompatible but no error.
|
||||||
|
|
||||||
:line
|
:line
|
||||||
|
|
||||||
[Related commands:]
|
[Related commands:]
|
||||||
|
@ -90,7 +94,7 @@ section for more info.
|
||||||
[(Andersen)] Andersen, J. Comp. Phys. 52, 24, (1983).
|
[(Andersen)] Andersen, J. Comp. Phys. 52, 24, (1983).
|
||||||
|
|
||||||
:link(Paquay)
|
:link(Paquay)
|
||||||
[(Paquay)] Paquay and Kusters, Biophys. J., 110, 6, (2016).
|
[(Paquay)] Paquay and Kusters, Biophys. J., 110, ???, (2016), to be published,
|
||||||
preprint available at "arXiv:1411.3019"_http://arxiv.org/abs/1411.3019/.
|
preprint available at "arXiv:1411.3019"_http://arxiv.org/abs/1411.3019/.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,10 @@ This fix is part of the USER-MANIFOLD package. It is only enabled if LAMMPS
|
||||||
was built with that package. See the "Making LAMMPS"_Section_start.html#start_3
|
was built with that package. See the "Making LAMMPS"_Section_start.html#start_3
|
||||||
section for more info.
|
section for more info.
|
||||||
|
|
||||||
|
Only use this with {min_style hftn} or {min_style quickmin}. If not, the constraints
|
||||||
|
will not be satisfied very well at all. A warning is generated if the {min_style} is
|
||||||
|
incompatible but no error.
|
||||||
|
|
||||||
:line
|
:line
|
||||||
|
|
||||||
|
|
||||||
|
@ -76,6 +80,6 @@ section for more info.
|
||||||
[(Andersen)] Andersen, J. Comp. Phys. 52, 24, (1983).
|
[(Andersen)] Andersen, J. Comp. Phys. 52, 24, (1983).
|
||||||
|
|
||||||
:link(Paquay)
|
:link(Paquay)
|
||||||
[(Paquay)] Paquay and Kusters, Biophys. J., 110, 6, (2016).
|
[(Paquay)] Paquay and Kusters, Biophys. J., 110, ???, (2016), to be published,
|
||||||
preprint available at "arXiv:1411.3019"_http://arxiv.org/abs/1411.3019/.
|
preprint available at "arXiv:1411.3019"_http://arxiv.org/abs/1411.3019/.
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/env python
|
||||||
|
# simple utility which reimplements sha1sum using Python
|
||||||
|
import hashlib
|
||||||
|
import sys
|
||||||
|
s = hashlib.sha1()
|
||||||
|
s.update(sys.stdin.read().encode())
|
||||||
|
print(s.hexdigest())
|
|
@ -3,6 +3,10 @@
|
||||||
|
|
||||||
mode=$1
|
mode=$1
|
||||||
|
|
||||||
|
# enforce using portable C locale
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
# arg1 = file, arg2 = file it depends on
|
# arg1 = file, arg2 = file it depends on
|
||||||
|
|
||||||
action () {
|
action () {
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
|
|
||||||
mode=$1
|
mode=$1
|
||||||
|
|
||||||
|
# enforce using portable C locale
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
# arg1 = file, arg2 = file it depends on
|
# arg1 = file, arg2 = file it depends on
|
||||||
|
|
||||||
action () {
|
action () {
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
# Depend.sh = Install/unInstall files due to package dependencies
|
# Depend.sh = Install/unInstall files due to package dependencies
|
||||||
# this script is invoked after any package is installed/uninstalled
|
# this script is invoked after any package is installed/uninstalled
|
||||||
|
|
||||||
|
# enforce using portable C locale
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
# all parent/child package dependencies should be listed below
|
# all parent/child package dependencies should be listed below
|
||||||
# parent package = has files that files in another package derive from
|
# parent package = has files that files in another package derive from
|
||||||
# child package = has files that derive from files in another package
|
# child package = has files that derive from files in another package
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
|
|
||||||
mode=$1
|
mode=$1
|
||||||
|
|
||||||
|
# enforce using portable C locale
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
# arg1 = file, arg2 = file it depends on
|
# arg1 = file, arg2 = file it depends on
|
||||||
|
|
||||||
action () {
|
action () {
|
||||||
|
|
|
@ -7,6 +7,10 @@
|
||||||
|
|
||||||
mode=$1
|
mode=$1
|
||||||
|
|
||||||
|
# enforce using portable C locale
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
# arg1 = file, arg2 = file it depends on
|
# arg1 = file, arg2 = file it depends on
|
||||||
|
|
||||||
action () {
|
action () {
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
|
|
||||||
mode=$1
|
mode=$1
|
||||||
|
|
||||||
|
# enforce using portable C locale
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
# arg1 = file, arg2 = file it depends on
|
# arg1 = file, arg2 = file it depends on
|
||||||
|
|
||||||
action () {
|
action () {
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
|
|
||||||
mode=$1
|
mode=$1
|
||||||
|
|
||||||
|
# enforce using portable C locale
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
# arg1 = file, arg2 = file it depends on
|
# arg1 = file, arg2 = file it depends on
|
||||||
|
|
||||||
action () {
|
action () {
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
|
|
||||||
mode=$1
|
mode=$1
|
||||||
|
|
||||||
|
# enforce using portable C locale
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
# arg1 = file, arg2 = file it depends on
|
# arg1 = file, arg2 = file it depends on
|
||||||
|
|
||||||
action () {
|
action () {
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
|
|
||||||
mode=$1
|
mode=$1
|
||||||
|
|
||||||
|
# enforce using portable C locale
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
# arg1 = file, arg2 = file it depends on
|
# arg1 = file, arg2 = file it depends on
|
||||||
|
|
||||||
action () {
|
action () {
|
||||||
|
|
365
src/Make.py
365
src/Make.py
|
@ -3,9 +3,10 @@
|
||||||
# Make.py tool for managing packages and their auxiliary libs,
|
# Make.py tool for managing packages and their auxiliary libs,
|
||||||
# auto-editing machine Makefiles, and building LAMMPS
|
# auto-editing machine Makefiles, and building LAMMPS
|
||||||
# Syntax: Make.py -h (for help)
|
# Syntax: Make.py -h (for help)
|
||||||
# Notes: needs python 2.7 (not Python 3)
|
# Notes: should be compatible with python 2.7 and 3.x thanks to 'futurize'
|
||||||
|
|
||||||
import sys,os,commands,re,copy,subprocess,platform
|
from __future__ import print_function
|
||||||
|
import sys,os,re,copy,subprocess,platform
|
||||||
|
|
||||||
# switch abbrevs
|
# switch abbrevs
|
||||||
# switch classes = created class for each switch
|
# switch classes = created class for each switch
|
||||||
|
@ -34,15 +35,15 @@ gpubuildflag = 0
|
||||||
# functions
|
# functions
|
||||||
# ----------------------------------------------------------------
|
# ----------------------------------------------------------------
|
||||||
|
|
||||||
# if flag = 1, print str and exit
|
# if flag = 1, print txt and exit
|
||||||
# if flag = 0, print str as warning and do not exit
|
# if flag = 0, print txt as warning and do not exit
|
||||||
|
|
||||||
def error(str,flag=1):
|
def error(txt,flag=1):
|
||||||
if flag:
|
if flag:
|
||||||
print "ERROR:",str
|
print("ERROR:",txt)
|
||||||
sys.exit()
|
sys.exit()
|
||||||
else:
|
else:
|
||||||
print "WARNING:",str
|
print("WARNING:",txt)
|
||||||
|
|
||||||
# store command-line args as sw = dict of key/value
|
# store command-line args as sw = dict of key/value
|
||||||
# key = switch word, value = list of following args
|
# key = switch word, value = list of following args
|
||||||
|
@ -83,15 +84,15 @@ def switch2str(switches,switch_order):
|
||||||
|
|
||||||
def compile_check(compiler,ccflags,warn):
|
def compile_check(compiler,ccflags,warn):
|
||||||
open("tmpauto.cpp",'w').write("int main(int, char **) {}\n")
|
open("tmpauto.cpp",'w').write("int main(int, char **) {}\n")
|
||||||
str = "%s %s -c tmpauto.cpp" % (compiler,ccflags)
|
tmp = "%s %s -c tmpauto.cpp" % (compiler,ccflags)
|
||||||
txt = commands.getoutput(str)
|
txt = subprocess.check_output(tmp,stderr=subprocess.STDOUT,shell=True).decode()
|
||||||
flag = 1
|
flag = 1
|
||||||
if txt or not os.path.isfile("tmpauto.o"):
|
if txt or not os.path.isfile("tmpauto.o"):
|
||||||
flag = 0
|
flag = 0
|
||||||
if warn:
|
if warn:
|
||||||
print str
|
print(tmp)
|
||||||
if txt: print txt
|
if txt: print(txt)
|
||||||
else: print "compile produced no output"
|
else: print("compile produced no output")
|
||||||
os.remove("tmpauto.cpp")
|
os.remove("tmpauto.cpp")
|
||||||
if os.path.isfile("tmpauto.o"): os.remove("tmpauto.o")
|
if os.path.isfile("tmpauto.o"): os.remove("tmpauto.o")
|
||||||
return flag
|
return flag
|
||||||
|
@ -102,15 +103,15 @@ def compile_check(compiler,ccflags,warn):
|
||||||
|
|
||||||
def link_check(linker,linkflags,libs,warn):
|
def link_check(linker,linkflags,libs,warn):
|
||||||
open("tmpauto.cpp",'w').write("int main(int, char **) {}\n")
|
open("tmpauto.cpp",'w').write("int main(int, char **) {}\n")
|
||||||
str = "%s %s -o tmpauto tmpauto.cpp %s" % (linker,linkflags,libs)
|
tmp = "%s %s -o tmpauto tmpauto.cpp %s" % (linker,linkflags,libs)
|
||||||
txt = commands.getoutput(str)
|
txt = subprocess.check_output(tmp,stderr=subprocess.STDOUT,shell=True).decode()
|
||||||
flag = 1
|
flag = 1
|
||||||
if txt or not os.path.isfile("tmpauto"):
|
if txt or not os.path.isfile("tmpauto"):
|
||||||
flag = 0
|
flag = 0
|
||||||
if warn:
|
if warn:
|
||||||
print str
|
print(tmp)
|
||||||
if txt: print txt
|
if txt: print(txt)
|
||||||
else: print "link produced no output"
|
else: print("link produced no output")
|
||||||
os.remove("tmpauto.cpp")
|
os.remove("tmpauto.cpp")
|
||||||
if os.path.isfile("tmpauto"): os.remove("tmpauto")
|
if os.path.isfile("tmpauto"): os.remove("tmpauto")
|
||||||
return flag
|
return flag
|
||||||
|
@ -121,7 +122,7 @@ def link_check(linker,linkflags,libs,warn):
|
||||||
|
|
||||||
# actions
|
# actions
|
||||||
|
|
||||||
class Actions:
|
class Actions(object):
|
||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
self.inlist = copy.copy(list)
|
self.inlist = copy.copy(list)
|
||||||
|
|
||||||
|
@ -229,18 +230,18 @@ class Actions:
|
||||||
|
|
||||||
def lib(self,suffix):
|
def lib(self,suffix):
|
||||||
if suffix != "all":
|
if suffix != "all":
|
||||||
print "building",suffix,"library ..."
|
print("building",suffix,"library ...")
|
||||||
str = "%s.build()" % suffix
|
txt = "%s.build()" % suffix
|
||||||
exec(str)
|
exec(txt)
|
||||||
else:
|
else:
|
||||||
final = packages.final
|
final = packages.final
|
||||||
for one in packages.lib:
|
for one in packages.lib:
|
||||||
if final[one]:
|
if final[one]:
|
||||||
if "user" in one: pkg = one[5:]
|
if "user" in one: pkg = one[5:]
|
||||||
else: pkg = one
|
else: pkg = one
|
||||||
print "building",pkg,"library ..."
|
print("building",pkg,"library ...")
|
||||||
str = "%s.build()" % pkg
|
txt = "%s.build()" % pkg
|
||||||
exec(str)
|
exec(txt)
|
||||||
|
|
||||||
# read Makefile.machine
|
# read Makefile.machine
|
||||||
# if caller = "file", edit via switches
|
# if caller = "file", edit via switches
|
||||||
|
@ -526,8 +527,10 @@ class Actions:
|
||||||
# unless caller = "exe" and "file" action already invoked
|
# unless caller = "exe" and "file" action already invoked
|
||||||
|
|
||||||
if caller == "file" or "file" not in self.alist:
|
if caller == "file" or "file" not in self.alist:
|
||||||
|
# make certain that 'MAKE/MINE' folder exists.
|
||||||
|
subprocess.check_output("mkdir -p %s/MAKE/MINE" % dir.src,stderr=subprocess.STDOUT,shell=True)
|
||||||
make.write("%s/MAKE/MINE/Makefile.auto" % dir.src,1)
|
make.write("%s/MAKE/MINE/Makefile.auto" % dir.src,1)
|
||||||
print "Created src/MAKE/MINE/Makefile.auto"
|
print("Created src/MAKE/MINE/Makefile.auto")
|
||||||
|
|
||||||
# test full compile and link
|
# test full compile and link
|
||||||
# unless caller = "file" and "exe" action will be invoked later
|
# unless caller = "file" and "exe" action will be invoked later
|
||||||
|
@ -545,9 +548,9 @@ class Actions:
|
||||||
# invoke "make clean-auto" to force clean before build
|
# invoke "make clean-auto" to force clean before build
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
str = "cd %s; make clean-auto" % dir.src
|
txt = "cd %s; make clean-auto" % dir.src
|
||||||
commands.getoutput(str)
|
subprocess.check_output(txt,stderr=subprocess.STDOUT,shell=True)
|
||||||
print "Performed make clean-auto"
|
print("Performed make clean-auto")
|
||||||
|
|
||||||
# build LAMMPS using Makefile.auto and -j setting
|
# build LAMMPS using Makefile.auto and -j setting
|
||||||
# invoke self.file() first, to test makefile compile/link
|
# invoke self.file() first, to test makefile compile/link
|
||||||
|
@ -556,15 +559,15 @@ class Actions:
|
||||||
|
|
||||||
def exe(self):
|
def exe(self):
|
||||||
self.file("exe")
|
self.file("exe")
|
||||||
commands.getoutput("cd %s; rm -f lmp_auto" % dir.src)
|
subprocess.check_output("cd %s; rm -f lmp_auto" % dir.src,stderr=subprocess.STDOUT,shell=True)
|
||||||
if self.stubs and not os.path.isfile("%s/STUBS/libmpi_stubs.a" % dir.src):
|
if self.stubs and not os.path.isfile("%s/STUBS/libmpi_stubs.a" % dir.src):
|
||||||
print "building serial STUBS library ..."
|
print("building serial STUBS library ...")
|
||||||
str = "cd %s/STUBS; make clean; make" % dir.src
|
tmp = "cd %s/STUBS; make clean; make" % dir.src
|
||||||
txt = commands.getoutput(str)
|
txt = subprocess.check_output(tmp,stderr=subprocess.STDOUT,shell=True).decode()
|
||||||
if not os.path.isfile("%s/STUBS/libmpi_stubs.a" % dir.src):
|
if not os.path.isfile("%s/STUBS/libmpi_stubs.a" % dir.src):
|
||||||
print txt
|
print(txt)
|
||||||
error('Unsuccessful "make stubs"')
|
error('Unsuccessful "make stubs"')
|
||||||
print "Created src/STUBS/libmpi_stubs.a"
|
print("Created src/STUBS/libmpi_stubs.a")
|
||||||
|
|
||||||
# special hack for shannon GPU cluster
|
# special hack for shannon GPU cluster
|
||||||
# must use "srun make" if on it and building w/ GPU package, else just make
|
# must use "srun make" if on it and building w/ GPU package, else just make
|
||||||
|
@ -574,24 +577,24 @@ class Actions:
|
||||||
if "shannon" == platform.node() and packages.final["gpu"]:
|
if "shannon" == platform.node() and packages.final["gpu"]:
|
||||||
make = "srun make"
|
make = "srun make"
|
||||||
|
|
||||||
if jmake: str = "cd %s; %s -j %d auto" % (dir.src,make,jmake.n)
|
if jmake: tmp = "cd %s; %s -j %d auto" % (dir.src,make,jmake.n)
|
||||||
else: str = "cd %s; %s auto" % (dir.src,make)
|
else: tmp = "cd %s; %s auto" % (dir.src,make)
|
||||||
|
|
||||||
# if verbose, print output as build proceeds, else only print if fails
|
# if verbose, print output as build proceeds, else only print if fails
|
||||||
|
|
||||||
if verbose: subprocess.call(str,shell=True)
|
if verbose: subprocess.call(tmp,shell=True)
|
||||||
else:
|
else:
|
||||||
print str
|
print(tmp)
|
||||||
try: subprocess.check_output(str,stderr=subprocess.STDOUT,shell=True)
|
try: subprocess.check_output(tmp,stderr=subprocess.STDOUT,shell=True)
|
||||||
except Exception as e: print e.output
|
except Exception as e: print(e.output)
|
||||||
|
|
||||||
if not os.path.isfile("%s/lmp_auto" % dir.src):
|
if not os.path.isfile("%s/lmp_auto" % dir.src):
|
||||||
error('Unsuccessful "make auto"')
|
error('Unsuccessful "make auto"')
|
||||||
elif not output: print "Created src/lmp_auto"
|
elif not output: print("Created src/lmp_auto")
|
||||||
|
|
||||||
# dir switch
|
# dir switch
|
||||||
|
|
||||||
class Dir:
|
class Dir(object):
|
||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
self.inlist = copy.copy(list)
|
self.inlist = copy.copy(list)
|
||||||
|
|
||||||
|
@ -625,7 +628,7 @@ class Dir:
|
||||||
|
|
||||||
# help switch
|
# help switch
|
||||||
|
|
||||||
class Help:
|
class Help(object):
|
||||||
def __init__(self,list): pass
|
def __init__(self,list): pass
|
||||||
|
|
||||||
def help(self):
|
def help(self):
|
||||||
|
@ -650,7 +653,7 @@ Syntax: Make.py switch args ...
|
||||||
|
|
||||||
# jmake switch
|
# jmake switch
|
||||||
|
|
||||||
class Jmake:
|
class Jmake(object):
|
||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
self.inlist = copy.copy(list)
|
self.inlist = copy.copy(list)
|
||||||
|
|
||||||
|
@ -671,7 +674,7 @@ class Jmake:
|
||||||
|
|
||||||
# makefile switch
|
# makefile switch
|
||||||
|
|
||||||
class Makefile:
|
class Makefile(object):
|
||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
self.inlist = copy.copy(list)
|
self.inlist = copy.copy(list)
|
||||||
|
|
||||||
|
@ -690,7 +693,7 @@ class Makefile:
|
||||||
|
|
||||||
# output switch
|
# output switch
|
||||||
|
|
||||||
class Output:
|
class Output(object):
|
||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
self.inlist = copy.copy(list)
|
self.inlist = copy.copy(list)
|
||||||
|
|
||||||
|
@ -707,7 +710,7 @@ class Output:
|
||||||
|
|
||||||
# packages switch
|
# packages switch
|
||||||
|
|
||||||
class Packages:
|
class Packages(object):
|
||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
self.inlist = copy.copy(list)
|
self.inlist = copy.copy(list)
|
||||||
|
|
||||||
|
@ -805,14 +808,14 @@ class Packages:
|
||||||
# key = package name, value = 1 if currently installed, else 0
|
# key = package name, value = 1 if currently installed, else 0
|
||||||
|
|
||||||
original = {}
|
original = {}
|
||||||
str = "cd %s; make ps" % dir.src
|
tmp = "cd %s; make ps" % dir.src
|
||||||
output = commands.getoutput(str).split('\n')
|
output = subprocess.check_output(tmp,stderr=subprocess.STDOUT,shell=True).decode()
|
||||||
pattern = "Installed\s+(\w+): package (\S+)"
|
pattern = "Installed\s+(\w+): package (\S+)"
|
||||||
for line in output:
|
for line in output:
|
||||||
m = re.search(pattern,line)
|
m = re.search(pattern,line)
|
||||||
if not m: continue
|
if not m: continue
|
||||||
pkg = m.group(2).lower()
|
pkg = m.group(2).lower()
|
||||||
if pkg not in all: error('Package list does not math "make ps" results')
|
if pkg not in all: error('Package list does not match "make ps" results')
|
||||||
if m.group(1) == "NO": original[pkg] = 0
|
if m.group(1) == "NO": original[pkg] = 0
|
||||||
elif m.group(1) == "YES": original[pkg] = 1
|
elif m.group(1) == "YES": original[pkg] = 1
|
||||||
|
|
||||||
|
@ -849,33 +852,33 @@ class Packages:
|
||||||
# install packages in plist
|
# install packages in plist
|
||||||
|
|
||||||
def install(self):
|
def install(self):
|
||||||
if self.plist: print "Installing packages ..."
|
if self.plist: print("Installing packages ...")
|
||||||
for one in self.plist:
|
for one in self.plist:
|
||||||
if one == "orig": continue
|
if one == "orig": continue
|
||||||
commands.getoutput("cd %s; make %s" % (dir.src,one))
|
subprocess.check_output("cd %s; make %s" % (dir.src,one),stderr=subprocess.STDOUT,shell=True)
|
||||||
if self.plist and verbose:
|
if self.plist and verbose:
|
||||||
txt = commands.getoutput("cd %s; make ps" % dir.src)
|
txt = subprocess.check_output("cd %s; make ps" % dir.src,stderr=subprocess.STDOUT,shell=True).decode()
|
||||||
print "Package status after installation:"
|
print("Package status after installation:")
|
||||||
print txt
|
print(txt)
|
||||||
|
|
||||||
# restore packages to original list if requested
|
# restore packages to original list if requested
|
||||||
# order of re-install should not matter matter b/c of Depend.sh
|
# order of re-install should not matter matter b/c of Depend.sh
|
||||||
|
|
||||||
def uninstall(self):
|
def uninstall(self):
|
||||||
if not self.plist or self.plist[-1] != "orig": return
|
if not self.plist or self.plist[-1] != "orig": return
|
||||||
print "Restoring packages to original state ..."
|
print("Restoring packages to original state ...")
|
||||||
commands.getoutput("cd %s; make no-all" % dir.src)
|
subprocess.check_output("cd %s; make no-all" % dir.src,stderr=subprocess.STDOUT,shell=True)
|
||||||
for one in self.all:
|
for one in self.all:
|
||||||
if self.original[one]:
|
if self.original[one]:
|
||||||
commands.getoutput("cd %s; make yes-%s" % (dir.src,one))
|
subprocess.check_output("cd %s; make yes-%s" % (dir.src,one),stderr=subprocess.STDOUT,shell=True)
|
||||||
if verbose:
|
if verbose:
|
||||||
txt = commands.getoutput("cd %s; make ps" % dir.src)
|
txt = subprocess.check_output("cd %s; make ps" % dir.src,stderr=subprocess.STDOUT,shell=True).decode()
|
||||||
print "Restored package status:"
|
print("Restored package status:")
|
||||||
print txt
|
print(txt)
|
||||||
|
|
||||||
# redo switch
|
# redo switch
|
||||||
|
|
||||||
class Redo:
|
class Redo(object):
|
||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
self.inlist = copy.copy(list)
|
self.inlist = copy.copy(list)
|
||||||
|
|
||||||
|
@ -940,8 +943,8 @@ class Redo:
|
||||||
if words[0][-1] == ':': label = words[0][:-1]
|
if words[0][-1] == ':': label = words[0][:-1]
|
||||||
else: label = None
|
else: label = None
|
||||||
if not self.labels:
|
if not self.labels:
|
||||||
if label: commands.append(' '.join(words[1:]))
|
if label: subprocess.append(' '.join(words[1:]))
|
||||||
else: commands.append(line)
|
else: subprocess.append(line)
|
||||||
else:
|
else:
|
||||||
if not label: continue
|
if not label: continue
|
||||||
dict[label] = ' '.join(words[1:])
|
dict[label] = ' '.join(words[1:])
|
||||||
|
@ -950,13 +953,13 @@ class Redo:
|
||||||
|
|
||||||
for label in self.labels:
|
for label in self.labels:
|
||||||
if label not in dict: error("Redo label not in redo file")
|
if label not in dict: error("Redo label not in redo file")
|
||||||
commands.append(dict[label])
|
subprocess.append(dict[label])
|
||||||
|
|
||||||
self.commands = commands
|
self.commands = commands
|
||||||
|
|
||||||
# settings switch
|
# settings switch
|
||||||
|
|
||||||
class Settings:
|
class Settings(object):
|
||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
self.inlist = copy.copy(list)
|
self.inlist = copy.copy(list)
|
||||||
|
|
||||||
|
@ -979,7 +982,7 @@ class Settings:
|
||||||
|
|
||||||
# verbose switch
|
# verbose switch
|
||||||
|
|
||||||
class Verbose:
|
class Verbose(object):
|
||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
self.inlist = copy.copy(list)
|
self.inlist = copy.copy(list)
|
||||||
|
|
||||||
|
@ -995,7 +998,7 @@ class Verbose:
|
||||||
|
|
||||||
# zoutput switch for making copy of final Makefile.auto
|
# zoutput switch for making copy of final Makefile.auto
|
||||||
|
|
||||||
class Zoutput:
|
class Zoutput(object):
|
||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
self.inlist = copy.copy(list)
|
self.inlist = copy.copy(list)
|
||||||
|
|
||||||
|
@ -1018,7 +1021,7 @@ class Zoutput:
|
||||||
|
|
||||||
# ATC lib
|
# ATC lib
|
||||||
|
|
||||||
class ATC:
|
class ATC(object):
|
||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
self.inlist = copy.copy(list)
|
self.inlist = copy.copy(list)
|
||||||
self.make = "g++"
|
self.make = "g++"
|
||||||
|
@ -1051,25 +1054,25 @@ class ATC:
|
||||||
make.setvar("EXTRAMAKE","Makefile.lammps.%s" % self.lammps)
|
make.setvar("EXTRAMAKE","Makefile.lammps.%s" % self.lammps)
|
||||||
make.write("%s/Makefile.auto" % libdir)
|
make.write("%s/Makefile.auto" % libdir)
|
||||||
|
|
||||||
commands.getoutput("cd %s; make -f Makefile.auto clean" % libdir)
|
subprocess.check_output("cd %s; make -f Makefile.auto clean" % libdir,stderr=subprocess.STDOUT,shell=True)
|
||||||
if jmake: str = "cd %s; make -j %d -f Makefile.auto" % (libdir,jmake.n)
|
if jmake: txt = "cd %s; make -j %d -f Makefile.auto" % (libdir,jmake.n)
|
||||||
else: str = "cd %s; make -f Makefile.auto" % libdir
|
else: txt = "cd %s; make -f Makefile.auto" % libdir
|
||||||
|
|
||||||
# if verbose, print output as build proceeds, else only print if fails
|
# if verbose, print output as build proceeds, else only print if fails
|
||||||
|
|
||||||
if verbose: subprocess.call(str,shell=True)
|
if verbose: subprocess.call(txt,shell=True)
|
||||||
else:
|
else:
|
||||||
try: subprocess.check_output(str,stderr=subprocess.STDOUT,shell=True)
|
try: subprocess.check_output(txt,stderr=subprocess.STDOUT,shell=True)
|
||||||
except Exception as e: print e.output
|
except Exception as e: print(e.output)
|
||||||
|
|
||||||
if not os.path.isfile("%s/libatc.a" % libdir) or \
|
if not os.path.isfile("%s/libatc.a" % libdir) or \
|
||||||
not os.path.isfile("%s/Makefile.lammps" % libdir):
|
not os.path.isfile("%s/Makefile.lammps" % libdir):
|
||||||
error("Unsuccessful build of lib/atc library")
|
error("Unsuccessful build of lib/atc library")
|
||||||
else: print "Created lib/atc library"
|
else: print("Created lib/atc library")
|
||||||
|
|
||||||
# AWPMD lib
|
# AWPMD lib
|
||||||
|
|
||||||
class AWPMD:
|
class AWPMD(object):
|
||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
self.inlist = copy.copy(list)
|
self.inlist = copy.copy(list)
|
||||||
self.make = "mpicc"
|
self.make = "mpicc"
|
||||||
|
@ -1102,25 +1105,25 @@ class AWPMD:
|
||||||
make.setvar("EXTRAMAKE","Makefile.lammps.%s" % self.lammps)
|
make.setvar("EXTRAMAKE","Makefile.lammps.%s" % self.lammps)
|
||||||
make.write("%s/Makefile.auto" % libdir)
|
make.write("%s/Makefile.auto" % libdir)
|
||||||
|
|
||||||
commands.getoutput("cd %s; make -f Makefile.auto clean" % libdir)
|
subprocess.check_output("cd %s; make -f Makefile.auto clean" % libdir,stderr=subprocess.STDOUT,shell=True)
|
||||||
if jmake: str = "cd %s; make -j %d -f Makefile.auto" % (libdir,jmake.n)
|
if jmake: txt = "cd %s; make -j %d -f Makefile.auto" % (libdir,jmake.n)
|
||||||
else: str = "cd %s; make -f Makefile.auto" % libdir
|
else: txt = "cd %s; make -f Makefile.auto" % libdir
|
||||||
|
|
||||||
# if verbose, print output as build proceeds, else only print if fails
|
# if verbose, print output as build proceeds, else only print if fails
|
||||||
|
|
||||||
if verbose: subprocess.call(str,shell=True)
|
if verbose: subprocess.call(txt,shell=True)
|
||||||
else:
|
else:
|
||||||
try: subprocess.check_output(str,stderr=subprocess.STDOUT,shell=True)
|
try: subprocess.check_output(txt,stderr=subprocess.STDOUT,shell=True)
|
||||||
except Exception as e: print e.output
|
except Exception as e: print(e.output)
|
||||||
|
|
||||||
if not os.path.isfile("%s/libawpmd.a" % libdir) or \
|
if not os.path.isfile("%s/libawpmd.a" % libdir) or \
|
||||||
not os.path.isfile("%s/Makefile.lammps" % libdir):
|
not os.path.isfile("%s/Makefile.lammps" % libdir):
|
||||||
error("Unsuccessful build of lib/awpmd library")
|
error("Unsuccessful build of lib/awpmd library")
|
||||||
else: print "Created lib/awpmd library"
|
else: print("Created lib/awpmd library")
|
||||||
|
|
||||||
# COLVARS lib
|
# COLVARS lib
|
||||||
|
|
||||||
class COLVARS:
|
class COLVARS(object):
|
||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
self.inlist = copy.copy(list)
|
self.inlist = copy.copy(list)
|
||||||
self.make = "g++"
|
self.make = "g++"
|
||||||
|
@ -1153,25 +1156,25 @@ class COLVARS:
|
||||||
make.setvar("EXTRAMAKE","Makefile.lammps.%s" % self.lammps)
|
make.setvar("EXTRAMAKE","Makefile.lammps.%s" % self.lammps)
|
||||||
make.write("%s/Makefile.auto" % libdir)
|
make.write("%s/Makefile.auto" % libdir)
|
||||||
|
|
||||||
commands.getoutput("cd %s; make -f Makefile.auto clean" % libdir)
|
subprocess.check_output("cd %s; make -f Makefile.auto clean" % libdir,stderr=subprocess.STDOUT,shell=True)
|
||||||
if jmake: str = "cd %s; make -j %d -f Makefile.auto" % (libdir,jmake.n)
|
if jmake: txt = "cd %s; make -j %d -f Makefile.auto" % (libdir,jmake.n)
|
||||||
else: str = "cd %s; make -f Makefile.auto" % libdir
|
else: txt = "cd %s; make -f Makefile.auto" % libdir
|
||||||
|
|
||||||
# if verbose, print output as build proceeds, else only print if fails
|
# if verbose, print output as build proceeds, else only print if fails
|
||||||
|
|
||||||
if verbose: subprocess.call(str,shell=True)
|
if verbose: subprocess.call(txt,shell=True)
|
||||||
else:
|
else:
|
||||||
try: subprocess.check_output(str,stderr=subprocess.STDOUT,shell=True)
|
try: subprocess.check_output(txt,stderr=subprocess.STDOUT,shell=True)
|
||||||
except Exception as e: print e.output
|
except Exception as e: print(e.output)
|
||||||
|
|
||||||
if not os.path.isfile("%s/libcolvars.a" % libdir) or \
|
if not os.path.isfile("%s/libcolvars.a" % libdir) or \
|
||||||
not os.path.isfile("%s/Makefile.lammps" % libdir):
|
not os.path.isfile("%s/Makefile.lammps" % libdir):
|
||||||
error("Unsuccessful build of lib/colvars library")
|
error("Unsuccessful build of lib/colvars library")
|
||||||
else: print "Created lib/colvars library"
|
else: print("Created lib/colvars library")
|
||||||
|
|
||||||
# CUDA lib
|
# CUDA lib
|
||||||
|
|
||||||
class CUDA:
|
class CUDA(object):
|
||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
self.inlist = copy.copy(list)
|
self.inlist = copy.copy(list)
|
||||||
self.mode = "double"
|
self.mode = "double"
|
||||||
|
@ -1205,30 +1208,30 @@ class CUDA:
|
||||||
|
|
||||||
def build(self):
|
def build(self):
|
||||||
libdir = dir.lib + "/cuda"
|
libdir = dir.lib + "/cuda"
|
||||||
commands.getoutput("cd %s; make clean" % libdir)
|
subprocess.check_output("cd %s; make clean" % libdir,stderr=subprocess.STDOUT,shell=True)
|
||||||
if self.mode == "double": n = 2
|
if self.mode == "double": n = 2
|
||||||
elif self.mode == "mixed": n = 3
|
elif self.mode == "mixed": n = 3
|
||||||
elif self.mode == "single": n = 1
|
elif self.mode == "single": n = 1
|
||||||
if jmake: str = "cd %s; make -j %d precision=%d arch=%s" % \
|
if jmake: txt = "cd %s; make -j %d precision=%d arch=%s" % \
|
||||||
(libdir,jmake.n,n,self.arch)
|
(libdir,jmake.n,n,self.arch)
|
||||||
else: str = str = "cd %s; make precision=%d arch=%s" % \
|
else: txt = "cd %s; make precision=%d arch=%s" % \
|
||||||
(libdir,n,self.arch)
|
(libdir,n,self.arch)
|
||||||
|
|
||||||
# if verbose, print output as build proceeds, else only print if fails
|
# if verbose, print output as build proceeds, else only print if fails
|
||||||
|
|
||||||
if verbose: subprocess.call(str,shell=True)
|
if verbose: subprocess.call(txt,shell=True)
|
||||||
else:
|
else:
|
||||||
try: subprocess.check_output(str,stderr=subprocess.STDOUT,shell=True)
|
try: subprocess.check_output(txt,stderr=subprocess.STDOUT,shell=True)
|
||||||
except Exception as e: print e.output
|
except Exception as e: print(e.output)
|
||||||
|
|
||||||
if not os.path.isfile("%s/liblammpscuda.a" % libdir) or \
|
if not os.path.isfile("%s/liblammpscuda.a" % libdir) or \
|
||||||
not os.path.isfile("%s/Makefile.lammps" % libdir):
|
not os.path.isfile("%s/Makefile.lammps" % libdir):
|
||||||
error("Unsuccessful build of lib/cuda library")
|
error("Unsuccessful build of lib/cuda library")
|
||||||
else: print "Created lib/cuda library"
|
else: print("Created lib/cuda library")
|
||||||
|
|
||||||
# GPU lib
|
# GPU lib
|
||||||
|
|
||||||
class GPU:
|
class GPU(object):
|
||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
self.inlist = copy.copy(list)
|
self.inlist = copy.copy(list)
|
||||||
self.make = "linux.double"
|
self.make = "linux.double"
|
||||||
|
@ -1300,25 +1303,25 @@ class GPU:
|
||||||
make = "make"
|
make = "make"
|
||||||
if "shannon" == platform.node(): make = "srun make"
|
if "shannon" == platform.node(): make = "srun make"
|
||||||
|
|
||||||
commands.getoutput("cd %s; %s -f Makefile.auto clean" % (libdir,make))
|
subprocess.check_output("cd %s; %s -f Makefile.auto clean" % (libdir,make),stderr=subprocess.STDOUT,shell=True)
|
||||||
if jmake: str = "cd %s; %s -j %d -f Makefile.auto" % (libdir,make,jmake.n)
|
if jmake: txt = "cd %s; %s -j %d -f Makefile.auto" % (libdir,make,jmake.n)
|
||||||
else: str = "cd %s; %s -f Makefile.auto" % (libdir,make)
|
else: txt = "cd %s; %s -f Makefile.auto" % (libdir,make)
|
||||||
|
|
||||||
# if verbose, print output as build proceeds, else only print if fails
|
# if verbose, print output as build proceeds, else only print if fails
|
||||||
|
|
||||||
if verbose: subprocess.call(str,shell=True)
|
if verbose: subprocess.call(txt,shell=True)
|
||||||
else:
|
else:
|
||||||
try: subprocess.check_output(str,stderr=subprocess.STDOUT,shell=True)
|
try: subprocess.check_output(txt,stderr=subprocess.STDOUT,shell=True)
|
||||||
except Exception as e: print e.output
|
except Exception as e: print(e.output)
|
||||||
|
|
||||||
if not os.path.isfile("%s/libgpu.a" % libdir) or \
|
if not os.path.isfile("%s/libgpu.a" % libdir) or \
|
||||||
not os.path.isfile("%s/Makefile.lammps" % libdir):
|
not os.path.isfile("%s/Makefile.lammps" % libdir):
|
||||||
error("Unsuccessful build of lib/gpu library")
|
error("Unsuccessful build of lib/gpu library")
|
||||||
else: print "Created lib/gpu library"
|
else: print("Created lib/gpu library")
|
||||||
|
|
||||||
# H5MD lib
|
# H5MD lib
|
||||||
|
|
||||||
class H5MD:
|
class H5MD(object):
|
||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
self.inlist = copy.copy(list)
|
self.inlist = copy.copy(list)
|
||||||
self.make = "h5cc"
|
self.make = "h5cc"
|
||||||
|
@ -1351,24 +1354,24 @@ class H5MD:
|
||||||
make.setvar("EXTRAMAKE","Makefile.lammps.%s" % self.lammps)
|
make.setvar("EXTRAMAKE","Makefile.lammps.%s" % self.lammps)
|
||||||
make.write("%s/Makefile.auto" % libdir)
|
make.write("%s/Makefile.auto" % libdir)
|
||||||
|
|
||||||
commands.getoutput("cd %s; make clean" % libdir)
|
subprocess.check_output("cd %s; make clean" % libdir,stderr=subprocess.STDOUT,shell=True)
|
||||||
str = "cd %s; make" % libdir
|
txt = "cd %s; make" % libdir
|
||||||
|
|
||||||
# if verbose, print output as build proceeds, else only print if fails
|
# if verbose, print output as build proceeds, else only print if fails
|
||||||
|
|
||||||
if verbose: subprocess.call(str,shell=True)
|
if verbose: subprocess.call(txt,shell=True)
|
||||||
else:
|
else:
|
||||||
try: subprocess.check_output(str,stderr=subprocess.STDOUT,shell=True)
|
try: subprocess.check_output(txt,stderr=subprocess.STDOUT,shell=True)
|
||||||
except Exception as e: print e.output
|
except Exception as e: print(e.output)
|
||||||
|
|
||||||
if not os.path.isfile("%s/libch5md.a" % libdir) or \
|
if not os.path.isfile("%s/libch5md.a" % libdir) or \
|
||||||
not os.path.isfile("%s/Makefile.lammps" % libdir):
|
not os.path.isfile("%s/Makefile.lammps" % libdir):
|
||||||
error("Unsuccessful build of lib/h5md library")
|
error("Unsuccessful build of lib/h5md library")
|
||||||
else: print "Created lib/h5md library"
|
else: print("Created lib/h5md library")
|
||||||
|
|
||||||
# MEAM lib
|
# MEAM lib
|
||||||
|
|
||||||
class MEAM:
|
class MEAM(object):
|
||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
self.inlist = copy.copy(list)
|
self.inlist = copy.copy(list)
|
||||||
self.make = "gfortran"
|
self.make = "gfortran"
|
||||||
|
@ -1401,25 +1404,25 @@ class MEAM:
|
||||||
make.setvar("EXTRAMAKE","Makefile.lammps.%s" % self.lammps)
|
make.setvar("EXTRAMAKE","Makefile.lammps.%s" % self.lammps)
|
||||||
make.write("%s/Makefile.auto" % libdir)
|
make.write("%s/Makefile.auto" % libdir)
|
||||||
|
|
||||||
commands.getoutput("cd %s; make -f Makefile.auto clean" % libdir)
|
subprocess.check_output("cd %s; make -f Makefile.auto clean" % libdir,stderr=subprocess.STDOUT,shell=True)
|
||||||
# do not use -j for MEAM build, parallel build does not work
|
# do not use -j for MEAM build, parallel build does not work
|
||||||
str = "cd %s; make -f Makefile.auto" % libdir
|
txt = "cd %s; make -f Makefile.auto" % libdir
|
||||||
|
|
||||||
# if verbose, print output as build proceeds, else only print if fails
|
# if verbose, print output as build proceeds, else only print if fails
|
||||||
|
|
||||||
if verbose: subprocess.call(str,shell=True)
|
if verbose: subprocess.call(txt,shell=True)
|
||||||
else:
|
else:
|
||||||
try: subprocess.check_output(str,stderr=subprocess.STDOUT,shell=True)
|
try: subprocess.check_output(txt,stderr=subprocess.STDOUT,shell=True)
|
||||||
except Exception as e: print e.output
|
except Exception as e: print(e.output)
|
||||||
|
|
||||||
if not os.path.isfile("%s/libmeam.a" % libdir) or \
|
if not os.path.isfile("%s/libmeam.a" % libdir) or \
|
||||||
not os.path.isfile("%s/Makefile.lammps" % libdir):
|
not os.path.isfile("%s/Makefile.lammps" % libdir):
|
||||||
error("Unsuccessful build of lib/meam library")
|
error("Unsuccessful build of lib/meam library")
|
||||||
else: print "Created lib/meam library"
|
else: print("Created lib/meam library")
|
||||||
|
|
||||||
# POEMS lib
|
# POEMS lib
|
||||||
|
|
||||||
class POEMS:
|
class POEMS(object):
|
||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
self.inlist = copy.copy(list)
|
self.inlist = copy.copy(list)
|
||||||
self.make = "g++"
|
self.make = "g++"
|
||||||
|
@ -1452,25 +1455,25 @@ class POEMS:
|
||||||
make.setvar("EXTRAMAKE","Makefile.lammps.%s" % self.lammps)
|
make.setvar("EXTRAMAKE","Makefile.lammps.%s" % self.lammps)
|
||||||
make.write("%s/Makefile.auto" % libdir)
|
make.write("%s/Makefile.auto" % libdir)
|
||||||
|
|
||||||
commands.getoutput("cd %s; make -f Makefile.auto clean" % libdir)
|
subprocess.check_output("cd %s; make -f Makefile.auto clean" % libdir,stderr=subprocess.STDOUT,shell=True)
|
||||||
if jmake: str = "cd %s; make -j %d -f Makefile.auto" % (libdir,jmake.n)
|
if jmake: txt = "cd %s; make -j %d -f Makefile.auto" % (libdir,jmake.n)
|
||||||
else: str = "cd %s; make -f Makefile.auto" % libdir
|
else: txt = "cd %s; make -f Makefile.auto" % libdir
|
||||||
|
|
||||||
# if verbose, print output as build proceeds, else only print if fails
|
# if verbose, print output as build proceeds, else only print if fails
|
||||||
|
|
||||||
if verbose: subprocess.call(str,shell=True)
|
if verbose: subprocess.call(txt,shell=True)
|
||||||
else:
|
else:
|
||||||
try: subprocess.check_output(str,stderr=subprocess.STDOUT,shell=True)
|
try: subprocess.check_output(txt,stderr=subprocess.STDOUT,shell=True)
|
||||||
except Exception as e: print e.output
|
except Exception as e: print(e.output)
|
||||||
|
|
||||||
if not os.path.isfile("%s/libpoems.a" % libdir) or \
|
if not os.path.isfile("%s/libpoems.a" % libdir) or \
|
||||||
not os.path.isfile("%s/Makefile.lammps" % libdir):
|
not os.path.isfile("%s/Makefile.lammps" % libdir):
|
||||||
error("Unsuccessful build of lib/poems library")
|
error("Unsuccessful build of lib/poems library")
|
||||||
else: print "Created lib/poems library"
|
else: print("Created lib/poems library")
|
||||||
|
|
||||||
# PYTHON lib
|
# PYTHON lib
|
||||||
|
|
||||||
class PYTHON:
|
class PYTHON(object):
|
||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
self.inlist = copy.copy(list)
|
self.inlist = copy.copy(list)
|
||||||
self.make = "g++"
|
self.make = "g++"
|
||||||
|
@ -1497,15 +1500,15 @@ class PYTHON:
|
||||||
def build(self):
|
def build(self):
|
||||||
libdir = dir.lib + "/python"
|
libdir = dir.lib + "/python"
|
||||||
if self.lammpsflag:
|
if self.lammpsflag:
|
||||||
commands.getoutput("cd %s; cp Makefile.lammps.%s Makefile.lammps" %
|
subprocess.check_output("cd %s; cp Makefile.lammps.%s Makefile.lammps" %
|
||||||
(libdir,self.lammps))
|
(libdir,self.lammps))
|
||||||
if not os.path.isfile("%s/Makefile.lammps.%s" % (libdir,self.lammps)):
|
if not os.path.isfile("%s/Makefile.lammps.%s" % (libdir,self.lammps)):
|
||||||
error("Unsuccessful creation of lib/python/Makefile.lammps.%s file" % self.lammps)
|
error("Unsuccessful creation of lib/python/Makefile.lammps.%s file" % self.lammps)
|
||||||
else: print "Created lib/python/Makefile.lammps file"
|
else: print("Created lib/python/Makefile.lammps file")
|
||||||
|
|
||||||
# QMMM lib
|
# QMMM lib
|
||||||
|
|
||||||
class QMMM:
|
class QMMM(object):
|
||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
self.inlist = copy.copy(list)
|
self.inlist = copy.copy(list)
|
||||||
self.make = "gfortran"
|
self.make = "gfortran"
|
||||||
|
@ -1538,25 +1541,25 @@ class QMMM:
|
||||||
make.setvar("EXTRAMAKE","Makefile.lammps.%s" % self.lammps)
|
make.setvar("EXTRAMAKE","Makefile.lammps.%s" % self.lammps)
|
||||||
make.write("%s/Makefile.auto" % libdir)
|
make.write("%s/Makefile.auto" % libdir)
|
||||||
|
|
||||||
commands.getoutput("cd %s; make -f Makefile.auto clean" % libdir)
|
subprocess.check_output("cd %s; make -f Makefile.auto clean" % libdir,stderr=subprocess.STDOUT,shell=True)
|
||||||
if jmake: str = "cd %s; make -j %d -f Makefile.auto" % (libdir,jmake.n)
|
if jmake: txt = "cd %s; make -j %d -f Makefile.auto" % (libdir,jmake.n)
|
||||||
else: str = "cd %s; make -f Makefile.auto" % libdir
|
else: txt = "cd %s; make -f Makefile.auto" % libdir
|
||||||
|
|
||||||
# if verbose, print output as build proceeds, else only print if fails
|
# if verbose, print output as build proceeds, else only print if fails
|
||||||
|
|
||||||
if verbose: subprocess.call(str,shell=True)
|
if verbose: subprocess.call(txt,shell=True)
|
||||||
else:
|
else:
|
||||||
try: subprocess.check_output(str,stderr=subprocess.STDOUT,shell=True)
|
try: subprocess.check_output(txt,stderr=subprocess.STDOUT,shell=True)
|
||||||
except Exception as e: print e.output
|
except Exception as e: print(e.output)
|
||||||
|
|
||||||
if not os.path.isfile("%s/libqmmm.a" % libdir) or \
|
if not os.path.isfile("%s/libqmmm.a" % libdir) or \
|
||||||
not os.path.isfile("%s/Makefile.lammps" % libdir):
|
not os.path.isfile("%s/Makefile.lammps" % libdir):
|
||||||
error("Unsuccessful build of lib/qmmm library")
|
error("Unsuccessful build of lib/qmmm library")
|
||||||
else: print "Created lib/qmmm library"
|
else: print("Created lib/qmmm library")
|
||||||
|
|
||||||
# REAX lib
|
# REAX lib
|
||||||
|
|
||||||
class REAX:
|
class REAX(object):
|
||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
self.inlist = copy.copy(list)
|
self.inlist = copy.copy(list)
|
||||||
self.make = "gfortran"
|
self.make = "gfortran"
|
||||||
|
@ -1590,24 +1593,24 @@ class REAX:
|
||||||
make.write("%s/Makefile.auto" % libdir)
|
make.write("%s/Makefile.auto" % libdir)
|
||||||
|
|
||||||
commands.getoutput("cd %s; make -f Makefile.auto clean" % libdir)
|
commands.getoutput("cd %s; make -f Makefile.auto clean" % libdir)
|
||||||
if jmake: str = "cd %s; make -j %d -f Makefile.auto" % (libdir,jmake.n)
|
if jmake: txt = "cd %s; make -j %d -f Makefile.auto" % (libdir,jmake.n)
|
||||||
else: str = "cd %s; make -f Makefile.auto" % libdir
|
else: txt = "cd %s; make -f Makefile.auto" % libdir
|
||||||
|
|
||||||
# if verbose, print output as build proceeds, else only print if fails
|
# if verbose, print output as build proceeds, else only print if fails
|
||||||
|
|
||||||
if verbose: subprocess.call(str,shell=True)
|
if verbose: subprocess.call(txt,shell=True)
|
||||||
else:
|
else:
|
||||||
try: subprocess.check_output(str,stderr=subprocess.STDOUT,shell=True)
|
try: subprocess.check_output(txt,stderr=subprocess.STDOUT,shell=True)
|
||||||
except Exception as e: print e.output
|
except Exception as e: print(e.output)
|
||||||
|
|
||||||
if not os.path.isfile("%s/libreax.a" % libdir) or \
|
if not os.path.isfile("%s/libreax.a" % libdir) or \
|
||||||
not os.path.isfile("%s/Makefile.lammps" % libdir):
|
not os.path.isfile("%s/Makefile.lammps" % libdir):
|
||||||
error("Unsuccessful build of lib/reax library")
|
error("Unsuccessful build of lib/reax library")
|
||||||
else: print "Created lib/reax library"
|
else: print("Created lib/reax library")
|
||||||
|
|
||||||
# VORONOI lib
|
# VORONOI lib
|
||||||
|
|
||||||
class VORONOI:
|
class VORONOI(object):
|
||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
self.inlist = copy.copy(list)
|
self.inlist = copy.copy(list)
|
||||||
self.install = ""
|
self.install = ""
|
||||||
|
@ -1635,9 +1638,9 @@ class VORONOI:
|
||||||
if not self.install: return
|
if not self.install: return
|
||||||
libdir = dir.lib + "/voronoi"
|
libdir = dir.lib + "/voronoi"
|
||||||
cmd = "cd %s; python install.py %s" % (libdir,self.install)
|
cmd = "cd %s; python install.py %s" % (libdir,self.install)
|
||||||
txt = commands.getoutput(cmd)
|
txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True).decode()
|
||||||
if verbose: print txt
|
if verbose: print(txt)
|
||||||
print "Created lib/voronoi library"
|
print("Created lib/voronoi library")
|
||||||
|
|
||||||
# ----------------------------------------------------------------
|
# ----------------------------------------------------------------
|
||||||
# build classes for intel, kokkos build options
|
# build classes for intel, kokkos build options
|
||||||
|
@ -1645,7 +1648,7 @@ class VORONOI:
|
||||||
|
|
||||||
# Intel class
|
# Intel class
|
||||||
|
|
||||||
class Intel:
|
class Intel(object):
|
||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
self.inlist = copy.copy(list)
|
self.inlist = copy.copy(list)
|
||||||
self.mode = "cpu"
|
self.mode = "cpu"
|
||||||
|
@ -1666,7 +1669,7 @@ class Intel:
|
||||||
|
|
||||||
# Kokkos class
|
# Kokkos class
|
||||||
|
|
||||||
class Kokkos:
|
class Kokkos(object):
|
||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
self.inlist = copy.copy(list)
|
self.inlist = copy.copy(list)
|
||||||
self.mode = ""
|
self.mode = ""
|
||||||
|
@ -1688,7 +1691,7 @@ class Kokkos:
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def check(self):
|
def check(self):
|
||||||
print self.inlist
|
print(self.inlist)
|
||||||
if self.inlist != None and len(self.inlist) == 0:
|
if self.inlist != None and len(self.inlist) == 0:
|
||||||
error("-kokkos args are invalid")
|
error("-kokkos args are invalid")
|
||||||
|
|
||||||
|
@ -1710,7 +1713,7 @@ class Kokkos:
|
||||||
|
|
||||||
# Cc class
|
# Cc class
|
||||||
|
|
||||||
class Cc:
|
class Cc(object):
|
||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
self.inlist = copy.copy(list)
|
self.inlist = copy.copy(list)
|
||||||
self.compiler = self.abbrev = ""
|
self.compiler = self.abbrev = ""
|
||||||
|
@ -1762,7 +1765,7 @@ class Cc:
|
||||||
|
|
||||||
# Flags class
|
# Flags class
|
||||||
|
|
||||||
class Flags:
|
class Flags(object):
|
||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
self.inlist = copy.copy(list)
|
self.inlist = copy.copy(list)
|
||||||
self.flags = []
|
self.flags = []
|
||||||
|
@ -1803,7 +1806,7 @@ class Flags:
|
||||||
|
|
||||||
# Mpi class
|
# Mpi class
|
||||||
|
|
||||||
class Mpi:
|
class Mpi(object):
|
||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
self.inlist = copy.copy(list)
|
self.inlist = copy.copy(list)
|
||||||
self.style = self.dir = ""
|
self.style = self.dir = ""
|
||||||
|
@ -1837,7 +1840,7 @@ class Mpi:
|
||||||
|
|
||||||
# Fft class
|
# Fft class
|
||||||
|
|
||||||
class Fft:
|
class Fft(object):
|
||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
self.inlist = copy.copy(list)
|
self.inlist = copy.copy(list)
|
||||||
self.dir = self.incdir = self.libdir = ""
|
self.dir = self.incdir = self.libdir = ""
|
||||||
|
@ -1877,7 +1880,7 @@ class Fft:
|
||||||
|
|
||||||
# Jpg class
|
# Jpg class
|
||||||
|
|
||||||
class Jpg:
|
class Jpg(object):
|
||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
self.inlist = copy.copy(list)
|
self.inlist = copy.copy(list)
|
||||||
self.on = 1
|
self.on = 1
|
||||||
|
@ -1916,7 +1919,7 @@ class Jpg:
|
||||||
|
|
||||||
# Png class
|
# Png class
|
||||||
|
|
||||||
class Png:
|
class Png(object):
|
||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
self.inlist = copy.copy(list)
|
self.inlist = copy.copy(list)
|
||||||
self.on = 1
|
self.on = 1
|
||||||
|
@ -1958,7 +1961,7 @@ class Png:
|
||||||
|
|
||||||
# read, tweak, and write a Makefile
|
# read, tweak, and write a Makefile
|
||||||
|
|
||||||
class MakeReader:
|
class MakeReader(object):
|
||||||
|
|
||||||
# read a makefile
|
# read a makefile
|
||||||
# flag = 0 if file is full path name
|
# flag = 0 if file is full path name
|
||||||
|
@ -2127,14 +2130,14 @@ class MakeReader:
|
||||||
if not line.isdigit():
|
if not line.isdigit():
|
||||||
if flag and i == 0:
|
if flag and i == 0:
|
||||||
line = "# auto = makefile auto-generated by Make.py"
|
line = "# auto = makefile auto-generated by Make.py"
|
||||||
print >>fp,line
|
print(line, file=fp)
|
||||||
else:
|
else:
|
||||||
index = int(line)
|
index = int(line)
|
||||||
name = self.varinfo[index][0]
|
name = self.varinfo[index][0]
|
||||||
txt = self.varinfo[index][1]
|
txt = self.varinfo[index][1]
|
||||||
if name not in self.var: continue
|
if name not in self.var: continue
|
||||||
values = self.var[name]
|
values = self.var[name]
|
||||||
print >>fp,"%s%s" % (txt,' '.join(values))
|
print("%s%s" % (txt,' '.join(values)), file=fp)
|
||||||
|
|
||||||
# ----------------------------------------------------------------
|
# ----------------------------------------------------------------
|
||||||
# main program
|
# main program
|
||||||
|
@ -2203,7 +2206,7 @@ while 1:
|
||||||
switches[switch] = cmd_switches[switch]
|
switches[switch] = cmd_switches[switch]
|
||||||
|
|
||||||
argstr = switch2str(switches,switch_order)
|
argstr = switch2str(switches,switch_order)
|
||||||
print "Redo command: Make.py",argstr
|
print("Redo command: Make.py",argstr)
|
||||||
else:
|
else:
|
||||||
switches = cmd_switches
|
switches = cmd_switches
|
||||||
switch_order = cmd_switch_order
|
switch_order = cmd_switch_order
|
||||||
|
@ -2246,10 +2249,10 @@ while 1:
|
||||||
|
|
||||||
if help or (actions and "-h" in actions.inlist) or not switches:
|
if help or (actions and "-h" in actions.inlist) or not switches:
|
||||||
if not help: help = Help(None)
|
if not help: help = Help(None)
|
||||||
print help.help()
|
print(help.help())
|
||||||
for switch in switch_order:
|
for switch in switch_order:
|
||||||
if switch == "h": continue
|
if switch == "h": continue
|
||||||
print classes[switch].help()[1:]
|
print(classes[switch].help()[1:])
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
# create needed default classes if not specified with switch
|
# create needed default classes if not specified with switch
|
||||||
|
@ -2298,7 +2301,7 @@ while 1:
|
||||||
|
|
||||||
if actions:
|
if actions:
|
||||||
for action in actions.alist:
|
for action in actions.alist:
|
||||||
print "Action %s ..." % action
|
print("Action %s ..." % action)
|
||||||
if action.startswith("lib-"): actions.lib(action[4:])
|
if action.startswith("lib-"): actions.lib(action[4:])
|
||||||
elif action == "file": actions.file("file")
|
elif action == "file": actions.file("file")
|
||||||
elif action == "clean": actions.clean()
|
elif action == "clean": actions.clean()
|
||||||
|
@ -2310,35 +2313,35 @@ while 1:
|
||||||
|
|
||||||
if output and actions and "exe" in actions.alist:
|
if output and actions and "exe" in actions.alist:
|
||||||
txt = "cp %s/lmp_auto %s/lmp_%s" % (dir.src,dir.cwd,output.machine)
|
txt = "cp %s/lmp_auto %s/lmp_%s" % (dir.src,dir.cwd,output.machine)
|
||||||
commands.getoutput(txt)
|
subprocess.check_output(txt,stderr=subprocess.STDOUT,shell=True)
|
||||||
print "Created lmp_%s in %s" % (output.machine,dir.cwd)
|
print("Created lmp_%s in %s" % (output.machine,dir.cwd))
|
||||||
|
|
||||||
# create copy of Makefile.auto if requested, and file or exe action performed
|
# create copy of Makefile.auto if requested, and file or exe action performed
|
||||||
# ditto for library Makefile.auto and Makefile.lammps files
|
# ditto for library Makefile.auto and Makefile.lammps files
|
||||||
|
|
||||||
if zoutput and actions and \
|
if zoutput and actions and \
|
||||||
("file" in actions.alist or "exe" in actions.alist):
|
("file" in actions.alist or "exe" in actions.alist):
|
||||||
txt = "cp %s/MAKE/MINE/Makefile.auto %s/MAKE/MINE/Makefile.%s" % \
|
txt = "cp %s/MAKE/MINE/Makefile.auto %s/MAKE/MINE/Makefile.%s" % \
|
||||||
(dir.src,dir.src,zoutput.machine)
|
(dir.src,dir.src,zoutput.machine)
|
||||||
commands.getoutput(txt)
|
subprocess.check_output(txt,stderr=subprocess.STDOUT,shell=True)
|
||||||
print "Created Makefile.%s in %s/MAKE/MINE" % (zoutput.machine,dir.src)
|
print("Created Makefile.%s in %s/MAKE/MINE" % (zoutput.machine,dir.src))
|
||||||
if gpubuildflag:
|
if gpubuildflag:
|
||||||
txt = "cp %s/gpu/Makefile.auto %s/MAKE/MINE/Makefile_gpu.%s" % \
|
txt = "cp %s/gpu/Makefile.auto %s/MAKE/MINE/Makefile_gpu.%s" % \
|
||||||
(dir.lib,dir.src,zoutput.machine)
|
(dir.lib,dir.src,zoutput.machine)
|
||||||
commands.getoutput(txt)
|
subprocess.check_output(txt,stderr=subprocess.STDOUT,shell=True)
|
||||||
print "Created Makefile_gpu.%s in %s/MAKE/MINE" % \
|
print("Created Makefile_gpu.%s in %s/MAKE/MINE" % \
|
||||||
(zoutput.machine,dir.src)
|
(zoutput.machine,dir.src))
|
||||||
txt = "cp %s/gpu/Makefile.lammps %s/MAKE/MINE/Makefile_gpu_lammps.%s" % \
|
txt = "cp %s/gpu/Makefile.lammps %s/MAKE/MINE/Makefile_gpu_lammps.%s" % \
|
||||||
(dir.lib,dir.src,zoutput.machine)
|
(dir.lib,dir.src,zoutput.machine)
|
||||||
commands.getoutput(txt)
|
subprocess.check_output(txt,stderr=subprocess.STDOUT,shell=True)
|
||||||
print "Created Makefile_gpu_lammps.%s in %s/MAKE/MINE" % \
|
print("Created Makefile_gpu_lammps.%s in %s/MAKE/MINE" % \
|
||||||
(zoutput.machine,dir.src)
|
(zoutput.machine,dir.src))
|
||||||
|
|
||||||
# write current Make.py command to src/Make.py.last
|
# write current Make.py command to src/Make.py.last
|
||||||
|
|
||||||
fp = open("%s/Make.py.last" % dir.src,'w')
|
fp = open("%s/Make.py.last" % dir.src,'w')
|
||||||
print >>fp,"# last invoked Make.py command"
|
print("# last invoked Make.py command", file=fp)
|
||||||
print >>fp,switch2str(switches,switch_order)
|
print(switch2str(switches,switch_order), file=fp)
|
||||||
fp.close()
|
fp.close()
|
||||||
|
|
||||||
# if not redoflag, done
|
# if not redoflag, done
|
||||||
|
|
|
@ -5,6 +5,12 @@
|
||||||
# sh Make.sh Makefile.shlib
|
# sh Make.sh Makefile.shlib
|
||||||
# sh Make.sh Makefile.list
|
# sh Make.sh Makefile.list
|
||||||
|
|
||||||
|
# turn off enforced customizations
|
||||||
|
GREP_OPTIONS=
|
||||||
|
# enforce using portable C locale
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL GREP_OPTIONS
|
||||||
|
|
||||||
# function to create one style_*.h file
|
# function to create one style_*.h file
|
||||||
# must whack *.d files that depend on style_*.h file,
|
# must whack *.d files that depend on style_*.h file,
|
||||||
# else Make will not recreate them
|
# else Make will not recreate them
|
||||||
|
|
|
@ -5,6 +5,10 @@ mode=$1
|
||||||
|
|
||||||
# arg1 = file, arg2 = file it depends on
|
# arg1 = file, arg2 = file it depends on
|
||||||
|
|
||||||
|
# enforce using portable C locale
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
action () {
|
action () {
|
||||||
if (test $mode = 0) then
|
if (test $mode = 0) then
|
||||||
rm -f ../$1
|
rm -f ../$1
|
||||||
|
|
|
@ -5,6 +5,10 @@ mode=$1
|
||||||
|
|
||||||
# arg1 = file, arg2 = file it depends on
|
# arg1 = file, arg2 = file it depends on
|
||||||
|
|
||||||
|
# enforce using portable C locale
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
action () {
|
action () {
|
||||||
if (test $mode = 0) then
|
if (test $mode = 0) then
|
||||||
rm -f ../$1
|
rm -f ../$1
|
||||||
|
|
|
@ -5,6 +5,10 @@ mode=$1
|
||||||
|
|
||||||
# arg1 = file, arg2 = file it depends on
|
# arg1 = file, arg2 = file it depends on
|
||||||
|
|
||||||
|
# enforce using portable C locale
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
action () {
|
action () {
|
||||||
if (test $mode = 0) then
|
if (test $mode = 0) then
|
||||||
rm -f ../$1
|
rm -f ../$1
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
# Package.sh = package management, called from Makefile
|
# Package.sh = package management, called from Makefile
|
||||||
# Syntax: sh Package.sh DIR status/update/overwrite/diff
|
# Syntax: sh Package.sh DIR status/update/overwrite/diff
|
||||||
|
|
||||||
|
# enforce using portable C locale
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
# package is already installed if any package *.cpp or *.h file is in src
|
# package is already installed if any package *.cpp or *.h file is in src
|
||||||
# else not installed
|
# else not installed
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,10 @@ mode=$1
|
||||||
|
|
||||||
# arg1 = file, arg2 = file it depends on
|
# arg1 = file, arg2 = file it depends on
|
||||||
|
|
||||||
|
# enforce using portable C locale
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
action () {
|
action () {
|
||||||
if (test $mode = 0) then
|
if (test $mode = 0) then
|
||||||
rm -f ../$1
|
rm -f ../$1
|
||||||
|
|
|
@ -5,6 +5,10 @@ mode=$1
|
||||||
|
|
||||||
# arg1 = file, arg2 = file it depends on
|
# arg1 = file, arg2 = file it depends on
|
||||||
|
|
||||||
|
# enforce using portable C locale
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
action () {
|
action () {
|
||||||
if (test $mode = 0) then
|
if (test $mode = 0) then
|
||||||
rm -f ../$1
|
rm -f ../$1
|
||||||
|
|
|
@ -5,6 +5,10 @@ mode=$1
|
||||||
|
|
||||||
# arg1 = file, arg2 = file it depends on
|
# arg1 = file, arg2 = file it depends on
|
||||||
|
|
||||||
|
# enforce using portable C locale
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
action () {
|
action () {
|
||||||
if (test $mode = 0) then
|
if (test $mode = 0) then
|
||||||
rm -f ../$1
|
rm -f ../$1
|
||||||
|
|
|
@ -5,6 +5,10 @@ mode=$1
|
||||||
|
|
||||||
# arg1 = file, arg2 = file it depends on
|
# arg1 = file, arg2 = file it depends on
|
||||||
|
|
||||||
|
# enforce using portable C locale
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
action () {
|
action () {
|
||||||
if (test $mode = 0) then
|
if (test $mode = 0) then
|
||||||
rm -f ../$1
|
rm -f ../$1
|
||||||
|
|
|
@ -5,6 +5,10 @@ mode=$1
|
||||||
|
|
||||||
# arg1 = file, arg2 = file it depends on
|
# arg1 = file, arg2 = file it depends on
|
||||||
|
|
||||||
|
# enforce using portable C locale
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
action () {
|
action () {
|
||||||
if (test $mode = 0) then
|
if (test $mode = 0) then
|
||||||
rm -f ../$1
|
rm -f ../$1
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
# Install/unInstall package files in LAMMPS
|
# Install/unInstall package files in LAMMPS
|
||||||
# mode = 0/1/2 for uninstall/install/update
|
# mode = 0/1/2 for uninstall/install/update
|
||||||
|
|
||||||
# this is default Install.sh for all packages
|
|
||||||
# if package has an auxiliary library or a file with a dependency,
|
|
||||||
# then package dir has its own customized Install.sh
|
|
||||||
|
|
||||||
mode=$1
|
mode=$1
|
||||||
|
|
||||||
|
# enforce using portable C locale
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
# arg1 = file, arg2 = file it depends on
|
# arg1 = file, arg2 = file it depends on
|
||||||
|
|
||||||
action () {
|
action () {
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
|
|
||||||
mode=$1
|
mode=$1
|
||||||
|
|
||||||
|
# enforce using portable C locale
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
# arg1 = file, arg2 = file it depends on
|
# arg1 = file, arg2 = file it depends on
|
||||||
|
|
||||||
action () {
|
action () {
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
|
|
||||||
mode=$1
|
mode=$1
|
||||||
|
|
||||||
|
# enforce using portable C locale
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
# arg1 = file, arg2 = file it depends on
|
# arg1 = file, arg2 = file it depends on
|
||||||
|
|
||||||
action () {
|
action () {
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
|
|
||||||
mode=$1
|
mode=$1
|
||||||
|
|
||||||
|
# enforce using portable C locale
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
# arg1 = file, arg2 = file it depends on
|
# arg1 = file, arg2 = file it depends on
|
||||||
|
|
||||||
action () {
|
action () {
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
|
|
||||||
mode=$1
|
mode=$1
|
||||||
|
|
||||||
|
# enforce using portable C locale
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
# arg1 = file, arg2 = file it depends on
|
# arg1 = file, arg2 = file it depends on
|
||||||
|
|
||||||
action () {
|
action () {
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
|
|
||||||
mode=$1
|
mode=$1
|
||||||
|
|
||||||
|
# enforce using portable C locale
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
# arg1 = file, arg2 = file it depends on
|
# arg1 = file, arg2 = file it depends on
|
||||||
|
|
||||||
action () {
|
action () {
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
|
|
||||||
mode=$1
|
mode=$1
|
||||||
|
|
||||||
|
# enforce using portable C locale
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
# arg1 = file, arg2 = file it depends on
|
# arg1 = file, arg2 = file it depends on
|
||||||
|
|
||||||
action () {
|
action () {
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
|
|
||||||
mode=$1
|
mode=$1
|
||||||
|
|
||||||
|
# enforce using portable C locale
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
# arg1 = file, arg2 = file it depends on
|
# arg1 = file, arg2 = file it depends on
|
||||||
|
|
||||||
action () {
|
action () {
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
|
|
||||||
mode=$1
|
mode=$1
|
||||||
|
|
||||||
|
# enforce using portable C locale
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
# arg1 = file, arg2 = file it depends on
|
# arg1 = file, arg2 = file it depends on
|
||||||
|
|
||||||
action () {
|
action () {
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
|
|
||||||
mode=$1
|
mode=$1
|
||||||
|
|
||||||
|
# enforce using portable C locale
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
# arg1 = file, arg2 = file it depends on
|
# arg1 = file, arg2 = file it depends on
|
||||||
|
|
||||||
action () {
|
action () {
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
|
|
||||||
mode=$1
|
mode=$1
|
||||||
|
|
||||||
|
# enforce using portable C locale
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
# arg1 = file, arg2 = file it depends on
|
# arg1 = file, arg2 = file it depends on
|
||||||
|
|
||||||
action () {
|
action () {
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
|
|
||||||
mode=$1
|
mode=$1
|
||||||
|
|
||||||
|
# enforce using portable C locale
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
# arg1 = file, arg2 = file it depends on
|
# arg1 = file, arg2 = file it depends on
|
||||||
|
|
||||||
action () {
|
action () {
|
||||||
|
|
Loading…
Reference in New Issue