nomad icon indicating copy to clipboard operation
nomad copied to clipboard

Invaling MEX-file when running nomadOpt() in MATLAB interface for Linux

Open ctribes opened this issue 1 year ago • 1 comments

On linux, after successfully building the Matlab interface to Nomad (cmake commands) and setting the Matlab path to where the NOMAD libraries are located (Matlab addpath command) we can obtain the following error

image

This can happen even if the version of the gcc version matches the one recommended for the Matlab version at hand.

In the above example, I used gcc 11.4.1 (Red Hat 11.4.1-2) and Matlab 2023b.

ctribes avatar Feb 07 '24 16:02 ctribes

The problem is that when Matlab starts it loads its own version of the libstdc++ library. This can be incompatible with the libstdc++ that the Nomad libraries require. In our case we have use the gcc of the system and the libraries is in /lib64

It is possible to preload some libraries while launching Matlab with the command:

LD_PRELOAD=/lib64/libstdc++.so.6 matlab

ctribes avatar Feb 07 '24 16:02 ctribes