blob: 1fb3e6487f4d556afeaab80a8fb93a81e4f83baf [file] [log] [blame]
Guido van Rossum8d90f9d1997-05-22 20:13:25 +00001This is Python release 1.5 alpha 2
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 Rossum33fde571997-05-09 02:40:09 +000011Ehm, I'll be more complete later. Som highlights: I've completed the
12Grand Renaming. It's much faster (almost twice for pystone.py -- see
13Tools/scripts.) There's an assert statement, and a -O option that
14squeezes SET_LINENO instructions and if __debug__ code. It's much
15smarter (only on Unix, so far) about the initial value for sys.path.
16See the usage message (python -h). There's an explicit structure that
17maintains all per-thread globals.
18
19Unfinished projects: documentation; multiple independent interpreters;
20better embedding support; more Windows support.
Guido van Rossum3ff96dd1996-07-30 18:05:04 +000021
22
Guido van Rossum91cb9d21995-04-10 11:47:38 +000023What is Python anyway?
24----------------------
25
26Python is an interpreted object-oriented programming language, and is
Guido van Rossum8d90f9d1997-05-22 20:13:25 +000027often compared to Tcl, Perl, Java or Scheme. For a quick summary of
Guido van Rossum6d9cc801996-08-01 17:31:22 +000028what Python can mean for a UNIX/C programmer, read Misc/BLURB.LUTZ.
Guido van Rossumdfcf35d1996-08-26 17:52:09 +000029If you have web access, point your browser to http://www.python.org.
Guido van Rossum91cb9d21995-04-10 11:47:38 +000030
31
Guido van Rossumf501b4e1996-10-25 14:32:48 +000032How do I learn Python?
33----------------------
34
35The official tutorial is still a good place to start (in the Doc
36directory as tut.tex; and http://www.python.org/doc/tut/tut.html).
37Aaron Watters wrote a second tutorial, that may be more accessible for
38some: http://www.wcmh.com/uworld/archives/95/tutorial/005.html.
39
Guido van Rossum8d90f9d1997-05-22 20:13:25 +000040There are now also several books on Python. While these are still
41based on Python 1.3 or 1.4, the language is so stable now that you'd
42be hard pressed to find places where the books are out of date. The
43first two books, both first published in October 1996 and both
44including a CD-ROM, form excellent companions to each other:
Guido van Rossumf501b4e1996-10-25 14:32:48 +000045
46 Internet Programming with Python
47 by Aaron Watters, Guido van Rossum, and James Ahlstrom
48 MIS Press/Henry Holt publishers
49 ISBN: 1-55851-484-8
50
51 Programming Python
52 by Mark Lutz
53 O'Reilly & Associates
54 ISBN: 1-56592-197-6
55
Guido van Rossum8d90f9d1997-05-22 20:13:25 +000056If you prefer to read German, try:
57
58 Das Python-Buch
59 by Martin von Loewis and Nils Fischbeck
60 Addison-Wesley-Longman, 1997
61 ISBN: 3-8273-1110-1
62
Guido van Rossumf501b4e1996-10-25 14:32:48 +000063
Guido van Rossum91cb9d21995-04-10 11:47:38 +000064If you don't read instructions
65------------------------------
66
67Congratulations on getting this far. :-)
68
69To start building right away (on UNIX): type "./configure" in the
70current directory and when it finishes, type "make". The section
71Build Instructions below is still recommended reading. :-)
72
73
74Copyright issues
75----------------
76
77Python is COPYRIGHTED but free to use for all. See the full copyright
78notice at the end of this file.
79
80The Python distribution is *not* affected by the GNU Public Licence
81(GPL). There are interfaces to some GNU code but these are entirely
82optional and no GNU code is distributed with Python. For all these
83packages, GPL-free public domain versions also exist.
84
Guido van Rossum627b2d71993-12-24 10:39:16 +000085
Guido van Rossum6d9cc801996-08-01 17:31:22 +000086
Guido van Rossumff840491995-09-18 22:02:47 +000087A modest plug
88=============
89
Guido van Rossumf501b4e1996-10-25 14:32:48 +000090*********************************************************************
91* Without your help, I won't be able to continue to support Python! *
92*********************************************************************
Guido van Rossumff840491995-09-18 22:02:47 +000093
Guido van Rossumf501b4e1996-10-25 14:32:48 +000094If you use Python, please consider joining the Python Software
95Activity (PSA). See http://www.python.org/psa/.
96
97Organizations that make heavy use of Python are especially encouraged
98to become corporate members!
Guido van Rossum627b2d71993-12-24 10:39:16 +000099
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000100
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000101Build instructions
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000102==================
Guido van Rossum627b2d71993-12-24 10:39:16 +0000103
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000104Before you can build Python, you must first configure it.
105Fortunately, the configuration and build process has been streamlined
106for most Unix installations, so all you have to do is type a few
107commands, optionally edit one file, and sit back. There are some
108platforms where things are not quite as smooth; see the platform
109specific notes below. If you want to build for multiple platforms
110sharing the same source tree, see the section on VPATH below.
Guido van Rossum627b2d71993-12-24 10:39:16 +0000111
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000112You start by running the script "./configure", which figures out your
113system configuration and creates several Makefiles. (It takes a
114minute or two -- please be patient!) When it's done, you are ready to
115run make. You may want to pass options to the configure script -- see
116the section below on configuration options and variables.
117
118To build Python, you normally type "make" in the toplevel directory.
119This will recursively run make in each of the subdirectories Parser,
120Objects, Python and Modules, creating a library file in each one. The
121executable of the interpreter is built in the Modules subdirectory and
122moved up here when it is built. If you want or need to, you can also
123chdir into each subdirectory in turn and run make there manually (do
124the Modules subdirectory last!).
125
126Once you have built an interpreter, see the subsections below on
127testing, configuring additional modules, and installation. If you run
128in trouble, see the next section.
Guido van Rossum627b2d71993-12-24 10:39:16 +0000129
Guido van Rossum0a516c91994-09-12 10:58:40 +0000130
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000131Troubleshooting
132---------------
Guido van Rossum627b2d71993-12-24 10:39:16 +0000133
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000134See also the platform specific notes in the next section.
135
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000136If recursive makes fail, try invoking make as "make MAKE=make".
137
138If you run into other trouble, see section 3 of the FAQ (file
139Misc/FAQ) for hints on what can go wrong, and how to fix it.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000140
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000141If you rerun the configure script with different options, remove all
142object files by running "make clean" before rebuilding. Believe it or
143not, "make clean" sometimes helps to clean up other inexplicable
144problems as well. Try it before sending in a bug report!
145
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000146If the configure script fails or doesn't seem to find things that
147should be there, inspect the config.log file.
148
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000149
150Platform specific notes
151-----------------------
152
Guido van Rossum0447a321995-10-08 01:22:33 +0000153(Some of these may no longer apply. If you find you can build Python
154on these platforms without the special directions mentioned here, let
155me know so I can remove them!)
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000156
Guido van Rossum4462e931997-01-22 21:00:32 +0000157Solaris: When using Sun's C compiler with threads, at least on Solaris
158 2.5.1, you need to add the "-mt" compiler option (the simplest
159 way is probably to specify the compiler with this option as
160 the "CC" environment variable when running the configure
161 script).
162
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000163Linux: On Linux version 1.x, once you've built Python, use it to run
164 the regen script in the Lib/linux1 directory. Apparently
165 the files as distributed don't match the system headers on
166 some Linux versions. (The "h2py" command refers to
167 Tools/scripts/h2py.py.) The modules distributed for Linux 2.x
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000168 should be okay. Shared library support now works by default
Guido van Rossum4462e931997-01-22 21:00:32 +0000169 on ELF-based x86 Linux systems. (Note: when you change the
170 status of a module from static to shared, you must remove its
171 .o file or do a "make clean".)
172
Guido van Rossum6ae5d3d1997-05-14 21:39:05 +0000173DEC Unix: When enabling threads, use --with-dec-threads, not
Guido van Rossum4462e931997-01-22 21:00:32 +0000174 --with-thread.
Guido van Rossum8eca2c21996-02-14 18:37:46 +0000175
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000176AIX: A complete overhaul of the shared library support is now in
177 place. To enable it, uncomment the LINKCC line in the Setup
178 file. See Misc/AIX-NOTES for some notes on how it's done.
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000179
Guido van Rossum6ae5d3d1997-05-14 21:39:05 +0000180 WARNING! In some versions of AIX, you get errors about
Guido van Rossuma3b4b611996-07-21 02:48:16 +0000181 Invalid Indent when running the Python test set. This appears
182 to be a bug in the AIX compiler. Rebuild Parser/tokenizer.c
Guido van Rossum6ae5d3d1997-05-14 21:39:05 +0000183 using OPT="" or OPT=-g, or use gcc. According to the latest
184 reports, it seems this compiler bug is still present in 4.2.1.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000185
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000186HP-UX: Shared library support now works by default (at least on HP-UX
187 9.x). One other problem remains: the HP ANSI C compiler (cc
188 -Aa) is too pedantic to use, but in K&R mode, it barfs on a
189 few files (complexobject.c, getargs.c and operator.c). Until
190 this is fixed, the following seems to work:
191
192 make -k # this compiles all but a few files
193 make OPT=-Aa # compile the remaining files
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000194
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000195Minix: When using ack, use "CC=cc AR=aal RANLIB=: ./configure"!
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000196
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000197SCO: 1) Everything works much better if you add -U__STDC__ to the
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000198 defs. This is because all the SCO header files are broken.
199 Anything that isn't mentioned in the C standard it's
200 conditionally excluded when __STDC__ is defined.
201
202 2) Due to the U.S. export restrictions, SCO broke the crypt
203 stuff out into a separate library, libcrypt_i.a so the LIBS
204 needed be set to:
205
206 LIBS=' -lsocket -lcrypt_i'
207
Guido van Rossuma3b4b611996-07-21 02:48:16 +0000208 3) According to at least one report, the above apply only to
209 SCO 3 -- Python builds out of the box on SCO 5.
210
Guido van Rossum4462e931997-01-22 21:00:32 +0000211SunOS: On SunOS 4.1.x, when using the SunPro C compiler, you may want
212 to use the '-Xa' option instead of '-Xc', to enable some
213 needed non-ANSI Sunisms.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000214
Guido van Rossumcc55c2d1996-10-21 15:14:27 +0000215NeXT: To build fat binaries, use the --with-next-archs switch
216 described below.
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000217
218
219Configuring additional built-in modules
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000220---------------------------------------
Guido van Rossum19e0c261995-01-17 16:36:34 +0000221
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000222You can configure the interpreter to contain fewer or more built-in
223modules by editing the file Modules/Setup. This file is initially
224copied (when the toplevel Makefile makes Modules/Makefile for the
225first time) from Setup.in; if it does not exist yet, make a copy
226yourself. Never edit Setup.in -- always edit Setup. Read the
227comments in the file for information on what kind of edits you can
228make. When you have edited Setup, Makefile and config.c in Modules
229will automatically be rebuilt the next time you run make in the
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000230toplevel directory. (When working inside the Modules directory, use
231"make Makefile; make".)
Guido van Rossum627b2d71993-12-24 10:39:16 +0000232
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000233The default collection of modules should build on any Unix system, but
234many optional modules should work on all modern Unices (e.g. try dbm,
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000235nis, termios, timing, syslog, curses, new, soundex, parser). Often
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000236the quickest way to determine whether a particular module works or not
237is to see if it will build: enable it in Setup, then if you get
238compilation or link errors, disable it -- you're missing support.
239
240On SGI IRIX, there are modules that interface to many SGI specific
241system libraries, e.g. the GL library and the audio hardware.
242
243For SunOS and Solaris, enable module "sunaudiodev" to support the
244audio device.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000245
Guido van Rossum4462e931997-01-22 21:00:32 +0000246In addition to the file Setup, you can also edit the file Setup.local.
247(the makesetup script processes both). You may find it more
248convenient to edit Setup.local and leave Setup alone. Then, when
249installing a new Python version, you can copy your old Setup.local
250file.
251
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000252
253Setting the optimization/debugging options
254------------------------------------------
255
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000256If you want or need to change the optimization/debugging options for
257the C compiler, assign to the OPT variable on the toplevel make
258command; e.g. "make OPT=-g" will build a debugging version of Python
259on most platforms. The default is OPT=-O; a value for OPT in the
260environment when the configure script is run overrides this default
261(likewise for CC; and the initial value for LIBS is used as the base
262set of libraries to link with).
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000263
264
265Testing
266-------
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000267
268To test the interpreter that you have just built, type "make test".
Guido van Rossum6ae5d3d1997-05-14 21:39:05 +0000269This runs the test set twice (once with no compiled files, once with
270the compiled files left by the previous test run). The test set
271produces some output. You can generally ignore the messages about
272skipped tests due to an optional feature that can't be imported (if
273you want to test those modules, edit Modules/Setup to configure them).
274If a messages is printed about a failed test or a traceback or core
275dump is produced, something's wrong. On some systems, test_strftime
276fails due to a non-standard implementation of strftime() in the C
277library. This can be ignored (or you can complain to your vendor).
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000278
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000279IMPORTANT: If the tests fail and you decide to mail a bug report,
280*don't* include the output of "make test". It is useless. Run the
Guido van Rossum6ae5d3d1997-05-14 21:39:05 +0000281test that fails manually, as follows:
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000282
Guido van Rossum6ae5d3d1997-05-14 21:39:05 +0000283 python ../Lib/test/test_whatever.py
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000284
285(substituting the top of the source tree for .. if you built in a
Guido van Rossum6ae5d3d1997-05-14 21:39:05 +0000286different directory). This runs the test in verbose mode.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000287
288
289Installing
290----------
291
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000292Installing Python was never this easy!
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000293
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000294To install the Python binary, library modules, shared library modules
295(see below), include files, configuration files, and the manual page,
296just type "make install". This will install all platform-independent
297files in subdirectories the directory given with the --prefix option
298to configure or the 'prefix' Make variable (default /usr/local), and
299all binary and other platform-specific files in subdirectories if the
300directory given by --exec-prefix or the 'exec_prefix' Make variable
301(defaults to the --prefix directory). All subdirectories created will
302have Python's version number in their name, e.g. the library modules
Guido van Rossum33fde571997-05-09 02:40:09 +0000303are installed in "/usr/local/lib/python1.5/" by default. The Python
304binary is installed as "python1.5" and a hard link named "python" is
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000305created. The only file not installed with a version number in its
306name is the manual page, installed as "/usr/local/man/man1/python.1"
307by default.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000308
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000309If you have a previous installation of a pre-1.4 Python that you don't
310want to replace yet, use "make altinstall". This installs the same
311set of files as "make install" except it doesn't create the hard link
Guido van Rossum33fde571997-05-09 02:40:09 +0000312to "python1.5" named "python" and it doesn't install the manual page
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000313at all.
314
315The only thing you may have to install manually is the Python mode for
316Emacs. (But then again, more recent versions of Emacs may already
317have it!) This is the file Misc/python-mode.el; follow the
318instructions that came with Emacs for installation of site specific
319files.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000320
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000321
322Configuration options and variables
323-----------------------------------
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000324
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000325Some special cases are handled by passing options to the configure
326script.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000327
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000328WARNING: if you rerun the configure script with different options, you
329must run "make clean" before rebuilding. Exceptions to this rule:
330after changing --prefix or --exec-prefix, all you need to do is remove
331Modules/getpath.o; after changing --with-readline, just remove
Guido van Rossum4462e931997-01-22 21:00:32 +0000332Parser/myreadline.o (but if it doesn't seem to work, always try "make
333clean" before giving up or complaining!).
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000334
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000335--with(out)-gcc: The configure script uses gcc (the GNU C compiler) if
336 it finds it. If you don't want this, or if this compiler is
337 installed but broken on your platform, pass the option
338 --without-gcc. You can also pass "CC=cc" (or whatever the
339 name of the proper C compiler is) in the environment, but the
340 advantage of using --without-gcc is that this option is
341 remembered by the config.status script for its --recheck
342 option.
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000343
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000344--prefix, --exec-prefix: If you want to install the binaries and the
345 Python library somewhere else than in /usr/local/{bin,lib},
346 you can pass the option --prefix=DIRECTORY; the interpreter
347 binary will be installed as DIRECTORY/bin/python and the
348 library files as DIRECTORY/lib/python/*. If you pass
349 --exec-prefix=DIRECTORY (as well) this overrides the
350 installation prefix for architecture-dependent files (like the
351 interpreter binary). Note that --prefix=DIRECTORY also
352 affects the default module search path (sys.path), when
353 Modules/config.c is compiled. Passing make the option
354 prefix=DIRECTORY (and/or exec_prefix=DIRECTORY) overrides the
355 prefix set at configuration time; this may be more convenient
356 than re-running the configure script if you change your mind
357 about the install prefix...
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000358
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000359--with-readline: You can use the GNU readline library to improve the
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000360 interactive user interface. This gives you line editing and
361 command history when calling Python interactively. Unless GNU
362 readline is a standard part of your system (it is on Linux),
363 you need to configure build the GNU readline library before
364 running the configure script. Its sources are not distributed
365 with Python; you can ftp them from any GNU mirror site, or
366 from its home site:
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000367 ftp://slc2.ins.cwru.edu/pub/dist/readline-2.0.tar.gz (or
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000368 a higher version number -- using version 1.x is not
369 recommended).
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000370
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000371 A GPL-free version was posted to comp.sources.misc in volume
372 31 and is widely available from FTP archive sites, e.g.
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000373 ftp://gatekeeper.dec.com/.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000374
375 Pass the Python configure script the option
376 --with-readline=DIRECTORY where DIRECTORY is the absolute
377 pathname of the directory where you've built the readline
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000378 library. If GNU readline is a standard part of your system,
379 don't pass '=DIRECTORY'. Some hints on building and using the
380 readline library are in the FAQ (file Misc/FAQ).
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000381
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000382--with-thread: On most Unix systems, you can now use multiple threads.
Guido van Rossum4462e931997-01-22 21:00:32 +0000383 To enable this, pass --with-thread. (--with-threads is an
384 alias.) If the library required for threads lives in a
Guido van Rossum8d90f9d1997-05-22 20:13:25 +0000385 peculiar place, you can use --with-thread=DIRECTORY. NOTE:
386 you must also enable the thread module by uncommenting it in
387 the Modules/Setup file. (Threads aren't enabled automatically
388 because there are run-time penalties when support for them is
389 compiled in even if you don't use them.) IMPORTANT: run "make
390 clean" after changing (either enabling or disabling) this
391 option! Note: for DEC Unix use --with-dec-threads instead.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000392
393--with-sgi-dl: On SGI IRIX 4, dynamic loading of extension modules is
394 supported by the "dl" library by Jack Jansen, which is
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000395 ftp'able from ftp://ftp.cwi.nl/pub/dynload/dl-1.6.tar.Z.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000396 This is enabled (after you've ftp'ed and compiled the dl
397 library!) by passing --with-sgi-dl=DIRECTORY where DIRECTORY
398 is the absolute pathname of the dl library. (Don't bother on
399 IRIX 5, it already has dynamic linking using SunOS style
400 shared libraries.) Support for this feature is deprecated.
401
402--with-dl-dld: Dynamic loading of modules is rumoured to be supported
403 on some other systems: VAX (Ultrix), Sun3 (SunOS 3.4), Sequent
404 Symmetry (Dynix), and Atari ST. This is done using a
405 combination of the GNU dynamic loading package
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000406 (ftp://ftp.cwi.nl/pub/dynload/dl-dld-1.1.tar.Z) and an
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000407 emulation of the SGI dl library mentioned above (the emulation
408 can be found at
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000409 ftp://ftp.cwi.nl/pub/dynload/dld-3.2.3.tar.Z). To
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000410 enable this, ftp and compile both libraries, then call the
411 configure passing it the option
412 --with-dl-dld=DL_DIRECTORY,DLD_DIRECTORY where DL_DIRECTORY is
413 the absolute pathname of the dl emulation library and
414 DLD_DIRECTORY is the absolute pathname of the GNU dld library.
415 (Don't bother on SunOS 4 or 5, they already have dynamic
416 linking using shared libraries.) Support for this feature is
417 deprecated.
418
419--with-libm, --with-libc: It is possible to specify alternative
420 versions for the Math library (default -lm) and the C library
421 (default the empty string) using the options
422 --with-libm=STRING and --with-libc=STRING, respectively. E.g.
423 if your system requires that you pass -lc_s to the C compiler
424 to use the shared C library, you can pass --with-libc=-lc_s.
425 These libraries are passed after all other libraries, the C
426 library last.
Guido van Rossum3ff96dd1996-07-30 18:05:04 +0000427
428--with-next-archs='arch1 arch2': Under NEXTSTEP, this will build
429 all compiled binaries with the architectures listed. Includes
430 correctly setting the target architecture specific resource
Guido van Rossumcc55c2d1996-10-21 15:14:27 +0000431 directory. (This option is not supported on other platforms.)
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000432
Guido van Rossumd02ba451996-07-31 17:36:01 +0000433--with-libs='libs': Add 'libs' to the LIBS that the python
434 linked against.
435
Guido van Rossum76be6ed1995-01-02 18:33:54 +0000436
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000437Building for multiple architectures (using the VPATH feature)
438-------------------------------------------------------------
439
440If your file system is shared between multiple architectures, it
441usually is not necessary to make copies of the sources for each
442architecture you want to support. If the make program supports the
443VPATH feature, you can create an empty build directory for each
444architecture, and in each directory run the configure script (on the
445appropriate machine with the appropriate options). This creates the
446necessary subdirectories and the Makefiles therein. The Makefiles
447contain a line VPATH=... which points to directory containing the
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000448actual sources. (On SGI systems, use "smake -J1" instead of "make" if
449you use VPATH -- don't try gnumake.)
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000450
451For example, the following is all you need to build a minimal Python
452in /usr/tmp/python (assuming ~guido/src/python is the toplevel
453directory and you want to build in /usr/tmp/python):
454
455 $ mkdir /usr/tmp/python
456 $ cd /usr/tmp/python
457 $ ~guido/src/python/configure
458 [...]
459 $ make
460 [...]
461 $
462
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000463Note that Modules/Makefile copies the original Setup file to the build
464directory if it finds no Setup file there. This means that you can
465edit the Setup file for each architecture independently. For this
466reason, subsequent changes to the original Setup file are not tracked
467automatically, as they might overwrite local changes. To force a copy
468of a changed original Setup file, delete the target Setup file. (The
469makesetup script supports multiple input files, so if you want to be
470fancy you can change the rules to create an empty Setup.local if it
471doesn't exist and run it with arguments $(srcdir)/Setup Setup.local;
472however this assumes that you only need to add modules.)
473
474
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000475Building on non-UNIX systems
476----------------------------
477
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000478Building Python for a PC is now a piece of cake!
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000479
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000480Enter the directory "PC" and read the file "readme.txt". Most popular
481non-Unix PC platforms and compilers are supported (Unix ports to the
482PC such as Linux, FreeBSD or Solaris-x86 of course use the standard
483Unix build instructions).
484
485For the Mac, a separate source distribution will be made available,
486for use with the CodeWarrior compiler. If you are interested in Mac
487development, join the PythonMac Special Interest Group
488(http://www.python.org/sigs/pythonmac-sig/, or send email to
489pythonmac-sig-request@python.org).
490
491Of course, there are also binary distributions available for these
492platforms -- see http://www.python.org/python/.
493
494To port Python to a new non-UNIX system, you will have to fake the
495effect of running the configure script manually (for Mac and PC, this
496has already been done for you). A good start is to copy the file
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000497config.h.in to config.h and edit the latter to reflect the actual
498configuration of your system. Most symbols must simply be defined as
4991 only if the corresponding feature is present and can be left alone
500otherwise; however RETSIGTYPE must always be defined, either as int or
501as void, and the *_t type symbols must be defined as some variant of
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000502int if they need to be defined at all.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000503
504
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000505
506Miscellaneous issues
507====================
508
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000509Documentation
510-------------
511
512All documentation is provided in the subdirectory Doc in the form of
513LaTeX files. In order of importance for new users: Tutorial (tut),
514Library Reference (lib), Language Reference (ref), Extending (ext).
515Especially the Library Reference is of immense value since much of
516Python's power (including the built-in data types and functions!) is
517described here.
518
Guido van Rossumdfcf35d1996-08-26 17:52:09 +0000519To print the documentation from the LaTeX files, chdir into the Doc
520subdirectory, type "make" (let's hope you have LaTeX installed!), and
521send the four resulting PostScript files (tut.ps, lib.ps, ref.ps, and
522ext.ps) to the printer. See the README file there. If you don't have
523LaTeX, you can ftp the PostScript files from the ftp archives (see
524below).
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000525
Guido van Rossumdfcf35d1996-08-26 17:52:09 +0000526All documentation is also available on-line via the Python web site
527(http://www.python.org/, see below). It can also be downloaded
528separately from the ftp archives (see below) in Emacs INFO, HTML or
529PostScript form -- see the web site or the FAQ (file Misc/FAQ) for
530more info.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000531
532
533Emacs mode
534----------
535
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000536There's an excellent Emacs editing mode for Python code; see the file
537Misc/python-mode.el. Originally written by Tim Peters, it is now
538maintained by Barry Warsaw <bwarsaw@cnri.reston.va.us>.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000539
540
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000541Web site
542--------
543
544Python's own web site has URL http://www.python.org/. Come visit us!
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000545There are a number of mirrors, listed on the home page -- try a mirror
546that's close you you.
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000547
548
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000549Ftp site
550--------
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000551
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000552Python's own ftp site is ftp.python.org, directory /pub/python. See
553the FAQ (file Misc/FAQ) for a list of other ftp sites carrying the
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000554Python distribution.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000555
556
557Newsgroup and mailing list
558--------------------------
559
Guido van Rossumdfcf35d1996-08-26 17:52:09 +0000560There are a newsgroup and a mailing list devoted to Python. The
561newsgroup, comp.lang.python, contains exactly the same messages as the
562mailing list (though not always in the same order, due to the
563mysterious nature of the Usenet news distribution algorithm). To
564subscribe to the mailing list, send mail containing your real name and
565e-mail address to "python-list-request@cwi.nl". Use the same address
566if you want to unsibscribed. (A real person reads these messages, so
567no LISTPROC or Majordomo commands, please, and please be patient --
568normal turn-around time is about one working day.)
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000569
Guido van Rossumdfcf35d1996-08-26 17:52:09 +0000570The Python web site contains a search form that lets you search the
571newsgroup archives (or the web site itself). Click on the "search"
572link in the banner menu on any page of http://www.python.org/.
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000573
574
575Bug reports
576-----------
577
Guido van Rossumdfcf35d1996-08-26 17:52:09 +0000578Bugs are best reported to the comp.lang.python newsgroup or the Python
Guido van Rossumcc55c2d1996-10-21 15:14:27 +0000579mailing list -- see the section "Newsgroup and mailing list" above.
Guido van Rossumdfcf35d1996-08-26 17:52:09 +0000580Before posting, check the newsgroup archives (see above) to see if
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000581your bug has already been reported!
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000582
583
584Questions
585---------
586
587For help, if you can't find it in the manuals, the FAQ or on the web
588site, it's best to post to the comp.lang.python or the Python mailing
589list (see above). If you specifically don't want to involve the
590newsgroup or mailing list, send questions to python-help@python.org.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000591
592
593The Tk interface
594----------------
595
596Tk (the user interface component of John Ousterhout's Tcl language) is
597also usable from Python. Since this requires that you first build and
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000598install Tcl/Tk, the Tk interface is not enabled by default. It works
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000599with Tcl 7.5 and Tk 4.1 as well as with Tcl 7.4 and Tk 4.0. I didn't
600have the time to test it with Tcl 7.6 and Tk 4.2 yet, but it might
601well work.
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000602
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000603See http://www.sunlabs.com/research/tcl/ for more info on where to get
Guido van Rossum33fde571997-05-09 02:40:09 +0000604Tcl/Tk. Also http://sunscript.sun.com/.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000605
606To enable the Python/Tk interface, once you've built and installed
607Tcl/Tk, all you need to do is edit two lines in Modules/Setup; search
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000608for the string "_tkinter". Uncomment one (normally the first) of the
609lines beginning with "#_tkinter" and un-comment the line beginning
610with "#TKPATH". If you have installed Tcl/Tk or X11 in unusual
611places, you will have to edit the first line to fix or add -I and -L
612options. See the Build Instructions above for more details.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000613
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000614There is little documentation on how to use Tkinter; however most of
615the Tk manual pages apply quite straightforwardly. Begin with
616fetching the "Tk Lifesaver" document,
617e.g. ftp://ftp.python.org/pub/python/doc/tkinter-doc.tar.gz (a gzipped
618tar file containing a PostScript file) or the on-line version
619http://www.python.org/doc/life-preserver/index.html. Reading the
620Tkinter.py source will reveal most details on how Tkinter calls are
621translated into Tcl code.
622
623There are demos in the Demo/tkinter directory, in the subdirectories
624guido, matt and www (the matt and guido subdirectories have been
625overhauled to use more recent Tkinter coding conventions).
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000626
627Note that there's a Python module called "Tkinter" (capital T) which
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000628lives in Lib/tkinter/Tkinter.py, and a C module called "_tkinter"
629(lower case t and leading underscore) which lives in
630Modules/_tkinter.c. Demos and normal Tk applications only import the
631Python Tkinter module -- only the latter uses the C _tkinter module
632directly. In order to find the C _tkinter module, it must be compiled
633and linked into the Python interpreter -- the _tkinter line in the
634Setup file does this. In order to find the Python Tkinter module,
635sys.path must be set correctly -- the TKPATH assignment in the Setup
636file takes care of this, but only if you install Python properly
637("make install libinstall"). (You can also use dynamic loading for
638the C _tkinter module, in which case you must manually fix up sys.path
639or set $PYTHONPATH for the Python Tkinter module.)
Guido van Rossum84c8c7f1995-08-28 02:44:24 +0000640
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000641
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000642Distribution structure
643----------------------
644
645Most subdirectories have their own README file. Most files have
646comments.
647
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000648BUGS A list of known bugs (not completely up-to-date)
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000649Demo/ Demonstration scripts, modules and programs
650Doc/ Documentation (LaTeX sources)
651Grammar/ Input for the parser generator
652Include/ Public header files
653Lib/ Python library modules
654Makefile.in Source from which config.status creates Makefile
655Misc/ Miscellaneous files
656Modules/ Implementation of most built-in modules
657Objects/ Implementation of most built-in object types
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000658PC/ PC porting files (DOS, Windows, NT, OS/2)
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000659Parser/ The parser and tokenizer and their input handling
660Python/ The "compiler" and interpreter
661README The file you're reading now
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000662TODO A list of things that could be done (not up-to-date)
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000663Tools/ Some useful programs written in Python
664acconfig.h Additional input for the autoheader program
665config.h.in Source from which config.status creates config.h
666configure Configuration shell script (GNU autoconf output)
667configure.in Configuration specification (GNU autoconf input)
668install-sh Shell script used to install files
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000669
670The following files will (may) be created in the toplevel directory by
671the configuration and build processes:
672
Guido van Rossum6d9cc801996-08-01 17:31:22 +0000673Makefile Build rules
674config.cache cache of configuration variables
675config.h Configuration header
676config.log log from last configure run
677config.status status from last run of configure script
678python The executable interpreter
679tags, TAGS Tags files for vi and Emacs
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000680
681
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000682Author's address
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000683================
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000684
685Guido van Rossum
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000686CNRI
6871895 Preston White Drive
Guido van Rossum8d7d4ed1996-07-30 21:41:07 +0000688Reston, VA 20191
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000689USA
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000690
Guido van Rossumd0fe8451996-08-26 03:02:37 +0000691E-mail: guido@cnri.reston.va.us or guido@python.org
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000692
693
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000694
695Copyright notice
696================
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000697
698The Python source is copyrighted, but you can freely use and copy it
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000699as long as you don't change or remove the copyright notice:
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000700
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000701----------------------------------------------------------------------
Guido van Rossumaf5b83e1995-01-04 19:02:35 +0000702Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
703The Netherlands.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000704
705 All Rights Reserved
706
Guido van Rossumc561e5d1994-08-23 13:52:46 +0000707Permission to use, copy, modify, and distribute this software and its
708documentation for any purpose and without fee is hereby granted,
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000709provided that the above copyright notice appear in all copies and that
Guido van Rossumc561e5d1994-08-23 13:52:46 +0000710both that copyright notice and this permission notice appear in
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000711supporting documentation, and that the names of Stichting Mathematisch
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000712Centrum or CWI or Corporation for National Research Initiatives or
713CNRI not be used in advertising or publicity pertaining to
714distribution of the software without specific, written prior
715permission.
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000716
Guido van Rossumf501b4e1996-10-25 14:32:48 +0000717While CWI is the initial source for this software, a modified version
718is made available by the Corporation for National Research Initiatives
719(CNRI) at the Internet address ftp://ftp.python.org.
720
721STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
722REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
723MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
724CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
725DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
726PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
727TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
728PERFORMANCE OF THIS SOFTWARE.
Guido van Rossum91cb9d21995-04-10 11:47:38 +0000729----------------------------------------------------------------------
Guido van Rossum433c8ad1994-08-01 12:07:07 +0000730
731
Guido van Rossumfaf681a1996-06-20 14:32:08 +0000732--Guido van Rossum (home page: http://www.python.org/~guido/)