LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to deploy .so file in NI Linux RT, target: cRIO-904x and x86-64

Good morning,

I'm working to develop a C code and In the code I also used 2 external libraries like libxml2 and json-c. Later I built it (.dll) and and we checked that .dll along with it's external dependencies in Labview. It worked fine without any issue.

 

when we try to deploy the .dll in NI Linux real time, we got to know that we can only deploy .so file and it's header file.

so I used linux PC and I built .so file. when we check that .so file in NI Linux RT. It is not showing the functions that I used in the code.

What might be the issue, can anyone help out. if you have time can you please give an example code using it in NI Linux RT.

Thank you.

Software: Visual Studio code

Target: NI Linux RT cRIO-904x x86-64.

0 Kudos
Message 1 of 3
(213 Views)

You can’t really check in NI Linux RT from inside LabVIEW if the .so contains the function you want. The LabVIEW editor environment in which you edit the VIs runs under Windows and can’t load your .so file to show you the functions it contains.

There are additional pitfalls here. NI Linux runs an embedded kernel derived from the OpenEmbedded aka.

Yocto project. This is Debian based but lags modern Linux desktop systems several versions behind. So your standard Linux x64 system may seem having the same architecture but may really have different dependencies (libc, system interfaces, etc.) than what NI Linux has. You need to compile your shared library with a GCC toolchain that matches the used NI Linux system libraries. This can be done either on the target after having installed the according gcc development packages or on a cross compiler installation on your Windows system that NI provides you for download. You will also have to use command line tools on the target to investigate the resulting shared libraries through commands such as nm, objdump or readelf.

You will also need to deploy the shared library yourself to the target, either by copying in tone of the library directories or creating an opkg package and installing it through opkg on the target. And of course also install any dependencies too.

For libxml2 itself and many other popular libraries you should however not need to compile your own library. That’s something available on all NI Linux RT feeds and can be installed through opkg directly from the command line.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 2 of 3
(177 Views)

Make sure you follow the steps in NI Linux Real-Time Cross Compiling: Using the NI Linux Real-Time Cross Compile Toolchain with Visual...

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
-------------------------------------------------------
https://github.com/ZhiYang-Ong
0 Kudos
Message 3 of 3
(133 Views)