summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDr Owain Kenway <o.kenway@ucl.ac.uk>2020-07-11 15:02:53 +0100
committerGregory Becker <becker33@llnl.gov>2020-07-23 13:51:35 -0700
commite4265d31352ce6f6c23a732829c47bc768a1c79a (patch)
tree38b339c2739970c279c0d64347409f857fa3e8aa
parent5e5cc991470475d77c2ad6dda2a7cc288e00bafe (diff)
downloadspack-e4265d31352ce6f6c23a732829c47bc768a1c79a.tar.gz
spack-e4265d31352ce6f6c23a732829c47bc768a1c79a.tar.bz2
spack-e4265d31352ce6f6c23a732829c47bc768a1c79a.tar.xz
spack-e4265d31352ce6f6c23a732829c47bc768a1c79a.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
-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')