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

Error when executing example from MKL Reference Manual

ricardormartins
Beginner
397 Views
I am evaluating Intel Visual Fortran 11.1.038 and a MKL 10.2 licenses and I have tried to run the following program which is exactly the Example C-1 provided in Appendix C of Intel MKL Reference Manual (Version:August 2008):

program dot_main
real x(10), y(10), res
integer n, incx, incy, i
external sdot
n = 5
incx = 2
incy = 1
do i = 1, 10
x(i) = 2.0e0
y(i) = 1.0e0
end do
res = 0
res = sdot (n, x, incx, y, incy)
print*, 'SDOT = ', res
end

However the following error occurred:

forrtl: severe (157): Program Exception - access violation
Image PC Routine Line Source
ExampleC1.exe 00408520 Unknown Unknown Unknown
ExampleC1.exe 0040125D _MAIN__ 14 c1.F90
ExampleC1.exe 004A9973 Unknown Unknown Unknown
ExampleC1.exe 0044C6B7 Unknown Unknown Unknown
ExampleC1.exe 0044C58F Unknown Unknown Unknown
kernel32.dll 7C817077 Unknown Unknown Unknown

It seems that the problem is inside the sdot routine because when I remove this line the error disappears. Does somebody know what could be happening?
0 Kudos
1 Solution
Gennady_F_Intel
Moderator
397 Views
Please look at the article related what libraries are recommended for linking your application.
--Gennady

View solution in original post

0 Kudos
3 Replies
ArturGuzik
Valued Contributor I
397 Views

How (and which libraries) do you link? Example is OK and produces no error.

A.
0 Kudos
Gennady_F_Intel
Moderator
398 Views
Please look at the article related what libraries are recommended for linking your application.
--Gennady
0 Kudos
ricardormartins
Beginner
397 Views
Please look at the article related what libraries are recommended for linking your application.
--Gennady
Dear Gennady and A.

Thank you for the prompt response.

I was linking the MKL library using

Project > Properties > Fortran > Libraries >Use Intel MKL Library > Sequential(/Qmkl:sequential)

There was no linking error message when I built the solution, then I supposed that the problem was not related to link issues. However I read the article that you recommended and linked the suggested libraries and the program worked fine.

Best regards

Ricardo
0 Kudos
Reply