Mac boost编译libboost_python3

mac系统自带python2.7,无论是brew install boost-python还是源码安装boost编译后会生成libboost_python27.dylib,但有些应用需要libboost_python3,下面我们就来编译。

进入boost源文件目录boost_1_720,配置仅仅编译python,python路径指向anaconda3中的python3.6。
 

./bootstrap.sh --with-libraries=python --with-toolset=gcc
./b2 cflags='-fPIC' cxxflags='-fPIC' --with-python include="/Users/huamulan/anaconda3/include/python3.6m/"

--with-toolset=gcc可以选择不用

sudo ./b2 install

编译安装成功后,/usr/local/lib下会有libboost_python36.dylib和libboost_python36.a,有些应用link时需要的是libboost_python3.so或者libboost_python3.a,我们建个软链:

cd /usr/local/lib
sudo ln -s libboost_python36.dylib libboost_python3.dylib
sudo ln -s libboost_python36.a libboost_python3.a

 

你可能感兴趣的:(深度学习,caffe)