blob: 6f0d5be2ea6a5d253ba9510b96e311a7a29367d7 [file] [log] [blame]
Anthony Baxter09d7fc62002-04-08 06:05:511This is Python version 2.1.3
Guido van Rossumb37d2702001-07-18 19:40:572============================
Guido van Rossum91447632000-04-11 17:11:093
Guido van Rossum9e83cae2002-01-15 22:09:554Copyright (c) 2001-2002 Python Software Foundation.
Guido van Rossum67345eb2001-01-18 14:51:125All rights reserved.
6
Guido van Rossumc07d5fa2000-09-01 22:50:027Copyright (c) 2000 BeOpen.com.
8All rights reserved.
9
Guido van Rossum23f7aed2001-04-12 20:53:3110Copyright (c) 1995-2001 Corporation for National Research Initiatives.
Guido van Rossumc07d5fa2000-09-01 22:50:0211All rights reserved.
12
Guido van Rossum6ebd2992000-09-03 04:47:4713Copyright (c) 1991-1995 Stichting Mathematisch Centrum.
Guido van Rossumc07d5fa2000-09-01 22:50:0214All rights reserved.
15
Guido van Rossum4f40c2d2000-09-05 16:46:2216
Guido van Rossumc07d5fa2000-09-01 22:50:0217License information
18-------------------
19
Guido van Rossum4f40c2d2000-09-05 16:46:2220See the file "LICENSE" for information on the history of this
21software, terms & conditions for usage, and a DISCLAIMER OF ALL
22WARRANTIES.
Guido van Rossumc07d5fa2000-09-01 22:50:0223
Guido van Rossum4f40c2d2000-09-05 16:46:2224This Python distribution contains no GNU General Public Licensed
25(GPLed) code so it may be used in proprietary projects just like prior
26Python distributions. There are interfaces to some GNU code but these
27are entirely optional.
28
29All trademarks referenced herein are property of their respective
30holders.
Guido van Rossum79808261997-12-11 18:01:4731
32
Guido van Rossum8d7d4ed1996-07-30 21:41:0733What's new in this release?
34---------------------------
Guido van Rossum3ff96dd1996-07-30 18:05:0435
Guido van Rossum67345eb2001-01-18 14:51:1236See the file "Misc/NEWS".
Guido van Rossum64773801997-11-26 17:07:0237
38If you don't read instructions
39------------------------------
40
41Congratulations on getting this far. :-)
42
43To start building right away (on UNIX): type "./configure" in the
44current directory and when it finishes, type "make". The section
Guido van Rossum4f40c2d2000-09-05 16:46:2245`Build Instructions' below is still recommended reading, especially
46the part on customizing Modules/Setup.
Guido van Rossum3ff96dd1996-07-30 18:05:0447
48
Guido van Rossum91cb9d21995-04-10 11:47:3849What is Python anyway?
50----------------------
51
Guido van Rossum4f40c2d2000-09-05 16:46:2252Python is an interpreted object-oriented programming language suitable
53(amongst other uses) for distributed application development,
54scripting, numeric computing and system testing. Python is often
55compared to Tcl, Perl, Java, JavaScript, Visual Basic or Scheme. To
56find out more about what Python can do for you, point your browser to
Guido van Rossum67345eb2001-01-18 14:51:1257http://www.python.org/.
Guido van Rossum91cb9d21995-04-10 11:47:3858
59
Guido van Rossumf501b4e1996-10-25 14:32:4860How do I learn Python?
61----------------------
62
Fred Drake0e6444c1999-05-17 19:35:0163The official tutorial is still a good place to start; see
Guido van Rossumd0a42e22000-03-31 20:16:4564http://www.python.org/doc/ for online and downloadable versions, as
65well as a list of other introductions, and reference documentation.
Guido van Rossumf501b4e1996-10-25 14:32:4866
Guido van Rossumd0a42e22000-03-31 20:16:4567There's a quickly growing set of books on Python. See
68http://www.python.org/psa/bookstore/ for a list.
Guido van Rossum8d90f9d1997-05-22 20:13:2569
Guido van Rossumf501b4e1996-10-25 14:32:4870
Guido van Rossumc07d5fa2000-09-01 22:50:0271Documentation
72-------------
Guido van Rossum91cb9d21995-04-10 11:47:3873
Guido van Rossumc07d5fa2000-09-01 22:50:0274All documentation is provided online in a variety of formats. In
75order of importance for new users: Tutorial, Library Reference,
Guido van Rossum4f40c2d2000-09-05 16:46:2276Language Reference, Extending & Embedding, and the Python/C API. The
77Library Reference is especially of immense value since much of
78Python's power is described there, including the built-in data types
79and functions!
Guido van Rossum91cb9d21995-04-10 11:47:3880
Guido van Rossum4f40c2d2000-09-05 16:46:2281All documentation is also available online at the Python web site
Guido van Rossumc07d5fa2000-09-01 22:50:0282(http://www.python.org/doc/, see below). It is available online for
Guido van Rossum4f40c2d2000-09-05 16:46:2283occasional reference, or can be downloaded in many formats for faster
Fred Drake6caae142000-10-25 17:51:0284access. The documentation is available in HTML, PostScript, PDF, and
85LaTeX formats; the LaTeX version is primarily for documentation
86authors, translators, and people with special formatting requirements.
Guido van Rossumc07d5fa2000-09-01 22:50:0287
88
Guido van Rossum4f40c2d2000-09-05 16:46:2289Web sites
90---------
Guido van Rossumc07d5fa2000-09-01 22:50:0291
Guido van Rossum4f40c2d2000-09-05 16:46:2292New Python releases and related technologies are published at
Guido van Rossum67345eb2001-01-18 14:51:1293http://www.python.org/. Come visit us!
Guido van Rossumc07d5fa2000-09-01 22:50:0294
Guido van Rossum67345eb2001-01-18 14:51:1295There's also a Python community web site at http://starship.python.net/.
Guido van Rossumc07d5fa2000-09-01 22:50:0296
Guido van Rossum4f40c2d2000-09-05 16:46:2297
98Newsgroups and Mailing Lists
99----------------------------
Guido van Rossumc07d5fa2000-09-01 22:50:02100
101Read comp.lang.python, a high-volume discussion newsgroup about
102Python, or comp.lang.python.announce, a low-volume moderated newsgroup
103for Python-related announcements. These are also accessible as
Guido van Rossum4f40c2d2000-09-05 16:46:22104mailing lists: see http://www.python.org/psa/MailingLists.html for an
105overview of the many Python-related mailing lists.
Guido van Rossumc07d5fa2000-09-01 22:50:02106
Guido van Rossum4f40c2d2000-09-05 16:46:22107Archives are accessible via Deja.com Usenet News: see
108http://www.deja.com/usenet. The mailing lists are also archived, see
109http://www.python.org/psa/MailingLists.html for details.
Guido van Rossumc07d5fa2000-09-01 22:50:02110
111
112Bug reports
113-----------
114
Guido van Rossum4f40c2d2000-09-05 16:46:22115To report or search for bugs, please use the Python Bug
116Tracker at http://sourceforge.net/bugs/?group_id=5470.
Guido van Rossumc07d5fa2000-09-01 22:50:02117
118
119Patches and contributions
120-------------------------
121
Fred Drake6caae142000-10-25 17:51:02122To submit a patch or other contribution, please use the Python Patch
123Manager at http://sourceforge.net/patch/?group_id=5470. Guidelines
124for patch submission may be found at http://www.python.org/patches/.
Guido van Rossumc07d5fa2000-09-01 22:50:02125
126If you have a proposal to change Python, it's best to submit a Python
127Enhancement Proposal (PEP) first. All current PEPs, as well as
Guido van Rossum4f40c2d2000-09-05 16:46:22128guidelines for submitting a new PEP, are list at
Guido van Rossumc07d5fa2000-09-01 22:50:02129http://python.sourceforge.net/peps/.
130
131
132Questions
133---------
134
135For help, if you can't find it in the manuals or on the web site, it's
136best to post to the comp.lang.python or the Python mailing list (see
137above). If you specifically don't want to involve the newsgroup or
Guido van Rossum67345eb2001-01-18 14:51:12138mailing list, send questions to help@python.org (a group of volunteers
139who answer questions as they can). The newsgroup is the most
140efficient way to ask public questions.
Guido van Rossum627b2d71993-12-24 10:39:16141
Guido van Rossum901454e2000-06-29 22:28:44142
Guido van Rossum433c8ad1994-08-01 12:07:07143Build instructions
Guido van Rossum91cb9d21995-04-10 11:47:38144==================
Guido van Rossum627b2d71993-12-24 10:39:16145
Guido van Rossum4f40c2d2000-09-05 16:46:22146Before you can build Python, you must first configure it. Fortunately,
147the configuration and build process has been streamlined for most Unix
148installations, so all you have to do is type a few commands,
149optionally edit one file, and sit back. There are some platforms
150where things are not quite as smooth; see the platform specific notes
151below. If you want to build for multiple platforms sharing the same
152source tree, see the section on VPATH below.
Guido van Rossum627b2d71993-12-24 10:39:16153
Neil Schemenauer3f52da52001-01-24 17:49:59154Start by running the script "./configure", which determines your system
155configuration and creates the Makefile. (It takes a minute or two --
156please be patient!) You may want to pass options to the configure
157script or edit the Modules/Setup file after running configure -- see the
158section below on configuration options and variables. When it's done,
159you are ready to run make.
Guido van Rossum6d9cc801996-08-01 17:31:22160
Neil Schemenauer3f52da52001-01-24 17:49:59161To build Python, you normally type "make" in the toplevel directory. If
162you have changed the configuration or have modified Modules/Setup, the
163Makefile may have to be rebuilt. In this case you may have to run make
164again to correctly build your desired target. The interpreter
165executable is built in the top level directory.
Guido van Rossum6d9cc801996-08-01 17:31:22166
Guido van Rossum4f40c2d2000-09-05 16:46:22167Once you have built a Python interpreter, see the subsections below on
Guido van Rossum6d9cc801996-08-01 17:31:22168testing, configuring additional modules, and installation. If you run
Fred Drake80078492000-10-26 17:13:19169into trouble, see the next section. Editing the Modules/Setup file
170after running make is supported; just run "make" again after making
171the desired changes.
Guido van Rossum627b2d71993-12-24 10:39:16172
Guido van Rossum0a516c91994-09-12 10:58:40173
Guido van Rossum91cb9d21995-04-10 11:47:38174Troubleshooting
175---------------
Guido van Rossum627b2d71993-12-24 10:39:16176
Guido van Rossum6d9cc801996-08-01 17:31:22177See also the platform specific notes in the next section.
178
Guido van Rossum49523691997-08-15 18:30:14179If you run into other trouble, see section 3 of the FAQ
Guido van Rossum901454e2000-06-29 22:28:44180(http://www.python.org/cgi-bin/faqw.py or
Guido van Rossum49523691997-08-15 18:30:14181http://www.python.org/doc/FAQ.html) for hints on what can go wrong,
182and how to fix it.
Guido van Rossum91cb9d21995-04-10 11:47:38183
Guido van Rossum6d9cc801996-08-01 17:31:22184If you rerun the configure script with different options, remove all
185object files by running "make clean" before rebuilding. Believe it or
186not, "make clean" sometimes helps to clean up other inexplicable
187problems as well. Try it before sending in a bug report!
188
Guido van Rossumd0fe8451996-08-26 03:02:37189If the configure script fails or doesn't seem to find things that
Guido van Rossumc0be2f51997-10-08 05:05:28190should be there, inspect the config.log file. When you fix a
191configure problem, be sure to remove config.cache!
192
193If you get a warning for every file about the -Olimit option being no
194longer supported, you can ignore it. There's no foolproof way to know
Guido van Rossum4f40c2d2000-09-05 16:46:22195whether this option is needed; all we can do is test whether it is
Guido van Rossumc0be2f51997-10-08 05:05:28196accepted without error. On some systems, e.g. older SGI compilers, it
197is essential for performance (specifically when compiling ceval.c,
198which has more basic blocks than the default limit of 1000). If the
199warning bothers you, edit the Makefile to remove "-Olimit 1500" from
200the OPT variable.
Guido van Rossumd0fe8451996-08-26 03:02:37201
Guido van Rossum7ac11532000-08-29 21:36:40202If you get failures in test_long, or sys.maxint gets set to -1, you
203are probably experiencing compiler bugs, usually related to
204optimization. This is a common problem with some versions of gcc and
205egcs, and some vendor-supplied compilers, which can sometimes be
206worked around by turning off optimization. Consider switching to
207stable versions (gcc 2.7.2.3, egcs 1.1.2, or contact your vendor.)
208
209From Python 2.0 onward, all Python C code is ANSI C. Compiling using
210old K&R-C-only compilers is no longer possible. ANSI C compilers are
211available for all modern systems, either in the form of updated
212compilers from the vendor, or one of the free compilers (gcc, egcs).
Guido van Rossum91cb9d21995-04-10 11:47:38213
214Platform specific notes
215-----------------------
216
Guido van Rossum0447a321995-10-08 01:22:33217(Some of these may no longer apply. If you find you can build Python
Guido van Rossum67345eb2001-01-18 14:51:12218on these platforms without the special directions mentioned here,
219submit a documentation bug report to SourceForge (see Bug Reports
220above) so we can remove them!)
Guido van Rossum91cb9d21995-04-10 11:47:38221
Guido van Rossumc0be2f51997-10-08 05:05:2822264-bit platforms: The modules audioop, imageop and rgbimg don't work.
223 Don't try to enable them in the Modules/Setup file. They
224 contain code that is quite wordsize sensitive. (If you have a
Guido van Rossum4f40c2d2000-09-05 16:46:22225 fix, let us know!)
Guido van Rossumc0be2f51997-10-08 05:05:28226
Thomas Woutersd9256202001-07-13 15:10:55227Solaris: When using Sun's C compiler, it's necessary to compile in
228 strict ANSI mode with multithreading enabled. This can be done
229 by setting the 'CC' environment variable to 'cc -Xc -mt'
230 before running the configure script. ANSI-compatibility mode
231 ('-Xa') has been seen to compile the code without problems,
232 but generate faulty code.
Guido van Rossum4462e931997-01-22 21:00:32233
Guido van Rossum7ac11532000-08-29 21:36:40234Linux: A problem with threads and fork() was tracked down to a bug in
235 the pthreads code in glibc version 2.0.5; glibc version 2.0.7
236 solves the problem. This causes the popen2 test to fail;
237 problem and solution reported by Pablo Bleyer.
Guido van Rossum4462e931997-01-22 21:00:32238
Guido van Rossum7ac11532000-08-29 21:36:40239 Under Linux systems using GNU libc 2 (aka libc6), the crypt
240 module now needs the -lcrypt option. Uncomment this flag in
241 Modules/Setup, or comment out the crypt module in the same
242 file. Most modern Linux systems use glibc2.
Fred Drake61280911997-12-08 14:10:40243
Guido van Rossum59230501999-06-21 20:51:46244FreeBSD 3.x and probably platforms with NCurses that use libmytinfo or
245 similar: When using cursesmodule, the linking is not done in
246 the correct order with the defaults. Remove "-ltermcap" from
247 the readline entry in Setup, and use as curses entry: "curses
248 cursesmodule.c -lmytinfo -lncurses -ltermcap" - "mytinfo" (so
249 called on FreeBSD) should be the name of the auxiliary library
250 required on your platform. Normally, it would be linked
251 automatically, but not necessarily in the correct order.
252
Guido van Rossum7ac11532000-08-29 21:36:40253BSDI: BSDI versions before 4.1 have known problems with threads,
254 which can cause strange errors in a number of modules (for
255 instance, the 'test_signal' test script will hang forever.)
256 Turning off threads (with --with-threads=no) or upgrading to
257 BSDI 4.1 solves this problem.
258
259DEC Unix: Run configure with --with-dec-threads, or with
260 --with-threads=no if no threads are desired (threads are on by
261 default). When using GCC, it is possible to get an internal
262 compiler error if optimization is used. This was reported for
263 GCC 2.7.2.3 on selectmodule.c. Manually compile the affected
264 file without optimization to solve the problem.
Guido van Rossum8eca2c21996-02-14 18:37:46265
Guido van Rossume1cdb161999-04-10 16:04:07266DEC Ultrix: compile with GCC to avoid bugs in the native compiler,
267 and pass SHELL=/bin/sh5 to Make when installing.
268
Guido van Rossumd0fe8451996-08-26 03:02:37269AIX: A complete overhaul of the shared library support is now in
Guido van Rossum16e809e2001-04-16 02:07:08270 place. See Misc/AIX-NOTES for some notes on how it's done.
Guido van Rossum9ac9a261998-02-16 22:19:21271 (The optimizer bug reported at this place in previous releases
Thomas Wouters8ee06142001-02-15 11:45:29272 has been worked around by a minimal code change.) If you get
273 errors about ptread_* functions, during compile or during
274 testing, try setting CC to a thread-safe (reentrant) compiler,
275 like "cc_r". For full C++ module support, set CC="xlC_r" (or
276 CC="xlC" without thread support).
Guido van Rossum91cb9d21995-04-10 11:47:38277
Guido van Rossum59a88f41999-04-12 18:16:09278HP-UX: Please read the file Misc/HPUX-NOTES for shared libraries.
279 When using threading, you may have to add -D_REENTRANT to the
Guido van Rossum4f40c2d2000-09-05 16:46:22280 OPT variable in the top-level Makefile; reported by Pat Knight,
Guido van Rossum59a88f41999-04-12 18:16:09281 this seems to make a difference (at least for HP-UX 10.20)
282 even though config.h defines it.
Guido van Rossum2094e041998-05-14 15:47:35283
Guido van Rossum6d9cc801996-08-01 17:31:22284Minix: When using ack, use "CC=cc AR=aal RANLIB=: ./configure"!
Guido van Rossum91cb9d21995-04-10 11:47:38285
Guido van Rossum4f40c2d2000-09-05 16:46:22286SCO: The following apply to SCO 3 only; Python builds out of the box
287 on SCO 5 (or so we've heard).
Guido van Rossuma16e2751998-04-13 20:14:05288
289 1) Everything works much better if you add -U__STDC__ to the
Guido van Rossum91cb9d21995-04-10 11:47:38290 defs. This is because all the SCO header files are broken.
Guido van Rossum64773801997-11-26 17:07:02291 Anything that isn't mentioned in the C standard is
Guido van Rossum91cb9d21995-04-10 11:47:38292 conditionally excluded when __STDC__ is defined.
293
294 2) Due to the U.S. export restrictions, SCO broke the crypt
295 stuff out into a separate library, libcrypt_i.a so the LIBS
296 needed be set to:
297
298 LIBS=' -lsocket -lcrypt_i'
299
Guido van Rossum7ac11532000-08-29 21:36:40300SunOS 4.x: When using the SunPro C compiler, you may want to use the
Guido van Rossum64773801997-11-26 17:07:02301 '-Xa' option instead of '-Xc', to enable some needed non-ANSI
302 Sunisms.
Guido van Rossum91cb9d21995-04-10 11:47:38303
Guido van Rossumcc55c2d1996-10-21 15:14:27304NeXT: To build fat binaries, use the --with-next-archs switch
305 described below.
Guido van Rossum6d9cc801996-08-01 17:31:22306
Guido van Rossumb7f454d1997-12-02 19:44:31307QNX: Chris Herborth (chrish@qnx.com) writes:
308 configure works best if you use GNU bash; a port is available on
309 ftp.qnx.com in /usr/free. I used the following process to build,
Guido van Rossumd4493421998-12-22 16:37:01310 test and install Python 1.5.x under QNX:
Guido van Rossumb7f454d1997-12-02 19:44:31311
Guido van Rossumec95c7b1998-08-04 17:59:56312 1) CONFIG_SHELL=/usr/local/bin/bash CC=cc RANLIB=: \
313 ./configure --verbose --without-gcc --with-libm=""
Guido van Rossumb7f454d1997-12-02 19:44:31314
Fred Drake80078492000-10-26 17:13:19315 2) edit Modules/Setup to activate everything that makes sense for
316 your system... tested here at QNX with the following modules:
Guido van Rossumb7f454d1997-12-02 19:44:31317
Guido van Rossum6fa49e21998-08-11 17:31:39318 array, audioop, binascii, cPickle, cStringIO, cmath,
319 crypt, curses, errno, fcntl, gdbm, grp, imageop,
320 _locale, math, md5, new, operator, parser, pcre,
321 posix, pwd, readline, regex, reop, rgbimg, rotor,
322 select, signal, socket, soundex, strop, struct,
Guido van Rossumd4493421998-12-22 16:37:01323 syslog, termios, time, timing, zlib, audioop, imageop, rgbimg
Guido van Rossumb7f454d1997-12-02 19:44:31324
Guido van Rossum16e809e2001-04-16 02:07:08325 3) make SHELL=/usr/local/bin/bash
326
Guido van Rossumec95c7b1998-08-04 17:59:56327 or, if you feel the need for speed:
Guido van Rossum16e809e2001-04-16 02:07:08328
Guido van Rossumec95c7b1998-08-04 17:59:56329 make SHELL=/usr/local/bin/bash OPT="-5 -Oil+nrt"
Guido van Rossumb7f454d1997-12-02 19:44:31330
Guido van Rossumec95c7b1998-08-04 17:59:56331 4) make SHELL=/usr/local/bin/bash test
332
Guido van Rossum6fa49e21998-08-11 17:31:39333 Using GNU readline 2.2 seems to behave strangely, but I
334 think that's a problem with my readline 2.2 port. :-\
Guido van Rossumec95c7b1998-08-04 17:59:56335
336 5) make SHELL=/usr/local/bin/bash install
Guido van Rossumb7f454d1997-12-02 19:44:31337
Guido van Rossum6fa49e21998-08-11 17:31:39338 If you get SIGSEGVs while running Python (I haven't yet, but
339 I've only run small programs and the test cases), you're
340 probably running out of stack; the default 32k could be a
341 little tight. To increase the stack size, edit the Makefile
Neil Schemenauer73f8ab22001-01-26 22:18:55342 to read: LDFLAGS = -N 48k
Guido van Rossum40d63581997-08-14 19:45:30343
Guido van Rossumec95c7b1998-08-04 17:59:56344BeOS: Chris Herborth (chrish@qnx.com) writes:
345 See BeOS/README for notes about compiling/installing Python on
Guido van Rossum6fa49e21998-08-11 17:31:39346 BeOS R3 or later. Note that only the PowerPC platform is
Guido van Rossumd4493421998-12-22 16:37:01347 supported for R3; both PowerPC and x86 are supported for R4.
Guido van Rossumec95c7b1998-08-04 17:59:56348
Guido van Rossum1bf0bf41997-08-20 23:50:51349Cray T3E: Konrad Hinsen writes:
Guido van Rossum6fa49e21998-08-11 17:31:39350 1) Don't use gcc. It compiles Python/graminit.c into something
351 that the Cray assembler doesn't like. Cray's cc seems to work
352 fine.
Guido van Rossum7ac11532000-08-29 21:36:40353 2) Comment out modules md5 (won't compile) and audioop (will
Guido van Rossum6fa49e21998-08-11 17:31:39354 crash the interpreter during the test suite).
355 If you run the test suite, two tests will fail (rotate and
356 binascii), but these are not the modules you'd expect to need
357 on a Cray.
Guido van Rossum1bf0bf41997-08-20 23:50:51358
Guido van Rossum0078aaf1997-08-21 03:05:11359SGI: SGI's standard "make" utility (/bin/make or /usr/bin/make)
360 does not check whether a command actually changed the file it
361 is supposed to build. This means that whenever you say "make"
362 it will redo the link step. The remedy is to use SGI's much
Guido van Rossum7be8ca02001-04-14 13:09:53363 smarter "smake" utility (/usr/sbin/smake), or GNU make. If
Guido van Rossumc0be2f51997-10-08 05:05:28364 you set the first line of the Makefile to #!/usr/sbin/smake
365 smake will be invoked by make (likewise for GNU make).
Guido van Rossum0078aaf1997-08-21 03:05:11366
Guido van Rossum7be8ca02001-04-14 13:09:53367 WARNING: There are bugs in the optimizer of some versions of
368 SGI's compilers that can cause bus errors or other strange
369 behavior, especially on numerical operations. To avoid this,
370 try building with "make OPT=".
Fred Drake0b5fb2b2000-09-29 17:45:05371
Guido van Rossum64773801997-11-26 17:07:02372OS/2: If you are running Warp3 or Warp4 and have IBM's VisualAge C/C++
373 compiler installed, just change into the pc\os2vacpp directory
374 and type NMAKE. Threading and sockets are supported by default
375 in the resulting binaries of PYTHON15.DLL and PYTHON.EXE.
376
Fred Drake36ed5602000-10-06 01:58:48377Monterey (64-bit AIX): The current Monterey C compiler (Visual Age)
378 uses the OBJECT_MODE={32|64} environment variable to set the
379 compilation mode to either 32-bit or 64-bit (32-bit mode is
380 the default). Presumably you want 64-bit compilation mode for
381 this 64-bit OS. As a result you must first set OBJECT_MODE=64
382 in your environment before configuring (./configure) or
383 building (make) Python on Monterey.
384
385Reliant UNIX: The thread support does not compile on Reliant UNIX, and
386 there is a (minor) problem in the configure script for that
387 platform as well. This should be resolved in time for a
388 future release.
Trent Mick635f6fb2000-08-23 21:33:05389
Fred Drake2db09cc2001-05-09 18:13:29390Mac OS X 10.0: Run configure with "OPT='-no-cpp-precomp' ./configure
391 --with-suffix=.exe --with-dyld". This generates executable
392 file: 'python.exe' (it cannot be named 'python' on an HFS or
393 HFS+ disk as the file name clashes with directory 'Python').
394 The '-no-cpp-precomp' option prevents a large number of
395 compilation warnings. One of the regular expression tests
396 fails with a SEGV due to the small stack size used by default
397 (how to change this?), and the test_largefile test is only
398 expected to work on a Unix UFS filesystem (how to check for
399 this on Mac OS X?).
Fred Drakedabed752001-02-01 19:41:13400
Anthony Baxter86b2c9e2002-01-10 12:29:33401Mac OS X 10.1: Run configure with
402 "./configure --with-suffix=.x --with-dyld".
403 This generates executable file: 'python.x'
404 (it cannot be named 'python' on an HFS or HFS+
405 disk as the file name clashes with directory 'Python').
406
407 The makefile is set up to correctly handle two-
408 level namespaces for Mac OS X v10.1 and 10.0.x
409 systems. However, running the prebinding tool on
410 Mac OS X 10.0.x again will cause the tool to break
411 as it cannot handle two level namespaces.
412
413 The default Mac OS X has a default stacksize
414 of 512K which causes the regular expression
415 tests (RE and SRE) to SEGV. To temporarily
416 increase the stacksize, type 'limit stacksize 2M' in
417 the terminal window before running 'make test'.
418
419 The test_largefile test will work on HFS+ and
420 UFS filesystem, providing you have enough space
421 and time.
422
423 After sudo 'make installation', do the following
424 commands:
425 cd /usr/local/bin/
426 sudo mv python.x python
427 sudo mv python2.1.x python2.1
428
Tim Peters42fc7cc2001-04-04 18:35:19429Cygwin: Cygwin Python builds OOTB when configured as follows:
430
431 configure --with-threads=no
Guido van Rossum16e809e2001-04-16 02:07:08432
Tim Peters42fc7cc2001-04-04 18:35:19433 assuming Cygwin 1.1.8-2 and gcc 2.95.3-1 or later. At the time
434 of this writing, Cygwin pthread support is being significantly
435 enhanced. Hopefully, there will be a Cygwin Python with thread
436 support soon.
437
438 Cygwin Python supports the building of shared extensions via the
439 traditional Misc/Makefile.pre.in and the newer distutils methods.
Guido van Rossum16e809e2001-04-16 02:07:08440
Tim Peters42fc7cc2001-04-04 18:35:19441 On NT/2000, the following regression tests fail:
442
443 test_poll (hang)
444 test_strftime
Guido van Rossum16e809e2001-04-16 02:07:08445
Tim Peters42fc7cc2001-04-04 18:35:19446 Due to the test_poll hang on NT/2000, one should run the
447 regression test using the following:
448
449 PYTHONPATH= ./python.exe -tt ./Lib/test/regrtest.py -l -x test_poll
Guido van Rossum16e809e2001-04-16 02:07:08450
Tim Peters42fc7cc2001-04-04 18:35:19451 On 9X/Me, in addition the above NT/2000 failures, it has been
452 reported that the following regression tests also fail:
453
454 test_pwd
455 test_select (hang)
456 test_socket
457
458 Due to the test_poll and test_select hang on 9X/Me, one should
459 run the regression test using the following:
460
461 PYTHONPATH= ./python.exe -tt ./Lib/test/regrtest.py -l -x test_poll -x test_select
462
463 Help trying to track down the root causes for these known problems
464 will be greatly appreciated.
Guido van Rossum16e809e2001-04-16 02:07:08465
Guido van Rossum6d9cc801996-08-01 17:31:22466
Guido van Rossumdc8a3cb1998-05-12 15:29:18467Configuring threads
468-------------------
469
Guido van Rossum7ac11532000-08-29 21:36:40470As of Python 2.0, threads are enabled by default. If you wish to
471compile without threads, or if your thread support is broken, pass the
472--with-threads=no switch to configure. Unfortunately, on some
473platforms, additional compiler and/or linker options are required for
474threads to work properly. Below is a table of those options,
Guido van Rossum4f40c2d2000-09-05 16:46:22475collected by Bill Janssen. We would love to automate this process
Guido van Rossum7ac11532000-08-29 21:36:40476more, but the information below is not enough to write a patch for the
477configure.in file, so manual intervention is required. If you patch
478the configure.in file and are confident that the patch works, please
Guido van Rossum4f40c2d2000-09-05 16:46:22479send in the patch. (Don't bother patching the configure script itself
Guido van Rossum7ac11532000-08-29 21:36:40480-- it is regenerated each the configure.in file changes.)
Guido van Rossumdc8a3cb1998-05-12 15:29:18481
482Compiler switches for threads
483.............................
484
Martin v. Löwis1c24f9c2001-03-06 12:07:27485The definition of _REENTRANT should be configured automatically, if
486that does not work on your system, or if _REENTRANT is defined
487incorrectly, please report that as a bug.
Guido van Rossumdc8a3cb1998-05-12 15:29:18488
Martin v. Löwis1c24f9c2001-03-06 12:07:27489 OS/Compiler/threads Switches for use with threads
490 (POSIX is draft 10, DCE is draft 4) compile & link
491
492 SunOS 5.{1-5}/{gcc,SunPro cc}/solaris -mt
493 SunOS 5.5/{gcc,SunPro cc}/POSIX (nothing)
Guido van Rossum16e809e2001-04-16 02:07:08494 DEC OSF/1 3.x/cc/DCE -threads
Guido van Rossumdc8a3cb1998-05-12 15:29:18495 (butenhof@zko.dec.com)
Guido van Rossum16e809e2001-04-16 02:07:08496 Digital UNIX 4.x/cc/DCE -threads
Guido van Rossumdc8a3cb1998-05-12 15:29:18497 (butenhof@zko.dec.com)
Guido van Rossum16e809e2001-04-16 02:07:08498 Digital UNIX 4.x/cc/POSIX -pthread
Guido van Rossumdc8a3cb1998-05-12 15:29:18499 (butenhof@zko.dec.com)
Guido van Rossum16e809e2001-04-16 02:07:08500 AIX 4.1.4/cc_r/d7 (nothing)
Guido van Rossumdc8a3cb1998-05-12 15:29:18501 (buhrt@iquest.net)
Guido van Rossum16e809e2001-04-16 02:07:08502 AIX 4.1.4/cc_r4/DCE (nothing)
Guido van Rossumdc8a3cb1998-05-12 15:29:18503 (buhrt@iquest.net)
Guido van Rossum16e809e2001-04-16 02:07:08504 IRIX 6.2/cc/POSIX (nothing)
Guido van Rossumdc8a3cb1998-05-12 15:29:18505 (robertl@cwi.nl)
506
507
508Linker (ld) libraries and flags for threads
509...........................................
510
511 OS/threads Libraries/switches for use with threads
512
513 SunOS 5.{1-5}/solaris -lthread
514 SunOS 5.5/POSIX -lpthread
Guido van Rossum16e809e2001-04-16 02:07:08515 DEC OSF/1 3.x/DCE -lpthreads -lmach -lc_r -lc
Guido van Rossumdc8a3cb1998-05-12 15:29:18516 (butenhof@zko.dec.com)
517 Digital UNIX 4.x/DCE -lpthreads -lpthread -lmach -lexc -lc
518 (butenhof@zko.dec.com)
Guido van Rossum16e809e2001-04-16 02:07:08519 Digital UNIX 4.x/POSIX -lpthread -lmach -lexc -lc
Guido van Rossumdc8a3cb1998-05-12 15:29:18520 (butenhof@zko.dec.com)
Guido van Rossum16e809e2001-04-16 02:07:08521 AIX 4.1.4/{draft7,DCE} (nothing)
Guido van Rossumdc8a3cb1998-05-12 15:29:18522 (buhrt@iquest.net)
Guido van Rossum16e809e2001-04-16 02:07:08523 IRIX 6.2/POSIX -lpthread
Guido van Rossumdc8a3cb1998-05-12 15:29:18524 (jph@emilia.engr.sgi.com)
525
526
Guido van Rossum6d9cc801996-08-01 17:31:22527Configuring additional built-in modules
Guido van Rossum91cb9d21995-04-10 11:47:38528---------------------------------------
Guido van Rossum19e0c261995-01-17 16:36:34529
Andrew M. Kuchlingebe30452001-02-27 03:24:24530Starting with Python 2.1, the setup.py script at the top of the source
531distribution attempts to detect which modules can be built and
532automatically compiles them. Autodetection doesn't always work, so
533you can customize the configuration by editing the Modules/Setup file.
534This file is initially copied from Setup.dist by the configure script;
535if it does not exist yet, create it by copying Modules/Setup.dist
536yourself (configure will never overwrite it). Never edit Setup.dist
537-- always edit Setup or Setup.local (see below). Read the comments in
538the file for information on what kind of edits are allowed. When you
539have edited Setup in the Modules directory, the interpreter will
540automatically be rebuilt the next time you run make in the toplevel
541directory. (When working inside the Modules directory, use "make
542Makefile; make".)
Guido van Rossum627b2d71993-12-24 10:39:16543
Andrew M. Kuchlingebe30452001-02-27 03:24:24544Many useful modules can be built on any Unix system, but some optional
545modules can't be reliably autodetected. Often the quickest way to
546determine whether a particular module works or not is to see if it
547will build: enable it in Setup, then if you get compilation or link
Fred Drake6caae142000-10-25 17:51:02548errors, disable it -- you're either missing support or need to adjust
549the compilation and linking parameters for that module.
Guido van Rossum6d9cc801996-08-01 17:31:22550
551On SGI IRIX, there are modules that interface to many SGI specific
Andrew M. Kuchlingebe30452001-02-27 03:24:24552system libraries, e.g. the GL library and the audio hardware. These
553modules will not be built by the setup.py script.
Guido van Rossum91cb9d21995-04-10 11:47:38554
Guido van Rossum4462e931997-01-22 21:00:32555In addition to the file Setup, you can also edit the file Setup.local.
556(the makesetup script processes both). You may find it more
557convenient to edit Setup.local and leave Setup alone. Then, when
558installing a new Python version, you can copy your old Setup.local
559file.
560
Guido van Rossum91cb9d21995-04-10 11:47:38561
562Setting the optimization/debugging options
563------------------------------------------
564
Guido van Rossum6d9cc801996-08-01 17:31:22565If you want or need to change the optimization/debugging options for
566the C compiler, assign to the OPT variable on the toplevel make
567command; e.g. "make OPT=-g" will build a debugging version of Python
568on most platforms. The default is OPT=-O; a value for OPT in the
569environment when the configure script is run overrides this default
570(likewise for CC; and the initial value for LIBS is used as the base
571set of libraries to link with).
Guido van Rossum91cb9d21995-04-10 11:47:38572
Fred Drake6caae142000-10-25 17:51:02573When compiling with GCC, the default value of OPT will also include
574the -Wall and -Wstrict-prototypes options.
575
576Additional debugging code to help debug memory management problems can
577be enabled by using the --with-pydebug option to the configure script.
578
Guido van Rossum91cb9d21995-04-10 11:47:38579
580Testing
581-------
Guido van Rossum433c8ad1994-08-01 12:07:07582
Guido van Rossum4f40c2d2000-09-05 16:46:22583To test the interpreter, type "make test" in the top-level directory.
Guido van Rossum6ae5d3d1997-05-14 21:39:05584This runs the test set twice (once with no compiled files, once with
585the compiled files left by the previous test run). The test set
586produces some output. You can generally ignore the messages about
Guido van Rossum4f40c2d2000-09-05 16:46:22587skipped tests due to optional features which can't be imported. (If
588you want to test those modules, edit Modules/Setup to configure them.)
589If a message is printed about a failed test or a traceback or core
590dump is produced, something is wrong. On some Linux systems (those
Guido van Rossum24df6841997-12-30 04:32:30591that are not yet using glibc 6), test_strftime fails due to a
Guido van Rossum4f40c2d2000-09-05 16:46:22592non-standard implementation of strftime() in the C library. Please
593ignore this, or upgrade to glibc version 6.
Guido van Rossum433c8ad1994-08-01 12:07:07594
Guido van Rossum91cb9d21995-04-10 11:47:38595IMPORTANT: If the tests fail and you decide to mail a bug report,
596*don't* include the output of "make test". It is useless. Run the
Guido van Rossum4f40c2d2000-09-05 16:46:22597failing test manually, as follows:
Guido van Rossum91cb9d21995-04-10 11:47:38598
Guido van Rossum6ae5d3d1997-05-14 21:39:05599 python ../Lib/test/test_whatever.py
Guido van Rossum91cb9d21995-04-10 11:47:38600
601(substituting the top of the source tree for .. if you built in a
Guido van Rossum6ae5d3d1997-05-14 21:39:05602different directory). This runs the test in verbose mode.
Guido van Rossum91cb9d21995-04-10 11:47:38603
604
605Installing
606----------
607
Guido van Rossum6d9cc801996-08-01 17:31:22608To install the Python binary, library modules, shared library modules
609(see below), include files, configuration files, and the manual page,
Guido van Rossum64773801997-11-26 17:07:02610just type
611
612 make install
613
Guido van Rossum4f40c2d2000-09-05 16:46:22614This will install all platform-independent files in subdirectories of
615the directory given with the --prefix option to configure or to the
616`prefix' Make variable (default /usr/local). All binary and other
617platform-specific files will be installed in subdirectories if the
618directory given by --exec-prefix or the `exec_prefix' Make variable
619(defaults to the --prefix directory) is given.
Guido van Rossum64773801997-11-26 17:07:02620
621All subdirectories created will have Python's version number in their
622name, e.g. the library modules are installed in
Guido van Rossum67345eb2001-01-18 14:51:12623"/usr/local/lib/python<version>/" by default, where <version> is the
624<major>.<minor> release number (e.g. "2.1"). The Python binary is
625installed as "python<version>" and a hard link named "python" is
626created. The only file not installed with a version number in its
627name is the manual page, installed as "/usr/local/man/man1/python.1"
628by default.
Guido van Rossum433c8ad1994-08-01 12:07:07629
Neil Schemenauer0e91dc72001-02-16 04:18:08630If you have a previous installation of Python that you don't
Guido van Rossum64773801997-11-26 17:07:02631want to replace yet, use
632
633 make altinstall
634
635This installs the same set of files as "make install" except it
Guido van Rossum67345eb2001-01-18 14:51:12636doesn't create the hard link to "python<version>" named "python" and
637it doesn't install the manual page at all.
Guido van Rossum6d9cc801996-08-01 17:31:22638
Neil Schemenauer0e91dc72001-02-16 04:18:08639Alpha/beta revision levels are stripped from the executable and
640library filenames during installation. For example, Python2.1a2 will
641install as python2.1, overwriting the previous python2.1. To avoid
642this, you could set the Makefile VERSION variable manually
643(e.g. VERSION=2.1a2) before running "make install" or "make altinstall".
644
Guido van Rossum6d9cc801996-08-01 17:31:22645The only thing you may have to install manually is the Python mode for
Guido van Rossum4f40c2d2000-09-05 16:46:22646Emacs found in Misc/python-mode.el. (But then again, more recent
647versions of Emacs may already have it.) Follow the instructions that
648came with Emacs for installation of site-specific files.
Guido van Rossum433c8ad1994-08-01 12:07:07649
Guido van Rossum91cb9d21995-04-10 11:47:38650
651Configuration options and variables
652-----------------------------------
Guido van Rossum433c8ad1994-08-01 12:07:07653
Guido van Rossum6d9cc801996-08-01 17:31:22654Some special cases are handled by passing options to the configure
655script.
Guido van Rossum433c8ad1994-08-01 12:07:07656
Guido van Rossum6d9cc801996-08-01 17:31:22657WARNING: if you rerun the configure script with different options, you
658must run "make clean" before rebuilding. Exceptions to this rule:
659after changing --prefix or --exec-prefix, all you need to do is remove
Guido van Rossumb06df271997-08-05 21:50:20660Modules/getpath.o.
Guido van Rossum433c8ad1994-08-01 12:07:07661
Guido van Rossum91cb9d21995-04-10 11:47:38662--with(out)-gcc: The configure script uses gcc (the GNU C compiler) if
663 it finds it. If you don't want this, or if this compiler is
664 installed but broken on your platform, pass the option
665 --without-gcc. You can also pass "CC=cc" (or whatever the
666 name of the proper C compiler is) in the environment, but the
667 advantage of using --without-gcc is that this option is
668 remembered by the config.status script for its --recheck
669 option.
Guido van Rossum76be6ed1995-01-02 18:33:54670
Guido van Rossum91cb9d21995-04-10 11:47:38671--prefix, --exec-prefix: If you want to install the binaries and the
672 Python library somewhere else than in /usr/local/{bin,lib},
673 you can pass the option --prefix=DIRECTORY; the interpreter
674 binary will be installed as DIRECTORY/bin/python and the
675 library files as DIRECTORY/lib/python/*. If you pass
676 --exec-prefix=DIRECTORY (as well) this overrides the
677 installation prefix for architecture-dependent files (like the
678 interpreter binary). Note that --prefix=DIRECTORY also
679 affects the default module search path (sys.path), when
680 Modules/config.c is compiled. Passing make the option
681 prefix=DIRECTORY (and/or exec_prefix=DIRECTORY) overrides the
682 prefix set at configuration time; this may be more convenient
683 than re-running the configure script if you change your mind
Guido van Rossum4f40c2d2000-09-05 16:46:22684 about the install prefix.
Guido van Rossum76be6ed1995-01-02 18:33:54685
Guido van Rossumb06df271997-08-05 21:50:20686--with-readline: This option is no longer supported. To use GNU
687 readline, enable module "readline" in the Modules/Setup file.
Guido van Rossum91cb9d21995-04-10 11:47:38688
Guido van Rossum7ac11532000-08-29 21:36:40689--with-threads: On most Unix systems, you can now use multiple
690 threads, and support for this is enabled by default. To
691 disable this, pass --with-threads=no. If the library required
692 for threads lives in a peculiar place, you can use
693 --with-thread=DIRECTORY. IMPORTANT: run "make clean" after
694 changing (either enabling or disabling) this option, or you
695 will get link errors! Note: for DEC Unix use
Guido van Rossum0e13da91998-02-22 04:36:34696 --with-dec-threads instead.
Guido van Rossum91cb9d21995-04-10 11:47:38697
698--with-sgi-dl: On SGI IRIX 4, dynamic loading of extension modules is
699 supported by the "dl" library by Jack Jansen, which is
Guido van Rossum6d9cc801996-08-01 17:31:22700 ftp'able from ftp://ftp.cwi.nl/pub/dynload/dl-1.6.tar.Z.
Guido van Rossum91cb9d21995-04-10 11:47:38701 This is enabled (after you've ftp'ed and compiled the dl
Guido van Rossum4f40c2d2000-09-05 16:46:22702 library) by passing --with-sgi-dl=DIRECTORY where DIRECTORY
Guido van Rossum91cb9d21995-04-10 11:47:38703 is the absolute pathname of the dl library. (Don't bother on
704 IRIX 5, it already has dynamic linking using SunOS style
705 shared libraries.) Support for this feature is deprecated.
706
Guido van Rossum4f40c2d2000-09-05 16:46:22707--with-dl-dld: Dynamic loading of modules is rumored to be supported
Guido van Rossum91cb9d21995-04-10 11:47:38708 on some other systems: VAX (Ultrix), Sun3 (SunOS 3.4), Sequent
709 Symmetry (Dynix), and Atari ST. This is done using a
710 combination of the GNU dynamic loading package
Guido van Rossum6d9cc801996-08-01 17:31:22711 (ftp://ftp.cwi.nl/pub/dynload/dl-dld-1.1.tar.Z) and an
Guido van Rossum91cb9d21995-04-10 11:47:38712 emulation of the SGI dl library mentioned above (the emulation
713 can be found at
Guido van Rossum6d9cc801996-08-01 17:31:22714 ftp://ftp.cwi.nl/pub/dynload/dld-3.2.3.tar.Z). To
Guido van Rossum16e809e2001-04-16 02:07:08715 enable this, ftp and compile both libraries, then call
Guido van Rossum4f40c2d2000-09-05 16:46:22716 configure, passing it the option
Guido van Rossum91cb9d21995-04-10 11:47:38717 --with-dl-dld=DL_DIRECTORY,DLD_DIRECTORY where DL_DIRECTORY is
718 the absolute pathname of the dl emulation library and
719 DLD_DIRECTORY is the absolute pathname of the GNU dld library.
720 (Don't bother on SunOS 4 or 5, they already have dynamic
721 linking using shared libraries.) Support for this feature is
722 deprecated.
723
724--with-libm, --with-libc: It is possible to specify alternative
725 versions for the Math library (default -lm) and the C library
726 (default the empty string) using the options
Guido van Rossum4f40c2d2000-09-05 16:46:22727 --with-libm=STRING and --with-libc=STRING, respectively. For
728 example, if your system requires that you pass -lc_s to the C
729 compiler to use the shared C library, you can pass
730 --with-libc=-lc_s. These libraries are passed after all other
731 libraries, the C library last.
Guido van Rossum16e809e2001-04-16 02:07:08732
Guido van Rossum3ff96dd1996-07-30 18:05:04733--with-next-archs='arch1 arch2': Under NEXTSTEP, this will build
Guido van Rossum4f40c2d2000-09-05 16:46:22734 all compiled binaries with the architectures listed. This will
735 also correctly set the target architecture-specific resource
Guido van Rossumcc55c2d1996-10-21 15:14:27736 directory. (This option is not supported on other platforms.)
Guido van Rossum76be6ed1995-01-02 18:33:54737
Guido van Rossum4f40c2d2000-09-05 16:46:22738--with-libs='libs': Add 'libs' to the LIBS that the python interpreter
739 is linked against.
Guido van Rossumd02ba451996-07-31 17:36:01740
Martin v. Löwis2df66942000-12-13 14:14:32741--with-cxx=<compiler>: Some C++ compilers require that main() is
742 compiled with the C++ if there is any C++ code in the application.
743 Specifically, g++ on a.out systems may require that to support
744 construction of global objects. With this option, the main() function
745 of Python will be compiled with <compiler>; use that only if you
746 plan to use C++ extension modules, and if your compiler requires
747 compilation of main() as a C++ program.
748
749
Fred Drake6caae142000-10-25 17:51:02750--with-pydebug: Enable additional debugging code to help track down
751 memory management problems. This allows printing a list of all
752 live objects when the interpreter terminates.
753
Guido van Rossum76be6ed1995-01-02 18:33:54754
Guido van Rossum433c8ad1994-08-01 12:07:07755Building for multiple architectures (using the VPATH feature)
756-------------------------------------------------------------
757
758If your file system is shared between multiple architectures, it
759usually is not necessary to make copies of the sources for each
760architecture you want to support. If the make program supports the
761VPATH feature, you can create an empty build directory for each
762architecture, and in each directory run the configure script (on the
763appropriate machine with the appropriate options). This creates the
764necessary subdirectories and the Makefiles therein. The Makefiles
Guido van Rossum4f40c2d2000-09-05 16:46:22765contain a line VPATH=... which points to a directory containing the
Guido van Rossumd0fe8451996-08-26 03:02:37766actual sources. (On SGI systems, use "smake -J1" instead of "make" if
767you use VPATH -- don't try gnumake.)
Guido van Rossum433c8ad1994-08-01 12:07:07768
769For example, the following is all you need to build a minimal Python
770in /usr/tmp/python (assuming ~guido/src/python is the toplevel
771directory and you want to build in /usr/tmp/python):
772
773 $ mkdir /usr/tmp/python
774 $ cd /usr/tmp/python
775 $ ~guido/src/python/configure
776 [...]
777 $ make
778 [...]
779 $
780
Neil Schemenauer73f8ab22001-01-26 22:18:55781Note that configure copies the original Setup file to the build
Guido van Rossum433c8ad1994-08-01 12:07:07782directory if it finds no Setup file there. This means that you can
783edit the Setup file for each architecture independently. For this
784reason, subsequent changes to the original Setup file are not tracked
785automatically, as they might overwrite local changes. To force a copy
786of a changed original Setup file, delete the target Setup file. (The
787makesetup script supports multiple input files, so if you want to be
788fancy you can change the rules to create an empty Setup.local if it
789doesn't exist and run it with arguments $(srcdir)/Setup Setup.local;
790however this assumes that you only need to add modules.)
791
792
Guido van Rossum433c8ad1994-08-01 12:07:07793Building on non-UNIX systems
794----------------------------
795
Tim Peters03444242000-09-19 00:38:35796For Windows (2000/NT/ME/98/95), assuming you have MS VC++ 6.0, the
797project files are in PCbuild, the workspace is pcbuild.dsw. See
798PCbuild\readme.txt for detailed instructions.
Guido van Rossum8d7d4ed1996-07-30 21:41:07799
Guido van Rossum31ae2071999-04-12 14:47:30800For other non-Unix Windows compilers, in particular Windows 3.1 and
801for OS/2, enter the directory "PC" and read the file "readme.txt".
Guido van Rossum6d9cc801996-08-01 17:31:22802
803For the Mac, a separate source distribution will be made available,
804for use with the CodeWarrior compiler. If you are interested in Mac
805development, join the PythonMac Special Interest Group
806(http://www.python.org/sigs/pythonmac-sig/, or send email to
807pythonmac-sig-request@python.org).
808
809Of course, there are also binary distributions available for these
Guido van Rossum67345eb2001-01-18 14:51:12810platforms -- see http://www.python.org/.
Guido van Rossum6d9cc801996-08-01 17:31:22811
812To port Python to a new non-UNIX system, you will have to fake the
813effect of running the configure script manually (for Mac and PC, this
814has already been done for you). A good start is to copy the file
Guido van Rossum433c8ad1994-08-01 12:07:07815config.h.in to config.h and edit the latter to reflect the actual
816configuration of your system. Most symbols must simply be defined as
8171 only if the corresponding feature is present and can be left alone
Tim Peters4f1b2082000-07-23 21:18:09818otherwise; however the *_t type symbols must be defined as some variant
819of int if they need to be defined at all.
Guido van Rossum433c8ad1994-08-01 12:07:07820
821
Guido van Rossum91cb9d21995-04-10 11:47:38822
823Miscellaneous issues
824====================
825
Guido van Rossum91cb9d21995-04-10 11:47:38826Emacs mode
827----------
828
Guido van Rossumc0be2f51997-10-08 05:05:28829There's an excellent Emacs editing mode for Python code; see the file
830Misc/python-mode.el. Originally written by the famous Tim Peters, it
Guido van Rossum4f40c2d2000-09-05 16:46:22831is now maintained by the equally famous Barry Warsaw (it's no
Guido van Rossum67345eb2001-01-18 14:51:12832coincidence that they now both work on the same team). The latest
Guido van Rossumc07d5fa2000-09-01 22:50:02833version, along with various other contributed Python-related Emacs
Guido van Rossum67345eb2001-01-18 14:51:12834goodies, is online at http://www.python.org/emacs/python-mode. And
Guido van Rossumc07d5fa2000-09-01 22:50:02835if you are planning to edit the Python C code, please pick up the
Guido van Rossum67345eb2001-01-18 14:51:12836latest version of CC Mode http://www.python.org/emacs/cc-mode; it
Guido van Rossumc07d5fa2000-09-01 22:50:02837contains a "python" style used throughout most of the Python C source
838files. (Newer versions of Emacs or XEmacs may already come with the
839latest version of python-mode.)
Guido van Rossum91cb9d21995-04-10 11:47:38840
841
842The Tk interface
843----------------
844
845Tk (the user interface component of John Ousterhout's Tcl language) is
846also usable from Python. Since this requires that you first build and
Fred Drake8179a9d2000-09-28 23:28:30847install Tcl/Tk, the Tk interface is not enabled by default when
848building Python from source. Python supports Tcl/Tk version 8.0 and
849higher.
Guido van Rossum6d9cc801996-08-01 17:31:22850
Guido van Rossum973e4dc2000-07-01 00:34:39851See http://dev.ajubasolutions.com/ for more info on Tcl/Tk, including
852the on-line manual pages.
Guido van Rossum64773801997-11-26 17:07:02853
Guido van Rossum91cb9d21995-04-10 11:47:38854
855To enable the Python/Tk interface, once you've built and installed
Guido van Rossum4f40c2d2000-09-05 16:46:22856Tcl/Tk, load the file Modules/Setup into your favorite text editor and
Guido van Rossum64773801997-11-26 17:07:02857search for the string "_tkinter". Then follow the instructions found
858there. If you have installed Tcl/Tk or X11 in unusual places, you
Guido van Rossum4f40c2d2000-09-05 16:46:22859will have to edit the first line to fix or add the -I and -L options.
Guido van Rossum64773801997-11-26 17:07:02860(Also see the general instructions at the top of that file.)
Guido van Rossum91cb9d21995-04-10 11:47:38861
Guido van Rossum973e4dc2000-07-01 00:34:39862For more Tkinter information, see the Tkinter Resource page:
863http://www.python.org/topics/tkinter/
Guido van Rossumc0be2f51997-10-08 05:05:28864
Guido van Rossum6d9cc801996-08-01 17:31:22865There are demos in the Demo/tkinter directory, in the subdirectories
866guido, matt and www (the matt and guido subdirectories have been
867overhauled to use more recent Tkinter coding conventions).
Guido van Rossum91cb9d21995-04-10 11:47:38868
869Note that there's a Python module called "Tkinter" (capital T) which
Guido van Rossumc07d5fa2000-09-01 22:50:02870lives in Lib/lib-tk/Tkinter.py, and a C module called "_tkinter"
Guido van Rossum6d9cc801996-08-01 17:31:22871(lower case t and leading underscore) which lives in
Guido van Rossum4f40c2d2000-09-05 16:46:22872Modules/_tkinter.c. Demos and normal Tk applications import only the
873Python Tkinter module -- the latter uses the C _tkinter module
Guido van Rossum6d9cc801996-08-01 17:31:22874directly. In order to find the C _tkinter module, it must be compiled
875and linked into the Python interpreter -- the _tkinter line in the
876Setup file does this. In order to find the Python Tkinter module,
877sys.path must be set correctly -- the TKPATH assignment in the Setup
878file takes care of this, but only if you install Python properly
879("make install libinstall"). (You can also use dynamic loading for
880the C _tkinter module, in which case you must manually fix up sys.path
881or set $PYTHONPATH for the Python Tkinter module.)
Guido van Rossum84c8c7f1995-08-28 02:44:24882
Guido van Rossum91cb9d21995-04-10 11:47:38883
Guido van Rossum433c8ad1994-08-01 12:07:07884Distribution structure
885----------------------
886
Guido van Rossum4f40c2d2000-09-05 16:46:22887Most subdirectories have their own README files. Most files have
Guido van Rossum433c8ad1994-08-01 12:07:07888comments.
889
Guido van Rossumc07d5fa2000-09-01 22:50:02890.cvsignore Additional filename matching patterns for CVS to ignore
891BeOS/ Files specific to the BeOS port
Guido van Rossum6d9cc801996-08-01 17:31:22892Demo/ Demonstration scripts, modules and programs
Guido van Rossumc07d5fa2000-09-01 22:50:02893Doc/ Documentation sources (LaTeX)
Guido van Rossum6d9cc801996-08-01 17:31:22894Grammar/ Input for the parser generator
895Include/ Public header files
Guido van Rossumc07d5fa2000-09-01 22:50:02896LICENSE Licensing information
Guido van Rossum6d9cc801996-08-01 17:31:22897Lib/ Python library modules
Neil Schemenauer3f52da52001-01-24 17:49:59898Makefile.pre.in Source from which config.status creates the Makefile.pre
Guido van Rossumc0be2f51997-10-08 05:05:28899Misc/ Miscellaneous useful files
Guido van Rossum6d9cc801996-08-01 17:31:22900Modules/ Implementation of most built-in modules
901Objects/ Implementation of most built-in object types
Guido van Rossumc07d5fa2000-09-01 22:50:02902PC/ Files specific to PC ports (DOS, Windows, OS/2)
903PCbuild/ Build directory for Microsoft Visual C++
Guido van Rossum6d9cc801996-08-01 17:31:22904Parser/ The parser and tokenizer and their input handling
Guido van Rossum4f40c2d2000-09-05 16:46:22905Python/ The byte-compiler and interpreter
Guido van Rossum6d9cc801996-08-01 17:31:22906README The file you're reading now
907Tools/ Some useful programs written in Python
Guido van Rossumc07d5fa2000-09-01 22:50:02908acconfig.h Additional input for the GNU autoheader program
909config.h.in Source from which config.h is created (GNU autoheader output)
Guido van Rossum6d9cc801996-08-01 17:31:22910configure Configuration shell script (GNU autoconf output)
Guido van Rossumc07d5fa2000-09-01 22:50:02911configure.in Configuration specification (input for GNU autoconf)
Guido van Rossum6d9cc801996-08-01 17:31:22912install-sh Shell script used to install files
Guido van Rossum91cb9d21995-04-10 11:47:38913
914The following files will (may) be created in the toplevel directory by
915the configuration and build processes:
916
Guido van Rossum6d9cc801996-08-01 17:31:22917Makefile Build rules
Neil Schemenauer3f52da52001-01-24 17:49:59918Makefile.pre Build rules before running Modules/makesetup
Guido van Rossumc07d5fa2000-09-01 22:50:02919buildno Keeps track of the build number
920config.cache Cache of configuration variables
Guido van Rossum6d9cc801996-08-01 17:31:22921config.h Configuration header
Guido van Rossumc0be2f51997-10-08 05:05:28922config.log Log from last configure run
Guido van Rossum4f40c2d2000-09-05 16:46:22923config.status Status from last run of the configure script
Guido van Rossumc07d5fa2000-09-01 22:50:02924getbuildinfo.o Object file from Modules/getbuildinfo.c
Guido van Rossum67345eb2001-01-18 14:51:12925libpython<version>.a The library archive
Guido van Rossum6d9cc801996-08-01 17:31:22926python The executable interpreter
927tags, TAGS Tags files for vi and Emacs
Guido van Rossum433c8ad1994-08-01 12:07:07928
929
Guido van Rossumc07d5fa2000-09-01 22:50:02930That's all, folks!
931------------------
Guido van Rossum433c8ad1994-08-01 12:07:07932
933
Guido van Rossum67345eb2001-01-18 14:51:12934--Guido van Rossum (home page: http://www.python.org/~guido/)