new Section package and start doc pages and build scripts
This commit is contained in:
52
lib/linalg/Install.py
Normal file
52
lib/linalg/Install.py
Normal file
@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# install.py tool to do build of the linear algebra library
|
||||
# used to automate the steps described in the README file in this dir
|
||||
|
||||
import sys,commands,os
|
||||
|
||||
# help message
|
||||
|
||||
help = """
|
||||
Syntax: python Install.py -m machine
|
||||
-m = peform a clean followed by "make -f Makefile.machine"
|
||||
machine = suffix of a lib/Makefile.* file
|
||||
"""
|
||||
|
||||
# print error message or help
|
||||
|
||||
def error(str=None):
|
||||
if not str: print help
|
||||
else: print "ERROR",str
|
||||
sys.exit()
|
||||
|
||||
# parse args
|
||||
|
||||
args = sys.argv[1:]
|
||||
nargs = len(args)
|
||||
if nargs == 0: error()
|
||||
|
||||
machine = None
|
||||
|
||||
iarg = 0
|
||||
while iarg < nargs:
|
||||
if args[iarg] == "-m":
|
||||
if iarg+2 > nargs: error()
|
||||
machine = args[iarg+1]
|
||||
iarg += 2
|
||||
else: error()
|
||||
|
||||
# set lib from working dir
|
||||
|
||||
cwd = os.getcwd()
|
||||
lib = os.path.basename(cwd)
|
||||
|
||||
# make the library
|
||||
|
||||
print "Building lib%s.a ..." % lib
|
||||
cmd = "make -f Makefile.%s clean; make -f Makefile.%s" % (machine,machine)
|
||||
txt = commands.getoutput(cmd)
|
||||
print txt
|
||||
|
||||
if os.path.exists("lib%s.a" % lib): print "Build was successful"
|
||||
else: error("Build of lib/%s/lib%s.a was NOT successful" % (lib,lib))
|
||||
@ -3,11 +3,16 @@ USER-AWPMD packages, and possibly by other packages in the future.
|
||||
|
||||
Note that this is an *incomplete* subset of full BLAS/LAPACK.
|
||||
|
||||
You should only need to build and use the resulting library in this
|
||||
directory if you want to build LAMMPS with the USER-ATC and/or
|
||||
USER-AWPMD packages AND you do not have any other suitable BLAS and
|
||||
LAPACK libraries installed on your system. E.g. ATLAS, GOTO-BLAS,
|
||||
OpenBLAS, ACML, or MKL.
|
||||
You should only need to build and use the library in this directory if
|
||||
you want to build LAMMPS with the USER-ATC and/or USER-AWPMD packages
|
||||
AND you do not have any other suitable BLAS and LAPACK libraries
|
||||
installed on your system. E.g. ATLAS, GOTO-BLAS, OpenBLAS, ACML, or
|
||||
MKL.
|
||||
|
||||
You can type "make lib-linalg" from the src directory to see help on
|
||||
how to 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.
|
||||
|
||||
Build the library using one of the provided Makefile.* files or create
|
||||
your own, specific to your compiler and system. For example:
|
||||
@ -20,4 +25,5 @@ directory:
|
||||
liblinalg.a the library LAMMPS will link against
|
||||
|
||||
You can then include this library and its path in the Makefile.lammps
|
||||
file of any packages that need it, e.g. in lib/atc/Makefile.lammps.
|
||||
file of any packages that need it. As an example, see the
|
||||
lib/atc/Makefile.lammps.linalg file.
|
||||
|
||||
Reference in New Issue
Block a user