git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@12900 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2015-01-08 22:46:24 +00:00
parent 7dd802cb67
commit a31233cd10
4 changed files with 196 additions and 3 deletions

View File

@ -1,11 +1,11 @@
This directory contains libraries that can be linked with when
building LAMMPS, if particular packages are included in a LAMMPS
build. The library itself must be built first, so that a lib*.a file
build. The library itself must be built first, so that a library file
exists for LAMMPS to link against.
Each library directory contains a README with additional info about
how to build the library. This may require you to edit one of the
provided Makefiles to make it suitable for your machine.
how to acquire and/or build the library. This may require you to edit
one of the provided Makefiles to make it suitable for your machine.
The libraries included in the LAMMPS distribution are the following:
@ -19,6 +19,8 @@ cuda NVIDIA GPU routines, USER-CUDA package
from Christian Trott (U Tech Ilmenau)
gpu general GPU routines, GPU package
from Mike Brown (ORNL)
kim hooks to KIM library, used by KIM package
from Ryan Elliott and Ellad Tadmor (U Minn)
kokkos Kokkos package for GPU and many-core acceleration
from Kokkos development team (Sandia)
linalg set of BLAS and LAPACK routines needed by USER-ATC package
@ -31,3 +33,5 @@ qmmm quantum mechanics/molecular mechanics coupling interface
from Axel Kohlmeyer (Temple U)
reax ReaxFF potential, REAX package
from Adri van Duin (Penn State) and Aidan Thompson (Sandia)
voronoi hooks to Voro++ library, used by compute voronoi/atom command
from Daniel Schwen (LANL)

View File

@ -0,0 +1,5 @@
# Settings that the LAMMPS build will import when this package is installed
voronoi_SYSINC =
voronoi_SYSLIB =
voronoi_SYSPATH =

57
lib/voronoi/README Normal file
View File

@ -0,0 +1,57 @@
This directory contains links to the Voro++ library which is required
to use the VORONOI package and its compute voronoi/atom command in a
LAMMPS input script.
The Voro++ library is available at http://math.lbl.gov/voro++ and was
developed by Chris H. Rycroft while at UC Berkeley / Lawrence Berkeley
Laboratory.
You must perform the following steps yourself, or you can use the
install.py Python script to automate any or all steps of the process.
Type "python install.py" for instructions.
1. Download Voro++ at http://math.lbl.gov/voro++/download
either as a tarball or via SVN, and unpack the
tarball either in this /lib/voronoi directory
or somewhere else on your system.
2. compile Voro++ from within its home directory
% make
3. There is no need to install Voro++ if you only wish
to use it from LAMMPS. You can install it if you
wish to use it stand-alone or from other codes:
a) install under the default /usr/local
% sudo make install
b) install under a user-writeable location by first
changing the PREFIX variable in the config.mk file, then
% make install
4. Create two soft links in this dir (lib/voronoi)
to where the Voro++ src directory is. E.g if you
built Voro++ it in this dir:
% ln -s voro++-0.4.6/src includelink
% ln -s voro++-0.4.6/src liblink
Note that these links could also be set to the include and lib
directories created by a Voro++ install, if you prefer, e.g.
% ln -s /usr/local/include includelink
% ln -s /usr/local/lib liblink
When these steps are complete you can build LAMMPS
with the VORONOI package installed:
% cd lammps/src
% make yes-voronoi
% make g++ (or whatever target you wish)
Note that if you download and unpack a new LAMMPS tarball,
the "includelink" and "liblink" files will be lost
and you will need to re-create them (step 4). If you
built Voro++ in this directory (as opposed to somewhere
else on your system) and did not install it somewhere
else, you will also need to repeat steps 1,2,3.
The Makefile.lammps file in this directory is there for compatibility
with the way other libraries under the lib dir are linked with by
LAMMPS. However, Voro++ requires no auxiliary files or
settings, so its variables are blank.

127
lib/voronoi/install.py Normal file
View File

@ -0,0 +1,127 @@
#!usr/local/python
# install.py tool to download, unpack, build, and link to the Voro++ library
# used to automate the steps described in the README file in this dir
import sys,os,urllib,commands
help = """
Syntax: install.py -d dir -v version -g -b -i installdir -l incdir libdir
specify one or more options, order does not matter
-d = dir to download tarball to, unpack tarball in, perform build in
dir will be created if it doesn't exist (only last level)
default = this dir
-v = version of Voro++ to download and work with
default = voro++-0.4.6 (current as of Jan 2015)
-g = download (grab) tarball from
http://math.lbl.gov/voro++/download/dir/version
-b = build Voro++ by invoking "make" in its home dir
no default
-i = install Voro++ by invoking "make install" in its home dir
installdir arg is optional:
if not specified, installs at PREFIX defined in config.mk file
if specified, will overwrite PREFIX and install there
if PREFIX starts with /usr, will invoke "sudo make install"
-l = create two links to incdir and libdir
incdir and libdir are optional (specify neither or both):
if specified, includelink and liblink are to those two dirs
if not specified and no install, links are to Voro++ src dir
if not specified and install performed,
links are to include and lib dirs under PREFIX
"""
def error():
print help
sys.exit()
# parse args
args = sys.argv
if len(args) == 1: error()
dir = "."
version = "voro++-0.4.6"
grabflag = 0
buildflag = 0
installflag = 0
linkflag = 0
iarg = 1
while iarg < len(args):
if args[iarg] == "-d":
if iarg+2 > len(args): error()
dir = args[iarg+1]
iarg += 2
elif args[iarg] == "-v":
if iarg+2 > len(args): error()
version = args[iarg+1]
iarg += 2
elif args[iarg] == "-g":
grabflag = 1
iarg += 1
elif args[iarg] == "-b":
buildflag = 1
iarg += 1
elif args[iarg] == "-i":
if iarg+2 > len(args): error()
if iarg+1 == len(args) or args[iarg+1][0] == '-':
installdir = ""
iarg += 1
else:
installdir = args[iarg+1]
iarg += 2
elif args[iarg] == "-l":
if iarg+2 > len(args): error()
if iarg+1 == len(args) or args[iarg+1][0] == '-':
incdir = libdir = ""
iarg += 1
else:
incdir = args[iarg+1]
libdir = args[iarg+2]
iarg += 3
else: error()
url = "http://math.lbl.gov/voro++/download/dir/%s.tar.gz" % version
# create dir if does not exist
if not os.path.isdir(dir):
if os.path.isfile(dir):
print "ERROR: Dir already exists as file"
sys.exit()
os.mkdir(dir)
if not os.path.isdir(dir):
print "ERROR: Unable to create dir"
sys.exit()
# download and unpack tarball
if grabflag:
print "Downloading Voro++ tarball ..."
urllib.urlretrieve(url,"%s/%s.tar.gz" % (dir,version))
print "Unpacking Voro++ tarball ..."
cmd = "cd %s; tar zxvf %s.tar.gz" % (dir,version)
txt = commands.getoutput(cmd)
# build Voro++
if buildflag:
print "Building Voro++ ..."
cmd = "cd %s/%s; make" % (dir,version)
txt = commands.getoutput(cmd)
print txt
# install Voro++
# create links in this dir to Voro++ include and lib files
if linkflag:
print "Creating links to Voro++ include and lib files"
cmd = "ln -s %s/src includelink" % version
txt = commands.getoutput(cmd)
cmd = "ln -s %s/src liblink" % version
txt = commands.getoutput(cmd)