【发布时间】:2014-11-28 10:21:31
【问题描述】:
我目前正在尝试在 Fortran 上使用 OpenMP 运行 fftw,但我在运行任何程序时遇到了一些问题。
我相信我已经正确安装/配置了 fftw:
./configure --enable-openmp --enable-threads
我似乎拥有所有正确的库和文件,但我无法运行任何程序,我不断收到错误
undefined reference to 'fftw_init_threads'
我使用的代码如下:
program trial
use omp_lib
implicit none
include "fftw3.f"
integer :: id, nthreads, void
integer :: error
call fftw_init_threads(void)
!$omp parallel private(id)
id = omp_get_thread_num()
write (*,*) 'Hello World from thread', id
!$omp barrier
if ( id == 0 ) then
nthreads = omp_get_num_threads()
write (*,*) 'There are', nthreads, 'threads'
end if
!$omp end parallel
end program
我会运行它
gfortran trial.f90 -I/home/files/include -L/home/files/lib -lfftw3_omp -lfftw3 -lm -fopenmp
如果有人可以帮助我,将不胜感激。
【问题讨论】: