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
|
||||
SHA1 = $(shell echo $USER-$PWD | sha1sum | cut -f1 -d" ")
|
||||
SHA1 = $(shell echo $USER-$PWD | python utils/sha1sum.py)
|
||||
BUILDDIR = /tmp/lammps-docs-$(SHA1)
|
||||
RSTDIR = $(BUILDDIR)/rst
|
||||
VENV = $(BUILDDIR)/docenv
|
||||
|
|
|
@ -15,18 +15,28 @@ make clean-all # remove entire build folder and any cached data
|
|||
## Installing prerequisites
|
||||
|
||||
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
|
||||
sudo apt-get install python-virtualenv
|
||||
```
|
||||
|
||||
#### Fedora
|
||||
### Fedora
|
||||
|
||||
```
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
|
@ -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
|
||||
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>
|
||||
<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>
|
||||
<hr class="docutils" />
|
||||
<div class="section" id="related-commands">
|
||||
|
@ -199,7 +202,7 @@ section for more info.</p>
|
|||
<p><strong>Default:</strong> every = 0, tchain = 3</p>
|
||||
<hr class="docutils" />
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -157,7 +157,7 @@ keyword = <em>temp</em> or <em>tchain</em> or <em>every</em>
|
|||
</div>
|
||||
<div class="section" id="description">
|
||||
<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).
|
||||
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>
|
||||
|
@ -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
|
||||
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>
|
||||
<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>
|
||||
<hr class="docutils" />
|
||||
<div class="section" id="related-commands">
|
||||
|
@ -184,7 +187,7 @@ section for more info.</p>
|
|||
<strong>Default:</strong> every = 0</p>
|
||||
<hr class="docutils" />
|
||||
<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>
|
||||
</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
|
||||
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
|
||||
|
||||
[Related commands:]
|
||||
|
@ -90,7 +94,7 @@ section for more info.
|
|||
[(Andersen)] Andersen, J. Comp. Phys. 52, 24, (1983).
|
||||
|
||||
: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/.
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
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
|
||||
|
||||
|
||||
|
@ -76,6 +80,6 @@ section for more info.
|
|||
[(Andersen)] Andersen, J. Comp. Phys. 52, 24, (1983).
|
||||
|
||||
: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/.
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
# enforce using portable C locale
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
# arg1 = file, arg2 = file it depends on
|
||||
|
||||
action () {
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
|
||||
mode=$1
|
||||
|
||||
# enforce using portable C locale
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
# arg1 = file, arg2 = file it depends on
|
||||
|
||||
action () {
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
# Depend.sh = Install/unInstall files due to package dependencies
|
||||
# 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
|
||||
# parent package = has files that files in another package derive from
|
||||
# child package = has files that derive from files in another package
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
|
||||
mode=$1
|
||||
|
||||
# enforce using portable C locale
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
# arg1 = file, arg2 = file it depends on
|
||||
|
||||
action () {
|
||||
|
|
|
@ -7,6 +7,10 @@
|
|||
|
||||
mode=$1
|
||||
|
||||
# enforce using portable C locale
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
# arg1 = file, arg2 = file it depends on
|
||||
|
||||
action () {
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
|
||||
mode=$1
|
||||
|
||||
# enforce using portable C locale
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
# arg1 = file, arg2 = file it depends on
|
||||
|
||||
action () {
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
|
||||
mode=$1
|
||||
|
||||
# enforce using portable C locale
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
# arg1 = file, arg2 = file it depends on
|
||||
|
||||
action () {
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
|
||||
mode=$1
|
||||
|
||||
# enforce using portable C locale
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
# arg1 = file, arg2 = file it depends on
|
||||
|
||||
action () {
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
|
||||
mode=$1
|
||||
|
||||
# enforce using portable C locale
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
# arg1 = file, arg2 = file it depends on
|
||||
|
||||
action () {
|
||||
|
|
363
src/Make.py
363
src/Make.py
|
@ -3,9 +3,10 @@
|
|||
# Make.py tool for managing packages and their auxiliary libs,
|
||||
# auto-editing machine Makefiles, and building LAMMPS
|
||||
# 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 classes = created class for each switch
|
||||
|
@ -34,15 +35,15 @@ gpubuildflag = 0
|
|||
# functions
|
||||
# ----------------------------------------------------------------
|
||||
|
||||
# if flag = 1, print str and exit
|
||||
# if flag = 0, print str as warning and do not exit
|
||||
# if flag = 1, print txt and exit
|
||||
# if flag = 0, print txt as warning and do not exit
|
||||
|
||||
def error(str,flag=1):
|
||||
def error(txt,flag=1):
|
||||
if flag:
|
||||
print "ERROR:",str
|
||||
print("ERROR:",txt)
|
||||
sys.exit()
|
||||
else:
|
||||
print "WARNING:",str
|
||||
print("WARNING:",txt)
|
||||
|
||||
# store command-line args as sw = dict of key/value
|
||||
# key = switch word, value = list of following args
|
||||
|
@ -83,15 +84,15 @@ def switch2str(switches,switch_order):
|
|||
|
||||
def compile_check(compiler,ccflags,warn):
|
||||
open("tmpauto.cpp",'w').write("int main(int, char **) {}\n")
|
||||
str = "%s %s -c tmpauto.cpp" % (compiler,ccflags)
|
||||
txt = commands.getoutput(str)
|
||||
tmp = "%s %s -c tmpauto.cpp" % (compiler,ccflags)
|
||||
txt = subprocess.check_output(tmp,stderr=subprocess.STDOUT,shell=True).decode()
|
||||
flag = 1
|
||||
if txt or not os.path.isfile("tmpauto.o"):
|
||||
flag = 0
|
||||
if warn:
|
||||
print str
|
||||
if txt: print txt
|
||||
else: print "compile produced no output"
|
||||
print(tmp)
|
||||
if txt: print(txt)
|
||||
else: print("compile produced no output")
|
||||
os.remove("tmpauto.cpp")
|
||||
if os.path.isfile("tmpauto.o"): os.remove("tmpauto.o")
|
||||
return flag
|
||||
|
@ -102,15 +103,15 @@ def compile_check(compiler,ccflags,warn):
|
|||
|
||||
def link_check(linker,linkflags,libs,warn):
|
||||
open("tmpauto.cpp",'w').write("int main(int, char **) {}\n")
|
||||
str = "%s %s -o tmpauto tmpauto.cpp %s" % (linker,linkflags,libs)
|
||||
txt = commands.getoutput(str)
|
||||
tmp = "%s %s -o tmpauto tmpauto.cpp %s" % (linker,linkflags,libs)
|
||||
txt = subprocess.check_output(tmp,stderr=subprocess.STDOUT,shell=True).decode()
|
||||
flag = 1
|
||||
if txt or not os.path.isfile("tmpauto"):
|
||||
flag = 0
|
||||
if warn:
|
||||
print str
|
||||
if txt: print txt
|
||||
else: print "link produced no output"
|
||||
print(tmp)
|
||||
if txt: print(txt)
|
||||
else: print("link produced no output")
|
||||
os.remove("tmpauto.cpp")
|
||||
if os.path.isfile("tmpauto"): os.remove("tmpauto")
|
||||
return flag
|
||||
|
@ -121,7 +122,7 @@ def link_check(linker,linkflags,libs,warn):
|
|||
|
||||
# actions
|
||||
|
||||
class Actions:
|
||||
class Actions(object):
|
||||
def __init__(self,list):
|
||||
self.inlist = copy.copy(list)
|
||||
|
||||
|
@ -229,18 +230,18 @@ class Actions:
|
|||
|
||||
def lib(self,suffix):
|
||||
if suffix != "all":
|
||||
print "building",suffix,"library ..."
|
||||
str = "%s.build()" % suffix
|
||||
exec(str)
|
||||
print("building",suffix,"library ...")
|
||||
txt = "%s.build()" % suffix
|
||||
exec(txt)
|
||||
else:
|
||||
final = packages.final
|
||||
for one in packages.lib:
|
||||
if final[one]:
|
||||
if "user" in one: pkg = one[5:]
|
||||
else: pkg = one
|
||||
print "building",pkg,"library ..."
|
||||
str = "%s.build()" % pkg
|
||||
exec(str)
|
||||
print("building",pkg,"library ...")
|
||||
txt = "%s.build()" % pkg
|
||||
exec(txt)
|
||||
|
||||
# read Makefile.machine
|
||||
# if caller = "file", edit via switches
|
||||
|
@ -526,8 +527,10 @@ class Actions:
|
|||
# unless caller = "exe" and "file" action already invoked
|
||||
|
||||
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)
|
||||
print "Created src/MAKE/MINE/Makefile.auto"
|
||||
print("Created src/MAKE/MINE/Makefile.auto")
|
||||
|
||||
# test full compile and link
|
||||
# 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
|
||||
|
||||
def clean(self):
|
||||
str = "cd %s; make clean-auto" % dir.src
|
||||
commands.getoutput(str)
|
||||
print "Performed make clean-auto"
|
||||
txt = "cd %s; make clean-auto" % dir.src
|
||||
subprocess.check_output(txt,stderr=subprocess.STDOUT,shell=True)
|
||||
print("Performed make clean-auto")
|
||||
|
||||
# build LAMMPS using Makefile.auto and -j setting
|
||||
# invoke self.file() first, to test makefile compile/link
|
||||
|
@ -556,15 +559,15 @@ class Actions:
|
|||
|
||||
def exe(self):
|
||||
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):
|
||||
print "building serial STUBS library ..."
|
||||
str = "cd %s/STUBS; make clean; make" % dir.src
|
||||
txt = commands.getoutput(str)
|
||||
print("building serial STUBS library ...")
|
||||
tmp = "cd %s/STUBS; make clean; make" % dir.src
|
||||
txt = subprocess.check_output(tmp,stderr=subprocess.STDOUT,shell=True).decode()
|
||||
if not os.path.isfile("%s/STUBS/libmpi_stubs.a" % dir.src):
|
||||
print txt
|
||||
print(txt)
|
||||
error('Unsuccessful "make stubs"')
|
||||
print "Created src/STUBS/libmpi_stubs.a"
|
||||
print("Created src/STUBS/libmpi_stubs.a")
|
||||
|
||||
# special hack for shannon GPU cluster
|
||||
# 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"]:
|
||||
make = "srun make"
|
||||
|
||||
if jmake: str = "cd %s; %s -j %d auto" % (dir.src,make,jmake.n)
|
||||
else: str = "cd %s; %s auto" % (dir.src,make)
|
||||
if jmake: tmp = "cd %s; %s -j %d auto" % (dir.src,make,jmake.n)
|
||||
else: tmp = "cd %s; %s auto" % (dir.src,make)
|
||||
|
||||
# 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:
|
||||
print str
|
||||
try: subprocess.check_output(str,stderr=subprocess.STDOUT,shell=True)
|
||||
except Exception as e: print e.output
|
||||
print(tmp)
|
||||
try: subprocess.check_output(tmp,stderr=subprocess.STDOUT,shell=True)
|
||||
except Exception as e: print(e.output)
|
||||
|
||||
if not os.path.isfile("%s/lmp_auto" % dir.src):
|
||||
error('Unsuccessful "make auto"')
|
||||
elif not output: print "Created src/lmp_auto"
|
||||
elif not output: print("Created src/lmp_auto")
|
||||
|
||||
# dir switch
|
||||
|
||||
class Dir:
|
||||
class Dir(object):
|
||||
def __init__(self,list):
|
||||
self.inlist = copy.copy(list)
|
||||
|
||||
|
@ -625,7 +628,7 @@ class Dir:
|
|||
|
||||
# help switch
|
||||
|
||||
class Help:
|
||||
class Help(object):
|
||||
def __init__(self,list): pass
|
||||
|
||||
def help(self):
|
||||
|
@ -650,7 +653,7 @@ Syntax: Make.py switch args ...
|
|||
|
||||
# jmake switch
|
||||
|
||||
class Jmake:
|
||||
class Jmake(object):
|
||||
def __init__(self,list):
|
||||
self.inlist = copy.copy(list)
|
||||
|
||||
|
@ -671,7 +674,7 @@ class Jmake:
|
|||
|
||||
# makefile switch
|
||||
|
||||
class Makefile:
|
||||
class Makefile(object):
|
||||
def __init__(self,list):
|
||||
self.inlist = copy.copy(list)
|
||||
|
||||
|
@ -690,7 +693,7 @@ class Makefile:
|
|||
|
||||
# output switch
|
||||
|
||||
class Output:
|
||||
class Output(object):
|
||||
def __init__(self,list):
|
||||
self.inlist = copy.copy(list)
|
||||
|
||||
|
@ -707,7 +710,7 @@ class Output:
|
|||
|
||||
# packages switch
|
||||
|
||||
class Packages:
|
||||
class Packages(object):
|
||||
def __init__(self,list):
|
||||
self.inlist = copy.copy(list)
|
||||
|
||||
|
@ -805,14 +808,14 @@ class Packages:
|
|||
# key = package name, value = 1 if currently installed, else 0
|
||||
|
||||
original = {}
|
||||
str = "cd %s; make ps" % dir.src
|
||||
output = commands.getoutput(str).split('\n')
|
||||
tmp = "cd %s; make ps" % dir.src
|
||||
output = subprocess.check_output(tmp,stderr=subprocess.STDOUT,shell=True).decode()
|
||||
pattern = "Installed\s+(\w+): package (\S+)"
|
||||
for line in output:
|
||||
m = re.search(pattern,line)
|
||||
if not m: continue
|
||||
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
|
||||
elif m.group(1) == "YES": original[pkg] = 1
|
||||
|
||||
|
@ -849,33 +852,33 @@ class Packages:
|
|||
# install packages in plist
|
||||
|
||||
def install(self):
|
||||
if self.plist: print "Installing packages ..."
|
||||
if self.plist: print("Installing packages ...")
|
||||
for one in self.plist:
|
||||
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:
|
||||
txt = commands.getoutput("cd %s; make ps" % dir.src)
|
||||
print "Package status after installation:"
|
||||
print txt
|
||||
txt = subprocess.check_output("cd %s; make ps" % dir.src,stderr=subprocess.STDOUT,shell=True).decode()
|
||||
print("Package status after installation:")
|
||||
print(txt)
|
||||
|
||||
# restore packages to original list if requested
|
||||
# order of re-install should not matter matter b/c of Depend.sh
|
||||
|
||||
def uninstall(self):
|
||||
if not self.plist or self.plist[-1] != "orig": return
|
||||
print "Restoring packages to original state ..."
|
||||
commands.getoutput("cd %s; make no-all" % dir.src)
|
||||
print("Restoring packages to original state ...")
|
||||
subprocess.check_output("cd %s; make no-all" % dir.src,stderr=subprocess.STDOUT,shell=True)
|
||||
for one in self.all:
|
||||
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:
|
||||
txt = commands.getoutput("cd %s; make ps" % dir.src)
|
||||
print "Restored package status:"
|
||||
print txt
|
||||
txt = subprocess.check_output("cd %s; make ps" % dir.src,stderr=subprocess.STDOUT,shell=True).decode()
|
||||
print("Restored package status:")
|
||||
print(txt)
|
||||
|
||||
# redo switch
|
||||
|
||||
class Redo:
|
||||
class Redo(object):
|
||||
def __init__(self,list):
|
||||
self.inlist = copy.copy(list)
|
||||
|
||||
|
@ -940,8 +943,8 @@ class Redo:
|
|||
if words[0][-1] == ':': label = words[0][:-1]
|
||||
else: label = None
|
||||
if not self.labels:
|
||||
if label: commands.append(' '.join(words[1:]))
|
||||
else: commands.append(line)
|
||||
if label: subprocess.append(' '.join(words[1:]))
|
||||
else: subprocess.append(line)
|
||||
else:
|
||||
if not label: continue
|
||||
dict[label] = ' '.join(words[1:])
|
||||
|
@ -950,13 +953,13 @@ class Redo:
|
|||
|
||||
for label in self.labels:
|
||||
if label not in dict: error("Redo label not in redo file")
|
||||
commands.append(dict[label])
|
||||
subprocess.append(dict[label])
|
||||
|
||||
self.commands = commands
|
||||
|
||||
# settings switch
|
||||
|
||||
class Settings:
|
||||
class Settings(object):
|
||||
def __init__(self,list):
|
||||
self.inlist = copy.copy(list)
|
||||
|
||||
|
@ -979,7 +982,7 @@ class Settings:
|
|||
|
||||
# verbose switch
|
||||
|
||||
class Verbose:
|
||||
class Verbose(object):
|
||||
def __init__(self,list):
|
||||
self.inlist = copy.copy(list)
|
||||
|
||||
|
@ -995,7 +998,7 @@ class Verbose:
|
|||
|
||||
# zoutput switch for making copy of final Makefile.auto
|
||||
|
||||
class Zoutput:
|
||||
class Zoutput(object):
|
||||
def __init__(self,list):
|
||||
self.inlist = copy.copy(list)
|
||||
|
||||
|
@ -1018,7 +1021,7 @@ class Zoutput:
|
|||
|
||||
# ATC lib
|
||||
|
||||
class ATC:
|
||||
class ATC(object):
|
||||
def __init__(self,list):
|
||||
self.inlist = copy.copy(list)
|
||||
self.make = "g++"
|
||||
|
@ -1051,25 +1054,25 @@ class ATC:
|
|||
make.setvar("EXTRAMAKE","Makefile.lammps.%s" % self.lammps)
|
||||
make.write("%s/Makefile.auto" % 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)
|
||||
else: str = "cd %s; make -f Makefile.auto" % libdir
|
||||
subprocess.check_output("cd %s; make -f Makefile.auto clean" % libdir,stderr=subprocess.STDOUT,shell=True)
|
||||
if jmake: txt = "cd %s; make -j %d -f Makefile.auto" % (libdir,jmake.n)
|
||||
else: txt = "cd %s; make -f Makefile.auto" % libdir
|
||||
|
||||
# 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:
|
||||
try: subprocess.check_output(str,stderr=subprocess.STDOUT,shell=True)
|
||||
except Exception as e: print e.output
|
||||
try: subprocess.check_output(txt,stderr=subprocess.STDOUT,shell=True)
|
||||
except Exception as e: print(e.output)
|
||||
|
||||
if not os.path.isfile("%s/libatc.a" % libdir) or \
|
||||
not os.path.isfile("%s/Makefile.lammps" % libdir):
|
||||
error("Unsuccessful build of lib/atc library")
|
||||
else: print "Created lib/atc library"
|
||||
else: print("Created lib/atc library")
|
||||
|
||||
# AWPMD lib
|
||||
|
||||
class AWPMD:
|
||||
class AWPMD(object):
|
||||
def __init__(self,list):
|
||||
self.inlist = copy.copy(list)
|
||||
self.make = "mpicc"
|
||||
|
@ -1102,25 +1105,25 @@ class AWPMD:
|
|||
make.setvar("EXTRAMAKE","Makefile.lammps.%s" % self.lammps)
|
||||
make.write("%s/Makefile.auto" % 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)
|
||||
else: str = "cd %s; make -f Makefile.auto" % libdir
|
||||
subprocess.check_output("cd %s; make -f Makefile.auto clean" % libdir,stderr=subprocess.STDOUT,shell=True)
|
||||
if jmake: txt = "cd %s; make -j %d -f Makefile.auto" % (libdir,jmake.n)
|
||||
else: txt = "cd %s; make -f Makefile.auto" % libdir
|
||||
|
||||
# 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:
|
||||
try: subprocess.check_output(str,stderr=subprocess.STDOUT,shell=True)
|
||||
except Exception as e: print e.output
|
||||
try: subprocess.check_output(txt,stderr=subprocess.STDOUT,shell=True)
|
||||
except Exception as e: print(e.output)
|
||||
|
||||
if not os.path.isfile("%s/libawpmd.a" % libdir) or \
|
||||
not os.path.isfile("%s/Makefile.lammps" % libdir):
|
||||
error("Unsuccessful build of lib/awpmd library")
|
||||
else: print "Created lib/awpmd library"
|
||||
else: print("Created lib/awpmd library")
|
||||
|
||||
# COLVARS lib
|
||||
|
||||
class COLVARS:
|
||||
class COLVARS(object):
|
||||
def __init__(self,list):
|
||||
self.inlist = copy.copy(list)
|
||||
self.make = "g++"
|
||||
|
@ -1153,25 +1156,25 @@ class COLVARS:
|
|||
make.setvar("EXTRAMAKE","Makefile.lammps.%s" % self.lammps)
|
||||
make.write("%s/Makefile.auto" % 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)
|
||||
else: str = "cd %s; make -f Makefile.auto" % libdir
|
||||
subprocess.check_output("cd %s; make -f Makefile.auto clean" % libdir,stderr=subprocess.STDOUT,shell=True)
|
||||
if jmake: txt = "cd %s; make -j %d -f Makefile.auto" % (libdir,jmake.n)
|
||||
else: txt = "cd %s; make -f Makefile.auto" % libdir
|
||||
|
||||
# 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:
|
||||
try: subprocess.check_output(str,stderr=subprocess.STDOUT,shell=True)
|
||||
except Exception as e: print e.output
|
||||
try: subprocess.check_output(txt,stderr=subprocess.STDOUT,shell=True)
|
||||
except Exception as e: print(e.output)
|
||||
|
||||
if not os.path.isfile("%s/libcolvars.a" % libdir) or \
|
||||
not os.path.isfile("%s/Makefile.lammps" % libdir):
|
||||
error("Unsuccessful build of lib/colvars library")
|
||||
else: print "Created lib/colvars library"
|
||||
else: print("Created lib/colvars library")
|
||||
|
||||
# CUDA lib
|
||||
|
||||
class CUDA:
|
||||
class CUDA(object):
|
||||
def __init__(self,list):
|
||||
self.inlist = copy.copy(list)
|
||||
self.mode = "double"
|
||||
|
@ -1205,30 +1208,30 @@ class CUDA:
|
|||
|
||||
def build(self):
|
||||
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
|
||||
elif self.mode == "mixed": n = 3
|
||||
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)
|
||||
else: str = str = "cd %s; make precision=%d arch=%s" % \
|
||||
else: txt = "cd %s; make precision=%d arch=%s" % \
|
||||
(libdir,n,self.arch)
|
||||
|
||||
# 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:
|
||||
try: subprocess.check_output(str,stderr=subprocess.STDOUT,shell=True)
|
||||
except Exception as e: print e.output
|
||||
try: subprocess.check_output(txt,stderr=subprocess.STDOUT,shell=True)
|
||||
except Exception as e: print(e.output)
|
||||
|
||||
if not os.path.isfile("%s/liblammpscuda.a" % libdir) or \
|
||||
not os.path.isfile("%s/Makefile.lammps" % libdir):
|
||||
error("Unsuccessful build of lib/cuda library")
|
||||
else: print "Created lib/cuda library"
|
||||
else: print("Created lib/cuda library")
|
||||
|
||||
# GPU lib
|
||||
|
||||
class GPU:
|
||||
class GPU(object):
|
||||
def __init__(self,list):
|
||||
self.inlist = copy.copy(list)
|
||||
self.make = "linux.double"
|
||||
|
@ -1300,25 +1303,25 @@ class GPU:
|
|||
make = "make"
|
||||
if "shannon" == platform.node(): make = "srun make"
|
||||
|
||||
commands.getoutput("cd %s; %s -f Makefile.auto clean" % (libdir,make))
|
||||
if jmake: str = "cd %s; %s -j %d -f Makefile.auto" % (libdir,make,jmake.n)
|
||||
else: str = "cd %s; %s -f Makefile.auto" % (libdir,make)
|
||||
subprocess.check_output("cd %s; %s -f Makefile.auto clean" % (libdir,make),stderr=subprocess.STDOUT,shell=True)
|
||||
if jmake: txt = "cd %s; %s -j %d -f Makefile.auto" % (libdir,make,jmake.n)
|
||||
else: txt = "cd %s; %s -f Makefile.auto" % (libdir,make)
|
||||
|
||||
# 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:
|
||||
try: subprocess.check_output(str,stderr=subprocess.STDOUT,shell=True)
|
||||
except Exception as e: print e.output
|
||||
try: subprocess.check_output(txt,stderr=subprocess.STDOUT,shell=True)
|
||||
except Exception as e: print(e.output)
|
||||
|
||||
if not os.path.isfile("%s/libgpu.a" % libdir) or \
|
||||
not os.path.isfile("%s/Makefile.lammps" % libdir):
|
||||
error("Unsuccessful build of lib/gpu library")
|
||||
else: print "Created lib/gpu library"
|
||||
else: print("Created lib/gpu library")
|
||||
|
||||
# H5MD lib
|
||||
|
||||
class H5MD:
|
||||
class H5MD(object):
|
||||
def __init__(self,list):
|
||||
self.inlist = copy.copy(list)
|
||||
self.make = "h5cc"
|
||||
|
@ -1351,24 +1354,24 @@ class H5MD:
|
|||
make.setvar("EXTRAMAKE","Makefile.lammps.%s" % self.lammps)
|
||||
make.write("%s/Makefile.auto" % libdir)
|
||||
|
||||
commands.getoutput("cd %s; make clean" % libdir)
|
||||
str = "cd %s; make" % libdir
|
||||
subprocess.check_output("cd %s; make clean" % libdir,stderr=subprocess.STDOUT,shell=True)
|
||||
txt = "cd %s; make" % libdir
|
||||
|
||||
# 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:
|
||||
try: subprocess.check_output(str,stderr=subprocess.STDOUT,shell=True)
|
||||
except Exception as e: print e.output
|
||||
try: subprocess.check_output(txt,stderr=subprocess.STDOUT,shell=True)
|
||||
except Exception as e: print(e.output)
|
||||
|
||||
if not os.path.isfile("%s/libch5md.a" % libdir) or \
|
||||
not os.path.isfile("%s/Makefile.lammps" % libdir):
|
||||
error("Unsuccessful build of lib/h5md library")
|
||||
else: print "Created lib/h5md library"
|
||||
else: print("Created lib/h5md library")
|
||||
|
||||
# MEAM lib
|
||||
|
||||
class MEAM:
|
||||
class MEAM(object):
|
||||
def __init__(self,list):
|
||||
self.inlist = copy.copy(list)
|
||||
self.make = "gfortran"
|
||||
|
@ -1401,25 +1404,25 @@ class MEAM:
|
|||
make.setvar("EXTRAMAKE","Makefile.lammps.%s" % self.lammps)
|
||||
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
|
||||
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: subprocess.call(str,shell=True)
|
||||
if verbose: subprocess.call(txt,shell=True)
|
||||
else:
|
||||
try: subprocess.check_output(str,stderr=subprocess.STDOUT,shell=True)
|
||||
except Exception as e: print e.output
|
||||
try: subprocess.check_output(txt,stderr=subprocess.STDOUT,shell=True)
|
||||
except Exception as e: print(e.output)
|
||||
|
||||
if not os.path.isfile("%s/libmeam.a" % libdir) or \
|
||||
not os.path.isfile("%s/Makefile.lammps" % libdir):
|
||||
error("Unsuccessful build of lib/meam library")
|
||||
else: print "Created lib/meam library"
|
||||
else: print("Created lib/meam library")
|
||||
|
||||
# POEMS lib
|
||||
|
||||
class POEMS:
|
||||
class POEMS(object):
|
||||
def __init__(self,list):
|
||||
self.inlist = copy.copy(list)
|
||||
self.make = "g++"
|
||||
|
@ -1452,25 +1455,25 @@ class POEMS:
|
|||
make.setvar("EXTRAMAKE","Makefile.lammps.%s" % self.lammps)
|
||||
make.write("%s/Makefile.auto" % 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)
|
||||
else: str = "cd %s; make -f Makefile.auto" % libdir
|
||||
subprocess.check_output("cd %s; make -f Makefile.auto clean" % libdir,stderr=subprocess.STDOUT,shell=True)
|
||||
if jmake: txt = "cd %s; make -j %d -f Makefile.auto" % (libdir,jmake.n)
|
||||
else: txt = "cd %s; make -f Makefile.auto" % libdir
|
||||
|
||||
# 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:
|
||||
try: subprocess.check_output(str,stderr=subprocess.STDOUT,shell=True)
|
||||
except Exception as e: print e.output
|
||||
try: subprocess.check_output(txt,stderr=subprocess.STDOUT,shell=True)
|
||||
except Exception as e: print(e.output)
|
||||
|
||||
if not os.path.isfile("%s/libpoems.a" % libdir) or \
|
||||
not os.path.isfile("%s/Makefile.lammps" % libdir):
|
||||
error("Unsuccessful build of lib/poems library")
|
||||
else: print "Created lib/poems library"
|
||||
else: print("Created lib/poems library")
|
||||
|
||||
# PYTHON lib
|
||||
|
||||
class PYTHON:
|
||||
class PYTHON(object):
|
||||
def __init__(self,list):
|
||||
self.inlist = copy.copy(list)
|
||||
self.make = "g++"
|
||||
|
@ -1497,15 +1500,15 @@ class PYTHON:
|
|||
def build(self):
|
||||
libdir = dir.lib + "/python"
|
||||
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))
|
||||
if not os.path.isfile("%s/Makefile.lammps.%s" % (libdir,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
|
||||
|
||||
class QMMM:
|
||||
class QMMM(object):
|
||||
def __init__(self,list):
|
||||
self.inlist = copy.copy(list)
|
||||
self.make = "gfortran"
|
||||
|
@ -1538,25 +1541,25 @@ class QMMM:
|
|||
make.setvar("EXTRAMAKE","Makefile.lammps.%s" % self.lammps)
|
||||
make.write("%s/Makefile.auto" % 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)
|
||||
else: str = "cd %s; make -f Makefile.auto" % libdir
|
||||
subprocess.check_output("cd %s; make -f Makefile.auto clean" % libdir,stderr=subprocess.STDOUT,shell=True)
|
||||
if jmake: txt = "cd %s; make -j %d -f Makefile.auto" % (libdir,jmake.n)
|
||||
else: txt = "cd %s; make -f Makefile.auto" % libdir
|
||||
|
||||
# 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:
|
||||
try: subprocess.check_output(str,stderr=subprocess.STDOUT,shell=True)
|
||||
except Exception as e: print e.output
|
||||
try: subprocess.check_output(txt,stderr=subprocess.STDOUT,shell=True)
|
||||
except Exception as e: print(e.output)
|
||||
|
||||
if not os.path.isfile("%s/libqmmm.a" % libdir) or \
|
||||
not os.path.isfile("%s/Makefile.lammps" % libdir):
|
||||
error("Unsuccessful build of lib/qmmm library")
|
||||
else: print "Created lib/qmmm library"
|
||||
else: print("Created lib/qmmm library")
|
||||
|
||||
# REAX lib
|
||||
|
||||
class REAX:
|
||||
class REAX(object):
|
||||
def __init__(self,list):
|
||||
self.inlist = copy.copy(list)
|
||||
self.make = "gfortran"
|
||||
|
@ -1590,24 +1593,24 @@ class REAX:
|
|||
make.write("%s/Makefile.auto" % 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)
|
||||
else: str = "cd %s; make -f Makefile.auto" % libdir
|
||||
if jmake: txt = "cd %s; make -j %d -f Makefile.auto" % (libdir,jmake.n)
|
||||
else: txt = "cd %s; make -f Makefile.auto" % libdir
|
||||
|
||||
# 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:
|
||||
try: subprocess.check_output(str,stderr=subprocess.STDOUT,shell=True)
|
||||
except Exception as e: print e.output
|
||||
try: subprocess.check_output(txt,stderr=subprocess.STDOUT,shell=True)
|
||||
except Exception as e: print(e.output)
|
||||
|
||||
if not os.path.isfile("%s/libreax.a" % libdir) or \
|
||||
not os.path.isfile("%s/Makefile.lammps" % libdir):
|
||||
error("Unsuccessful build of lib/reax library")
|
||||
else: print "Created lib/reax library"
|
||||
else: print("Created lib/reax library")
|
||||
|
||||
# VORONOI lib
|
||||
|
||||
class VORONOI:
|
||||
class VORONOI(object):
|
||||
def __init__(self,list):
|
||||
self.inlist = copy.copy(list)
|
||||
self.install = ""
|
||||
|
@ -1635,9 +1638,9 @@ class VORONOI:
|
|||
if not self.install: return
|
||||
libdir = dir.lib + "/voronoi"
|
||||
cmd = "cd %s; python install.py %s" % (libdir,self.install)
|
||||
txt = commands.getoutput(cmd)
|
||||
if verbose: print txt
|
||||
print "Created lib/voronoi library"
|
||||
txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True).decode()
|
||||
if verbose: print(txt)
|
||||
print("Created lib/voronoi library")
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# build classes for intel, kokkos build options
|
||||
|
@ -1645,7 +1648,7 @@ class VORONOI:
|
|||
|
||||
# Intel class
|
||||
|
||||
class Intel:
|
||||
class Intel(object):
|
||||
def __init__(self,list):
|
||||
self.inlist = copy.copy(list)
|
||||
self.mode = "cpu"
|
||||
|
@ -1666,7 +1669,7 @@ class Intel:
|
|||
|
||||
# Kokkos class
|
||||
|
||||
class Kokkos:
|
||||
class Kokkos(object):
|
||||
def __init__(self,list):
|
||||
self.inlist = copy.copy(list)
|
||||
self.mode = ""
|
||||
|
@ -1688,7 +1691,7 @@ class Kokkos:
|
|||
"""
|
||||
|
||||
def check(self):
|
||||
print self.inlist
|
||||
print(self.inlist)
|
||||
if self.inlist != None and len(self.inlist) == 0:
|
||||
error("-kokkos args are invalid")
|
||||
|
||||
|
@ -1710,7 +1713,7 @@ class Kokkos:
|
|||
|
||||
# Cc class
|
||||
|
||||
class Cc:
|
||||
class Cc(object):
|
||||
def __init__(self,list):
|
||||
self.inlist = copy.copy(list)
|
||||
self.compiler = self.abbrev = ""
|
||||
|
@ -1762,7 +1765,7 @@ class Cc:
|
|||
|
||||
# Flags class
|
||||
|
||||
class Flags:
|
||||
class Flags(object):
|
||||
def __init__(self,list):
|
||||
self.inlist = copy.copy(list)
|
||||
self.flags = []
|
||||
|
@ -1803,7 +1806,7 @@ class Flags:
|
|||
|
||||
# Mpi class
|
||||
|
||||
class Mpi:
|
||||
class Mpi(object):
|
||||
def __init__(self,list):
|
||||
self.inlist = copy.copy(list)
|
||||
self.style = self.dir = ""
|
||||
|
@ -1837,7 +1840,7 @@ class Mpi:
|
|||
|
||||
# Fft class
|
||||
|
||||
class Fft:
|
||||
class Fft(object):
|
||||
def __init__(self,list):
|
||||
self.inlist = copy.copy(list)
|
||||
self.dir = self.incdir = self.libdir = ""
|
||||
|
@ -1877,7 +1880,7 @@ class Fft:
|
|||
|
||||
# Jpg class
|
||||
|
||||
class Jpg:
|
||||
class Jpg(object):
|
||||
def __init__(self,list):
|
||||
self.inlist = copy.copy(list)
|
||||
self.on = 1
|
||||
|
@ -1916,7 +1919,7 @@ class Jpg:
|
|||
|
||||
# Png class
|
||||
|
||||
class Png:
|
||||
class Png(object):
|
||||
def __init__(self,list):
|
||||
self.inlist = copy.copy(list)
|
||||
self.on = 1
|
||||
|
@ -1958,7 +1961,7 @@ class Png:
|
|||
|
||||
# read, tweak, and write a Makefile
|
||||
|
||||
class MakeReader:
|
||||
class MakeReader(object):
|
||||
|
||||
# read a makefile
|
||||
# flag = 0 if file is full path name
|
||||
|
@ -2127,14 +2130,14 @@ class MakeReader:
|
|||
if not line.isdigit():
|
||||
if flag and i == 0:
|
||||
line = "# auto = makefile auto-generated by Make.py"
|
||||
print >>fp,line
|
||||
print(line, file=fp)
|
||||
else:
|
||||
index = int(line)
|
||||
name = self.varinfo[index][0]
|
||||
txt = self.varinfo[index][1]
|
||||
if name not in self.var: continue
|
||||
values = self.var[name]
|
||||
print >>fp,"%s%s" % (txt,' '.join(values))
|
||||
print("%s%s" % (txt,' '.join(values)), file=fp)
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# main program
|
||||
|
@ -2203,7 +2206,7 @@ while 1:
|
|||
switches[switch] = cmd_switches[switch]
|
||||
|
||||
argstr = switch2str(switches,switch_order)
|
||||
print "Redo command: Make.py",argstr
|
||||
print("Redo command: Make.py",argstr)
|
||||
else:
|
||||
switches = cmd_switches
|
||||
switch_order = cmd_switch_order
|
||||
|
@ -2246,10 +2249,10 @@ while 1:
|
|||
|
||||
if help or (actions and "-h" in actions.inlist) or not switches:
|
||||
if not help: help = Help(None)
|
||||
print help.help()
|
||||
print(help.help())
|
||||
for switch in switch_order:
|
||||
if switch == "h": continue
|
||||
print classes[switch].help()[1:]
|
||||
print(classes[switch].help()[1:])
|
||||
sys.exit()
|
||||
|
||||
# create needed default classes if not specified with switch
|
||||
|
@ -2298,7 +2301,7 @@ while 1:
|
|||
|
||||
if actions:
|
||||
for action in actions.alist:
|
||||
print "Action %s ..." % action
|
||||
print("Action %s ..." % action)
|
||||
if action.startswith("lib-"): actions.lib(action[4:])
|
||||
elif action == "file": actions.file("file")
|
||||
elif action == "clean": actions.clean()
|
||||
|
@ -2310,8 +2313,8 @@ while 1:
|
|||
|
||||
if output and actions and "exe" in actions.alist:
|
||||
txt = "cp %s/lmp_auto %s/lmp_%s" % (dir.src,dir.cwd,output.machine)
|
||||
commands.getoutput(txt)
|
||||
print "Created lmp_%s in %s" % (output.machine,dir.cwd)
|
||||
subprocess.check_output(txt,stderr=subprocess.STDOUT,shell=True)
|
||||
print("Created lmp_%s in %s" % (output.machine,dir.cwd))
|
||||
|
||||
# create copy of Makefile.auto if requested, and file or exe action performed
|
||||
# ditto for library Makefile.auto and Makefile.lammps files
|
||||
|
@ -2320,25 +2323,25 @@ while 1:
|
|||
("file" in actions.alist or "exe" in actions.alist):
|
||||
txt = "cp %s/MAKE/MINE/Makefile.auto %s/MAKE/MINE/Makefile.%s" % \
|
||||
(dir.src,dir.src,zoutput.machine)
|
||||
commands.getoutput(txt)
|
||||
print "Created Makefile.%s in %s/MAKE/MINE" % (zoutput.machine,dir.src)
|
||||
subprocess.check_output(txt,stderr=subprocess.STDOUT,shell=True)
|
||||
print("Created Makefile.%s in %s/MAKE/MINE" % (zoutput.machine,dir.src))
|
||||
if gpubuildflag:
|
||||
txt = "cp %s/gpu/Makefile.auto %s/MAKE/MINE/Makefile_gpu.%s" % \
|
||||
(dir.lib,dir.src,zoutput.machine)
|
||||
commands.getoutput(txt)
|
||||
print "Created Makefile_gpu.%s in %s/MAKE/MINE" % \
|
||||
(zoutput.machine,dir.src)
|
||||
subprocess.check_output(txt,stderr=subprocess.STDOUT,shell=True)
|
||||
print("Created Makefile_gpu.%s in %s/MAKE/MINE" % \
|
||||
(zoutput.machine,dir.src))
|
||||
txt = "cp %s/gpu/Makefile.lammps %s/MAKE/MINE/Makefile_gpu_lammps.%s" % \
|
||||
(dir.lib,dir.src,zoutput.machine)
|
||||
commands.getoutput(txt)
|
||||
print "Created Makefile_gpu_lammps.%s in %s/MAKE/MINE" % \
|
||||
(zoutput.machine,dir.src)
|
||||
subprocess.check_output(txt,stderr=subprocess.STDOUT,shell=True)
|
||||
print("Created Makefile_gpu_lammps.%s in %s/MAKE/MINE" % \
|
||||
(zoutput.machine,dir.src))
|
||||
|
||||
# write current Make.py command to src/Make.py.last
|
||||
|
||||
fp = open("%s/Make.py.last" % dir.src,'w')
|
||||
print >>fp,"# last invoked Make.py command"
|
||||
print >>fp,switch2str(switches,switch_order)
|
||||
print("# last invoked Make.py command", file=fp)
|
||||
print(switch2str(switches,switch_order), file=fp)
|
||||
fp.close()
|
||||
|
||||
# if not redoflag, done
|
||||
|
|
|
@ -5,6 +5,12 @@
|
|||
# sh Make.sh Makefile.shlib
|
||||
# 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
|
||||
# must whack *.d files that depend on style_*.h file,
|
||||
# else Make will not recreate them
|
||||
|
|
|
@ -5,6 +5,10 @@ mode=$1
|
|||
|
||||
# arg1 = file, arg2 = file it depends on
|
||||
|
||||
# enforce using portable C locale
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
action () {
|
||||
if (test $mode = 0) then
|
||||
rm -f ../$1
|
||||
|
|
|
@ -5,6 +5,10 @@ mode=$1
|
|||
|
||||
# arg1 = file, arg2 = file it depends on
|
||||
|
||||
# enforce using portable C locale
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
action () {
|
||||
if (test $mode = 0) then
|
||||
rm -f ../$1
|
||||
|
|
|
@ -5,6 +5,10 @@ mode=$1
|
|||
|
||||
# arg1 = file, arg2 = file it depends on
|
||||
|
||||
# enforce using portable C locale
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
action () {
|
||||
if (test $mode = 0) then
|
||||
rm -f ../$1
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
# Package.sh = package management, called from Makefile
|
||||
# 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
|
||||
# else not installed
|
||||
|
||||
|
|
|
@ -5,6 +5,10 @@ mode=$1
|
|||
|
||||
# arg1 = file, arg2 = file it depends on
|
||||
|
||||
# enforce using portable C locale
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
action () {
|
||||
if (test $mode = 0) then
|
||||
rm -f ../$1
|
||||
|
|
|
@ -5,6 +5,10 @@ mode=$1
|
|||
|
||||
# arg1 = file, arg2 = file it depends on
|
||||
|
||||
# enforce using portable C locale
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
action () {
|
||||
if (test $mode = 0) then
|
||||
rm -f ../$1
|
||||
|
|
|
@ -5,6 +5,10 @@ mode=$1
|
|||
|
||||
# arg1 = file, arg2 = file it depends on
|
||||
|
||||
# enforce using portable C locale
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
action () {
|
||||
if (test $mode = 0) then
|
||||
rm -f ../$1
|
||||
|
|
|
@ -5,6 +5,10 @@ mode=$1
|
|||
|
||||
# arg1 = file, arg2 = file it depends on
|
||||
|
||||
# enforce using portable C locale
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
action () {
|
||||
if (test $mode = 0) then
|
||||
rm -f ../$1
|
||||
|
|
|
@ -5,6 +5,10 @@ mode=$1
|
|||
|
||||
# arg1 = file, arg2 = file it depends on
|
||||
|
||||
# enforce using portable C locale
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
action () {
|
||||
if (test $mode = 0) then
|
||||
rm -f ../$1
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
# Install/unInstall package files in LAMMPS
|
||||
# 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
|
||||
|
||||
# enforce using portable C locale
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
# arg1 = file, arg2 = file it depends on
|
||||
|
||||
action () {
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
|
||||
mode=$1
|
||||
|
||||
# enforce using portable C locale
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
# arg1 = file, arg2 = file it depends on
|
||||
|
||||
action () {
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
|
||||
mode=$1
|
||||
|
||||
# enforce using portable C locale
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
# arg1 = file, arg2 = file it depends on
|
||||
|
||||
action () {
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
|
||||
mode=$1
|
||||
|
||||
# enforce using portable C locale
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
# arg1 = file, arg2 = file it depends on
|
||||
|
||||
action () {
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
|
||||
mode=$1
|
||||
|
||||
# enforce using portable C locale
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
# arg1 = file, arg2 = file it depends on
|
||||
|
||||
action () {
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
|
||||
mode=$1
|
||||
|
||||
# enforce using portable C locale
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
# arg1 = file, arg2 = file it depends on
|
||||
|
||||
action () {
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
|
||||
mode=$1
|
||||
|
||||
# enforce using portable C locale
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
# arg1 = file, arg2 = file it depends on
|
||||
|
||||
action () {
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
|
||||
mode=$1
|
||||
|
||||
# enforce using portable C locale
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
# arg1 = file, arg2 = file it depends on
|
||||
|
||||
action () {
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
|
||||
mode=$1
|
||||
|
||||
# enforce using portable C locale
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
# arg1 = file, arg2 = file it depends on
|
||||
|
||||
action () {
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
|
||||
mode=$1
|
||||
|
||||
# enforce using portable C locale
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
# arg1 = file, arg2 = file it depends on
|
||||
|
||||
action () {
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
|
||||
mode=$1
|
||||
|
||||
# enforce using portable C locale
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
# arg1 = file, arg2 = file it depends on
|
||||
|
||||
action () {
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
|
||||
mode=$1
|
||||
|
||||
# enforce using portable C locale
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
# arg1 = file, arg2 = file it depends on
|
||||
|
||||
action () {
|
||||
|
|
Loading…
Reference in New Issue