Compiling python to generate a static library libpython2.7.so

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.