18

I'm trying to get a system up and running, and am having problems with the OpenMotif shared libraries. I have their directory in LD_LIBRARY_PATH, but it still can't find them.

Here's an example:

[root@intrepid netcool]# ldd /opt/netcool/omnibus/platform/linux2x86/bin/nco_* |grep 'not found'
    libXm.so.3 => not found
    libXpm.so.4 => not found
    libXm.so.3 => not found
    libXm.so.3 => not found
    libXpm.so.4 => not found
    libXm.so.3 => not found
    libXm.so.3 => not found
    libXm.so.3 => not found
    libXm.so.3 => not found
[root@intrepid netcool]# find /usr/ -name libXm.so.3 
/usr/lib64/libXm.so.3
[root@intrepid netcool]# find /usr/ -name libXpm.so.4
/usr/lib64/libXpm.so.4
[root@intrepid netcool]# echo $LD_LIBRARY_PATH
/opt/netcool/omnibus//platform/linux2x86/lib/:/opt/netcool//platform/linux2x86/lib/:/usr/lib/:/usr/lib64/

I'm probably doing something stupid, but I can't think of anything else to try.

EDIT: To answer a couple of the questions asked below:

[root@intrepid netcool]# export LD_LIBRARY_PATH
[root@intrepid netcool]# ldd /opt/netcool/omnibus/platform/linux2x86/bin/nco_* |grep 'not found'
    libXm.so.3 => not found
    libXpm.so.4 => not found
    libXm.so.3 => not found
    libXm.so.3 => not found
    libXpm.so.4 => not found
    libXm.so.3 => not found
    libXm.so.3 => not found
    libXm.so.3 => not found
    libXm.so.3 => not found
[root@intrepid netcool]# ldconfig
[root@intrepid netcool]# ldd /opt/netcool/omnibus/platform/linux2x86/bin/nco_* |grep 'not found'
    libXm.so.3 => not found
    libXpm.so.4 => not found
    libXm.so.3 => not found
    libXm.so.3 => not found
    libXpm.so.4 => not found
    libXm.so.3 => not found
    libXm.so.3 => not found
    libXm.so.3 => not found
    libXm.so.3 => not found

Ok, just tried to run one of the executables:

# ./bin/nco_xigen 
/opt/netcool//omnibus/platform/linux2x86/bin/nco_xigen: error while loading shared libraries: libXm.so.3: wrong ELF class: ELFCLASS64

Is this a 32 bit/64 bit thing?

coding_hero
  • 1,759
  • 3
  • 19
  • 34
  • 2
    Did you `export LD_LIBRARY_PATH`? – vhallac Apr 26 '12 at 20:37
  • Yes, LD_LIBRARY_PATH was set and exported in ~/.bash_profile – coding_hero Apr 26 '12 at 20:45
  • Did you re-source .bash_profile in your environment? Sorry to start so basic, but it's usually the basic stuff that trips up advanced programmers... #EDIT it would seem you did, since echo prints out the right directories. Hmm... – Matt Apr 26 '12 at 20:49
  • In the spirit of grasping at straws, could you run [ldconfig](http://www.linuxquestions.org/questions/linux-newbie-8/ldd-reports-shared-library-missing-but-library-exists-on-disk-725472/)? – Matt Apr 26 '12 at 20:53
  • Try `ldconfig -p | grep 'X[p]m'` that will search the `ld.so` cache. – D.Shawley Apr 26 '12 at 21:04
  • Returned `libXpm.so.4 (libc6,x86-64) => /usr/lib64/libXpm.so.4`. Still the same output from ldd. – coding_hero Apr 26 '12 at 21:23

2 Answers2

17

Did you export LD_LIBRARY_PATH? the export keyword tells Bash to send any variables to subprocesses - otherwise ldd will never see LD_LIBRARY_PATH.

Matt
  • 10,434
  • 1
  • 36
  • 45
16

The binaries I had were looking for the 32-bit versions of the shared libraries, I had the 64-bit installed. Stupid mistake. LDD didn't produce a very insightful error message, but the binary did when I tried to run it.

coding_hero
  • 1,759
  • 3
  • 19
  • 34