Skip to content
Snippets Groups Projects
Commit 92d62421 authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

TEST: MAke sure build env is activated

parent 0cc7d457
No related branches found
No related tags found
No related merge requests found
Pipeline #19433 skipped
This commit is part of merge request !57. Comments created here will be created in the context of that merge request.
......@@ -6,20 +6,19 @@ import tempfile
import subprocess as sp
def run(cmd, ompthreads=None, blasthreads=None, fslskipglobal=None, keepenv=False):
def run(cmd, ompthreads=None, blasthreads=None, fslskipglobal=None):
env = os.environ.copy()
if not keepenv:
blacklist = ['OMP', 'GOTO', 'BLAS', 'FSL']
blacklist = ['OMP', 'GOTO', 'BLAS', 'FSL']
for varname in list(env.keys()):
if any(b in varname for b in blacklist):
env.pop(varname)
for varname in list(env.keys()):
if any(b in varname for b in blacklist):
env.pop(varname)
if ompthreads is not None: env['OMP_NUM_THREADS'] = str(ompthreads)
if blasthreads is not None: env['BLAS_NUM_THREADS'] = str(blasthreads)
if fslskipglobal is not None: env['FSL_SKIP_GLOBAL'] = str(fslskipglobal)
if ompthreads is not None: env['OMP_NUM_THREADS'] = str(ompthreads)
if blasthreads is not None: env['BLAS_NUM_THREADS'] = str(blasthreads)
if fslskipglobal is not None: env['FSL_SKIP_GLOBAL'] = str(fslskipglobal)
result = sp.run(shlex.split(cmd), check=True, text=True,
stdout=sp.PIPE, stderr=sp.STDOUT, env=env)
......@@ -33,7 +32,10 @@ def run(cmd, ompthreads=None, blasthreads=None, fslskipglobal=None, keepenv=Fals
def main():
run('make', keepenv=True)
buildcmds = ['source $FSLDIR/bin/activate $FSLDIR',
'source $FSLDIR/etc/fslconf/fsl-devel.sh',
'make']
sp.run('; '.join(buildcmds), check=True, shell=True)
# Default behaviour should be: OMP multi-threaded, BLAS single threaded.
assert run('./test_fslStartup', 8, 8) == '8 1 8'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment