# \[gnuradio 3.5.0\] libgnuradio-core.so: undefined reference to \`fftwf\_free'

**URL:** <https://www.ruby-forum.com/t/gnuradio-3-5-0-libgnuradio-core-so-undefined-reference-to-fftwf-free/215220>\
**Category:** GNU Radio\
**Created:** [December 27, 2011, 10:42am UTC](https://www.ruby-forum.com/t/gnuradio-3-5-0-libgnuradio-core-so-undefined-reference-to-fftwf-free/215220 "2011-12-27T10:42:39Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [December 27, 2011, 10:42am UTC](https://www.ruby-forum.com/t/gnuradio-3-5-0-libgnuradio-core-so-undefined-reference-to-fftwf-free/215220/1 "2011-12-27T10:42:39Z")

</div>

Hello,

I’m on Ubuntu 11.04 32bit

I downloaded gnuradio source (3.5.0), read about reqs then started  
installation process

./configure went fine and I run `make`

After 15min I got error about undefined references from FFT

I had installed ‘libfftw3’ and ‘libfftw3-dev’ 3.2.2 with Synaptic, but  
have  
no idea if provided packages fulfilled some requirements mentioned in  
README: --enable-single --enable-shared configure options.

So I removed ‘libfftw3-dev’ and downloaded FFTW 3.3 source. Build it  
with  
mentioned switches with --prefix=$HOME/.local, so installation ended in:

~/.local/lib and ~/.local/include

as fftw3 configure command was:

./configure --enable-single --enable-shared --enable-sse2  
–prefix=$HOME/.local

Now I extracted fresh from gnuradio archive again, then run:

FFTW3F\_LIBS=$HOME/.local/lib FFTW3F\_INCLUDEDIR=$HOME/.local/include  
./configure

everything went fine and I run `make`

Unfortunately I still get the same error:

# ======================================== make[8]: Entering directory `/home/klonuo/src/gnuradio-3.5.0/gnuradio-core/src/lib' /bin/bash ../../../libtool --tag=CXX --mode=link g++ -g -O2 -Wall -Woverloaded-virtual -pthread -o gnuradio-config-info gnuradio-config-info.o libgnuradio-core.la -L/usr/lib -lboost_program_options-mt -lboost_filesystem-mt -lltdl libtool: link: g++ -g -O2 -Wall -Woverloaded-virtual -pthread -o .libs/gnuradio-config-info gnuradio-config-info.o ./.libs/libgnuradio-core.so -L/usr/lib -lboost_program_options-mt -lboost_filesystem-mt /usr/lib/libltdl.so -pthread -Wl,-rpath -Wl,/home/klonuo/.local/lib ./.libs/libgnuradio-core.so: undefined reference to`fftwf\_free’ ./.libs/libgnuradio-core.so: undefined reference to `fftwf_malloc' ./.libs/libgnuradio-core.so: undefined reference to`fftwf\_execute’ ./.libs/libgnuradio-core.so: undefined reference to `fftwf_plan_dft_c2r_1d' ./.libs/libgnuradio-core.so: undefined reference to`fftwf\_import\_wisdom\_from\_file’ ./.libs/libgnuradio-core.so: undefined reference to `fftwf_export_wisdom_to_file' ./.libs/libgnuradio-core.so: undefined reference to`fftwf\_plan\_dft\_1d’ ./.libs/libgnuradio-core.so: undefined reference to `fftwf_plan_dft_r2c_1d' ./.libs/libgnuradio-core.so: undefined reference to`fftwf\_destroy\_plan’ collect2: ld returned 1 exit status

As I don’t know what else could be problem I thought to ask for help

Thanks

---

<div class="post-metadata">

**Author:** ![klo\_uo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/258eb7/32.png) [@klo\_uo](https://www.ruby-forum.com/u/klo_uo)\
**Post date:** [December 27, 2011, 10:55am UTC](https://www.ruby-forum.com/t/gnuradio-3-5-0-libgnuradio-core-so-undefined-reference-to-fftwf-free/215220/2 "2011-12-27T10:55:38Z")

</div>

Remove the manually installed fftw, reinstall libfftw3-dev and try to  
build. It should work just fine.  
If you want to install all optional dependencies see here:  
[http://gnuradio.org/redmine/projects/gnuradio/wiki/UbuntuInstall#Natty-Narwhal-1104](http://gnuradio.org/redmine/projects/gnuradio/wiki/UbuntuInstall#Natty-Narwhal-1104)

Alex

---

<div class="post-metadata">

**Author:** ![klo\_uo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/258eb7/32.png) [@klo\_uo](https://www.ruby-forum.com/u/klo_uo)\
**Post date:** [December 27, 2011, 11:06am UTC](https://www.ruby-forum.com/t/gnuradio-3-5-0-libgnuradio-core-so-undefined-reference-to-fftwf-free/215220/3 "2011-12-27T11:06:44Z")

</div>

Thanks for your fast reply 🙂

Remove the manually installed fftw, reinstall libfftw3-dev and try to

> build. It should work just fine.

I tried that as first step and because it failed I manually installed  
fftw

> If you want to install all optional dependencies see here:

[http://gnuradio.org/redmine/projects/gnuradio/wiki/UbuntuInstall#Natty-Narwhal-1104](http://gnuradio.org/redmine/projects/gnuradio/wiki/UbuntuInstall#Natty-Narwhal-1104)

> 

I have all dependencies satisfied, only that `make` fails at fftw

Also I would not like to install gnuradio package, as I have some of it  
dependencies installed from source (like scipy, numpy, wx…) which  
aren’t  
recognised by Synaptic, and similar complication

---

<div class="post-metadata">

**Author:** ![klo\_uo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/258eb7/32.png) [@klo\_uo](https://www.ruby-forum.com/u/klo_uo)\
**Post date:** [December 27, 2011, 11:59am UTC](https://www.ruby-forum.com/t/gnuradio-3-5-0-libgnuradio-core-so-undefined-reference-to-fftwf-free/215220/4 "2011-12-27T11:59:14Z")

</div>

If you build fftw manually, please check if you configured it with  
‘–enable-single --enable-shared’ otherwise, only the fixed-point  
version will be built. Also, you can verify after installation via ‘ls  
-l /usr/local/lib/libfftw\*’. I assume you only see libfftw3.so not  
libfftw3f.so, right? After you fixed that gnuradio should build as  
expected.

BR  
Andre

---

<div class="post-metadata">

**Author:** ![klo\_uo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/258eb7/32.png) [@klo\_uo](https://www.ruby-forum.com/u/klo_uo)\
**Post date:** [December 27, 2011, 12:27pm UTC](https://www.ruby-forum.com/t/gnuradio-3-5-0-libgnuradio-core-so-undefined-reference-to-fftwf-free/215220/5 "2011-12-27T12:27:07Z")

</div>

On 12/27/2011 12:16 PM, klo uo wrote:

> -rw-r–r-- 1 klonuo klonuo 2283452 2011-12-27 08:14  
> /home/klonuo/.local/lib/libfftw3f.a  
> -rwxr-xr-x 1 klonuo klonuo 962 2011-12-27 08:14  
> /home/klonuo/.local/lib/libfftw3f.la [http://libfftw3f.la](http://libfftw3f.la)  
> lrwxrwxrwx 1 klonuo klonuo 18 2011-12-27 08:14  
> /home/klonuo/.local/lib/libfftw3f.so → libfftw3f.so.3.3.0  
> lrwxrwxrwx 1 klonuo klonuo 18 2011-12-27 08:14  
> /home/klonuo/.local/lib/libfftw3f.so.3 → libfftw3f.so.3.3.0  
> -rwxr-xr-x 1 klonuo klonuo 1419867 2011-12-27 08:14  
> /home/klonuo/.local/lib/libfftw3f.so.3.3.0

Ok, then according to your output in the last post, gnuradio  
configuration did not set the paths correctly.

> libtool: link: g++ -g -O2 -Wall -Woverloaded-virtual -pthread -o  
> .libs/gnuradio-config-info gnuradio-config-info.o  
> ./.libs/libgnuradio-core.so -L/usr/lib -lboost\_program\_options-mt  
> -lboost\_filesystem-mt /usr/lib/libltdl.so -pthread -Wl,-rpath  
> -Wl,/home/klonuo/.local/lib

Two things are missing, the linker command does not include the library  
(i.e. -lfftw3f) and not the library path (-L/home/klonuo/.local/lib).  
The latter is instead just appended to that last command which is wrong.

FFTW3F\_LIBS should be something like this ‘-L$HOME/.local/lib -lfftw3f’

BR  
Andre

---

<div class="post-metadata">

**Author:** ![klo\_uo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/258eb7/32.png) [@klo\_uo](https://www.ruby-forum.com/u/klo_uo)\
**Post date:** [December 27, 2011, 12:17pm UTC](https://www.ruby-forum.com/t/gnuradio-3-5-0-libgnuradio-core-so-undefined-reference-to-fftwf-free/215220/6 "2011-12-27T12:17:49Z")

</div>

> If you build fftw manually, please check if you configured it with  
> ‘–enable-single --enable-shared’ otherwise, only the fixed-point  
> version will be built.

I did build fftw manually with noted switches as I wrote in my first  
mail:

./configure --enable-single --enable-shared --enable-sse2  
–prefix=$HOME/.local

> Also, you can verify after installation via ‘ls  
> -l /usr/local/lib/libfftw\*’. I assume you only see libfftw3.so not  
> libfftw3f.so, right?

Here is output of `ls -l ~/.local/lib/libbfft*` as I configured gnuradio  
as  
explained in my first mail:

$ _ls -l ~/.local/lib/libfftw_\*  
-rw-r–r-- 1 klonuo klonuo 2283452 2011-12-27 08:14  
/home/klonuo/.local/lib/libfftw3f.a  
-rwxr-xr-x 1 klonuo klonuo 962 2011-12-27 08:14  
/home/klonuo/.local/lib/  
libfftw3f.la  
lrwxrwxrwx 1 klonuo klonuo 18 2011-12-27 08:14  
/home/klonuo/.local/lib/libfftw3f.so → libfftw3f.so.3.3.0  
lrwxrwxrwx 1 klonuo klonuo 18 2011-12-27 08:14  
/home/klonuo/.local/lib/libfftw3f.so.3 → libfftw3f.so.3.3.0  
-rwxr-xr-x 1 klonuo klonuo 1419867 2011-12-27 08:14  
/home/klonuo/.local/lib/libfftw3f.so.3.3.0

---

<div class="post-metadata">

**Author:** ![klo\_uo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/258eb7/32.png) [@klo\_uo](https://www.ruby-forum.com/u/klo_uo)\
**Post date:** [December 27, 2011, 12:53pm UTC](https://www.ruby-forum.com/t/gnuradio-3-5-0-libgnuradio-core-so-undefined-reference-to-fftwf-free/215220/7 "2011-12-27T12:53:40Z")

</div>

Yes, it install fine this time and working good 🙂

What I did was reinstall libfftw-dev with Synaptic and added  
“/usr/local/lib/” to “/etc/ld.so.conf”

However I’m not sure why it worked this way as “$ locate libfftw” shows  
this structure:

/usr/lib/libfftw3.so.3  
/usr/lib/libfftw3.so.3.2.4  
/usr/lib/libfftw3\_threads.so.3  
/usr/lib/libfftw3\_threads.so.3.2.4  
/usr/lib/libfftw3f.so.3  
/usr/lib/libfftw3f.so.3.2.4  
/usr/lib/libfftw3f\_threads.so.3  
/usr/lib/libfftw3f\_threads.so.3.2.4  
/usr/lib/libfftw3l.so.3  
/usr/lib/libfftw3l.so.3.2.4  
/usr/lib/libfftw3l\_threads.so.3  
/usr/lib/libfftw3l\_threads.so.3.2.4  
/usr/local/lib/libfftw3.a  
/usr/local/lib/libfftw3.la

Anyhow it works for me 🙂

Thanks for all replies, I guess previous suggestion with correcting FFTW  
environment variables would also show fine

Cheers

---

<div class="post-metadata">

**Author:** ![klo\_uo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/258eb7/32.png) [@klo\_uo](https://www.ruby-forum.com/u/klo_uo)\
**Post date:** [December 27, 2011, 12:58pm UTC](https://www.ruby-forum.com/t/gnuradio-3-5-0-libgnuradio-core-so-undefined-reference-to-fftwf-free/215220/8 "2011-12-27T12:58:39Z")

</div>

Thinking again maybe it worked not because of changes in  
“/etc/ld.so.conf”  
but because I run “ldconfig”

First time I tried to install gnuradio, I installed “libfftw-dev” and  
some  
other required packages (with Synaptic), but perhaps I needed to run  
“ldconfig” afterwards for libfftw?

---

<div class="post-metadata">

**Author:** ![klo\_uo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/258eb7/32.png) [@klo\_uo](https://www.ruby-forum.com/u/klo_uo)\
**Post date:** [December 27, 2011, 12:37pm UTC](https://www.ruby-forum.com/t/gnuradio-3-5-0-libgnuradio-core-so-undefined-reference-to-fftwf-free/215220/9 "2011-12-27T12:37:38Z")

</div>

> Two things are missing, the linker command does not include the library  
> (i.e. -lfftw3f) and not the library path (-L/home/klonuo/.local/lib).  
> The latter is instead just appended to that last command which is wrong.
> 
> FFTW3F\_LIBS should be something like this ‘-L$HOME/.local/lib -lfftw3f’

Ah, that should be the problem then. Thanks for spotting it, I thought  
just  
absolute path was needed.

I’m trying something else right now (Debian/Ubuntu issue with  
“/etc/ld.so.conf” as noted in gnuradio wiki) and it seem like it would  
build fine, as it’s compiling almost half hour (libfftw error did not  
show)  
and report back shortly, for possible future reference to this problem

Cheers
