properly apply version flag

This commit is contained in:
Axel Kohlmeyer 2019-01-14 16:29:07 -05:00
parent 718428df68
commit 2604b60eb8
2 changed files with 10 additions and 3 deletions

View File

@ -55,6 +55,7 @@ if args.build == False and not args.path:
buildflag = args.build buildflag = args.build
pathflag = args.path != None pathflag = args.path != None
version = args.version
homepath = fullpath(".") homepath = fullpath(".")
scafacospath = "%s/scafacos-%s" % (homepath,version) scafacospath = "%s/scafacos-%s" % (homepath,version)

View File

@ -6,8 +6,7 @@
from __future__ import print_function from __future__ import print_function
import sys,os,re,glob,subprocess,shutil import sys,os,re,glob,subprocess,shutil
sys.path.append('..') sys.path.append('..')
from install_helpers import fullpath,geturl from install_helpers import fullpath,geturl,checkmd5sum
from argparse import ArgumentParser from argparse import ArgumentParser
parser = ArgumentParser(prog='Install.py', parser = ArgumentParser(prog='Install.py',
@ -26,7 +25,6 @@ checksums = { \
'3.3.7' : 'f2a417d083fe8ca4b8ed2bc613d20f07' \ '3.3.7' : 'f2a417d083fe8ca4b8ed2bc613d20f07' \
} }
# help message # help message
help = """ help = """
@ -63,6 +61,7 @@ eigenpath = "%s/eigen3" % homepath
buildflag = args.build buildflag = args.build
pathflag = args.path != None pathflag = args.path != None
version = args.version
if (pathflag): if (pathflag):
eigenpath = args.path eigenpath = args.path
@ -77,6 +76,13 @@ if buildflag:
url = "http://bitbucket.org/eigen/eigen/get/%s.tar.gz" % version url = "http://bitbucket.org/eigen/eigen/get/%s.tar.gz" % version
geturl(url,"%s/%s" % (homepath,tarball)) geturl(url,"%s/%s" % (homepath,tarball))
# verify downloaded archive integrity via md5 checksum, if known.
if version in checksums:
print("checking version %s\n" % version)
if not checkmd5sum(checksums[version],'%s/%s' % (homepath,tarball)):
sys.exit("Checksum for Eigen library does not match")
print("Cleaning up old folders ...") print("Cleaning up old folders ...")
edir = glob.glob("%s/eigen-eigen-*" % homepath) edir = glob.glob("%s/eigen-eigen-*" % homepath)
edir.append(eigenpath) edir.append(eigenpath)