NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding dev packages to NI toolchain

Solved!
Go to solution
Highlighted

Has anyone got any experience or tips how to add additional dev packages to the NI RT toolchain?

 

The toolchain comes with opkg and I assumed it would be straightforward to use that to install additional packages into the toolchain on the build host, but it refuses to install anything due to incompatible architecture. "opkg print-architecture" shows:

 

arch all 1
arch noarch 1
arch x86_64 10

 

(I was expecting to see cortexa9-vfpv3 somewhere)

 

This is the package I'm attempting to install (downloaded from http://download.ni.com/ni-linux-rt/feeds/2017/arm/cortexa9-vfpv3/ )

 

libxml2-dev_2.9.4-r0.49_cortexa9-vfpv3.ipk

 

That package installs without issue on my target device.

 

Suggestions are welcome.

 

0 Kudos
Message 1 of 6
(234 Views)
Highlighted

Hi GBeaton,

A couple of questions to get a better understanding of the system state.

  1. What Real-Time device are you using?
  2. Have you installed any software to the device from NI MAX? 
  3. Is the device in Safe Mode?
  4. What output do you see when you run "opkg update" from the console? Is it able to fetch all the feeds properly?

 

Charlie J.
National Instruments
0 Kudos
Message 2 of 6
(176 Views)
Highlighted

Hi GatorBait,

 

We have several devices, mostly NI-9064 and NI-9065 cRIOs. My question is not about installing packages on the device however, I have no issue with that.

 

I should have been clearer in my original post. We use the NI toolchain from here to cross-compile C applications on a build host, which we then package and install onto various target devices:

http://www.ni.com/download/labview-real-time-module-2017/6760/en/

 

My question is really just about how to get additional development packages installed into the toolchain on the build host. I only mentioned opkg because it's there in the toolchain (i.e. it runs on the build host), and I can't see any other reason for it to be there. I also don't really see what use those development packages (i.e. header files and libraries) would be on the target device itself, unless someone is compiling natively on the device (we are not). If these assumptions are incorrect, please ignore them.

 

If there is another recommended mechanism to get additional development packages in the toolchain itself, please educate me. One of our subprojects has introduced a dependency on some external libraries and it's causing some headaches at the moment.

0 Kudos
Message 3 of 6
(140 Views)
Highlighted

[ apologies if this is a repeat, my original reply was flagged as spam ]

 

Thanks for your reply. Sorry I should have been clearer in my original post.

 

We use various devices, mostly NI-9064 and NI-9065 cRIOs. We have no issue installing packages on any target devices, that's not what I am asking about.

 

We are developing in C using a toolchain from NI (oecore-x86_64-cortexa9-vfpv3-toolchain-5.0). We cross-compile on a Linux host, build an ipk file, transfer to a target cRIO, and install using opkg on the target. No problems there.

 

However one of our subprojects has recently introduced a compile-time dependency on an external library that is not present in the NI toolchain. I am looking for a way to install the development version of that library (i.e. header files and libraries) into the toolchain on the build host. My immediate need is for libxml2-dev (found in the ni-linux-rt feed) but I am really looking for a general solution to installing dev packages into the toolchain on the build host, not on the target.

 

My first assumption was that's the reason a host version of opkg is included in the toolchain. I can't think of any other use for a version of opkg that runs on the host.

0 Kudos
Message 4 of 6
(161 Views)
Highlighted
Solution
Accepted by topic author GBeaton

Ah, I misunderstood your question. You're looking for dependencies in the sysroot for either linking or inclusion as dependencies.

 

I'll be honest: I usually just copy the dependencies manually from the target or (if there's a larger number of them) compile on the target itself. That being said, people have had success with opkg on the host system previously. However, i believe you'll want to copy the /etc/opkg/ directory from your target to the sysroot to overcome the arch limitation as well as ensure you're using the flag to install to the sysroot. 

 

This post is probably a bit more helpful than I'm being.

 

EDIT: For some additional context, you need to manually copy the conf as our toolchain may support more than one version of the software installed to a Linux Real-Time system. E.g., the 18.0 toolchain supports both 2018 and 2019 software stacks. However, those stacks have different opkg repos and you'll need to manually switch the configurations to ensure the package version you build against are the same as in the repos. 

Charlie J.
National Instruments
Message 5 of 6
(157 Views)
Highlighted

Cheers, I think that puts me in the right direction.

0 Kudos
Message 6 of 6
(151 Views)