2016-12-20 11:52:19 +00:00
|
|
|
import os
|
|
|
|
import platform
|
|
|
|
import subprocess
|
|
|
|
|
2017-06-13 15:56:58 +00:00
|
|
|
def get_python_cmds():
|
2017-06-13 16:58:12 +00:00
|
|
|
if platform.system() == 'Windows':
|
|
|
|
lst = []
|
2017-06-13 18:32:06 +00:00
|
|
|
pyvers = ['27','35']
|
|
|
|
#pyvers = ['27']
|
2017-06-13 16:58:12 +00:00
|
|
|
for pyver in pyvers:
|
|
|
|
pycmd = 'C:/python{}/python'.format(pyver)
|
|
|
|
lst.append((pyver,pycmd))
|
|
|
|
return lst
|
|
|
|
elif platform.system() == 'Linux':
|
2017-06-13 16:07:13 +00:00
|
|
|
lst = []
|
2017-06-13 18:32:06 +00:00
|
|
|
pyvers = ['2.7','3.5.2']
|
|
|
|
#pyvers = ['2.7']
|
2017-06-13 16:40:46 +00:00
|
|
|
for pyver in pyvers:
|
2017-06-13 15:56:58 +00:00
|
|
|
pycmd = '/opt/python/{}/bin/python'.format(pyver)
|
2017-06-13 16:02:17 +00:00
|
|
|
lst.append((pyver,pycmd))
|
2017-06-13 15:56:58 +00:00
|
|
|
return lst
|
|
|
|
|
2017-06-13 16:02:17 +00:00
|
|
|
return [('dfltpython','python')]
|
2017-06-13 15:56:58 +00:00
|
|
|
|
|
|
|
|
2017-06-13 16:02:17 +00:00
|
|
|
for pyver,pycmd in get_python_cmds():
|
2017-06-13 18:32:06 +00:00
|
|
|
cmd = '{} -m pip install --user https://github.com/intelxed/mbuild/zipball/master'.format(pycmd)
|
|
|
|
print(cmd)
|
|
|
|
subprocess.check_call(cmd, shell=True)
|
2017-06-13 15:56:58 +00:00
|
|
|
for size in ['ia32','x86-64']:
|
2017-06-13 16:02:17 +00:00
|
|
|
for linkkind,link in [('dfltlink',''),('dynamic','--shared')]:
|
|
|
|
build_dir = '{}-{}-{}'.format(pyver, size, linkkind)
|
|
|
|
cmd = '{} mfile.py --build-dir=build-{} host_cpu={} {} test'.format(pycmd,build_dir,size,link)
|
2017-06-13 15:56:58 +00:00
|
|
|
print(cmd)
|
|
|
|
subprocess.check_call(cmd, shell=True)
|