Since we are a C + + driven python development, the driver needs to be coupled with Python static library libpython2.7.so, libpython2.7.so.1.0, libpython2.7.a.
Here I want to add my own log on the Python source, so I want to recompile python to generate a static library, and then generate the driver.
General Quick Compile Install Python source step:
./configure
Make
Make install
If you want to generate a static library libpython2.7.so, libpython2.7.so.1.0, libpython2.7.a:
./configure --prefix=/usr/local/python2.7 --enable-sharedmakemake install altinstall
--prefix Specify the directory you want to install,--enable-shared means compile to static library;
install 安装会使用新安装的版本,
altinstall 则会使用旧版本(假如有)。(应该是这样吧。。)
Reference:
Http://stackoverflow.com/questions/16018463/difference-in-details-between-make-install-and-make-altinstall
Http://stackoverflow.com/questions/26597527/how-to-install-libpython2-7-so
Compiling python to generate a static library libpython2.7.so