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

Intel OneAPI MKL: How to use legac FORTRAN libraries, specififally mkl_pardiso.f77

HGBeutler
Beginner
1,203 Views

Hello,

I need to use some legacy FORTRAN code, which is compiled using gfortran std=legacy. The code uses the pardiso solver, specifically the one provided with MKL: mkl_pardiso.f77. I installed MKL via apt on Ubuntu 20.04 and mkl_pardiso.f77 is not provided anymore, only mkl_pardiso.f90. Simply switching to the new version doesn't do the trick for me, since my old FORTRAN code is not compatible with .f90. 

So my question is, how can I either get the old MKL library which still contains the .f77 files or how can I get the new Intel oneapi to work with .f77.

Kind regards.

 

0 Kudos
9 Replies
ArpanB_Intel
Moderator
1,189 Views

Hi Felix, we have contacted you internally to share some information. Please check your inbox for further updates.


0 Kudos
ArpanB_Intel
Moderator
1,141 Views

Felix, thank you for your patience. We will move the thread to the relevant forum for support on your query.



0 Kudos
Arjen_Markus
Honored Contributor I
1,135 Views

Unless the code is really old, basically predating FORTRAN 77 or using a wagon-load of compiler-specific extensions, it should be no problem to combine it with a library that uses Fortran 90 (and beyond) features. You may need to change something in the calls or use a module, but that is basically it. I am not familiar enough with pardiso to advise you in more detail, but it is well worth the effort, I'd say.

0 Kudos
JohnNichols
Valued Contributor III
1,117 Views

Several years ago, @mecej4 , very kindly showed me, I mean I watched in awe, as he implemented Paradiso with code that dated from 1972, the Harrison Structural Analysis package.  

I just checked the program with the latest Windows Preview,  VS 2022 17.4.4 and the latest ONEAPI and it compiles and appears to run.  

Here is a copy. The input file is enl and the option to pick is 3.  It includes Pardiso.  

It is not a hard drag and drop to put it into other programs. 

Hope this helps.  

 

0 Kudos
HGBeutler
Beginner
1,039 Views

@Arjen_Markus wrote:

Unless the code is really old, basically predating FORTRAN 77 or using a wagon-load of compiler-specific extensions


Basically, this is the case. And it's a whole FEM library, so it's not like I  can just change the code. It would take me several weeks to understand what is going on. 

0 Kudos
mecej4
Honored Contributor III
1,083 Views

@HGBeutler, I think that you do not realize that the files mkl_pardiso.f77 and mkl_pardiso.f90 contain just interface declarations to the Pardiso routines. The only difference is that the former is meant for inclusion in fixed form Fortran source, and the latter in free form Fortran source. The Pardiso solver itself is proprietary, and the source code of the computational routines of Pardiso (probably in C) is not available to users of MKL.

Even the latest version of MKL contains, in its include directory, two files: mkl_pardiso.fi and mkl_pardiso.f90. The first of these is suitable for inclusion in your fixed form Fortran files through an INCLUDE statement, and I think that mkl_pardiso.fi will work as a replacement for the old file that you ask for.

Your problems could probably be easily overcome if you provide a sample of your code that you could compile and run with the old version of MKL. We can then suggest how you can get it to work with OneAPI-MKL.

0 Kudos
HGBeutler
Beginner
1,037 Views
@mecej4 wrote:

@HGBeutler, I think that you do not realize that the files mkl_pardiso.f77 and mkl_pardiso.f90 contain just interface declarations to the Pardiso routines. The only difference is that the former is meant for inclusion in fixed form Fortran source, and the latter in free form Fortran source. The Pardiso solver itself is proprietary, and the source code of the computational routines of Pardiso (probably in C) is not available to users of MKL.

Even the latest version of MKL contains, in its include directory, two files: mkl_pardiso.fi and mkl_pardiso.f90. The first of these is suitable for inclusion in your fixed form Fortran files through an INCLUDE statement, and I think that mkl_pardiso.fi will work as a replacement for the old file that you ask for.

Exactly, I did not realize this, since I was not familiar with paradise at all. Changing import paridso.f77 to import pardiso.f90/.fi did not work for me. However, I could get the original mkl_pardiso.f77 file from another person and included it in the oneAPI. It just contains the interface declarations you mentioned and it seems like it just integrates into the one api. So it does work now with that workaround.


Your problems could probably be easily overcome if you provide a sample of your code that you could compile and run with the old version of MKL. We can then suggest how you can get it to work with OneAPI-MKL.


I can't provide the sample code, since I don't have the rights to publish it. I would need to write a MWE which would be hard for me since my FORTRAN knowledge is limited. However, it works now, so I guess it's fine. In addition, I never compiled it with the old version of MKL myself. I just know it works with version 10 of the MKL, since the guy who sent me that library compiled it with that version.

Anyway, thanks for your reply. It helped me a lot. 

 

0 Kudos
VidyalathaB_Intel
Moderator
991 Views

Hi Felix,


>>it works now, so I guess it's fine


Thanks for the confirmation.

As the issue is resolved we are closing this thread. Please post a new question if you need any additional assistance from Intel as this thread will no longer be monitored.


Regards,

Vidya.


0 Kudos
Reply