Use new-ish blas_shared_lib and more flake8 fixes
This commit is contained in:
parent
e2e72b14b2
commit
d7020434d9
@ -22,8 +22,8 @@
|
|||||||
# License along with this program; if not, write to the Free Software
|
# License along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
##############################################################################
|
##############################################################################
|
||||||
from spack import *
|
|
||||||
import spack
|
import spack
|
||||||
|
from spack import *
|
||||||
|
|
||||||
|
|
||||||
class Elk(Package):
|
class Elk(Package):
|
||||||
@ -36,14 +36,20 @@ class Elk(Package):
|
|||||||
version('3.3.17', 'f57f6230d14f3b3b558e5c71f62f0592')
|
version('3.3.17', 'f57f6230d14f3b3b558e5c71f62f0592')
|
||||||
|
|
||||||
# Elk provides these libraries, but allows you to specify your own
|
# Elk provides these libraries, but allows you to specify your own
|
||||||
variant('blas', default=True, description='Build with custom BLAS library')
|
variant('blas', default=True,
|
||||||
variant('lapack', default=True, description='Build with custom LAPACK library')
|
description='Build with custom BLAS library')
|
||||||
variant('fft', default=True, description='Build with custom FFT library')
|
variant('lapack', default=True,
|
||||||
|
description='Build with custom LAPACK library')
|
||||||
|
variant('fft', default=True,
|
||||||
|
description='Build with custom FFT library')
|
||||||
|
|
||||||
# Elk does not provide these libraries, but allows you to use them
|
# Elk does not provide these libraries, but allows you to use them
|
||||||
variant('mpi', default=True, description='Enable MPI parallelism')
|
variant('mpi', default=True,
|
||||||
variant('openmp', default=True, description='Enable OpenMP support')
|
description='Enable MPI parallelism')
|
||||||
variant('libxc', default=True, description='Link to Libxc functional library')
|
variant('openmp', default=True,
|
||||||
|
description='Enable OpenMP support')
|
||||||
|
variant('libxc', default=True,
|
||||||
|
description='Link to Libxc functional library')
|
||||||
|
|
||||||
depends_on('blas', when='+blas')
|
depends_on('blas', when='+blas')
|
||||||
depends_on('lapack', when='+lapack')
|
depends_on('lapack', when='+lapack')
|
||||||
@ -54,17 +60,16 @@ class Elk(Package):
|
|||||||
# Cannot be built in parallel
|
# Cannot be built in parallel
|
||||||
parallel = False
|
parallel = False
|
||||||
|
|
||||||
|
|
||||||
def configure(self, spec):
|
def configure(self, spec):
|
||||||
# Dictionary of configuration options
|
# Dictionary of configuration options
|
||||||
config = {
|
config = {
|
||||||
'MAKE': 'make',
|
'MAKE': 'make',
|
||||||
'AR': 'ar'
|
'AR': 'ar'
|
||||||
}
|
}
|
||||||
|
|
||||||
# Compiler-specific flags
|
# Compiler-specific flags
|
||||||
flags = ''
|
flags = ''
|
||||||
if self.compiler.name == 'intel':
|
if self.compiler.name == 'intel':
|
||||||
flags = '-O3 -ip -unroll -no-prec-div'
|
flags = '-O3 -ip -unroll -no-prec-div'
|
||||||
elif self.compiler.name == 'gcc':
|
elif self.compiler.name == 'gcc':
|
||||||
flags = '-O3 -ffast-math -funroll-loops'
|
flags = '-O3 -ffast-math -funroll-loops'
|
||||||
@ -84,15 +89,17 @@ def configure(self, spec):
|
|||||||
# if the +openmp variant is chosen
|
# if the +openmp variant is chosen
|
||||||
blas = 'blas.a'
|
blas = 'blas.a'
|
||||||
lapack = 'lapack.a'
|
lapack = 'lapack.a'
|
||||||
if '+blas' in spec:
|
if '+blas' in spec:
|
||||||
blas = join_path(spec['blas'].prefix.lib, 'libblas.so')
|
blas = spec['blas'].blas_shared_lib
|
||||||
if '+lapack' in spec:
|
if '+lapack' in spec:
|
||||||
lapack = join_path(spec['lapack'].prefix.lib, 'liblapack.so')
|
lapack = spec['lapack'].lapack_shared_lib
|
||||||
config['LIB_LPK'] = ' '.join([lapack, blas]) # lapack must come before blas
|
# lapack must come before blas
|
||||||
|
config['LIB_LPK'] = ' '.join([lapack, blas])
|
||||||
|
|
||||||
# FFT support
|
# FFT support
|
||||||
if '+fft' in spec:
|
if '+fft' in spec:
|
||||||
config['LIB_FFT'] = join_path(spec['fftw'].prefix.lib, 'libfftw3.so')
|
config['LIB_FFT'] = join_path(spec['fftw'].prefix.lib,
|
||||||
|
'libfftw3.so')
|
||||||
config['SRC_FFT'] = 'zfftifc_fftw.f90'
|
config['SRC_FFT'] = 'zfftifc_fftw.f90'
|
||||||
else:
|
else:
|
||||||
config['LIB_FFT'] = 'fftlib.a'
|
config['LIB_FFT'] = 'fftlib.a'
|
||||||
@ -100,8 +107,8 @@ def configure(self, spec):
|
|||||||
|
|
||||||
# MPI support
|
# MPI support
|
||||||
if '+mpi' in spec:
|
if '+mpi' in spec:
|
||||||
config['F90'] = join_path(spec['mpi'].mpifc)
|
config['F90'] = spec['mpi'].mpifc
|
||||||
config['F77'] = join_path(spec['mpi'].mpif77)
|
config['F77'] = spec['mpi'].mpif77
|
||||||
else:
|
else:
|
||||||
config['F90'] = join_path(spack.build_env_path, 'f90'),
|
config['F90'] = join_path(spack.build_env_path, 'f90'),
|
||||||
config['F77'] = join_path(spack.build_env_path, 'f77'),
|
config['F77'] = join_path(spack.build_env_path, 'f77'),
|
||||||
@ -133,7 +140,6 @@ def configure(self, spec):
|
|||||||
for key in config:
|
for key in config:
|
||||||
inc.write('{0} = {1}\n'.format(key, config[key]))
|
inc.write('{0} = {1}\n'.format(key, config[key]))
|
||||||
|
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
# Elk only provides an interactive setup script
|
# Elk only provides an interactive setup script
|
||||||
self.configure(spec)
|
self.configure(spec)
|
||||||
|
Loading…
Reference in New Issue
Block a user