Merge pull request #698 from UCL-RITS/espresso
Fixes install issues on OS/X for Quantum Espresso
This commit is contained in:
commit
0840ffa3dd
@ -24,7 +24,7 @@ class Espresso(Package):
|
|||||||
depends_on('fftw~mpi', when='~mpi')
|
depends_on('fftw~mpi', when='~mpi')
|
||||||
depends_on('fftw+mpi', when='+mpi')
|
depends_on('fftw+mpi', when='+mpi')
|
||||||
depends_on('scalapack', when='+scalapack+mpi') # TODO : + mpi needed to avoid false dependencies installation
|
depends_on('scalapack', when='+scalapack+mpi') # TODO : + mpi needed to avoid false dependencies installation
|
||||||
|
|
||||||
def check_variants(self, spec):
|
def check_variants(self, spec):
|
||||||
error = 'you cannot ask for \'+{variant}\' when \'+mpi\' is not active'
|
error = 'you cannot ask for \'+{variant}\' when \'+mpi\' is not active'
|
||||||
if '+scalapack' in spec and '~mpi' in spec:
|
if '+scalapack' in spec and '~mpi' in spec:
|
||||||
@ -32,14 +32,11 @@ def check_variants(self, spec):
|
|||||||
if '+elpa' in spec and ('~mpi' in spec or '~scalapack' in spec):
|
if '+elpa' in spec and ('~mpi' in spec or '~scalapack' in spec):
|
||||||
raise RuntimeError(error.format(variant='elpa'))
|
raise RuntimeError(error.format(variant='elpa'))
|
||||||
|
|
||||||
def setup_environment(self, spack_env, run_env):
|
|
||||||
# Espresso copies every executable in prefix without creating sub-folders
|
|
||||||
run_env.prepend_path('PATH', self.prefix)
|
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
|
from glob import glob
|
||||||
self.check_variants(spec)
|
self.check_variants(spec)
|
||||||
|
|
||||||
options = ['-prefix=%s' % prefix]
|
options = ['-prefix=%s' % prefix.bin]
|
||||||
|
|
||||||
if '+mpi' in spec:
|
if '+mpi' in spec:
|
||||||
options.append('--enable-parallel')
|
options.append('--enable-parallel')
|
||||||
@ -65,5 +62,11 @@ def install(self, spec, prefix):
|
|||||||
|
|
||||||
configure(*options)
|
configure(*options)
|
||||||
make('all')
|
make('all')
|
||||||
make('install')
|
|
||||||
|
if spec.architecture.startswith('darwin'):
|
||||||
|
mkdirp(prefix.bin)
|
||||||
|
for filename in glob("bin/*.x"):
|
||||||
|
install(filename, prefix.bin)
|
||||||
|
else:
|
||||||
|
make('install')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user