# Link FFTW3 in OOT module

**URL:** <https://www.ruby-forum.com/t/link-fftw3-in-oot-module/239442>\
**Category:** GNU Radio\
**Created:** [February 26, 2014, 2:34pm UTC](https://www.ruby-forum.com/t/link-fftw3-in-oot-module/239442 "2014-02-26T14:34:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [February 26, 2014, 2:34pm UTC](https://www.ruby-forum.com/t/link-fftw3-in-oot-module/239442/1 "2014-02-26T14:34:00Z")

</div>

Dear all

I try to link the FFTW3 lib to my OOT module but always get the error:

Linking CXX executable test-mymodule  
libgnuradio-mymodule.so: undefined reference to `fftw_plan_dft_1d' libgnuradio-mymodule.so: undefined reference to`fftw\_destroy\_plan’  
libgnuradio-mymodule.so: undefined reference to `fftw\_malloc’

How can I add FFTW3 to cmake? I found a solution of older days where  
./configure was used, but with the cmake version I can’t find a  
solution. Is it possible to use gr\_modtool do link a library?

Thanks for the help.  
Best Regards  
Mischa

---

<div class="post-metadata">

**Author:** ![Sabathy\_M](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b782af/32.png) [@Sabathy\_M](https://www.ruby-forum.com/u/Sabathy_M)\
**Post date:** [February 26, 2014, 2:45pm UTC](https://www.ruby-forum.com/t/link-fftw3-in-oot-module/239442/2 "2014-02-26T14:45:47Z")

</div>

Hi Mischa,

we need to make an FAQ of this 🙂  
actually, to use the fftw, you need to directly link to the fftw.  
Depending on whether you need the single precision floating point  
version (“fftwf\__" which GNU Radio uses) or the double precision one  
("fftw\__”), you can use the FindFFTW3(f).cmake script from the GNU Radio  
source tree,  
or use my modified version.  
Put the .cmake modules under cmake/Modules, and add the  
find\_package(FFTW3(f)) directive to your master CMakeLists.txt; also,  
add the link and include directories (look at the occurences of “FFT” in  
my CMakeLists.txt):

> <https://gist.github.com/marcusmueller/7783656>

Greetings,  
Marcus
