From f9137f606f68392cca56bd19810c3c86addbae7a Mon Sep 17 00:00:00 2001 From: Glenn Johnson Date: Wed, 20 Jul 2016 15:37:31 -0500 Subject: [PATCH 1/2] Set environment variables This commit adds `setup_environment` to export the libraries and headers. Fixes #1314. --- var/spack/repos/builtin/packages/R/package.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/var/spack/repos/builtin/packages/R/package.py b/var/spack/repos/builtin/packages/R/package.py index 11c5909efa..5e7c8492f6 100644 --- a/var/spack/repos/builtin/packages/R/package.py +++ b/var/spack/repos/builtin/packages/R/package.py @@ -136,6 +136,14 @@ def setup_dependent_environment(self, spack_env, run_env, extension_spec): run_env.prepend_path('R_LIBS', os.path.join( extension_spec.prefix, self.r_lib_dir)) + def setup_environment(self, spack_env, run_env): + run_env.prepend_path('LIBRARY_PATH', + join_path(self.prefix, 'rlib', 'R', 'lib')) + run_env.prepend_path('LD_LIBRARY_PATH', + join_path(self.prefix, 'rlib', 'R', 'lib')) + run_env.prepend_path('CPATH', + join_path(self.prefix, 'rlib', 'R', 'include')) + def setup_dependent_package(self, module, ext_spec): """Called before R modules' install() methods. In most cases, extensions will only need to have one line: From 0c75174ec323757400e9095e1cb9fa66e557a723 Mon Sep 17 00:00:00 2001 From: Glenn Johnson Date: Wed, 20 Jul 2016 15:56:20 -0500 Subject: [PATCH 2/2] Fix indent/flake8 error. --- var/spack/repos/builtin/packages/R/package.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/var/spack/repos/builtin/packages/R/package.py b/var/spack/repos/builtin/packages/R/package.py index 5e7c8492f6..ad06c2ca48 100644 --- a/var/spack/repos/builtin/packages/R/package.py +++ b/var/spack/repos/builtin/packages/R/package.py @@ -138,11 +138,11 @@ def setup_dependent_environment(self, spack_env, run_env, extension_spec): def setup_environment(self, spack_env, run_env): run_env.prepend_path('LIBRARY_PATH', - join_path(self.prefix, 'rlib', 'R', 'lib')) + join_path(self.prefix, 'rlib', 'R', 'lib')) run_env.prepend_path('LD_LIBRARY_PATH', - join_path(self.prefix, 'rlib', 'R', 'lib')) + join_path(self.prefix, 'rlib', 'R', 'lib')) run_env.prepend_path('CPATH', - join_path(self.prefix, 'rlib', 'R', 'include')) + join_path(self.prefix, 'rlib', 'R', 'include')) def setup_dependent_package(self, module, ext_spec): """Called before R modules' install() methods. In most cases,