summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorDr Owain Kenway <o.kenway@ucl.ac.uk>2020-07-11 15:02:53 +0100
committerGitHub <noreply@github.com>2020-07-11 09:02:53 -0500
commit9629f571bcec423133d4951be2ed474049116704 (patch)
tree9fce2e7ed586ed8c8f093c3dce13d68c6af7e301 /var
parent5e50dc5acb64d47ac3bd89d60f1353efce5ff084 (diff)
downloadspack-9629f571bcec423133d4951be2ed474049116704.tar.gz
spack-9629f571bcec423133d4951be2ed474049116704.tar.bz2
spack-9629f571bcec423133d4951be2ed474049116704.tar.xz
spack-9629f571bcec423133d4951be2ed474049116704.zip
llvm-flang: Only build offload code if cuda enabled (#17466)
* llvm-flang Only build offload code if cuda enabled The current version executes `cmake(*args)` always as part of the post install. If device offload is not part of the build, this results in referencing `args` without it being set and the error: ``` ==> Error: UnboundLocalError: local variable 'args' referenced before assignment ``` Looking at prevoous version of `llvm-package.py` this whole routine appears to be only required for offload, some indent `cmake/make/install` to be under the `if`. * Update package.py Add comment
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/llvm-flang/package.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/var/spack/repos/builtin/packages/llvm-flang/package.py b/var/spack/repos/builtin/packages/llvm-flang/package.py
index 10001e2340..99948fd76f 100644
--- a/var/spack/repos/builtin/packages/llvm-flang/package.py
+++ b/var/spack/repos/builtin/packages/llvm-flang/package.py
@@ -238,6 +238,7 @@ class LlvmFlang(CMakePackage, CudaPackage):
spec['libelf'].prefix.include,
spec['hwloc'].prefix.include))
- cmake(*args)
- make()
- make('install')
+ # Only build if offload target.
+ cmake(*args)
+ make()
+ make('install')