From 397e0d1368d8f6077cb7ea59ee953b993ef3d244 Mon Sep 17 00:00:00 2001 From: Mayeul d'Avezac Date: Thu, 31 Mar 2016 10:12:20 +0100 Subject: Fixes #454 in a simpler way than 34a8f0c Rather than mess with the environment, have espresso install into the right directory (prefix/bin). --- var/spack/repos/builtin/packages/espresso/package.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/var/spack/repos/builtin/packages/espresso/package.py b/var/spack/repos/builtin/packages/espresso/package.py index 59f362ab46..167bb38e38 100644 --- a/var/spack/repos/builtin/packages/espresso/package.py +++ b/var/spack/repos/builtin/packages/espresso/package.py @@ -24,7 +24,7 @@ class Espresso(Package): 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 - + def check_variants(self, spec): error = 'you cannot ask for \'+{variant}\' when \'+mpi\' is not active' if '+scalapack' in spec and '~mpi' in spec: @@ -32,14 +32,10 @@ class Espresso(Package): if '+elpa' in spec and ('~mpi' in spec or '~scalapack' in spec): 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): self.check_variants(spec) - options = ['-prefix=%s' % prefix] + options = ['-prefix=%s' % prefix.bin] if '+mpi' in spec: options.append('--enable-parallel') -- cgit v1.2.3-70-g09d2 From 7430f9142fc3fc590232a21a193321be9de33df7 Mon Sep 17 00:00:00 2001 From: Mayeul d'Avezac Date: Thu, 31 Mar 2016 10:16:40 +0100 Subject: Can install espresso on OS/X Espresso uses unix utility `find dir -name \*.x` to determine the executable to install. On OS/X, it also finds a bunch of debug symbols associated with the exectuble. These files have the same name, but are in a different directory. So the install process is done by hand in the package.py file, for OS/X. --- var/spack/repos/builtin/packages/espresso/package.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/espresso/package.py b/var/spack/repos/builtin/packages/espresso/package.py index 167bb38e38..0dad57a9f6 100644 --- a/var/spack/repos/builtin/packages/espresso/package.py +++ b/var/spack/repos/builtin/packages/espresso/package.py @@ -33,6 +33,7 @@ class Espresso(Package): raise RuntimeError(error.format(variant='elpa')) def install(self, spec, prefix): + from glob import glob self.check_variants(spec) options = ['-prefix=%s' % prefix.bin] @@ -61,5 +62,11 @@ class Espresso(Package): configure(*options) 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') -- cgit v1.2.3-70-g09d2