Closed FabioBergonti closed 2 months ago
The key error is:
Error code: /home/fbergonti/miniforge3/envs/test_casadi/lib/python3.12/site-packages/casadi/../../../././libblasfeo.so: undefined symbol: kernel_dpack_buffer_ft
Indeed, there are some symbols missing in blasfeo, see:
(casadi366) traversaro@IITBMP014LW012:~/fatrop_demo$ nm ${CONDA_PREFIX}/lib/libblasfeo.so | grep "U kernel"
U kernel_dgetr_tn_4_lib
U kernel_dgetr_tn_4_vs_lib
U kernel_dgetr_tn_8_lib
U kernel_dpack_buffer_fn
U kernel_dpack_buffer_ft
U kernel_dpack_buffer_ln
U kernel_dpack_buffer_lt
U kernel_dpack_buffer_ut
I fixed locally by backporting, but the example still fails with:
(casadi366) traversaro@IITBMP014LW012:~/fatrop_demo$ python after.py
it obj cv du lg(mu) reg alpha_du alpha_pr ls
0 2.1000000e+02 9.70e-01 9.85e-01 2.0 -.- 0.00e+00 0.00e+00 0x
1 2.3645160e+02 4.63e-01 7.85e+00 -0.1 -.- 1.22e-01 1.70e-01 2h
2 2.2329015e+02 3.77e-01 8.55e+00 -0.1 -.- 7.95e-01 1.78e-01 1h
3 2.3412732e+02 1.03e-01 3.23e+00 -0.1 -.- 6.06e-01 1.00e+00 1h
4 2.2272949e+02 4.34e-02 1.18e+00 -0.8 -.- 1.00e+00 7.83e-01 1h
5 2.1727447e+02 7.26e-03 1.85e-01 -1.5 -.- 1.00e+00 1.00e+00 1h
6 2.1665629e+02 1.93e-03 1.82e-02 -2.2 -.- 1.00e+00 1.00e+00 1h
7 2.1655221e+02 4.43e-05 1.11e-03 -3.4 -.- 1.00e+00 9.99e-01 1h
8 2.1654383e+02 4.03e-07 6.74e-06 -5.0 -.- 1.00e+00 1.00e+00 1h
9 2.1654363e+02 1.16e-10 1.76e-09 -7.6 -.- 1.00e+00 1.00e+00 1h
10 2.1654363e+02 7.11e-15 1.21e-14 -9.0 -.- 1.00e+00 1.00e+00 1h
---- stats ----
compute_sd: 0.000365 s
duinf: 3.1e-05 s
initialization: 0.000472 s count: 10
time_FE : 0.004185 s
eval hess: 0.002379 s count: 10
eval jac: 0.001274 s count: 12
eval cv: 0.000423 s count: 14
eval grad: 4.2e-05 s count: 12
eval obj: 6.7e-05 s count: 35
rest : 0.000648 s
-----
time_w/o_FE : 0.001516 s
time_FE : 0.004185 s
time_total : 0.005701 s iterations: 10
found solution
solver : t_proc (avg) t_wall (avg) n_eval
nlp_f | 39.00us ( 1.11us) 34.41us (983.14ns) 35
nlp_g | 372.00us ( 26.57us) 368.98us ( 26.36us) 14
nlp_grad_f | 16.00us ( 1.33us) 17.53us ( 1.46us) 12
nlp_hess_l | 2.29ms (228.60us) 2.29ms (229.08us) 10
nlp_jac_g | 1.14ms ( 94.75us) 1.14ms ( 94.79us) 12
total | 5.98ms ( 5.98ms) 14.58ms ( 14.58ms) 1
Traceback (most recent call last):
File "/home/traversaro/fatrop_demo/after.py", line 119, in <module>
sol = opti.solve()
^^^^^^^^^^^^
File "/home/traversaro/miniforge3/envs/casadi366/lib/python3.12/site-packages/casadi/casadi.py", line 48339, in solve
return _casadi.Opti_solve(self, *args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Error in Opti::solve [OptiNode] at .../casadi/core/optistack.cpp:165:
.../casadi/core/generic_type.cpp:438: Assertion "is_string()" failed:
type mismatch
Probably we should include the python after.py
example in the feedstock to check if fatrop works.
Interestingly, I also get the `Assertion "is_string()" failed" error with casadi installed via pip, @FabioBergonti can you report the conda list of the environment were that is working?
Interestingly, I also get the `Assertion "is_string()" failed" error with casadi installed via pip, @FabioBergonti can you report the conda list of the environment were that is working?
It is failing also on my laptop. The example seems to have a bug as pointed out in this issue. I resolved it with this workaround.
Ah great, that means by fix works, I will open a PR in blasfeo-feedstock.
Ah great, that means by fix works, I will open a PR in blasfeo-feedstock.
Done in https://github.com/conda-forge/blasfeo-feedstock/pull/9 .
Solution to issue cannot be found in the documentation.
Issue
I'm testing
fatrop
with this code https://github.com/jgillis/fatrop_demo/blob/master/after.py, but I'm encountering the following error:If I run the same code with CasADi 3.6.6 installed via pip, it works correctly.
Installed packages
Environment info