libint: factored parts of configure_args into their own functions (#4211)

* libint: factored parts of configure_args into their own functions

* libint: added -xSSE2, as suggested by @lee218llnl
This commit is contained in:
Massimiliano Culpo 2017-07-05 16:19:39 +02:00 committed by Adam J. Stewart
parent e3bd6e3d93
commit f403117f71

View file

@ -61,19 +61,31 @@ def autoreconf(self, spec, prefix):
aclocal('-I', 'lib/autoconf') aclocal('-I', 'lib/autoconf')
autoconf() autoconf()
@property
def optflags(self):
flags = '-O2'
# Optimizations for the Intel compiler, suggested by CP2K
if '%intel' in self.spec:
# -xSSE2 will make it usable on old architecture
flags += ' -xSSE2 -xAVX -axCORE-AVX2 -ipo'
return flags
def setup_environment(self, build_env, run_env):
# Set optimization flags
build_env.set('CFLAGS', self.optflags)
build_env.set('CXXFLAGS', self.optflags)
# Change AR to xiar if we compile with Intel and we
# find the executable
if '%intel' in self.spec and which('xiar'):
build_env.set('AR', 'xiar')
def configure_args(self): def configure_args(self):
config_args = ['--enable-shared'] config_args = ['--enable-shared']
optflags = self.optflags
# Optimizations for the Intel compiler, suggested by CP2K
optflags = '-O2'
if self.compiler.name == 'intel':
optflags += ' -xAVX -axCORE-AVX2 -ipo'
if which('xiar'):
env['AR'] = 'xiar'
env['CFLAGS'] = optflags
env['CXXFLAGS'] = optflags
# Optimization flag names have changed in libint 2 # Optimization flag names have changed in libint 2
if self.version < Version('2.0.0'): if self.version < Version('2.0.0'):