After a while that i was not using matlab on my secondary linux pc with manjaro, I don't know why I currently not able to run some commands. I don't know if I messed up with some OS updates or something like that.
In particular if I run
restoredefaultpath;
I've got the following output:
Error using restoredefaultpath (line 36)
Unable to find Perl executable.
I don't know if it could be useful, but if I run
unix('which perl');
I got
/usr/bin/fish: /home/**/Programmi/MATLAB/R2019b/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /usr/bin/fish)
/usr/bin/fish: /home/**/Programmi/MATLAB/R2019b/sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.13' not found (required by /usr/bin/fish)
while if I run from terminal 'which perl' command I got '/usr/bin/perl'
Thanks in advance!

답변 (1개)

Yongjian Feng
Yongjian Feng 2021년 11월 22일
편집: Yongjian Feng 2021년 11월 22일

0 개 추천

Acording to this anwer, matlab uses $SHELL to execute shell command. Most likely your SHELL env var is /usr/bin/fish. Check from terminal
echo $SHELL
Change it to /bin/sh or /bin/tcsh
Also your /usr/bin/fish might not be installed properly. If you really want to use /usr/bin/fish, you need to fix it. The following most likely will show the same error as the matlab error you showed.
ldd /usr/bin/fish

댓글 수: 4

Federico Maggiore
Federico Maggiore 2021년 11월 22일
편집: Federico Maggiore 2021년 11월 22일
Thanks for the fast response!
I'm not sure that fish is the problem, I was using it before and I'm currently using it on my laptop without any problem. You're correct saying that the SHELL env var is /usr/bin/fish, but is unclear to me why I sould change it (also there my SHELL env var is /usr/bin/fish but it doesn't give any problem, as it didn't cause any problem some time ago on this PC).
Regarding the
ldd /usr/bin/fish
it gives the following output if I run it in the terminal
linux-vdso.so.1 (0x00007ffc8b1a2000)
libncursesw.so.6 => /usr/lib/libncursesw.so.6 (0x00007f1d5c8e0000)
libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f1d5c8d9000)
libpcre2-32.so.0 => /usr/lib/libpcre2-32.so.0 (0x00007f1d5c855000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f1d5c63f000)
libm.so.6 => /usr/lib/libm.so.6 (0x00007f1d5c4fb000)
libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f1d5c4da000)
libc.so.6 => /usr/lib/libc.so.6 (0x00007f1d5c30c000)
/lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007f1d5cb70000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f1d5c2f1000)
while, as you were predicting, in MATLAB
unix('ldd /usr/bin/fish')
gives the same error as before
Federico Maggiore
Federico Maggiore 2021년 11월 22일
moreover, following the answer you linked using
setenv SHELL /usr/local/bin/bash
doesn't resolve the problem and
launchctl setenv MATLAB_SHELL /bin/bash
result in "Unrecognized function or variable 'launchctl'."
Yongjian Feng
Yongjian Feng 2021년 11월 22일
I see.
  1. Your system uses /usr/bin/fish for default shell
  2. What is the version of the linux you are using now, and what is the matlab version? The root cause here could be that the new upgraded linux version is using some *.so different from your matlab version. For example, the error message suggests that matlab wants to link to the old glib, but the new /usr/bin/fish wants the new glib.
  3. If so, you have two options here. Go back to the old linux version that is compatible with your matlab version. Or play with LD_LIBRARY_PATH.
Federico Maggiore
Federico Maggiore 2021년 11월 22일
I'm using Manjaro 21.2 and matlab 2019b. I don't know what it mens to play with LD_LIBRARY_PATH...

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품

릴리스

R2019b

질문:

2021년 11월 22일

댓글:

2021년 11월 22일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by