summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@googlemail.com>2017-07-05 16:19:39 +0200
committerAdam J. Stewart <ajstewart426@gmail.com>2017-07-05 09:19:39 -0500
commitf403117f7152b97068188edaedee09d979d4b4c5 (patch)
treef8a9a0792318894139c50d5060f9f8a4a3720519
parente3bd6e3d930a58bb65a4bd4c00d5ac4f7e58d5b5 (diff)
downloadspack-f403117f7152b97068188edaedee09d979d4b4c5.tar.gz
spack-f403117f7152b97068188edaedee09d979d4b4c5.tar.bz2
spack-f403117f7152b97068188edaedee09d979d4b4c5.tar.xz
spack-f403117f7152b97068188edaedee09d979d4b4c5.zip
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
-rw-r--r--var/spack/repos/builtin/packages/libint/package.py32
1 files changed, 22 insertions, 10 deletions
diff --git a/var/spack/repos/builtin/packages/libint/package.py b/var/spack/repos/builtin/packages/libint/package.py
index 3853d2c57f..d267a8ea88 100644
--- a/var/spack/repos/builtin/packages/libint/package.py
+++ b/var/spack/repos/builtin/packages/libint/package.py
@@ -61,19 +61,31 @@ class Libint(AutotoolsPackage):
aclocal('-I', 'lib/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):
config_args = ['--enable-shared']
-
- # 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
+ optflags = self.optflags
# Optimization flag names have changed in libint 2
if self.version < Version('2.0.0'):