Typedef redefinition with qpDUNES on M2 Mac

Hi there,

I am trying to install acados on an M2 MacBook and followed the steps in the documentation. I generated the code with CMake using cmake -DACADOS_WITH_QPDUNES=1 -DACADOS_WITH_OSQP=1 -DACADOS_WITH_QPOASES=1 -DACADOS_WITH_OPENMP=1 -DBLASFEO_TARGET=X64_AUTOMATIC .. and tried to install it with make install -j4.

I get the following weird error:

In file included from /Users/tudoroancea/acados/acados/ocp_qp/ocp_qp_qpdunes.c:51:
In file included from /Users/tudoroancea/acados/acados/utils/print.h:43:
In file included from /Users/tudoroancea/acados/acados/ocp_nlp/ocp_nlp_common.h:62:
In file included from /Users/tudoroancea/acados/acados/ocp_nlp/ocp_nlp_dynamics_common.h:54:
In file included from /Users/tudoroancea/acados/acados/sim/sim_common.h:41:
In file included from /Users/tudoroancea/acados/acados/utils/timing.h:60:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/mach/mach_time.h:32:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/mach/mach_types.h:80:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/mach/host_info.h:66:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/mach/message.h:75:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/mach/port.h:91:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/mach/boolean.h:73:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/mach/machine/boolean.h:35:
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/mach/arm/boolean.h:70:25: error: typedef redefinition with different types ('int' vs 'unsigned int')
typedef int             boolean_t;
                        ^
/Users/tudoroancea/acados/external/qpdunes/include/qp/types.h:151:23: note: previous definition is here
        typedef unsigned int boolean_t;
                             ^
1 error generated.
make[2]: *** [acados/CMakeFiles/acados.dir/ocp_qp/ocp_qp_qpdunes.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [acados/CMakeFiles/acados.dir/all] Error 2
make: *** [all] Error 2

However, when I disable the qpdunes option, it works. I am not sure where the error is but I think it might be a bug.

This confilicting type definition, could be resolved by replacing

boolean_t

with something else, like

bool_qpdunes_t

everywhere in qpDUNES.

I will try to fix it. Should I then try to open a PR on acados’s fork of qpDUNES?

Sure, feel free to do that!