home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / OPENSTEP / Languages / Python / python-14-src / Misc / AIX-NOTES < prev    next >
Encoding:
Internet Message Format  |  1997-01-17  |  8.2 KB

  1. Subject: AIX-NOTES FOR 1.4
  2. From: Manus Hand <Manus.Hand@evolving.com>
  3. To: Guido van Rossum <guido@CNRI.Reston.VA.US>
  4. Date: Tue, 22 Oct 1996 16:02:07 -0600 (MDT)
  5.  
  6. ==============================================================================
  7.                               COMPILER INFORMATION
  8. ------------------------------------------------------------------------------
  9.  
  10. (1) A problem has been reported with "make test" failing because of "weird
  11.     indentation."  Searching the comp.lang.python newsgroup reveals several
  12.     threads on this subject, and it seems to be a compiler bug in an old
  13.     version of the AIX CC compiler.  However, the compiler/OS combination
  14.     which has this problem is not identified.  In preparation for the 1.4
  15.     release, Vladimir Marangozov (Vladimir.Marangozov@imag.fr) and Manus Hand
  16.     (mhand@csn.net) reported no such troubles for the following compilers and
  17.     operating system versions:
  18.        AIX C compiler version 3.1.2 on AIX 4.1.3 and AIX 4.1.4
  19.        AIX C compiler version 1.3.0 on AIX 3.2.5
  20.     If you have this problem, please report the compiler/OS version.
  21.  
  22. (2) Stefan Esser (se@MI.Uni-Koeln.DE), in work done to compile Python
  23.     1.0.0 on AIX 3.2.4, reports that AIX compilers don't like the LANG
  24.     environment varaiable set to European locales.  This makes the compiler
  25.     generate floating point constants using "," as the decimal seperator,
  26.     which the assembler doesn't understand (or perhaps it is the other way
  27.     around, with the assembler expecting, but not getting "," in float
  28.     numbers).  "LANG=C; export LANG" solves the problem, as does
  29.     "LANG=C $(MAKE) ..." in the master Makefile.
  30.  
  31. (3) The cc (or xlc) compiler considers "Python/ceval.c" too complex to
  32.     optimize, except when invoked with "-qmaxmem=4000"
  33.  
  34. (4) Some problems (due to _AIX not being #defined) when python 1.0.0 was
  35.     compiled using 'gcc -ansi' were reported by Stefan Esser, but were not
  36.     investigated.
  37.  
  38. (5) The cc compiler has internal variables named "__abs" and "__div".  These
  39.     names are reserved and may not be used as program variables in compiled
  40.     source.  (As an anecdote in support of this, the implementation of
  41.     Python/operator.c had this problem in the 1.4 beta releases, and the
  42.     solution was to re#define some core-source variables having these names,
  43.     to give these python variables different names if the build is being done
  44.     on AIX.)
  45.  
  46. (6) As mentioned in the README, builds done immediately after previous builds
  47.     (without "make clean" or "make clobber") sometimes fail for mysterious
  48.     reasons.  There are some unpredictable results when the configuration
  49.     is changed (that is, if you "configure" with different parameters) or if
  50.     intermediate changes are made to some files.  Performing "make clean" or
  51.     "make clobber" resolves the problems.
  52.  
  53. ==============================================================================
  54.                                 THREAD SUPPORT
  55. ------------------------------------------------------------------------------
  56.  
  57. AIX uses pthreads.  However, as of AIX version 4, there are two (incompatible)
  58. types of pthreads on AIX:
  59.         a)  AIX DCE pthreads (on AIX 3.2.5)
  60.         b)  AIX 4 pthreads (on AIX 4.1 and up)
  61. Support has been added to Python to handle the distinction.
  62.  
  63. The cc and gcc compilers do not initialize pthreads properly. The only
  64. compilers that can initialize pthreads properly are IBM *_r* compilers,
  65. which use the crt0_r.o module, and which invoke ld with the reentrant
  66. version of libc (libc_r).
  67.  
  68. In order to enable thread support, follow these steps:
  69.    1.  Uncomment the thread module in Modules/Setup
  70.    2.  configure --without-gcc --with-thread ...
  71.    3.  make CC="cc_r" OPT="-O -qmaxmem=4000"
  72.  
  73. For example, to make with both threads and readline, use:
  74.   ./configure --without-gcc --with-thread --with-readline=/usr/local/lib
  75.   make CC=cc_r OPT="-O2 -qmaxmem=4000"
  76.  
  77. If the "make" which is used ignores the "CC=cc_r" directive, one could alias
  78. the cc command to cc_r (for example, in C-shell, perform an "alias cc cc_r").
  79.  
  80. Vladimir Marangozov (Vladimir.Marangozov@imag.fr) provided this information,
  81. and he reports that a cc_r build initializes threads properly and that all
  82. demos on threads run okay with cc_r.
  83.  
  84. ==============================================================================
  85.                             SHARED LIBRARY SUPPORT
  86. ------------------------------------------------------------------------------
  87.  
  88. AIX shared library support was added to Python in the 1.4 release by Manus
  89. Hand (mhand@csn.net) and Vladimir Marangozov (Vladimir.Marangozov@imag.fr).
  90.  
  91. Python modules may now be built as shared libraries on AIX using the normal
  92. process of uncommenting the "*noconfig*" line in Modules/Setup.in before the
  93. build.  There is one additional step required, and that is to also uncomment
  94. the line in Modules/Setup.in which reads
  95.     LINKCC= makexp_aix python.exp "" $(MYLIBS) $(ADDOBJS) ; $(CC)
  96.  
  97. AIX shared libraries require that an "export" and "import" file be provided
  98. at compile time to list all extern symbols which may be shared between
  99. modules.  The effect of uncommenting the LINKCC line in Modules/Setup.in is
  100. to create the "export" file for the modules and the libraries that belong to
  101. the Python core.  This is done by the "makexp_aix" script, which creates a
  102. file named python.exp before performing the link of the python binary.
  103.  
  104. When shared library modules (.so files) are made, a second shell script
  105. is invoked.  This script is named "ld_so_aix" and is also provided with
  106. the distribution in the Modules subdirectory.  This script acts as an "ld"
  107. wrapper which hides the explicit management of "export" and "import" files;
  108. it adds the appropriate arguments (in the appropriate order) to the link
  109. command that creates the shared module.  Among other things, it specifies
  110. that the "python.exp" file is an "import" file for the shared module.
  111.  
  112. A default python.exp file is provided with the distribution.  It will be
  113. overwritten (by the action of the makexp_aix script) if you build with shared
  114. libraries.  The python.exp file which comes with the distribution contains
  115. all extern symbols of a completely statically built python executable.
  116. Any python.exp file which is created from a build of python with some of the
  117. modules linked as shared modules will obviously not list symbols from the now
  118. dynamic modules.  The distributed python.exp is provided so that, with
  119. assistance from the ld_so_aix and makexp_aix scripts, shared extension
  120. modules may be added to an otherwise completely static python build.
  121.  
  122. At the time of this writing, neither the python.exp file nor the makexp_aix
  123. or ld_so_aix scripts are installed by the make procedure, so you should
  124. remember to keep these and/or copy them to a different location for
  125. safekeeping if you wish to use them to add shared extension modules to
  126. python.  However, if the make process has been updated since this writing,
  127. these files MAY have been installed for you during the make by the
  128. LIBAINSTALL rule, in which case the need to make safe copies is obviated.
  129.  
  130. If you wish to add a shared extension module to the language, you would follow
  131. the steps given in the example below (the example adds the shared extension
  132. module "spam" to python):
  133.     1.  Make sure that "ld_so_aix" and "makexp_aix" are in your path.
  134.     2.  The "python.exp" file should be in the current directory.
  135.     3.  Issue the following commands or include them in your Makefile:
  136.             cc -c spammodule.c
  137.             ld_so_aix cc spammodule.o -o spammodule.so
  138.  
  139. For more detailed information on the shared library support, examine the
  140. contents of the "ld_so_aix" and "makexp_aix" scripts or refer to the AIX
  141. documentation.
  142.  
  143. NOTE:  If the extension module is written in C++ and contains templates,
  144.        an alternative to "ld_so_aix" is the /usr/lpp/xlC/bin/makeC++SharedLib
  145.        script.  Chris Myers (myers@TC.Cornell.EDU) reports that ld_so_aix
  146.        works well for some C++ (including the C++ that is generated
  147.        automatically by the Python SWIG package [SWIG can be found at
  148.        http://www.cs.utah.edu/~beazley/SWIG/swig.html]).  However, it is not
  149.        known whether makeC++SharedLib can be used as a complete substitute
  150.        for ld_so_aix.
  151.  
  152. ==============================================================================
  153.