Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
12452 Discussions

How to install and configure FFTW-3.3.3 that can be compiled by "nios2-linux-gcc"

Honored Contributor II



I want to use fftw-3.3.3 in my nios2-uclinux , I install it follow "fftw installation user manual": 


(1)first, verify whether it works well on linux (centos-6.4) 


[root@localhost fftw-3.3.3]# ./configure 

[root@localhost fftw-3.3.3]# make 

[root@localhost fftw-3.3.3]# make install 


Edit the PATH: 


export path=$path: /root/opt/nios2/bin:/usr/local/bin 

export c_include_path=/usrlocal/include 

export library_path=/usr/local/lib 



After that, I write and compile a testfft.c: 


[root@localhost root]# gcc testfft.c -lm -lfftw3 -i/usr/local/bin 

[root@localhost root]# ./a.out 


--the output is correct! it can work on my linux:). 


(2) change to "nios2-linux-gcc" 


[root@localhost root]# nios2-linux-gcc -v 

--the version is 3.4.6, it's ok. 

[root@localhost fftw-3.3.3]# make clean 

--clean fftw pre-install 

[root@localhost fftw-3.3.3]# ./configure cc="nios2-linux-gcc" --host=nios2 

[root@localhost fftw-3.3.3]# make  

[root@localhost fftw-3.3.3]# make install 



then copy the "fftw3.f , fftw3.f03 , fftw3.h , fftw3l.f03 ,fftw3q.f03" from " /usr/local/include" folder to nios2 toolchain folder ".../nios2/include"  

copy the the "fftw-wisedom, fftw-wisdom-to-conf" from "/usr/local/bin" to nios2 toolchain ".../nios2/bin"folder. 

copy the "libfftw3.a," from "/usr/local/lib" to nios2 toolchain ".../nios2/lib" 


(3) compile testfft.c again: 


[root@localhost root]# nios2-linux-gcc testfft.c -lm -lfftw3 -i/usr/local/bin 


/root/opt/nios2/bin/../lib/gcc/nios2-linux-uclibc/3.4.6/../../../../nios2-linux-uclibc/lib/libfftw3.a(mapflags.o)(.text+0x49c): in function `fftw_mapflags': 

: undefined reference to `log' 

/root/opt/nios2/bin/../lib/gcc/nios2-linux-uclibc/3.4.6/../../../../nios2-linux-uclibc/lib/libfftw3.a(mapflags.o)(.text+0x4b8): in function `fftw_mapflags': 

: undefined reference to `log' 

/root/opt/nios2/bin/../lib/gcc/nios2-linux-uclibc/3.4.6/../../../../nios2-linux-uclibc/lib/libfftw3.a(trig.o)(.text+0xf0): in function `real_cexp': 

: undefined reference to `cos' 

/root/opt/nios2/bin/../lib/gcc/nios2-linux-uclibc/3.4.6/../../../../nios2-linux-uclibc/lib/libfftw3.a(trig.o)(.text+0x10c): in function `real_cexp': 

: undefined reference to `sin' 

collect2: ld returned 1 exit status 



--something is wrong, "nios2-linux-gcc" can't compile it .:confused: 


the nios2-linux is "nios2-linux-20090929.tar" 

the nios2gcc is "nios2gcc-20080203.tar.bz2" 


--the nios2-linux is ok, i have verified it on my fpga hardware. 


maybe the configuration is wrong, so would somebody give me some suggestions? 

thank you very much!
0 Kudos
0 Replies