15

I compiled python 2.7.11 as follow steps:

tar -xf python.tar.xz
./configure
make

after compiling, I found that there is no libpython2.7.so in the results, which means that this is not a 'dev' version.

So, how could I make the .so file and install them properly (Do not override the default python of system) ?

1
  • 3
    Note that -dev packages (as provided my many distros) do not mean they include a shared library (.so) or static library (.a). Rather, -dev packages provide the header files used during compilation. Commented Jan 3, 2017 at 19:59

1 Answer 1

22

You need:

./configure --enable-shared

Check out all that ./configure has to offer with:

./configure --help
Sign up to request clarification or add additional context in comments.

4 Comments

Thanks for your answer. I just updated my question. besides the compiling, I also want to know how to install them (maybe make some symbol links) to the properly dirs. I do not want the system's default python to be override, so the install location should be my home dir, i.e. ~, and add the header and lib dir to compiler's finding path.
Then configure the prefix in ./configure. But if you have a new question, please make a new post. Don't forget we're helping you, but others will get help by reading the QA. If it gets too specific and hard to read, then the post looses its value…
I my case --enable-shared worked. Pay attention whether configure yields a message about unrecognized option with --with-shared
Thanks @PauloCarvalho, just to reassure that the option is --enable-shared and NOT --enabled-shared...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.