From 6d9f0e89345403324da751c4a805a704c74b21c0 Mon Sep 17 00:00:00 2001 From: Brendan Long Date: Tue, 8 Dec 2015 17:51:58 -0500 Subject: [PATCH 1/2] Let nvcc figure out it's own default for 'arch' and add new values. --- build-env.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build-env.py b/build-env.py index 4c33b7a..cb6a6c3 100644 --- a/build-env.py +++ b/build-env.py @@ -157,8 +157,8 @@ def Environment(*args, **keywords): allowed_values = ('release', 'debug'))) # add a variable to handle compute capability - vars.Add(EnumVariable('arch', 'Compute capability code generation', 'sm_10', - allowed_values = ('sm_10', 'sm_11', 'sm_12', 'sm_13', 'sm_20', 'sm_21', 'sm_30'))) + vars.Add(EnumVariable('arch', 'Compute capability code generation', None, + allowed_values = ('sm_10', 'sm_11', 'sm_12', 'sm_13', 'sm_20', 'sm_21', 'sm_30','sm_32','sm_35','sm_37','sm_50','sm_52','sm_53'))) # add a variable to handle warnings if os.name == 'posix': @@ -187,7 +187,8 @@ def Environment(*args, **keywords): env.Append(CXXFLAGS = getCXXFLAGS(env['mode'], env['Wall'], env['Werror'], env.subst('$CXX'))) # get NVCC compiler switches - env.Append(NVCCFLAGS = getNVCCFLAGS(env['mode'], env['arch'])) + if 'arch' in env: + env.Append(NVCCFLAGS = getNVCCFLAGS(env['mode'], env['arch'])) # get linker switches env.Append(LINKFLAGS = getLINKFLAGS(env['mode'], env.subst('$LINK'))) From 109122df08972a72bf4e915db0985685a3a90f77 Mon Sep 17 00:00:00 2001 From: Brendan Long Date: Tue, 8 Dec 2015 17:52:26 -0500 Subject: [PATCH 2/2] Change environment copying to copy anything in the environment if it starts with NV or CUDA. --- build-env.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/build-env.py b/build-env.py index cb6a6c3..0dd19a1 100644 --- a/build-env.py +++ b/build-env.py @@ -213,10 +213,9 @@ def Environment(*args, **keywords): # on shared libraries # XXX we should probably just copy the entire environment if os.name == 'posix': - if env['PLATFORM'] == "darwin": - env['ENV']['DYLD_LIBRARY_PATH'] = os.environ['DYLD_LIBRARY_PATH'] - else: - env['ENV']['LD_LIBRARY_PATH'] = os.environ['LD_LIBRARY_PATH'] + for k in os.environ: + if k in ('DYLD_LIBRARY_PATH', 'LD_LIBRARY_PATH') or k.startswith('NV') or k.startswith('CUDA'): + env['ENV'][k] = os.environ[k] # generate help text Help(vars.GenerateHelpText(env))