Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
6981 Discussions

MacOS + MKL (BLAS) segmentation fault using debug flags

Lecris
Novice
954 Views

I have narrowed down an issue when compiling a simple HelloWorld code using debug flags (`-DCMAKE_BUILD_TYPE=Debug`) on MacOS (11.0.1 with XCode 11.7 and Parallel Studio Xe 19.1.2.258 20200623 or XCode 12.2 and OneApi 2021.1.1). I have uploaded my MWE of this issue, and I wish to confirm if it's not miss-configuration on my part.

#include <iostream>
#include <mkl.h>

int main() {
	double M[10] = {};
	double X[4] = {};
	double Y[4] = {};
	std::cout << "Trying BLAS operation:" << std::endl;
//	for (int i = 0; i < 10; i++)
		cblas_dspmv(CblasColMajor, CblasUpper, 4,
		            1.0f, M, X, 1, 0.0f, Y, 1);
	std::cout << "Success" << std::endl;
	return 0;
}



PS: I had a similar issue on Linux, but I cannot currently reproduce it.

0 Kudos
1 Solution
Lecris
Novice
904 Views

I have found the porblem, and indeed it was a configuration error.

I was compiling and linking with `ilp64` while still using default `int` parameters. After switching to `lp64` everything works perfectly fine.

View solution in original post

0 Kudos
6 Replies
Lecris
Novice
951 Views

I should add the Segmentation fault error I get is `EXC_BAD_ACCESS (code=EXC_I386_GPFLT)` in the BLAS function, and when the debug mode is turned off the programm runs normally with appropriate results.

0 Kudos
GouthamK_Intel
Moderator
932 Views

Hi,

Thanks for reaching out to us!

As your issue is related to MKL and we have a dedicated forum for MKL related issues. So we are redirecting your thread to MKL Forum for faster response.

Have a Good day!

 

Thanks & Regards

Goutham

 

0 Kudos
Lecris
Novice
905 Views

I have found the porblem, and indeed it was a configuration error.

I was compiling and linking with `ilp64` while still using default `int` parameters. After switching to `lp64` everything works perfectly fine.

0 Kudos
RahulV_intel
Moderator
887 Views

Hi,


Thanks for the update. Good to know that it worked. Let me know if I can close this thread from my end?


Regards,

Rahul


0 Kudos
Lecris
Novice
882 Views

Of course, go ahead and close it. Maybe someone in the same situation as me will find this post by accident when needed.

0 Kudos
RahulV_intel
Moderator
878 Views

Thanks for the confirmation. Intel will no longer monitor this thread. Further responses on this thread will be considered community only.


--Rahul


0 Kudos
Reply