Open BenjaminRodenberg opened 4 months ago
gcc --version
): (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0matlab -nodisplay -r "disp(version);exit;"
): 24.1.0.2537033 (R2024a)LD_PRELOAD
: yesgcc --version
): (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0matlab -nodisplay -r "disp(version);exit;"
): 23.2.0.2515942 (R2023b) Update 7LD_PRELOAD
: nogcc --version
): (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0/usr/local/MATLAB/R2022b/bin/matlab -nodisplay -r "disp(version);exit;"
): 9.13.0.2105380 (R2022b) Update 2LD_PRELOAD
: yesI also tried it out with an older MATLAB version on my system. This makes things even more confusing...
gcc --version
): (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0~/Software/MATLAB/R2023b/bin/matlab -nodisplay -r "disp(version);exit;"
): 23.2.0.2515942 (R2023b) Update 7LD_PRELOAD
: yesAlso no problems with MATLAB R2023b on my system. This is confusing for me considering what @NiklasVin reports above. Currently it looks like I cannot reproduce the problem.
gcc --version
): (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0~/Software/MATLAB/R2020b/bin/matlab -nodisplay -r "disp(version);exit;"
): 9.9.0.2037887 (R2020b) Update 8LD_PRELOAD
: no.With R2020b I can reproduce the problem and get the following error:
Warning: The following error was caught while executing 'precice.Participant' class destructor:
Invalid MEX-file '/home/benjamin/Programming/matlab-bindings/+precice/@Participant/private/preciceGateway.mexa64': /home/benjamin/Software/MATLAB/R2020b/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /usr/local/lib/libprecice.so.3)
Error in precice.Participant/delete (line 40)
preciceGateway(uint8(1));
Error in coil (line 4)
interface = precice.Participant("Coil", "../precice-config.xml", 0, 1);
> In coil (line 4)
Invalid MEX-file '/home/benjamin/Programming/matlab-bindings/+precice/@Participant/private/preciceGateway.mexa64': /home/benjamin/Software/MATLAB/R2020b/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /usr/local/lib/libprecice.so.3)
Error in precice.Participant (line 34)
preciceGateway(uint8(0),ParticipantName,configFileName,int32(ProcessIndex),int32(ProcessSize));
Error in coil (line 4)
interface = precice.Participant("Coil", "../precice-config.xml", 0, 1);
gcc --version
): (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0~/Software/MATLAB/R2021b/bin/matlab -nodisplay -r "disp(version);exit;"
): 9.11.0.2358333 (R2021b) Update 7LD_PRELOAD
: no.Warning: The following error was caught while executing 'precice.Participant' class destructor:
Invalid MEX-file '/home/benjamin/Programming/matlab-bindings/+precice/@Participant/private/preciceGateway.mexa64': /home/benjamin/Software/MATLAB/R2021b/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /usr/local/lib/libprecice.so.3)
Error in precice.Participant/delete (line 40)
preciceGateway(uint8(1));
Error in coil (line 4)
interface = precice.Participant("Coil", "../precice-config.xml", 0, 1);
> In coil (line 4)
Invalid MEX-file '/home/benjamin/Programming/matlab-bindings/+precice/@Participant/private/preciceGateway.mexa64': /home/benjamin/Software/MATLAB/R2021b/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /usr/local/lib/libprecice.so.3)
Error in precice.Participant (line 34)
preciceGateway(uint8(0),ParticipantName,configFileName,int32(ProcessIndex),int32(ProcessSize));
Error in coil (line 4)
interface = precice.Participant("Coil", "../precice-config.xml", 0, 1);
I tried to find a bugfix or similar hinting in this direction in the changelogs of MATLAB, but could not find anything. Therefore, I asked a question in the MATLAB Community forum: https://de.mathworks.com/matlabcentral/answers/2108031-has-issue-with-libstdc-so-6-been-fixed.
LD_PRELOAD
: no
gcc version (
gcc --version
): (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0
MATLAB version (
~/Software/MATLAB/R2023b/bin/matlab -nodisplay -r "disp(version);exit;"
): 23.2.0.2515942 (R2023b) Update 7tutorials/resonant-circuit works without setting
LD_PRELOAD
: yesAlso no problems with MATLAB R2023b on my system. This is confusing for me considering what @NiklasVin reports above. Currently it looks like I cannot reproduce the problem.
Were the MATLAB versions for which the resonant circuit example worked for you fresh installations?
I checked whether you got an answer to your question in the MATLAB forum. The answer links to another thread explaining two different solutions how to avoid the issues I encountered. The first one is with the LD_PRELOAD
and the other ansatz is to rename one problematic library in the MATLAB installation path. Maybe you did the renaming for your working examples in advance? Because I reinstalled the newest MATLAB version and it didn't work without the LD_PRELOAD
out of the box, but as soon as I renamed the mentioned file, everything worked fine without the preload.
In our
README.md
we suggest the following procedure to start MATLAB, if versionGLIBCXX_#.#.##
is not found:This follows the suggested approach from here.
I'm a bit unsure whether we should generally follow this procedure (assuming it is always or in most cases required) or rather treat it as pure troubleshooting (exceptional cases). I was a bit surprised that I actually do not need to set
LD_PRELOAD
on my system. Running the example case from https://github.com/precice/tutorials/pull/480 worked for me without the need to setLD_PRELOAD
.There is also a list of supported gcc versions and this looks like we don't need to worry a lot. I would still suggest to keep the remark in the troubleshooting section, because I'm not a big fan of the fact that MATLAB brings along its own
libstdc++.so
and I assume this might lead to compatibility problems sooner or later.I think it would be helpful to collect some data here in the comments and then decide what we should tell our users (and how to design the tutorials).
suggested format
gcc --version
): ...matlab -nodisplay -r "disp(version);exit;"
): ...LD_PRELOAD
: yes/noImportant: We should also check this for the VM.