shared lib libmwi18n.so not find - matlab

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

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).

I think you want glnx86, not glnx68.
Apologies if that was just a typo in your question.

Related

Why is uprobe unaffected by ASLR?

I came from this article: https://blog.quarkslab.com/defeating-ebpf-uprobe-monitoring.html and this worked well for me:
# First log-in as root.
# This line creates a uretprobe named bashReadline at offset 0xd5690 of /bin/bash program that prints the return value as a string.
echo 'r:bashReadline /bin/bash:0xd5690 cmd=+0($retval):string' >> /sys/kernel/tracing/uprobe_events
# When the uprobe is added, activate it with this command:
echo 1 > /sys/kernel/tracing/events/uprobes/bashReadline/enable
The interesting part is that I can use a static offset and no need to worry about ASLR. Why is that?

How to remove blank line before prompt when I set fish_greating to null?

I want to remove the blank line before prompt when I open a new fish shell window.
I try to remove fish_greating use official FAQ.
➜ set fish_greeting
Here's my plugins.
vue-multiple-pages on  master [!] is 📦 v0.1.0 via ⬢ none
➜ fisher ls
edc/bass
FabioAntunes/fish-nvm
matchai/spacefish
It works. I remove the greating "Welcome to fish, the friendly interactive shell".
But, I got a blank line like this:
How to remove this blank line?
======updated======
This is is gif that I want to explain.
Thanks.
After a few hours of hard work, I found the answer.
It's the matchai/spacefish plugin which add new line to my prompt.
Here is the function
# Defined in /Users/liwei/.config/fish/functions/fish_prompt.fish # line 1
function fish_prompt
set -g sf_exit_code $status
set -g SPACEFISH_VERSION 2.6.0
# ------------------------------------------------------------------------------
# Configuration
# ------------------------------------------------------------------------------
__sf_util_set_default SPACEFISH_PROMPT_ADD_NEWLINE true
__sf_util_set_default SPACEFISH_PROMPT_FIRST_PREFIX_SHOW false
__sf_util_set_default SPACEFISH_PROMPT_PREFIXES_SHOW true
__sf_util_set_default SPACEFISH_PROMPT_SUFFIXES_SHOW true
__sf_util_set_default SPACEFISH_PROMPT_DEFAULT_PREFIX "via "
__sf_util_set_default SPACEFISH_PROMPT_DEFAULT_SUFFIX " "
__sf_util_set_default SPACEFISH_PROMPT_ORDER time user dir host git package node ruby golang php rust haskell julia elixir docker aws venv conda pyenv dotnet kubecontext exec_time line_sep battery vi_mode jobs exit_code char
# ------------------------------------------------------------------------------
# Sections
# ------------------------------------------------------------------------------
# Keep track of whether the prompt has already been opened
set -g sf_prompt_opened $SPACEFISH_PROMPT_FIRST_PREFIX_SHOW
if test "$SPACEFISH_PROMPT_ADD_NEWLINE" = "true"
echo
end
for i in $SPACEFISH_PROMPT_ORDER
eval __sf_section_$i
end
set_color normal
end
Just set SPACEFISH_PROMPT_ADD_NEWLINE to false,
add this line to your config.fish and solve the problem.
set SPACEFISH_PROMPT_ADD_NEWLINE false
Thanks to all.

Buildroot Config Option for applying custom patch

I am new to buildroot and working to build Linaro with buildroot ..I have multiple fragment kernel config files and specified that in buildroot defconfig.
I have specified a custom kernel patches directory with BR2_LINUX_PATCH_DIR .
I dont have some of the config flags not set which are supposed to be there in the .config files..so i suspect that the Patches are applied successfully..so i tried giving a non existing location as Linux Patch dir and it does not give any error..
Is there anything other than giving value to BR2_LINUX_PATCH_DIR and what should be the format of the dir structure...in buildroot manual it says it should be
Package_name/patch name..For linux what should be the package name? It should be the same with which linux dir is created.for example for me it is linux-custom
Plz suggest and guide me in this.
Thanks in Advance
The option is named BR2_LINUX_KERNEL_PATCH, there is nothing named BR2_LINUX_PATCH_DIR. It applies all patches listed in this option (if those are files), or all files named *.patch if what's given in this option is a directory. See the code in linux/linux.mk:
define LINUX_APPLY_LOCAL_PATCHES
for p in $(filter-out ftp://% http://% https://%,$(LINUX_PATCHES)) ; do \
if test -d $$p ; then \
$(APPLY_PATCHES) $(#D) $$p \*.patch || exit 1 ; \
else \
$(APPLY_PATCHES) $(#D) `dirname $$p` `basename $$p` || exit 1; \
fi \
done
endef
Also, I would recommend that you watch the output of Buildroot: it shows everything it is doing, especially it lists the patches it applied. Look at the line >>> linux .... Patching, which is the marker for the beginning of the patching step of the linux package.

Add a perl project in Komodo

I have an old perl(5.12.3) project, which I would like to debug in the komodo 3.0.1 environment (temporarely i have only this old version). The project is a multiple module project, with a three like structure:
Root
core
module1.pm
...
external
ext_module.pm
...
caller.bat
The project start point is the .bat file. Would it be possible to add and debug it in komodo? Any suggestion are appreciated.
set PERL_EXIST=0
perl -version >nul 2>&1 && ( set PERL_EXIST=1 )
if %PERL_EXIST% EQU 0 (
rem if perl doesn't exist give an error message and finish
echo.
echo ERROR: Perl %PERL_DIR% is missing
set PERL_EXIST=
set MY_EXIT_CODE=1
goto EXIT
)
.
.
.
#perl starts here
use core::FirstModule;
use Cwd qw(getcwd chdir);
use Switch;
use core::FirstModule;
use Env qw(PATH VAR_1 PROJ_VERSION CORE_LOC );
# adapt the environment to point to main folder
$ENV{'CORE_LOC'}=~s/[\\\/]?[^\\\/]*$//;
if ($ENV{'CORE_LOC'}=~/[\\\/].*$/i) {
$ENV{'CORE_LOC'} =~s/[\\\/]?[^\\\/]*$//;
.
.
.
.
push #INC,$sourceDir;
$hFirstModule = core::FirstModule->new("object properties");
$hFirstModule->checkDir($dir_version);

Configuring the compile sources of a build phase

I have a project with many targets.
Every time I create a new target, I am adding a specific class to the Compile Sources and I am setting a compiler flag for that class. How can I apply this setting automatically?
I think this needs to be done by modifying the project file directly. In other words, write a script that will make the changes.
Here's a simple example to add arc flags to a file for all targets.
#!/bin/sh
set -e
USAGE="$0 <filename> ..."
PROJECTFILE="project.pbxproj"
FILES="$*"
COMPILER_FLAGS="\"-fobjc-arc\"";
if [ "${FILES}" = "" ] ; then
echo ${USAGE};
exit 1 ;
fi
if [ ! -f "${PROJECTFILE}" ] ; then
echo "Cannot find ${PROJECTFILE} - Please run from within the .xcodeproj directory";
exit 1 ;
fi
cp ${PROJECTFILE} ${PROJECTFILE}.bak
for f in ${FILES}; do
echo "Adding flags for $f" ;
sed -ie "s/\(${f}.*{ *isa *= *PBXBuildFile.*\)};$/\\1 settings = {COMPILER_FLAGS = ${COMPILER_FLAGS}; }; };/g" "${PROJECTFILE}"
done