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

Calling up MKL Fortran95 Routines via Visual Studio 2003

Groundsel
Beginner
386 Views

I am trying to apply MKL routines to do a simple reduction and solution of a square system of equations:

Qu=p where Q is a general nxn matrix; u and p n-vectors.

My original application was written in Fortran66 and resided on cards! It would have been nice had I thought years ago (when card readers were commonplace) to dump them into a file. However, I did not expect to use them again and had to transcribe them manually into a computer file. It is possible that the bugs I now experience are transcription errors but they may reflect my technique in applying the MKL routines.

I got without incident to a F77 build using dgetrf and dgetrs, which appear to be the applicable F77 MKL routines. I did what the user guide specified to link in these routines using the Visual Studio 2003 IDE.

To get better diagnostics for my debugging and to prepare the way for subsequent development, I decided to translate to F90 with the plusFORT programs SPAG and GXCHK. This was simple enough. It looks, from the MKL User Guide, that all I would need to do to upgrade the MKL routine calls was

1. Replace dgetrf and dgetrs calls with getrf and getrs respectively (and appropriate changes to their argument lists)

2. Under properties FortranGeneralAdditional include directories, place includeia32

3. Under propertiesLinkerGeneralAdditional Library Directories, place

mkl_lapack32.lib in front of the other entries already introduced for F77:

mkl_intel_c.lib mkl_intel_thread.lib, mkl_core.lib and libiomp5md.lib

However, when I do this and try the IDE build, I get unresolved reference messages (LNK2019) for the two MKL routines; so there is probably a glaring error (of omission?) on my part. This is a very simple application: IA32, single threading, statically linked using IVF version 11.1.048. What else do I need to do?

Tom Stevens

0 Kudos
10 Replies
TimP
Honored Contributor III
386 Views

When you use lapack95 or blas95, you should include the additional headers specific to those, and you will need the additional 95 libraries. The link advisor on the top forum page should help you with this.

You could still use the f77 style MKL calls, at least as an intermediate step, while checking that your f90 substitutions are OK.

0 Kudos
Groundsel
Beginner
386 Views

I did make use of the "advisor" to get me the desired libraries. And I erred above in stating that I used mkl_lapack32.lib. What I should have said was mkl_lapack95.lib. As for the headers, do you mean those USE statements?

The example problem has USE mkl95_lapack. Another thread mentions lapack95. The name of the module file in the MKL directory is mkl95_lapack.mod. However, that may be a red herring.

Anyway, whatever I try seems not to trigger a viable reference. I keep getting various flavours of no find messages. Is there an example showing how the IDE needs to be set for a simple F95 example? I am also wondering if an environment variable is not being set the way I have my system configured.


What would be really useful to me would be an example already configured so that I would have only to load the project and see all the internal IDE settings. Is there such a thing? The User Guide seems to expect one to go outside the IDE to compile and link all the examples. That won't really tell me what I want to know.

Tom Stevens

0 Kudos
Groundsel
Beginner
386 Views

Perhaps, you can tell me what is wrong with this attempt at theattached LAPACK95 example. It is one of the standard examples, a simple application of the gesv LAPACK95 routine and using the coding supplied. The attached zip file has the project and the one source file needed. The attached jpg showswhat I get when I tryto build based on it and my project settings.

There is undoubtedly an error ofomission on my part - but I can't find it on perusing the literature available to me.

Tom Stevens

0 Kudos
Groundsel
Beginner
386 Views

Let me see if I get better luck attaching files this time. It does not seem to work for me the way some of the "how to" posts suggest. This time, I shall Add Files before submitting and coming back with Edit.

No. The same thing applies. I click on the Add Files tab and get a Create Folders opportunity (on the server). There are 3 folders there which I tried to create before.If I choose one of them andclick on "Edit" of the (server) folder and then that button "Edit" goes to "Update". It does not open an upload dialog as expected. If Ibite thebullet andclick on "Update", it gives me a hairy message that the page cannot be refreshed withoutresending the information(when I could notsend it in the first place). And nothing good comes of clicking Retry or Cancel.

If anyone can tell me how to get this system to work, I shall try again.

0 Kudos
Gennady_F_Intel
Moderator
386 Views

Tom,

please look at the tread How to attach file to forum post. will it help you?

--Gennady

0 Kudos
Groundsel
Beginner
386 Views

Gennady,

I was trying to follow the advice given on that thread. The trouble is that the behaviour actually realized is not as described. I tried it again hoping that another day would produce more gratifying results - but the same problem arises. I get as far as the server folders where I am to click on Edit and enter file names. However, when I click on the button saying "Edit", I do not get a file selector enabling me to upload files from my own computer. In stead, the button reading "Edit" changes to "Update" and if I click that, it takes me off into limbo.

So I fear I really can't post files and hence my question can't be properly logged. I'm surprised if it only affects me. Could it be a local fire-wall issue? Or some other interaction between browser settings and the web site?

Tom

0 Kudos
Gennady_F_Intel
Moderator
386 Views

Tom,

I will ask our ISN administrators to investigate what's going wrong with your account.

Gennady

0 Kudos
Svetlana_E_Intel
Employee
386 Views
Quoting Groundsel
I get as far as the server folders where I am to click on Edit and enter file names. However, when I click on the button saying "Edit", I do not get a file selector enabling me to upload files from my own computer. In stead, the button reading "Edit" changes to "Update" and if I click that, it takes me off into limbo.

Hello Tom,

After you created a folder you don't need to click on Edit button - actually this is used to rename your folder. You just need to click on folder's name andwhen you get inside the folder you should seeBrowse, Upload& Deletebuttons and be able to choose files on your computer.

Hope, this was helpful.

0 Kudos
Groundsel
Beginner
386 Views

Yes, Svetlana,

It does help and I have uploaded the two files desired. Will you please inform Gennady that the files of which we spoke are attached to this posting. Thank-you and I'm sorry for my misunderstanding.

Tom

0 Kudos
Gennady_F_Intel
Moderator
386 Views

Hi Tom,

looking to the vfroj you have attached, I can see the following

AdditionalLibraryDirectories="mkl_lapack95.lib mkl_intel_c.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.lib" SubSystem="subSystemConsole"/>

but AdditionalDependencies=""/> is empty

please modify it by the following:

AdditionalLibraryDirectories= "C:\Apps\Intel\Compiler\11.1\048\mkl\ia32\lib" SubSystem="subSystemConsole"/>

but AdditionalDependencies=""mkl_lapack95.lib mkl_intel_c.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.lib""/> is empty

--Gennady

0 Kudos
Reply