Tim-Salzmann / l4casadi

Use PyTorch Models with CasADi for data-driven optimization or learning-based optimal control. Supports Acados.
MIT License
350 stars 23 forks source link

propagate_const library is not available on Windows #13

Closed Heliosfang closed 1 year ago

Heliosfang commented 1 year ago

Hi, I'm trying to use it on Windows11, it seems that the experimental/propagate_const is not available in the current standard library, is it possible to use it on windows like under conda environment?

One more question is, I also tried to run the code readme.py under Linux conda environment, but when the code runs to

y_sym = l4c_model(x_sym)

the program dies says the .so generated file has something wrong

thank you!

Tim-Salzmann commented 1 year ago

Hi,

Please post the exact error messages you are getting. Otherwise, it is hard to reason what is going on.

Windows is not officially supported.

Thanks Tim

Heliosfang commented 1 year ago

Thanks for the reply, the error message I have shows below,I got this when trying to run the simple_nlp.py:

symbol lookup error: /home/acsr/deep_learning_test/l4casadi/_l4c_generated/libf.so: undefined symbol: _ZN8L4CasADiC1ESsSsbSsbb

Similar error when I run the readme.py:

symbol lookup error: /home/acsr/deep_learning_test/l4casadi/_l4c_generated/libl4casadi_f.so: undefined symbol: _ZN8L4CasADiC1ESsSsbSsbb

I can see the error happens when the code trying to implement a casadi symbol x to the l4c_model.

Thanks!

Hi,

Please post the exact error messages you are getting. Otherwise, it is hard to reason what is going on.

Windows is not officially supported.

Thanks Tim

Tim-Salzmann commented 1 year ago

Hi,

can you provide the ldd output for the two libraries respectively please? Which platform is this on? Native Ubuntu?

Thanks Tim

Heliosfang commented 1 year ago

I tested it on the anaconda environment in Ubuntu 20.04, through the virtual environment's own python 3.9.17 pip install, ldd couldn't output anything saying: not a dynamic executable

so I tried lddcollect to check the _l4c_generated folder: lddcollect ./ --json { "files": [ "/lib/x86_64-linux-gnu/ld-2.31.so", "/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2", "/lib/x86_64-linux-gnu/libc-2.31.so", "/lib/x86_64-linux-gnu/libc.so.6", "/lib/x86_64-linux-gnu/libgcc_s.so.1", "/lib/x86_64-linux-gnu/libm-2.31.so", "/lib/x86_64-linux-gnu/libm.so.6", "/lib/x86_64-linux-gnu/libstdc++.so.6", "/lib/x86_64-linux-gnu/libstdc++.so.6.0.28" ] } There were missing libraries libl4casadi.so

so perhaps its due to the conda environment?

Heliosfang commented 1 year ago

I just tried it on the original environment out of conda, similar error happens again:

OSError: /home/acsr/.local/lib/python3.9/site-packages/l4casadi/lib/libl4casadi.so: undefined symbol: _ZN5torch3jit4loadERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN3c108optionalINS9_6DeviceEEEb

Heliosfang commented 1 year ago

Well now I managed to make it works by uninstall it from the packages and build again through the source, thanks a lot for the help!