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

linking to mkl pardiso on windows using pgfortran

miti
Beginner
1,175 Views

hello, 

i am new to computing on windows operating systems. i have pgfortran 18.4 installed and MKL 2018.3.210 installed, including the mkl_pgi_thread library. 


i am trying to statically link to the libraries needed to use PARDISO_D_64 (mkl_intel_ilp64.lib mkl_pgi_thread.lib mkl_core.lib) but the best outcome i can get is: 


pgfortran -i8 -pgf90libs -mp -o GEMINI GEMINI.obj MD.obj MR.obj M1.obj M2.obj MW.obj -I"C:\IntelMKL\compilers_and_libraries_2018.3.210\windows\mkl\include" -LC:\Inte 
lMKL\compilers_and_libraries_2018.3.210\windows\mkl\lib\intel64_win\mkl_intel_ilp64.lib -LC:\IntelMKL\compilers_and_libraries_2018.3.210\windows\mkl\lib\intel64_win\mk 
l_pgi_thread.lib -LC:\IntelMKL\compilers_and_libraries_2018.3.210\windows\mkl\lib\intel64_win\mkl_core.lib -LC:\IntelMKL\compilers_and_libraries_2018.3.210\windows\com 
piler\lib\intel64_win 
GEMINI.obj : error LNK2019: unresolved external symbol mkl_set_num_threads_ referenced in function MAIN_ 
GEMINI.obj : error LNK2019: unresolved external symbol mkl_set_dynamic_ referenced in function MAIN_
M1.obj : error LNK2019: unresolved external symbol pardiso_d_64_ referenced in function m1_s1_ 
GEMINI.exe : fatal error LNK1120: 3 unresolved externals 



the main problem, i hope, is that i just don't know how to link to multiple libraries using pgfortran on windows. i previously compiled and executed this same code, without issue, on linux mint using gfortran.

i MKL link line advisor also states that MKL support in windows with pgi fortran is "limited."  what does that mean?  could it be that i just cannot use pgfortran to link to the pardiso routines?  or, could it be that i need to add the "mkl service" to my code, which i found to not be necessary when i was working on linux with gfortran.

0 Kudos
1 Solution
MariaZh
Employee
1,175 Views

Hi,

Looks like the reason here is "-L" option used for linking MKL libraries. 
You should just put required libs to your link line. I've modified it a bit for you, hope this will help!

pgfortran -i8 -pgf90libs -mp -o GEMINI GEMINI.obj MD.obj MR.obj M1.obj M2.obj MW.obj -I"C:\IntelMKL\compilers_and_libraries_2018.3.210\windows\mkl\include" C:\IntelMKL\compilers_and_libraries_2018.3.210\windows\mkl\lib\intel64_win\mkl_intel_ilp64.lib C:\IntelMKL\compilers_and_libraries_2018.3.210\windows\mkl\lib\intel64_win\mkl_pgi_thread.lib C:\IntelMKL\compilers_and_libraries_2018.3.210\windows\mkl\lib\intel64_win\mkl_core.lib

Please, let us know if you have any other questions.

Best regards,
Maria

 

View solution in original post

0 Kudos
7 Replies
Gennady_F_Intel
Moderator
1,175 Views

could you try to build sequential version? -i8 -I"%MKLROOT%"\include mkl_intel_ilp64.lib mkl_sequential.lib mkl_core.lib

0 Kudos
miti
Beginner
1,175 Views

I just tried the sequential library and found the same answers.

I also tried "including" the MKL service in the main program--the compiler reports 31 "warnings" about "END" statements in internal procedures, but no "severes" or "fatals."  There were also a few "unrecognized DEC directives."

 

Thanks

0 Kudos
mecej4
Honored Contributor III
1,175 Views

I have not used the PGI/MKL combination recently; but, after reading your post, I tried the versions that I have from a year or two ago, namely, PGI 15.3 and Composer XE 2015. I ran the Pardiso symmetric equations example, using the command 

     pgfortran sym.f mkl_rt.lib

The resulting EXE ran and produced the expected output. You could start with this working case, and modify it bit by bit to suit your requirements. If you need more specific help, you may have to provide test source code, information regarding the PGI compiler and MKL versions, and the options used to build the EXE.

0 Kudos
Maria_K_Intel
Employee
1,175 Views

Hi,

What the exact header file did you include?

0 Kudos
miti
Beginner
1,175 Views

hi maria k. (intel),

 

sorry for my delay--i had some other things that needed my attention.

 

in the module (subprogram) (called M1) that actually calls "pardiso_d_64," my file starts off:

INCLUDE 'mkl_pardiso.f90'
MODULE M1
USE OMP_LIB
USE MD
USE MKL_PARDISO
USE M2
CONTAINS
SUBROUTINE S1(F,E,WATCH,ROM,NRM)

 

and I instruct the compiler to halt after assembly:

pgfortran -i8 -mp -pgf90libs -c M1.f90 -IC:/IntelMKL/compilers_and_libraries_2018.3.210/windows/mkl/include

 

 

 

 

0 Kudos
MariaZh
Employee
1,176 Views

Hi,

Looks like the reason here is "-L" option used for linking MKL libraries. 
You should just put required libs to your link line. I've modified it a bit for you, hope this will help!

pgfortran -i8 -pgf90libs -mp -o GEMINI GEMINI.obj MD.obj MR.obj M1.obj M2.obj MW.obj -I"C:\IntelMKL\compilers_and_libraries_2018.3.210\windows\mkl\include" C:\IntelMKL\compilers_and_libraries_2018.3.210\windows\mkl\lib\intel64_win\mkl_intel_ilp64.lib C:\IntelMKL\compilers_and_libraries_2018.3.210\windows\mkl\lib\intel64_win\mkl_pgi_thread.lib C:\IntelMKL\compilers_and_libraries_2018.3.210\windows\mkl\lib\intel64_win\mkl_core.lib

Please, let us know if you have any other questions.

Best regards,
Maria

 

0 Kudos
miti
Beginner
1,175 Views

Zhukova, Maria (Intel),

 

Thank you very much--I can now properly link and execute my code.

0 Kudos
Reply