Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
6434 Discussions

MacOS + MKL (BLAS) segmentation fault using debug flags

Lecris
Novice
269 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
219 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

6 Replies
Lecris
Novice
266 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.

GouthamK_Intel
Moderator
247 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

 

Lecris
Novice
220 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

RahulV_intel
Moderator
202 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


Lecris
Novice
197 Views

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

RahulV_intel
Moderator
193 Views

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


--Rahul


Reply