diff --git a/var/spack/repos/builtin/packages/gsl/package.py b/var/spack/repos/builtin/packages/gsl/package.py index 21d7bd63716..dd5bad19cd8 100644 --- a/var/spack/repos/builtin/packages/gsl/package.py +++ b/var/spack/repos/builtin/packages/gsl/package.py @@ -55,3 +55,8 @@ def configure_args(self): configure_args.append("CBLAS_LIBS=%s" % self.spec["blas"].libs.ld_flags) return configure_args + + def setup_run_environment(self, env): + # cmake looks for GSL_ROOT_DIR to find GSL so this helps pick the spack one + # when there are multiple installations (e.g. a system one and a spack one) + env.set("GSL_ROOT_DIR", self.prefix)