Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,14 @@ vars.Add(BoolVariable(
vars.Add(BoolVariable(
'with_shared_cctbx',
'compile and link with the shared cctbx library', False))
vars.Add(
'arch',
'target CPU passed to -march in the \'fast\' build. Empty (the default) means '
'no -march => maximum portability. Set \'x86-64-v3\' for a portable AVX2/FMA '
'build (Intel Haswell 2013+, AMD Zen 2017+), \'native\' for a machine-specific '
'build, or \'x86-64-v4\' for AVX-512. Also settable via the OBJCRYST_ARCH '
'environment variable.',
os.environ.get('OBJCRYST_ARCH', ''))

vars.Update(env)
env.Help(MY_SCONS_HELP % vars.GenerateHelpText(env))
Expand Down
2 changes: 2 additions & 0 deletions src/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ else:
# g++ options
env.PrependUnique(CCFLAGS=['-Wall'])
fast_optimflags = ['-ffast-math']
if env.get('arch'):
fast_optimflags.append('-march=' + env['arch'])

# Configure build variants
if env['build'] == 'debug':
Expand Down
Loading