summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorNichols A. Romero <naromero77@users.noreply.github.com>2020-06-24 02:52:27 -0500
committerGitHub <noreply@github.com>2020-06-24 09:52:27 +0200
commit4c055630d545d3ec9c919d20485f6f85f8f8d6b3 (patch)
tree20caf79dad5723c31c96425dac1fe1461359306b /var
parentfd710fc93eee64e3ecd432d902a8bb6b61354451 (diff)
downloadspack-4c055630d545d3ec9c919d20485f6f85f8f8d6b3.tar.gz
spack-4c055630d545d3ec9c919d20485f6f85f8f8d6b3.tar.bz2
spack-4c055630d545d3ec9c919d20485f6f85f8f8d6b3.tar.xz
spack-4c055630d545d3ec9c919d20485f6f85f8f8d6b3.zip
quantum-espresso: correctly cross-compile code for Cray and BG/Q (#17180)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/quantum-espresso/package.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/quantum-espresso/package.py b/var/spack/repos/builtin/packages/quantum-espresso/package.py
index 3c8b2c9d02..35454ae3ef 100644
--- a/var/spack/repos/builtin/packages/quantum-espresso/package.py
+++ b/var/spack/repos/builtin/packages/quantum-espresso/package.py
@@ -224,6 +224,19 @@ class QuantumEspresso(Package):
prefix_path = prefix.bin if '@:5.4.0' in spec else prefix
options = ['-prefix={0}'.format(prefix_path)]
+ # This additional flag is needed anytime the target architecture
+ # does not match the host architecture, which results in a binary that
+ # configure cannot execute on the login node. This is how we detect
+ # cross compilation: If the platform is NOT either Linux or Darwin
+ # and the target=backend, that we are in the cross-compile scenario
+ # scenario. This should cover Cray, BG/Q, and other custom platforms.
+ # The other option is to list out all the platform where you would be
+ # cross compiling explicitly.
+ if not (spec.satisfies('platform=linux') or
+ spec.satisfies('platform=darwin')):
+ if spec.satisfies('target=backend'):
+ options.append('--host')
+
# QE autoconf compiler variables has some limitations:
# 1. There is no explicit MPICC variable so we must re-purpose
# CC for the case of MPI.