[gnuradio 3.5.0] libgnuradio-core.so: undefined reference to `fftwf_free'

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 tofftwf_free’
./.libs/libgnuradio-core.so: undefined reference to fftwf_malloc' ./.libs/libgnuradio-core.so: undefined reference tofftwf_execute’
./.libs/libgnuradio-core.so: undefined reference to
fftwf_plan_dft_c2r_1d' ./.libs/libgnuradio-core.so: undefined reference tofftwf_import_wisdom_from_file’
./.libs/libgnuradio-core.so: undefined reference to
fftwf_export_wisdom_to_file' ./.libs/libgnuradio-core.so: undefined reference tofftwf_plan_dft_1d’
./.libs/libgnuradio-core.so: undefined reference to
fftwf_plan_dft_r2c_1d' ./.libs/libgnuradio-core.so: undefined reference tofftwf_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

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

Alex

Thanks for your fast reply :slight_smile:

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

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

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

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
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

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

Yes, it install fine this time and working good :slight_smile:

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 :slight_smile:

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

Cheers

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?

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