Search code examples
compiler-errorsfortrangfortranintel-mklcompiler-flags

link gfortran with Intel MKL


I have an application that is written in Fortran and call Intel PARDISO for parallelization. Linking directly with PARDISO doesn't seem like a possibility because the current gfortran I'm using is 5.4.0.

What compiler options/flags do you use to link gfortran with Intel MKL, assuming that Intel MKL is installed on the computer? The MKL libraries version is 2018.0.

Thanks a lot!

Note: The application was compiled without any error using ifort -mkl flag that naturally links the application with Intel MKL.


Solution

  • I agree with @tim18 that you should use the link advisor.

    However to compile the test singular value decomposition program from Intel with gfortran the following works:

    gfortran -I${MKLROOT}/include -fopenmp -o dgesvd dgesvd.f \
             -L${MKLROOT}/lib/ -lmkl_core -lmkl_gnu_thread -lmkl_gf_lp64