hpipm
hpipm copied to clipboard
Compiler mex errors
Hello. I am trying to use hpipm in Matlab and Simulink. I am using Matlab 2021b and I have installed Visula Studio 2022 at my computer.
I have followed the instruction of the installation but I face some problems.
The blasfeo installation and build proccess has been done without problems. When I try to build hpipm and run the command:
cmake --build
, I get the following error:
C:\myfiles\hpipm\examples\c\example_d_ocp_qp.c(45,10): fatal error C1083: Cannot open include file: 'sys/time
.h': No such file or directory [C:\myfiles\hpipm\build\examples\c\example_d_ocp_qp.vcxproj]
getting_started_data.c
C:\myfiles\hpipm\examples\c\data\getting_started_data.c(100,29): error C2059: syntax error: '}' [C:\myfiles\hpipm\build\examples\c\example_d_ocp_qp.vcxproj].
This problem started popping up after I tried to rebuild hpipm to overcome the following two problems.
- In order to use hpipm in Matlab, I run env.m and then hpipm/interfaces/matlab_octave/compile_mex_all.m. After running th file the following error pops up:
Building with 'MinGW64 Compiler (C)'.
Error using mex
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
C:\myfiles\hpipm\lib\hpipm.lib(hpipm.dir/Debug/d_ocp_qp_dim.obj):(.rtc$IMZ+0x0):
undefined reference to `_RTC_InitBase'
C:\myfiles\hpipm\lib\hpipm.lib(hpipm.dir/Debug/d_ocp_qp_dim.obj):(.rtc$TMZ+0x0):
undefined reference to `_RTC_Shutdown'
collect2.exe: error: ld returned 1 exit status
- Another error comes up when I follow the instruction in order to use hpipm in Simulink after running hpipm/examples/simulink/make_sfun.m :
Error using mex
Warning: corrupt .drectve at end of def file
C:\myfiles\hpipm\lib\hpipm.lib(hpipm.dir/Debug/timing.obj):(.rtc$IMZ+0x0):
undefined reference to `_RTC_InitBase'.
Could you please help me solving this issues?