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)) # build plumed print("Building plumed ...") n_cpus = get_cpus() cmd = 'cd %s/plumed-%s; ./configure --prefix=%s --enable-modules=all --enable-static-patch ; make -j%d ; make install' % (
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 buildflag: print("Building LATTE ...") cmd = 'cd "%s"; make' % lattedir try:
# 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 print("Building libpace ...") cmd = 'make lib -j2' txt = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) if verboseflag: print(txt.decode("UTF-8"))
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)) # build plumed print("Building plumed ...") n_cpus = get_cpus() cmd = 'cd %s/plumed-%s; ./configure --prefix=%s --enable-static-patch ; make -j%d ; make install' % (homepath,version,homedir,n_cpus)
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") # build LATTE print("Building LATTE ...") cmd = 'cd "%s"; make' % lattedir
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: sys.exit("File %s is not a supported archive" % vorotar) if os.path.basename(homedir) != version: if os.path.exists(homedir): shutil.rmtree(homedir)
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 tarfile.is_tarfile(eigentar): tgz = tarfile.open(eigentar) tgz.extractall(path=homepath) os.remove(eigentar) else:
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: sys.exit("File %s is not a supported archive" % tarname) # build ScaFaCoS print("Building ScaFaCoS ...")
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: sys.exit("File %s is not a supported archive" % vorotar) if os.path.basename(homedir) != version: if os.path.exists(homedir): shutil.rmtree(homedir)
cwd = os.getcwd() lib = os.path.basename(cwd) # download and unpack MDI_Library tarball homepath = "." homedir = "%s/MDI_Library" % homepath print("Downloading MDI_Library ...") mditar = "%s/v%s.tar.gz" % (homepath, version) geturl(url, mditar) # verify downloaded archive integrity via md5 checksum, if known. if version in checksums: if not checkmd5sum(checksums[version], mditar): sys.exit("Checksum for MDI library does not match") print("Unpacking MDI_Library tarball ...") if os.path.exists("%s/v%s" % (homepath, version)): cmd = 'rm -rf "%s/v%s"' % (homepath, version) subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) cmd = 'cd "%s"; tar -xzvf v%s.tar.gz' % (homepath, version) subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) os.remove("%s/v%s.tar.gz" % (homepath, version)) if os.path.basename(homedir) != version: if os.path.exists(homedir): cmd = 'rm -rf "%s"' % homedir subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) os.rename("%s/MDI_Library-%s" % (homepath, version), homedir)
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("Unpacking Eigen tarball ...") if tarfile.is_tarfile(eigentar): tgz = tarfile.open(eigentar) tgz.extractall(path=homepath) os.remove(eigentar)