找回密码
 注册
Simdroid-非首页
查看: 144|回复: 0

[3. Fortran] Help: Problem regarding FFTW called by Fortran

[复制链接]
发表于 2005-8-23 05:31:29 | 显示全部楼层 |阅读模式 来自 美国
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 testFFTW  testFFTW.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 testFFTW  testFFTW.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) [info -f g77 M GLOBALS]
username1@cfdcfd $  testFFTW
IN
  0.  0.707106769  1.  0.707106769 -8.74227766E-08 -0.707106888 -1.
-0.707106531
IN (after transform)
  0.  0.707106769  1.  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.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Simapps系列直播

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-11-1 21:38 , Processed in 0.030209 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表