Python Read-Me File

Embed Size (px)

Citation preview

  • 7/29/2019 Python Read-Me File

    1/21

    ThisisPythonversion2.4.4============================

    Copyright(c)2001,2002,2003,2004,2005,2006PythonSoftwareFoundation.Allrightsreserved.

    Copyright(c)2000BeOpen.com.Allrightsreserved.

    Copyright(c)1995-2001CorporationforNationalResearchInitiatives.Allrightsreserved.

    Copyright(c)1991-1995StichtingMathematischCentrum.Allrightsreserved.

    Licenseinformation-------------------

    Seethefile"LICENSE"forinformationonthehistoryofthissoftware,terms&conditionsforusage,andaDISCLAIMEROFALLWARRANTIES.

    ThisPythondistributioncontainsnoGNUGeneralPublicLicensed

    (GPLed)codesoitmaybeusedinproprietaryprojectsjustlikepriorPythondistributions.ThereareinterfacestosomeGNUcodebuttheseareentirelyoptional.

    Alltrademarksreferencedhereinarepropertyoftheirrespectiveholders.

    What'snewinthisrelease?---------------------------

    Seethefile"Misc/NEWS".

    Ifyoudon'treadinstructions------------------------------

    Congratulationsongettingthisfar.:-)

    Tostartbuildingrightaway(onUNIX):type"./configure"inthecurrentdirectoryandwhenitfinishes,type"make".Thiscreatesanexecutable"./python";toinstallin/usr/local,firstdo"suroot"andthen"makeinstall".

    Thesection`Buildinstructions'belowisstillrecommendedreading,especiallythepartoncustomizingModules/Setup.

    WhatisPythonanyway?----------------------

    Pythonisaninterpretedobject-orientedprogramminglanguagesuitable(amongstotheruses)fordistributedapplicationdevelopment,scripting,numericcomputingandsystemtesting.PythonisoftencomparedtoTcl,Perl,Java,JavaScript,VisualBasicorScheme.TofindoutmoreaboutwhatPythoncandoforyou,pointyourbrowsertohttp://www.python.org/.

  • 7/29/2019 Python Read-Me File

    2/21

    HowdoIlearnPython?----------------------

    Theofficialtutorialisstillagoodplacetostart;seehttp://www.python.org/doc/foronlineanddownloadableversions,aswellasalistofotherintroductions,andreferencedocumentation.

    There'saquicklygrowingsetofbooksonPython.Seehttp://www.python.org/cgi-bin/moinmoin/PythonBooksforalist.

    Documentation-------------

    Alldocumentationisprovidedonlineinavarietyofformats.Inorderofimportancefornewusers:Tutorial,LibraryReference,LanguageReference,Extending&Embedding,andthePython/CAPI.TheLibraryReferenceisespeciallyofimmensevaluesincemuchofPython'spowerisdescribedthere,includingthebuilt-indatatypesandfunctions!

    AlldocumentationisalsoavailableonlineatthePythonwebsite

    (http://www.python.org/doc/,seebelow).Itisavailableonlineforoccasionalreference,orcanbedownloadedinmanyformatsforfasteraccess.ThedocumentationisavailableinHTML,PostScript,PDF,andLaTeXformats;theLaTeXversionisprimarilyfordocumentationauthors,translators,andpeoplewithspecialformattingrequirements.

    Thebestdocumentationforthenew(inPython2.2)type/classunificationfeaturesisGuido'stutorialintroduction,at

    http://www.python.org/2.2.1/descrintro.html

    Websites

    ---------

    NewPythonreleasesandrelatedtechnologiesarepublishedathttp://www.python.org/.Comevisitus!

    There'salsoaPythoncommunitywebsiteathttp://starship.python.net/.

    NewsgroupsandMailingLists----------------------------

    Readcomp.lang.python,ahigh-volumediscussionnewsgroupabout

    Python,orcomp.lang.python.announce,alow-volumemoderatednewsgroupforPython-relatedannouncements.Thesearealsoaccessibleasmailinglists:seehttp://www.python.org/psa/MailingLists.htmlforanoverviewofthemanyPython-relatedmailinglists.

    ArchivesareaccessibleviatheGoogleGroupsusenetarchive;seehttp://groups.google.com/.Themailinglistsarealsoarchived,seehttp://www.python.org/psa/MailingLists.htmlfordetails.

  • 7/29/2019 Python Read-Me File

    3/21

    Bugreports-----------

    Toreportorsearchforbugs,pleaseusethePythonBugTrackerathttp://sourceforge.net/bugs/?group_id=5470.

    Patchesandcontributions-------------------------

    Tosubmitapatchorothercontribution,pleaseusethePythonPatchManagerathttp://sourceforge.net/patch/?group_id=5470.Guidelinesforpatchsubmissionmaybefoundathttp://www.python.org/patches/.

    IfyouhaveaproposaltochangePython,it'sbesttosubmitaPythonEnhancementProposal(PEP)first.AllcurrentPEPs,aswellasguidelinesforsubmittinganewPEP,arelistedathttp://python.sourceforge.net/peps/.

    Questions---------

    Forhelp,ifyoucan'tfinditinthemanualsoronthewebsite,it's

    besttoposttothecomp.lang.pythonorthePythonmailinglist(seeabove).Ifyouspecificallydon'twanttoinvolvethenewsgroupormailinglist,[email protected](agroupofvolunteerswhoanswerquestionsastheycan).Thenewsgroupisthemostefficientwaytoaskpublicquestions.

    Buildinstructions==================

    BeforeyoucanbuildPython,youmustfirstconfigureit.Fortunately,theconfigurationandbuildprocesshasbeenautomatedforUnixandLinuxinstallations,soallyouusuallyhavetodois

    typeafewcommandsandsitback.Therearesomeplatformswherethingsarenotquiteassmooth;seetheplatformspecificnotesbelow.Ifyouwanttobuildformultipleplatformssharingthesamesourcetree,seethesectiononVPATHbelow.

    Startbyrunningthescript"./configure",whichdeterminesyoursystemconfigurationandcreatestheMakefile.(Ittakesaminuteortwo--pleasebepatient!)Youmaywanttopassoptionstotheconfigurescript--seethesectionbelowonconfigurationoptionsandvariables.Whenit'sdone,youarereadytorunmake.

    Asaprerequisite,youneedatleastaCcompileronyoursystem,alongwithheaderfilesforthestandardClibrary.Youalsoneed

    aC++compiler,unlessyoupass--without-cxxtoconfigure.Inaddition,youneedheaderfilesandlibrariesforvariousoptionalextensionmodules;ifthesearemissing,thebuildprocesswillskipbuildingthesemodules.

    TobuildPython,younormallytype"make"inthetopleveldirectory.Ifyouhavechangedtheconfiguration,theMakefilemayhavetoberebuilt.Inthiscaseyoumayhavetorunmakeagaintocorrectlybuildyourdesiredtarget.Theinterpreterexecutableisbuiltinthetopleveldirectory.

  • 7/29/2019 Python Read-Me File

    4/21

    OnceyouhavebuiltaPythoninterpreter,seethesubsectionsbelowontestingandinstallation.Ifyourunintotrouble,seethenextsection.

    PreviousversionsofPythonusedamanualconfigurationprocessthatinvolvededitingthefileModules/Setup.Whilethisfilestillexistsandmanualconfigurationisstillsupported,itisrarelyneededanymore:almostallmodulesareautomaticallybuiltasappropriateunderguidanceofthesetup.pyscript,whichisrunbyMakeaftertheinterpreterhasbeenbuilt.

    Troubleshooting---------------

    Seealsotheplatformspecificnotesinthenextsection.

    Ifyourunintoothertrouble,seesection3oftheFAQ(http://www.python.org/cgi-bin/faqw.pyorhttp://www.python.org/doc/FAQ.html)forhintsonwhatcangowrong,andhowtofixit.

    Ifyoureruntheconfigurescriptwithdifferentoptions,removeall

    objectfilesbyrunning"makeclean"beforerebuilding.Believeitornot,"makeclean"sometimeshelpstocleanupotherinexplicableproblemsaswell.Tryitbeforesendinginabugreport!

    Iftheconfigurescriptfailsordoesn'tseemtofindthingsthatshouldbethere,inspecttheconfig.logfile.Whenyoufixaconfigureproblem,besuretoremoveconfig.cache!

    Ifyougetawarningforeveryfileaboutthe-Olimitoptionbeingnolongersupported,youcanignoreit.There'snofoolproofwaytoknowwhetherthisoptionisneeded;allwecandoistestwhetheritisacceptedwithouterror.Onsomesystems,e.g.olderSGIcompilers,itisessentialforperformance(specificallywhencompilingceval.c,

    whichhasmorebasicblocksthanthedefaultlimitof1000).Ifthewarningbothersyou,edittheMakefiletoremove"-Olimit1500"fromtheOPTvariable.

    Ifyougetfailuresintest_long,orsys.maxintgetssetto-1,youareprobablyexperiencingcompilerbugs,usuallyrelatedtooptimization.Thisisacommonproblemwithsomeversionsofgcc,andsomevendor-suppliedcompilers,whichcansometimesbeworkedaroundbyturningoffoptimization.Considerswitchingtostableversions(gcc2.95.2,gcc3.x,orcontactyourvendor.)

    FromPython2.0onward,allPythonCcodeisANSIC.CompilingusingoldK&R-C-onlycompilersisnolongerpossible.ANSICcompilersare

    availableforallmodernsystems,eitherintheformofupdatedcompilersfromthevendor,oroneofthefreecompilers(gcc).

    Unsupportedsystems-------------------

    AnumberoffeatureshavenotbeensupportedsincePython2.3,andthecodetosupportthemwasremovedinPython2.4.IfyoustillneedtousecurrentPythonversionsonthesesystems,pleasesendamessagetopython-dev@python.orgindicatingthatyouvolunteer

  • 7/29/2019 Python Read-Me File

    5/21

    tosupportthissystem.ThereismoredetailonthisinPEP11.

    Morespecifically,thefollowingsystemsarenolongersupported:

    -SunOS4-DYNIX-dgux-Minix-Irix4and--with-sgi-dl-Linux1-Systemsdefining__d6_pthread_create(configure.in)-SystemsdefiningPY_PTHREAD_D4,PY_PTHREAD_D6,orPY_PTHREAD_D7inthread_pthread.h-Systemsusing--with-dl-dld-Systemsusing--without-universal-newlines

    Platformspecificnotes-----------------------

    (Someofthesemaynolongerapply.IfyoufindyoucanbuildPythonontheseplatformswithoutthespecialdirectionsmentionedhere,submitadocumentationbugreporttoSourceForge(seeBugReportsabove)sowecanremovethem!)

    Unixplatforms:Ifyourvendorstillships(andyoustilluse)BerkeleyDB1.85youwillneedtoeditModules/Setuptobuildthebsddb185moduleandaddalinetositecustomize.pywhichmakesitthedefault.InModules/Setupalinelike

    bsddb185bsddbmodule.c

    shouldwork.(Youmayneedtoadd-I,-Lor-lflagstodirectthecompilerandlinkertoyourincludefilesandlibraries.)Youcanthenforceittobetheversionpeopleimportbyadding

    importbsddb185asbsddb

    insitecustomize.py.

    64-bitplatforms:Themodulesaudioop,imageopandrgbimgdon'twork.Thesetup.pyscriptdisablesthemon64-bitinstallations.Don'ttrytoenablethemintheModules/Setupfile.Theycontaincodethatisquitewordsizesensitive.(Ifyouhaveafix,letusknow!)

    Solaris:WhenusingSun'sCcompilerwiththreads,atleastonSolaris2.5.1,youneedtoaddthe"-mt"compileroption(thesimplestwayisprobablytospecifythecompilerwiththisoptionasthe"CC"environmentvariablewhenrunningtheconfigurescript).

    WhenusingGCConSolaris,bewareofbinutils2.13orGCCversionsbuiltusingit.Thismistakenlyenablesthe-zcombrelocoptionwhichcreatesbrokensharedlibrariesonSolaris.binutils2.12works,andthebinutilsmaintainersareawareoftheproblem.Binutils2.13.1onlypartiallyfixedthings.Itappearsthat2.13.2solvestheproblemcompletely.ThisproblemisknowntooccurwithSolaris2.7and2.8,butmayalsoaffectearlierandlaterversionsoftheOS.

  • 7/29/2019 Python Read-Me File

    6/21

    Whenthedynamicloadercomplainsabouterrorsfindingsharedlibraries,suchas

    ld.so.1:./python:fatal:libstdc++.so.5:openfailed:Nosuchfileordirectory

    youneedtofirstmakesurethatthelibraryisavailableonyoursystem.Then,youneedtoinstructthedynamicloaderhowtofindit.Youcanchooseanyofthefollowingstrategies:

    1.WhencompilingPython,setLD_RUN_PATHtothedirectoriescontainingmissinglibraries.2.WhenrunningPython,setLD_LIBRARY_PATHtothesedirectories.3.Usecrle(8)toextendthesearchpathoftheloader.4.ModifytheinstalledGCCspecsfile,adding-Roptionsintothe*link:section.

    ThecomplexobjectfailstocompileonSolaris10withgcc3.4(atleastupto3.4.3).Toworkaroundit,definePy_HUGE_VALasHUGE_VAL(),e.g.:

    makeCPPFLAGS='-D"Py_HUGE_VAL=HUGE_VAL()"-I.-I$(srcdir)/Include'./pythonsetup.pyCPPFLAGS='-D"Py_HUGE_VAL=HUGE_VAL()"'

    Linux:Aproblemwiththreadsandfork()wastrackeddowntoabuginthepthreadscodeinglibcversion2.0.5;glibcversion2.0.7solvestheproblem.Thiscausesthepopen2testtofail;problemandsolutionreportedbyPabloBleyer.

    UnderLinuxsystemsusingGNUlibc2(akalibc6),thecryptmodulenowneedsthe-lcryptoption.Thesetup.pyscripttakescareofthisautomatically.

    RedHatLinux:RedHat9builtPython2.2inUCS-4modeandhackedTcltosupportit.TocompilePythonwithTkinteronthese

    systems,youwillneedtopass--enable-unicode=ucs4flag

    to./configure.ThisisnolongerneededinFedoraCore.

    OnolderRedHatreleases,there'sanexecutable/usr/bin/pythonwhichisPython1.5.2onmostolderRedHatinstallations;severalkeyRedHattoolsrequirethisversion.Python2.1.xmaybeinstalledas/usr/bin/python2(youcanalsouse"makealtinstall"toinstallPythoninawaythatwon'treplacethe'python'executable,butinsteadonlycreatea"python2.4"binary).TheMakefileinstallsPythonas/usr/local/bin/python,whichmayormaynottakeprecedenceover/usr/bin/python,dependingonhowyouhavesetup$PATH.

    FreeBSD3.xandprobablyplatformswithNCursesthatuselibmytinfoor

    similar:Whenusingcursesmodule,thelinkingisnotdoneinthecorrectorderwiththedefaults.Remove"-ltermcap"fromthereadlineentryinSetup,anduseascursesentry:"cursescursesmodule.c-lmytinfo-lncurses-ltermcap"-"mytinfo"(socalledonFreeBSD)shouldbethenameoftheauxiliarylibraryrequiredonyourplatform.Normally,itwouldbelinkedautomatically,butnotnecessarilyinthecorrectorder.

    BSDI: BSDIversionsbefore4.1haveknownproblemswiththreads,whichcancausestrangeerrorsinanumberofmodules(for

  • 7/29/2019 Python Read-Me File

    7/21

    instance,the'test_signal'testscriptwillhangforever.)Turningoffthreads(with--with-threads=no)orupgradingtoBSDI4.1solvesthisproblem.

    DECUnix:Runconfigurewith--with-dec-threads,orwith--with-threads=noifnothreadsaredesired(threadsareonbydefault).WhenusingGCC,itispossibletogetaninternalcompilererrorifoptimizationisused.ThiswasreportedforGCC2.7.2.3onselectmodule.c.Manuallycompiletheaffectedfilewithoutoptimizationtosolvetheproblem.

    DECUltrix:compilewithGCCtoavoidbugsinthenativecompiler,andpassSHELL=/bin/sh5toMakewheninstalling.

    AIX: Acompleteoverhaulofthesharedlibrarysupportisnowinplace.SeeMisc/AIX-NOTESforsomenotesonhowit'sdone.(Theoptimizerbugreportedatthisplaceinpreviousreleaseshasbeenworkedaroundbyaminimalcodechange.)Ifyougeterrorsaboutpthread_*functions,duringcompileorduringtesting,trysettingCCtoathread-safe(reentrant)compiler,like"cc_r".ForfullC++modulesupport,setCC="xlC_r"(orCC="xlC"withoutthreadsupport).

    AIX5.3:Tobuilda64-bitversionwithIBM'scompiler,Iusedthe

    following:

    exportPATH=/usr/bin:/usr/vacpp/bin./configure--with-gcc="xlc_r-q64"--with-cxx="xlC_r-q64"\

    --disable-ipv6AR="ar-X64"make

    HP-UX:Whenusingthreading,youmayhavetoadd-D_REENTRANTtotheOPTvariableinthetop-levelMakefile;reportedbyPatKnight,thisseemstomakeadifference(atleastforHP-UX10.20)eventhoughpyconfig.hdefinesit.ThisseemsunnecessarywhenusingHP/UX11andlater-threadingseemstowork"outofthebox".

    HP-UXia64:Whenbuildingontheia64(Itanium)platformusingHP'scompiler,someexperiencehasshownthatthecompiler'soptimiserproducesacompletelybrokenversionofpython(seehttp://www.python.org/sf/814976).Toworkaroundthis,edittheMakefileandremove-OfromtheOPTline.

    Tobuilda64-bitexecutableonanItanium2systemusingHP'scompiler,usetheseenvironmentvariables:

    CC=ccCXX=aCCBASECFLAGS="+DD64"

    LDFLAGS="+DD64-lxnet"

    andcallconfigureas:

    ./configure--without-gcc

    then*unset*theenvironmentvariablesagainbeforerunningmake.(Atleastoneoftheseflagscausesthebuildtofailifitremainsset.)YoustillhavetoedittheMakefileandremove-OfromtheOPTline.

  • 7/29/2019 Python Read-Me File

    8/21

    HPPA-RISC2.0:Arecentbugreport(http://www.python.org/sf/546117)suggeststhattheCcompilerinthis64-bitsystemhasbugsintheoptimizerthatbreakPython.Compilingwithoutoptimizationsolvestheproblems.

    SCO: ThefollowingapplytoSCO3only;PythonbuildsoutoftheboxonSCO5(orsowe'veheard).

    1)Everythingworksmuchbetterifyouadd-U__STDC__tothedefs.ThisisbecausealltheSCOheaderfilesarebroken.Anythingthatisn'tmentionedintheCstandardisconditionallyexcludedwhen__STDC__isdefined.

    2)DuetotheU.S.exportrestrictions,SCObrokethecryptstuffoutintoaseparatelibrary,libcrypt_i.asotheLIBSneededbesetto:

    LIBS='-lsocket-lcrypt_i'

    UnixWare:Thereareknownbugsinthemathlibraryofthesystem,aswellasproblemsinthehandlingofthreads(callingforkinonethreadmayinterruptsystemcallsinothers).Therefore,test_mathandtestsinvolvingthreadswillfailuntilthoseproblemsarefixed.

    SunOS4.x:WhenusingtheSunProCcompiler,youmaywanttousethe'-Xa'optioninsteadof'-Xc',toenablesomeneedednon-ANSISunisms.THISSYSTEMISNOLONGERSUPPORTED.

    NeXT:Notsupportedanymore.StartwiththeMacOSX/Darwincodeifyouwanttoreviveit.

    QNX: ChrisHerborth([email protected])writes:configureworksbestifyouuseGNUbash;aportisavailableonftp.qnx.comin/usr/free.Iusedthefollowingprocesstobuild,testandinstallPython1.5.xunderQNX:

    1)CONFIG_SHELL=/usr/local/bin/bashCC=ccRANLIB=:\./configure--verbose--without-gcc--with-libm=""

    2)editModules/Setuptoactivateeverythingthatmakessenseforyoursystem...testedhereatQNXwiththefollowingmodules:

    array,audioop,binascii,cPickle,cStringIO,cmath,crypt,curses,errno,fcntl,gdbm,grp,imageop,

    _locale,math,md5,new,operator,parser,pcre,posix,pwd,readline,regex,reop,rgbimg,rotor,select,signal,socket,soundex,strop,struct,syslog,termios,time,timing,zlib,audioop,imageop,rgbimg

    3)makeSHELL=/usr/local/bin/bash

    or,ifyoufeeltheneedforspeed:

    makeSHELL=/usr/local/bin/bashOPT="-5-Oil+nrt"

    4)makeSHELL=/usr/local/bin/bashtest

    UsingGNUreadline2.2seemstobehavestrangely,butI

  • 7/29/2019 Python Read-Me File

    9/21

    thinkthat'saproblemwithmyreadline2.2port.:-\

    5)makeSHELL=/usr/local/bin/bashinstall

    IfyougetSIGSEGVswhilerunningPython(Ihaven'tyet,butI'veonlyrunsmallprogramsandthetestcases),you'reprobablyrunningoutofstack;thedefault32kcouldbealittletight.Toincreasethestacksize,edittheMakefiletoread:LDFLAGS=-N48k

    BeOS: SeeMisc/BeOS-NOTESfornotesaboutcompiling/installingPythononBeOSR3orlater.NotethatonlythePowerPCplatformissupportedforR3;bothPowerPCandx86aresupportedforR4.

    CrayT3E:MarkHadfield([email protected])writes:PythoncanbebuiltsatisfactorilyonaCrayT3EbutbasedonmyexperiencewiththeNIWAT3E(2002-05-22,version2.2.1)thereareafewbugsandgotchas.Formoreinformationseeathreadoncomp.lang.pythoninMay2002entitled"BuildingPythononCrayT3E".

    1)UseCray'sccandnotgcc.ThelatterwasreportednottoworkbyKonradHinsen.Itmayworknow,butitmaynot.

    2)Tosetsys.platformtosomethingsensible,passthefollowingenvironmentvariabletotheconfigurescript:

    MACHDEP=unicosmk

    2)Runconfigurewithoption"--enable-unicode=ucs4".

    3)TheCrayT3Edoesnotsupportdynamiclinking,soextensionmoduleshavetobebuiltbyadding(oruncommenting)linesinModules/Setup.Theminimumsetofmodulesis

    posix,new,_sre,unicodedata

    OnNIWA'svanillaT3Esystemthefollowinghavealsobeenincludedsuccessfully:

    _codecs,_locale,_socket,_symtable,_testcapi,_weakrefarray,binascii,cmath,cPickle,crypt,cStringIO,dbmerrno,fcntl,grp,math,md5,operator,parser,pcre,pwdregex,rotor,select,struct,strop,syslog,termiostime,timing,xreadlines

    4)Oncethepythonexecutableandlibraryhavebeenbuilt,makewillexecutesetup.py,whichwillattempttobuildremainingextensionsandlinkthemdynamically.Eachoftheseattempts

    willfailbutshouldnothaltthemakeprocess.Thisisnormal.

    5)Running"maketest"usesalotofresourcesandcausesproblemsonoursystem.Youmightwanttotryrunningtestssinglyorinsmallgroups.

    SGI: SGI'sstandard"make"utility(/bin/makeor/usr/bin/make)doesnotcheckwhetheracommandactuallychangedthefileitissupposedtobuild.Thismeansthatwheneveryousay"make"

  • 7/29/2019 Python Read-Me File

    10/21

    itwillredothelinkstep.TheremedyistouseSGI'smuchsmarter"smake"utility(/usr/sbin/smake),orGNUmake.IfyousetthefirstlineoftheMakefileto#!/usr/sbin/smakesmakewillbeinvokedbymake(likewiseforGNUmake).

    WARNING:TherearebugsintheoptimizerofsomeversionsofSGI'scompilersthatcancausebuserrorsorotherstrangebehavior,especiallyonnumericaloperations.Toavoidthis,trybuildingwith"makeOPT=".

    OS/2:IfyouarerunningWarp3orWarp4andhaveIBM'sVisualAgeC/C++compilerinstalled,justchangeintothepc\os2vacppdirectoryandtypeNMAKE.ThreadingandsocketsaresupportedbydefaultintheresultingbinariesofPYTHON15.DLLandPYTHON.EXE.

    Monterey(64-bitAIX):ThecurrentMontereyCcompiler(VisualAge)usestheOBJECT_MODE={32|64}environmentvariabletosetthecompilationmodetoeither32-bitor64-bit(32-bitmodeisthedefault).Presumablyyouwant64-bitcompilationmodeforthis64-bitOS.AsaresultyoumustfirstsetOBJECT_MODE=64inyourenvironmentbeforeconfiguring(./configure)orbuilding(make)PythononMonterey.

    ReliantUNIX:ThethreadsupportdoesnotcompileonReliantUNIX,and

    thereisa(minor)problemintheconfigurescriptforthatplatformaswell.Thisshouldberesolvedintimeforafuturerelease.

    MacOSX:Thetestswillcrashonboth10.1and10.2withSEGVintest_reandtest_sreduetothesmalldefaultstacksize.Ifyousetthestacksizeto2048beforedoinga"maketest"thefailurecanbeavoided.Ifyou'reusingthetcsh(thedefaultonOSX),orcshshellsuse"limitstacksize2048"andforthebashshell,use"ulimit-s2048".

    OnnakedDarwinyoumaywanttoaddtheconfigureoption"--disable-toolbox-glue"todisablethegluecodefortheCarbon

    interfacemodules.Themodulesthemselvesarecurrentlyonlybuiltifyouaddthe--enable-frameworkoption,seebelow.

    OnacleanOSX/usr/localdoesnotexist.Doa"sudomkdir-m775/usr/local"beforeyoudoamakeinstall.Itisprobablynotagoodideatodo"sudomakeinstall"whichinstallseverythingassuperuser,asthismaylatercauseproblemswheninstallingdistutils-basedadditions.SomepeoplehavereportedproblemsbuildingPythonafterusing"fink"toinstalladditionalunixsoftware.Disablingfink(removeallreferences

    to/swfromyour.profileor.login)shouldsolvethis.

    Youmaywanttotrytheconfigureoption"--enable-framework"whichinstallsPythonasaframework.Thelocationcanbesetasargumenttothe--enable-frameworkoption(default/Library/Frameworks).AframeworkinstallisprobablyneededifyouwanttouseanyAqua-basedGUItoolkit(whetherTkinter,wxPython,Carbon,Cocoaoranythingelse).

    Youmayalsowanttotrytheconfigureoption"--enable-universalsdk"

  • 7/29/2019 Python Read-Me File

    11/21

    whichbuildsPythonasauniversalbinarywithsupportforthei386andPPCarchitetures.ThisrequiresXcode2.1orlatertobuild.

    SeeMac/OSX/READMEformoreinformationonframeworkbuilds.

    Cygwin:Withrecent(relativetothetimeofwriting,2001-12-19)Cygwininstallations,thereareproblemswiththeinteractionofdynamiclinkingandfork().Thismanifestsitselfinbuildfailuresduringtheexecutionofsetup.py.

    TherearetwoworkaroundsthatbothenablePython(albeitwithoutthreadingsupport)tobuildandpassalltestsonNT/2000(andmostlikelyXPaswell,thoughreportsoftestingonXPwouldbeappreciated).

    Theworkarounds:

    (a)theband-aidfixistolinkthe_socketmodulestaticallyratherthandynamically(whichisthedefault).

    Todothis,run"./configure--with-threads=no"includinganyotheroptionsyouneed(--prefix,etc.).TheninModules/Setupuncommentthelines:

    #SSL=/usr/local/ssl#_socketsocketmodule.c\# -DUSE_SSL-I$(SSL)/include-I$(SSL)/include/openssl\# -L$(SSL)/lib-lssl-lcrypto

    andremove"local/"fromtheSSLvariable.Finally,justrun"make"!

    (b)The"proper"fixistorebasetheCygwinDLLstopreventbaseaddressconflicts.Detailsonhowtodothiscanbefoundinthefollowingmail:

    http://sources.redhat.com/ml/cygwin/2001-12/msg00894.html

    ItishopedthataversionofthissolutionwillbeincorporatedintotheCygwindistributionfairlysoon.

    Twoadditionalproblems:

    (1)ThreadingsupportshouldstillbedisabledduetoaknownbuginCygwinpthreadsthatcausestest_threadedtempfiletohang.

    (2)The_cursesmoduledoesnotbuild.ThisisaknownCygwinncursesproblemthatshouldberesolvedthenexttimethatthispackageisreleased.

    OnolderversionsofCygwin,test_pollmayhangandtest_strftimemayfail.

    Thesituationon9X/Meisnotaccuratelyknownatpresent.Sometimeago,therewerereportsthatthefollowingregressiontestsfailed:

    test_pwdtest_select(hang)

  • 7/29/2019 Python Read-Me File

    12/21

    test_socket

    Duetothetest_selecthangon9X/Me,oneshouldruntheregressiontestusingthefollowing:

    makeTESTOPTS='-l-xtest_select'test

    NewsregardingtheseplatformswithmorerecentCygwinversionswouldbeappreciated!

    AtheOS:FromOctavianCerna:

    Beforebuilding:

    MakesureyouhavesharedversionsofthelibrariesyouwanttousewithPython.Youwillhavetocompilethemyourself,ordownloadprecompiledpackages.

    Recommendedlibraries:

    ncurses-4.2readline-4.2azlib-1.1.4

    Build:

    $./configure--prefix=/usr/python$make

    Pythonisalwaysbuiltasasharedlibrary,otherwisedynamicloadingwouldnotwork.

    Testing:

    $maketest

    Install:

    #makeinstall#pkgmanager-a/usr/python

    AtheOSissues:

    -largefilesupport:duetoastdiobuginglibc/libio,accesstolargefilesmaynotworkcorrectly.fseeko()triestoseektoanegativeoffset.ftello()returnsanegativeoffset,itlookslikea32->64bitsign-extensionissue.Thelowlevelfunctions(open,lseek,etc)areOK.

    -sockets:AF_UNIXisdefinedintheClibraryandinPython,butnotimplementedinthesystem.-select:pollisavailableintheClibrary,butdoesnotwork(ItdoesnotreturnPOLLNVALforbadfdsandhangs).-posix:statvfsandfstatvfsalwaysreturnENOSYS.-disabledmodules:

    -mmap:notyetimplementedinAtheOS-nis:broken(onanunconfiguredsystemyp_get_default_domain()returnsjunkinsteadof

  • 7/29/2019 Python Read-Me File

    13/21

    error)-dl:dynamicloadingdoesn'tworkviadlopen()-resource:getrimitandsetrlimitarenotyetimplemented

    -ifyouaregettingsegmentationfaults,youprobablyarelowonmemory.AtheOSdoesn'thandleverywellanout-of-memoryconditionandsimplySEGVstheprocess.

    Testedon:

    AtheOS-0.3.7gcc-2.95binutils-2.10make-3.78

    Configuringthebsddbanddbmmodules-------------------------------------

    BeginningwithPythonversion2.3,thePyBsddbpackagewasadoptedintoPythonasthebsddbpackage,exposingasetofpackage-levelfunctionswhichprovidebackwards-compatiblebehavior.Onlyversions3.1through4.1of

    Sleepycat'slibrariesprovidethenecessaryAPI,soolderversionsaren'tsupportedthroughthisinterface.Theoldbsddbmodulehasbeenretainedasbsddb185,thoughitisnotbuiltbydefault.UserswishingtouseitwillhavetotweakModules/Setuptobuildit.ThedbmmodulewillstillbebuiltagainsttheSleepycatlibrariesifotherpreferredalternatives(ndbm,gdbm)arenotfound,thoughversionsoftheSleepycatlibrarypriorto3.1arenotconsidered.

    Configuringthreads-------------------

    AsofPython2.0,threadsareenabledbydefault.Ifyouwishto

    compilewithoutthreads,orifyourthreadsupportisbroken,passthe--with-threads=noswitchtoconfigure.Unfortunately,onsomeplatforms,additionalcompilerand/orlinkeroptionsarerequiredforthreadstoworkproperly.Belowisatableofthoseoptions,collectedbyBillJanssen.Wewouldlovetoautomatethisprocessmore,buttheinformationbelowisnotenoughtowriteapatchfortheconfigure.infile,somanualinterventionisrequired.Ifyoupatchtheconfigure.infileandareconfidentthatthepatchworks,pleasesendinthepatch.(Don'tbotherpatchingtheconfigurescriptitself--itisregeneratedeachtimetheconfigure.infilechanges.)

    Compilerswitchesforthreads.............................

    Thedefinitionof_REENTRANTshouldbeconfiguredautomatically,ifthatdoesnotworkonyoursystem,orif_REENTRANTisdefinedincorrectly,pleasereportthatasabug.

    OS/Compiler/threadsSwitchesforusewiththreads(POSIXisdraft10,DCEisdraft4)compile&link

    SunOS5.{1-5}/{gcc,SunProcc}/solaris-mtSunOS5.5/{gcc,SunProcc}/POSIX(nothing)

  • 7/29/2019 Python Read-Me File

    14/21

    DECOSF/13.x/cc/DCE-threads([email protected])

    DigitalUNIX4.x/cc/DCE-threads([email protected])

    DigitalUNIX4.x/cc/POSIX-pthread([email protected])

    AIX4.1.4/cc_r/d7(nothing)([email protected])

    AIX4.1.4/cc_r4/DCE(nothing)([email protected])

    IRIX6.2/cc/POSIX(nothing)([email protected])

    Linker(ld)librariesandflagsforthreads...........................................

    OS/threadsLibraries/switchesforusewiththreads

    SunOS5.{1-5}/solaris-lthreadSunOS5.5/POSIX-lpthreadDECOSF/13.x/DCE-lpthreads-lmach-lc_r-lc

    ([email protected])DigitalUNIX4.x/DCE-lpthreads-lpthread-lmach-lexc-lc

    ([email protected])DigitalUNIX4.x/POSIX-lpthread-lmach-lexc-lc([email protected])

    AIX4.1.4/{draft7,DCE}(nothing)([email protected])

    IRIX6.2/POSIX-lpthread([email protected])

    Buildingasharedlibpython---------------------------

    StartingwithPython2.3,themajorityoftheinterpretercanbebuilt

    intoasharedlibrary,whichcanthenbeusedbytheinterpreterexecutable,andbyapplicationsembeddingPython.Toenablethisfeature,configurewith--enable-shared.

    Ifyouenablethisfeature,thesameobjectfileswillbeusedtocreateastaticlibrary.Inparticular,thestaticlibrarywillcontainobjectfilesusingposition-independentcode(PIC)onplatformswherePICflagsareneededforthesharedlibrary.

    Configuringadditionalbuilt-inmodules---------------------------------------

    StartingwithPython2.1,thesetup.pyscriptatthetopofthesourcedistributionattemptstodetectwhichmodulescanbebuiltandautomaticallycompilesthem.Autodetectiondoesn'talwayswork,soyoucanstillcustomizetheconfigurationbyeditingtheModules/Setupfile;butthisshouldbeconsideredalastresort.TherestofthissectiononlyappliesifyoudecidetoedittheModules/Setupfile.Youalsoneedthistoenablestaticlinkingofcertainmodules(whichisneededtoenableprofilingonsomesystems).

    ThisfileisinitiallycopiedfromSetup.distbytheconfigurescript;

  • 7/29/2019 Python Read-Me File

    15/21

    ifitdoesnotexistyet,createitbycopyingModules/Setup.distyourself(configurewillneveroverwriteit).NevereditSetup.dist--alwayseditSetuporSetup.local(seebelow).Readthecommentsinthefileforinformationonwhatkindofeditsareallowed.WhenyouhaveeditedSetupintheModulesdirectory,theinterpreterwillautomaticallyberebuiltthenexttimeyourunmake(inthetopleveldirectory).

    ManyusefulmodulescanbebuiltonanyUnixsystem,butsomeoptionalmodulescan'tbereliablyautodetected.Oftenthequickestwaytodeterminewhetheraparticularmoduleworksornotistoseeifitwillbuild:enableitinSetup,thenifyougetcompilationorlinkerrors,disableit--you'reeithermissingsupportorneedtoadjustthecompilationandlinkingparametersforthatmodule.

    OnSGIIRIX,therearemodulesthatinterfacetomanySGIspecificsystemlibraries,e.g.theGLlibraryandtheaudiohardware.Thesemoduleswillnotbebuiltbythesetup.pyscript.

    InadditiontothefileSetup,youcanalsoeditthefileSetup.local.(themakesetupscriptprocessesboth).YoumayfinditmoreconvenienttoeditSetup.localandleaveSetupalone.Then,wheninstallinganewPythonversion,youcancopyyouroldSetup.localfile.

    Settingtheoptimization/debuggingoptions------------------------------------------

    Ifyouwantorneedtochangetheoptimization/debuggingoptionsfortheCcompiler,assigntotheOPTvariableonthetoplevelmakecommand;e.g."makeOPT=-g"willbuildadebuggingversionofPythononmostplatforms.ThedefaultisOPT=-O;avalueforOPTintheenvironmentwhentheconfigurescriptisrunoverridesthisdefault(likewiseforCC;andtheinitialvalueforLIBSisusedasthebasesetoflibrariestolinkwith).

    WhencompilingwithGCC,thedefaultvalueofOPTwillalsoincludethe-Walland-Wstrict-prototypesoptions.

    Additionaldebuggingcodetohelpdebugmemorymanagementproblemscanbeenabledbyusingthe--with-pydebugoptiontotheconfigurescript.

    Profiling---------

    IfyouwantCprofilingturnedon,theeasiestwayistorunconfigurewiththeCCenvironmentvariabletothenecessarycompilerinvocation.Forexample,onLinux,thisworksforprofilingusing

    gprof(1):

    CC="gcc-pg"./configure

    NotethatonLinux,gprofapparentlydoesnotworkforsharedlibraries.TheMakefile/Setupmechanismcanbeusedtocompileandlinkmostextensionmodulesstatically.

    Testing

  • 7/29/2019 Python Read-Me File

    16/21

    -------

    Totesttheinterpreter,type"maketest"inthetop-leveldirectory.Thisrunsthetestsettwice(oncewithnocompiledfiles,oncewiththecompiledfilesleftbytheprevioustestrun).Thetestsetproducessomeoutput.Youcangenerallyignorethemessagesaboutskippedtestsduetooptionalfeatureswhichcan'tbeimported.Ifamessageisprintedaboutafailedtestoratracebackorcoredumpisproduced,somethingiswrong.OnsomeLinuxsystems(thosethatarenotyetusingglibc6),test_strftimefailsduetoanon-standardimplementationofstrftime()intheClibrary.Pleaseignorethis,orupgradetoglibcversion6.

    IMPORTANT:Ifthetestsfailandyoudecidetomailabugreport,*don't*includetheoutputof"maketest".Itisuseless.Runthefailingtestmanually,asfollows:

    ./python./Lib/test/test_whatever.py

    (substitutingthetopofthesourcetreefor'.'ifyoubuiltinadifferentdirectory).Thisrunsthetestinverbosemode.

    Installing

    ----------

    ToinstallthePythonbinary,librarymodules,sharedlibrarymodules(seebelow),includefiles,configurationfiles,andthemanualpage,justtype

    makeinstall

    Thiswillinstallallplatform-independentfilesinsubdirectoriesofthedirectorygivenwiththe--prefixoptiontoconfigureortothe`prefix'Makevariable(default/usr/local).Allbinaryandotherplatform-specificfileswillbeinstalledinsubdirectoriesifthedirectorygivenby--exec-prefixorthe`exec_prefix'Makevariable

    (defaultstothe--prefixdirectory)isgiven.

    IfDESTDIRisset,itwillbetakenastherootdirectoryoftheinstallation,andfileswillbeinstalledinto$(DESTDIR)$(prefix),$(DESTDIR)$(exec_prefix),etc.

    AllsubdirectoriescreatedwillhavePython'sversionnumberintheirname,e.g.thelibrarymodulesareinstalledin"/usr/local/lib/python/"bydefault,whereisthe.releasenumber(e.g."2.1").ThePythonbinaryisinstalledas"python"andahardlinknamed"python"iscreated.Theonlyfilenotinstalledwithaversionnumberinitsnameisthemanualpage,installedas"/usr/local/man/man1/python.1"

    bydefault.

    IfyouhaveapreviousinstallationofPythonthatyoudon'twanttoreplaceyet,use

    makealtinstall

    Thisinstallsthesamesetoffilesas"makeinstall"exceptitdoesn'tcreatethehardlinkto"python"named"python"anditdoesn'tinstallthemanualpageatall.

  • 7/29/2019 Python Read-Me File

    17/21

    TheonlythingyoumayhavetoinstallmanuallyisthePythonmodeforEmacsfoundinMisc/python-mode.el.(Butthenagain,morerecentversionsofEmacsmayalreadyhaveit.)FollowtheinstructionsthatcamewithEmacsforinstallationofsite-specificfiles.

    OnMacOSX,ifyouhaveconfiguredPythonwith--enable-framework,youshoulduse"makeframeworkinstall"todotheinstallation.NotethatthisinstallsthePythonexecutableinaplacethatisnotnormallyonyourPATH,youmaywanttosetupasymlinkin/usr/local/bin.

    Configurationoptionsandvariables-----------------------------------

    Somespecialcasesarehandledbypassingoptionstotheconfigurescript.

    WARNING:ifyoureruntheconfigurescriptwithdifferentoptions,youmustrun"makeclean"beforerebuilding.Exceptionstothisrule:afterchanging--prefixor--exec-prefix,allyouneedtodoisremoveModules/getpath.o.

    --with(out)-gcc:Theconfigurescriptusesgcc(theGNUCcompiler)if

    itfindsit.Ifyoudon'twantthis,orifthiscompilerisinstalledbutbrokenonyourplatform,passtheoption--without-gcc.Youcanalsopass"CC=cc"(orwhateverthenameoftheproperCcompileris)intheenvironment,buttheadvantageofusing--without-gccisthatthisoptionisrememberedbytheconfig.statusscriptforits--recheckoption.

    --prefix,--exec-prefix:IfyouwanttoinstallthebinariesandthePythonlibrarysomewhereelsethanin/usr/local/{bin,lib},youcanpasstheoption--prefix=DIRECTORY;theinterpreterbinarywillbeinstalledasDIRECTORY/bin/pythonandthelibraryfilesasDIRECTORY/lib/python/*.Ifyoupass

    --exec-prefix=DIRECTORY(aswell)thisoverridestheinstallationprefixforarchitecture-dependentfiles(liketheinterpreterbinary).Notethat--prefix=DIRECTORYalsoaffectsthedefaultmodulesearchpath(sys.path),whenModules/config.ciscompiled.Passingmaketheoptionprefix=DIRECTORY(and/orexec_prefix=DIRECTORY)overridestheprefixsetatconfigurationtime;thismaybemoreconvenientthanre-runningtheconfigurescriptifyouchangeyourmindabouttheinstallprefix.

    --with-readline:Thisoptionisnolongersupported.GNUreadlineisautomaticallyenabledbysetup.pywhenpresent.

    --with-threads:OnmostUnixsystems,youcannowusemultiplethreads,andsupportforthisisenabledbydefault.Todisablethis,pass--with-threads=no.Ifthelibraryrequiredforthreadslivesinapeculiarplace,youcanuse--with-thread=DIRECTORY.IMPORTANT:run"makeclean"afterchanging(eitherenablingordisabling)thisoption,oryouwillgetlinkerrors!Note:forDECUnixuse--with-dec-threadsinstead.

    --with-sgi-dl:OnSGIIRIX4,dynamicloadingofextensionmodulesis

  • 7/29/2019 Python Read-Me File

    18/21

    supportedbythe"dl"librarybyJackJansen,whichisftp'ablefromftp://ftp.cwi.nl/pub/dynload/dl-1.6.tar.Z.Thisisenabled(afteryou'veftp'edandcompiledthedllibrary)bypassing--with-sgi-dl=DIRECTORYwhereDIRECTORYistheabsolutepathnameofthedllibrary.(Don'tbotheronIRIX5,italreadyhasdynamiclinkingusingSunOSstylesharedlibraries.)THISOPTIONISUNSUPPORTED.

    --with-dl-dld:Dynamicloadingofmodulesisrumoredtobesupportedonsomeothersystems:VAX(Ultrix),Sun3(SunOS3.4),SequentSymmetry(Dynix),andAtariST.ThisisdoneusingacombinationoftheGNUdynamicloadingpackage(ftp://ftp.cwi.nl/pub/dynload/dl-dld-1.1.tar.Z)andanemulationoftheSGIdllibrarymentionedabove(theemulationcanbefoundatftp://ftp.cwi.nl/pub/dynload/dld-3.2.3.tar.Z).Toenablethis,ftpandcompilebothlibraries,thencallconfigure,passingittheoption--with-dl-dld=DL_DIRECTORY,DLD_DIRECTORYwhereDL_DIRECTORYistheabsolutepathnameofthedlemulationlibraryandDLD_DIRECTORYistheabsolutepathnameoftheGNUdldlibrary.(Don'tbotheronSunOS4or5,theyalreadyhavedynamiclinkingusingsharedlibraries.)THISOPTIONISUNSUPPORTED.

    --with-libm,--with-libc:ItispossibletospecifyalternativeversionsfortheMathlibrary(default-lm)andtheClibrary(defaulttheemptystring)usingtheoptions--with-libm=STRINGand--with-libc=STRING,respectively.Forexample,ifyoursystemrequiresthatyoupass-lc_stotheCcompilertousethesharedClibrary,youcanpass--with-libc=-lc_s.Theselibrariesarepassedafterallotherlibraries,theClibrarylast.

    --with-libs='libs':Add'libs'totheLIBSthatthepythoninterpreterislinkedagainst.

    --with-cxx=:SomeC++compilersrequirethatmain()is

    compiledwiththeC++ifthereisanyC++codeintheapplication.Specifically,g++ona.outsystemsmayrequirethattosupportconstructionofglobalobjects.Withthisoption,themain()functionofPythonwillbecompiledwith;usethatonlyifyouplantouseC++extensionmodules,andifyourcompilerrequirescompilationofmain()asaC++program.

    --with-pydebug:Enableadditionaldebuggingcodetohelptrackdownmemorymanagementproblems.Thisallowsprintingalistofallliveobjectswhentheinterpreterterminates.

    --with(out)-universal-newlines:enablereadingoftextfileswith

    foreignnewlineconvention(default:enabled).Inotherwords,anyof\r,\nor\r\nisacceptableasend-of-linecharacter.Ifenabledimportandexecfilewillautomaticallyacceptanynewlineinfiles.Pythoncodecanopenafilewithopen(file,'U')toreaditinuniversalnewlinemode.THISOPTIONISUNSUPPORTED.

    --with-tsc:ProfileusingthePentiumtimestampingcounter(TSC).

    Buildingformultiplearchitectures(usingtheVPATHfeature)-------------------------------------------------------------

  • 7/29/2019 Python Read-Me File

    19/21

    Ifyourfilesystemissharedbetweenmultiplearchitectures,itusuallyisnotnecessarytomakecopiesofthesourcesforeacharchitectureyouwanttosupport.IfthemakeprogramsupportstheVPATHfeature,youcancreateanemptybuilddirectoryforeacharchitecture,andineachdirectoryruntheconfigurescript(ontheappropriatemachinewiththeappropriateoptions).ThiscreatesthenecessarysubdirectoriesandtheMakefilestherein.TheMakefilescontainalineVPATH=...whichpointstoadirectorycontainingtheactualsources.(OnSGIsystems,use"smake-J1"insteadof"make"ifyouuseVPATH--don'ttrygnumake.)

    Forexample,thefollowingisallyouneedtobuildaminimalPythonin/usr/tmp/python(assuming~guido/src/pythonisthetopleveldirectoryandyouwanttobuildin/usr/tmp/python):

    $mkdir/usr/tmp/python$cd/usr/tmp/python$~guido/src/python/configure[...]$make[...]$

    NotethatconfigurecopiestheoriginalSetupfiletothebuilddirectoryifitfindsnoSetupfilethere.ThismeansthatyoucanedittheSetupfileforeacharchitectureindependently.Forthisreason,subsequentchangestotheoriginalSetupfilearenottrackedautomatically,astheymightoverwritelocalchanges.ToforceacopyofachangedoriginalSetupfile,deletethetargetSetupfile.(Themakesetupscriptsupportsmultipleinputfiles,soifyouwanttobefancyyoucanchangetherulestocreateanemptySetup.localifitdoesn'texistandrunitwitharguments$(srcdir)/SetupSetup.local;howeverthisassumesthatyouonlyneedtoaddmodules.)

    Buildingonnon-UNIXsystems

    ----------------------------

    ForWindows(2000/NT/ME/98/95),assumingyouhaveMSVC++7.1,theprojectfilesareinPCbuild,theworkspaceispcbuild.dsw.SeePCbuild\readme.txtfordetailedinstructions.

    Forothernon-UnixWindowscompilers,inparticularMSVC++6.0andforOS/2,enterthedirectory"PC"andreadthefile"readme.txt".

    FortheMac,aseparatesourcedistributionwillbemadeavailable,forusewiththeCodeWarriorcompiler.IfyouareinterestedinMacdevelopment,jointhePythonMacSpecialInterestGroup(http://www.python.org/sigs/pythonmac-sig/,orsendemailto

    [email protected]).

    Ofcourse,therearealsobinarydistributionsavailablefortheseplatforms--seehttp://www.python.org/.

    ToportPythontoanewnon-UNIXsystem,youwillhavetofaketheeffectofrunningtheconfigurescriptmanually(forMacandPC,thishasalreadybeendoneforyou).Agoodstartistocopythefilepyconfig.h.intopyconfig.handeditthelattertoreflecttheactualconfigurationofyoursystem.Mostsymbolsmustsimplybedefinedas

  • 7/29/2019 Python Read-Me File

    20/21

    1onlyifthecorrespondingfeatureispresentandcanbeleftaloneotherwise;howeverthe*_ttypesymbolsmustbedefinedassomevariantofintiftheyneedtobedefinedatall.

    Forallplatforms,it'simportantthatthebuildarrangetodefinethepreprocessorsymbolNDEBUGonthecompilercommandlineinareleasebuildofPython(elseassert()callsremaininthecode,hurtingrelease-buildperformance).TheUnix,WindowsandMacbuildsalreadydothis.

    Miscellaneousissues====================

    Emacsmode----------

    There'sanexcellentEmacseditingmodeforPythoncode;seethefileMisc/python-mode.el.OriginallywrittenbythefamousTimPeters,itisnowmaintainedbytheequallyfamousBarryWarsaw(it'snocoincidencethattheynowbothworkonthesameteam).Thelatestversion,alongwithvariousothercontributedPython-relatedEmacsgoodies,isonlineathttp://www.python.org/emacs/python-mode.AndifyouareplanningtoeditthePythonCcode,pleasepickupthe

    latestversionofCCModehttp://www.python.org/emacs/cc-mode;itcontainsa"python"styleusedthroughoutmostofthePythonCsourcefiles.(NewerversionsofEmacsorXEmacsmayalreadycomewiththelatestversionofpython-mode.)

    Tkinter-------

    Thesetup.pyscriptautomaticallyconfiguresthiswhenitdetectsausableTcl/Tkinstallation.ThisrequiresTcl/Tkversion8.0orhigher.

    FormoreTkinterinformation,seetheTkinterResourcepage:http://www.python.org/topics/tkinter/

    TherearedemosintheDemo/tkinterdirectory,inthesubdirectoriesguido,mattandwww(themattandguidosubdirectorieshavebeenoverhauledtousemorerecentTkintercodingconventions).

    Notethatthere'saPythonmodulecalled"Tkinter"(capitalT)whichlivesinLib/lib-tk/Tkinter.py,andaCmodulecalled"_tkinter"(lowercasetandleadingunderscore)whichlivesinModules/_tkinter.c.DemosandnormalTkapplicationsimportonlythePythonTkintermodule--onlythelatterimportstheC_tkintermodule.InordertofindtheC_tkintermodule,itmustbecompiled

    andlinkedintothePythoninterpreter--thesetup.pyscriptdoesthis.InordertofindthePythonTkintermodule,sys.pathmustbesetcorrectly--normalinstallationtakescareofthis.

    Distributionstructure----------------------

    MostsubdirectorieshavetheirownREADMEfiles.Mostfileshavecomments.

  • 7/29/2019 Python Read-Me File

    21/21

    .cvsignore AdditionalfilenamematchingpatternsforCVStoignoreBeOS/ FilesspecifictotheBeOSportDemo/Demonstrationscripts,modulesandprogramsDoc/ Documentationsources(LaTeX)Grammar/InputfortheparsergeneratorInclude/PublicheaderfilesLICENSE LicensinginformationLib/PythonlibrarymodulesMac/MacintoshspecificresourcesMakefile.pre.inSourcefromwhichconfig.statuscreatestheMakefile.preMisc/MiscellaneoususefulfilesModules/Implementationofmostbuilt-inmodulesObjects/Implementationofmostbuilt-inobjecttypesPC/FilesspecifictoPCports(DOS,Windows,OS/2)PCbuild/ BuilddirectoryforMicrosoftVisualC++Parser/TheparserandtokenizerandtheirinputhandlingPython/Thebyte-compilerandinterpreterREADMEThefileyou'rereadingnowTools/SomeusefulprogramswritteninPythonpyconfig.h.inSourcefromwhichpyconfig.hiscreated(GNUautoheaderoutput)configureConfigurationshellscript(GNUautoconfoutput)configure.inConfigurationspecification(inputforGNUautoconf)install-shShellscriptusedtoinstallfiles

    Thefollowingfileswill(may)becreatedinthetopleveldirectorybytheconfigurationandbuildprocesses:

    MakefileBuildrulesMakefile.preBuildrulesbeforerunningModules/makesetupbuildnoKeepstrackofthebuildnumberconfig.cacheCacheofconfigurationvariablespyconfig.hConfigurationheaderconfig.logLogfromlastconfigurerunconfig.statusStatusfromlastrunoftheconfigurescriptgetbuildinfo.o ObjectfilefromModules/getbuildinfo.clibpython.a Thelibraryarchive

    pythonTheexecutableinterpretertags,TAGSTagsfilesforviandEmacs

    That'sall,folks!------------------

    --GuidovanRossum(homepage:http://www.python.org/~guido/)