Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Rawlins__David
Beginner
195 Views

Segmentation fault with LAPACK routine dsytrf

Jump to solution
Hi,

I'm running the MKL version 10.1 Update 1 on an iMac (Darwin 9.8.0) with the Intel c++ compiler 11.0.064. The iMac has LAPACK installed by default and the test problem below works fine when linked with that, but I get a seg fault when I link it with the MKL.

Here is the test code:

[cpp]// This program tests the call to dsytrf using lapack and the mkl. #include extern "C" { extern int dsytrf(char *uplo, int *n, double *a, int *lda, int *ipiv, double *work, int *lwork, int *info); } using namespace std; int main(int argc, char **argv) { int m, info, work_sz; double tmp; work_sz = -1; m = 3; dsytrf("L", (int *)&m, NULL, (int *)&m, NULL, (double *)&tmp, (int *)&work_sz, (int *)&info); cout << "info = " << info << endl; cout << "tmp = " << (int)tmp << endl; return 0; }[/cpp] Here is the Makefile I use to compile it:

[bash]# Makefile for test.cpp # Generic LAPACK variables LDFLAGS = -L/usr/lib -L. LAPACKLIBS=-llapack -lblas -lm # MKL variables MLAPACKLIBS_PATH = /opt/intel/Compiler/11.0/064/Frameworks/mkl/lib/em64t MLDFLAGS = -L$(MLAPACKLIBS_PATH) -L. LP=$(MLAPACKLIBS_PATH) IP=/opt/intel/Compiler/11.0/064/lib MLAPACKLIBS = $(LP)/libmkl_intel_lp64.a $(LP)/libmkl_sequential.a $(LP)/libmkl_core.a MLAPACKLIBS += -lpthread $(IP)/libiomp5.a -lm # Use LAPACKLIBS for generic LAPACK and MLAPACKLIBS for MKL LIBS = $(MLAPACKLIBS) # Use LDFLAGS for generic LAPACK and MLDFLAGS for MKL LD = $(MLDFLAGS) all: icpc test.cpp -c -g -O0 icpc -o test test.o $(LD) $(LIBS) clean: rm test test.o[/bash]
Here is the output when linking with the generic LAPACK:

[bash]> ./test info = 0 tmp = 240 [/bash] And here is the output from idb when linking with the MKL:

[bash]> idb test Intel Debugger for applications running on Intel 64, Version 11.0, Build [1.1510.2.109] ------------------ object file name: test Reading symbols from /home/sci/rawlins/Examples/optimization/levmar/test...done. (idb) r Starting program: /home/sci/rawlins/Examples/optimization/levmar/test Program received signal SIGBUS _DSYTRF () in /home/sci/rawlins/Examples/optimization/levmar/test (idb) bt #0 0x00000001000014ab in _DSYTRF () in /home/sci/rawlins/Examples/optimization/levmar/test #1 0x00007fff5fbff510 [/bash]
0 Kudos
1 Solution
Gennady_F_Intel
Moderator
195 Views
I cannot see the problem with the latest version either. the one thing we can recommend you know - to download the evaluation version (valid for 30 days) from intel registration center for checking the problem on your side.

View solution in original post

7 Replies
mecej4
Black Belt
195 Views
With Intel C++ 12.1.3.300, MKL 10.3, on Windows 7 X64 I get

T:\lang>icl /Qmkl cdsy.cpp
Intel C++ Intel 64 Compiler XE for applications running on Intel 64, Version 12.1.3.300 Build 20120130

T:\lang>cdsy
info = 0
tmp = 3

I get the same results with the 32-bit versions of the C compiler and MKL. With Cygwin-lapack and GFortran I get tmp = 192. All these results are acceptable since the workspace size returned in 'tmp' is implementation-dependent.

Sorry, I do not have a Macintosh.
Gennady_F_Intel
Moderator
196 Views
I cannot see the problem with the latest version either. the one thing we can recommend you know - to download the evaluation version (valid for 30 days) from intel registration center for checking the problem on your side.

View solution in original post

Rawlins__David
Beginner
195 Views
Gennady,

I haven't downloaded the evaluation version yet, but I did compile it on Linux using icpc version 11.0.083 and MKL version 10.3 update 1 and I'm getting the same error. I'll try the evaluation version next.

Thanks,

Dave

p.s. Nevermind. I realized that I needed to reset the MKL environment variables. Once I did that, it works!

Thanks,

Dave
Yuri_R_1
Beginner
195 Views

Hello Dave,

I use Windows 7 and MKL 10. dsytrf() works fine for me on 32bit, but dies on 64bit architechure, trying to write to some location.

Could you please share which MKL environment variables you have changed to make it work? Maybe I have the same issue?

 

Thanks,

    Yuri Rzhanov

manuel_m_4
Beginner
195 Views

i just downloaded version 11.1 of MKL, and the same code works fine in 32b and crashes on 64

Unhandled exception at 0x00007ff7f06241bc in template.exe: 0xC0000005: Access violation writing location 0x0000000000000000.

mecej4
Black Belt
195 Views

I find that on Windows the 32- and 64-bit Intel C compilers 14.0.2.176 and MKL 11.1.3 give correct results.

Bernard
Black Belt
195 Views

manuel m. wrote:

i just downloaded version 11.1 of MKL, and the same code works fine in 32b and crashes on 64

Unhandled exception at 0x00007ff7f06241bc in template.exe: 0xC0000005: Access violation writing location 0x0000000000000000.

What is template.exe? Is this your application?

It seems that null pointer was dereferenced. If you have an access to source code you can try to investigate this issue.

Reply