Ubuntu中下载boost包安装boost
移除原来的boost方法:
sudo apt-get --purge remove libboost-dev
sudo apt-get --purge remove libboost-all-dev
安装boost 1.57依赖项
sudo apt-get install mpi-default-dev ##(不知道有没有用)
sudo apt-get install libbz2-dev
sudo apt-get install libicu-dev
sudo apt-get install python-dev
查看boost版本:
cat /usr/include/boost/version.hpp | grep "BOOST_LIB_VERSION"
The way you are reinstalling the package might install Boost on your (/home) as opposed to on system (/usr..).
Use the --prefix
option of b2 to set the installation location.
Depending on where it installs, at the completion of ./b2
Install Ipopt on Ubuntu
See the intallation_tips
Ipopt uses a few external packages that are not included in the Ipopt source code distribution, for example ASL, HSL, and MUMPS, COIN-OR. Because of licences, the third party libraries is not included in Ipopt github repo. You need to install one of them before installing Ipopt library.
The third party library which I choose is ThirdParty-HSL. According to the first step of installation of ThirdParty-HSL github repo, download personal licence coin-HSL from http://www.hsl.rl.ac.uk/ipopt/. Install it with the following:
cd coinhsl
./configure
make -j4
sudo make install
pkg-config --libs coinhsl # make sure installed
pkg-config --cflags coinhsl # make sure installed
After installing coin-HSL, you can download Ipopt from . Follow the rules:
cd ipopt
./configure --with-hsl-lflags="-L/usr/local/lib -lcoinhsl" # important
make -j4
sudo make install
pkg-config --libs ipopt # make sure installed
pkg-config --cflags ipopt # make sure installed