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

[Intel Visual Fortran, ps xe 2019.3] Again, I cannot link to intel mkl

pascal_M_
Beginner
553 Views

In the past, I already had several issues with automatically (meaning, through the integration tool with the switch no/yes{sequential|...}) linking to the mkl, this concerning c/c++ projects. First it never worked, second, rolling back wasn't putting the solution/project in the same state than the state in which it was before automatically linking to the mkl, therefore messing everything up. I therefore get used to link manually to the mkl, and it worked at compilation and execution.

Now, I am working with Intel Visual Fortran (from ps xe 2019 update 3) under last update of visual studio 2017, under last update of windows 10 pro.

I followed the (simple) instructions from https://software.intel.com/en-us/mkl-windows-developer-guide-automatically-linking-your-intel-visual-fortran-project-with-intel-mkl, compiled my file and had the following output in visual studio :

1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.3.203\windows\mkl\include\blas.f90(21): error #5149: Illegal character in statement label field  
1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.3.203\windows\mkl\include\blas.f90(21): error #5149: Illegal character in statement label field  
1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.3.203\windows\mkl\include\blas.f90(21): error #5149: Illegal character in statement label field  
1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.3.203\windows\mkl\include\blas.f90(21): error #5149: Illegal character in statement label field  
1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.3.203\windows\mkl\include\blas.f90(21): error #5149: Illegal character in statement label field  
1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.3.203\windows\mkl\include\blas.f90(22): error #5149: Illegal character in statement label field  
1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.3.203\windows\mkl\include\blas.f90(23): error #5149: Illegal character in statement label field  
1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.3.203\windows\mkl\include\blas.f90(24): error #5149: Illegal character in statement label field  
1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.3.203\windows\mkl\include\blas.f90(24): error #5149: Illegal character in statement label field  
1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.3.203\windows\mkl\include\blas.f90(24): error #5149: Illegal character in statement label field  
1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.3.203\windows\mkl\include\blas.f90(24): error #5149: Illegal character in statement label field  
1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.3.203\windows\mkl\include\blas.f90(26): error #5149: Illegal character in statement label field  
1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.3.203\windows\mkl\include\blas.f90(26): error #5149: Illegal character in statement label field  
1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.3.203\windows\mkl\include\blas.f90(26): error #5149: Illegal character in statement label field  
1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.3.203\windows\mkl\include\blas.f90(26): error #5149: Illegal character in statement label field  
1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.3.203\windows\mkl\include\blas.f90(26): error #5149: Illegal character in statement label field  
1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.3.203\windows\mkl\include\blas.f90(28): error #5149: Illegal character in statement label field  
1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.3.203\windows\mkl\include\blas.f90(28): error #5149: Illegal character in statement label field  
1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.3.203\windows\mkl\include\blas.f90(28): error #5149: Illegal character in statement label field  
1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.3.203\windows\mkl\include\blas.f90(28): error #5149: Illegal character in statement label field  
1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.3.203\windows\mkl\include\blas.f90(28): error #5149: Illegal character in statement label field  
1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.3.203\windows\mkl\include\blas.f90(29): error #5149: Illegal character in statement label field  


1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.3.203\windows\mkl\include\mkl.fi(36): error #5082: Syntax error, found CHARACTER_CONSTANT 'mkl_solvers_ee.fi' when expecting one of: ( : % [ . = =>
1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.3.203\windows\mkl\include\blas.f90(22): error #5082: Syntax error, found '=' when expecting one of: :: ) ( , : * <END-OF-STATEMENT> ; . % (/ + - [ ] /) . ** > ...
1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.3.203\windows\mkl\include\blas.f90(23): error #5082: Syntax error, found IDENTIFIER 'TEGER' when expecting one of: :: ) ( , : * <END-OF-STATEMENT> ; . % (/ + - [ ] /) . = ' ** > ...
1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.3.203\windows\mkl\include\blas.f90(23): error #5082: Syntax error, found '=' when expecting one of: :: ) ( , : * <END-OF-STATEMENT> ; . % (/ + - [ ] /) . ** > ...
1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.3.203\windows\mkl\include\blas.f90(24): error #5082: Syntax error, found IDENTIFIER 'DULEF95_PRECISIONBLAS95ACEASUMREFUNCTIONSASUM_F95' when expecting one of: :: ) ( , : * <END-OF-STATEMENT> ; . % (/ + - [ ] /) . = ' ** > ...
1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.3.203\windows\mkl\include\blas.f90(29): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ) ,
1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.3.203\windows\mkl\include\blas.f90(35): error #5149: Illegal character in statement label field  
1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.3.203\windows\mkl\include\blas.f90(36): error #5149: Illegal character in statement label field  


1>C:\Users\THEUSER~1\AppData\Local\Temp\316813.i(29742): catastrophic error: Too many errors, exiting

(I have no call to the mkl in my code for now, I just do an include of mkl.fi and blas.f90.)

Again, using the automatic linking tool failed. Fine, I am used to this.

In the project properties I undid the "use intel mkl", compiled the file, and had the same output !

Again, having automatically linked to the mkl and automatically unlinking from doesn't let the project in the state it was before, linking.

So I manually linked to it, again. (Yes, I am really annoyed when there's no thrill, when I know the same problem will appear again again, despite everyone having it, etc etc, despite paying for the libraries, etc. But let's put this aside.)

By manually linking to it, I mean doing this : in Project --> Properties -->

  • Fortran --> General --> Additional Include Directories : I added C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.3.203\windows\mkl\include
  • Linker --> General --> Additional Libraries Directories : I added C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.3.203\windows\mkl\lib\intel64_win
  • Linker --> Input --> Additional Dependencies : I added mkl_blas95_lp64.lib mkl_lapack95_lp64.lib mkl_intel_lp64.lib mkl_sequential.lib

My question is : what should I do to make

  • the compiler provided in intel ps xe 2019.3
  • the mkl provided intel ps xe 2019.3

work together while I use visual studio ? Is there a patch or something ? Or an appropriate set of filed in project properties to modify ? ...

Because according to the ouput mentionned above, clearly, your compiler has issues with the code of the libraries (your libraries) you provide.

I must be frank and mention that I am not at all in the mood of trying what was being proposed to the poor chap here :

https://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/topic/801005

that is, using the command line. (Because I use visual studio especially to avoid the command line for huge projects. And also because I think that creating a console hello world is still faster with visual studio than in the command line, whatever might be read here and there.)

0 Kudos
4 Replies
pascal_M_
Beginner
553 Views

Ok, I solved the problem for compilation with dgemm called in the code as follows :

I compiled a mod file from a source file containing

      module mkl_module
      include 'mkl.fi'
      end module

(it took quite a long time to compile, btw ... Why ?) and placed it in the include directory from my intel ps xe 2019.3 installation with all header etc.

Then I removed the "includes" of mkl fortran files in my program, and added a Use mkl_module strictly after each routine etc.

Will this be fixed for the next update as it should ?

(On the contrary to what I wrote about "Project --> Properties --> Linker --> Input --> Additional Dependencies", it is not "mkl_blas95_lp64.lib mkl_lapack95_lp64.lib mkl_intel_lp64.lib mkl_sequential.lib" but "mkl_intel_lp64.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.lib" that made the code work at execution.)

0 Kudos
mecej4
Honored Contributor III
553 Views

The numerous error #5149 messages in #1 are probably the result of your including "blas.f90" in a fixed format source code. For instance, the first non-comment line in blas.f90 starts with "MODULE" in columns 1 to 6, and those characters are not valid in those columns in fixed format Fortran source.

It is best to avoid mixing fixed format and free format Fortran source in the same input file. If you insist on such mixing, you will have to provide directives in the source code to tell the compiler each time when the format is about to be changed.

0 Kudos
pascal_M_
Beginner
553 Views

mecej4 wrote:

The numerous error #5149 messages in #1 are probably the result of your including "blas.f90" in a fixed format source code. For instance, the first non-comment line in blas.f90 starts with "MODULE" in columns 1 to 6, and those characters are not valid in those columns in fixed format Fortran source.

It is best to avoid mixing fixed format and free format Fortran source in the same input file. If you insist on such mixing, you will have to provide directives in the source code to tell the compiler each time when the format is about to be changed.

I conclude that there is no way to tell the compiler to do it for me ? (In the command line.)

0 Kudos
mecej4
Honored Contributor III
553 Views

You can use compiler options to tell the compiler to ignore the extension in the file name (/Tf), assume that the files are in fixed format (/fixed) , in free format (/free), or some meaningful combination of these options. However, such options apply to entire files. To switch between free and fixed format within a source file, the embedded directives DIR$ FREEFORM and DIR$ NOFREEFORM are available. 

However, for the purpose that you implied in #2, it is sufficient to replace the source file of #2 by

!         Fixed form source file
      module mkl_module
      include 'mkl.fi'
      end module

and give the file a ".f" extension. You can compile the fixed source form file to generate the desired .mod file(s).

0 Kudos
Reply