From 9a8c4cf071a760e3a86d5bfa7d32d5ab8dcf0629 Mon Sep 17 00:00:00 2001
From: fcannini <fcannini@gmail.com>
Date: Wed, 20 Mar 2019 00:54:03 -0300
Subject: [PATCH] gromacs: make sure cuda support is disabled when cuda=False
 (#10936)

* abinit: Fix building with hdf5/netcdf.

* gromacs: Fix attempt to build with cuda support when 'cuda=False'

If for some reason there's a cuda toolkit installed by other means,
(i.e. not by spack) cmake will still try to build with cuda support,
even though 'cuda=False' is the default of the spec.

* Revert "abinit: Fix building with hdf5/netcdf."

This reverts commit e16f725e37b91193fe519b1821446c76ab551928.

This should not be here.
---
 var/spack/repos/builtin/packages/gromacs/package.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/var/spack/repos/builtin/packages/gromacs/package.py b/var/spack/repos/builtin/packages/gromacs/package.py
index 6476f32dcd..6709505537 100644
--- a/var/spack/repos/builtin/packages/gromacs/package.py
+++ b/var/spack/repos/builtin/packages/gromacs/package.py
@@ -87,6 +87,8 @@ def cmake_args(self):
             options.append('-DGMX_GPU:BOOL=ON')
             options.append('-DCUDA_TOOLKIT_ROOT_DIR:STRING=' +
                            self.spec['cuda'].prefix)
+        else:
+            options.append('-DGMX_GPU:BOOL=OFF')
 
         simd_value = self.spec.variants['simd'].value
         if simd_value == 'auto':
-- 
GitLab