Help: Problem regarding FFTW called by Fortran
Below is my problem.===========================================================================
The problem I have is the intel fortran compiler seems not be able to find a
subroutines in the application package I used. I tried to use FFTW to do Fast
Fourier Transform. The FFTW package is written in C but in such a way that it
can be called by Fortran. There are many subroutines in the package. I wrote my
Fortran code and call some of subroutines from FFTW package. If I use ifort, the
intel Fortran compiler to compile the program, it doesn't work. It gave me error
message, e.g.
username1@cfdcfd $ ifort -o testFFTWtestFFTW.f -I/usr/local/include/ -L
/usr/local/lib/ -lrff tw -lfftw -static
/opt/intel_fce_80/lib/libifcore.a(for_open_proc.o)(.text+0x3d86): In function
`for__compute_fi lename':
: Using 'getpwnam' in statically linked applications requires at runtime the
shared libraries from the glibc version used for linking
/opt/intel_fce_80/lib/libifcore.a(for_open_proc.o)(.text+0x3e9d): In function
`for__compute_fi lename':
: Using 'getpwuid' in statically linked applications requires at runtime the
shared libraries from the glibc version used for linking
/tmp/ifortT2mKoq.o(.text+0x4f): In function `MAIN__':
: undefined reference to `rfftw_f77_create_plan_'
/tmp/ifortT2mKoq.o(.text+0x71): In function `MAIN__':
: undefined reference to `rfftw_f77_create_plan_'
/tmp/ifortT2mKoq.o(.text+0x15d): In function `MAIN__':
: undefined reference to `rfftw_f77_one_'
/tmp/ifortT2mKoq.o(.text+0x177): In function `MAIN__':
: undefined reference to `rfftw_f77_one_'
/tmp/ifortT2mKoq.o(.text+0x22a): In function `MAIN__':
: undefined reference to `rfftw_f77_destroy_plan_'
/tmp/ifortT2mKoq.o(.text+0x236): In function `MAIN__':
: undefined reference to `rfftw_f77_destroy_plan_'
However, if I use g77 to compile the exact same code, it only gave a warning but
the program can be compiled and run with a correct result as follows:
username1@cfdcfd $ g77 -o testFFTWtestFFTW.f -I/usr/local/include/ -L
/usr/local/lib/ -lrfftw-lfftw -static
testFFTW.f: In program `testfftw':
testFFTW.f:30: warning:
CALL rfftw_f77_create_plan(PLAN,N,FFTW_REAL_TO_COMPLEX,
1
testFFTW.f:33: (continued):
CALL rfftw_f77_create_plan(PINV,N,FFTW_COMPELX_TO_REAL,
2
Argument #3 of `rfftw_f77_create_plan' is one type at (2) but is some other type
at (1)
username1@cfdcfd $testFFTW
IN
0.0.7071067691.0.707106769 -8.74227766E-08 -0.707106888 -1.
-0.707106531
IN (after transform)
0.0.7071067691.0.707106769 -8.74227766E-08 -0.707106888 -1.
-0.707106531
I've written another code using C language and use FFTW to do Fast Fourier
Transform. I can compile the code with icc, intel C compiler, with no problem.
It seems to me that the ifort can't find the library or subroutines of FFTW
because the package is written in C while we try to call it from Fortran, but
I'm not totally sure if this is the case.
=====================================================================
I am really appreciate any of your help.
页:
[1]