ubuntu安装非线性优化器Ipopt
Install 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({$CUSTOM_PATH})
Step by step download the libraries
cd {$CUSTOM_PATH}/Ipopt-3.12.8/ThirdParty/Blas
./get.Blas
cd ../Lapack
./get.Lapack
cd ../Mumps
./get.Mumps
cd ../Metis
./get.Metis
在执行./get.Mumps 和 ./get.Metis 可能由于国内网络问题无法下载
可手动下载源码并放在指定的位置, 下载地址
根据./get.Mumps 和 ./get.Metis文件中的脚本步骤,将下载的文件以正确的名称放到正确的位置。
其中get.Mumps脚本中, 下载文件后执行了下述指令
rm -rf MUMPS
mv MUMPS_${mumps_ver} MUMPS # 将带版本号的文件夹名称修改为不带版本号的名称
patch -p0 < mumps.patch #执行补丁文件
patch -p0 < mumps_mpi.patch #执行补丁文件
mv MUMPS/libseq/mpi.h MUMPS/libseq/mumps_mpi.h # 修改头文件名称
get.Mumps 脚本将带有修订号的文件名改为不带修订号的文件名
mv metis-4.0.? metis-4.0
Compile and Install
cd {$CUSTOM_PATH}/Ipopt-3.12.8
mkdir build && cd build
../configure
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/.