Quantcast
Channel: Intel® Software - Intel® oneAPI Math Kernel Library & Intel® Math Kernel Library
Viewing all articles
Browse latest Browse all 3005

Problem compiling Fortran code with MKL

$
0
0

Hi all,

I'm trying to replace my own LU decomposition code with the fortran subroutine gbtrf from MKL. Please bear with me as I am somewhat new to Fortran.

I successfully compiled, run and validated the example (sgbtrfx.f) provided by Intel (2018 release). The compilation was done with:

gfortran  -w source/sgbtrfx.f  -Wl,--start-group /opt/intel/compilers_and_libraries_2018/linux/mkl/lib/intel64/libmkl_intel_lp64.a /opt/intel/compilers_and_libraries_2018/linux/mkl/lib/intel64/libmkl_intel_thread.a /opt/intel/compilers_and_libraries_2018/linux/mkl/lib/intel64/libmkl_core.a -Wl,--end-group lib/libaux_intel64_gfortran.a -L/opt/intel/compilers_and_libraries_2018/linux/mkl/../compiler/lib/intel64 -liomp5  -lpthread -ldl -o _results/intel_lp64_omp_intel_iomp5_intel64_lib/sgbtrfx.out

And it also required me to set:

export LD_LIBRARY_PATH=/opt/intel/compilers_and_libraries_2018.1.163/linux/compiler/lib/intel64_lin

I am now finding some difficulties getting the same subroutine to work with some code I previously had. My compilation and linking were done with:

      1. Compilation

gfortran  -O1  -fopenmp -ffast-math -funroll-loops --param max-unroll-times=2 -Ofast -march=native -mcmodel=medium -fno-range-check -ffree-line-length-0 -fdefault-double-8 -fdefault-real-8 -fdefault-integer-8 -w -c <FILENAME>.f90

      2. Linking

gfortran  -O1  -fopenmp -ffast-math -funroll-loops --param max-unroll-times=2 -Ofast -march=native -mcmodel=medium -fno-range-check -ffree-line-length-0 -fdefault-double-8 -fdefault-real-8 -fdefault-integer-8 -o ......

And I got it to link to the MKL library using:

      1. Compilation

gfortran -O1 -fopenmp -m64 -I/opt/intel/parallel_studio_xe_2018/compilers_and_libraries_2018/linux/mkl/include -ffast-math -funroll-loops --param max-unroll-times=2 -Ofast -march=native -mcmodel=medium -fno-range-check -ffree-line-length-0 -fdefault-double-8 -fdefault-real-8 -fdefault-integer-8 -w -c <FILENAME>.f90

      2. Linking

gfortran  -O1  -fopenmp -L/opt/intel/parallel_studio_xe_2018/compilers_and_libraries_2018/linux/mkl/lib/intel64 -Wl,--no-as-needed -lmkl_gf_ilp64 -lmkl_gnu_thread -lmkl_core -lgomp -lpthread -lm -ldl -ffast-math -funroll-loops --param max-unroll-times=2 -Ofast -march=native -mcmodel=medium -fno-range-check -ffree-line-length-0 -fdefault-double-8 -fdefault-real-8 -fdefault-integer-8 -o ......

as well as

export LD_LIBRARY_PATH=/opt/intel/parallel_studio_xe_2018/compilers_and_libraries_2018/linux/mkl/lib/intel64

But when I call the subroutine sgbtrf with the exact same input as in the example file (sgbtrfx.f) I don't obtain the correct output.

Can anyone help me figure out what might be wrong here? 

Many thanks,

Henrique


Viewing all articles
Browse latest Browse all 3005

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>