deng-haoyang / ParNMPC

A Parallel Optimization Toolkit for Nonlinear Model Predictive Control (NMPC)
https://deng-haoyang.github.io/ParNMPC/
BSD 2-Clause "Simplified" License
297 stars 78 forks source link

macOS Compilation #6

Open DeepakIngole opened 6 years ago

DeepakIngole commented 6 years ago

Hi Deng,

I am using ParNMPC on MATLAB 2018a and macOS High Sierra 10.13.6. While code generation I am getting an error.

`1 error generated. gmake: *** [NMPC_Iter.o] Error 1

Error(s) encountered while building "NMPC_Iter":

Failed to generate all binary outputs.


??? Build error: C compiler produced errors. See the Build Log for further details.

Code generation failed: View Error Report Error using codegen

Error in NMPC_Iter_CodeGen (line 83) codegen -config cfg ...

Error in Simu_Simulink_Setup (line 31) NMPC_Iter_CodeGen('dll','C',DoP); ` How to generate dylib insted of dll?

Thank you.

deng-haoyang commented 6 years ago

Hi DeepakIngole,

Sorry for late response. I don't have a mac in my hand right now and I cannot give you the exact solution.

Most likely, it is the problem of generating or compiling the openmp code. One way to check is to disable parallel code generation, i.e., by setting DoP to 1 and remove openmp timer function in Timer.m.

Another way is to switch 'dll' to 'lib' to generate C code without compiling. But I am not sure it will work or not.

The code generation function NMPC_Iter_CodeGen is actually based on MATLAB Coder and you can check the codegen function and possibly fix it.

Thank you for your feedback and I will fix it as soon as possible.