MATLAB linking error - CentOS 7 - R2020b

137 views (last 30 days)
Heinz Stockinger
Heinz Stockinger on 22 Sep 2020
Answered: Jonathan Rosalki on 14 Jul 2022 at 15:00
I've installed MATLAB R2020b on CentOS 7 and get the following error:
$ matlab
MATLAB is selecting SOFTWARE OPENGL rendering.
/Home/matlab/matlab/bin/glnxa64/MATLAB: symbol lookup error: /Home/matlab/matlab/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: undefined symbol: __cxa_thread_atexit_impl
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/software/libexec/gcc/x86_64-redhat-linux/6.1.1/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,objc,obj-c++,fortran,go,lto --prefix=/software --mandir=/software/share/man --infodir=/software/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --disable-libgcj --without-isl --enable-libmpx --enable-gnu-indirect-function --with-arch_32=x86-64 --with-arch=nocona --with-tune=core2 --with-multilib-list=m64 --oldincludedir=/software/include --build=x86_64-redhat-linux
Thread model: posix
gcc version 6.1.1 20160510 (Red Hat 6.1.1-2) (GCC)
Which compiler version and dependencies do you need to install to have MATLAB working?
Thank you,
Heinz
  4 Comments
gerco hassink
gerco hassink on 9 Jun 2021
I have the same problem on centos 7.6.1810.
I checked the solutions from Sai Sri Pathuri below, but they don't work and don't seem to make sense as well, but that could be me of course. Any help would be appreciated. Due to other software we prefer not to update the system too much
matlab installation worked fine
MATLABWindow runs as well
/usr/local/MATLAB/R2020b/bin/./matlab -nosplash -nodesktop
gives:
MATLAB is selecting SOFTWARE OPENGL rendering.
and then the prompt again
/usr/local/MATLAB/R2020b/bin/glnxa64/MATLAB -nosplash -nodesktop
gives:
/usr/local/MATLAB/R2020b/bin/glnxa64/MATLAB: symbol lookup error: /usr/local/MATLAB/R2020b/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: undefined symbol: __cxa_thread_atexit_impl
gcc -v
Ingebouwde specs worden gebruikt.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc versie 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)

Sign in to comment.

Answers (3)

Sai Sri Pathuri
Sai Sri Pathuri on 24 Sep 2020

gerco hassink
gerco hassink on 22 Jul 2021
Turned out that it is a version problem. Matlab 2020 uses libstdc++.so.6.0.25 and our Centos 7 and other software on it use *.19 and we did not want to upgrade these. the only solution was to install an older version of matlab R2017b and this worked perfectly.

Jonathan Rosalki
Jonathan Rosalki on 14 Jul 2022 at 15:00
I had a similar problem (trying to run in python3.8 "import matlab.engine") and was pointed at this solution by the kind people at Mathworks (thank you):
  • Could you please try setting the "LD_PRELOAD" environment variable by running:
  • export LD_PRELOAD="/home/local/MATLAB/R2022a/bin/glnxa64/glibc-2.17_shim.so"
  • Note that since this is a local environment variable the fix will not apply to any workers. The fix can be applied everywhere by adding the environment variable as a user or system wide variable.
Maybe that will help in this situation?

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by