version = args.version if pathflag: eigenpath = args.path if not os.path.isdir(eigenpath): sys.exit("Eigen path %s does not exist" % eigenpath) eigenpath = fullpath(eigenpath) # download and unpack Eigen tarball # use glob to find name of dir it unpacks to if buildflag: print("Downloading Eigen ...") eigentar = os.path.join(homepath, tarball) url = "https://download.lammps.org/thirdparty/eigen-%s.tar.gz" % version geturl(url, eigentar) # verify downloaded archive integrity via md5 checksum, if known. if version in checksums: print("checking version %s\n" % version) if not checkmd5sum(checksums[version], eigentar): sys.exit("Checksum for Eigen library does not match") print("Cleaning up old folders ...") edir = glob.glob(os.path.join(homepath, "eigen-*")) edir.append(eigenpath) for one in edir: if os.path.isdir(one): shutil.rmtree(one) print("Unpacking Eigen tarball ...")
if (pathflag): if not os.path.isdir(voropath): error("Voro++ path does not exist") homedir = voropath if (buildflag and pathflag): error("Cannot use -b and -p flag at the same time") if (not buildflag and not pathflag): error("Have to use either -b or -p flag") # download and unpack Voro++ tarball if buildflag: print("Downloading Voro++ ...") geturl(url, "%s/%s.tar.gz" % (homepath, version)) print("Unpacking Voro++ tarball ...") if os.path.exists("%s/%s" % (homepath, version)): shutil.rmtree("%s/%s" % (homepath, version)) cmd = 'cd "%s"; tar -xzvf %s.tar.gz' % (homepath, version) subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) os.remove("%s/%s.tar.gz" % (homepath, version)) if os.path.basename(homedir) != version: if os.path.exists(homedir): shutil.rmtree(homedir) os.rename("%s/%s" % (homepath, version), homedir) # build Voro++ if buildflag:
tardir = "MSCG-release-%s" % mscgver homepath = fullpath('.') homedir = os.path.join(homepath, tardir) if pathflag: if not os.path.isdir(mscgpath): sys.exit("MS-CG path %s does not exist" % mscgpath) homedir = fullpath(mscgpath) # download and unpack MS-CG tarfile if buildflag: print("Downloading MS-CG ...") tarname = os.path.join(homepath, tarname) geturl(url, tarname) print("Unpacking MS-CG tarfile ...") if os.path.exists(os.path.join(homepath, tardir)): shutil.rmtree(os.path.join(homepath, tardir)) if tarfile.is_tarfile(tarname): tgz = tarfile.open(tarname) tgz.extractall(path=homepath) os.remove(tarname) else: sys.exit("File %s is not a supported archive", tarname) if os.path.basename(homedir) != tardir: if os.path.exists(homedir):
"kim-api is already installed at %s.\nRemoving it for re-install" % kimdir) shutil.rmtree(kimdir) # configure LAMMPS to use kim-api to be installed with open("%s/kim-prefix.txt" % thisdir, 'w') as pffile: pffile.write("%s" % kimdir) print("Created %s/kim-prefix.txt\n using %s" % (thisdir, kimdir)) # download entire kim-api tarball print("Downloading kim-api tarball ...") filename = "kim-api-%s.txz" % version geturl(url, "%s/%s" % (thisdir, filename)) # verify downloaded archive integrity via md5 checksum, if known. if version in checksums: if not checkmd5sum(checksums[version], filename): sys.exit("Checksum for KIM-API library does not match") print("Unpacking kim-api tarball ...") cmd = 'cd "%s"; rm -rf "kim-api-%s"; tar -xJvf %s' % (thisdir, version, filename) subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) # configure kim-api print("Configuring kim-api ...") cmd = 'cd "%s/kim-api-%s" && mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX="%s" -DCMAKE_BUILD_TYPE=Release' % (
homepath = fullpath('.') homedir = "%s/plumed2" % (homepath) if pathflag: if not os.path.isdir(plumedpath): sys.exit("Plumed2 path %s does not exist" % plumedpath) homedir = fullpath(plumedpath) # download and unpack plumed2 tarball if buildflag: url = "https://github.com/plumed/plumed2/releases/download/v%s/plumed-src-%s.tgz" % ( version, version) filename = "plumed-src-%s.tar.gz" % version print("Downloading plumed ...") geturl(url, filename) # verify downloaded archive integrity via md5 checksum, if known. if version in checksums: if not checkmd5sum(checksums[version], filename): sys.exit("Checksum for plumed2 library does not match") print("Unpacking plumed2 source tarball ...") if os.path.exists("%s/plumed-%s" % (homepath, version)): shutil.rmtree("%s/plumed-%s" % (homepath, version)) if os.path.exists(homedir): shutil.rmtree(homedir) cmd = 'cd "%s"; tar -xzvf %s' % (homepath, filename) subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) os.remove(os.path.join(homepath, filename))
version = args.version if pathflag: eigenpath = args.path if not os.path.isdir(eigenpath): sys.exit("Eigen path %s does not exist" % eigenpath) eigenpath = fullpath(eigenpath) # download and unpack Eigen tarball # use glob to find name of dir it unpacks to if buildflag: print("Downloading Eigen ...") eigentar = os.path.join(homepath, tarball) url = "http://bitbucket.org/eigen/eigen/get/%s.tar.gz" % version geturl(url, eigentar) # verify downloaded archive integrity via md5 checksum, if known. if version in checksums: print("checking version %s\n" % version) if not checkmd5sum(checksums[version], eigentar): sys.exit("Checksum for Eigen library does not match") print("Cleaning up old folders ...") edir = glob.glob(os.path.join(homepath, "eigen-eigen-*")) edir.append(eigenpath) for one in edir: if os.path.isdir(one): shutil.rmtree(one)
print( "kim-api is already installed at %s.\nRemoving it for re-install" % kimdir) shutil.rmtree(kimdir) # configure LAMMPS to use kim-api to be installed with open("%s/kim-prefix.txt" % thisdir, 'w') as pffile: pffile.write("%s" % kimdir) print("Created %s/kim-prefix.txt\n using %s" % (thisdir, kimdir)) # download entire kim-api tarball print("Downloading kim-api tarball ...") geturl(url, "%s/%s.txz" % (thisdir, version)) print("Unpacking kim-api tarball ...") cmd = 'cd "%s"; rm -rf "%s"; tar -xJvf %s.txz' % (thisdir, version, version) subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) # configure kim-api print("Configuring kim-api ...") cmd = 'cd "%s/%s" && mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX="%s" -DCMAKE_BUILD_TYPE=Release' % ( thisdir, version, kimdir) txt = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) if verboseflag: print(txt.decode("UTF-8")) # build kim-api print("Building kim-api ...")
archive_extension = "tar.gz" url = "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/%s.%s" % ( version, archive_extension) unarchived_folder_name = "lammps-user-pace-%s" % (version) # download PACE tarball, unpack, build PACE if buildflag: # download entire tarball print("Downloading pace tarball ...") archive_filename = "%s.%s" % (version, archive_extension) download_filename = "%s/%s" % (thisdir, archive_filename) print("Downloading from ", url, " to ", download_filename, end=" ") geturl(url, download_filename) print(" done") # verify downloaded archive integrity via md5 checksum, if known. if version in checksums: if not checkmd5sum(checksums[version], archive_filename): sys.exit("Checksum for pace library does not match") print("Unpacking pace tarball ...") src_folder = thisdir + "/src" cmd = 'cd "%s"; rm -rf "%s"; tar -xvf %s; mv %s %s' % ( thisdir, src_folder, archive_filename, unarchived_folder_name, src_folder) subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) # build
if (pathflag): if not os.path.isdir(eigenpath): error("Eigen path does not exist") if (buildflag and pathflag): error("Cannot use -b and -p flag at the same time") if (not buildflag and not pathflag): error("Have to use either -b or -p flag") # download and unpack Eigen tarball # use glob to find name of dir it unpacks to if buildflag: print("Downloading Eigen ...") url = "http://bitbucket.org/eigen/eigen/get/%s.tar.gz" % version geturl(url, "%s/%s" % (homepath, tarball)) print("Unpacking Eigen tarball ...") edir = glob.glob("%s/eigen-eigen-*" % homepath) for one in edir: if os.path.isdir(one): shutil.rmtree(one) cmd = 'cd "%s"; tar -xzvf %s' % (homepath, tarball) subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) edir = glob.glob("%s/eigen-eigen-*" % homepath) os.rename(edir[0], "%s/%s" % (homepath, homedir)) os.remove(tarball) # create link in lib/smd to Eigen src dir if linkflag:
if (pathflag): if not os.path.isdir(mscgpath): error("MS-CG path does not exist") homedir = mscgpath if (buildflag and pathflag): error("Cannot use -b and -p flag at the same time") if (not buildflag and not pathflag): error("Have to use either -b or -p flag") # download and unpack MS-CG tarfile if buildflag: print("Downloading MS-CG ...") geturl(url,"%s/%s" % (homepath,tarfile)) print("Unpacking MS-CG tarfile ...") if os.path.exists("%s/%s" % (homepath,tardir)): shutil.rmtree("%s/%s" % (homepath,tardir)) cmd = 'cd "%s"; tar -xzvf %s' % (homepath,tarfile) subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) os.remove("%s/%s" % (homepath,tarfile)) if os.path.basename(homedir) != tardir: if os.path.exists(homedir): shutil.rmtree(homedir) os.rename("%s/%s" % (homepath,tardir),homedir) # build MS-CG if buildflag:
if (pathflag): if not os.path.isdir(eigenpath): error("Eigen path does not exist") if (buildflag and pathflag): error("Cannot use -b and -p flag at the same time") if (not buildflag and not pathflag): error("Have to use either -b or -p flag") # download and unpack Eigen tarball # use glob to find name of dir it unpacks to if buildflag: print("Downloading Eigen ...") url = "http://bitbucket.org/eigen/eigen/get/%s.tar.gz" % version geturl(url,"%s/%s" % (homepath,tarball)) print("Unpacking Eigen tarball ...") edir = glob.glob("%s/eigen-eigen-*" % homepath) for one in edir: if os.path.isdir(one): shutil.rmtree(one) cmd = 'cd "%s"; tar -xzvf %s' % (homepath,tarball) subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) edir = glob.glob("%s/eigen-eigen-*" % homepath) os.rename(edir[0],"%s/%s" % (homepath,homedir)) os.remove(tarball) # create link in lib/smd to Eigen src dir if linkflag:
if (pathflag): if not os.path.isdir(mscgpath): error("MS-CG path does not exist") homedir = mscgpath if (buildflag and pathflag): error("Cannot use -b and -p flag at the same time") if (not buildflag and not pathflag): error("Have to use either -b or -p flag") # download and unpack MS-CG tarfile if buildflag: print("Downloading MS-CG ...") geturl(url, "%s/%s" % (homepath, tarfile)) print("Unpacking MS-CG tarfile ...") if os.path.exists("%s/%s" % (homepath, tardir)): shutil.rmtree("%s/%s" % (homepath, tardir)) cmd = 'cd "%s"; tar -xzvf %s' % (homepath, tarfile) subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) os.remove("%s/%s" % (homepath, tarfile)) if os.path.basename(homedir) != tardir: if os.path.exists(homedir): shutil.rmtree(homedir) os.rename("%s/%s" % (homepath, tardir), homedir) # build MS-CG if buildflag:
homepath = fullpath(homepath) homedir = "%s/%s" % (homepath,version) if (pathflag): if not os.path.isdir(scafacospath): error("Scafacos path does not exist") homedir =scafacospath if (buildflag and pathflag): error("Cannot use -b and -p flag at the same time") # download and unpack Scafacos tarball if buildflag: print("Downloading Scafacos ...") geturl(url,"%s/%s.tar.gz" % (homepath,version)) print("Unpacking Scafacos tarball ...") if os.path.exists("%s/%s" % (homepath,version)): shutil.rmtree("%s/%s" % (homepath,version)) cmd = 'cd "%s"; tar -xzvf %s.tar.gz' % (homepath,version) subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) os.remove("%s/%s.tar.gz" % (homepath,version)) if os.path.basename(homedir) != version: if os.path.exists(homedir): shutil.rmtree(homedir) os.rename("%s/%s" % (homepath,version),homedir) # build Scafacos if buildflag:
if not os.path.isdir(lattedir): sys.exit("LATTE path %s does not exist" % lattedir) lattedir = fullpath(lattedir) homedir = "LATTE-%s" % version if buildflag: url = "https://github.com/lanl/LATTE/archive/v%s.tar.gz" % version lattepath = fullpath(homepath) lattedir = os.path.join(lattepath, homedir) # download and unpack LATTE tarball if buildflag: print("Downloading LATTE ...") geturl(url, "LATTE.tar.gz") # verify downloaded archive integrity via md5 checksum, if known. if version in checksums: if not checkmd5sum(checksums[version], 'LATTE.tar.gz'): sys.exit("Checksum for LATTE library does not match") print("Unpacking LATTE ...") if os.path.exists(lattedir): shutil.rmtree(lattedir) if tarfile.is_tarfile('LATTE.tar.gz'): tgz = tarfile.open('LATTE.tar.gz') tgz.extractall() os.remove('LATTE.tar.gz') else: sys.exit("File LATTE.tar.gz is not a supported archive")
tardir = "MSCG-release-%s" % mscgver homepath = fullpath('.') homedir = os.path.join(homepath, tardir) if pathflag: if not os.path.isdir(mscgpath): sys.exit("MS-CG path %s does not exist" % mscgpath) homedir = fullpath(mscgpath) # download and unpack MS-CG tarfile if buildflag: print("Downloading MS-CG ...") tarname = os.path.join(homepath, tarname) geturl(url, tarname) print("Unpacking MS-CG tarfile ...") if os.path.exists(os.path.join(homepath, tardir)): shutil.rmtree(os.path.join(homepath, tardir)) if tarfile.is_tarfile(tarname): tgz = tarfile.open(tarname) tgz.extractall(path=homepath) os.remove(tarname) else: sys.exit("File %s is not a supported archive", tarname) if os.path.basename(homedir) != tardir: if os.path.exists(homedir):
voropath = args.path homepath = fullpath(".") homedir = os.path.join(homepath, version) if pathflag: if not os.path.isdir(voropath): sys.exit("Voro++ path %s does not exist" % voropath) homedir = fullpath(voropath) # download and unpack Voro++ tarball if buildflag: print("Downloading Voro++ ...") vorotar = os.path.join(homepath, version) + '.tar.gz' geturl(url, vorotar) # verify downloaded archive integrity via md5 checksum, if known. if version in checksums: if not checkmd5sum(checksums[version], vorotar): sys.exit("Checksum for Voro++ library does not match") print("Unpacking Voro++ tarball ...") srcpath = os.path.join(homepath, version) if os.path.exists(srcpath): shutil.rmtree(srcpath) if tarfile.is_tarfile(vorotar): tgz = tarfile.open(vorotar) tgz.extractall(path=homepath) os.remove(vorotar) else:
voropath = args.path homepath = fullpath(".") homedir = os.path.join(homepath, version) if pathflag: if not os.path.isdir(voropath): sys.exit("Voro++ path %s does not exist" % voropath) homedir = fullpath(voropath) # download and unpack Voro++ tarball if buildflag: print("Downloading Voro++ ...") vorotar = os.path.join(homepath, version) + '.tar.gz' geturl(url, vorotar) # verify downloaded archive integrity via md5 checksum, if known. if version in checksums: if not checkmd5sum(checksums[version], vorotar): sys.exit("Checksum for Voro++ library does not match") print("Unpacking Voro++ tarball ...") srcpath = os.path.join(homepath, version) if os.path.exists(srcpath): shutil.rmtree(srcpath) if tarfile.is_tarfile(vorotar): tgz = tarfile.open(vorotar) tgz.extractall(path=homepath) os.remove(vorotar) else:
if (buildflag and pathflag): error("Cannot use -b and -p flag at the same time") if (not buildflag and not pathflag): error("Have to use either -b or -p flag") if ((mode != "static") and (mode != "shared") and (mode != "runtime")): error("Unknown linkage mode '%s' for Plumed" % mode) # download and unpack plumed2 tarball if buildflag: url = "https://github.com/plumed/plumed2/releases/download/v%s/plumed-src-%s.tgz" % (version,version) filename = "plumed-src-%s.tar.gz" %version print("Downloading plumed ...") geturl(url,filename) # verify downloaded archive integrity via md5 checksum, if known. if version in checksums: if not checkmd5sum(checksums[version],filename): error("Checksum for plumed2 library does not match") print("Unpacking plumed2 source tarball ...") if os.path.exists("%s/plumed-%s" % (homepath,version)): shutil.rmtree("%s/plumed-%s" % (homepath,version)) if os.path.exists(homedir): shutil.rmtree(homedir) cmd = 'cd "%s"; tar -xzvf %s' % (homepath,filename) subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) os.remove("%s/%s" % (homepath,filename))
scafacospath = os.path.join(homepath, "scafacos-%s" % version) if pathflag: scafacospath = args.path if not os.path.isdir(os.path.join(scafacospath, "include")): sys.exit("ScaFaCoS include path for %s does not exist" % scafacospath) if (not os.path.isdir(os.path.join(scafacospath, "lib64"))) \ and (not os.path.isdir(os.path.join(scafacospath, "lib"))): sys.exit("ScaFaCoS lib path for %s does not exist" % scafacospath) scafacospath = fullpath(scafacospath) # download and unpack ScaFaCoS tarball if buildflag: print("Downloading ScaFaCoS ...") geturl(url, "%s/scafacos-%s.tar.gz" % (homepath, version)) # verify downloaded archive integrity via md5 checksum, if known. if version in checksums: if not checkmd5sum(checksums[version], '%s/scafacos-%s.tar.gz' % (homepath, version)): sys.exit("Checksum for ScaFaCoS library does not match") print("Unpacking ScaFaCoS tarball ...") if os.path.exists(scafacospath): shutil.rmtree(scafacospath) tarname = os.path.join(homepath, "%s.tar.gz" % scafacospath) if tarfile.is_tarfile(tarname): tgz = tarfile.open(tarname) tgz.extractall(path=homepath) os.remove(tarname) else:
if (buildflag and pathflag): error("Cannot use -b and -p flag at the same time") if buildflag: url = "https://github.com/lanl/LATTE/archive/v%s.tar.gz" % version lattepath = fullpath(homepath) lattedir = "%s/%s" % (lattepath,homedir) if pathflag: if not os.path.isdir(lattedir): error("LATTE path does not exist") # download and unpack LATTE tarball if buildflag: print("Downloading LATTE ...") geturl(url,"LATTE.tar.gz") # verify downloaded archive integrity via md5 checksum, if known. if version in checksums: if not checkmd5sum(checksums[version],'LATTE.tar.gz'): error("Checksum for LATTE library does not match") print("Unpacking LATTE ...") if os.path.exists(lattedir): shutil.rmtree(lattedir) cmd = 'cd "%s"; tar zxvf LATTE.tar.gz' % lattepath subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) os.remove("%s/LATTE.tar.gz" % lattepath) # build LATTE
if os.path.isdir(kimdir): print("kim-api is already installed at %s.\nRemoving it for re-install" % kimdir) shutil.rmtree(kimdir) # configure LAMMPS to use kim-api to be installed with open("%s/kim-prefix.txt" % thisdir, 'w') as pffile: pffile.write("%s" % kimdir) print("Created %s/kim-prefix.txt\n using %s" % (thisdir,kimdir)) # download entire kim-api tarball print("Downloading kim-api tarball ...") geturl(url, "%s/%s.txz" % (thisdir, version)) print("Unpacking kim-api tarball ...") cmd = 'cd "%s"; rm -rf "%s"; tar -xJvf %s.txz' % (thisdir, version, version) subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) # configure kim-api print("Configuring kim-api ...") cmd = 'cd "%s/%s" && mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX="%s" -DCMAKE_BUILD_TYPE=Release' % (thisdir,version,kimdir) txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) if verboseflag: print(txt.decode("UTF-8")) # build kim-api print("Building kim-api ...") cmd = 'cd "%s/%s/build" && make' % (thisdir, version) txt = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)