Closed hmenke closed 3 weeks ago
CMake defaults to (and forces) Intel ABI when there is no GNU Fortran compiler loaded ^1. The difference between Intel and GNU ABI is that in Intel ABI complex*16
values are returned as an implicit first argument instead of by value, i.e.
// GNU
double complex zdotc_(const int *N, const void *ZX, const int *INCX, const void *ZY, const int *INCY);
// Intel
void zdotc_(const void *res, const int *N, const void *ZX, const int *INCX, const void *ZY, const int *INCY);
Now one might be tempted to say “Intel ABI is not supported, you have to use Intel10_64_dyn
and we just select GNU ABI at runtime ^2”. However, this does not work when the Python distribution is Anaconda, because Anaconda builds NumPy against MKL with Intel ABI, so if there is import numpy
in a TRIQS Python script, this will load MKL with Intel ABI and the zdotc_
symbol will be resolved in this library, irrespective of whether there is MKL linked with another ABI somewhere, still resulting in segfault. The fix will definitely be non-trivial.
Intel actually has some documentation on this:
Their recommendation is “use the CBLAS interface”.
Fixed by #69
Prerequisites
Description
When I configure nda with
-DBLA_VENDOR=Intel10_64lp_seq
to use a particular version of MKL, I get a segfault sometimes even with stack smashing inside the MKL, but when I configure with-DBLA_VENDOR=Intel10_64_dyn
(which is the default) it works fine.Steps to Reproduce
cmake -S . -B _build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=install -DBLA_VENDOR=Intel10_64lp_seq
cmake --build _build/
./_build/test/c++/nda_lapack
Expected behavior: No segfault
Actual behavior: Segfault
Versions
https://github.com/TRIQS/nda/commit/a3a3119bae0b684de35a23439c4fae52c2306437
MKL 2024.0
Formatting
Please use markdown in your issue message. A useful summary of commands can be found here.
Additional Information
Any additional information, configuration or data that might be necessary to reproduce the issue.