- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is it possible to use the modern f2003 interface for FFTW3 in Intel Fortran Composer?
The program example is the following
[fortran]program test_fftw3
use,intrinsic :: iso_c_binding
implicit none
include 'fftw3.f03'
integer :: n
type(c_ptr) :: fw,bk,ptr,ptc
double precision,pointer :: fftr(:)
double complex,pointer :: fftc(:)
n=2**20
ptr=fftw_alloc_real(int(2*n,C_SIZE_T)); call c_f_pointer(ptr,fftr,[2*n])
ptc=fftw_alloc_complex(int(n+1,C_SIZE_T)); call c_f_pointer(ptc,fftc,[n+1])
fw=fftw_plan_dft_r2c_1d(2*n,fftr,fftc,FFTW_ESTIMATE)
bk=fftw_plan_dft_c2r_1d(2*n,fftc,fftr,FFTW_ESTIMATE)
do i=1,n
fftr(i)=1.d0/dble(i)
end do
do i=n+1,2*n
fftr(i)=0.d0
end do
call fftw_execute_dft_r2c(fw,fftr,fftc)
call fftw_destroy_plan(fw)
call fftw_destroy_plan(bk)
call fftw_free(ptr)
call fftw_free(ptc)
end program[/fortran]
The compilation gives
[bash]draug@fujik:~/work$ uname -a
Linux fujik 3.0.0-16-generic #28-Ubuntu SMP Fri Jan 27 17:44:39 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
draug@fujik:~/work$ ifort -V
Intel Fortran Intel 64 Compiler XE for applications running on Intel 64, Version 12.1.3.293 Build 20120212
Copyright (C) 1985-2012 Intel Corporation. All rights reserved.
FOR NON-COMMERCIAL USE ONLY
draug@fujik:~/work$ ifort fftw.f90
fftw.f90(4): error #5102: Cannot open include file 'fftw3.f03'
include 'fftw3.f03'
---------^
[/bash]
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is certainly possible, but FFTW is a third party package. Intel compilers and MKL come with FFTW-compatible wrappers and interfaces to MKL routines, but you may want to obtain and install the full FFTW, especially if you want to use F9X/F2003 style interfaces. You can build FFTW from source (some posts in these Intel forums have reported doing that) or you may try to obtain a package for your Linux distribution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I will comment that the error you saw is that there is no file named fftw.f03 in the include path. You'll need to provide that in order to make any progress. Perhaps you need to use -I to add the path to where this file can be found.
![](/skins/images/1FC86CD46823E418D1E2B7B4DC10231C/responsive_peak/images/icon_anonymous_message.png)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page