Skip to content

Commit

Permalink
Merge pull request #173 from opesci/gnu-compiler-sse
Browse files Browse the repository at this point in the history
Compiler: Adding `march=native` to `GNU/CustomCompiler` to enable SSE
  • Loading branch information
Michael Lange authored Jan 19, 2017
2 parents 680d5a0 + ea05157 commit 4a8c0bd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions devito/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def __init__(self, *args, **kwargs):
self.version = kwargs.get('version', None)
self.cc = 'gcc' if self.version is None else 'gcc-%s' % self.version
self.ld = 'gcc' if self.version is None else 'gcc-%s' % self.version
self.cflags = ['-O3', '-g', '-fPIC', '-Wall', '-std=c99']
self.cflags = ['-O3', '-g', '-march=native', '-fPIC', '-Wall', '-std=c99']
self.ldflags = ['-shared']

if self.openmp:
Expand Down Expand Up @@ -173,7 +173,8 @@ def __init__(self, *args, **kwargs):
super(CustomCompiler, self).__init__(*args, **kwargs)
self.cc = environ.get('CC', 'gcc')
self.ld = environ.get('LD', 'gcc')
self.cflags = environ.get('CFLAGS', '-O3 -g -fPIC -Wall -std=c99').split(' ')
default = '-O3 -g -march=native -fPIC -Wall -std=c99'
self.cflags = environ.get('CFLAGS', default).split(' ')
self.ldflags = environ.get('LDFLAGS', '-shared').split(' ')

if self.openmp:
Expand Down

0 comments on commit 4a8c0bd

Please sign in to comment.