LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Does anyone know if there is anyway to build an executable in Linux and this executable run in every Linux version?

Hi!!
I am working using Linux. I have built the executable in a PC with a version of Linux. And I tried to run this exe. in other PC that works over other version of Linux, an older version, and the result hasn't been very good. I think that Labview has to use some Linux libraries when build the executable ( I am using VISA vi).
It is not possible to build the executable in the PC that has the "poor" version of Linux, because it is a embedded PC. I am asking if it is possible to build the executable in a "way" that lets us works in every version of Linux!!

Thank you!!

Graci
0 Kudos
Message 1 of 2
(2,708 Views)
Shared libraries on Linux are designed to be forward-compatible. In otherwords, newer versions of system libraries generally do not break executables built with older versions of those libraries. Unfortunately, the converse is not true: executables built against newer libraries will not work when run on systems with older libraries.

If you want to build an exe that will run in as many places as possible, your best bet is to build it on the oldest system you want it to run on. In your case, since your desired system for it to run on is embedded and you can't build it there, you need to find out what version of the system libraries the embedded system is using, and then find a Linux distribution based on the same version. The only library you probably need to worry about is libc.so.6, the system C run-time library. As long as you build on a system which has the same C run-time lib (or older), then the exe will run.

If your embedded system is Red Hat based or uses the RPM install tool, you can figure out your C runtime version using 'rpm -q glibc'. Otherwise, you can figure it out by doing looking at the symbolic link for the library:

% ls -l /lib/libc.so.6
lrwxr-xr-x 1 root root 13 Apr 2 11:44 /lib/libc.so.6 -> libc-2.2.4.so

Here the glibc version is 2.2.4; this command was run on a Red Hat 7.2 system. RH 7.2 and 7.3, Mandrake 8.0, and S.u.S.E 8.0 all use glibc 2.2.4 I believe. Any of these distros should be able to build an exe that will run on your embedded system if it also has 2.2.4 or newer. If it's older, I know RH 6.2 uses 2.1.92.
You may be able to use the resource rpmfind.net to help you figure out what distros have the version you need.
(And I don't recommend going with S.u.S.E., because I've had a really hard time finding older versions of it for sale or downloadable on-line.)

One further note: I'm assuming your executable is either in C or is built using the LV app builder. If it's C++, you are in another plane of library he11, because libstdc++ library has been through many ABI changes and has been a moving target until fairly recently. Use rpmfind.net to find the library packages you need; you might look for packages made explicitly for building backward-compatible exes; they tend to be named things like 'glibc-compat' and 'libstdc++-compat' plus a version number.

Good luck!

Regards,
Craig Smith
LabVIEW R&D
0 Kudos
Message 2 of 2
(2,708 Views)