二次规划求解库安装教程
1、Eigen安装
sudo apt install libeigen3-dev
2、CppAD 安装
sudo apt install cppad
CppAD需要调用系统中已经安装好的优化求解器,如非线性优化器ipopt、Gurobi、GLPK。
3、Ipopt安装
3.1 install Ipopt on ARM environment
## Inatall CPPAD & Fortran
$ sudo apt-get install cppad gfortran
## Get ipopt source code
Download Ipopt-3.12.8.tgz from https://www.coin-or.org/download/source/Ipopt/
Untar the package and cd into the "Ipopt-3.12.8" folder
## Step by step
$ cd CUSTOM_PATH/Ipopt-3.12.8/ThirdParty/Blas
$ ./get.Blas
$ cd ../Lapack
$ ./get.Lapack
$ cd ../Mumps
$ ./get.Mumps
$ cd ../Metis
$ ./get.Metis
$ cd CUSTOM_PATH/Ipopt-3.12.8
$ mkdir build
$ cd build
$ ../configure --build=arm-linux
$ make -j4
$ make install
## Copy install files into specific directory
$ cd CUSTOM_PATH/Ipopt-3.12.8/build
$ sudo cp -a include/* /usr/include/.
$ sudo cp -a lib/* /usr/lib/.
## Trouble Shooting
If something wrong like: "redefinition of ‘bool CppAD::is_pod()"
Modify the file:
$ sudo gedit /usr/include/cppad/configure.hpp
Change line from:
define CPPAD_SIZE_T_NOT_UNSIGNED_INT 1
to
define CPPAD_SIZE_T_NOT_UNSIGNED_INT 0
## Inatall CPPAD & Fortran
$ sudo apt-get install cppad gfortran
## Get ipopt source code
Download Ipopt-3.12.8.tgz from https://www.coin-or.org/download/source/Ipopt/
Untar the package and cd into the "Ipopt-3.12.8" folder
## Step by step
$ cd CUSTOM_PATH/Ipopt-3.12.8/ThirdParty/Blas
$ ./get.Blas
$ cd ../Lapack
$ ./get.Lapack
$ cd ../Mumps
$ ./get.Mumps
$ cd ../Metis
$ ./get.Metis
$ cd CUSTOM_PATH/Ipopt-3.12.8
$ mkdir build
$ cd build
$ ../configure --build=arm-linux
$ make -j4
$ make install
## Copy install files into specific directory
$ cd CUSTOM_PATH/Ipopt-3.12.8/build
$ sudo cp -a include/* /usr/include/.
$ sudo cp -a lib/* /usr/lib/.
## Trouble Shooting
If something wrong like: "redefinition of ‘bool CppAD::is_pod()"
Modify the file:
$ sudo gedit /usr/include/cppad/configure.hpp
Change line from:
define CPPAD_SIZE_T_NOT_UNSIGNED_INT 1
to
define CPPAD_SIZE_T_NOT_UNSIGNED_INT 0
2.2 install Ipopt on x86 environment
## Inatall CPPAD & Fortran
$ sudo apt-get install cppad gfortran
## Get ipopt source code
Download Ipopt-3.12.8.tgz from https://www.coin-or.org/download/source/Ipopt/
Untar the package and cd into the "Ipopt-3.12.8" folder
## Step by step
$ cd CUSTOM_PATH/Ipopt-3.12.8/ThirdParty/Blas
$ ./get.Blas
$ cd ../Lapack
$ ./get.Lapack
$ cd ../Mumps
$ ./get.Mumps
$ cd ../Metis
$ ./get.Metis
$ cd ../ASL
$ ./get.ASL
$ cd CUSTOM_PATH/Ipopt-3.12.8
$ mkdir build
$ cd build
$ ../configure
$ make -j4
$ sudo make install
## Copy install files into specific directory
$ cd CUSTOM_PATH/Ipopt-3.12.8/build
$ sudo cp -a include/* /usr/include/.
$ sudo cp -a lib/* /usr/lib/.
#1、Inatall CPPAD & Fortran
sudo apt install cppad gfortran
#2、Get ipopt source code
#Download Ipopt-3.12.8.tgz from https://www.coin-or.org/download/source/Ipopt/
#Untar the package and cd into the "Ipopt-3.12.8" folder
sudo apt install wget #用于下载东西
sudo apt install zip #用于解压
wget https://www.coin-or.org/download/source/Ipopt/Ipopt-3.12.8.zip -O Ipopt-3.12.8.zip
unzip Ipopt-3.12.8.zip
#3、Step by step
cd Ipopt-3.12.8/ThirdParty/Blas
./get.Blas
cd ../Lapack
./get.Lapack
cd ../Mumps
./get.Mumps
cd ../Metis
./get.Metis
cd ../ASL
./get.ASL
#4、移动到顶层目录,CUSTOM_PATH/Ipopt-3.12.8,开始编译
cd ..
cd ..
mkdir build
cd build
../configure
make
sudo make install
#6、Copy install files into specific directory
sudo cp -a include/* /usr/include/.
sudo cp -a lib/* /usr/lib/.
4、osqp安装
这里默认git的是最新版本,apollo默认用的是0.5.0版本,可以切换0.6.0。0.6.0更新了osqp_setup, clone慢可以先用gitee保存
git clone --recursive https://github.com/oxfordcontrol/osqp -b v0.6.0
cd osqp
mkdir build
cd build
cmake -G "Unix Makefiles" ..
cmake --build .
make
sudo make install
sudo make uninstall #卸载
5、osqp-eigen安装
git clone https://github.com/robotology/osqp-eigen.git
cd osqp-eigen
mkdir build
cd build
cmake -G "Unix Makefiles" ..
cmake --build .
make
sudo make install
sudo make uninstall
6、qpOASES
git clone https://github.com/coin-or/qpOASES.git -b releases/3.2.1
cd qpOASES/
mkdir build
cd build
cmake ..
make
sudo make install #安装到系统目录
#卸载
sudo xargs rm < install_manifest.txt