Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable useful options in CasADi build of the robotology-superbuild #614

Closed
traversaro opened this issue Feb 8, 2021 · 3 comments
Closed

Comments

@traversaro
Copy link
Member

See #239 (comment) .

@traversaro
Copy link
Member Author

Continuing from #239 (comment) :

@diegoferigo

The module could not be imported. I had to apply the following patch: sed -i "s/class _copyableObject(_object):/class _copyableObject():/g" /usr/local/src/robotology-superbuild/build/install/python/casadi/casadi.py. I guess it is a Python2 related problem.

Interesting, similar problem (but different sed line) on conda-forge : https://github.com/conda-forge/casadi-feedstock/blob/391139c859e1fba1321818bae27b6ca11fa4081e/recipe/build.sh#L18 . Interestingly, nothing seems to be necessary on Windows, I don't know if a new release came out and fixed that w.r.t. to the fork we are using in the superbuild.

The Python bindings are installed into /install/python.

I think you can specify that with the PYTHON_PREFIX option, see https://github.com/conda-forge/casadi-feedstock/blob/391139c859e1fba1321818bae27b6ca11fa4081e/recipe/build.sh#L13 .

Yep I agree, we should pass -DWITH_LAPACK=ON WITH_MUMPS=ON WITH_QPOASES=ON.

You have a specific use case for -DWITH_LAPACK=ON WITH_MUMPS=ON ? I am afraid those could now work in the vcpkg-based Windows build. My goal is to eventually replace that with the Conda-based Windows build, but probably this will take some time, if you have a specific use case we can enable it just on Linux/macOS, otherwise I would avoid to have cross-platform differences.

@diegoferigo
Copy link
Member

The module could not be imported. I had to apply the following patch: sed -i "s/class _copyableObject(_object):/class _copyableObject():/g" /usr/local/src/robotology-superbuild/build/install/python/casadi/casadi.py. I guess it is a Python2 related problem.

Interesting, similar problem (but different sed line) on conda-forge : https://github.com/conda-forge/casadi-feedstock/blob/391139c859e1fba1321818bae27b6ca11fa4081e/recipe/build.sh#L18 . Interestingly, nothing seems to be necessary on Windows, I don't know if a new release came out and fixed that w.r.t. to the fork we are using in the superbuild.

Ow cool, thanks for the reference, I'm glad I was not the only one :) Maybe SWIG on windows generates slightly different code.

The Python bindings are installed into /install/python.

I think you can specify that with the PYTHON_PREFIX option, see https://github.com/conda-forge/casadi-feedstock/blob/391139c859e1fba1321818bae27b6ca11fa4081e/recipe/build.sh#L13 .

Yes you can. Btw I noticed yesterday that with a conda-based installation (not sure in a normal Ubuntu system) the PYTHONPATH exported by the superbuild is wrong. I start thinking that using an unversioned <build>/install/lib/python/site-packages would be more robust.

(/conda) root@ed2fd1dfa26f:~# cat /usr/local/src/robotology-superbuild/build/install/share/robotology-superbuild/setup.sh | grep PYTHON
# Add the python bindings directory to the PYTHON_PATH
export PYTHONPATH=${PYTHONPATH:+${PYTHONPATH}:}${ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX}/lib/python3/dist-packages
export PYTHONPATH=${PYTHONPATH}:${ROBOTOLOGY_SUPERBUILD_INSTALL_PREFIX}/lib/python3/site-packages

(/conda) root@ed2fd1dfa26f:~# ls /usr/local/src/robotology-superbuild/build/install/lib | grep python
python3.8

(/conda) root@ed2fd1dfa26f:~# ls /usr/local/src/robotology-superbuild/build/install/lib/python3.8/   
dist-packages  site-packages

Yep I agree, we should pass -DWITH_LAPACK=ON WITH_MUMPS=ON WITH_QPOASES=ON.

You have a specific use case for -DWITH_LAPACK=ON WITH_MUMPS=ON ? I am afraid those could now work in the vcpkg-based Windows build. My goal is to eventually replace that with the Conda-based Windows build, but probably this will take some time, if you have a specific use case we can enable it just on Linux/macOS, otherwise I would avoid to have cross-platform differences.

One of the two is mandatory for the qpOASES backend, now on the fly I don't recally which one of the two.

@traversaro
Copy link
Member Author

Fixed in #694 for Python and in #747 for MATLAB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants