diff --git a/var/spack/repos/builtin/packages/pythia8/package.py b/var/spack/repos/builtin/packages/pythia8/package.py index 22cbb2c9490..9c4ca7c3a8e 100644 --- a/var/spack/repos/builtin/packages/pythia8/package.py +++ b/var/spack/repos/builtin/packages/pythia8/package.py @@ -179,7 +179,9 @@ def configure_args(self): args.append("--with-yoda=" + self.spec["yoda"].prefix) args += self.with_or_without("python", activation_value="prefix") - args += self.with_or_without("openmp", activation_value="prefix", variant="openmpi") + args += self.with_or_without( + "openmp", activation_value=lambda x: self.spec["openmpi"].prefix, variant="openmpi" + ) args += self.with_or_without("mpich", activation_value="prefix") args += self.with_or_without("hdf5", activation_value="prefix")