473,396 Members | 2,011 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Building Python statically on linux

Are there instructions somewhere on how to build Python (on linux)
statically? This seems like a common thing to do want to do, but my
searching isn't turning up much. If it is common, it would be nice to
see a configure option like I've seen in other tools:

--enable-all-static Build completely static (standalone)
binaries.

I'm ./configure-ing with "--disable-shared" (because this must mean
"enable static", right?), and (based on some other posts here) tried
adding "*static*" near the top of Modules/Setup. I'd like to see ldd
tell me "not a dynamic executable", but alas, it's presently:

$ ldd /path/to/new/bin/python
libpthread.so.0 =/lib/tls/libpthread.so.0 (0x008e9000)
libdl.so.2 =/lib/libdl.so.2 (0x007f0000)
libutil.so.1 =/lib/libutil.so.1 (0x00df6000)
libm.so.6 =/lib/tls/libm.so.6 (0x007cb000)
libc.so.6 =/lib/tls/libc.so.6 (0x0069f000)
/lib/ld-linux.so.2 (0x00682000)

Do I just need to be passing something like LDFLAGS="-static ???" to
configure? I just tried that and got a bunch of "symbol rename"
warnings during the compilation, and then "make install" mysteriously
failed.

Thanks for any pointers.
--
Micah
Dec 27 '07 #1
3 2488
Micah Elliott wrote:
I'm ./configure-ing with "--disable-shared" (because this must mean
"enable static", right?), and (based on some other posts here) tried
adding "*static*" near the top of Modules/Setup. I'd like to see ldd
tell me "not a dynamic executable", but alas, it's presently:
--disabled-shared is the default value. It does not mean that the Python
interpreter is a static linked executable. --enable-shared builds a
libpython??.so and --disable-shared links libpython into the python binary.

Christian

Dec 27 '07 #2
On Dec 27, 8:21*am, Christian Heimes <li...@cheimes.dewrote:
Micah Elliott wrote:
I'm ./configure-ing with "--disable-shared" (because this must mean
"enable static", right?)
I think you can just add -static to the gcc Flag line in the
makefile. "man gcc" should also be helpful but that is a pile of docs
to wade through.
Dec 27 '07 #3
On Dec 28, 5:44 am, Christian Heimes <li...@cheimes.dewrote:
Can you work on the topic and write a small howto for your wiki
(http://wiki.python.org/moin/)?
Good idea. I've created a placeholder (with what I know so far, not
much) to track this:

http://wiki.python.org/moin/BuildStatically

I'll plan to be updating it today if I can get it working. Anyone
else is welcome to add their knowledge/experience.
Dec 28 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Erik Johnson | last post by:
I am trying to upgrade my Python installation. After downloading sources and building Python 2.3.4, I am unable to use the command history editing feature in the interactive interpreter (where the...
1
by: francescomoi | last post by:
Hi. I'm trying to build MySQL-python-1.2.0 on my Linux FC2 (with MySQL 3.23.58). But when building, I get this error message: ------------------------------------------------------- # python...
5
by: arve.knudsen | last post by:
Hi I'm trying to build a Python package that I can use on different Linux setups, for this purpose it would be nice to weld external dependencies (libraries) into Python itself. So far I've...
0
by: Samuel M. Smith | last post by:
I can build python 2.4.2 from source on the embedded linux box when I nfs mount and boot a full debian distribution. The embedded box also has stripped down linux distribution in onboard flash....
7
by: Hal Vaughan | last post by:
I have a problem with port forwarding and I have been working on it for over 2 weeks with no luck. I have found C programs that almost work and Java programs that almost work, but nothing that...
3
by: Ralph Butler | last post by:
Hi: I have searched the docs and google but have not totally figured out how to accomplish my task: On a linux box, I want to compile and link python so that it uses no shared libraries, but...
0
by: Alan | last post by:
Dears, It's about Pyhton for Linux X86. First, I would like to know if it's possible to build a fully static python binary, something that does not depends on others libraries when using 'ldd...
15
by: kyosohma | last post by:
Hi, I am trying to get a small group of volunteers together to create Windows binaries for any Python extension developer that needs them, much like the package/extension builders who volunteer...
145
by: Dave Parker | last post by:
I've read that one of the design goals of Python was to create an easy- to-use English-like language. That's also one of the design goals of Flaming Thunder at http://www.flamingthunder.com/ ,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.