Commit 62a1f894 authored by Mathieu Giraud's avatar Mathieu Giraud init, install various vidjil-algo releases

see #3916
parent 5a4af716
DEST = 'bench/'
SRC = DEST + 'src/'
BIN = DEST + 'bin/'
import re
import urllib.request
import os
import subprocess
import glob
import time
import sys
import argparse
import resource
stats = {}
parser = argparse.ArgumentParser()
parser.add_argument('-i', '--install', action='store_true', help='install various releases')
def go(cmd, log=None):
if log:
flog = open(log, 'a')
flog.write('\n\n%s\n' % cmd)
flog = sys.stdout
print(cmd, end=' ')
completed =, shell=True, stderr=subprocess.STDOUT, stdout=flog)
if log:
if completed.returncode:
print('FAILED', end=' ')
def code(tgz):
Extract release tag from filename
>>> code('vidjil-algo-2001.01.tar.gz')
base = tgz.replace('.tgz', '').replace('.tar.gz', '').replace('vidjil-algo-', '').replace('vidjil-', '')
return base
def get_releases():
with urllib.request.urlopen(ARCHIVE) as response:
for elt in str('"'):
ok = True
for ignore in ['<', '>', 'x86', 'latest']:
if ignore in elt:
ok = False
if ok and 'vidjil-' in elt:
yield code(elt), elt
def install(release, tgz):
os.system('mkdir -p %s' % BIN)
print('== %s' % release)
dir = SRC + release
go('mkdir -p %s' % dir)
log = dir + '/' + 'install.log'
go('wget %s/%s -O %s/src.tgz' % (ARCHIVE, tgz, dir), log)
go('cd %s ; tar xfz src.tgz' % dir, log)
go('cd %s/*%s* ; make vidjil-algo || make CXX=g++-6' % (dir, release), log)
res = go('cp %s/*%s*/vidjil* %s/%s ' % (dir, release, BIN, release), log)
def install_all():
for release, tgz in get_releases():
install(release, tgz)
except subprocess.CalledProcessError:
def installed():
return sorted([f.replace(BIN, '') for f in glob.glob('%s/*' % BIN)])
if __name__ == '__main__':
args = parser.parse_args(sys.argv[1:])
if args.install:
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment