Simulink Rapid accelerator mode compiler error Linux CentOS 7.3 undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>
1 view (last 30 days)
Show older comments
Currently I am trying to run my Simulink model, built with Matlab 2019b, on a server of my university, which runs on Linux CentOS 7.3.1611. If I run the model in either 'normal', or 'accelerator' mode it is succesful. However, if I try to run the model in 'rapid accelerator mode' the compiler returns an error during building. The errors all contain the element of not finding the standard library:
'undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>,'
I have searched on MATLAB Answers and stackoverflow for solutions, but none have worked for me so far. I have also asked the IT service of my university for help but they could not help me out.
- One of the solutions hinted towards the compiler not being able to find the correct libraries and that the library path should be added/updated here on stack overflow. However, if I print the Library path in matlab then it seems allright:
Library path:
<matlab_root>/cefclient/sys/os/glnxa64:<matlab_root>/sys/opengl/lib/glnxa64:<matlab_root>/sys/os/glnxa64:<matlab_root>/bin/glnxa64:<matlab_root>/extern/lib/glnxa64:<matlab_root>/runtime/glnxa64:<matlab_root>/sys/java/jre/glnxa64/jre/lib/amd64/native_threads:
<matlab_root>/sys/java/jre/glnxa64/jre/lib/amd64/server:<compiler_root>/root/usr/lib64:<compiler_root>/root/usr/lib:<compiler_root>/root/usr/lib64/dyninst
- Another problem could be the compiler. At first I used a gcc 8.x compiler, but later found out that a 6.3 version is required, so that is what I am using now
- Lastly I found a that a problem could be that "(...) it probably indicates that you are trying to link together object files that were compiled with different values for the _GLIBCXX_USE_CXX11_ABI macro." (from stack overflow)
The last option seems the most likely to me, however, I have not been able to solve this. I tried for instance:
set_param(model,'AccelMakeCommand','make_rtw CPP_OPTS="-D_GLIBCXX_USE_CXX11_ABI=0"')
and
set_param(model,'MakeCommand','make_rtw CPP_OPTS="-D_GLIBCXX_USE_CXX11_ABI=0"')
However, this did not help.
If anyone has a tip that could help me out, that would be great. I have added the console output in the output_rw_build_error.txt file, and the error message in the errorfile_rtw_build_error.txt
Kind regards,
Nathan
1 Comment
Steve Miller
on 25 Nov 2022
Can you get a shipping example to work, such as vdp.slx? This would help us narrow down the cause and allow us to possibly reproduce it.
--Steve
Answers (1)
Jordan Olson
on 28 Nov 2022
Red Hat Enterprise Linux (RHEL) and CentOS versions 6 and 7 do not support the library ABI that came out with GCC 5.1. Here is a bug report on the issue from Red Hat:
For more information on libstdc++'s dual ABI, see the following link:
Unfortunately, the libraries used by rapid accelerator mode were compiled using the new ABI, so rapid accelerator mode simply will not work with those OS versions. The only recourse is to upgrade to MATLAB R2020b (or later) or use a different operating system. For a list of other operating systems we support, see the following page:
0 Comments
See Also
Categories
Find more on Nonlinear Operators in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!