Performance Tools for Software Developers - Building FFTW* with the Intel® Compilers

Submit New Article

Last Modified On :   September 19, 2008 1:00 AM PDT
Rate
 



Introduction

This guide is intended to help Intel® C++ Compiler customers build the FFTW* library on Mac OS*. The FFTW library is used for high performance computation of the Discrete Fourier Transform (DFT).


Version Information

This guide applies to FFTW version 3.1.2 and the Intel C++ Compiler version 10.0 for Mac OS.


Application Notes

FFTW is a portable open source library for computing DFTs and is one of the fastest such libraries available. In addition to the library, FFTW also includes a benchmark application. FFTW can be used on many platforms, but this particular guide is intended for Mac OS. FFTW can compute DFTs in multiple dimensions and with arbitrary sizes, using either real or complex data. More information about FFTW can be found at:

http://fftw.org


Obtaining the Source Code

The source code can be found at:

http://fftw.org/download.html

Currently, the most recent stable version of FFTW is 3.1.2. Here is a direct link to that version:

http://software.intel.com/file/7251


Obtaining the latest version of the Intel C++ Compiler

Licensed users of the Intel compilers may download the most recent versions of the compiler from the Intel® Download Center which is accessed by logging into your account at the Intel® Registration Center.

Evaluation versions of the Intel compilers may be found at the Intel® Evaluation Software Center.


Prerequisites

Hardware: This note has been tested on Intel® Core® 2 Duo processors.

Software: This note applies to use of version 10.0 of the Intel C++ Compiler for Mac OS.


Configuration and Set-up Information

In order to use this guide, you will need to have the Intel C++ Compiler installed. No additional configuration is required on Mac OS. However, you may optionally execute the following commands, which will set up some environment variables. This can be helpful if you have multiple versions of the Intel C++ Compiler on your system and would like to switch between them.

IA-32:
source /opt/intel/cc/10.0. xxx/bin/iccvars.sh

Intel® 64:
source /opt/intel/cce/10.0. xxx/bin/iccvars.sh

You will need to replace “xxx” in the above commands with the three digit build number of your compiler.


Source Code Changes

No source code changes are required to build FFTW with the Intel® compiler.


Building FFTW

After you download the source code, use the following commands to extract the archive:

tar –zxvf fftw-3.1.2.tar.gz
cd fftw-3.1.2

Now, use the following commands to build the FFTW library and benchmark executable:

./configure CC=icc CFLAGS=-gcc --with-our-malloc16 --enable-threads
--with-combined-threads --enable-sse2
make

The resulting library will be called libfftw3.la and will be placed in the current directory. The benchmark executable will be called bench and will be placed in the tests directory. Optionally, you can also run make install to copy some of the output files to your /usr/local directory.


Running FFTW

Since FFTW is a library, it cannot be run independently. It must be linked with an executable. However, there is a benchmark executable that uses FFTW which can be used for testing. Here is an example of how to use the benchmark:

cd tests
./bench -opatient 512 1024 2048 4096

The –opatient switch is recommended for benchmarking. The numbers listed are the problem sizes that should be run in each trial. In the example shown, we are running four problems of sizes 512, 1024, 2048, and 4096. The number of trials and problem sizes chosen in this example are arbitrary. Also, problem sizes can be repeated in the list for multiple trials of the same problem size.


Verifying Correctness

To verify that the results are being computed correctly, you can use the benchmark executable as you normally would, but with the --verify switch. For example, you could execute the following command from the fftw-3.1.2/tests directory:

./bench --verify 4096

If the results were correct, no output will be shown. Otherwise, there will be an error message.


Benefits

This note demonstrates the use of FFTW with the latest version 10.0 Intel C++ Compiler technology. Following this method will produce object files and libraries that are compatible with the latest Intel compilers.


Known Issues and Limitations

There are no known issues or limitations with building FFTW with the Intel C++ Compiler 10.0.

 

This link will take you off of the Intel Web site. Intel does not control the content of the destination Web Site.

 






This article applies to: Intel® C++ Compiler for Mac OS X* Knowledge Base