Guido van Rossum | 462a549 | 1998-04-10 21:36:04 +0000 | [diff] [blame] | 1 | This is Python release 1.5.1 |
| 2 | ============================ |
Guido van Rossum | faf681a | 1996-06-20 14:32:08 +0000 | [diff] [blame] | 3 | |
Guido van Rossum | 462a549 | 1998-04-10 21:36:04 +0000 | [diff] [blame] | 4 | This version is officially released on Tuesday, April 14, 1997. It is |
| 5 | mostly a bugfix release on Python 1.5. |
Guido van Rossum | 7980826 | 1997-12-11 18:01:47 +0000 | [diff] [blame] | 6 | |
| 7 | |
Guido van Rossum | 8d7d4ed | 1996-07-30 21:41:07 +0000 | [diff] [blame] | 8 | What's new in this release? |
| 9 | --------------------------- |
Guido van Rossum | 3ff96dd | 1996-07-30 18:05:04 +0000 | [diff] [blame] | 10 | |
Guido van Rossum | 462a549 | 1998-04-10 21:36:04 +0000 | [diff] [blame] | 11 | See the Misc/NEWS file. Nothing spectacular this time, only small |
| 12 | changes (as you would expect from a release called "1.5.1"). |
Guido van Rossum | 33fde57 | 1997-05-09 02:40:09 +0000 | [diff] [blame] | 13 | |
Guido van Rossum | 462a549 | 1998-04-10 21:36:04 +0000 | [diff] [blame] | 14 | One big organizational change: the documentation sources have been |
| 15 | unbundled. We will release a version of the Doc subtree separately, |
| 16 | but probably not simultaneously with the source release. |
Guido van Rossum | 6477380 | 1997-11-26 17:07:02 +0000 | [diff] [blame] | 17 | |
Guido van Rossum | 6477380 | 1997-11-26 17:07:02 +0000 | [diff] [blame] | 18 | |
| 19 | If you don't read instructions |
| 20 | ------------------------------ |
| 21 | |
| 22 | Congratulations on getting this far. :-) |
| 23 | |
| 24 | To start building right away (on UNIX): type "./configure" in the |
| 25 | current directory and when it finishes, type "make". The section |
| 26 | Build Instructions below is still recommended reading. :-) |
Guido van Rossum | 3ff96dd | 1996-07-30 18:05:04 +0000 | [diff] [blame] | 27 | |
| 28 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 29 | What is Python anyway? |
| 30 | ---------------------- |
| 31 | |
| 32 | Python is an interpreted object-oriented programming language, and is |
Guido van Rossum | c0be2f5 | 1997-10-08 05:05:28 +0000 | [diff] [blame] | 33 | often compared to Tcl, Perl, Java or Scheme. To find out more, point |
| 34 | your browser to http://www.python.org/. |
| 35 | |
| 36 | |
| 37 | A modest plug |
| 38 | ------------- |
| 39 | |
| 40 | ************************************************************************ |
| 41 | * Without your support, I won't be able to continue to work on Python! * |
| 42 | ************************************************************************ |
| 43 | |
| 44 | If you use Python, please consider joining the Python Software |
| 45 | Activity (PSA). See http://www.python.org/psa/. |
| 46 | |
| 47 | Organizations that make heavy use of Python are especially encouraged |
| 48 | to become corporate members! |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 49 | |
| 50 | |
Guido van Rossum | f501b4e | 1996-10-25 14:32:48 +0000 | [diff] [blame] | 51 | How do I learn Python? |
| 52 | ---------------------- |
| 53 | |
| 54 | The official tutorial is still a good place to start (in the Doc |
| 55 | directory as tut.tex; and http://www.python.org/doc/tut/tut.html). |
| 56 | Aaron Watters wrote a second tutorial, that may be more accessible for |
Guido van Rossum | c0be2f5 | 1997-10-08 05:05:28 +0000 | [diff] [blame] | 57 | some: http://www.wcmh.com/uworld/archives/95/tutorial/005.html. Both |
| 58 | tutorials (as well as most other sources) assume that you already know |
| 59 | how to program -- if you'd like to write "Python for Dummies", I know |
| 60 | a publisher who would like to talk to you... |
Guido van Rossum | f501b4e | 1996-10-25 14:32:48 +0000 | [diff] [blame] | 61 | |
Guido van Rossum | 8d90f9d | 1997-05-22 20:13:25 +0000 | [diff] [blame] | 62 | There are now also several books on Python. While these are still |
Guido van Rossum | c0be2f5 | 1997-10-08 05:05:28 +0000 | [diff] [blame] | 63 | based on Python 1.3 or 1.4, the information in them is still 99% |
| 64 | correct. The first two books, both first published in October 1996 |
| 65 | and both including a CD-ROM, form excellent companions to each other: |
Guido van Rossum | f501b4e | 1996-10-25 14:32:48 +0000 | [diff] [blame] | 66 | |
| 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 Rossum | c0be2f5 | 1997-10-08 05:05:28 +0000 | [diff] [blame] | 77 | If you can read German, try: |
Guido van Rossum | 8d90f9d | 1997-05-22 20:13:25 +0000 | [diff] [blame] | 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 Rossum | f501b4e | 1996-10-25 14:32:48 +0000 | [diff] [blame] | 84 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 85 | Copyright issues |
| 86 | ---------------- |
| 87 | |
| 88 | Python is COPYRIGHTED but free to use for all. See the full copyright |
Guido van Rossum | 6477380 | 1997-11-26 17:07:02 +0000 | [diff] [blame] | 89 | notice at the end of this file and in the file Misc/COPYRIGHT. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 90 | |
| 91 | The Python distribution is *not* affected by the GNU Public Licence |
| 92 | (GPL). There are interfaces to some GNU code but these are entirely |
Guido van Rossum | 6477380 | 1997-11-26 17:07:02 +0000 | [diff] [blame] | 93 | optional and no GNU code is distributed with Python. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 94 | |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 95 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 96 | Build instructions |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 97 | ================== |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 98 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 99 | Before you can build Python, you must first configure it. |
| 100 | Fortunately, the configuration and build process has been streamlined |
| 101 | for most Unix installations, so all you have to do is type a few |
| 102 | commands, optionally edit one file, and sit back. There are some |
| 103 | platforms where things are not quite as smooth; see the platform |
| 104 | specific notes below. If you want to build for multiple platforms |
| 105 | sharing the same source tree, see the section on VPATH below. |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 106 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 107 | You start by running the script "./configure", which figures out your |
| 108 | system configuration and creates several Makefiles. (It takes a |
| 109 | minute or two -- please be patient!) When it's done, you are ready to |
| 110 | run make. You may want to pass options to the configure script -- see |
| 111 | the section below on configuration options and variables. |
| 112 | |
| 113 | To build Python, you normally type "make" in the toplevel directory. |
| 114 | This will recursively run make in each of the subdirectories Parser, |
| 115 | Objects, Python and Modules, creating a library file in each one. The |
| 116 | executable of the interpreter is built in the Modules subdirectory and |
| 117 | moved up here when it is built. If you want or need to, you can also |
| 118 | chdir into each subdirectory in turn and run make there manually (do |
| 119 | the Modules subdirectory last!). |
| 120 | |
| 121 | Once you have built an interpreter, see the subsections below on |
| 122 | testing, configuring additional modules, and installation. If you run |
| 123 | in trouble, see the next section. |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 124 | |
Guido van Rossum | 0a516c9 | 1994-09-12 10:58:40 +0000 | [diff] [blame] | 125 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 126 | Troubleshooting |
| 127 | --------------- |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 128 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 129 | See also the platform specific notes in the next section. |
| 130 | |
Guido van Rossum | faf681a | 1996-06-20 14:32:08 +0000 | [diff] [blame] | 131 | If recursive makes fail, try invoking make as "make MAKE=make". |
| 132 | |
Guido van Rossum | 4952369 | 1997-08-15 18:30:14 +0000 | [diff] [blame] | 133 | If you run into other trouble, see section 3 of the FAQ |
| 134 | (http://grail.cnri.reston.va.us/cgi-bin/faqw.py or |
| 135 | http://www.python.org/doc/FAQ.html) for hints on what can go wrong, |
| 136 | and how to fix it. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 137 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 138 | If you rerun the configure script with different options, remove all |
| 139 | object files by running "make clean" before rebuilding. Believe it or |
| 140 | not, "make clean" sometimes helps to clean up other inexplicable |
| 141 | problems as well. Try it before sending in a bug report! |
| 142 | |
Guido van Rossum | d0fe845 | 1996-08-26 03:02:37 +0000 | [diff] [blame] | 143 | If the configure script fails or doesn't seem to find things that |
Guido van Rossum | c0be2f5 | 1997-10-08 05:05:28 +0000 | [diff] [blame] | 144 | should be there, inspect the config.log file. When you fix a |
| 145 | configure problem, be sure to remove config.cache! |
| 146 | |
| 147 | If you get a warning for every file about the -Olimit option being no |
| 148 | longer supported, you can ignore it. There's no foolproof way to know |
| 149 | whether this option is needed; all I can do is test whether it is |
| 150 | accepted without error. On some systems, e.g. older SGI compilers, it |
| 151 | is essential for performance (specifically when compiling ceval.c, |
| 152 | which has more basic blocks than the default limit of 1000). If the |
| 153 | warning bothers you, edit the Makefile to remove "-Olimit 1500" from |
| 154 | the OPT variable. |
Guido van Rossum | d0fe845 | 1996-08-26 03:02:37 +0000 | [diff] [blame] | 155 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 156 | |
| 157 | Platform specific notes |
| 158 | ----------------------- |
| 159 | |
Guido van Rossum | 0447a32 | 1995-10-08 01:22:33 +0000 | [diff] [blame] | 160 | (Some of these may no longer apply. If you find you can build Python |
| 161 | on these platforms without the special directions mentioned here, let |
| 162 | me know so I can remove them!) |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 163 | |
Guido van Rossum | c0be2f5 | 1997-10-08 05:05:28 +0000 | [diff] [blame] | 164 | 64-bit platforms: The modules audioop, imageop and rgbimg don't work. |
| 165 | Don't try to enable them in the Modules/Setup file. They |
| 166 | contain code that is quite wordsize sensitive. (If you have a |
| 167 | fix, let me know!) |
| 168 | |
Guido van Rossum | 4462e93 | 1997-01-22 21:00:32 +0000 | [diff] [blame] | 169 | Solaris: When using Sun's C compiler with threads, at least on Solaris |
| 170 | 2.5.1, you need to add the "-mt" compiler option (the simplest |
| 171 | way is probably to specify the compiler with this option as |
| 172 | the "CC" environment variable when running the configure |
| 173 | script). |
| 174 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 175 | Linux: On Linux version 1.x, once you've built Python, use it to run |
| 176 | the regen script in the Lib/linux1 directory. Apparently |
| 177 | the files as distributed don't match the system headers on |
| 178 | some Linux versions. (The "h2py" command refers to |
| 179 | Tools/scripts/h2py.py.) The modules distributed for Linux 2.x |
Guido van Rossum | d0fe845 | 1996-08-26 03:02:37 +0000 | [diff] [blame] | 180 | should be okay. Shared library support now works by default |
Guido van Rossum | 4462e93 | 1997-01-22 21:00:32 +0000 | [diff] [blame] | 181 | on ELF-based x86 Linux systems. (Note: when you change the |
| 182 | status of a module from static to shared, you must remove its |
| 183 | .o file or do a "make clean".) |
| 184 | |
Fred Drake | 6128091 | 1997-12-08 14:10:40 +0000 | [diff] [blame] | 185 | Under RedHat Linux 5.0, if upgraded from a previous version, |
| 186 | remove the LinuxThreads packages. This is needed because |
| 187 | LinuxThreads conflicts with the new thread support provided by |
| 188 | glibc. Before running Python's configure script, use the |
| 189 | following commands as root (version numbers may differ; these |
| 190 | are from a stock 4.2 install): |
| 191 | |
| 192 | % rpm -qa | grep ^linuxthread |
| 193 | linuxthreads-0.5-1 |
| 194 | linuxthreads-devel-0.5-1 |
| 195 | % rpm -e linuxthreads linuxthreads-devel |
| 196 | |
| 197 | While Python only needs this to be done to allow thread |
| 198 | support to be included, the conflicts these packages create |
| 199 | with the new glibc may cause other packages which use threads |
| 200 | to fail as well, so their removal is a good idea regardless of |
| 201 | how you configure python. |
| 202 | |
| 203 | Also under RedHat Linux 5.0, the crypt module now needs the |
| 204 | -lcrypt option. Uncomment this flag in Modules/Setup, or |
| 205 | comment out the crypt module in the same file. |
| 206 | |
Guido van Rossum | 6ae5d3d | 1997-05-14 21:39:05 +0000 | [diff] [blame] | 207 | DEC Unix: When enabling threads, use --with-dec-threads, not |
Guido van Rossum | 9ac9a26 | 1998-02-16 22:19:21 +0000 | [diff] [blame] | 208 | --with-thread. When using GCC, it is possible to get an |
| 209 | internal compiler error if optimization is used. This was |
| 210 | reported for GCC 2.7.2.3 on selectmodule.c. Manually compile |
| 211 | the affected file without optimization to solve the problem. |
Guido van Rossum | 8eca2c2 | 1996-02-14 18:37:46 +0000 | [diff] [blame] | 212 | |
Guido van Rossum | d0fe845 | 1996-08-26 03:02:37 +0000 | [diff] [blame] | 213 | AIX: A complete overhaul of the shared library support is now in |
Guido van Rossum | cbfcb17 | 1997-10-20 22:57:00 +0000 | [diff] [blame] | 214 | place. See Misc/AIX-NOTES for some notes on how it's done. |
Guido van Rossum | 9ac9a26 | 1998-02-16 22:19:21 +0000 | [diff] [blame] | 215 | (The optimizer bug reported at this place in previous releases |
| 216 | has been worked around by a minimal code change.) |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 217 | |
Guido van Rossum | 2094e04 | 1998-05-14 15:47:35 +0000 | [diff] [blame^] | 218 | HP-UX: Please read the file Misc/HPUX-NOTES. |
| 219 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 220 | Minix: When using ack, use "CC=cc AR=aal RANLIB=: ./configure"! |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 221 | |
Guido van Rossum | a16e275 | 1998-04-13 20:14:05 +0000 | [diff] [blame] | 222 | SCO: The following only apply to SCO 3; Python builds out of the box |
| 223 | on SCO 5 (or so I've heard). |
| 224 | |
| 225 | 1) Everything works much better if you add -U__STDC__ to the |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 226 | defs. This is because all the SCO header files are broken. |
Guido van Rossum | 6477380 | 1997-11-26 17:07:02 +0000 | [diff] [blame] | 227 | Anything that isn't mentioned in the C standard is |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 228 | conditionally excluded when __STDC__ is defined. |
| 229 | |
| 230 | 2) Due to the U.S. export restrictions, SCO broke the crypt |
| 231 | stuff out into a separate library, libcrypt_i.a so the LIBS |
| 232 | needed be set to: |
| 233 | |
| 234 | LIBS=' -lsocket -lcrypt_i' |
| 235 | |
Guido van Rossum | a16e275 | 1998-04-13 20:14:05 +0000 | [diff] [blame] | 236 | SunOS 4.x: When using the standard "cc" compiler, certain modules may |
Guido van Rossum | 6477380 | 1997-11-26 17:07:02 +0000 | [diff] [blame] | 237 | not be compilable because they use non-K&R syntax. You should |
| 238 | be able to get a basic Python interpreter by commenting out |
| 239 | such modules in the Modules/Setup file, but I really recommend |
| 240 | using gcc. |
| 241 | |
| 242 | When using the SunPro C compiler, you may want to use the |
| 243 | '-Xa' option instead of '-Xc', to enable some needed non-ANSI |
| 244 | Sunisms. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 245 | |
Guido van Rossum | cc55c2d | 1996-10-21 15:14:27 +0000 | [diff] [blame] | 246 | NeXT: To build fat binaries, use the --with-next-archs switch |
| 247 | described below. |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 248 | |
Guido van Rossum | b7f454d | 1997-12-02 19:44:31 +0000 | [diff] [blame] | 249 | QNX: Chris Herborth (chrish@qnx.com) writes: |
| 250 | configure works best if you use GNU bash; a port is available on |
| 251 | ftp.qnx.com in /usr/free. I used the following process to build, |
| 252 | test and install Python 1.5 under QNX: |
| 253 | |
Guido van Rossum | b1d368c | 1997-12-17 21:08:34 +0000 | [diff] [blame] | 254 | 1) SHELL=/usr/local/bin/bash CC=cc CFLAGS="-5 -O" RANLIB=: \ |
Guido van Rossum | b7f454d | 1997-12-02 19:44:31 +0000 | [diff] [blame] | 255 | bash ./configure --verbose --without-gcc --with-libm="" |
| 256 | |
| 257 | 2) copy Modules/Setup.in to Modules/Setup; edit Modules/Setup to |
| 258 | activate everything that makes sense for your system... tested |
| 259 | here at QNX with the following modules: |
| 260 | |
| 261 | regex reop pcre posix signal readline array cmath math strop |
| 262 | struct time operator _locale fcntl pwd grp crypt select socket |
| 263 | errno termios audioop imageop rgbimg md5 timing rotor syslog |
Guido van Rossum | b1d368c | 1997-12-17 21:08:34 +0000 | [diff] [blame] | 264 | new gdbm soundex binascii parser cStringIO cPickle zlib curses |
Guido van Rossum | b7f454d | 1997-12-02 19:44:31 +0000 | [diff] [blame] | 265 | |
| 266 | 3) SHELL=/usr/local/bin/bash make SHELL=/usr/local/bin/bash |
| 267 | |
| 268 | 4) SHELL=/usr/local/bin/bash make SHELL=/usr/local/bin/bash test |
| 269 | |
| 270 | The socket, strftime and possibly gdbm tests might fail in the |
| 271 | test harness; going through them by hand shows that they work. |
| 272 | A good exercise for the reader: make these work "out of the box". |
| 273 | |
| 274 | 5) SHELL=/usr/local/bin/bash make SHELL=/usr/local/bin/bash install |
| 275 | |
| 276 | If you get SIGSEGVs while running Python (I haven't yet, but I've |
| 277 | only run small programs and the test cases), you're probably running |
| 278 | out of stack; the default 32k could be a little tight. To increase |
| 279 | the stack size, edit the Makefile in the Modules directory to read: |
Guido van Rossum | 40d6358 | 1997-08-14 19:45:30 +0000 | [diff] [blame] | 280 | LDFLAGS = -N 48k |
| 281 | |
Guido van Rossum | 1bf0bf4 | 1997-08-20 23:50:51 +0000 | [diff] [blame] | 282 | Cray T3E: Konrad Hinsen writes: |
| 283 | 1) Don't use gcc. It compiles Python/graminit.c into something that |
| 284 | the Cray assembler doesn't like. Cray's cc seems to work fine. |
| 285 | 2) Uncomment modules md5 (won't compile) and audioop (will crash |
| 286 | the interpreter during the test suite). |
| 287 | If you run the test suite, two tests will fail (rotate and binascii), |
| 288 | but these are not the modules you'd expect to need on a Cray. |
| 289 | |
Guido van Rossum | 0078aaf | 1997-08-21 03:05:11 +0000 | [diff] [blame] | 290 | SGI: SGI's standard "make" utility (/bin/make or /usr/bin/make) |
| 291 | does not check whether a command actually changed the file it |
| 292 | is supposed to build. This means that whenever you say "make" |
| 293 | it will redo the link step. The remedy is to use SGI's much |
Guido van Rossum | c0be2f5 | 1997-10-08 05:05:28 +0000 | [diff] [blame] | 294 | smarter "smake " utility (/usr/sbin/smake), or GNU make. If |
| 295 | you set the first line of the Makefile to #!/usr/sbin/smake |
| 296 | smake will be invoked by make (likewise for GNU make). |
Guido van Rossum | 0078aaf | 1997-08-21 03:05:11 +0000 | [diff] [blame] | 297 | |
Guido van Rossum | 9ac9a26 | 1998-02-16 22:19:21 +0000 | [diff] [blame] | 298 | A bug in the MIPSpro 7.1 compiler's optimizer seems to break |
| 299 | Modules/pypcre.c. The short term solution is to compile it |
| 300 | without optimization. The bug appears to be fixed in version |
| 301 | 7.2.1 of the compiler. |
| 302 | |
Guido van Rossum | 6477380 | 1997-11-26 17:07:02 +0000 | [diff] [blame] | 303 | OS/2: If you are running Warp3 or Warp4 and have IBM's VisualAge C/C++ |
| 304 | compiler installed, just change into the pc\os2vacpp directory |
| 305 | and type NMAKE. Threading and sockets are supported by default |
| 306 | in the resulting binaries of PYTHON15.DLL and PYTHON.EXE. |
| 307 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 308 | |
Guido van Rossum | dc8a3cb | 1998-05-12 15:29:18 +0000 | [diff] [blame] | 309 | Configuring threads |
| 310 | ------------------- |
| 311 | |
| 312 | The main switch to configure threads is to run the configure script |
| 313 | (see below) with the --with-thread switch (on DEC, use |
| 314 | --with-dec-threads). Unfortunately, on some platforms, additional |
| 315 | compiler and/or linker options are required. Below is a table of |
| 316 | those options, collected by Bill Janssen. I would love to automate |
| 317 | this process more, but the information below is not enough to write a |
| 318 | patch for the configure.in file, so manual intervention is required. |
| 319 | If you patch the configure.in file and are confident that the patch |
| 320 | works, please send me the patch. (Don't bother patching the configure |
| 321 | script itself -- it is regenerated each the configure.in file |
| 322 | changes.) |
| 323 | |
| 324 | Compiler switches for threads |
| 325 | ............................. |
| 326 | |
| 327 | OS/Compiler/threads Switches for use with threads |
| 328 | (POSIX is draft 10, DCE is draft 4) (1) compile only (2) compile & link |
| 329 | |
| 330 | SunOS 5.{1-5}/{gcc,SunPro cc}/solaris (1) -D_REENTRANT (2) -mt |
| 331 | SunOS 5.5/{gcc,SunPro cc}/POSIX (1) -D_REENTRANT |
| 332 | DEC OSF/1 3.x/cc/DCE (1) -D_REENTRANT (2) -threads |
| 333 | (butenhof@zko.dec.com) |
| 334 | Digital UNIX 4.x/cc/DCE (1) -D_REENTRANT (2) -threads |
| 335 | (butenhof@zko.dec.com) |
| 336 | Digital UNIX 4.x/cc/POSIX (1) -D_REENTRANT (2) -pthread |
| 337 | (butenhof@zko.dec.com) |
| 338 | AIX 4.1.4/cc_r/d7 (nothing) |
| 339 | (buhrt@iquest.net) |
| 340 | AIX 4.1.4/cc_r4/DCE (nothing) |
| 341 | (buhrt@iquest.net) |
| 342 | IRIX 6.2/cc/POSIX (nothing) |
| 343 | (robertl@cwi.nl) |
| 344 | |
| 345 | |
| 346 | Linker (ld) libraries and flags for threads |
| 347 | ........................................... |
| 348 | |
| 349 | OS/threads Libraries/switches for use with threads |
| 350 | |
| 351 | SunOS 5.{1-5}/solaris -lthread |
| 352 | SunOS 5.5/POSIX -lpthread |
| 353 | DEC OSF/1 3.x/DCE -lpthreads -lmach -lc_r -lc |
| 354 | (butenhof@zko.dec.com) |
| 355 | Digital UNIX 4.x/DCE -lpthreads -lpthread -lmach -lexc -lc |
| 356 | (butenhof@zko.dec.com) |
| 357 | Digital UNIX 4.x/POSIX -lpthread -lmach -lexc -lc |
| 358 | (butenhof@zko.dec.com) |
| 359 | AIX 4.1.4/{draft7,DCE} (nothing) |
| 360 | (buhrt@iquest.net) |
| 361 | IRIX 6.2/POSIX -lpthread |
| 362 | (jph@emilia.engr.sgi.com) |
| 363 | |
| 364 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 365 | Configuring additional built-in modules |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 366 | --------------------------------------- |
Guido van Rossum | 19e0c26 | 1995-01-17 16:36:34 +0000 | [diff] [blame] | 367 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 368 | You can configure the interpreter to contain fewer or more built-in |
| 369 | modules by editing the file Modules/Setup. This file is initially |
| 370 | copied (when the toplevel Makefile makes Modules/Makefile for the |
| 371 | first time) from Setup.in; if it does not exist yet, make a copy |
| 372 | yourself. Never edit Setup.in -- always edit Setup. Read the |
| 373 | comments in the file for information on what kind of edits you can |
| 374 | make. When you have edited Setup, Makefile and config.c in Modules |
| 375 | will automatically be rebuilt the next time you run make in the |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 376 | toplevel directory. (When working inside the Modules directory, use |
| 377 | "make Makefile; make".) |
Guido van Rossum | 627b2d7 | 1993-12-24 10:39:16 +0000 | [diff] [blame] | 378 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 379 | The default collection of modules should build on any Unix system, but |
| 380 | many optional modules should work on all modern Unices (e.g. try dbm, |
Guido van Rossum | d0fe845 | 1996-08-26 03:02:37 +0000 | [diff] [blame] | 381 | nis, termios, timing, syslog, curses, new, soundex, parser). Often |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 382 | the quickest way to determine whether a particular module works or not |
| 383 | is to see if it will build: enable it in Setup, then if you get |
| 384 | compilation or link errors, disable it -- you're missing support. |
| 385 | |
| 386 | On SGI IRIX, there are modules that interface to many SGI specific |
| 387 | system libraries, e.g. the GL library and the audio hardware. |
| 388 | |
| 389 | For SunOS and Solaris, enable module "sunaudiodev" to support the |
| 390 | audio device. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 391 | |
Guido van Rossum | 4462e93 | 1997-01-22 21:00:32 +0000 | [diff] [blame] | 392 | In addition to the file Setup, you can also edit the file Setup.local. |
| 393 | (the makesetup script processes both). You may find it more |
| 394 | convenient to edit Setup.local and leave Setup alone. Then, when |
| 395 | installing a new Python version, you can copy your old Setup.local |
| 396 | file. |
| 397 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 398 | |
| 399 | Setting the optimization/debugging options |
| 400 | ------------------------------------------ |
| 401 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 402 | If you want or need to change the optimization/debugging options for |
| 403 | the C compiler, assign to the OPT variable on the toplevel make |
| 404 | command; e.g. "make OPT=-g" will build a debugging version of Python |
| 405 | on most platforms. The default is OPT=-O; a value for OPT in the |
| 406 | environment when the configure script is run overrides this default |
| 407 | (likewise for CC; and the initial value for LIBS is used as the base |
| 408 | set of libraries to link with). |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 409 | |
| 410 | |
| 411 | Testing |
| 412 | ------- |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 413 | |
| 414 | To test the interpreter that you have just built, type "make test". |
Guido van Rossum | 6ae5d3d | 1997-05-14 21:39:05 +0000 | [diff] [blame] | 415 | This runs the test set twice (once with no compiled files, once with |
| 416 | the compiled files left by the previous test run). The test set |
| 417 | produces some output. You can generally ignore the messages about |
| 418 | skipped tests due to an optional feature that can't be imported (if |
| 419 | you want to test those modules, edit Modules/Setup to configure them). |
| 420 | If a messages is printed about a failed test or a traceback or core |
Guido van Rossum | 24df684 | 1997-12-30 04:32:30 +0000 | [diff] [blame] | 421 | dump is produced, something's wrong. On some Linux systems (those |
| 422 | that are not yet using glibc 6), test_strftime fails due to a |
| 423 | non-standard-compliant implementation of strftime() in the C library. |
| 424 | Please ignore this, or upgrade to glibc version 6. |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 425 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 426 | IMPORTANT: If the tests fail and you decide to mail a bug report, |
| 427 | *don't* include the output of "make test". It is useless. Run the |
Guido van Rossum | 6ae5d3d | 1997-05-14 21:39:05 +0000 | [diff] [blame] | 428 | test that fails manually, as follows: |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 429 | |
Guido van Rossum | 6ae5d3d | 1997-05-14 21:39:05 +0000 | [diff] [blame] | 430 | python ../Lib/test/test_whatever.py |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 431 | |
| 432 | (substituting the top of the source tree for .. if you built in a |
Guido van Rossum | 6ae5d3d | 1997-05-14 21:39:05 +0000 | [diff] [blame] | 433 | different directory). This runs the test in verbose mode. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 434 | |
| 435 | |
| 436 | Installing |
| 437 | ---------- |
| 438 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 439 | To install the Python binary, library modules, shared library modules |
| 440 | (see below), include files, configuration files, and the manual page, |
Guido van Rossum | 6477380 | 1997-11-26 17:07:02 +0000 | [diff] [blame] | 441 | just type |
| 442 | |
| 443 | make install |
| 444 | |
| 445 | This will install all platform-independent files in subdirectories the |
| 446 | directory given with the --prefix option to configure or the 'prefix' |
| 447 | Make variable (default /usr/local), and all binary and other |
| 448 | platform-specific files in subdirectories if the directory given by |
| 449 | --exec-prefix or the 'exec_prefix' Make variable (defaults to the |
| 450 | --prefix directory). |
| 451 | |
| 452 | All subdirectories created will have Python's version number in their |
| 453 | name, e.g. the library modules are installed in |
| 454 | "/usr/local/lib/python1.5/" by default. The Python binary is |
| 455 | installed as "python1.5" and a hard link named "python" is created. |
| 456 | The only file not installed with a version number in its name is the |
| 457 | manual page, installed as "/usr/local/man/man1/python.1" by default. |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 458 | |
Guido van Rossum | 4952369 | 1997-08-15 18:30:14 +0000 | [diff] [blame] | 459 | If you have a previous installation of a pre-1.5 Python that you don't |
Guido van Rossum | 6477380 | 1997-11-26 17:07:02 +0000 | [diff] [blame] | 460 | want to replace yet, use |
| 461 | |
| 462 | make altinstall |
| 463 | |
| 464 | This installs the same set of files as "make install" except it |
| 465 | doesn't create the hard link to "python1.5" named "python" and it |
| 466 | doesn't install the manual page at all. |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 467 | |
| 468 | The only thing you may have to install manually is the Python mode for |
| 469 | Emacs. (But then again, more recent versions of Emacs may already |
| 470 | have it!) This is the file Misc/python-mode.el; follow the |
| 471 | instructions that came with Emacs for installation of site specific |
| 472 | files. |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 473 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 474 | |
| 475 | Configuration options and variables |
| 476 | ----------------------------------- |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 477 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 478 | Some special cases are handled by passing options to the configure |
| 479 | script. |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 480 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 481 | WARNING: if you rerun the configure script with different options, you |
| 482 | must run "make clean" before rebuilding. Exceptions to this rule: |
| 483 | after changing --prefix or --exec-prefix, all you need to do is remove |
Guido van Rossum | b06df27 | 1997-08-05 21:50:20 +0000 | [diff] [blame] | 484 | Modules/getpath.o. |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 485 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 486 | --with(out)-gcc: The configure script uses gcc (the GNU C compiler) if |
| 487 | it finds it. If you don't want this, or if this compiler is |
| 488 | installed but broken on your platform, pass the option |
| 489 | --without-gcc. You can also pass "CC=cc" (or whatever the |
| 490 | name of the proper C compiler is) in the environment, but the |
| 491 | advantage of using --without-gcc is that this option is |
| 492 | remembered by the config.status script for its --recheck |
| 493 | option. |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 494 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 495 | --prefix, --exec-prefix: If you want to install the binaries and the |
| 496 | Python library somewhere else than in /usr/local/{bin,lib}, |
| 497 | you can pass the option --prefix=DIRECTORY; the interpreter |
| 498 | binary will be installed as DIRECTORY/bin/python and the |
| 499 | library files as DIRECTORY/lib/python/*. If you pass |
| 500 | --exec-prefix=DIRECTORY (as well) this overrides the |
| 501 | installation prefix for architecture-dependent files (like the |
| 502 | interpreter binary). Note that --prefix=DIRECTORY also |
| 503 | affects the default module search path (sys.path), when |
| 504 | Modules/config.c is compiled. Passing make the option |
| 505 | prefix=DIRECTORY (and/or exec_prefix=DIRECTORY) overrides the |
| 506 | prefix set at configuration time; this may be more convenient |
| 507 | than re-running the configure script if you change your mind |
| 508 | about the install prefix... |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 509 | |
Guido van Rossum | b06df27 | 1997-08-05 21:50:20 +0000 | [diff] [blame] | 510 | --with-readline: This option is no longer supported. To use GNU |
| 511 | readline, enable module "readline" in the Modules/Setup file. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 512 | |
Guido van Rossum | faf681a | 1996-06-20 14:32:08 +0000 | [diff] [blame] | 513 | --with-thread: On most Unix systems, you can now use multiple threads. |
Guido van Rossum | 4462e93 | 1997-01-22 21:00:32 +0000 | [diff] [blame] | 514 | To enable this, pass --with-thread. (--with-threads is an |
| 515 | alias.) If the library required for threads lives in a |
Guido van Rossum | 8d90f9d | 1997-05-22 20:13:25 +0000 | [diff] [blame] | 516 | peculiar place, you can use --with-thread=DIRECTORY. NOTE: |
| 517 | you must also enable the thread module by uncommenting it in |
| 518 | the Modules/Setup file. (Threads aren't enabled automatically |
| 519 | because there are run-time penalties when support for them is |
| 520 | compiled in even if you don't use them.) IMPORTANT: run "make |
| 521 | clean" after changing (either enabling or disabling) this |
Guido van Rossum | 0e13da9 | 1998-02-22 04:36:34 +0000 | [diff] [blame] | 522 | option, or you will get link errors! Note: for DEC Unix use |
| 523 | --with-dec-threads instead. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 524 | |
| 525 | --with-sgi-dl: On SGI IRIX 4, dynamic loading of extension modules is |
| 526 | supported by the "dl" library by Jack Jansen, which is |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 527 | ftp'able from ftp://ftp.cwi.nl/pub/dynload/dl-1.6.tar.Z. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 528 | This is enabled (after you've ftp'ed and compiled the dl |
| 529 | library!) by passing --with-sgi-dl=DIRECTORY where DIRECTORY |
| 530 | is the absolute pathname of the dl library. (Don't bother on |
| 531 | IRIX 5, it already has dynamic linking using SunOS style |
| 532 | shared libraries.) Support for this feature is deprecated. |
| 533 | |
| 534 | --with-dl-dld: Dynamic loading of modules is rumoured to be supported |
| 535 | on some other systems: VAX (Ultrix), Sun3 (SunOS 3.4), Sequent |
| 536 | Symmetry (Dynix), and Atari ST. This is done using a |
| 537 | combination of the GNU dynamic loading package |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 538 | (ftp://ftp.cwi.nl/pub/dynload/dl-dld-1.1.tar.Z) and an |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 539 | emulation of the SGI dl library mentioned above (the emulation |
| 540 | can be found at |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 541 | ftp://ftp.cwi.nl/pub/dynload/dld-3.2.3.tar.Z). To |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 542 | enable this, ftp and compile both libraries, then call the |
| 543 | configure passing it the option |
| 544 | --with-dl-dld=DL_DIRECTORY,DLD_DIRECTORY where DL_DIRECTORY is |
| 545 | the absolute pathname of the dl emulation library and |
| 546 | DLD_DIRECTORY is the absolute pathname of the GNU dld library. |
| 547 | (Don't bother on SunOS 4 or 5, they already have dynamic |
| 548 | linking using shared libraries.) Support for this feature is |
| 549 | deprecated. |
| 550 | |
| 551 | --with-libm, --with-libc: It is possible to specify alternative |
| 552 | versions for the Math library (default -lm) and the C library |
| 553 | (default the empty string) using the options |
| 554 | --with-libm=STRING and --with-libc=STRING, respectively. E.g. |
| 555 | if your system requires that you pass -lc_s to the C compiler |
| 556 | to use the shared C library, you can pass --with-libc=-lc_s. |
| 557 | These libraries are passed after all other libraries, the C |
| 558 | library last. |
Guido van Rossum | 3ff96dd | 1996-07-30 18:05:04 +0000 | [diff] [blame] | 559 | |
| 560 | --with-next-archs='arch1 arch2': Under NEXTSTEP, this will build |
| 561 | all compiled binaries with the architectures listed. Includes |
| 562 | correctly setting the target architecture specific resource |
Guido van Rossum | cc55c2d | 1996-10-21 15:14:27 +0000 | [diff] [blame] | 563 | directory. (This option is not supported on other platforms.) |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 564 | |
Guido van Rossum | d02ba45 | 1996-07-31 17:36:01 +0000 | [diff] [blame] | 565 | --with-libs='libs': Add 'libs' to the LIBS that the python |
| 566 | linked against. |
| 567 | |
Guido van Rossum | 76be6ed | 1995-01-02 18:33:54 +0000 | [diff] [blame] | 568 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 569 | Building for multiple architectures (using the VPATH feature) |
| 570 | ------------------------------------------------------------- |
| 571 | |
| 572 | If your file system is shared between multiple architectures, it |
| 573 | usually is not necessary to make copies of the sources for each |
| 574 | architecture you want to support. If the make program supports the |
| 575 | VPATH feature, you can create an empty build directory for each |
| 576 | architecture, and in each directory run the configure script (on the |
| 577 | appropriate machine with the appropriate options). This creates the |
| 578 | necessary subdirectories and the Makefiles therein. The Makefiles |
| 579 | contain a line VPATH=... which points to directory containing the |
Guido van Rossum | d0fe845 | 1996-08-26 03:02:37 +0000 | [diff] [blame] | 580 | actual sources. (On SGI systems, use "smake -J1" instead of "make" if |
| 581 | you use VPATH -- don't try gnumake.) |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 582 | |
| 583 | For example, the following is all you need to build a minimal Python |
| 584 | in /usr/tmp/python (assuming ~guido/src/python is the toplevel |
| 585 | directory and you want to build in /usr/tmp/python): |
| 586 | |
| 587 | $ mkdir /usr/tmp/python |
| 588 | $ cd /usr/tmp/python |
| 589 | $ ~guido/src/python/configure |
| 590 | [...] |
| 591 | $ make |
| 592 | [...] |
| 593 | $ |
| 594 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 595 | Note that Modules/Makefile copies the original Setup file to the build |
| 596 | directory if it finds no Setup file there. This means that you can |
| 597 | edit the Setup file for each architecture independently. For this |
| 598 | reason, subsequent changes to the original Setup file are not tracked |
| 599 | automatically, as they might overwrite local changes. To force a copy |
| 600 | of a changed original Setup file, delete the target Setup file. (The |
| 601 | makesetup script supports multiple input files, so if you want to be |
| 602 | fancy you can change the rules to create an empty Setup.local if it |
| 603 | doesn't exist and run it with arguments $(srcdir)/Setup Setup.local; |
| 604 | however this assumes that you only need to add modules.) |
| 605 | |
| 606 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 607 | Building on non-UNIX systems |
| 608 | ---------------------------- |
| 609 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 610 | Building Python for a PC is now a piece of cake! |
Guido van Rossum | 8d7d4ed | 1996-07-30 21:41:07 +0000 | [diff] [blame] | 611 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 612 | Enter the directory "PC" and read the file "readme.txt". Most popular |
| 613 | non-Unix PC platforms and compilers are supported (Unix ports to the |
| 614 | PC such as Linux, FreeBSD or Solaris-x86 of course use the standard |
| 615 | Unix build instructions). |
| 616 | |
| 617 | For the Mac, a separate source distribution will be made available, |
| 618 | for use with the CodeWarrior compiler. If you are interested in Mac |
| 619 | development, join the PythonMac Special Interest Group |
| 620 | (http://www.python.org/sigs/pythonmac-sig/, or send email to |
| 621 | pythonmac-sig-request@python.org). |
| 622 | |
| 623 | Of course, there are also binary distributions available for these |
| 624 | platforms -- see http://www.python.org/python/. |
| 625 | |
| 626 | To port Python to a new non-UNIX system, you will have to fake the |
| 627 | effect of running the configure script manually (for Mac and PC, this |
| 628 | has already been done for you). A good start is to copy the file |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 629 | config.h.in to config.h and edit the latter to reflect the actual |
| 630 | configuration of your system. Most symbols must simply be defined as |
| 631 | 1 only if the corresponding feature is present and can be left alone |
| 632 | otherwise; however RETSIGTYPE must always be defined, either as int or |
| 633 | as void, and the *_t type symbols must be defined as some variant of |
Guido van Rossum | d0fe845 | 1996-08-26 03:02:37 +0000 | [diff] [blame] | 634 | int if they need to be defined at all. |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 635 | |
| 636 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 637 | |
| 638 | Miscellaneous issues |
| 639 | ==================== |
| 640 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 641 | Documentation |
| 642 | ------------- |
| 643 | |
| 644 | All documentation is provided in the subdirectory Doc in the form of |
| 645 | LaTeX files. In order of importance for new users: Tutorial (tut), |
| 646 | Library Reference (lib), Language Reference (ref), Extending (ext). |
| 647 | Especially the Library Reference is of immense value since much of |
| 648 | Python's power (including the built-in data types and functions!) is |
| 649 | described here. |
| 650 | |
Guido van Rossum | dfcf35d | 1996-08-26 17:52:09 +0000 | [diff] [blame] | 651 | To print the documentation from the LaTeX files, chdir into the Doc |
| 652 | subdirectory, type "make" (let's hope you have LaTeX installed!), and |
| 653 | send the four resulting PostScript files (tut.ps, lib.ps, ref.ps, and |
| 654 | ext.ps) to the printer. See the README file there. If you don't have |
| 655 | LaTeX, you can ftp the PostScript files from the ftp archives (see |
| 656 | below). |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 657 | |
Guido van Rossum | dfcf35d | 1996-08-26 17:52:09 +0000 | [diff] [blame] | 658 | All documentation is also available on-line via the Python web site |
| 659 | (http://www.python.org/, see below). It can also be downloaded |
| 660 | separately from the ftp archives (see below) in Emacs INFO, HTML or |
Guido van Rossum | 4952369 | 1997-08-15 18:30:14 +0000 | [diff] [blame] | 661 | PostScript form -- see the web site or the FAQ |
| 662 | (http://grail.cnri.reston.va.us/cgi-bin/faqw.py or |
| 663 | http://www.python.org/doc/FAQ.html) for more info. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 664 | |
| 665 | |
| 666 | Emacs mode |
| 667 | ---------- |
| 668 | |
Guido van Rossum | c0be2f5 | 1997-10-08 05:05:28 +0000 | [diff] [blame] | 669 | There's an excellent Emacs editing mode for Python code; see the file |
| 670 | Misc/python-mode.el. Originally written by the famous Tim Peters, it |
| 671 | is now maintained by the equally famous Barry Warsaw |
| 672 | <bwarsaw@cnri.reston.va.us>. The latest version is online at |
| 673 | ftp://ftp.python.org/pub/emacs/python-mode.el. As you might expect of |
| 674 | Barry (and even if you don't know what the heck I'm talking about :-), |
| 675 | a configuration file for his cc-mode.el which selects the style used |
| 676 | throughout most Python C source files is also provided; see the file |
| 677 | Misc/ccpy-style.el. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 678 | |
| 679 | |
Guido van Rossum | 8d7d4ed | 1996-07-30 21:41:07 +0000 | [diff] [blame] | 680 | Web site |
| 681 | -------- |
| 682 | |
| 683 | Python's own web site has URL http://www.python.org/. Come visit us! |
Guido van Rossum | a16e275 | 1998-04-13 20:14:05 +0000 | [diff] [blame] | 684 | There are a number of mirrors, and a list of mirrors is accessible |
| 685 | from the home page -- try a mirror that's close you you. |
Guido van Rossum | 8d7d4ed | 1996-07-30 21:41:07 +0000 | [diff] [blame] | 686 | |
| 687 | |
Guido van Rossum | d0fe845 | 1996-08-26 03:02:37 +0000 | [diff] [blame] | 688 | Ftp site |
| 689 | -------- |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 690 | |
Guido van Rossum | c0be2f5 | 1997-10-08 05:05:28 +0000 | [diff] [blame] | 691 | Python's own ftp site is ftp://ftp.python.org/pub/python/. There are |
Guido van Rossum | a16e275 | 1998-04-13 20:14:05 +0000 | [diff] [blame] | 692 | numerous mirrors; the list of mirrors is accessible from |
| 693 | http://www.python.org/. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 694 | |
| 695 | |
Guido van Rossum | a16e275 | 1998-04-13 20:14:05 +0000 | [diff] [blame] | 696 | Newsgroups |
| 697 | ---------- |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 698 | |
Guido van Rossum | a16e275 | 1998-04-13 20:14:05 +0000 | [diff] [blame] | 699 | Read comp.lang.python, a high-volume discussion newsgroup about |
| 700 | Python, or comp.lang.python.announce, a low-volume moderated newsgroup |
| 701 | for Python-related announcements. These are also accessible as |
| 702 | mailing lists, see the next item. |
Guido van Rossum | d0fe845 | 1996-08-26 03:02:37 +0000 | [diff] [blame] | 703 | |
Guido van Rossum | a16e275 | 1998-04-13 20:14:05 +0000 | [diff] [blame] | 704 | Archives are accessible via Deja News; the Python website has a |
| 705 | query form for the archives at http://www.python.org/search/. |
| 706 | |
| 707 | |
| 708 | Mailing lists |
| 709 | ------------- |
| 710 | |
| 711 | See http://www.python.org/psa/MailingLists.html for an overview of the |
| 712 | many Python related mailing lists. |
Guido van Rossum | d0fe845 | 1996-08-26 03:02:37 +0000 | [diff] [blame] | 713 | |
| 714 | |
| 715 | Bug reports |
| 716 | ----------- |
| 717 | |
Guido van Rossum | a16e275 | 1998-04-13 20:14:05 +0000 | [diff] [blame] | 718 | Bugs are best reported to the comp.lang.python newsgroup (or the |
| 719 | Python mailing list) -- see the section "Newsgroups" above. Before |
| 720 | posting, check the newsgroup archives (see above) to see if your bug |
| 721 | has already been reported! If you don't want to go public, send them |
| 722 | to me: <guido@python.org>. |
Guido van Rossum | d0fe845 | 1996-08-26 03:02:37 +0000 | [diff] [blame] | 723 | |
| 724 | |
| 725 | Questions |
| 726 | --------- |
| 727 | |
Guido van Rossum | 4952369 | 1997-08-15 18:30:14 +0000 | [diff] [blame] | 728 | For help, if you can't find it in the manuals or on the web site, it's |
| 729 | best to post to the comp.lang.python or the Python mailing list (see |
| 730 | above). If you specifically don't want to involve the newsgroup or |
Guido van Rossum | c0be2f5 | 1997-10-08 05:05:28 +0000 | [diff] [blame] | 731 | mailing list, send questions to <python-help@python.org> (a group of |
| 732 | volunteers which does *not* include me). Because of my work and email |
| 733 | volume, I'm often be slow in answering questions sent to me directly; |
| 734 | I prefer to answer questions posted to the newsgroup. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 735 | |
| 736 | |
| 737 | The Tk interface |
| 738 | ---------------- |
| 739 | |
| 740 | Tk (the user interface component of John Ousterhout's Tcl language) is |
| 741 | also usable from Python. Since this requires that you first build and |
Guido van Rossum | c0be2f5 | 1997-10-08 05:05:28 +0000 | [diff] [blame] | 742 | install Tcl/Tk, the Tk interface is not enabled by default. Python |
| 743 | supports all Tcl/Tk versions from version 7.5/4.1 through 8.0 (and it |
| 744 | is expected that it will also work with newer versions). Tcl/Tk |
Guido van Rossum | 6477380 | 1997-11-26 17:07:02 +0000 | [diff] [blame] | 745 | 7.4/4.0 is no longer supported. 8.0 or any later non-alpha non-beta |
| 746 | release is recommended. |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 747 | |
Guido van Rossum | 6477380 | 1997-11-26 17:07:02 +0000 | [diff] [blame] | 748 | See http://sunscript.sun.com/ for more info on Tcl/Tk, including the |
| 749 | on-line manual pages. |
| 750 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 751 | |
| 752 | To enable the Python/Tk interface, once you've built and installed |
Guido van Rossum | 6477380 | 1997-11-26 17:07:02 +0000 | [diff] [blame] | 753 | Tcl/Tk, load the file Modules/Setup in your favorite text editor and |
| 754 | search for the string "_tkinter". Then follow the instructions found |
| 755 | there. If you have installed Tcl/Tk or X11 in unusual places, you |
| 756 | will have to edit the first line to fix or add -I and -L options. |
| 757 | (Also see the general instructions at the top of that file.) |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 758 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 759 | There is little documentation on how to use Tkinter; however most of |
| 760 | the Tk manual pages apply quite straightforwardly. Begin with |
| 761 | fetching the "Tk Lifesaver" document, |
| 762 | e.g. ftp://ftp.python.org/pub/python/doc/tkinter-doc.tar.gz (a gzipped |
| 763 | tar file containing a PostScript file) or the on-line version |
| 764 | http://www.python.org/doc/life-preserver/index.html. Reading the |
| 765 | Tkinter.py source will reveal most details on how Tkinter calls are |
| 766 | translated into Tcl code. |
| 767 | |
Guido van Rossum | c0be2f5 | 1997-10-08 05:05:28 +0000 | [diff] [blame] | 768 | A more recent introduction to Tkinter programming, by Fredrik Lundh, |
| 769 | is at http://www.pythonware.com/library/tkinter/introduction/index.htm. |
| 770 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 771 | There are demos in the Demo/tkinter directory, in the subdirectories |
| 772 | guido, matt and www (the matt and guido subdirectories have been |
| 773 | overhauled to use more recent Tkinter coding conventions). |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 774 | |
| 775 | Note that there's a Python module called "Tkinter" (capital T) which |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 776 | lives in Lib/tkinter/Tkinter.py, and a C module called "_tkinter" |
| 777 | (lower case t and leading underscore) which lives in |
| 778 | Modules/_tkinter.c. Demos and normal Tk applications only import the |
| 779 | Python Tkinter module -- only the latter uses the C _tkinter module |
| 780 | directly. In order to find the C _tkinter module, it must be compiled |
| 781 | and linked into the Python interpreter -- the _tkinter line in the |
| 782 | Setup file does this. In order to find the Python Tkinter module, |
| 783 | sys.path must be set correctly -- the TKPATH assignment in the Setup |
| 784 | file takes care of this, but only if you install Python properly |
| 785 | ("make install libinstall"). (You can also use dynamic loading for |
| 786 | the C _tkinter module, in which case you must manually fix up sys.path |
| 787 | or set $PYTHONPATH for the Python Tkinter module.) |
Guido van Rossum | 84c8c7f | 1995-08-28 02:44:24 +0000 | [diff] [blame] | 788 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 789 | |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 790 | Distribution structure |
| 791 | ---------------------- |
| 792 | |
| 793 | Most subdirectories have their own README file. Most files have |
| 794 | comments. |
| 795 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 796 | Demo/ Demonstration scripts, modules and programs |
| 797 | Doc/ Documentation (LaTeX sources) |
| 798 | Grammar/ Input for the parser generator |
| 799 | Include/ Public header files |
| 800 | Lib/ Python library modules |
| 801 | Makefile.in Source from which config.status creates Makefile |
Guido van Rossum | c0be2f5 | 1997-10-08 05:05:28 +0000 | [diff] [blame] | 802 | Misc/ Miscellaneous useful files |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 803 | Modules/ Implementation of most built-in modules |
| 804 | Objects/ Implementation of most built-in object types |
Guido van Rossum | 6477380 | 1997-11-26 17:07:02 +0000 | [diff] [blame] | 805 | PC/ PC porting files (DOS, Windows, OS/2) |
| 806 | PCbuild/ Directory where you should build for Windows NT/95 |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 807 | Parser/ The parser and tokenizer and their input handling |
| 808 | Python/ The "compiler" and interpreter |
| 809 | README The file you're reading now |
| 810 | Tools/ Some useful programs written in Python |
| 811 | acconfig.h Additional input for the autoheader program |
| 812 | config.h.in Source from which config.status creates config.h |
| 813 | configure Configuration shell script (GNU autoconf output) |
| 814 | configure.in Configuration specification (GNU autoconf input) |
| 815 | install-sh Shell script used to install files |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 816 | |
| 817 | The following files will (may) be created in the toplevel directory by |
| 818 | the configuration and build processes: |
| 819 | |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 820 | Makefile Build rules |
| 821 | config.cache cache of configuration variables |
| 822 | config.h Configuration header |
Guido van Rossum | c0be2f5 | 1997-10-08 05:05:28 +0000 | [diff] [blame] | 823 | config.log Log from last configure run |
| 824 | config.status Status from last run of configure script |
| 825 | libpython1.5.a The library archive |
Guido van Rossum | 6d9cc80 | 1996-08-01 17:31:22 +0000 | [diff] [blame] | 826 | python The executable interpreter |
| 827 | tags, TAGS Tags files for vi and Emacs |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 828 | |
| 829 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 830 | Author's address |
Guido van Rossum | d0fe845 | 1996-08-26 03:02:37 +0000 | [diff] [blame] | 831 | ================ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 832 | |
| 833 | Guido van Rossum |
Guido van Rossum | faf681a | 1996-06-20 14:32:08 +0000 | [diff] [blame] | 834 | CNRI |
| 835 | 1895 Preston White Drive |
Guido van Rossum | 8d7d4ed | 1996-07-30 21:41:07 +0000 | [diff] [blame] | 836 | Reston, VA 20191 |
Guido van Rossum | faf681a | 1996-06-20 14:32:08 +0000 | [diff] [blame] | 837 | USA |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 838 | |
Guido van Rossum | d0fe845 | 1996-08-26 03:02:37 +0000 | [diff] [blame] | 839 | E-mail: guido@cnri.reston.va.us or guido@python.org |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 840 | |
| 841 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 842 | |
| 843 | Copyright notice |
| 844 | ================ |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 845 | |
| 846 | The Python source is copyrighted, but you can freely use and copy it |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 847 | as long as you don't change or remove the copyright notice: |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 848 | |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 849 | ---------------------------------------------------------------------- |
Guido van Rossum | af5b83e | 1995-01-04 19:02:35 +0000 | [diff] [blame] | 850 | Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, |
| 851 | The Netherlands. |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 852 | |
| 853 | All Rights Reserved |
| 854 | |
Guido van Rossum | c561e5d | 1994-08-23 13:52:46 +0000 | [diff] [blame] | 855 | Permission to use, copy, modify, and distribute this software and its |
| 856 | documentation for any purpose and without fee is hereby granted, |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 857 | provided that the above copyright notice appear in all copies and that |
Guido van Rossum | c561e5d | 1994-08-23 13:52:46 +0000 | [diff] [blame] | 858 | both that copyright notice and this permission notice appear in |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 859 | supporting documentation, and that the names of Stichting Mathematisch |
Guido van Rossum | f501b4e | 1996-10-25 14:32:48 +0000 | [diff] [blame] | 860 | Centrum or CWI or Corporation for National Research Initiatives or |
| 861 | CNRI not be used in advertising or publicity pertaining to |
| 862 | distribution of the software without specific, written prior |
| 863 | permission. |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 864 | |
Guido van Rossum | f501b4e | 1996-10-25 14:32:48 +0000 | [diff] [blame] | 865 | While CWI is the initial source for this software, a modified version |
| 866 | is made available by the Corporation for National Research Initiatives |
| 867 | (CNRI) at the Internet address ftp://ftp.python.org. |
| 868 | |
| 869 | STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH |
| 870 | REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF |
| 871 | MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH |
| 872 | CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL |
| 873 | DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 874 | PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 875 | TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 876 | PERFORMANCE OF THIS SOFTWARE. |
Guido van Rossum | 91cb9d2 | 1995-04-10 11:47:38 +0000 | [diff] [blame] | 877 | ---------------------------------------------------------------------- |
Guido van Rossum | 433c8ad | 1994-08-01 12:07:07 +0000 | [diff] [blame] | 878 | |
| 879 | |
Guido van Rossum | faf681a | 1996-06-20 14:32:08 +0000 | [diff] [blame] | 880 | --Guido van Rossum (home page: http://www.python.org/~guido/) |