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

Error while linking FFTW in the Visual Environment

david_sallngc_com
1,100 Views
Hi Everyone!

I have written a FORTAN 90 code that uses the FFTW libraries as provided from the FFTW website. I can successfully create an executable via the command line using the Intel Fortran compiler as,

> ifort foo.f90 libfftw3-3.lib

and it works great. I have tried compiling in the Visual environment and continually get LINK errors where the compiler does not recognize the calls to FFTW. I can not seem to find project properties to change in order for the compiler to find the FFTW libraries. I have modified the Project Properties "Linker" configuration "Additional Library Directories" to point to hwere the FFTW library is located. Also, under the "Custom Build Step", I have included in the "Additional Dependencies" the library name, "libfftw3-3.lib".

Could someone please help steer me in the right direction as to how I configure the Project Properties to properly link the FFTW libraries?

Thank you very much.

Sinerely,

David
0 Kudos
8 Replies
Steven_L_Intel1
Employee
1,100 Views

The simplest method is to add the .lib as a "source file". The approach you took is close - the "Additional Dependencies" property you want is under Linker > General.
0 Kudos
Paul_Curtis
Valued Contributor I
1,100 Views
The simplest method is to add the .lib as a "source file". The approach you took is close - the "Additional Dependencies" property you want is under Linker > General.

This is the way that works, and adding a library as a dependency does not.

But why should this be so? Is this an artifact of Visual Studio? Why doesn't adding dependencies work as well?
0 Kudos
Steven_L_Intel1
Employee
1,100 Views
It does work - I do this a lot.
0 Kudos
david_sallngc_com
1,100 Views

The simplest method is to add the .lib as a "source file". The approach you took is close - the "Additional Dependencies" property you want is under Linker > General.
Hi Steve!

Thanks for the help. Adding the FFTW library as a source file works! I never would have thought of adding a library file as a source.

Sincerely,

David
0 Kudos
seabstian1134
Beginner
1,100 Views

The simplest method is to add the .lib as a "source file". The approach you took is close - the "Additional Dependencies" property you want is under Linker > General.

Hi!

I have the same problem as david, but I can not find the specified property. Could you please elaborate the process for me. I am using MCVS 2008, maybe it differs.

thanks a lot,

Sebastian
0 Kudos
Steven_L_Intel1
Employee
1,100 Views

Sorry - I meant Linker > Input.
0 Kudos
seabstian1134
Beginner
1,100 Views

Sorry - I meant Linker > Input.

Thanks, but I think I did this already. I have included libfftw3-3.lib as an additonal dependency in linker->input. The library is read in, but I still get the linker issues. I must have gone wrong at one point, so I will start the process from the front.

Thanks for your fast reply!
0 Kudos
Steven_L_Intel1
Employee
1,100 Views
If you open a "Fortran Build Environment" command prompt and do a:

dumpbin -symbols yourlib.lib > lib.txt

lib.txt will list all the symbols found in the library. Compare that to what the linker says it can't find.
0 Kudos
Reply