Modification to R environment (#23623)

* Modification to R environment

This PR modifies how the R environmnet is presented, and fixes
installing the standalone Rmath library.

- The Rmath build and install methods are combined into one
- Set parallel=False when installing Rmath
- remove the run environment that set up variables for libraries and
  headers that are not really needed, and pollute the environment.

* Add setup_run_environment back

- Add back the setup_run_environment with LD_LIBRARY_PATH and
  PKG_CONFIG_PATH.
- Adjust documentation to reflect the current code.
This commit is contained in:
Glenn Johnson 2021-05-21 02:34:15 -05:00 committed by GitHub
parent 3dfb61116d
commit 71b9e67b3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 13 deletions

View File

@ -130,9 +130,8 @@ list of environment modifications.
to the corresponding environment variables: to the corresponding environment variables:
================== ================================= ================== =================================
LIBRARY_PATH ``self.prefix/rlib/R/lib``
LD_LIBRARY_PATH ``self.prefix/rlib/R/lib`` LD_LIBRARY_PATH ``self.prefix/rlib/R/lib``
CPATH ``self.prefix/rlib/R/include`` PKG_CONFIG_PATH ``self.prefix/rlib/pkgconfig``
================== ================================= ================== =================================
with the following snippet: with the following snippet:

View File

@ -109,17 +109,12 @@ def url_for_version(self, version):
def etcdir(self): def etcdir(self):
return join_path(prefix, 'rlib', 'R', 'etc') return join_path(prefix, 'rlib', 'R', 'etc')
@run_after('build')
def build_rmath(self):
if '+rmath' in self.spec:
with working_dir('src/nmath/standalone'):
make()
@run_after('install') @run_after('install')
def install_rmath(self): def install_rmath(self):
if '+rmath' in self.spec: if '+rmath' in self.spec:
with working_dir('src/nmath/standalone'): with working_dir('src/nmath/standalone'):
make('install') make()
make('install', parallel=False)
def configure_args(self): def configure_args(self):
spec = self.spec spec = self.spec
@ -225,12 +220,14 @@ def setup_dependent_run_environment(self, env, dependent_spec):
dependent_spec.prefix, self.r_lib_dir)) dependent_spec.prefix, self.r_lib_dir))
def setup_run_environment(self, env): def setup_run_environment(self, env):
env.prepend_path('LIBRARY_PATH',
join_path(self.prefix, 'rlib', 'R', 'lib'))
env.prepend_path('LD_LIBRARY_PATH', env.prepend_path('LD_LIBRARY_PATH',
join_path(self.prefix, 'rlib', 'R', 'lib')) join_path(self.prefix, 'rlib', 'R', 'lib'))
env.prepend_path('CPATH', env.prepend_path('PKG_CONFIG_PATH',
join_path(self.prefix, 'rlib', 'R', 'include')) join_path(self.prefix, 'rlib', 'pkgconfig'))
if '+rmath' in self.spec:
env.prepend_path('LD_LIBRARY_PATH',
join_path(self.prefix, 'rlib'))
def setup_dependent_package(self, module, dependent_spec): def setup_dependent_package(self, module, dependent_spec):
"""Called before R modules' install() methods. In most cases, """Called before R modules' install() methods. In most cases,