From 4b767b83a9d742483a9ef788c835aea4357e79c4 Mon Sep 17 00:00:00 2001 From: Geoffrey Oxberry Date: Tue, 27 Aug 2019 05:00:40 -0700 Subject: raja~openmp: explicitly disable OpenMP in CMake (#12572) Before this commit, CMake would still attempt to detect OpenMP, even if RAJA were being installed with `spack install raja~openmp`, because the option `ENABLE_OPENMP` is set to "On" by default. This commit explicitly disables OpenMP when the Spack install spec contains '~openmp`, ensuring that CMake does not attempt to detect and link with OpenMP. --- var/spack/repos/builtin/packages/raja/package.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/var/spack/repos/builtin/packages/raja/package.py b/var/spack/repos/builtin/packages/raja/package.py index 9ccd80f11f..4eb7dcbd1e 100644 --- a/var/spack/repos/builtin/packages/raja/package.py +++ b/var/spack/repos/builtin/packages/raja/package.py @@ -36,10 +36,8 @@ class Raja(CMakePackage): spec = self.spec options = [] - - if '+openmp' in spec: - options.extend([ - '-DENABLE_OPENMP=On']) + options.append('-DENABLE_OPENMP={0}'.format( + 'On' if '+openmp' in spec else 'Off')) if '+cuda' in spec: options.extend([ -- cgit v1.2.3-60-g2f50