Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Linear algebra function

Di_Marco__Nicola
Beginner
604 Views

Good morning,

I have a f90 code where dgemm, dgemv and dgesvd functions are used. I don't have these function currently loaded and when I compile I get errors since these functions are not found by the compiler.

My question is: how do I can import these functions?

Thanks for the support

 

Nicola

0 Kudos
8 Replies
gib
New Contributor II
604 Views

You need the BLAS library, which provides dgemm and dgemv.  .  Take a look here, for example:

http://www.netlib.org/blas/

For dgesvd you want the LAPACK library.

0 Kudos
mecej4
Honored Contributor III
604 Views

All the BLAS and Lapack routines (and many more that are not in BLAS or Lapack) are included in the MKL library, which you can choose to install at the time that you installed the Intel compiler, or later (by modifying the Parallel Studio installation).

For simple cases of using MKL, simply use the /Qmkl compiler switch to the compilation command line, or specify in your VS project properties that the MKL libraries are to be used by the linker.

0 Kudos
Di_Marco__Nicola
Beginner
604 Views

Dear all, thanks for the quick replies.

I modified the VS project properties (Fortran/Libraries/Use MKL) and now the code compiles.

Unfortunately it doesn't run yet. I believe there is still something related to the use of MKL routines. I checked the installation of Intel that I did some time ago and it seems that MKL were installed. Are there any way to check that?

Thanks,

Nicola

0 Kudos
mecej4
Honored Contributor III
604 Views

Di Marco, Nicola wrote:

Unfortunately it doesn't run yet. I believe there is still something related to the use of MKL routines.

What do you mean by "it doesn't run yet"? Describe how you attempted to run the program, report any error messages and other pertinent observations.

0 Kudos
andrew_4619
Honored Contributor II
604 Views

It compiles and links to make an exe ? What does "it doesn't run yet." mean? You need to give more information and show the error messages etc.

 

0 Kudos
Di_Marco__Nicola
Beginner
604 Views

After setting the VS properties enabling the use of MKL routines I ran the code in Debug mode.

The Debug started correctly but during the allocation of the array "U" it stopped, given the following alert: undefined pointer/array.

Then if try to move on anyway I got this: wntdll.pdb not loaded

The code is the following:

real, allocatable, dimension(:,:) :: U

call dgemm('n','t', nrobs, nrobs, nrens, 1.0, S, nrobs,S, nrobs,float(nrens), R, nrobs)

allocate(U(nrobs, nrobs))

So, the array "U" is declared before its allocation. I've checked the value of nrobs and it is correct.

The strange thing is that if I put the allocation of U before calling dgemm it works.

So that's why I believe it is happening something when I call dgemm.

Thanks for the support,

Nicola

0 Kudos
mecej4
Honored Contributor III
604 Views

That description is incomplete and far from coherent. There is not enough information there to enable me provide you with much help.

If the call to DGEMM was not made with correct arguments (allocated, of the proper shapes, and defined), it is not worthwhile to try to investigate subsequent errors. The call to DGEMM, and the code shown that comes before that call, does not involve U. Examine the contents of R after the call to DGEMM has been completed and control has returned to your code.

If the values of nrobs and nrens are large, first run with much smaller values so that it becomes possible to check (by hand calculations, if feasible) that the call to DGEMM was made correctly and the returned R is correct.

The "missing PDB" messages are of no concern except for experts who are debugging Windows itself.

0 Kudos
Di_Marco__Nicola
Beginner
604 Views

Everything is fine if I comment DGEMM, I think I'm missing something in the arguments of the function from a mathematical point of view.

I will go through it.

Thanks,

 

Nicola

0 Kudos
Reply