acados with python interface on mac
Dimitris Kouzoupis edited this page Aug 14, 2018
·
4 revisions
Currently, casadi must be compiled from sources (with the same compiler as acados) to work on mac.
-
Clone casadi
git clone https://github.com/casadi/casadi.git
-
Go for a walk
-
Checkout version 3.4.0
cd casadi
git checkout 3.4.0
-
Build casadi from sources, with python interface:
mkdir build && cd build
cmake -DWITH_SELFCONTAINED=ON -DWITH_PYTHON=ON -DWITH_PYTHON3=ON -DCMAKE_INSTALL_PREFIX=~/Desktop/tmp ..
make -j 4 && make install
-
Go for another walk
-
Add casadi install folder to PYTHONPATH
cd ~/Desktop/tmp
export PYTHONPATH=$(pwd):$PYTHONPATH
-
Run an acados example (assuming you have already compiled with SWIG_PYTHON=ON)
cd ACADOS_DIRECTORY/build/swig/python
python3 ../../../examples/python/ocp_nlp.py