def get_lammps_machine_flags(machine): """Parse Makefile.machine from LAMMPS, return dictionary of compiler flags""" if not os.path.exists("../../src/MAKE/MACHINES/Makefile.%s" % machine): error("Cannot locate src/MAKE/MACHINES/Makefile.%s" % machine) lines = open("../../src/MAKE/MACHINES/Makefile.%s" % machine, 'r').readlines() machine_flags = {} for line in lines: line = line.partition('#')[0] line = line.rstrip() words = line.split() if (len(words) > 2): if ((words[0] == 'CC') or (words[0] == 'CCFLAGS') or (words[0] == 'SHFLAGS') or (words[0] == 'ARCHIVE') or (words[0] == 'ARFLAGS') or (words[0] == 'SHELL')): machine_flags[words[0]] = ' '.join(words[2:]) return machine_flags
def get_lammps_machine_flags(machine): """Parse Makefile.machine from LAMMPS, return dictionary of compiler flags""" if not os.path.exists("../../src/MAKE/MACHINES/Makefile.%s" % machine): error("Cannot locate src/MAKE/MACHINES/Makefile.%s" % machine) lines = open("../../src/MAKE/MACHINES/Makefile.%s" % machine, 'r').readlines() machine_flags = {} for line in lines: line = line.partition('#')[0] line = line.rstrip() words = line.split() if (len(words) > 2): if ((words[0] == 'CC') or (words[0] == 'CCFLAGS') or (words[0] == 'SHFLAGS') or (words[0] == 'ARCHIVE') or (words[0] == 'ARFLAGS') or (words[0] == 'SHELL')): machine_flags[words[0]] = ' '.join(words[2:]) return machine_flags
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="-b" # build GPU lib with default Makefile.linux make lib-gpu args="-m xk7 -p single -o xk7.single" # create new Makefile.xk7.single, altered for single-precision make lib-gpu args="-m mpi -a sm_35 -p single -o mpi.mixed -b" # create new Makefile.mpi.mixed, also build GPU lib with these settings """ # parse args args = sys.argv[1:] nargs = len(args) if nargs == 0: error(help=help) isuffix = "linux" hflag = aflag = pflag = eflag = 0 makeflag = 0 outflag = 0 iarg = 0 while iarg < nargs: if args[iarg] == "-m": if iarg + 2 > nargs: error(help=help) isuffix = args[iarg + 1] iarg += 2 elif args[iarg] == "-h": if iarg + 2 > nargs: error(help=help) hflag = 1
Example: make lib-voronoi args="-b" # download/build in lib/voronoi/voro++-0.4.6 make lib-voronoi args="-p $HOME/voro++-0.4.6" # use existing Voro++ installation in $HOME/voro++-0.4.6 """ # settings version = "voro++-0.4.6" url = "http://math.lbl.gov/voro++/download/dir/%s.tar.gz" % version # parse args args = sys.argv[1:] nargs = len(args) if nargs == 0: error(help=help) homepath = "." homedir = version buildflag = False pathflag = False linkflag = True iarg = 0 while iarg < nargs: if args[iarg] == "-v": if iarg + 2 > nargs: error(help=help) version = args[iarg + 1] iarg += 2 elif args[iarg] == "-p":
-m = delete all existing objects, followed by "make -f Makefile.machine" machine = suffix of a lib/colvars/Makefile.* or of a src/MAKE/MACHINES/Makefile.* file -e = set EXTRAMAKE variable in Makefile.machine to Makefile.lammps.suffix does not alter existing Makefile.machine Examples: make lib-colvars args="-m mpi" # build COLVARS lib with default mpi compiler wrapper """ # parse args args = sys.argv[1:] nargs = len(args) if nargs == 0: error(help=help) machine = None extraflag = False iarg = 0 while iarg < nargs: if args[iarg] == "-m": if iarg+2 > len(args): error(help=help) machine = args[iarg+1] iarg += 2 elif args[iarg] == "-e": if iarg+2 > len(args): error(help=help) extraflag = True suffix = args[iarg+1] iarg += 2
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="-b" # build GPU lib with default Makefile.linux make lib-gpu args="-m xk7 -p single -o xk7.single" # create new Makefile.xk7.single, altered for single-precision make lib-gpu args="-m mpi -a sm_35 -p single -o mpi.mixed -b" # create new Makefile.mpi.mixed, also build GPU lib with these settings """ # parse args args = sys.argv[1:] nargs = len(args) if nargs == 0: error(help=help) isuffix = "linux" hflag = aflag = pflag = eflag = 0 makeflag = 0 outflag = 0 iarg = 0 while iarg < nargs: if args[iarg] == "-m": if iarg+2 > nargs: error(help=help) isuffix = args[iarg+1] iarg += 2 elif args[iarg] == "-h": if iarg+2 > nargs: error(help=help) hflag = 1
make lib-mscg args="-b -m mpi " # download/build in lib/mscg/MSCG-release-master with settings compatible with "make mpi" make lib-mscg args="-p /usr/local/mscg-release " # use existing MS-CG installation in /usr/local/mscg-release """ # settings mscgver = "1.7.3.1" url = "https://github.com/uchicago-voth/MSCG-release/archive/%s.tar.gz" % mscgver tarfile = "MS-CG-%s.tar.gz" % mscgver tardir = "MSCG-release-%s" % mscgver # parse args args = sys.argv[1:] nargs = len(args) if nargs == 0: error(help=help) homepath = "." homedir = tardir buildflag = False pathflag = False linkflag = True msuffix = "g++_simple" iarg = 0 while iarg < nargs: if args[iarg] == "-p": if iarg+2 > nargs: error(help=help) mscgpath = fullpath(args[iarg+1]) pathflag = True
# settings version = '1.2.1' # known checksums for different LATTE versions. used to validate the download. checksums = { \ '1.1.0' : '533635721ee222d0ed2925a18fb5b294', \ '1.2.0' : '68bf0db879da5e068a71281020239ae7', \ '1.2.1' : '85ac414fdada2d04619c8f936344df14', \ } # parse args args = sys.argv[1:] nargs = len(args) if nargs == 0: error(help=help) homepath = "." buildflag = False pathflag = False suffixflag = False linkflag = True iarg = 0 while iarg < nargs: if args[iarg] == "-p": if iarg + 2 > nargs: error(help=help) lattedir = fullpath(args[iarg + 1]) pathflag = True iarg += 2
make lib-smd args="-b" # download/build in default lib/smd/eigen-eigen-* make lib-smd args="-p /usr/include/eigen3" # use existing Eigen installation in /usr/include/eigen3 """ # settings version = '3.3.4' tarball = "eigen.tar.gz" # parse args args = sys.argv[1:] nargs = len(args) if nargs == 0: error(help=help) homepath = "." homedir = "eigen3" buildflag = False pathflag = False linkflag = True iarg = 0 while iarg < nargs: if args[iarg] == "-v": if iarg+2 > nargs: error(help=help) version = args[iarg+1] iarg += 2 elif args[iarg] == "-p":
make lib-mscg args="-b -m mpi " # download/build in lib/mscg/MSCG-release-master with settings compatible with "make mpi" make lib-mscg args="-p /usr/local/mscg-release " # use existing MS-CG installation in /usr/local/mscg-release """ # settings mscgver = "1.7.3.1" url = "https://github.com/uchicago-voth/MSCG-release/archive/%s.tar.gz" % mscgver tarfile = "MS-CG-%s.tar.gz" % mscgver tardir = "MSCG-release-%s" % mscgver # parse args args = sys.argv[1:] nargs = len(args) if nargs == 0: error(help=help) homepath = "." homedir = tardir buildflag = False pathflag = False linkflag = True msuffix = "g++_simple" iarg = 0 while iarg < nargs: if args[iarg] == "-p": if iarg + 2 > nargs: error(help=help) mscgpath = fullpath(args[iarg + 1]) pathflag = True
#!/usr/bin/env python # install.py tool to do a generic build of a library # soft linked to by many of the lib/Install.py files # used to automate the steps described in the corresponding lib/README from __future__ import print_function import sys,os,subprocess sys.path.append('..') from install_helpers import error,get_cpus # parse args args = sys.argv[1:] nargs = len(args) if nargs == 0: error() machine = None extraflag = 0 iarg = 0 while iarg < nargs: if args[iarg] == "-m": if iarg+2 > nargs: error() machine = args[iarg+1] iarg += 2 elif args[iarg] == "-e": if iarg+2 > nargs: error() extraflag = 1 suffix = args[iarg+1] iarg += 2
version = "2.4.3" mode = "static" # known checksums for different PLUMED versions. used to validate the download. checksums = { \ '2.4.2' : '88188743a6e03ef076e5377d03ebb0e7', \ '2.4.3' : 'b1be7c48971627febc11c61b70767fc5', \ '2.5b' : 'e341bdef469be1da058b8a0b97a3db22', \ } # parse args args = sys.argv[1:] nargs = len(args) if nargs == 0: error(help=help) homepath = "." buildflag = False pathflag = False suffixflag = False linkflag = True iarg = 0 while iarg < nargs: if args[iarg] == "-v": if iarg + 2 > nargs: error(help=help) version = args[iarg + 1] iarg += 2 elif args[iarg] == "-p":
# parse args args = sys.argv[1:] nargs = len(args) homepath = "." buildflag = True pathflag = False linkflag = True iarg = 0 while iarg < nargs: if args[iarg] == "-v": if iarg+2 > nargs: error(help=help) version = args[iarg+1] iarg += 2 elif args[iarg] == "-p": if iarg+2 > nargs: error(help=help) scafacospath = fullpath(args[iarg+1]) pathflag = True iarg += 2 elif args[iarg] == "-b": buildflag = True iarg += 1 else: error(help=help) homepath = fullpath(homepath) homedir = "%s/%s" % (homepath,version)
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 """ # parse args args = sys.argv[1:] nargs = len(args) if nargs == 0: error(help=help) thisdir = fullpath('.') version = "kim-api-v1.9.5" buildflag = False everythingflag = False addflag = False verboseflag = False pathflag = False iarg = 0 while iarg < len(args): if args[iarg] == "-v": if iarg+2 > len(args): error(help=help) version = args[iarg+1]
version = "2.4.3" mode = "static" # known checksums for different PLUMED versions. used to validate the download. checksums = { \ '2.4.2' : '88188743a6e03ef076e5377d03ebb0e7', \ '2.4.3' : 'b1be7c48971627febc11c61b70767fc5', \ '2.5b' : 'e341bdef469be1da058b8a0b97a3db22', \ } # parse args args = sys.argv[1:] nargs = len(args) if nargs == 0: error(help=help) homepath = "." buildflag = False pathflag = False suffixflag = False linkflag = True iarg = 0 while iarg < nargs: if args[iarg] == "-v": if iarg+2 > nargs: error(help=help) version = args[iarg+1] iarg += 2 elif args[iarg] == "-p":
-m = parallel build of CSlib library -s = serial build of CSlib library -z = build CSlib library with ZMQ socket support, default = no ZMQ support Example: make lib-message args="-m -z" # build parallel CSlib with ZMQ support make lib-message args="-s" # build serial CSlib with no ZMQ support """ # parse args args = sys.argv[1:] nargs = len(args) if nargs == 0: error(help=help) mpiflag = False serialflag = False zmqflag = False iarg = 0 while iarg < nargs: if args[iarg] == "-m": mpiflag = True iarg += 1 elif args[iarg] == "-s": serialflag = True iarg += 1 elif args[iarg] == "-z": zmqflag = True
# settings version = '1.2.1' # known checksums for different LATTE versions. used to validate the download. checksums = { \ '1.1.0' : '533635721ee222d0ed2925a18fb5b294', \ '1.2.0' : '68bf0db879da5e068a71281020239ae7', \ '1.2.1' : '85ac414fdada2d04619c8f936344df14', \ } # parse args args = sys.argv[1:] nargs = len(args) if nargs == 0: error(help=help) homepath = "." buildflag = False pathflag = False suffixflag = False linkflag = True iarg = 0 while iarg < nargs: if args[iarg] == "-p": if iarg+2 > nargs: error(help=help) lattedir = fullpath(args[iarg+1]) pathflag = True iarg += 2
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 """ # parse args args = sys.argv[1:] nargs = len(args) if nargs == 0: error(help=help) thisdir = fullpath('.') version = "kim-api-v1.9.5" buildflag = False everythingflag = False addflag = False verboseflag = False pathflag = False iarg = 0 while iarg < len(args): if args[iarg] == "-v": if iarg + 2 > len(args): error(help=help) version = args[iarg + 1]