NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Building libsndfile for the cRio

Solved!
Go to solution

Hi All

Apologies if this is a bit of a noob question but it might be useful for others using the cRio 9068/NI Real Time.

I'm trying to use the libsndfile library to write .wav files from data collected using the cRio. For linux you are either supposed to build from source code or download a package for the distribution you're using. I downloaded the folder containing source code for libsndfile, transferred to the cRio and then connected to the cRio via putty to tried and build the libsndfile library  using

        sh ./configure

        make

        make install

When I try this it seems like an error occurs due to no compiler being found.

pwd

/home/admin/lib/libsndfile-1.0.25

admin@cRioKE:~/lib/libsndfile-1.0.25# sh ./configure

checking build system type... armv7l-unknown-linux-gnueabi

checking host system type... armv7l-unknown-linux-gnueabi

checking target system type... armv7l-unknown-linux-gnueabi

checking for a BSD-compatible install... Cfg/install-sh -c

checking whether build environment is sane... yes

checking for a thread-safe mkdir -p... Cfg/install-sh -c -d

checking for gawk... no

checking for mawk... no

checking for nawk... no

checking for awk... awk

checking whether make sets $(MAKE)... no

checking for gcc... no

checking for cc... no

checking for cl.exe... no

configure: error: in `/home/admin/lib/libsndfile-1.0.25':

configure: error: no acceptable C compiler found in $PATH

See `config.log' for more details

admin@cRioKE:~/lib/libsndfile-1.0.25#

I'm relatively new to this so would like some advice on how you would generally go about building libraries for the cRio? Is there something I need to install or am I fundementally misunderstanding something.

Thanks in advance for the help.

0 Kudos
Message 1 of 10
(9,085 Views)

Re: Building software for NI Linux RT

That link should be helpful

Message 2 of 10
(4,753 Views)
Solution
Accepted by topic author jamie_mac

Thanks Brad

Eventually I got things working. For future inexperienced people (like me) here's a rough summary of how:

1) Go to this great walkthorugh on how to install stuff on the cRio and read it all the way through.

2) Make sure your cRio 9068 is connected to the internet (e.g. ping www.bbc.co.uk usually works) and follow the walkthrough up to the point a new libc6 library is installed. Do not install a new version of libc6.

3) Now install libsndfile

Check the libsndfile package exists: opkg list | grep sndfile

Install the libsndfile package opkg install libsndfile-dev --force-depends

Install the libsndfile static lib package opkg install libsndfile-staticdev --force-depends

The --force-depends flag is used because opkg install libsndfile-dev will flag an error due to an out of date libc6 package. However it seems to work fine if an install is just forced through.

4) Step 3 should have got everything working on the cRio but if you're using Eclipse like me, nothing will build.

Note: I am  sure there is probably a neater way to this next part but I botched as follows:


Check where the new files have installed on the cRio: opkg files libsndfile-dev

                                       opkg files libsndfile-staticdev

     You should end up with something very similar below-if not something has gone wrong somewhere;


     /usr/include/

     /usr/lib/pkgconfig/sndfile.pc

     /usr/lib/libsndfile.so

     /usr/include/sndfile.hh

     /usr/lib/pkgconfig/

     /usr/include/sndfile.h

     /usr/lib/libsndfile.la


     /usr/lib/libsndfile.a

5) Copy the files libsndfile.a, sndfile.h and sndfile.hh from your cRio. I did this using terminal to save files onto a usb stick. Next go to the following address on your computer:

<C:\Program Files>\National Instruments\Eclipse\toolchain\gcc-4.4-arm\i386\lib\gcc\arm-none-linux-gnueabi\4.4.1

Copy libsndfile.a direct to the directory. Copy sndfile.h and sndfile.hh to the 'include' folder

6) Restart Eclipse, clean your project and rebuild. You should now be able to use the sndfile library. Just stick #include <sndfile.hh> at the top of your source/header file.

    

0 Kudos
Message 3 of 10
(4,753 Views)

Another option you have is to actually use the resources on your target from Windows! you would need to do something like configuring cifs/samba shares on your target or install sshfs on your Windows machine (haven't tried it, but https://code.google.com/p/win-sshfs/ looks promising), point your Eclipse project to the resources "on your computer" (really accessed from the target at a location on your computer), and away you go!

Thanks for fleshing out some of the details and providing a link to the document that codifies things a bit more than the discussion I linked to. It's great to see people doing things with these targets, I was excited enough when I heard about these things that I moved from a different internal team just to be involved with them.

Message 4 of 10
(4,753 Views)

Thanks Brad.

I'll have a look at trying to use your solution when I get a moment.

Yeah the cRio 9068 is a  great wee thing once you get over an initial few humps (for users relatively inexperienced in embedded computers anyway). We're hoping to eventually deploy ours in an autonomous bouys to detect and localise the position of porpoises and dolphins by recording the high frequency vocalisations they make on lots of different hydrophones. Having an all in one and relatively open package like this along with the number of resources and support associated with both NI and Linux is fantastic for us- good job NI.

I'll post something once we deploy the unit but untill then I'm sure there will be a few more questions;-)

0 Kudos
Message 5 of 10
(4,753 Views)

jamie_mac wrote:

...

We're hoping to eventually deploy ours in an autonomous bouys to detect and localise the position of porpoises and dolphins by recording the high frequency vocalisations they make on lots of different hydrophones.

...

Very cool! You may also want to look into this other thread, if you haven't already seen it: Re: Using ppp on NI Linux Real-Time with a EDGE modem

0 Kudos
Message 6 of 10
(4,753 Views)

Wow,

Really cool application indeed. Any chance you have the time to share this story on the LabVIEW Sweet Apps Blog? Applications like yours help us stay extra motivated about the products we bring to market!

Sanjay C.
Embedded Software Product Manager| National Instruments
0 Kudos
Message 7 of 10
(4,753 Views)

Thanks. Looks like a good place to write up what we're doing. Once I get the cRio 9068 working and deploy this summer I'll write something for the blog. For now, here's some dive tracks of porpoises calculated using data collected from NI6356 USB DAQ cards, the NIDAQ C library and ten hydrophones sampling at 500kS/s. Not quite as convenient as the autonomous system that's being developed using the cRio 9068 (you have to be on a large vessel with a laptop and big power supply to collect this data as opposed to throwing a small bouy off a rib).

0 Kudos
Message 8 of 10
(4,753 Views)

Pic attached20130711_track_format_detections_2_3D_bathymetry2.png

Message 9 of 10
(4,753 Views)

Wow,

Still really cool data -- exciting to see and hear about what happens when you can collect much more data with the cRIO deployment. Also, please do bump this thread with a link to the writeup when you get around to that; it can be easy to miss things in the noise! (pun almost intended)

Sanjay C.
Embedded Software Product Manager| National Instruments
0 Kudos
Message 10 of 10
(4,753 Views)