Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

libXm,so shared library

connell
Beginner
433 Views
I am having problems running code that build on a newer Linux OS on an older OS.

On the older OSlibXm.so was a link tolibXm.so.3.0.2. Both are in /usr/X11R6/lib64.
On the newerOSlibXm.so is a link to libXm.so.4.0.1 now in /usr/lib64.
We have a mix of machines. If I link the code on the newer OS and try to run on the older OS I get a message about not being able to find libXm.so.4.0.1

I use -L /usr/lib64 -lXm in the link step

So the exe has a reference to the versioned shared lib and not libXm.so. I have tryed using hard and soft links without sucess. Is there any way to tell the linker not to follow the link and just use libXm.so as the reference?
0 Kudos
3 Replies
mecej4
Honored Contributor III
433 Views
Have you tried copying the old shared library to the new machine, building against this version on the new machine rather than the newer library, and then moving the application to the old machine?
0 Kudos
connell
Beginner
433 Views
On the new machine libXm.so is a symbolic link to libXm.so.4.01 so moving the library would have no effect (unless the link was updated) Linking on the new machine would still see the 4.0.1 version. If I updated the link I am sure it would run on the old machine - however it would not run on any new machine without the updated link.

I am after a way of making it run on both machines. If there are no linker options to do this the only way i can see is to package the shared lib with the executable
0 Kudos
TimP
Honored Contributor III
433 Views
If you have a .so which performs correctly, you can force its use rather than a (presumably more up to date) version preferred according to your system paths by setting LD_PRELOAD= in your shell. I don't know if this answers your requirement, as I'm not familiar with this question of dealing with widely different Motif versions.
As others suggested, you might try adding the older Motif installation in a separate path on your build machine and setting -L paths to link to it, as well as running with LD_PRELOAD. If you want to spare your users this sort of tinkering, you may require a version linked to run on each system, or you could try specifying the static Motif libraries compatible with the oldest glibc you want to support, in your link.
0 Kudos
Reply