01-27-2014 04:19 AM
Hi,
I'm looking for information on building linux software for the cRIO-9068. When looking for software, the first place I look is opkg. However, if the package is not available there it will need to be installed manually.
Let me take a concrete example (the case for which I'm looking for a solution):
opkg installs python 2.6
what if I want to install python 2.7?
In most cases, a linux tar.gz package needs to be decompressed, and then you simply run:
./configure
make
make install
Does opkg contain the required packages to install a complete C/C++ build environment? I've added gcc gcc-symlinks g++ g++-symlinks but will always run into errors trying to build. The error encountered is:
gcc: error trying to exec 'cc1': execvp: No such file or directory
for which I haven't found a fix yet.
What is the recommended way of doing this on NI Linux RT?
Do I have to go to a cross-compiling solution? Or is cross-compiling only faster and possibly more efficient?
The ultimate goal is to use Python with SciPy, preferably in their newer versions. Any ideas are welcome.
Regards,
jtagg
01-27-2014 08:55 AM
jtagg,
cc1 is, oddly, in the "cpp" package:
BradM@linuxgetsreal ~/temp/ontargettools/cpp $ ar p cpp_4.5-r37.1+svnr170880.9_armv7a.ipk data.tar.gz | tar tzvf - | grep cc1
-rwxr-xr-x root/root 9507160 2011-08-01 05:32 ./usr/libexec/gcc/arm-angstrom-linux-gnueabi/4.5.3/cc1
Install cpp from the repositories that we point to with the 2013 release and you should have what you need. Additionally, you may want to consider pointing the repositories at a more recent feed and see if they have the version of python already available for install, you may need to play the part of package manager (telling opkg to ignore dependecies and manually ensure that all dependencies are indeed installed, e.g. many tools will ask that glibc be at least 2.12, but this is not usually required)
01-27-2014 08:56 AM
Here are my notes from when I installed the gcc enviornment on the cRIO-9068 when I got it:
edit /etc/opkg/angstrom-base-feed.conf to look like:
> vi /etc/opkg/angstrom-base-feed.conf
# To enable opkg repo feeds, uncomment the following lines.
src/gz angstrom-base http://us.feeds.angstrom-distribution.org/feeds/next/ipk/eglibc/armv7a/base/
save the file, and exit. (shift : wq <enter>)
remove the lock on libc6
> opkg flag ok libc6
update libc6
> opkg upgrade libc6
install gcc packages
> opkg install gcc
> opkg install gcc-symlinks
Install the needed files from the cpp package
> opkg install cpp
> opkg install cpp-symlinks
Install the standard C library
> cd
> opkg install libc6-dev -t .
note: you must cd to your home directory and then use the -t option to specificy the directory you are in. This is because the default temp directory is not large enough to download the package to.
note: This may take some time as there are a number of dependancies that also need to be downloaded.
You can also use NI's Eclipse IDE enviornment to cross compile. Here is a nice thread that was created back in July:
https://decibel.ni.com/content/thread/17524?tstart=0
I have done both compiling on the cRIO and in Eclipse. I much prefer the cRIO.
Hope that helps.
-TD
01-27-2014 09:01 AM
Hi jtagg,
Since the cRIO-9068 is technically an embedded system, I would not recommend doing any major builds on the device itself. The reason being: you are severely limited by the amount of memory and storage space on the device and it will take a very long time to compile code. When I compiled Python 2.7 for the cRIO-9068 I used a GNU/Linux PC that had a cross-compiler on it. I matched the versions of available required packages for Python from the cRIO-9068 angstrom feed and then performed the compile. Afterwards, I was able to copy everything over to the device and it worked just fine. I did not update libc6 as it did not seem like there were any issues with the current version other than when I tried to install packages. I just used the --nodeps flag with opkg and was very careful to ensure the rest of the dependencies were there.
The Python build on my PC took about 10 minutes, whereas compiling a couple of smaller C programs on the cRIO-9068 itself took me just as long.
01-27-2014 09:15 AM
I would definitely go with tduffy's or BluesKnight's recommendation (with a slight preference for BK's), I was simply noting which package to install to get the missing binary.
01-28-2014 02:09 AM
Hi BK and others,
Thanks for the answers.
Do we have any good tutorials on cross-compiling, or is there one that is particulary appropriate for Eclipse and the cRIO-9068?