summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/r/package.py28
1 files changed, 21 insertions, 7 deletions
diff --git a/var/spack/repos/builtin/packages/r/package.py b/var/spack/repos/builtin/packages/r/package.py
index 9dd9337607..eb5a6f4a8f 100644
--- a/var/spack/repos/builtin/packages/r/package.py
+++ b/var/spack/repos/builtin/packages/r/package.py
@@ -4,6 +4,7 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
+import re
from spack import *
@@ -70,9 +71,10 @@ class R(AutotoolsPackage):
depends_on('pango~X', when='~X')
depends_on('freetype')
depends_on('tcl')
- depends_on('tk')
+ depends_on('tk', when='+X')
depends_on('libx11', when='+X')
depends_on('libxt', when='+X')
+ depends_on('libxmu', when='+X')
depends_on('curl')
depends_on('pcre')
depends_on('java')
@@ -92,7 +94,6 @@ class R(AutotoolsPackage):
prefix = self.prefix
tcl_config_path = join_path(spec['tcl'].prefix.lib, 'tclConfig.sh')
- tk_config_path = join_path(spec['tk'].prefix.lib, 'tkConfig.sh')
config_args = [
'--libdir={0}'.format(join_path(prefix, 'rlib')),
@@ -100,14 +101,27 @@ class R(AutotoolsPackage):
'--enable-BLAS-shlib',
'--enable-R-framework=no',
'--with-tcl-config={0}'.format(tcl_config_path),
- '--with-tk-config={0}'.format(tk_config_path),
+ 'LDFLAGS=-L{0} -Wl,-rpath,{0}'.format(join_path(prefix, 'rlib',
+ 'R', 'lib')),
]
+ if '^tk' in spec:
+ tk_config_path = join_path(spec['tk'].prefix.lib, 'tkConfig.sh')
+ config_args.append('--with-tk-config={0}'.format(tk_config_path))
if '+external-lapack' in spec:
- config_args.extend([
- '--with-blas={0}'.format(spec['blas'].libs),
- '--with-lapack'
- ])
+ if '^mkl' in spec and 'gfortran' in self.compiler.fc:
+ mkl_re = re.compile(r'(mkl_)intel(_i?lp64\b)')
+ config_args.extend([
+ mkl_re.sub(r'\g<1>gf\g<2>',
+ '--with-blas={0}'.format(
+ spec['blas'].libs.ld_flags)),
+ '--with-lapack'
+ ])
+ else:
+ config_args.extend([
+ '--with-blas={0}'.format(spec['blas'].libs.ld_flags),
+ '--with-lapack'
+ ])
if '+X' in spec:
config_args.append('--with-x')