diff options
author | Christoph Junghans <junghans@lanl.gov> | 2019-12-08 08:03:59 -0700 |
---|---|---|
committer | Adam J. Stewart <ajstewart426@gmail.com> | 2019-12-08 09:03:59 -0600 |
commit | 16a61d1422efa940c8fb6474d39c1ad2a28be924 (patch) | |
tree | 960649f85da612fd898e7a1935fe208202a474a4 /var | |
parent | 4e24c4ca5f6c26b04c0888a1fa7219d82d61f8e6 (diff) | |
download | spack-16a61d1422efa940c8fb6474d39c1ad2a28be924.tar.gz spack-16a61d1422efa940c8fb6474d39c1ad2a28be924.tar.bz2 spack-16a61d1422efa940c8fb6474d39c1ad2a28be924.tar.xz spack-16a61d1422efa940c8fb6474d39c1ad2a28be924.zip |
elpa: port to microarch (#13655)
* elpa: port to microarch
* flake8
* Update package.py
* Update var/spack/repos/builtin/packages/elpa/package.py
Co-Authored-By: Adam J. Stewart <ajstewart426@gmail.com>
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/elpa/package.py | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/var/spack/repos/builtin/packages/elpa/package.py b/var/spack/repos/builtin/packages/elpa/package.py index bda2d7c441..f0d101199b 100644 --- a/var/spack/repos/builtin/packages/elpa/package.py +++ b/var/spack/repos/builtin/packages/elpa/package.py @@ -62,32 +62,40 @@ class Elpa(AutotoolsPackage): build_directory = 'spack-build' - def setup_build_environment(self, env): + def configure_args(self): spec = self.spec + options = [] - env.set('CC', spec['mpi'].mpicc) - env.set('FC', spec['mpi'].mpifc) - env.set('CXX', spec['mpi'].mpicxx) + # TODO: add --enable-gpu, --disable-sse-assembly, --enable-sparc64 + # and --enable-neon-arch64 + simd_features = ['vsx', 'sse', 'avx', 'avx2', 'avx512', 'bgp', 'bgq'] - env.append_flags('LDFLAGS', spec['lapack'].libs.search_flags) - env.append_flags('LIBS', spec['lapack'].libs.link_flags) - env.set('SCALAPACK_LDFLAGS', spec['scalapack'].libs.joined()) + for feature in simd_features: + msg = '--enable-{0}' if feature in spec.target else '--disable-{0}' + options.append(msg.format(feature)) - def configure_args(self): - # TODO: set optimum flags for platform+compiler combo, see - # https://github.com/hfp/xconfigure/tree/master/elpa - # also see: - # https://src.fedoraproject.org/cgit/rpms/elpa.git/ - # https://packages.qa.debian.org/e/elpa.html - options = [] - # without -march=native there is configure error for 2017.05.02 - # Could not compile test program, try with --disable-sse, or - # adjust the C compiler or CFLAGS - if '+optflags' in self.spec: + # If no features are found, enable the generic ones + if not any(f in spec.target for f in simd_features): + options.append('--enable-generic') + + if '+optflags' in spec: options.extend([ 'FCFLAGS=-O2 -ffree-line-length-none', 'CFLAGS=-O2' ]) - if '+openmp' in self.spec: + + if '+openmp' in spec: options.append('--enable-openmp') + else: + options.append('--disable-openmp') + + options.extend([ + 'CC={0}'.format(spec['mpi'].mpicc), + 'FC={0}'.format(spec['mpi'].mpifc), + 'CXX={0}'.format(spec['mpi'].mpicxx), + 'LDFLAGS={0}'.format(spec['lapack'].libs.search_flags), + 'LIBS={0}'.format(spec['lapack'].libs.link_flags), + 'SCALAPACK_LDFLAGS={0}'.format(spec['scalapack'].libs.joined()) + ]) + return options |