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