forked from lijiext/lammps
better Install.py script for KIM from Ryan Elliott
This commit is contained in:
parent
cc9b3864bf
commit
296e572e69
|
@ -49,6 +49,7 @@ Lists of both kinds of directories are given below.
|
|||
Lowercase directories :h4
|
||||
|
||||
accelerate: run with various acceleration options (OpenMP, GPU, Phi)
|
||||
airebo: polyethylene with AIREBO potential
|
||||
balance: dynamic load balancing, 2d system
|
||||
body: body particles, 2d system
|
||||
cmap: CMAP 5-body contributions to CHARMM force field
|
||||
|
|
|
@ -492,14 +492,38 @@ Minnesota).
|
|||
|
||||
[Install or un-install:]
|
||||
|
||||
Using this package requires the KIM library and its models
|
||||
(interatomic potentials) to be downloaded and installed on your
|
||||
system. The library can be downloaded and built in lib/kim or
|
||||
elsewhere on your system. Details of the download, build, and install
|
||||
process for KIM are given in the lib/kim/README file.
|
||||
Before building LAMMPS with this package, you must first download and
|
||||
build the KIM library and include the KIM models that you want to
|
||||
use. You can do this manually if you prefer; follow the instructions
|
||||
in lib/kim/README. You can also do it in one step from the lammps/src
|
||||
dir, using a command like these, which simply invoke the
|
||||
lib/kim/Install.py script with the specified args.
|
||||
|
||||
Once that process is complete, you can then install/un-install the
|
||||
package and build LAMMPS in the usual manner:
|
||||
make lib-kim # print help message
|
||||
make lib-kim args="-b . none" # install KIM API lib with only example models
|
||||
make lib-kim args="-b . Glue_Ercolessi_Adams_Al__MO_324507536345_001" # ditto plus one model
|
||||
make lib-kim args="-b . OpenKIM" # install KIM API lib with all models
|
||||
make lib-kim args="-a EAM_Dynamo_Ackland_W__MO_141627196590_002" # add one model or model driver :pre
|
||||
|
||||
Note that in LAMMPS lingo, a KIM model driver is a pair style
|
||||
(e.g. EAM or Tersoff). A KIM model is a pair style for a particular
|
||||
element or alloy and set of parameters, e.g. EAM for Cu with a
|
||||
specific EAM potential file. Also note that installing the KIM API
|
||||
library with all its models, may take around 30 min to build. Of
|
||||
course you only need to do that once.
|
||||
|
||||
See the list of KIM model drivers here:
|
||||
https://openkim.org/kim-items/model-drivers/alphabetical
|
||||
|
||||
See the list of all KIM models here:
|
||||
https://openkim.org/kim-items/models/by-model-drivers
|
||||
|
||||
See the list of example KIM models included by default here:
|
||||
https://openkim.org/kim-api
|
||||
in the "What is in the KIM API source package?" section
|
||||
|
||||
You can then install/un-install the package and build LAMMPS in the
|
||||
usual manner:
|
||||
|
||||
make yes-kim
|
||||
make machine :pre
|
||||
|
@ -1414,7 +1438,7 @@ lib/linalg. In the latter case you also need to build the library
|
|||
in lib/linalg with a command like these:
|
||||
|
||||
make lib-linalg # print help message
|
||||
make lib-atc args="-m gfortran" # build with GNU Fortran compiler
|
||||
make lib-linalg args="-m gfortran" # build with GNU Fortran compiler
|
||||
|
||||
You can then install/un-install the package and build LAMMPS in the
|
||||
usual manner:
|
||||
|
@ -2469,8 +2493,8 @@ step from the lammps/src dir, using a command like these, which simply
|
|||
invoke the lib/smd/Install.py script with the specified args:
|
||||
|
||||
make lib-smd # print help message
|
||||
make lib-smd args="-g -l" # download in default lib/smd/eigen-eigen-*
|
||||
make lib-smd args="-h . eigen -g -l" # download in lib/smd/eigen
|
||||
make lib-smd args="-g -l" # download and build in default lib/smd/eigen-eigen-*
|
||||
make lib-smd args="-h . eigen -g -l" # download and build in lib/smd/eigen
|
||||
make lib-smd args="-h ~ eigen -g -l" # download and build in ~/eigen :pre
|
||||
|
||||
Note that the final -l switch is to create a symbolic (soft) link
|
||||
|
|
|
@ -109,7 +109,8 @@ atoms in the specified group. This can be useful for models where a
|
|||
large portion of the simulation is particles that do not interact with
|
||||
other particles or with each other via pairwise interactions. The
|
||||
group specified with this option must also be specified via the
|
||||
"atom_modify first"_atom_modify.html command.
|
||||
"atom_modify first"_atom_modify.html command. Note that specifying
|
||||
"all" as the group-ID effectively turns off the {include} option.
|
||||
|
||||
The {exclude} option turns off pairwise interactions between certain
|
||||
pairs of atoms, by not including them in the neighbor list. These are
|
||||
|
@ -213,5 +214,5 @@ space.
|
|||
[Default:]
|
||||
|
||||
The option defaults are delay = 10, every = 1, check = yes, once = no,
|
||||
cluster = no, include = all, exclude = none, page = 100000, one =
|
||||
2000, and binsize = 0.0.
|
||||
cluster = no, include = all (same as no include option defined),
|
||||
exclude = none, page = 100000, one = 2000, and binsize = 0.0.
|
||||
|
|
|
@ -58,6 +58,7 @@ These are the sample problems and their output in the various
|
|||
sub-directories:
|
||||
|
||||
accelerate: use of all the various accelerator packages
|
||||
airebo: polyethylene with AIREBO potential
|
||||
balance: dynamic load balancing, 2d system
|
||||
body: body particles, 2d system
|
||||
cmap: CMAP 5-body contributions to CHARMM force field
|
||||
|
|
|
@ -9,12 +9,21 @@ import sys,commands,os
|
|||
# help message
|
||||
|
||||
help = """
|
||||
Syntax: python Install.py -m machine -e suffix
|
||||
specify -m and optionally -e, order does not matter
|
||||
Syntax from src dir: make lib-libname args="-m machine -e suffix"
|
||||
Syntax from lib dir: python Install.py -m machine -e suffix
|
||||
|
||||
libname = name of lib dir (e.g. atc, colvars, h5md, meam, poems, etc)
|
||||
specify -m and optionally -e, order does not matter
|
||||
|
||||
-m = peform a clean followed by "make -f Makefile.machine"
|
||||
machine = suffix of a lib/Makefile.* file
|
||||
-e = set EXTRAMAKE variable in Makefile.machine to Makefile.lammps.suffix
|
||||
does not alter existing Makefile.machine
|
||||
|
||||
Examplesx:
|
||||
|
||||
make lib-colvars args="-m g++" # build COLVARS lib with GNU g++ compiler
|
||||
make lib-meam args="-m ifort" # build MEAM lib with Intel ifort compiler
|
||||
"""
|
||||
|
||||
# print error message or help
|
||||
|
|
|
@ -9,12 +9,21 @@ import sys,commands,os
|
|||
# help message
|
||||
|
||||
help = """
|
||||
Syntax: python Install.py -m machine -e suffix
|
||||
specify -m and optionally -e, order does not matter
|
||||
Syntax from src dir: make lib-libname args="-m machine -e suffix"
|
||||
Syntax from lib dir: python Install.py -m machine -e suffix
|
||||
|
||||
libname = name of lib dir (e.g. atc, colvars, h5md, meam, poems, etc)
|
||||
specify -m and optionally -e, order does not matter
|
||||
|
||||
-m = peform a clean followed by "make -f Makefile.machine"
|
||||
machine = suffix of a lib/Makefile.* file
|
||||
-e = set EXTRAMAKE variable in Makefile.machine to Makefile.lammps.suffix
|
||||
does not alter existing Makefile.machine
|
||||
|
||||
Examplesx:
|
||||
|
||||
make lib-colvars args="-m g++" # build COLVARS lib with GNU g++ compiler
|
||||
make lib-meam args="-m ifort" # build MEAM lib with Intel ifort compiler
|
||||
"""
|
||||
|
||||
# print error message or help
|
||||
|
|
|
@ -9,12 +9,21 @@ import sys,commands,os
|
|||
# help message
|
||||
|
||||
help = """
|
||||
Syntax: python Install.py -m machine -e suffix
|
||||
specify -m and optionally -e, order does not matter
|
||||
Syntax from src dir: make lib-libname args="-m machine -e suffix"
|
||||
Syntax from lib dir: python Install.py -m machine -e suffix
|
||||
|
||||
libname = name of lib dir (e.g. atc, colvars, h5md, meam, poems, etc)
|
||||
specify -m and optionally -e, order does not matter
|
||||
|
||||
-m = peform a clean followed by "make -f Makefile.machine"
|
||||
machine = suffix of a lib/Makefile.* file
|
||||
-e = set EXTRAMAKE variable in Makefile.machine to Makefile.lammps.suffix
|
||||
does not alter existing Makefile.machine
|
||||
|
||||
Examplesx:
|
||||
|
||||
make lib-colvars args="-m g++" # build COLVARS lib with GNU g++ compiler
|
||||
make lib-meam args="-m ifort" # build MEAM lib with Intel ifort compiler
|
||||
"""
|
||||
|
||||
# print error message or help
|
||||
|
|
|
@ -9,12 +9,21 @@ import sys,commands,os
|
|||
# help message
|
||||
|
||||
help = """
|
||||
Syntax: python Install.py -m machine -e suffix
|
||||
specify -m and optionally -e, order does not matter
|
||||
Syntax from src dir: make lib-libname args="-m machine -e suffix"
|
||||
Syntax from lib dir: python Install.py -m machine -e suffix
|
||||
|
||||
libname = name of lib dir (e.g. atc, colvars, h5md, meam, poems, etc)
|
||||
specify -m and optionally -e, order does not matter
|
||||
|
||||
-m = peform a clean followed by "make -f Makefile.machine"
|
||||
machine = suffix of a lib/Makefile.* file
|
||||
-e = set EXTRAMAKE variable in Makefile.machine to Makefile.lammps.suffix
|
||||
does not alter existing Makefile.machine
|
||||
|
||||
Examplesx:
|
||||
|
||||
make lib-colvars args="-m g++" # build COLVARS lib with GNU g++ compiler
|
||||
make lib-meam args="-m ifort" # build MEAM lib with Intel ifort compiler
|
||||
"""
|
||||
|
||||
# print error message or help
|
||||
|
|
|
@ -8,14 +8,17 @@ import sys,os,re,commands
|
|||
# help message
|
||||
|
||||
help = """
|
||||
Syntax: python Install.py -i isuffix -h hdir -a arch -p precision -e esuffix -m -o osuffix
|
||||
specify one or more options, order does not matter
|
||||
copies an existing Makefile.isuffix in lib/gpu to Makefile.auto
|
||||
optionally edits these variables in Makefile.auto:
|
||||
CUDA_HOME, CUDA_ARCH, CUDA_PRECISION, EXTRAMAKE
|
||||
optionally uses Makefile.auto to build the GPU library -> libgpu.a
|
||||
and to copy a Makefile.lammps.esuffix -> Makefile.lammps
|
||||
optionally copies Makefile.auto to a new Makefile.osuffix
|
||||
Syntax from src dir: make lib-gpu args="-i isuffix -h hdir -a arch -p precision -e esuffix -m -o osuffix"
|
||||
Syntax from lib dir: python Install.py -i isuffix -h hdir -a arch -p precision -e esuffix -m -o osuffix
|
||||
|
||||
specify one or more options, order does not matter
|
||||
|
||||
copies an existing Makefile.isuffix in lib/gpu to Makefile.auto
|
||||
optionally edits these variables in Makefile.auto:
|
||||
CUDA_HOME, CUDA_ARCH, CUDA_PRECISION, EXTRAMAKE
|
||||
optionally uses Makefile.auto to build the GPU library -> libgpu.a
|
||||
and to copy a Makefile.lammps.esuffix -> Makefile.lammps
|
||||
optionally copies Makefile.auto to a new Makefile.osuffix
|
||||
|
||||
-i = use Makefile.isuffix as starting point, copy to Makefile.auto
|
||||
default isuffix = linux
|
||||
|
@ -34,6 +37,12 @@ Syntax: python Install.py -i isuffix -h hdir -a arch -p precision -e esuffix -m
|
|||
also copies EXTRAMAKE file -> Makefile.lammps
|
||||
-e can set which Makefile.lammps.esuffix file is copied
|
||||
-o = copy final Makefile.auto to Makefile.osuffix
|
||||
|
||||
Examples:
|
||||
|
||||
make lib-gpu args="-m" # build GPU lib with default Makefile.linux
|
||||
make lib-gpu args="-i xk7 -p single -o xk7.single" # create new Makefile.xk7.single, altered for single-precision
|
||||
make lib-gpu args="-i xk7 -p single -o xk7.single -m" # ditto, also build GPU lib
|
||||
"""
|
||||
|
||||
# print error message or help
|
||||
|
|
|
@ -9,12 +9,21 @@ import sys,commands,os
|
|||
# help message
|
||||
|
||||
help = """
|
||||
Syntax: python Install.py -m machine -e suffix
|
||||
specify -m and optionally -e, order does not matter
|
||||
Syntax from src dir: make lib-libname args="-m machine -e suffix"
|
||||
Syntax from lib dir: python Install.py -m machine -e suffix
|
||||
|
||||
libname = name of lib dir (e.g. atc, colvars, h5md, meam, poems, etc)
|
||||
specify -m and optionally -e, order does not matter
|
||||
|
||||
-m = peform a clean followed by "make -f Makefile.machine"
|
||||
machine = suffix of a lib/Makefile.* file
|
||||
-e = set EXTRAMAKE variable in Makefile.machine to Makefile.lammps.suffix
|
||||
does not alter existing Makefile.machine
|
||||
|
||||
Examplesx:
|
||||
|
||||
make lib-colvars args="-m g++" # build COLVARS lib with GNU g++ compiler
|
||||
make lib-meam args="-m ifort" # build MEAM lib with Intel ifort compiler
|
||||
"""
|
||||
|
||||
# print error message or help
|
||||
|
|
|
@ -1,25 +1,44 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
# install.py tool to setup the kim-api library
|
||||
# install.pa tool to setup the kim-api library
|
||||
# used to automate the steps described in the README file in this dir
|
||||
|
||||
import sys,os,re,urllib,commands
|
||||
|
||||
help = """
|
||||
Syntax: install.py -v version -c kim-dir -b kim-model-name -a kim-name
|
||||
specify one or more options, order does not matter
|
||||
-v = version of kim-api to download and work with
|
||||
default = kim-api-v1.8.2 (current as of June 2017)
|
||||
-c = create Makefile.KIM_DIR within lammps lib/kim to configure lammps
|
||||
for use with the kim-api library installed at "kim-dir" (absolute
|
||||
path). default = this dir
|
||||
-b = build kim-api and kim model where kim-model-name can be a specific
|
||||
openkim.org model name (such as
|
||||
"EAM_Dynamo_Ackland_W__MO_141627196590_002") or the keyword
|
||||
"OpenKIM" to install all compatible models from the openkim.org
|
||||
site.
|
||||
-a = add kim-name openkim.org item (model driver or model) to existing
|
||||
kim-api instalation.
|
||||
Syntax from src dir: make lib-kim args="-v version -b kim-install-dir kim-name -a kim-name"
|
||||
Syntax from lib dir: python Install.py -v version -b kim-install-dir kim-name -a kim-name
|
||||
|
||||
specify one or more options, order does not matter
|
||||
|
||||
-v = version of KIM API library to use
|
||||
default = kim-api-v1.8.2 (current as of June 2017)
|
||||
-b = download and build KIM API library with KIM models
|
||||
kim-dir = where to install/build the KIM API library
|
||||
use "." to install in lib/kim
|
||||
kim-name = none to install only the example KIM models
|
||||
kim-name = KIM model name (see example below) + examples
|
||||
kim-name = OpenKIM to install all models
|
||||
from the openkim.org site (this can take 30 minutes or more)
|
||||
-a = add single KIM model or model driver with kim-name
|
||||
to existing KIM API lib (see example below)
|
||||
|
||||
Examples:
|
||||
|
||||
make lib-kim args="-b . none" # install KIM API lib with only example models
|
||||
make lib-kim args="-b . Glue_Ercolessi_Adams_Al__MO_324507536345_001" # ditto plus one model
|
||||
make lib-kim args="-b . OpenKIM" # install KIM API lib with all models
|
||||
make lib-kim args="-a EAM_Dynamo_Ackland_W__MO_141627196590_002" # add one model or model driver
|
||||
|
||||
See the list of KIM model drivers here:
|
||||
https://openkim.org/kim-items/model-drivers/alphabetical
|
||||
|
||||
See the list of all KIM models here:
|
||||
https://openkim.org/kim-items/models/by-model-drivers
|
||||
|
||||
See the list of example KIM models included by default here:
|
||||
https://openkim.org/kim-api
|
||||
in the "What is in the KIM API source package?" section
|
||||
"""
|
||||
|
||||
def error():
|
||||
|
@ -28,32 +47,28 @@ def error():
|
|||
|
||||
# parse args
|
||||
|
||||
args = sys.argv
|
||||
args = sys.argv[1:]
|
||||
nargs = len(args)
|
||||
if nargs == 0: error()
|
||||
|
||||
thisdir = os.environ['PWD']
|
||||
dir = thisdir
|
||||
version = "kim-api-v1.8.2"
|
||||
|
||||
dirflag = 0
|
||||
buildflag = 0
|
||||
addflag = 0
|
||||
|
||||
iarg = 1
|
||||
iarg = 0
|
||||
while iarg < len(args):
|
||||
if args[iarg] == "-v":
|
||||
if iarg+2 > len(args): error()
|
||||
version = args[iarg+1]
|
||||
iarg += 2
|
||||
elif args[iarg] == "-c":
|
||||
dirflag = 1
|
||||
if iarg+2 > len(args): error()
|
||||
dir = args[iarg+1]
|
||||
iarg += 2
|
||||
elif args[iarg] == "-b":
|
||||
buildflag = 1
|
||||
if iarg+2 > len(args): error()
|
||||
modelname = args[iarg+1]
|
||||
iarg += 2
|
||||
if iarg+3 > len(args): error()
|
||||
dir = args[iarg+1]
|
||||
modelname = args[iarg+2]
|
||||
iarg += 3
|
||||
elif args[iarg] == "-a":
|
||||
addflag = 1
|
||||
if iarg+2 > len(args): error()
|
||||
|
@ -62,33 +77,59 @@ while iarg < len(args):
|
|||
else: error()
|
||||
|
||||
thisdir = os.path.abspath(thisdir)
|
||||
dir = os.path.abspath(dir)
|
||||
url = "https://s3.openkim.org/kim-api/%s.tgz" % version
|
||||
|
||||
# download and unpack tarball
|
||||
|
||||
|
||||
if not os.path.isfile("%s/Makefile.KIM_DIR" % thisdir):
|
||||
open("%s/Makefile.KIM_DIR" % thisdir, 'w').write("KIM_INSTALL_DIR=%s" % dir)
|
||||
open("%s/Makefile.KIM_Config" % thisdir, 'w').write("include %s/lib/kim-api/Makefile.KIM_Config" % dir)
|
||||
print "Created %s/Makefile.KIM_DIR : using %s" % (thisdir,dir)
|
||||
else:
|
||||
if dirflag == 1:
|
||||
open("%s/Makefile.KIM_DIR" % thisdir, 'w').write("KIM_INSTALL_DIR=%s" % dir)
|
||||
open("%s/Makefile.KIM_Config" % thisdir, 'w').write("include %s/lib/kim-api/Makefile.KIM_Config" % dir)
|
||||
print "Updated %s/Makefile.KIM_DIR : using %s" % (thisdir,dir)
|
||||
|
||||
# download KIM tarball, unpack, build KIM
|
||||
# either in lib/kim or user-requested location
|
||||
|
||||
if buildflag == 1:
|
||||
# download kim-api
|
||||
|
||||
# set install directory
|
||||
dir = os.path.abspath(dir) + "/installed-" + version
|
||||
|
||||
# check to see if an installed kim-api already exists
|
||||
|
||||
if os.path.isdir(dir):
|
||||
print "kim-api is already installed at %s" % dir
|
||||
print "Must remove this directory in order to resintall at this location"
|
||||
sys.exit()
|
||||
|
||||
# configure LAMMPS to use kim-api to be installed
|
||||
|
||||
mkfle = open("%s/Makefile.KIM_DIR" % thisdir, 'w')
|
||||
mkfle.write("KIM_INSTALL_DIR=%s\n" % dir)
|
||||
mkfle.write("\n")
|
||||
mkfle.write(".DUMMY: print_dir\n")
|
||||
mkfle.write("\n")
|
||||
mkfle.write("print_dir:\n")
|
||||
mkfle.write(" @printf $(KIM_INSTALL_DIR)\n")
|
||||
mkfle.close()
|
||||
open("%s/Makefile.KIM_Config" % thisdir, 'w'). \
|
||||
write("include %s/lib/kim-api/Makefile.KIM_Config" % dir)
|
||||
print "Created %s/Makefile.KIM_DIR : using %s" % (thisdir,dir)
|
||||
|
||||
# download entire kim-api tarball
|
||||
# try first via urllib
|
||||
# if fails (probably due to no SSL support), use wget
|
||||
|
||||
print "Downloading kim-api tarball ..."
|
||||
urllib.urlretrieve(url,"%s/%s.tgz" % (thisdir,version))
|
||||
|
||||
try: urllib.urlretrieve(url,"%s/%s.tgz" % (thisdir,version))
|
||||
except:
|
||||
cmd = "wget %s %s/%s.tgz" % (url,thisdir,version)
|
||||
txt = commands.getstatusoutput(cmd)
|
||||
print txt[1]
|
||||
if not os.path.isfile("%s/%s.tgz" % (thisdir,version)):
|
||||
print "Both urllib.urlretrieve() and wget command failed to download"
|
||||
sys.exit()
|
||||
|
||||
print "Unpacking kim-api tarball ..."
|
||||
cmd = "cd %s; rm -rf %s; tar zxvf %s.tgz" % (thisdir,version,version)
|
||||
txt = commands.getstatusoutput(cmd)
|
||||
if txt[0] != 0: error()
|
||||
|
||||
# configure kim-api
|
||||
|
||||
print "Configuring kim-api ..."
|
||||
cmd = "cd %s/%s; ./configure --prefix='%s'" % (thisdir,version,dir)
|
||||
txt = commands.getstatusoutput(cmd)
|
||||
|
@ -96,12 +137,19 @@ if buildflag == 1:
|
|||
if txt[0] != 0: error()
|
||||
|
||||
# build kim-api
|
||||
|
||||
print "Configuring model : %s" % modelname
|
||||
cmd = "cd %s/%s; make add-%s" % (thisdir,version,modelname)
|
||||
if modelname == "none":
|
||||
cmd = "cd %s/%s; make add-examples" % (thisdir,version)
|
||||
else:
|
||||
if modelname == "OpenKIM":
|
||||
print "configuring all OpenKIM models, this will take a while ..."
|
||||
cmd = "cd %s/%s; make add-examples; make add-%s" % \
|
||||
(thisdir,version,modelname)
|
||||
txt = commands.getstatusoutput(cmd)
|
||||
print txt[1]
|
||||
if txt[0] != 0: error()
|
||||
#
|
||||
|
||||
print "Building kim-api ..."
|
||||
cmd = "cd %s/%s; make" % (thisdir,version)
|
||||
txt = commands.getstatusoutput(cmd)
|
||||
|
@ -109,42 +157,101 @@ if buildflag == 1:
|
|||
if txt[0] != 0: error()
|
||||
|
||||
# install kim-api
|
||||
|
||||
print "Installing kim-api ..."
|
||||
cmd = "cd %s/%s; make install" % (thisdir,version)
|
||||
txt = commands.getstatusoutput(cmd)
|
||||
print txt[1]
|
||||
if txt[0] != 0: error()
|
||||
#
|
||||
|
||||
cmd = "cd %s/%s; make install-set-default-to-v1" %(thisdir,version)
|
||||
txt = commands.getstatusoutput(cmd)
|
||||
print txt[1]
|
||||
if txt[0] != 0: error()
|
||||
|
||||
# remove source files
|
||||
|
||||
print "Removing kim-api source and build files ..."
|
||||
cmd = "cd %s; rm -rf %s; rm -rf %s.tgz" % (thisdir,version,version)
|
||||
txt = commands.getstatusoutput(cmd)
|
||||
print txt[1]
|
||||
if txt[0] != 0: error()
|
||||
|
||||
# add a single model (and possibly its driver) to existing KIM installation
|
||||
|
||||
if addflag == 1:
|
||||
# download model
|
||||
url = "https://openkim.org/download/%s.tgz" % addmodelname
|
||||
|
||||
# get location of installed kim-api
|
||||
|
||||
if not os.path.isfile("%s/Makefile.KIM_DIR" % thisdir):
|
||||
print "kim-api is not installed"
|
||||
error()
|
||||
else:
|
||||
cmd = "cd %s; make -f Makefile.KIM_DIR print_dir" % thisdir
|
||||
dir = commands.getstatusoutput(cmd)[1]
|
||||
|
||||
# download single model
|
||||
# try first via urllib
|
||||
# if fails (probably due to no SSL support), use wget
|
||||
|
||||
print "Downloading item tarball ..."
|
||||
urllib.urlretrieve(url,"%s/%s.tgz" % (thisdir,addmodelname))
|
||||
|
||||
url = "https://openkim.org/download/%s.tgz" % addmodelname
|
||||
|
||||
try: urllib.urlretrieve(url,"%s/%s.tgz" % (thisdir,addmodelname))
|
||||
except:
|
||||
cmd = "wget %s %s/%s.tgz" % (url,thisdir,addmodelname)
|
||||
txt = commands.getstatusoutput(cmd)
|
||||
print txt[1]
|
||||
if not os.path.isfile("%s/%s.tgz" % (thisdir,addmodelname)):
|
||||
print "Both urllib.urlretrieve() and wget command failed to download"
|
||||
sys.exit()
|
||||
|
||||
print "Unpacking item tarball ..."
|
||||
cmd = "cd %s; tar zxvf %s.tgz" % (thisdir,addmodelname)
|
||||
txt = commands.getstatusoutput(cmd)
|
||||
if txt[0] != 0: error()
|
||||
#
|
||||
|
||||
print "Building item ..."
|
||||
cmd = "cd %s/%s; make; make install" %(thisdir,addmodelname)
|
||||
txt = commands.getstatusoutput(cmd)
|
||||
print txt[1]
|
||||
if txt[0] != 0: error()
|
||||
#
|
||||
print "Removing kim item source and build files ..."
|
||||
cmd = "cd %s; rm -rf %s; rm -rf %s.tgz" %(thisdir,addmodelname,addmodelname)
|
||||
txt = commands.getstatusoutput(cmd)
|
||||
print txt[1]
|
||||
if txt[0] != 0: error()
|
||||
firstRunOutput = txt[1]
|
||||
if txt[0] != 0:
|
||||
# Error: but first, check to see if it needs a driver
|
||||
|
||||
cmd = "cd %s/%s; make kim-item-type" % (thisdir,addmodelname)
|
||||
txt = commands.getstatusoutput(cmd)
|
||||
if txt[1] == "ParameterizedModel":
|
||||
|
||||
# Get and install driver
|
||||
|
||||
cmd = "cd %s/%s; make model-driver-name" % (thisdir,addmodelname)
|
||||
txt = commands.getstatusoutput(cmd)
|
||||
adddrivername = txt[1]
|
||||
print "First Installing model driver: %s" % adddrivername
|
||||
cmd = "cd %s; python Install.py -a %s" % (thisdir,adddrivername)
|
||||
txt = commands.getstatusoutput(cmd)
|
||||
if txt[0] != 0:
|
||||
print firstRunOutput
|
||||
print txt[1]
|
||||
error()
|
||||
else:
|
||||
print txt[1]
|
||||
cmd = "cd %s; python Install.py -a %s" % (thisdir,addmodelname)
|
||||
txt = commands.getstatusoutput(cmd)
|
||||
print txt[1]
|
||||
if txt[0] != 0:
|
||||
error()
|
||||
else:
|
||||
print firstRunOutput
|
||||
error()
|
||||
else:
|
||||
|
||||
# success
|
||||
|
||||
print firstRunOutput
|
||||
print "Removing kim item source and build files ..."
|
||||
cmd = "cd %s; rm -rf %s; rm -rf %s.tgz" %(thisdir,addmodelname,addmodelname)
|
||||
txt = commands.getstatusoutput(cmd)
|
||||
print txt[1]
|
||||
if txt[0] != 0: error()
|
||||
|
|
|
@ -8,14 +8,16 @@ James Sethna (Cornell U). Ryan Elliott is the main developer for the
|
|||
KIM API and he also maintains the code that implements the pair_style
|
||||
kim command.
|
||||
|
||||
To download, build, and install the KIM API on your system, follow
|
||||
these steps. You can use the install.py script to automate these steps.
|
||||
You can type "make lib-kim" from the src directory to see help on
|
||||
how to download and build this library via make commands, or you can
|
||||
do the same thing by typing "python Install.py" from within this
|
||||
directory, or you can do it manually by following the instructions
|
||||
below.
|
||||
|
||||
-----------------
|
||||
|
||||
Instructions:
|
||||
|
||||
|
||||
1. Configure lammps for use with the kim-api library installed in this directory
|
||||
|
||||
$ printf "KIM_INSTALL_DIR=${PWD}\n" > ./Makefile.KIM_DIR
|
||||
|
@ -65,7 +67,7 @@ $ rm -rf EAM_Johnson_NearestNeighbor_Cu__MO_887933271505_001.tgz
|
|||
When these steps are complete you can build LAMMPS with the KIM
|
||||
package installed:
|
||||
|
||||
$ cd ../../src
|
||||
$ cd lammpos/src
|
||||
$ make yes-kim
|
||||
$ make g++ (or whatever target you wish)
|
||||
|
||||
|
|
|
@ -8,9 +8,15 @@ import sys,commands,os
|
|||
# help message
|
||||
|
||||
help = """
|
||||
Syntax: python Install.py -m machine
|
||||
Syntax from src dir: make lib-linalg args="-m machine"
|
||||
Syntax from lib dir: python Install.py -m machine
|
||||
|
||||
-m = peform a clean followed by "make -f Makefile.machine"
|
||||
machine = suffix of a lib/Makefile.* file
|
||||
|
||||
Example:
|
||||
|
||||
make lib-linalg args="-m gfortran" # build with GNU Fortran compiler
|
||||
"""
|
||||
|
||||
# print error message or help
|
||||
|
|
|
@ -9,12 +9,21 @@ import sys,commands,os
|
|||
# help message
|
||||
|
||||
help = """
|
||||
Syntax: python Install.py -m machine -e suffix
|
||||
specify -m and optionally -e, order does not matter
|
||||
Syntax from src dir: make lib-libname args="-m machine -e suffix"
|
||||
Syntax from lib dir: python Install.py -m machine -e suffix
|
||||
|
||||
libname = name of lib dir (e.g. atc, colvars, h5md, meam, poems, etc)
|
||||
specify -m and optionally -e, order does not matter
|
||||
|
||||
-m = peform a clean followed by "make -f Makefile.machine"
|
||||
machine = suffix of a lib/Makefile.* file
|
||||
-e = set EXTRAMAKE variable in Makefile.machine to Makefile.lammps.suffix
|
||||
does not alter existing Makefile.machine
|
||||
|
||||
Examplesx:
|
||||
|
||||
make lib-colvars args="-m g++" # build COLVARS lib with GNU g++ compiler
|
||||
make lib-meam args="-m ifort" # build MEAM lib with Intel ifort compiler
|
||||
"""
|
||||
|
||||
# print error message or help
|
||||
|
|
|
@ -8,8 +8,11 @@ import sys,os,re,commands
|
|||
# help message
|
||||
|
||||
help = """
|
||||
Syntax: python Install.py -h hpath hdir -g -b [suffix] -l
|
||||
specify one or more options, order does not matter
|
||||
Syntax from src dir: make lib-mscg args="-h hpath hdir -g -b [suffix] -l"
|
||||
Syntax from lib dir: python Install.py -h hpath hdir -g -b [suffix] -l
|
||||
|
||||
specify one or more options, order does not matter
|
||||
|
||||
-h = set home dir of MS-CG to be hpath/hdir
|
||||
hpath can be full path, contain '~' or '.' chars
|
||||
default hpath = . = lib/mscg
|
||||
|
@ -22,6 +25,10 @@ Syntax: python Install.py -h hpath hdir -g -b [suffix] -l
|
|||
optional suffix specifies which src/Make/Makefile.suffix to use
|
||||
default suffix = g++_simple
|
||||
-l = create 2 softlinks (includelink,liblink) in lib/mscg to MS-CG src dir
|
||||
|
||||
Example:
|
||||
|
||||
make lib-mscg args="-g -b -l" # download/build in lib/mscg/MSCG-release-master
|
||||
"""
|
||||
|
||||
# settings
|
||||
|
|
|
@ -9,12 +9,21 @@ import sys,commands,os
|
|||
# help message
|
||||
|
||||
help = """
|
||||
Syntax: python Install.py -m machine -e suffix
|
||||
specify -m and optionally -e, order does not matter
|
||||
Syntax from src dir: make lib-libname args="-m machine -e suffix"
|
||||
Syntax from lib dir: python Install.py -m machine -e suffix
|
||||
|
||||
libname = name of lib dir (e.g. atc, colvars, h5md, meam, poems, etc)
|
||||
specify -m and optionally -e, order does not matter
|
||||
|
||||
-m = peform a clean followed by "make -f Makefile.machine"
|
||||
machine = suffix of a lib/Makefile.* file
|
||||
-e = set EXTRAMAKE variable in Makefile.machine to Makefile.lammps.suffix
|
||||
does not alter existing Makefile.machine
|
||||
|
||||
Examplesx:
|
||||
|
||||
make lib-colvars args="-m g++" # build COLVARS lib with GNU g++ compiler
|
||||
make lib-meam args="-m ifort" # build MEAM lib with Intel ifort compiler
|
||||
"""
|
||||
|
||||
# print error message or help
|
||||
|
|
|
@ -9,12 +9,21 @@ import sys,commands,os
|
|||
# help message
|
||||
|
||||
help = """
|
||||
Syntax: python Install.py -m machine -e suffix
|
||||
specify -m and optionally -e, order does not matter
|
||||
Syntax from src dir: make lib-libname args="-m machine -e suffix"
|
||||
Syntax from lib dir: python Install.py -m machine -e suffix
|
||||
|
||||
libname = name of lib dir (e.g. atc, colvars, h5md, meam, poems, etc)
|
||||
specify -m and optionally -e, order does not matter
|
||||
|
||||
-m = peform a clean followed by "make -f Makefile.machine"
|
||||
machine = suffix of a lib/Makefile.* file
|
||||
-e = set EXTRAMAKE variable in Makefile.machine to Makefile.lammps.suffix
|
||||
does not alter existing Makefile.machine
|
||||
|
||||
Examplesx:
|
||||
|
||||
make lib-colvars args="-m g++" # build COLVARS lib with GNU g++ compiler
|
||||
make lib-meam args="-m ifort" # build MEAM lib with Intel ifort compiler
|
||||
"""
|
||||
|
||||
# print error message or help
|
||||
|
|
|
@ -9,12 +9,21 @@ import sys,commands,os
|
|||
# help message
|
||||
|
||||
help = """
|
||||
Syntax: python Install.py -m machine -e suffix
|
||||
specify -m and optionally -e, order does not matter
|
||||
Syntax from src dir: make lib-libname args="-m machine -e suffix"
|
||||
Syntax from lib dir: python Install.py -m machine -e suffix
|
||||
|
||||
libname = name of lib dir (e.g. atc, colvars, h5md, meam, poems, etc)
|
||||
specify -m and optionally -e, order does not matter
|
||||
|
||||
-m = peform a clean followed by "make -f Makefile.machine"
|
||||
machine = suffix of a lib/Makefile.* file
|
||||
-e = set EXTRAMAKE variable in Makefile.machine to Makefile.lammps.suffix
|
||||
does not alter existing Makefile.machine
|
||||
|
||||
Examplesx:
|
||||
|
||||
make lib-colvars args="-m g++" # build COLVARS lib with GNU g++ compiler
|
||||
make lib-meam args="-m ifort" # build MEAM lib with Intel ifort compiler
|
||||
"""
|
||||
|
||||
# print error message or help
|
||||
|
|
|
@ -8,8 +8,11 @@ import sys,os,re,glob,commands
|
|||
# help message
|
||||
|
||||
help = """
|
||||
Syntax: python Install.py -h hpath hdir -g -l
|
||||
specify one or more options, order does not matter
|
||||
Syntax from src dir: make lib-smd args="-h hpath hdir -g -l"
|
||||
Syntax from lib dir: python Install.py -h hpath hdir -g -l
|
||||
|
||||
specify one or more options, order does not matter
|
||||
|
||||
-h = set home dir of Eigen to be hpath/hdir
|
||||
hpath can be full path, contain '~' or '.' chars
|
||||
default hpath = . = lib/smd
|
||||
|
@ -19,6 +22,10 @@ Syntax: python Install.py -h hpath hdir -g -l
|
|||
hpath must already exist
|
||||
if hdir already exists, it will be deleted before unpack
|
||||
-l = create softlink (includelink) in lib/smd to Eigen src dir
|
||||
|
||||
Example:
|
||||
|
||||
make lib-smd args="-g -l" # download/build in default lib/smd/eigen-eigen-*
|
||||
"""
|
||||
|
||||
# settings
|
||||
|
|
|
@ -8,8 +8,11 @@ import sys,os,re,urllib,commands
|
|||
# help message
|
||||
|
||||
help = """
|
||||
Syntax: python Install.py -v version -h hpath hdir -g -b -l
|
||||
specify one or more options, order does not matter
|
||||
Syntax from src dir: make lib-voronoi args="-v version -h hpath hdir -g -b -l"
|
||||
Syntax from lib dir: python Install.py -v version -h hpath hdir -g -b -l
|
||||
|
||||
specify one or more options, order does not matter
|
||||
|
||||
-v = version of Voro++ to download and build
|
||||
default version = voro++-0.4.6 (current as of Jan 2015)
|
||||
-h = set home dir of Voro++ to be hpath/hdir
|
||||
|
@ -22,6 +25,10 @@ Syntax: python Install.py -v version -h hpath hdir -g -b -l
|
|||
if hdir already exists, it will be deleted before unpack
|
||||
-b = build Voro++ library in its src dir
|
||||
-l = create 2 softlinks (includelink,liblink) in lib/voronoi to Voro++ src dir
|
||||
|
||||
Example:
|
||||
|
||||
make lib-voronoi args="-g -b -l" # download/build in lib/voronoi/voro++-0.4.6
|
||||
"""
|
||||
|
||||
# settings
|
||||
|
|
|
@ -116,7 +116,8 @@ help:
|
|||
@echo 'make package-overwrite replace package files with src files'
|
||||
@echo 'make package-diff (pd) diff src files against package files'
|
||||
@echo ''
|
||||
@echo 'make lib-package download/build/install a package library'
|
||||
@echo 'make lib-package help for download/build/install a package library'
|
||||
@echo 'make lib-package args="..." download/build/install a package library'
|
||||
@echo 'make purge purge obsolete copies of source files'
|
||||
@echo ''
|
||||
@echo 'make machine build LAMMPS for machine'
|
||||
|
|
Loading…
Reference in New Issue