include '-ldl' in $LIBBLAS*/* & co when linking with Intel MKL 11.x or newer#1761
include '-ldl' in $LIBBLAS*/* & co when linking with Intel MKL 11.x or newer#1761boegel merged 6 commits intoeasybuilders:developfrom
Conversation
| # but it only seems to be strictly required for certain compilers | ||
| mkl_version = self.get_software_version(self.BLAS_MODULE_NAME)[0] | ||
| if LooseVersion(mkl_version) >= LooseVersion('11'): | ||
| #if LooseVersion(mkl_version) >= LooseVersion('11') and self.COMPILER_FAMILY in [TC_CONSTANT_PGI]: |
There was a problem hiding this comment.
I'm a little bit reluctant to do this for any compiler, but since this is what is advised by the Intel MKL Link Advisor, it should be fine I think.
Thoughts, @bartoldeman, @ocaisa, @damianam, @wpoely86?
There was a problem hiding this comment.
if it's not needed, the linker will discard them?
There was a problem hiding this comment.
Sure, but my biggest concern is: what if they're not around? I'm not sure if that's realistic though, they're probably always there...
There was a problem hiding this comment.
The math library and the dynamic linking library? If these are not around, we will have bigger concerns that this. Sure, glibc-devel is needed but that's a requirement anyway.
There was a problem hiding this comment.
Why is glibc-devel a requirement already (just to be clear)?
There was a problem hiding this comment.
$ rpm -qR gcc-5.3.1-6.fc23.x86_64
/bin/sh
/bin/sh
/bin/sh
/sbin/install-info
/sbin/install-info
binutils >= 2.24
cpp = 5.3.1-6.fc23
glibc-devel >= 2.2.90-12
...
Like for example libpthread.so is also in there.
|
Conservatively I think it's only really needed for PGI + static linking only, and then only -ldl (not -lm). Progressively the link advisor also suggests -lpthread (though perhaps not everywhere?). Either way I don't have a strong opinion on this, whatever works works... |
|
I did see this pop up, when compiling something with the Intel compilers that was using That makes me want to reconsider either doing this for all compilers or only slapping on @bartoldeman why would |
|
lm and lpthread are not required for PGI because they are already included by pgcc: |
|
Similarly, icc includes -lm and -ldl by default. |
|
So, is PGI not including Anyway, it seems like w can switch this to only including |
|
No it's not a bug, not including -ldl. Many programs compile without using -ldl. It's just static MKL that needs it. It will probably not hurt to add -ldl everywhere (as icc does it by default for some reason) but from a minimalistic point of view it is not necessary. I'm tending to favour the most minimalistic change (only use -ldl for statically linking MKL). |
|
@bartoldeman OK, thanks for the feedback, I changed things to only slap on |
|
fix verified with easybuilders/easybuild-easyconfigs#3044 and easybuilders/easybuild-easyconfigs#3046 |
|
Good to go now, thanks for the feedback @bartoldeman and @wpoely86! |
|
Thanks, I can confirm it works. |
|
I had to make the inclusion of |
This change results in
-lm -ldlbeing added to$LIBBLAS,$LIBLAPACK, etc. for Intel MKL 11.0 and newer, following the discussion in easybuilders/easybuild-easyconfigs#2900, and as instructed by the Intel MKL Link Advisor.This is required in particular for building HPL with PGI, cfr. easybuilders/easybuild-easyconfigs#3046.