Skip to content

correctly configure R for BLAS/LAPACK & check configure output#1292

Merged
wpoely86 merged 2 commits intoeasybuilders:developfrom
boegel:R_BLAS_LAPACK
Nov 21, 2017
Merged

correctly configure R for BLAS/LAPACK & check configure output#1292
wpoely86 merged 2 commits intoeasybuilders:developfrom
boegel:R_BLAS_LAPACK

Conversation

@boegel
Copy link
Copy Markdown
Member

@boegel boegel commented Nov 21, 2017

R is currently not being configured correctly, see easybuilders/easybuild-easyconfigs#1435 and also easybuilders/easybuild-easyconfigs#4773.

If LAPACK_LIBS is defined in preconfigopts, R reports that LAPACK is being built generic, which seems wrong (although it may be OK for LAPACK, since there are no tuned LAPACK libraries, all the tuning is done in the BLAS library afaik).

This change only defines $BLAS_LIBS in the environment, and checks the output of the configure command to make sure that BLAS/LAPACK is i) used, ii) correctly configured (i.e. no generic).

The R easyconfigs (in particular the recent easybuilders/easybuild-easyconfigs#5090 and easybuilders/easybuild-easyconfigs#5360) will need to be modified as well, since they now hard set LAPACK_LIBS via preconfigopts, which leads to LAPACK(generic) being reported.

That's a bit of a catch-22 situation though, since removing preconfigpts part and not including --with-blas --with-lapack in the easyconfig files requires that this updated easyblock is used, otherwise R gets (sliently) built without BLAS/LAPACK...

@boegel boegel added this to the 3.5.0 milestone Nov 21, 2017
if root:
dep_config = os.path.join(root, 'lib', '%sConfig.sh' % dep.lower())
self.cfg.update('configopts', '-with-%s-config=%s' % (dep.lower(), dep_config))
self.cfg.update('configopts', '--with-%s-config=%s' % (dep.lower(), dep_config))
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nasty typo here, this went undetected because the existing R easyconfigs already include --with-tcl-config and --with-tk-config in configopts...

# define $BLAS_LIBS to build R correctly against BLAS/LAPACK library
# $LAPACK_LIBS should *not* be specified since that may lead to using generic LAPACK
# see https://github.com/easybuilders/easybuild-easyconfigs/issues/1435
env.setvar('BLAS_LIBS', os.getenv('LIBBLAS_MT'))
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am using $LIBBLAS_MT here, while existing R easyconfigs use $LIBBLAS.

This matter mainly when using Intel MKL, i.e. multithreaded vs sequential, see also the discussion in #202.

We could/should make this configurable, and stick to linking with the sequential BLAS library by default?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants