Skip to content

MATLAB crashes when calling code-generated function #30

@steradiant

Description

@steradiant

Hello,
I'm using the code-generation feature to speed up the solver. The code generation is done like shown in the documentation:

settings.verbose = false;
prob = osqp;
prob.setup(H, q, Aeq, beq, beq, settings); 
prob.codegen('osqp_codegen','parameters','matrices');

I then want to run the solver in a for loop where I update the bounds and the A-matrix accordingly

emosqp('update_bounds', beq, beq);
[~,~,Ax] = find(Aeq);
emosqp('update_A', Ax, [], 0);
res = emosqp('solve');

When the 'update_A' function is called, MATLAB crashes. I uploaded the crash report. I'm using MATLAB 2020b under Ubuntu 20.04 LTS.
matlab crash osqp2.txt

Note: At my first try to generate the mex-file I got the following errors in MATLAB

cmake: /usr/local/MATLAB/R2020b/bin/glnxa64/libcurl.so.4: no version information available (required by cmake)
cmake: /usr/local/MATLAB/R2020b/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by cmake)
cmake: /usr/local/MATLAB/R2020b/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /usr/lib/x86_64-linux-gnu/libjsoncpp.so.1)

after some googling, I found a solution where I preload the library path as follows (executing the following command in the shell before I start matlab from the same shell): export LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libstdc++.so.6"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions