5

I saw a similar question here

After reading the answers and comment in the above link I located the 'libmwi18n.so' file and set the LD_LIBRRY_PATH, but I'm still getting this error:

'error while loading shared libraries: libmwi18n.so: cannot
 open shared object file: No such file or directory'

I did the following:

locate libmwil8n.so

which gives output

/usr/local/MATLAB/R2012a/bin/glnx86/libmwi18n.so

Then I did

export LD_LIBRARY_PATH= /usr/local/MATLAB/R2012a/bin/glnx86

and ran the shell program again,

./run_app.sh

which returns the same error.

Please help me , how can I solve this problem?

Update-

content of the run_spp.sh

!/bin/sh
# script for execution of deployed applications
#
# Sets up the MCR environment for the current $ARCH and executes 
# the specified command.
#
exe_name=$0
exe_dir=`dirname "$0"`
echo "------------------------------------------"
if [ "x$1" = "x" ]; then
  echo Usage:
  echo    $0 \<deployedMCRroot\> args
else
  echo Setting up environment variables
  MCRROOT="$1"
  echo ---
  LD_LIBRARY_PATH=.:${MCRROOT}/runtime/glnx86 ;
  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/bin/glnx86 ;
  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/os/glnx86;
        MCRJRE=${MCRROOT}/sys/java/jre/glnx86/jre/lib/i386 ;
        LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/native_threads ;
        LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/server ;
        LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/client ;
        LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE} ;
  XAPPLRESDIR=${MCRROOT}/X11/app-defaults ;
  export LD_LIBRARY_PATH;
  export XAPPLRESDIR;
 echo LD_LIBRARY_PATH is ${LD_LIBRARY_PATH};
  shift 1
  args=
  while [ $# -gt 0 ]; do
      token=`echo "$1" | sed 's/ /\\\\ /g'`   # Add blackslash before each blank
      args="${args} ${token}"
      shift
  done
  "${exe_dir}"/b $args
fi
exit
Community
  • 1
  • 1
MMH
  • 1,676
  • 5
  • 26
  • 43
  • You have `LD_LIBRARY_PATH= ...` while it should be `LD_LIBRARY_PATH=...` (note the space after the `=`sign). Is this another typo, or...? – Rody Oldenhuis Sep 11 '13 at 09:39
  • what does `ls -l /usr/local/MATLAB/R2012a/bin/glnx86/libmwi18n.so` return? if it is a symlink, does it (ultimately) refer to an existing file? (try `ldd /usr/local/MATLAB/R2012a/bin/glnx86/libmwi18n.so`) – umläute Sep 11 '13 at 09:46
  • yes it refers to an existing file, then what should I do? – MMH Sep 11 '13 at 09:51

2 Answers2

5

Your LD_LIBRARY_PATH should not include the library itself, but rather, the path that contains the library. Try:

export LD_LIBRARY_PATH=/usr/local/MATLAB/R2012a/bin/glnx86

or perhaps appending this location to the path:

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/MATLAB/R2012a/bin/glnx86

EDIT: (after more info on question provided)

The shell script run_app.sh sets up it's own library path, using the environment variable LD_LIBRARY_PATH (it is declared in lines 17--24, and overwritten in line 26). This means that anything that is set in your shell before executing the script will be overwritten.

To include the path for libmwi18n.so, append the path within the script, after line 17 and before line 26, with:

LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/MATLAB/R2012a/bin/glnx86

(Note: there is also a printout of the LD path so you should be able to tell whether the glnx86 path is present or not).

Bonlenfum
  • 19,101
  • 2
  • 53
  • 56
  • In the question linked in your post, the `run_test.sh` script redeclares the LD path (which would overwrite anything set up in your shell before executing the script). Are you doing something similar in `run_app.sh` ? – Bonlenfum Sep 11 '13 at 09:51
  • yes, the run_app.sh is doing the same thing, should I write the 'libmwi18n.so' path inside the shell program? – MMH Sep 11 '13 at 09:54
  • Line 26 of the script will overwrite the LD path with it's own setup path (declared in 17--24). So yes, try appending the libmwi19n path within the script -- `LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/MATLAB/R2012a/bin/glnx86`, around line 18. (There is also a printout of the LD path so you should be able to tell whether the glnx86 path is present or not). – Bonlenfum Sep 11 '13 at 10:06
  • Thanks you are a life saver.. please update your answer I will accept it as the answer. – MMH Sep 11 '13 at 10:29
1

I think you want glnx86, not glnx68.

Apologies if that was just a typo in your question.

Sam Roberts
  • 23,951
  • 1
  • 40
  • 64