Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default 'arch' and fix environment variable copy #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions build-env.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down Expand Up @@ -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')))
Expand All @@ -212,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))
Expand Down