>There's one issue I have but that is (I think) related to my 
>python built:
>
>dbmcli on TTT>load_systab -ud domain
>ERR
>-24964,ERR_EXECUTE: error in program execution
>256,/home/sapdb/maxdb-76/usr/bin/x_python
>/home/sapdb/maxdb-76/usr/env/lsystab.py -R /home/sapdb/maxdb-76/u
>sr -d TTT -u superdba,*
>'import site' failed; use -v for traceback
>Traceback (most recent call last):
>  File "/home/sapdb/maxdb-76/usr/env/lsystab.py", line 46, in ?
>    from installib import *
>  File "/home/sapdb/maxdb-76/usr/env/installib.py", line 29, in ?
>    import string
>zipimport.ZipImportError: can't decompress data; zlib not available

7.6 uses a more complete Python, so building the python executable takes some 
more effort. I tried to create 8ea shell script to automate this, but it isn't 
yet foolproof.

The important parts are in the following two functions:
#
# build Python required to load system tables
#   64bit if machine supports it
#   add required modules like zlib and expat to executable (patchPythonSetup
#
function buildForDistrib {
    # build additional libraries
    quickBuild $expatBuild $expatArchive
    quickBuild $zlibBuild $zlibArchive
    # remove shared objects to force static linking
    find $expatBuild $zlibBuild -name "*.so" -print | xargs rm 2>/dev/null
    # build python
    unpack $pythonBuild $pythonArchive
    (
        cd $pythonBuild
        if [ ! -r Makefile ]
        then
            execute ./configure
        fi
        patchPythonSetup
        execute make Makefile
        execute make python
    )
}

#
# uncomment required modules from Setup
#     to include them in the executable
#     instead of having them as loadable extensions
# add path for expat and zlib
# add module _random
#
function patchPythonSetup {
    zlibInclude=$buildRoot/$zlibBuild
    zlibLib=$buildRoot/$zlibBuild
    expatInclude=$buildRoot/$expatBuild/lib
    expatLib=$buildRoot/$expatBuild/.libs
    # TODO: detect directories for header and libs using find and dirname
    if [ ! -r $tmpDir/Setup.org ]
    then
        execute cp Modules/Setup $tmpDir/Setup.org
    fi
    cat > $tmpDir/Setup.sed <<EOF
/^#array/s/^#//
/^#math/s/^#//
/^#atruct/s/^#//
/^#time/s/^#//
/^#operator/s/^#//
/^#_weakref/s/^#//
/^#fcntl/s/^#//
/^#pwd/s/^#//
/^#select/s/^#//
/^#mmap/s/^#//
/^#xreadlines/s/^#//
/^#_csv/s/^#//
/^#_socket/s/^#//
/^#md5/s/^#//
/^#sha/s/^#//
/^#binascii/s/^#//
/^#cStringIO/s/^#//
/^#cPickle/s/^#//
/^#zlib/s'.*'zlib zlibmodule.c -I$zlibInclude -L$zlibLib -lz'
/^#pyexpat/s'.*'pyexpat pyexpat.c -DHAVE_EXPAT_H -I$expatInclude -L$expatLib 
-lexpat'
EOF
    sed -f $tmpDir/Setup.sed $tmpDir/Setup.org > Modules/Setup
    echo _random _randommodule.c >> Modules/Setup
}

$zlibArchive and $expatArchive point to source tarballs of the zlib and expat 
projects
quickbuild: does gunzip + tar x + configure + make
pathPythonSetup: changes the file Python-2.*.*/Module/Setup so that several of 
the standard modules are linked into the python executable (instead of being in 
separed shared objects), this make it easier to keep the distribution lists 
current.

Really import for the installation are zlib and _random, pyexpat and _socket 
are also used for some of the regression tests. Everything else is there to 
make the python distribution more useful, but isn't really required.

-- 
Daniel Dittmar
SAP Labs Berlin
[EMAIL PROTECTED] 

--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to