giaf / hpipm

High-performance interior-point-method QP and QCQP solvers
Other
548 stars 130 forks source link

Error in example_d_ocp_qp: blasfeo_dtrsm_rlnn: feature not implemented yet #117

Closed reichardtj closed 2 years ago

reichardtj commented 2 years ago

This appears to be the source of https://github.com/giaf/hpipm/issues/116

When running the example example_d_ocp_qp in the latest master of hpipm, the program exits with blasfeo_dtrsm_rlnn: feature not implemented yet - just when it tries to get the Riccati K matrix.

I've installed the latest master of blasfeo and all examples run fine.

Installation on my Mac is via cmake, if that makes any difference.

Thanks for considering this issue.

giaf commented 2 years ago

Thanks for giving me the good hints to understand the issue. Can you check that this https://github.com/giaf/blasfeo/commit/d4387e5fef89a2cad5a4321baa4b774e2a0ea692 solves the issue? Thanks!

reichardtj commented 2 years ago

Thanks! Recompiling Blasfeo and HPIPM allows the example to run and retrieve the feedback matrices. However, there are linker warnings now:

[100%] Linking C executable example_d_ocp_qp
cd /Users/joerg/research/hpipm/build/examples/c && /Applications/CMake.app/Contents/bin/cmake -E cmake_link_script CMakeFiles/example_d_ocp_qp.dir/link.txt --verbose=1
/Library/Developer/CommandLineTools/usr/bin/cc  -O2 -fPIC -DTARGET_AVX -m64 -mavx  -DUSE_C99_MATH -DRUNTIME_CHECKS -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names  CMakeFiles/example_d_ocp_qp.dir/example_d_ocp_qp.c.o CMakeFiles/example_d_ocp_qp.dir/data/getting_started_data.c.o  -o example_d_ocp_qp ../../libhpipm.a /opt/blasfeo/lib/libblasfeo.a -lm
ld: warning: could not create compact unwind for _blasfeo_pack_dmat: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _blasfeo_pack_l_dmat: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _blasfeo_pack_u_dmat: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _blasfeo_pack_tran_dmat: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _blasfeo_unpack_dmat: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _blasfeo_unpack_tran_dmat: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _blasfeo_dveccl: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _blasfeo_dveccl_mask: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _blasfeo_dvecze: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _blasfeo_hp_dvecmul.part.0: non-standard register 10 being saved in prolog
ld: warning: could not create compact unwind for _blasfeo_hp_dvecmulacc.part.1: non-standard register 10 being saved in prolog
ld: warning: could not create compact unwind for _blasfeo_hp_dvecmuldot.part.2: non-standard register 10 being saved in prolog
ld: warning: could not create compact unwind for _blasfeo_hp_daxpy: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _blasfeo_hp_daxpby: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _blasfeo_hp_dgelqf.part.5: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _blasfeo_hp_dorglq.part.6: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _blasfeo_hp_dgelqf_pd.part.7: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _blasfeo_hp_dgelqf_pd_la.part.8: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _blasfeo_hp_dgelqf_pd_lla.part.9: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _blasfeo_hp_dgemm_tn: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _blasfeo_hp_dsyrk_ln: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _blasfeo_hp_dsyrk_ut: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgecp_8_0_lib4: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgecpsc_8_0_lib4: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgecpsc_8_1_lib4: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgecpsc_8_2_lib4: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgecpsc_8_3_lib4: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgecpsc_4_0_lib4: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgecpsc_4_1_lib4: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgecpsc_4_2_lib4: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgecpsc_4_3_lib4: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgead_8_0_lib4: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgead_8_1_lib4: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgead_8_2_lib4: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgead_8_3_lib4: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgead_4_0_lib4: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgead_4_1_lib4: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgead_4_2_lib4: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgead_4_3_lib4: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgeset_4_lib4: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dtrset_4_lib4: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dlarf_t_4_lib4: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgelqf_vs_lib4: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgelqf_pd_vs_lib4: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgelqf_pd_la_vs_lib4: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgelqf_pd_lla_vs_lib4: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgetr_8_lib4: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgetr_4_lib4: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgetrf_pivot_4_vs_lib4.part.0: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgetrf_pivot_12_lib4: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgetrf_pivot_8_lib4: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgetrf_pivot_4_lib4: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgetrf_pivot_4_vs_lib.part.1: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgetrf_pivot_12_lib: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgetrf_pivot_8_lib: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgetrf_pivot_8_vs_lib: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgetrf_pivot_12_vs_lib: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgetrf_pivot_4_lib: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _kernel_dgemm_diag_right_4_a0_lib4: register 3 saved somewhere other than in frame
ld: warning: could not create compact unwind for _kernel_dgemm_diag_right_4_lib4: register 3 saved somewhere other than in frame
ld: warning: could not create compact unwind for _kernel_dgemm_diag_right_3_lib4: register 3 saved somewhere other than in frame
ld: warning: could not create compact unwind for _kernel_dgemm_diag_right_2_lib4: register 3 saved somewhere other than in frame
ld: warning: could not create compact unwind for _kernel_dgemm_diag_right_1_lib4: register 3 saved somewhere other than in frame
ld: warning: could not create compact unwind for _kernel_dgemm_diag_left_4_lib4: non-standard register 10 being saved in prolog
ld: warning: could not create compact unwind for _kernel_dgemm_diag_left_3_lib4: non-standard register 10 being saved in prolog
[100%] Built target example_d_ocp_qp
/Applications/CMake.app/Contents/bin/cmake -E cmake_progress_start /Users/joerg/research/hpipm/build/CMakeFiles 0

running the example produces a couple of nans in the iteration count (?) but returns the feedback matrices fine:

(base) joerg@Jorgs-MBP build % ./examples/c/example_d_ocp_qp

nan -2.101758

nan -2.101758

nan -2.101758

nan -2.101758

nan -2.101758

nan -2.101758

nan -2.101758

nan -2.101758

nan -2.101758

nan -2.101758

HPIPM returned with flag 0.

 -> QP solved!

Average solution time over 10 runs: 2.867950e-05 [s]

u =
 -2.10176

  0.03793

  0.31730

  0.07956

 -0.16651

x =
  1.00000   1.00000

  2.00000  -1.10176

  0.89824  -1.06383

 -0.16559  -0.74653

 -0.91212  -0.66698

 -1.57909  -0.83349

pi =
  5.24144   2.10176

  2.24144  -0.03793

  0.34320  -0.31730

 -0.49121  -0.07956

 -0.57909   0.16651

ipm return = 0

ipm residuals max: res_g = 6.442504e-10, res_b = 1.776357e-15, res_d = 9.992007e-16, res_m = 9.878959e-12

ipm iter = 3

alpha_aff   mu_aff      sigma       alpha_prim  alpha_dual  mu      res_stat    res_eq      res_ineq    res_comp    lq fact     itref pred  itref corr  lin res stat    lin res eq  lin res ineq    lin res comp
0.000000e+00    0.000000e+00    0.000000e+00    0.000000e+00    0.000000e+00    0.000000e+00    8.999790e+04    2.200000e+00    1.100000e+00    1.000000e+04    0.000000e+00    0.000000e+00    0.000000e+00    0.000000e+00    0.000000e+00    0.000000e+00    0.000000e+00
9.181883e-01    8.184494e+02    5.482461e-04    9.271496e-01    1.000000e+00    4.759825e+02    1.641530e-01    1.617571e-01    8.087855e-02    9.434398e+02    0.000000e+00    0.000000e+00    0.000000e+00    0.000000e+00    0.000000e+00    0.000000e+00    0.000000e+00
9.999530e-01    2.235245e-02    1.035624e-13    1.000000e+00    1.000000e+00    4.760779e-05    1.641600e-08    1.617895e-08    8.089476e-09    9.434413e-05    0.000000e+00    0.000000e+00    0.000000e+00    0.000000e+00    0.000000e+00    0.000000e+00    0.000000e+00
1.000000e+00    1.097816e-13    1.226182e-26    1.000000e+00    1.000000e+00    5.418980e-12    6.442504e-10    1.776357e-15    9.992007e-16    9.878959e-12    0.000000e+00    0.000000e+00    0.000000e+00    0.000000e+00    0.000000e+00    0.000000e+00    0.000000e+00

ocp ipm time = 2.867950e-05 [s]

get Riccati recursion matrices and vectors

Lr0
2.366651e+00

Ls0
9.983282e-01
2.942441e+00

P0
1.608428e+14    2.368178e+00
2.368178e+00    1.586591e+14

lr0
1.033357e+00

p0
-1.608428e+14   -1.586591e+14

K0
-4.218316e-01   -1.243293e+00

k0
-4.366327e-01

Lr1
2.348252e+00

Ls1
9.855357e-01
2.907939e+00

P1
2.943005e+00    2.362694e+00
2.362694e+00    4.601036e+00

lr1
1.143708e+00

p1
1.958549e+00    2.445596e+00

K1
-4.196891e-01   -1.238342e+00

k1
-4.870466e-01
giaf commented 2 years ago

I am not sure where I saw already a similar compiler issue: could it be that you used two different compilers for BLASFEO and HPIPM, e.g. gcc and clang?

reichardtj commented 2 years ago

Ups, that was indeed the case. My bad. Thanks again for fixing the interface.