blob: 5f8a5c86f8e8be94caaa2741deef60e111814f31 [file] [log] [blame]
Guido van Rossumb06df271997-08-05 21:50:20 +00001This is Python release 1.5 alpha 3
Guido van Rossumf501b4e1996-10-25 14:32:48 +00002==================================
Guido van Rossumfaf681a1996-06-20 14:32:08 +00003
Guido van Rossum33fde571997-05-09 02:40:09 +00004******************************************
5*** RELEASE RESTRICTED TO PSA MEMBERS! ***
6******************************************
Guido van Rossum627b2d71993-12-24 10:39:16 +00007
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +00008What's new in this release?
9---------------------------
Guido van Rossum3ff96dd1996-07-30 18:05:04 +000010
Guido van Rossumb06df271997-08-05 21:50:20 +000011Too much has changed to list it all; I'll be more complete later.
Guido van Rossum33fde571997-05-09 02:40:09 +000012
Guido van Rossumb06df271997-08-05 21:50:20 +000013The most important changes since Python 1.4 include:
14
15- Many previously undocumented modules are now documented; some are
16now officially obsolete or deprecated.
17
18- It's much faster (almost twice for pystone.py -- see Tools/scripts.)
19
20- There's an assert statement.
21
22- There's a -O option that removes SET_LINENO instructions and code
23prefixed with ``if __debug__: ...''.
24
25- It's much smarter about the initial value for sys.path; you can
26control it easier using $PYTHONHOME (see the usage message, e.g. try
27``python -h'').
28
29- The Grand Renaming is completed: all linker-visible symbols defined
30by Python now have a "Py" or "_Py" prefix, and the same is true for
31most macros and typedefs.
32
33- The build strategy now uses a single library (libpython1.5.a) which
34contains everything except for the main() entry point. This makes
35life much easier for applications that want to embed Python.
36
37- There is also much better support for embedding Python in
38applications that use threads.
39
40- Unfinished projects: documentation; multiple independent
41interpreters; more Windows support.
Guido van Rossum3ff96dd1996-07-30 18:05:04 +000042
43
Guido van Rossum91cb9d21995-04-10 11:47:38 +000044What is Python anyway?
45----------------------
46
47Python is an interpreted object-oriented programming language, and is
Guido van Rossum8d90f9d1997-05-22 20:13:25 +000048often compared to Tcl, Perl, Java or Scheme. For a quick summary of
Guido van Rossum6d9cc801996-08-01 17:31:22 +000049what Python can mean for a UNIX/C programmer, read Misc/BLURB.LUTZ.
Guido van Rossumdfcf35d1996-08-26 17:52:09 +000050If you have web access, point your browser to http://www.python.org.
Guido van Rossum91cb9d21995-04-10 11:47:38 +000051
52
Guido van Rossumf501b4e1996-10-25 14:32:48 +000053How do I learn Python?
54----------------------
55
56The official tutorial is still a good place to start (in the Doc
57directory as tut.tex; and http://www.python.org/doc/tut/tut.html).
58Aaron Watters wrote a second tutorial, that may be more accessible for
59some: http://www.wcmh.com/uworld/archives/95/tutorial/005.html.
60
Guido van Rossum8d90f9d1997-05-22 20:13:25 +000061There are now also several books on Python. While these are still
62based on Python 1.3 or 1.4, the language is so stable now that you'd
63be hard pressed to find places where the books are out of date. The
64first two books, both first published in October 1996 and both
65including a CD-ROM, form excellent companions to each other:
Guido van Rossumf501b4e1996-10-25 14:32:48 +000066
67 Internet Programming with Python
68 by Aaron Watters, Guido van Rossum, and James Ahlstrom
69 MIS Press/Henry Holt publishers
70 ISBN: 1-55851-484-8
71
72 Programming Python
73 by Mark Lutz
74 O'Reilly & Associates
75 ISBN: 1-56592-197-6
76
Guido van Rossum8d90f9d1997-05-22 20:13:25 +000077If you prefer to read German, try:
78
79 Das Python-Buch
80 by Martin von Loewis and Nils Fischbeck
81 Addison-Wesley-Longman, 1997
82 ISBN: 3-8273-1110-1
83
Guido van Rossumf501b4e1996-10-25 14:32:48 +000084
Guido van Rossum91cb9d21995-04-10 11:47:38 +000085If you don't read instructions
86------------------------------
87
88Congratulations on getting this far. :-)
89
90To start building right away (on UNIX): type "./configure" in the
91current directory and when it finishes, type "make". The section
92Build Instructions below is still recommended reading. :-)
93
94
95Copyright issues
96----------------
97
98Python is COPYRIGHTED but free to use for all. See the full copyright
99notice at the end of this file.
100
101The Python distribution is *not* affected by the GNU Public Licence
102(GPL). There are interfaces to some GNU code but these are entirely
103optional and no GNU code is distributed with Python. For all these
104packages, GPL-free public domain versions also exist.
105
Guido van Rossum627b2d71993-12-24 10:39:16 +0000106
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000107
Guido van Rossumff840491995-09-18 22:02:47 +0000108A modest plug
109=============
110
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000111*********************************************************************
112* Without your help, I won't be able to continue to support Python! *
113*********************************************************************
Guido van Rossumff840491995-09-18 22:02:47 +0000114
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000115If you use Python, please consider joining the Python Software
116Activity (PSA). See http://www.python.org/psa/.
117
118Organizations that make heavy use of Python are especially encouraged
119to become corporate members!
Guido van Rossum627b2d71993-12-24 10:39:16 +0000120
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000121
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000122Build instructions
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000123==================
Guido van Rossum627b2d71993-12-24 10:39:16 +0000124
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000125Before you can build Python, you must first configure it.
126Fortunately, the configuration and build process has been streamlined
127for most Unix installations, so all you have to do is type a few
128commands, optionally edit one file, and sit back. There are some
129platforms where things are not quite as smooth; see the platform
130specific notes below. If you want to build for multiple platforms
131sharing the same source tree, see the section on VPATH below.
Guido van Rossum627b2d71993-12-24 10:39:16 +0000132
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000133You start by running the script "./configure", which figures out your
134system configuration and creates several Makefiles. (It takes a
135minute or two -- please be patient!) When it's done, you are ready to
136run make. You may want to pass options to the configure script -- see
137the section below on configuration options and variables.
138
139To build Python, you normally type "make" in the toplevel directory.
140This will recursively run make in each of the subdirectories Parser,
141Objects, Python and Modules, creating a library file in each one. The
142executable of the interpreter is built in the Modules subdirectory and
143moved up here when it is built. If you want or need to, you can also
144chdir into each subdirectory in turn and run make there manually (do
145the Modules subdirectory last!).
146
147Once you have built an interpreter, see the subsections below on
148testing, configuring additional modules, and installation. If you run
149in trouble, see the next section.
Guido van Rossum627b2d71993-12-24 10:39:16 +0000150
Guido van Rossum0a516c91994-09-12 10:58:40 +0000151
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000152Troubleshooting
153---------------
Guido van Rossum627b2d71993-12-24 10:39:16 +0000154
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000155See also the platform specific notes in the next section.
156
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000157If recursive makes fail, try invoking make as "make MAKE=make".
158
159If you run into other trouble, see section 3 of the FAQ (file
160Misc/FAQ) for hints on what can go wrong, and how to fix it.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000161
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000162If you rerun the configure script with different options, remove all
163object files by running "make clean" before rebuilding. Believe it or
164not, "make clean" sometimes helps to clean up other inexplicable
165problems as well. Try it before sending in a bug report!
166
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000167If the configure script fails or doesn't seem to find things that
168should be there, inspect the config.log file.
169
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000170
171Platform specific notes
172-----------------------
173
Guido van Rossum0447a321995-10-08 01:22:33 +0000174(Some of these may no longer apply. If you find you can build Python
175on these platforms without the special directions mentioned here, let
176me know so I can remove them!)
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000177
Guido van Rossum4462e931997-01-22 21:00:32 +0000178Solaris: When using Sun's C compiler with threads, at least on Solaris
179 2.5.1, you need to add the "-mt" compiler option (the simplest
180 way is probably to specify the compiler with this option as
181 the "CC" environment variable when running the configure
182 script).
183
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000184Linux: On Linux version 1.x, once you've built Python, use it to run
185 the regen script in the Lib/linux1 directory. Apparently
186 the files as distributed don't match the system headers on
187 some Linux versions. (The "h2py" command refers to
188 Tools/scripts/h2py.py.) The modules distributed for Linux 2.x
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000189 should be okay. Shared library support now works by default
Guido van Rossum4462e931997-01-22 21:00:32 +0000190 on ELF-based x86 Linux systems. (Note: when you change the
191 status of a module from static to shared, you must remove its
192 .o file or do a "make clean".)
193
Guido van Rossum6ae5d3d1997-05-14 21:39:05 +0000194DEC Unix: When enabling threads, use --with-dec-threads, not
Guido van Rossum4462e931997-01-22 21:00:32 +0000195 --with-thread.
Guido van Rossum8eca2c21996-02-14 18:37:46 +0000196
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000197AIX: A complete overhaul of the shared library support is now in
198 place. To enable it, uncomment the LINKCC line in the Setup
199 file. See Misc/AIX-NOTES for some notes on how it's done.
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000200
Guido van Rossum6ae5d3d1997-05-14 21:39:05 +0000201 WARNING! In some versions of AIX, you get errors about
Guido van Rossuma3b4b611996-07-21 02:48:16 +0000202 Invalid Indent when running the Python test set. This appears
203 to be a bug in the AIX compiler. Rebuild Parser/tokenizer.c
Guido van Rossum6ae5d3d1997-05-14 21:39:05 +0000204 using OPT="" or OPT=-g, or use gcc. According to the latest
205 reports, it seems this compiler bug is still present in 4.2.1.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000206
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000207HP-UX: Shared library support now works by default (at least on HP-UX
208 9.x). One other problem remains: the HP ANSI C compiler (cc
209 -Aa) is too pedantic to use, but in K&R mode, it barfs on a
210 few files (complexobject.c, getargs.c and operator.c). Until
211 this is fixed, the following seems to work:
212
213 make -k # this compiles all but a few files
214 make OPT=-Aa # compile the remaining files
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000215
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000216Minix: When using ack, use "CC=cc AR=aal RANLIB=: ./configure"!
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000217
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000218SCO: 1) Everything works much better if you add -U__STDC__ to the
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000219 defs. This is because all the SCO header files are broken.
220 Anything that isn't mentioned in the C standard it's
221 conditionally excluded when __STDC__ is defined.
222
223 2) Due to the U.S. export restrictions, SCO broke the crypt
224 stuff out into a separate library, libcrypt_i.a so the LIBS
225 needed be set to:
226
227 LIBS=' -lsocket -lcrypt_i'
228
Guido van Rossuma3b4b611996-07-21 02:48:16 +0000229 3) According to at least one report, the above apply only to
230 SCO 3 -- Python builds out of the box on SCO 5.
231
Guido van Rossum4462e931997-01-22 21:00:32 +0000232SunOS: On SunOS 4.1.x, when using the SunPro C compiler, you may want
233 to use the '-Xa' option instead of '-Xc', to enable some
234 needed non-ANSI Sunisms.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000235
Guido van Rossumcc55c2d1996-10-21 15:14:27 +0000236NeXT: To build fat binaries, use the --with-next-archs switch
237 described below.
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000238
239
240Configuring additional built-in modules
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000241---------------------------------------
Guido van Rossum19e0c261995-01-17 16:36:34 +0000242
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000243You can configure the interpreter to contain fewer or more built-in
244modules by editing the file Modules/Setup. This file is initially
245copied (when the toplevel Makefile makes Modules/Makefile for the
246first time) from Setup.in; if it does not exist yet, make a copy
247yourself. Never edit Setup.in -- always edit Setup. Read the
248comments in the file for information on what kind of edits you can
249make. When you have edited Setup, Makefile and config.c in Modules
250will automatically be rebuilt the next time you run make in the
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000251toplevel directory. (When working inside the Modules directory, use
252"make Makefile; make".)
Guido van Rossum627b2d71993-12-24 10:39:16 +0000253
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000254The default collection of modules should build on any Unix system, but
255many optional modules should work on all modern Unices (e.g. try dbm,
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000256nis, termios, timing, syslog, curses, new, soundex, parser). Often
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000257the quickest way to determine whether a particular module works or not
258is to see if it will build: enable it in Setup, then if you get
259compilation or link errors, disable it -- you're missing support.
260
261On SGI IRIX, there are modules that interface to many SGI specific
262system libraries, e.g. the GL library and the audio hardware.
263
264For SunOS and Solaris, enable module "sunaudiodev" to support the
265audio device.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000266
Guido van Rossum4462e931997-01-22 21:00:32 +0000267In addition to the file Setup, you can also edit the file Setup.local.
268(the makesetup script processes both). You may find it more
269convenient to edit Setup.local and leave Setup alone. Then, when
270installing a new Python version, you can copy your old Setup.local
271file.
272
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000273
274Setting the optimization/debugging options
275------------------------------------------
276
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000277If you want or need to change the optimization/debugging options for
278the C compiler, assign to the OPT variable on the toplevel make
279command; e.g. "make OPT=-g" will build a debugging version of Python
280on most platforms. The default is OPT=-O; a value for OPT in the
281environment when the configure script is run overrides this default
282(likewise for CC; and the initial value for LIBS is used as the base
283set of libraries to link with).
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000284
285
286Testing
287-------
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000288
289To test the interpreter that you have just built, type "make test".
Guido van Rossum6ae5d3d1997-05-14 21:39:05 +0000290This runs the test set twice (once with no compiled files, once with
291the compiled files left by the previous test run). The test set
292produces some output. You can generally ignore the messages about
293skipped tests due to an optional feature that can't be imported (if
294you want to test those modules, edit Modules/Setup to configure them).
295If a messages is printed about a failed test or a traceback or core
296dump is produced, something's wrong. On some systems, test_strftime
297fails due to a non-standard implementation of strftime() in the C
298library. This can be ignored (or you can complain to your vendor).
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000299
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000300IMPORTANT: If the tests fail and you decide to mail a bug report,
301*don't* include the output of "make test". It is useless. Run the
Guido van Rossum6ae5d3d1997-05-14 21:39:05 +0000302test that fails manually, as follows:
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000303
Guido van Rossum6ae5d3d1997-05-14 21:39:05 +0000304 python ../Lib/test/test_whatever.py
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000305
306(substituting the top of the source tree for .. if you built in a
Guido van Rossum6ae5d3d1997-05-14 21:39:05 +0000307different directory). This runs the test in verbose mode.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000308
309
310Installing
311----------
312
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000313Installing Python was never this easy!
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000314
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000315To install the Python binary, library modules, shared library modules
316(see below), include files, configuration files, and the manual page,
317just type "make install". This will install all platform-independent
318files in subdirectories the directory given with the --prefix option
319to configure or the 'prefix' Make variable (default /usr/local), and
320all binary and other platform-specific files in subdirectories if the
321directory given by --exec-prefix or the 'exec_prefix' Make variable
322(defaults to the --prefix directory). All subdirectories created will
323have Python's version number in their name, e.g. the library modules
Guido van Rossum33fde571997-05-09 02:40:09 +0000324are installed in "/usr/local/lib/python1.5/" by default. The Python
325binary is installed as "python1.5" and a hard link named "python" is
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000326created. The only file not installed with a version number in its
327name is the manual page, installed as "/usr/local/man/man1/python.1"
328by default.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000329
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000330If you have a previous installation of a pre-1.4 Python that you don't
331want to replace yet, use "make altinstall". This installs the same
332set of files as "make install" except it doesn't create the hard link
Guido van Rossum33fde571997-05-09 02:40:09 +0000333to "python1.5" named "python" and it doesn't install the manual page
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000334at all.
335
336The only thing you may have to install manually is the Python mode for
337Emacs. (But then again, more recent versions of Emacs may already
338have it!) This is the file Misc/python-mode.el; follow the
339instructions that came with Emacs for installation of site specific
340files.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000341
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000342
343Configuration options and variables
344-----------------------------------
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000345
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000346Some special cases are handled by passing options to the configure
347script.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000348
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000349WARNING: if you rerun the configure script with different options, you
350must run "make clean" before rebuilding. Exceptions to this rule:
351after changing --prefix or --exec-prefix, all you need to do is remove
Guido van Rossumb06df271997-08-05 21:50:20 +0000352Modules/getpath.o.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000353
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000354--with(out)-gcc: The configure script uses gcc (the GNU C compiler) if
355 it finds it. If you don't want this, or if this compiler is
356 installed but broken on your platform, pass the option
357 --without-gcc. You can also pass "CC=cc" (or whatever the
358 name of the proper C compiler is) in the environment, but the
359 advantage of using --without-gcc is that this option is
360 remembered by the config.status script for its --recheck
361 option.
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000362
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000363--prefix, --exec-prefix: If you want to install the binaries and the
364 Python library somewhere else than in /usr/local/{bin,lib},
365 you can pass the option --prefix=DIRECTORY; the interpreter
366 binary will be installed as DIRECTORY/bin/python and the
367 library files as DIRECTORY/lib/python/*. If you pass
368 --exec-prefix=DIRECTORY (as well) this overrides the
369 installation prefix for architecture-dependent files (like the
370 interpreter binary). Note that --prefix=DIRECTORY also
371 affects the default module search path (sys.path), when
372 Modules/config.c is compiled. Passing make the option
373 prefix=DIRECTORY (and/or exec_prefix=DIRECTORY) overrides the
374 prefix set at configuration time; this may be more convenient
375 than re-running the configure script if you change your mind
376 about the install prefix...
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000377
Guido van Rossumb06df271997-08-05 21:50:20 +0000378--with-readline: This option is no longer supported. To use GNU
379 readline, enable module "readline" in the Modules/Setup file.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000380
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000381--with-thread: On most Unix systems, you can now use multiple threads.
Guido van Rossum4462e931997-01-22 21:00:32 +0000382 To enable this, pass --with-thread. (--with-threads is an
383 alias.) If the library required for threads lives in a
Guido van Rossum8d90f9d1997-05-22 20:13:25 +0000384 peculiar place, you can use --with-thread=DIRECTORY. NOTE:
385 you must also enable the thread module by uncommenting it in
386 the Modules/Setup file. (Threads aren't enabled automatically
387 because there are run-time penalties when support for them is
388 compiled in even if you don't use them.) IMPORTANT: run "make
389 clean" after changing (either enabling or disabling) this
390 option! Note: for DEC Unix use --with-dec-threads instead.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000391
392--with-sgi-dl: On SGI IRIX 4, dynamic loading of extension modules is
393 supported by the "dl" library by Jack Jansen, which is
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000394 ftp'able from ftp://ftp.cwi.nl/pub/dynload/dl-1.6.tar.Z.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000395 This is enabled (after you've ftp'ed and compiled the dl
396 library!) by passing --with-sgi-dl=DIRECTORY where DIRECTORY
397 is the absolute pathname of the dl library. (Don't bother on
398 IRIX 5, it already has dynamic linking using SunOS style
399 shared libraries.) Support for this feature is deprecated.
400
401--with-dl-dld: Dynamic loading of modules is rumoured to be supported
402 on some other systems: VAX (Ultrix), Sun3 (SunOS 3.4), Sequent
403 Symmetry (Dynix), and Atari ST. This is done using a
404 combination of the GNU dynamic loading package
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000405 (ftp://ftp.cwi.nl/pub/dynload/dl-dld-1.1.tar.Z) and an
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000406 emulation of the SGI dl library mentioned above (the emulation
407 can be found at
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000408 ftp://ftp.cwi.nl/pub/dynload/dld-3.2.3.tar.Z). To
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000409 enable this, ftp and compile both libraries, then call the
410 configure passing it the option
411 --with-dl-dld=DL_DIRECTORY,DLD_DIRECTORY where DL_DIRECTORY is
412 the absolute pathname of the dl emulation library and
413 DLD_DIRECTORY is the absolute pathname of the GNU dld library.
414 (Don't bother on SunOS 4 or 5, they already have dynamic
415 linking using shared libraries.) Support for this feature is
416 deprecated.
417
418--with-libm, --with-libc: It is possible to specify alternative
419 versions for the Math library (default -lm) and the C library
420 (default the empty string) using the options
421 --with-libm=STRING and --with-libc=STRING, respectively. E.g.
422 if your system requires that you pass -lc_s to the C compiler
423 to use the shared C library, you can pass --with-libc=-lc_s.
424 These libraries are passed after all other libraries, the C
425 library last.
Guido van Rossum3ff96dd1996-07-30 18:05:04 +0000426
427--with-next-archs='arch1 arch2': Under NEXTSTEP, this will build
428 all compiled binaries with the architectures listed. Includes
429 correctly setting the target architecture specific resource
Guido van Rossumcc55c2d1996-10-21 15:14:27 +0000430 directory. (This option is not supported on other platforms.)
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000431
Guido van Rossumd02ba451996-07-31 17:36:01 +0000432--with-libs='libs': Add 'libs' to the LIBS that the python
433 linked against.
434
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000435
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000436Building for multiple architectures (using the VPATH feature)
437-------------------------------------------------------------
438
439If your file system is shared between multiple architectures, it
440usually is not necessary to make copies of the sources for each
441architecture you want to support. If the make program supports the
442VPATH feature, you can create an empty build directory for each
443architecture, and in each directory run the configure script (on the
444appropriate machine with the appropriate options). This creates the
445necessary subdirectories and the Makefiles therein. The Makefiles
446contain a line VPATH=... which points to directory containing the
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000447actual sources. (On SGI systems, use "smake -J1" instead of "make" if
448you use VPATH -- don't try gnumake.)
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000449
450For example, the following is all you need to build a minimal Python
451in /usr/tmp/python (assuming ~guido/src/python is the toplevel
452directory and you want to build in /usr/tmp/python):
453
454 $ mkdir /usr/tmp/python
455 $ cd /usr/tmp/python
456 $ ~guido/src/python/configure
457 [...]
458 $ make
459 [...]
460 $
461
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000462Note that Modules/Makefile copies the original Setup file to the build
463directory if it finds no Setup file there. This means that you can
464edit the Setup file for each architecture independently. For this
465reason, subsequent changes to the original Setup file are not tracked
466automatically, as they might overwrite local changes. To force a copy
467of a changed original Setup file, delete the target Setup file. (The
468makesetup script supports multiple input files, so if you want to be
469fancy you can change the rules to create an empty Setup.local if it
470doesn't exist and run it with arguments $(srcdir)/Setup Setup.local;
471however this assumes that you only need to add modules.)
472
473
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000474Building on non-UNIX systems
475----------------------------
476
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000477Building Python for a PC is now a piece of cake!
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000478
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000479Enter the directory "PC" and read the file "readme.txt". Most popular
480non-Unix PC platforms and compilers are supported (Unix ports to the
481PC such as Linux, FreeBSD or Solaris-x86 of course use the standard
482Unix build instructions).
483
484For the Mac, a separate source distribution will be made available,
485for use with the CodeWarrior compiler. If you are interested in Mac
486development, join the PythonMac Special Interest Group
487(http://www.python.org/sigs/pythonmac-sig/, or send email to
488pythonmac-sig-request@python.org).
489
490Of course, there are also binary distributions available for these
491platforms -- see http://www.python.org/python/.
492
493To port Python to a new non-UNIX system, you will have to fake the
494effect of running the configure script manually (for Mac and PC, this
495has already been done for you). A good start is to copy the file
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000496config.h.in to config.h and edit the latter to reflect the actual
497configuration of your system. Most symbols must simply be defined as
4981 only if the corresponding feature is present and can be left alone
499otherwise; however RETSIGTYPE must always be defined, either as int or
500as void, and the *_t type symbols must be defined as some variant of
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000501int if they need to be defined at all.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000502
503
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000504
505Miscellaneous issues
506====================
507
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000508Documentation
509-------------
510
511All documentation is provided in the subdirectory Doc in the form of
512LaTeX files. In order of importance for new users: Tutorial (tut),
513Library Reference (lib), Language Reference (ref), Extending (ext).
514Especially the Library Reference is of immense value since much of
515Python's power (including the built-in data types and functions!) is
516described here.
517
Guido van Rossumdfcf35d1996-08-26 17:52:09 +0000518To print the documentation from the LaTeX files, chdir into the Doc
519subdirectory, type "make" (let's hope you have LaTeX installed!), and
520send the four resulting PostScript files (tut.ps, lib.ps, ref.ps, and
521ext.ps) to the printer. See the README file there. If you don't have
522LaTeX, you can ftp the PostScript files from the ftp archives (see
523below).
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000524
Guido van Rossumdfcf35d1996-08-26 17:52:09 +0000525All documentation is also available on-line via the Python web site
526(http://www.python.org/, see below). It can also be downloaded
527separately from the ftp archives (see below) in Emacs INFO, HTML or
528PostScript form -- see the web site or the FAQ (file Misc/FAQ) for
529more info.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000530
531
532Emacs mode
533----------
534
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000535There's an excellent Emacs editing mode for Python code; see the file
536Misc/python-mode.el. Originally written by Tim Peters, it is now
537maintained by Barry Warsaw <bwarsaw@cnri.reston.va.us>.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000538
539
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000540Web site
541--------
542
543Python's own web site has URL http://www.python.org/. Come visit us!
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000544There are a number of mirrors, listed on the home page -- try a mirror
545that's close you you.
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000546
547
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000548Ftp site
549--------
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000550
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000551Python's own ftp site is ftp.python.org, directory /pub/python. See
552the FAQ (file Misc/FAQ) for a list of other ftp sites carrying the
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000553Python distribution.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000554
555
556Newsgroup and mailing list
557--------------------------
558
Guido van Rossumdfcf35d1996-08-26 17:52:09 +0000559There are a newsgroup and a mailing list devoted to Python. The
560newsgroup, comp.lang.python, contains exactly the same messages as the
561mailing list (though not always in the same order, due to the
562mysterious nature of the Usenet news distribution algorithm). To
563subscribe to the mailing list, send mail containing your real name and
564e-mail address to "python-list-request@cwi.nl". Use the same address
565if you want to unsibscribed. (A real person reads these messages, so
566no LISTPROC or Majordomo commands, please, and please be patient --
567normal turn-around time is about one working day.)
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000568
Guido van Rossumdfcf35d1996-08-26 17:52:09 +0000569The Python web site contains a search form that lets you search the
570newsgroup archives (or the web site itself). Click on the "search"
571link in the banner menu on any page of http://www.python.org/.
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000572
573
574Bug reports
575-----------
576
Guido van Rossumdfcf35d1996-08-26 17:52:09 +0000577Bugs are best reported to the comp.lang.python newsgroup or the Python
Guido van Rossumcc55c2d1996-10-21 15:14:27 +0000578mailing list -- see the section "Newsgroup and mailing list" above.
Guido van Rossumdfcf35d1996-08-26 17:52:09 +0000579Before posting, check the newsgroup archives (see above) to see if
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000580your bug has already been reported!
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000581
582
583Questions
584---------
585
586For help, if you can't find it in the manuals, the FAQ or on the web
587site, it's best to post to the comp.lang.python or the Python mailing
588list (see above). If you specifically don't want to involve the
589newsgroup or mailing list, send questions to python-help@python.org.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000590
591
592The Tk interface
593----------------
594
595Tk (the user interface component of John Ousterhout's Tcl language) is
596also usable from Python. Since this requires that you first build and
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000597install Tcl/Tk, the Tk interface is not enabled by default. It works
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000598with Tcl 7.5 and Tk 4.1 as well as with Tcl 7.4 and Tk 4.0. I didn't
599have the time to test it with Tcl 7.6 and Tk 4.2 yet, but it might
600well work.
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000601
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000602See http://www.sunlabs.com/research/tcl/ for more info on where to get
Guido van Rossum33fde571997-05-09 02:40:09 +0000603Tcl/Tk. Also http://sunscript.sun.com/.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000604
605To enable the Python/Tk interface, once you've built and installed
606Tcl/Tk, all you need to do is edit two lines in Modules/Setup; search
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000607for the string "_tkinter". Uncomment one (normally the first) of the
608lines beginning with "#_tkinter" and un-comment the line beginning
609with "#TKPATH". If you have installed Tcl/Tk or X11 in unusual
610places, you will have to edit the first line to fix or add -I and -L
611options. See the Build Instructions above for more details.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000612
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000613There is little documentation on how to use Tkinter; however most of
614the Tk manual pages apply quite straightforwardly. Begin with
615fetching the "Tk Lifesaver" document,
616e.g. ftp://ftp.python.org/pub/python/doc/tkinter-doc.tar.gz (a gzipped
617tar file containing a PostScript file) or the on-line version
618http://www.python.org/doc/life-preserver/index.html. Reading the
619Tkinter.py source will reveal most details on how Tkinter calls are
620translated into Tcl code.
621
622There are demos in the Demo/tkinter directory, in the subdirectories
623guido, matt and www (the matt and guido subdirectories have been
624overhauled to use more recent Tkinter coding conventions).
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000625
626Note that there's a Python module called "Tkinter" (capital T) which
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000627lives in Lib/tkinter/Tkinter.py, and a C module called "_tkinter"
628(lower case t and leading underscore) which lives in
629Modules/_tkinter.c. Demos and normal Tk applications only import the
630Python Tkinter module -- only the latter uses the C _tkinter module
631directly. In order to find the C _tkinter module, it must be compiled
632and linked into the Python interpreter -- the _tkinter line in the
633Setup file does this. In order to find the Python Tkinter module,
634sys.path must be set correctly -- the TKPATH assignment in the Setup
635file takes care of this, but only if you install Python properly
636("make install libinstall"). (You can also use dynamic loading for
637the C _tkinter module, in which case you must manually fix up sys.path
638or set $PYTHONPATH for the Python Tkinter module.)
Guido van Rossum84c8c7f1995-08-28 02:44:24 +0000639
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000640
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000641Distribution structure
642----------------------
643
644Most subdirectories have their own README file. Most files have
645comments.
646
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000647BUGS A list of known bugs (not completely up-to-date)
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000648Demo/ Demonstration scripts, modules and programs
649Doc/ Documentation (LaTeX sources)
650Grammar/ Input for the parser generator
651Include/ Public header files
652Lib/ Python library modules
653Makefile.in Source from which config.status creates Makefile
654Misc/ Miscellaneous files
655Modules/ Implementation of most built-in modules
656Objects/ Implementation of most built-in object types
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000657PC/ PC porting files (DOS, Windows, NT, OS/2)
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000658Parser/ The parser and tokenizer and their input handling
659Python/ The "compiler" and interpreter
660README The file you're reading now
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000661TODO A list of things that could be done (not up-to-date)
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000662Tools/ Some useful programs written in Python
663acconfig.h Additional input for the autoheader program
664config.h.in Source from which config.status creates config.h
665configure Configuration shell script (GNU autoconf output)
666configure.in Configuration specification (GNU autoconf input)
667install-sh Shell script used to install files
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000668
669The following files will (may) be created in the toplevel directory by
670the configuration and build processes:
671
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000672Makefile Build rules
673config.cache cache of configuration variables
674config.h Configuration header
675config.log log from last configure run
676config.status status from last run of configure script
677python The executable interpreter
678tags, TAGS Tags files for vi and Emacs
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000679
680
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000681Author's address
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000682================
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000683
684Guido van Rossum
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000685CNRI
6861895 Preston White Drive
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000687Reston, VA 20191
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000688USA
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000689
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000690E-mail: guido@cnri.reston.va.us or guido@python.org
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000691
692
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000693
694Copyright notice
695================
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000696
697The Python source is copyrighted, but you can freely use and copy it
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000698as long as you don't change or remove the copyright notice:
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000699
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000700----------------------------------------------------------------------
Guido van Rossumaf5b83e1995-01-04 19:02:35 +0000701Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
702The Netherlands.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000703
704 All Rights Reserved
705
Guido van Rossumc561e5d1994-08-23 13:52:46 +0000706Permission to use, copy, modify, and distribute this software and its
707documentation for any purpose and without fee is hereby granted,
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000708provided that the above copyright notice appear in all copies and that
Guido van Rossumc561e5d1994-08-23 13:52:46 +0000709both that copyright notice and this permission notice appear in
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000710supporting documentation, and that the names of Stichting Mathematisch
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000711Centrum or CWI or Corporation for National Research Initiatives or
712CNRI not be used in advertising or publicity pertaining to
713distribution of the software without specific, written prior
714permission.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000715
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000716While CWI is the initial source for this software, a modified version
717is made available by the Corporation for National Research Initiatives
718(CNRI) at the Internet address ftp://ftp.python.org.
719
720STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
721REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
722MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
723CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
724DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
725PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
726TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
727PERFORMANCE OF THIS SOFTWARE.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000728----------------------------------------------------------------------
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000729
730
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000731--Guido van Rossum (home page: http://www.python.org/~guido/)