[Rd] hand compile; link to MKL fails at BLAS zdotu

Ramón Fallon r@mon|@||on @end|ng |rom gm@||@com
Sat Mar 30 21:20:18 CET 2024


Yes, that work for me ... very many thanks Ivan.
Just verifying ... the configure reports:
  External libraries:          pcre2, readline, BLAS(MKL), LAPACK(generic),
curl
just what I was looking for.

Then make && sudo make install, all fine (of course, I have all the
dependencies sorted already)
and once inside the REPL
extSoftVersion() reports BLAS as /usr/lib/x86_64-linux-gnu/libmkl_gf_lp64.so
and same goes for La_library() - BTW the "generic" from above is bit
misleading.

You really took ownership of problem! Well, of course, hopefully it will
help others ...

Cheers / Ramón.

On Sat, 30 Mar 2024 at 18:28, Ivan Krylov <ikrylov using disroot.org> wrote:

> В Sat, 30 Mar 2024 20:31:25 +0300
> Ivan Krylov via R-devel <r-devel using r-project.org> пишет:
>
> > It seems to crash inside MKL!
>
> Should have read some more about mkl_gf_lp64 before posting. According
> to the Intel forums, it is indeed required in order to work with the
> GFortran calling convention, but if you're linking against it, you also
> have to add the rest of the linker command line, i.e.:
>
> -lmkl_gf_lp64 -lmkl_core -lmkl_sequential
> -Wl,--no-as-needed -lpthread -lm -ldl
>
>
> https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ARPACK-with-MKL-crashes-when-calling-zdotc/m-p/1054316
>
> Maybe it's even documented somewhere, but Intel makes it too annoying
> to read their documentation, and they definitely don't mention it in
> the link line advisor. There's also the ominous comment saying that
>
> >> you cannot call standard BLAS [c,z]dot[c,u] functions from C/C++
> >> because the interface library that is linked is specific for
> >> GFortran which has a different calling convention of returning a
> >> Complex type and would cause issues
>
> I'm not seeing any calls to [c,z]dot[c,u] from inside R's C code (which
> is why R seems to work when running with libmkl_rt.so), and the
> respective declarations in R_ext/BLAS.h have an appropriate warning:
>
> >> WARNING!  The next two return a value that may not be compatible
> >> between C and Fortran, and even if it is, this might not be the
> >> right translation to C.
>
> ...so it's likely that everything will keep working.
>
> Indeed, R configured with
>
> --with-blas='-lmkl_gf_lp64 -lmkl_core -lmkl_sequential'
> --with-lapack='-lmkl_gf_lp64 -lmkl_core -lmkl_sequential'
>
> seems to work with MKL.
>
> --
> Best regards,
> Ivan
>

	[[alternative HTML version deleted]]



More information about the R-devel mailing list