MATLAB ships with libstdc++.so.6, that is missing fish shell compatible versions of LIBCGXX and GXXABI

36 ビュー (過去 30 日間)
I already asked this on the fish shell GitHub page (question link), but I'm asking this here since that is what they suggested. I thought they might, considering this is not really their problem. I any case here goes.
System information
fish version: 3.6.1
OS: Ubuntu LTS 22.04
Terminal: Matlab R2023a REPL
The problem
Matlab (R2023a) allows running shell commands from its REPL by typing
!shell_command [options] args
or
[exit, msg] = system ( "shell_command [options] args" ) ;
However, when I do this with the setup listed above, I get the following 3 warnings:
/usr/bin/fish: /usr/local/MATLAB/R2023a/sys/os/glnx64/libstdc++.so.6: version `CXXABI_1.3.13' not found (required by /usr/bin/fish)
/usr/bin/fish: /usr/local/MATLAB/R2023a/sys/os/glnx64/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /usr/bin/fish)
/usr/bin/fish: /usr/local/MATLAB/R2023a/sys/os/glnx64/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /usr/bin/fish)
As the warnings say, the version of the C++ standard library shipped with Matlab seems to be missing the versions that fish requires, which can be confirmed by running the following command on the symbolic link libstdc++.so.6 in the Matlab installation folder:
strings /usr/local/MATLAB/R2023a/sys/os/glnxa64/libstdc++.so.6 | grep LIBCXX
strings /usr/local/MATLAB/R2023a/sys/os/glnxa64/libstdc++.so.6 | grep CXXABI
Their respective outputs are
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_3.4.22
GLIBCXX_3.4.23
GLIBCXX_3.4.24
GLIBCXX_3.4.25
GLIBCXX_3.4.26
GLIBCXX_3.4.27
GLIBCXX_3.4.28
and
CXXABI_1.3
CXXABI_1.3.1
CXXABI_1.3.2
CXXABI_1.3.3
CXXABI_1.3.4
CXXABI_1.3.5
CXXABI_1.3.6
CXXABI_1.3.7
CXXABI_1.3.8
CXXABI_1.3.9
CXXABI_1.3.10
CXXABI_1.3.11
CXXABI_1.3.12
Now, this does not seem to have absolutely broken anything substantial, but it seems to be worth mentioning.
The obvious fix is for MathWorks to update the libraries they provide, but I wonder what the right action would be if one wanted to fix this temporarily? Change the symbolic link in the Matlab installation folder to point to a system-wide version of libstdc++.so.6, in case it also provides newer versions (which it does), and see if Matlab can still be started successfully?
  2 件のコメント
dim-ask
dim-ask 2023 年 8 月 29 日
Does installing matlab-support (sudo apt-get install matlab-support in ubuntu) solve the issue? I think it installs some updated c++ libraries, maybe also the one you have issues with.
Joseph Hinton
Joseph Hinton 2024 年 7 月 29 日
Try running matlab using the command "env SHELL=<path to bash> matlab"
Not the best solution, but it seems to solve most fish-related issues.

サインインしてコメントする。

回答 (1 件)

Shubham
Shubham 2024 年 9 月 12 日
Hey Santtu,
I understand that you are recieving the error "libstdc++.so.6: version `CXXABI_1.3.13' not found" because of some missing versions of "LIBCGXX" and "GXXABI". This could be due to the libstdc++ library shipped with your Ubuntu LTS 22.04 being older and may not contain the required "LIBCGXX/GLIBCXX" version.
I would recommend you to upgrade the libstdc++ libraries or use the MATLAB's libraries by modifying the environment variables as done in the following MATLAB Answer post: https://www.mathworks.com/matlabcentral/answers/643300-why-do-i-receive-the-error-libstdc-so-6-version-glibcxx_3-4-22-not-found-when-trying-to-star
This should resolve the errors you are encountering.
I hope this helps!
  1 件のコメント
Walter Roberson
Walter Roberson 2024 年 9 月 12 日
This could be due to the libstdc++ library shipped with your Ubuntu LTS 22.04 being older
No, it is a problem that fish shell needs a libstdc++.so.6 that is newer than what MATLAB provides. Using system() or the ! command runs the command with libstdc++ set to the one provided with MATLAB.
All that I can think of at the moment is:
Use setenv to set LD_LIBRARY_PATH to a path that includes the version needed by fish shell. After that, hopefully ! or system() will provide an environment to fish shell that it can use to run.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by