NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

error in compiling Labview Application in Linux for shared library

Hello All,

                 I was trying to follow one of the sample application posted over NI over the Intel based PXIE target, the basic idea of the application is simply to compile the NI project(LabVIEW_No_GUI.zip) to a shared library (.so), as part of that  i did build the application in linux Labview 2012, which resulted me a shared library (SharedLibraryh.png) , but the tricky part here is the Labview 2012 platform is using native gcc compiler to form the shared library, while i try to link the application with the library (SharedLibrary.so) following is the error the target throws.

gcc -o mytest test.c ../SharedLibrary/SharedLib.so -I../SharedLibrary

Error Adding symbol: File in Wrong Format  -------------------------------------->(ERROR)

I did tried to unistall the native gcc within the linux host and tried to install the same crosscompile toolchain used by NI following is the path provided, but after setting up the path in ~./bashrc for gcc i did tried to build the shared library, resulted in error as shown (Stub-32.png). i did tried to get around the problem in hardway by copying the stub-32.h into the cross compiler folder, which resulted in more errors (Error.png).

I was really stuck here figuring out how to make the Labview over the linux host to use the cross compiler tool chain provided by NI to produce the compatable Shared Library.

Note:

The above application is part of the StandAlone executable, and the support for  NIMAX is not there.

The Stub-32.h resulted as part of the command executed on linux "yum -y install glibc-devel.i686 glibc-devel"


Cross Compile ToolChain:

http://www.ni.com/download/labview-real-time-module-2014/4959/en/

Example posted on NI:

http://digital.ni.com/public.nsf/allkb/5D6EC36DCF43343786257449006919E6

Thanks,

pratap


0 Kudos
Message 1 of 5
(2,640 Views)

Hi there pratapnaidu,

LabVIEW 2012 for Desktop Linux was only 32-bit. The NI Linux RT OS that came with the NI Software Technology Preview is 64-bit. This is just the first and most serious hurdle. Secondly, you cannot nor should not use the Desktop application build specification to create a library from a Desktop Linux LabVIEW installation.

What goal are you trying to achieve?

0 Kudos
Message 2 of 5
(2,335 Views)

Hi Brad,

               Thank you so much to take a look at my problem, appreciate your quick turn around time. We have a huge project running over PharLap OS, and we would like to port over some parts of that application to the Linux Platform, to check the response times and also to gain some hand-on experience over RT Linux capabilites.

As a part of it  i did choose this application, because of its similarities with the application (About to port), as both does not expect GUI interface.

Kindly provide me the steps to get the shared library out of a VI with the NI cross compiler tool chain, as my target runs a root filesystem compiled with this NI, I also noticed that the my target have the capabilites to compile the .c files (GCC is present within the target)

Please lead my way if i was completly deviating the purpose, like the way i had choosen to the Labview Desktop Application  to get the "SharedLibrary" and help me build shared library and link it a test.c program as demonstrated within the example.

Regards,

pratap

0 Kudos
Message 3 of 5
(2,335 Views)

Thanks for the clarification. I would recommend actually using the controller from your System Designer UI as exporting a library from traditional LabVIEW Desktop for Linux and attempting to load the library will not work (the library actually depends on runtime components that are not present on the System Designer RT image), so of course this is not a supported use-case.

0 Kudos
Message 4 of 5
(2,335 Views)

Hi Brad,

              Thanks for your reply, can you please breif me the possible linux compiler commands to export the VI image to a shared library.

              

Thanks,

pratap

0 Kudos
Message 5 of 5
(2,335 Views)