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

Problems with MKL in Microsoft Visual Studio (MVS).

Marcin_Wik
Beginner
1,844 Views

I have got some problems with running the MKL in Microsoft Visual Studio (MVS). I am new user in Intel Fortran.

I use three computers with different configuration: 1)Intel Pentium 4, 1GB RAM, Win XP 32bit, 2)AMD Phenom II X2 550 Black Edition 4 GB RAM, Win Vista 64bit (Im going to change it to win 7 64bit), 3) Laptop Intel Core 2 Duo processor T 6400 4GB RAM win XP 32bit (Im going to change it to win 7 64bit).

It will be convenient for me to have one project, which will work on different, depicted above platforms.

I changed the steps pointed on the web page:

http://software.intel.com/sites/products/documentation/hpc/mkl/win/MKL_UG_config_dev_env/Creating_and_Configuring_the_Intel_Visual_Fortran_Project.htm

the same one can find in Intel Math Kernel Library for Windows OS Users Guide March 2009, chapter 4, section: Creating and Configuring the Intel Visual Fortran Project, page 48.

  1. I have set environment variables shown in file:
    D:\Program Files\Intel\Compiler\11.1\051\mkl\tools\environment\mklvars32.bat
    depending on platform I use. Some of them I have had to set manually by command prompt, because when I run the file not all variables are set.

  2. Point 2 presented on the web page, I think is unnecessary, because include variable has been set. (When I follow the instructions on the web page the structure of catalogs has to be identical with all my working platforms)

  3. Point 5 presented on the web page, as the previous one.

  4. Point 7 a,b presented on the web page, similar but this time variable lib and/or LIBRARY_PATH is responsible for select additional dependences and the type of required libraries. Am I right?

  5. Where can I find additional dependences concerning point 7 presented on the web page? (Is it on http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/ ?)

Additionally, in the Property Pages window, Configuration

Properties > Fortran > Libraries. In the right-hand part of the window, Ive selected Use Intel Math Kernel Library > Sequential (default is No).

When I run my test program:

program MKL_test

!Use lapack95 , Only: gesv

implicit none

integer :: n,m

real,allocatable :: A(:,:),B(:)

!

! set matrix dimensions

n=3; m=3

allocate(A(n,m),B(n))

! example data

A=reshape((/2,4,1,4,7,2,3,1,1/),shape=(/3,3/))

B=(/2,4,6/)

! intel MKL lib.

call sgesv( A, B)

endprogram MKL_test


It does not work properly, as a result I get:


forrtl: severe (157): Program Exception - access violation

Image PC Routine Line Source

console_MKL_test. 004016FC Unknown Unknown Unknown

console_MKL_test. 00621553 Unknown Unknown Unknown

console_MKL_test. 00467257 Unknown Unknown Unknown

console_MKL_test. 0046712F Unknown Unknown Unknown

kernel32.dll 7C817077 Unknown Unknown Unknown

with communication:

'console_MKL_test.exe': Loaded 'E:\intel\console_MKL_test\console_MKL_test\Debug\console_MKL_test.exe', Symbols loaded.

'console_MKL_test.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll'

'console_MKL_test.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll'

'console_MKL_test.exe': Loaded 'D:\Program Files\Intel\Compiler\11.1\051\lib\ia32\libiomp5md.dll', Symbols loaded (source information stripped).

'console_MKL_test.exe': Loaded 'C:\WINDOWS\system32\imagehlp.dll'

'console_MKL_test.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll'

First-chance exception at 0x004016bc in console_MKL_test.exe: 0xC0000005: Access violation reading location 0x00000003.

First-chance exception at 0x00534eb5 in console_MKL_test.exe: 0xC0000091: Floating-point overflow.

'console_MKL_test.exe': Loaded 'C:\WINDOWS\system32\dbghelp.dll'

'console_MKL_test.exe': Loaded 'C:\WINDOWS\system32\version.dll'

'console_MKL_test.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll'

'console_MKL_test.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll'

'console_MKL_test.exe': Loaded 'C:\WINDOWS\system32\secur32.dll'

Unhandled exception at 0x004016bc in console_MKL_test.exe: 0xC0000005: Access violation reading location 0x00000003.

The program '[1468] console_MKL_test.exe: Native' has exited with code 0 (0x0).

And one more thing, why cant I use !Use lapack95 , Only: gesv.

When I add this statement an error appears:


Error 1 error #7002: Error in opening the compiled module file. Check INCLUDE paths. [LAPACK95] E:\intel\console_MKL_test\console_MKL_test\main.f90 6

Error 2 error #6580: Name in only-list does not exist. [GESV] E:\intel\console_MKL_test\console_MKL_test\main.f90 6

I will be grateful for all guidelines.

0 Kudos
8 Replies
Gennady_F_Intel
Moderator
1,844 Views

it seems to me that you linked 64-bit libs but ran yor test on 32bit system.
1) What Libraries were used for linking?
Please use linking adviser to select the list of libraries requred to build your application for different platforms.
2) May be this article help to you better how to adjust all dependemcies for MVSC Fortran based project, because of you can see the picture there.
--Gennady

0 Kudos
Vladimir_Koldakov__I
New Contributor III
1,844 Views

Hi,

If you call Fortran 95 interface, you should use generic name: call gesv( A, B) and USE statement (Use lapack95 , Only: gesv)
Then ensure "includeia32" directory is set or simply add it in the Additional Include Directories window.
And you need link also mkl_lapack95.lib library.

In case of 64 bit architecture the additional include directory should be "includeem64tlp64" and library mkl_lapack95_lp64.lib (or "includeem64tilp64" and mkl_lapack95_ilp64.lib if you use 64-bit integers - compiler flag /4I8).

Thanks,
Vladimir

0 Kudos
Marcin_Wik
Beginner
1,844 Views

Thank you for all responses,


I've changed libraries for proper depending on platform I work with use the linker adviser and all is working fine with old fortran.

But if I try to use fortran95:

  1. Use lapack95 , Only: gesv statement is add.

  2. call gesv( A, B) is use

  3. The "includeia32" directory is set and add in the Additional Include Directories window too.

  4. Project > Properties > Linker > General>Additional Library Directories > ia32lib is add in which mkl_lapack95.lib is placed.

But this time two errors appear:

Error 1 error LNK2019: unresolved external symbol _SGESV1_F95 referenced in function _MAIN__Source.obj

Error 2 fatal error LNK1120: 1 unresolved externals DebugXP_MKL.exe

Where can be the error?

0 Kudos
Gennady_F_Intel
Moderator
1,844 Views
Quoting - Marcin Wik

Thank you for all responses,


I've changed libraries for proper depending on platform I work with use the linker adviser and all is working fine with old fortran.

But if I try to use fortran95:

  1. Use lapack95 , Only: gesv statement is add.

  2. call gesv( A, B) is use

  3. The "includeia32" directory is set and add in the Additional Include Directories window too.

  4. Project > Properties > Linker > General>Additional Library Directories > ia32lib is add in which mkl_lapack95.lib is placed.

But this time two errors appear:

Error 1 error LNK2019: unresolved external symbol _SGESV1_F95 referenced in function _MAIN__Source.obj

Error 2 fatal error LNK1120: 1 unresolved externals DebugXP_MKL.exe

Where can be the error?


Marcin,
we have f90 example shows how to call gesv() routine.
( You can find these examples into exampleslapack95source directory )
I created VS2005 project based on this example and linked it with Intel C++ Compiler Professional Edition for Windows* Version 11.1.038.
Please see the project into attachment (70693.zip).
--Gennady


0 Kudos
Vladimir_Koldakov__I
New Contributor III
1,844 Views
Quoting - Marcin Wik

Project > Properties > Linker > General>Additional Library Directories > ia32lib is add in which mkl_lapack95.lib is placed.


Error 1 error LNK2019: unresolved external symbol _SGESV1_F95 referenced in function _MAIN__Source.obj


Hi Marcin,
Unresolved name is located in the mkl_lapack95.lib, so try to add this library to the project.
Thanks,
-Vladimir
0 Kudos
tonylamb
Beginner
1,844 Views

Marcin,
we have f90 example shows how to call gesv() routine.
( You can find these examples into exampleslapack95source directory )
I created VS2005 project based on this example and linked it with Intel C++ Compiler Professional Edition for Windows* Version 11.1.038.
Please see the project into attachment (70693.zip).
--Gennady



Hi Gennady,

Silly question but how do I get my hands on the zip file (70693.zip)? I might be wrong but didn't see the attachment in your last post.

Tony
0 Kudos
Gennady_F_Intel
Moderator
1,844 Views
Quoting - tonylamb

Marcin,
we have f90 example shows how to call gesv() routine.
( You can find these examples into exampleslapack95source directory )
I created VS2005 project based on this example and linked it with Intel C++ Compiler Professional Edition for Windows* Version 11.1.038.
Please see the project into attachment (70693.zip).
--Gennady



Hi Gennady,

Silly question but how do I get my hands on the zip file (70693.zip)? I might be wrong but didn't see the attachment in your last post.

Tony
Hi Tony,
I am sorry, my fault . Please see the attachment.
--Gennady
0 Kudos
tonylamb
Beginner
1,844 Views

Many thanks Gennady !!!!

Tony
0 Kudos
Reply