NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

FFTW Library with cross compiler on NI 9637

We have a LabVIEW program that I have been implementing in windows. Part of it calls a C++ DLL we have compiled, which in turn calls the DLLs for a fast fourier transform, FFTW, linked here:

http://www.fftw.org/

This is a very common FFT library, and comes included on most Linux distributions.

I want to port my code to be used on the sbRIO 9637 ARM architecture. The *.so that comes with linux distros is not working; the cross compiler complains about an unknown syntax. The source code is readily available, but I cannot get it to compile through Eclipse. It seems to suffer from being unable to #include headers that are in #include'd headers. I have been going in circles with this for awhile and I can't figure it out. Has anybody had success getting this to work, or even better happen to have a working ARM *.so?

0 Kudos
Message 1 of 7
(3,388 Views)

Welcome camacazio!

 

Which version of the OS are you using? I believe that you should be able to install the libfftw (or libfftwf, depending on your OS version) package through the opkg package manager tool.

 

Cross-compiling an existing project through Eclipse (one that usually makes assumptions base on the assumption that it is being built on the OS that it is intended to run on) is usually a painful experience.

 

Taking an ARM binary from another Linux distro and attempting to use it on NI Linux RT is also a risky proposition as most modern Linux distros are so-called "hard float", but current NI Linux RT distro releases are soft-float.

 

I'd recommend trying to use the library from the feeds and, failing that, try to build the library itself on the target, then linking against that target-built library. Of course, the recommended approach can and likely will change depending on what your requirements are regarding deployment or use of this application.

0 Kudos
Message 2 of 7
(3,341 Views)

Thanks for the response! I'm using the RTOS v15.0

Is your suggestion that I should be able to access the RTOS console and that there is an online package manager that I can pipe through to the RT linux on the microprocessor? NI support wasn't aware of any libraries for the FFTW library for RTOS.

I agree that cross compiling existing code is a painful experience (it has been) but the core code has at least been ported well enough, the only roadblock is this library. I have definitely experienced that *.so builds for the library are distro dependent, and it is the case here too.

 

However, the next wall I hit is that Eclipse fails to compile FFTW with the cross compiler. The documentation for FFTW seems to make it sound like a fairly simple affair from a linux environment. Eclipse seems to fail to see headers included in headers though, so I fail at the most basic step of generating my own *.so

0 Kudos
Message 3 of 7
(3,336 Views)

@camacazio wrote:

Thanks for the response! I'm using the RTOS v15.0

Is your suggestion that I should be able to access the RTOS console and that there is an online package manager that I can pipe through to the RT linux on the microprocessor? NI support wasn't aware of any libraries for the FFTW library for RTOS.

 

...

There's a package manager, opkg, that is included in the distribution itself.

 

BradM@devmachine $ ssh admin@crispus-attux

 

NI Linux Real-Time (run mode)

Log in with your NI-Auth credentials.

Password:
admin@crispus-attux:~# opkg update
Downloading http://download.ni.com/ni-linux-rt/feeds/2017/arm/ipk/all/Packages.gz.
Updated source 'uri-all-0'.
Downloading http://download.ni.com/ni-linux-rt/feeds/2017/arm/ipk/cortexa9-vfpv3/Packages.gz.
Updated source 'uri-cortexa9-vfpv3-0'.
Downloading http://download.ni.com/ni-linux-rt/feeds/2017/arm/ipk/xilinx-zynq/Packages.gz.
Updated source 'uri-xilinx-zynq-0'.
admin@crispus-attux:~# opkg list | grep fftw
fftwf - 3.3.4-r0.5 - fftwf version 3.3.4-r0 FFTW
fftwf-dbg - 3.3.4-r0.5 - fftwf version 3.3.4-r0 - Debugging files FFTW This package contains ELF
fftwf-dev - 3.3.4-r0.5 - fftwf version 3.3.4-r0 - Development files FFTW This package contains
fftwf-doc - 3.3.4-r0.5 - fftwf version 3.3.4-r0 - Documentation files FFTW This package contains
fftwf-staticdev - 3.3.4-r0.5 - fftwf version 3.3.4-r0 - Development files (Static Libraries) FFTW This
libfftwf - 3.3.4-r0.5 - fftwf version 3.3.4-r0 FFTW
admin@crispus-attux:~#

Note that you'll need to either enable the serial console (and have access to a null modem cable) or enable sshd from MAX first to gain access to the controller's console.

 

0 Kudos
Message 4 of 7
(3,332 Views)

I am optimistic that if there is a package with fftw for the RTOS, then I'll be in business!

 

I'm connected via the USB virtual network cable that came with the eval kit, and it doesn't seem to be piping through an internet connection to do a package update. Am I going to need to connect with a crossover cable?

0 Kudos
Message 5 of 7
(3,326 Views)

I think you may be able to use Windows Internet Connection Sharing (ICS) to get the job done. Share you desktop machine's internet connection interface with the USB CDC EEM interface. I have not personally tried this, but it seems reasonable, be sure to let us know if this works out.

0 Kudos
Message 6 of 7
(3,313 Views)

That is very promising! In the immediate time frame I have to take a detour attempt away from that, but I will revisit soon and be sure to report in full!

0 Kudos
Message 7 of 7
(3,285 Views)