473,385 Members | 1,562 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,385 software developers and data experts.

static python build?

How do I build Python so that I get static libraries instead of dynamic
libraries (e.g. build/lib.solaris-2.8-sun4u-2.3/math.so)?

John
Jul 18 '05 #1
3 7264
mu**@vex.net writes:
How do I build Python so that I get static libraries instead of dynamic
libraries (e.g. build/lib.solaris-2.8-sun4u-2.3/math.so)?


Edit Modules/Setup. The comments in the file should get you started.

Cheers,
mwh

--
Monte Carlo sampling is no way to understand code.
-- Gordon McMillan, comp.lang.python
Jul 18 '05 #2
Yes, thanks!, it was easy. I just edited Modules/Setup as follows:

(1) Changed the commented *shared* line to the *static* line (see below).

(2) Uncommented the modules (math, time, array) that I wanted incorporated
into the static libpython.a library.

(3) Added lines for a couple other modules (strop & _random) that
previously weren't listed in the Setup file.

(4) Reran configure, make & make install. It works!

Now I can run freeze.py and build a truly stand-alone executable including
the modules I mentioned.

Here's a section of Modules/Setup with my changes:
--------------------------------------------------------------------------
# Uncommenting the following line tells makesetup that all following #
modules are to be built as shared libraries (see above for more
# detail; also note that *static* reverses this effect):

*static*

# Modules that should always be present (non UNIX dependent):

array arraymodule.c # array objects
#cmath cmathmodule.c # -lm # complex math library functions
math mathmodule.c # -lm # math library functions, e.g. sin()
#struct structmodule.c # binary structure packing/unpacking
time timemodule.c # -lm # time operations and variables
#operator operator.c # operator.add() and similar goodies
#_weakref _weakref.c # basic weak reference support
#_testcapi _testcapimodule.c # Python C API test module
strop stropmodule.c
_random _randommodule.c
--------------------------------------------------------------------------


mu**@vex.net writes:
How do I build Python so that I get static libraries instead of dynamic
libraries (e.g. build/lib.solaris-2.8-sun4u-2.3/math.so)?
Edit Modules/Setup. The comments in the file should get you started.

Cheers,
mwh

--
Monte Carlo sampling is no way to understand code.
-- Gordon McMillan, comp.lang.python
--
http://mail.python.org/mailman/listinfo/python-list


Jul 18 '05 #3
mu**@vex.net writes:
Yes, thanks!, it was easy. I just edited Modules/Setup as follows:

(1) Changed the commented *shared* line to the *static* line (see below).

(2) Uncommented the modules (math, time, array) that I wanted incorporated
into the static libpython.a library.

(3) Added lines for a couple other modules (strop & _random) that
previously weren't listed in the Setup file.


I'm a bit surprised strop wasn't in there. _random probably should
be, too. File a bug on SF?

Cheers,
mwh

--
<washort> glyph: you're evil, too
<glyph> washort: I try
<washort> not the good kind of evil
<washort> the other kind -- from Twisted.Quotes
Jul 18 '05 #4

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

Similar topics

7
by: Christos TZOTZIOY Georgiou | last post by:
Last night I was compiling the latest python snapshot at my home Linux system (a K6-III @420 --the extra 20 Hz is overclocking :); then I tried building a shared version of the interpreter. I did...
6
by: Alexandre Gillet | last post by:
Hi, I am trying to build a python interpreter that is static link. My python interpreter was build on RedHat 8.0 using gcc 2.3 and GLIBC 2.3 When running on other linux flavor that still have...
0
by: Helmut Zeisel | last post by:
I want to build a static extension of Python using SWIG and VC++ 6.0 as described in http://www.swig.org/Doc1.3/Python.html#n8 for gcc. My file is testerl.i: ========================= %module...
3
by: Grzegorz Dostatni | last post by:
Cheers. First what I am trying to do: I am trying to create a version of pytho23.dll that contains everything inside of it. It is staticaly linked. It also needs to contain the qt library. For...
4
by: Torsten Mohr | last post by:
Hi, i'd like to build an executable file that is linked with a python library and executes a script via PyRun_SimpleString or similar functions. Is there a static library of python available,...
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....
1
by: Will Ware | last post by:
I am trying to freeze a static executable. I built a static Python executable this way: ./configure --disable-shared --prefix=/usr/local make make install Even that didn't give me a really...
9
by: Chris Pearl | last post by:
Are there Python tools to help webmasters manage static websites? I'm talking about regenerating an entire static website - all the HTML files in their appropriate directories and...
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.