Hi,
I have
#include
#include
#include "mkl_vml.h"
#include "mkl_service.h"
#define N 4
int main()
{
double a[N] = {0.1, 0.2, 0.3, 0.4};
double b[N], y[N];
MKL_INT n = N, i;
MKLVersion ver;
MKLGetVersion(&ver);
printf("\\nMKL Version = %d.%d.%d\\n\\n", ver.MajorVersion, ver.MinorVersion, ver.UpdateVersion);
for (i = 0; i < n; i++) b[i] = a[i] - 0.05;
vdSub(n, a, b, y);
for (i = 0; i < n; i++)
printf("a[%d] - b[%d] = %f - %f = %f\\n", i, i, a[i], b[i], y[i]);
return 0;
}
and
#include
#include
#include "mkl_vml.h"
#include "mkl_service.h"
int main()
{
double a[2] = {0.2, 0.3}, y[2];
MKL_INT n = 2, mod, accm, fpum, errm;
MKLVersion ver;
MKLGetVersion(&ver);
printf("\\nMKL Version = %d.%d.%d\\n", ver.MajorVersion, ver.MinorVersion, ver.UpdateVersion);
mod = vmlGetMode();
accm = vmlGetMode() & VML_ACCURACY_MASK;
fpum = vmlGetMode() & VML_FPUMODE_MASK;
errm = vmlGetMode() & VML_ERRMODE_MASK;
/*
printf("mod = %d\\n", mod);
printf("accm = %d\\n", accm);
printf("fpum = %d\\n", fpum);
printf("errm = %d\\n", errm);
*/
vdInv(n, a, y);
printf("Compute Power[{0.2, 0.3}, -1] using vdInv.\\n");
printf("answer = {%f, %f}\\n\\n", y[0], y[1]);
return 0;
}
with the following make file
# MKL static linking
MKLLIB = -Wl,--start-group $(MKLDIR)/libmkl_intel_lp64.a \\
$(MKLDIR)/libmkl_intel_thread.a $(MKLDIR)/libmkl_core.a -Wl,--end-group \\
-L$(MKLDIR) -liomp5 -lpthread
CC = gcc
CXX = g++
CFLAGS = -g -O0 -Wall -I$(MKLDIR)
LDFLAGS =-g -O0 $(MKLLIB) -lm
all : vdinv vdsub
vdinv : vdinv.o
$(CC) -o vdinv vdinv.o $(LDFLAGS)
vdinv.o : vdinv.c
$(CC) -c $(CFLAGS) vdinv.c
vdsub : vdsub.o
$(CC) -o vdsub vdsub.o $(LDFLAGS)
vdsub.o : vdsub.c
$(CC) -c $(CFLAGS) vdsub.c
clean :
rm -vf *.o
I compile
gcc -c -g -O0 -Wall -I/Components/MKL/10.2/Linux-x86-64/vendor vdinv.c
gcc -o vdinv vdinv.o -g -O0 -Wl,--start-group /Components/MKL/10.2/Linux-x86-64/vendor/libmkl_intel_lp64.a /Components/MKL/10.2/Linux-x86-64/vendor/libmkl_intel_thread.a /Components/MKL/10.2/Linux-x86-64/vendor/libmkl_core.a -Wl,--end-group -L/Components/MKL/10.2/Linux-x86-64/vendor -liomp5 -lpthread -lm
gcc -c -g -O0 -Wall -I/Components/MKL/10.2/Linux-x86-64/vendor vdsub.c
gcc -o vdsub vdsub.o -g -O0 -Wl,--start-group /Components/MKL/10.2/Linux-x86-64/vendor/libmkl_intel_lp64.a /Components/MKL/10.2/Linux-x86-64/vendor/libmkl_intel_thread.a /Components/MKL/10.2/Linux-x86-64/vendor/libmkl_core.a -Wl,--end-group -L/Components/MKL/10.2/Linux-x86-64/vendor -liomp5 -lpthread -lm
when I run these programs
I get Illegal instructions.
Program received signal SIGILL, Illegal instruction.
0x0000000000405406 in mkl_vml_core_e9_vml_dSub ()
bt:
#0 0x0000000000405406 in mkl_vml_core_e9_vml_dSub ()
#1 0x00000000004028e3 in vdSub ()
#2 0x00007fffffffde90 in ?? ()
#3 0x00007fffffffde90 in ?? ()
#4 0x00007fffffffded0 in ?? ()
#5 0x00007fffffffdfb0 in ?? ()
#6 0x0000000000000000 in ?? ()
My CPU is an Intel Core2 Duo CPU E8400
I use
gcc (SUSE Linux) 4.4.1 [gcc-4_4-branch revision 150839]
GNU C Library stable release version 2.10.1 (20090918), by Roland McGrath et al.
I tried to set
MKL_AVX_ENABLE to
but that did not help, I am not sure it should.
Anysuggestion, how I could fix it, or narrow it further down?
Thanks a lot
I think (because of the related CPU but i have not checked) there is a similar problem on a
Windows 7 (64 bit)
Intel Core2 Duo T9600 @ 2.80GHz



