Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

FFTW

i46
Beginner
838 Views
Dear All,
i don't understand nothing about computers,I need help step by step.I have Windows7 64bit on my pc and I
want to arrive to use a Fortran Project (I have Microsoft Visual studio 2008 and Intel Fortran compiler 11.0-061) with FFTW.
What I did is:
1)download fftw-3.2.2-dll64.zip from the web www.fftw.org and extract the files
2)into Visual Studio 2008 x64 Win64 Command Prompt I typed the command :lib /def:libfftw3-3.def and created
libfftw3-3.lib (by default the machine is x64)
3)I put it in the directory Resource Files of my Project Solution Explorer
4)In the Project Properties I put:
the path of my lib in Additional Include Directories under Fortran General
the path of my lib in AdditionalLibrary DirectoriesunderLinker General
the name libfftw3-3.lib in Additional Dependencies in Linker Input

The Debug is under x64 platform.
I didn't added any particular include command at the beginning of my file .for thatI want to build .Inside I use commands like
call dfftw_execute (plan_forward).

If I build,it gives me the error:
error LNK2019:unresolved external symbol DFFTW_EXECUTE

This for all the fftw callings I have in my file .
Is it wrong what I did with the library or the problem is in the commands I used?

What I must do ?

Thanks a lot
i
0 Kudos
5 Replies
mecej4
Honored Contributor III
838 Views
The FFTW sources were written in C; to call the FFTW routines from Fortran, you have to match the case and the underscoring added to external routine names. I don't have Win64 handy, but you may try the following, which is what I needed for Win32, at the command line:

ifort /I. /assume:underscore /Qlowercase ex.f90 libfftw3-3.lib

You have to enable the corresponding compiler options in the VS IDE.
0 Kudos
i46
Beginner
838 Views
Thanks for the cue,that I will try to follow.Unfortunately I 'm rather slow because I'm not used to work from
the command line.Can't I try nothing before remaining inside Microsoft Visual Studio 2008?
0 Kudos
Jugoslav_Dujic
Valued Contributor II
838 Views
There are IDE equivalents of command-line options given by mecej4. For example, if you type /assume:underscore in the Ifort MSVS documentation, you will find that it is located in External Procedures > Append Underscore to External Names.
0 Kudos
i46
Beginner
838 Views
Excellent work guys!Now I see the light.Now the fftw seem to work,but a new problem has born that I didn't have before changes.My program uses,in addition to fftw,also imsl libraries.It is dynamically linked using the
'link_fnl_shared.h' include file precisely.It worked fine previously,but now if I build it gives errors like this:
error LNK2019:unresolved external symbol dcsper_referenced in function MAIN_

How to have both fftw and imsl work in my program?
0 Kudos
Steven_L_Intel1
Employee
838 Views
Ok, time for me to get on my high horse.

PLEASE DO NOT USE /names or /iface to resolve such issues. They will generally create more problems than they solve. If you are calling C routines with lowercase names, I recommend either:
  1. Write an interface block for the C routines with the BIND(C) attribute specified
  2. Add !DEC$ ATTRIBUTES ALIAS directives for the routines with non-uppercase names
If you insist on changing the meaning of Fortran code with switches, then the solution to the IMSL problem is to USE the appropriate IMSL module to bring in the definitions of the routines. In your case, that is probably NUMERICAL_LIBRARIES. This will override the /names switch.
0 Kudos
Reply