Reputation: 141
I'm having a lot of trouble linking the Intel MKL libraries to my code in C++. I downloaded the MKL library from this link: https://software.intel.com/content/www/us/en/develop/tools/math-kernel-library/choose-download/windows.html
Then it says to use MKL Link Line Advisor to obtain the proper compiler options, which I'm having a lot of trouble figuring out. For reference, I'm using Windows, g++ 8.1.0 and MinGW-W64. Here is part by part:
Intel product: Intel MKL 2020, since I just downloaded it.
OS: Windows, no issues there.
Compiler: Intel(R) Fortran? I'm using g++ to compile my C++ code, so I have no idea since that option is not available. Doing some research in stackoverflow, it seems the right choice is Intel(R) Fortran
Architecture: Intel(R) 64, since I have a 64-bit OS?
Dynamic/Static Linking: Static linking I guess?
Interface layer: 64-bit, since I have a 64-bit OS?
Threading layer: OpenMP, since my current C++ code uses -fopenmp?
OpenMP library: Intel(R) libiomp5. Only one option, so no issues here.
Fortran95 Interfaces: BLAS95 and LAPACK95
The above choices give me the following compiler options
/4I8 /module:"%MKLROOT%"\include\intel64/ilp64 -I"%MKLROOT%"\include
And this results in error from the compiler:
/4I8: No such file or directory
Can somebody help me please?
Upvotes: 1
Views: 4151
Reputation: 802
I think you should use -DMKL_ILP64 -I"%MKLROOT%"\include for g++. You should definitely not pick Intel(R) Fortran for the compiler since you are not compiling Fortran programs.
Upvotes: 0