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

problem linking mkl to dft

juan_martinez
Beginner
645 Views
hi!

I am new in the stuff of the intel fortran compiler, I work in beam prpagation and need tu use Fourier Transform. I installed the fortran compiler 10.1.008 and the imkl 10.0.1.014 and read the examples of the refence manual for the imkl I made this program:

program fft

! Fortran example.
! 1D complex to complex, and real to conjugate even

USE MKL_DFTI
Complex :: X(100)
Real :: Y(34),del,x1
type(DFTI_DESCRIPTOR),POINTER ::My_Desc1_Handle,My_Desc2_Handle
Integer :: Status,i,j,n

pi=3.1416
n=100
open(unit=3,file='graficos.d')
del=2*pi/float(n)

do i=0,n-1
x1=-pi+i*del
X(i+1)=exp(-x1**2)
write(3,*)x1," ",X(i)
enddo


!...put input data into X(1),...,X(32); Y(1),...,Y(32)
! Perform a complex to complex transform

Status = DftiCreateDescriptor(My_Desc1_Handle,DFTI_SINGLE,DFTI
+_COMPLEX,1,32)
Status = DftiCommitDescriptor( My_Desc1_Handle )
Status = DftiComputeForward( My_Desc1_Handle, X )
Status = DftiFreeDescriptor(My_Desc1_Handle)
! result is given by {X(1),X(2),...,X(32)}

! Perform a real to complex conjugate even transform

! Status = DftiCreateDescriptor(My_Desc2_Handle, DFTI_SINGLE,DFTI
! +_REAL, 1, 32)
! Status = DftiCommitDescriptor(My_Desc2_Handle)
! Status = DftiComputeForward(My_Desc2_Handle, Y)
! Status = DftiFreeDescriptor(My_Desc2_Handle)

! result is given in CCS format.

END

And I read the user guide and Imade this compilation line:

ifort -o exec ejemplo1.f -L $/opt/intel/mkl/10.0.1.014/lib/32/ -I $/opt/intel/mkl/10.0.1.014/include/ -lmkl_ia32 -lguide -lpthread

And then the machine shows this errors

fortcom: Error: ejemplo1.f, line 7: Error in opening the compiled module file. Check INCLUDE paths. [MKL_DFTI]
USE MKL_DFTI
----------^
fortcom: Error: ejemplo1.f, line 10: This derived type name has not been declared. [DFTI_DESCRIPTOR]
type(DFTI_DESCRIPTOR),POINTER ::My_Desc1_Handle,My_Desc2_Handle
-----------^
compilation aborted for ejemplo1.f (code 1)

I don't know what happen here, if someone can help me say me where is the error, in the program? in the compilation line?

My OS is penSUSE 10.3, 32 bits, i386

0 Kudos
1 Reply
Tabrez_Ali
Beginner
645 Views
You have to compile the module first. The source file is probably provided in /opt/intel/mkl/10.0.1.0.14/include as mkl_dfti.f90 or something similar

Also link using -L/opt/intel/mkl/10.0.1.0.14/lib/32 -lmkl_ia32 -lguide etc. etc.
0 Kudos
Reply