OpenMP support not working anymore in Matlab?

Hi,

I’ve tried to sync my acados fork with the official master and now I face the following problem. I build acados with OpenMP support:

cmake .. -DACADOS_WITH_OPENMP=ON -DACADOS_NUM_THREADS=2 -DACADOS_MATLAB=ON
make
make install

When I execute examples/acados_matlab_octave/getting_started/minimal_example_ocp.m I get the following error in Matlab:

Error using mex
Unknown MEX argument '-fopenmp'.

Error in ocp_compile_interface (line 139)
        mex(mex_flags, FLAGS, LDFLAGS, COMPDEFINES, COMPFLAGS, acados_include, acados_interfaces_include, external_include, blasfeo_include, hpipm_include,...

Error in acados_ocp (line 183)
                ocp_compile_interface(obj.opts_struct);

Error in minimal_example_ocp (line 110)
ocp = acados_ocp(ocp_model, ocp_opts, simulink_opts);

Everything works until commit Matlab full template based OCP solver (#934) · acados/acados@bb9f1b2 · GitHub. So the problem must be in the related changes.

Could anyone please have a look on this?

BR,
Martin

1 Like

Hi Martin,

there are some updates in the master branch, including the fix of compiling with openmp. Would you like to check it out and test if that can fix your problem?

Best,
Yizhen

Hi Yizhen,

thanks for the update. Problem solved!

BR,
Martin